@alannxd/baileys 6.0.6 → 6.0.9

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 (220) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +341 -286
  3. package/WAProto/GenerateStatics.sh +3 -0
  4. package/WAProto/WAProto.proto +6902 -0
  5. package/WAProto/fix-imports.js +85 -0
  6. package/WAProto/index.d.ts +79257 -0
  7. package/WAProto/index.js +205861 -60565
  8. package/engine-requirements.js +1 -1
  9. package/lib/Defaults/index.js +119 -136
  10. package/lib/Signal/Group/ciphertext-message.js +2 -5
  11. package/lib/Signal/Group/group-session-builder.js +7 -41
  12. package/lib/Signal/Group/group_cipher.js +37 -51
  13. package/lib/Signal/Group/index.js +12 -57
  14. package/lib/Signal/Group/keyhelper.js +7 -44
  15. package/lib/Signal/Group/sender-chain-key.js +7 -15
  16. package/lib/Signal/Group/sender-key-distribution-message.js +8 -11
  17. package/lib/Signal/Group/sender-key-message.js +9 -12
  18. package/lib/Signal/Group/sender-key-name.js +2 -5
  19. package/lib/Signal/Group/sender-key-record.js +9 -21
  20. package/lib/Signal/Group/sender-key-state.js +27 -42
  21. package/lib/Signal/Group/sender-message-key.js +4 -7
  22. package/lib/Signal/libsignal.js +347 -90
  23. package/lib/Signal/lid-mapping.js +277 -0
  24. package/lib/Socket/Client/index.js +3 -19
  25. package/lib/Socket/Client/types.js +11 -0
  26. package/lib/Socket/Client/websocket.js +54 -0
  27. package/lib/Socket/business.js +162 -43
  28. package/lib/Socket/chats.js +627 -427
  29. package/lib/Socket/communities.js +90 -80
  30. package/lib/Socket/groups.js +154 -161
  31. package/lib/Socket/index.js +11 -10
  32. package/lib/Socket/luxu.js +315 -469
  33. package/lib/Socket/messages-recv.js +1421 -615
  34. package/lib/Socket/messages-send.js +1150 -799
  35. package/lib/Socket/mex.js +42 -0
  36. package/lib/Socket/newsletter.js +152 -204
  37. package/lib/Socket/socket.js +544 -313
  38. package/lib/Store/index.js +10 -10
  39. package/lib/Store/keyed-db.js +108 -0
  40. package/lib/Store/make-cache-manager-store.js +43 -41
  41. package/lib/Store/make-in-memory-store.js +112 -341
  42. package/lib/Store/make-ordered-dictionary.js +14 -20
  43. package/lib/Store/object-repository.js +11 -6
  44. package/lib/Types/Auth.js +2 -2
  45. package/lib/Types/Bussines.js +2 -0
  46. package/lib/Types/Call.js +2 -2
  47. package/lib/Types/Chat.js +8 -4
  48. package/lib/Types/Contact.js +2 -2
  49. package/lib/Types/Events.js +2 -2
  50. package/lib/Types/GroupMetadata.js +2 -2
  51. package/lib/Types/Label.js +3 -5
  52. package/lib/Types/LabelAssociation.js +3 -5
  53. package/lib/Types/Message.js +11 -9
  54. package/lib/Types/Mex.js +37 -0
  55. package/lib/Types/Product.js +2 -2
  56. package/lib/Types/Signal.js +2 -2
  57. package/lib/Types/Socket.js +3 -2
  58. package/lib/Types/State.js +56 -2
  59. package/lib/Types/USync.js +2 -2
  60. package/lib/Types/index.js +15 -31
  61. package/lib/Utils/auth-utils.js +239 -143
  62. package/lib/Utils/browser-utils.js +48 -0
  63. package/lib/Utils/business.js +66 -69
  64. package/lib/Utils/chat-utils.js +396 -253
  65. package/lib/Utils/companion-reg-client-utils.js +35 -0
  66. package/lib/Utils/crypto.js +57 -90
  67. package/lib/Utils/decode-wa-message.js +236 -84
  68. package/lib/Utils/event-buffer.js +185 -77
  69. package/lib/Utils/generics.js +189 -209
  70. package/lib/Utils/history.js +93 -55
  71. package/lib/Utils/identity-change-handler.js +50 -0
  72. package/lib/Utils/index.js +23 -33
  73. package/lib/Utils/link-preview.js +16 -24
  74. package/lib/Utils/logger.js +3 -7
  75. package/lib/Utils/lt-hash.js +3 -46
  76. package/lib/Utils/make-mutex.js +24 -34
  77. package/lib/Utils/message-composer.js +273 -0
  78. package/lib/Utils/message-retry-manager.js +265 -0
  79. package/lib/Utils/messages-media.js +451 -482
  80. package/lib/Utils/messages.js +795 -369
  81. package/lib/Utils/noise-handler.js +145 -99
  82. package/lib/Utils/offline-node-processor.js +40 -0
  83. package/lib/Utils/pre-key-manager.js +106 -0
  84. package/lib/Utils/process-message.js +459 -150
  85. package/lib/Utils/reporting-utils.js +258 -0
  86. package/lib/Utils/signal.js +120 -72
  87. package/lib/Utils/stanza-ack.js +38 -0
  88. package/lib/Utils/sync-action-utils.js +49 -0
  89. package/lib/Utils/tc-token-utils.js +163 -0
  90. package/lib/Utils/use-multi-file-auth-state.js +29 -27
  91. package/lib/Utils/validate-connection.js +73 -99
  92. package/lib/WABinary/constants.js +1281 -20
  93. package/lib/WABinary/decode.js +52 -42
  94. package/lib/WABinary/encode.js +110 -155
  95. package/lib/WABinary/generic-utils.js +55 -49
  96. package/lib/WABinary/index.js +6 -21
  97. package/lib/WABinary/jid-utils.js +76 -40
  98. package/lib/WABinary/types.js +2 -2
  99. package/lib/WAM/BinaryInfo.js +2 -5
  100. package/lib/WAM/constants.js +19071 -11568
  101. package/lib/WAM/encode.js +17 -22
  102. package/lib/WAM/index.js +4 -19
  103. package/lib/WAUSync/Protocols/USyncContactProtocol.js +33 -13
  104. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +11 -14
  105. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +9 -12
  106. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +9 -13
  107. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
  108. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +20 -22
  109. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +13 -8
  110. package/lib/WAUSync/Protocols/index.js +6 -20
  111. package/lib/WAUSync/USyncQuery.js +44 -35
  112. package/lib/WAUSync/USyncUser.js +10 -5
  113. package/lib/WAUSync/index.js +4 -19
  114. package/lib/index.js +13 -36
  115. package/package.json +85 -51
  116. package/WAProto/fix-import.js +0 -29
  117. package/lib/Defaults/baileys-version.json +0 -3
  118. package/lib/Defaults/index.d.ts +0 -53
  119. package/lib/Defaults/phonenumber-mcc.json +0 -223
  120. package/lib/Signal/Group/ciphertext-message.d.ts +0 -9
  121. package/lib/Signal/Group/group-session-builder.d.ts +0 -14
  122. package/lib/Signal/Group/group_cipher.d.ts +0 -17
  123. package/lib/Signal/Group/index.d.ts +0 -11
  124. package/lib/Signal/Group/keyhelper.d.ts +0 -10
  125. package/lib/Signal/Group/queue-job.d.ts +0 -1
  126. package/lib/Signal/Group/queue-job.js +0 -57
  127. package/lib/Signal/Group/sender-chain-key.d.ts +0 -13
  128. package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -16
  129. package/lib/Signal/Group/sender-key-message.d.ts +0 -18
  130. package/lib/Signal/Group/sender-key-name.d.ts +0 -17
  131. package/lib/Signal/Group/sender-key-record.d.ts +0 -30
  132. package/lib/Signal/Group/sender-key-state.d.ts +0 -38
  133. package/lib/Signal/Group/sender-message-key.d.ts +0 -11
  134. package/lib/Signal/libsignal.d.ts +0 -3
  135. package/lib/Socket/Client/abstract-socket-client.d.ts +0 -17
  136. package/lib/Socket/Client/abstract-socket-client.js +0 -13
  137. package/lib/Socket/Client/index.d.ts +0 -3
  138. package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
  139. package/lib/Socket/Client/mobile-socket-client.js +0 -65
  140. package/lib/Socket/Client/web-socket-client.d.ts +0 -12
  141. package/lib/Socket/Client/web-socket-client.js +0 -62
  142. package/lib/Socket/business.d.ts +0 -171
  143. package/lib/Socket/chats.d.ts +0 -267
  144. package/lib/Socket/communities.d.ts +0 -180
  145. package/lib/Socket/groups.d.ts +0 -115
  146. package/lib/Socket/index.d.ts +0 -173
  147. package/lib/Socket/luxu.d.ts +0 -266
  148. package/lib/Socket/messages-recv.d.ts +0 -161
  149. package/lib/Socket/messages-send.d.ts +0 -183
  150. package/lib/Socket/newsletter.d.ts +0 -134
  151. package/lib/Socket/registration.d.ts +0 -267
  152. package/lib/Socket/registration.js +0 -166
  153. package/lib/Socket/socket.d.ts +0 -44
  154. package/lib/Socket/usync.d.ts +0 -36
  155. package/lib/Socket/usync.js +0 -70
  156. package/lib/Store/index.d.ts +0 -3
  157. package/lib/Store/make-cache-manager-store.d.ts +0 -13
  158. package/lib/Store/make-in-memory-store.d.ts +0 -118
  159. package/lib/Store/make-ordered-dictionary.d.ts +0 -13
  160. package/lib/Store/object-repository.d.ts +0 -10
  161. package/lib/Types/Auth.d.ts +0 -110
  162. package/lib/Types/Call.d.ts +0 -13
  163. package/lib/Types/Chat.d.ts +0 -102
  164. package/lib/Types/Contact.d.ts +0 -19
  165. package/lib/Types/Events.d.ts +0 -157
  166. package/lib/Types/GroupMetadata.d.ts +0 -55
  167. package/lib/Types/Label.d.ts +0 -35
  168. package/lib/Types/LabelAssociation.d.ts +0 -29
  169. package/lib/Types/Message.d.ts +0 -273
  170. package/lib/Types/Newsletter.d.ts +0 -103
  171. package/lib/Types/Newsletter.js +0 -38
  172. package/lib/Types/Product.d.ts +0 -78
  173. package/lib/Types/Signal.d.ts +0 -57
  174. package/lib/Types/Socket.d.ts +0 -111
  175. package/lib/Types/State.d.ts +0 -27
  176. package/lib/Types/USync.d.ts +0 -25
  177. package/lib/Types/index.d.ts +0 -57
  178. package/lib/Utils/auth-utils.d.ts +0 -18
  179. package/lib/Utils/baileys-event-stream.d.ts +0 -16
  180. package/lib/Utils/baileys-event-stream.js +0 -63
  181. package/lib/Utils/business.d.ts +0 -22
  182. package/lib/Utils/chat-utils.d.ts +0 -71
  183. package/lib/Utils/crypto.d.ts +0 -41
  184. package/lib/Utils/decode-wa-message.d.ts +0 -19
  185. package/lib/Utils/event-buffer.d.ts +0 -35
  186. package/lib/Utils/generics.d.ts +0 -92
  187. package/lib/Utils/history.d.ts +0 -15
  188. package/lib/Utils/index.d.ts +0 -17
  189. package/lib/Utils/link-preview.d.ts +0 -21
  190. package/lib/Utils/logger.d.ts +0 -4
  191. package/lib/Utils/lt-hash.d.ts +0 -12
  192. package/lib/Utils/make-mutex.d.ts +0 -7
  193. package/lib/Utils/messages-media.d.ts +0 -116
  194. package/lib/Utils/messages.d.ts +0 -77
  195. package/lib/Utils/noise-handler.d.ts +0 -21
  196. package/lib/Utils/process-message.d.ts +0 -41
  197. package/lib/Utils/signal.d.ts +0 -32
  198. package/lib/Utils/use-multi-file-auth-state.d.ts +0 -13
  199. package/lib/Utils/validate-connection.d.ts +0 -11
  200. package/lib/WABinary/constants.d.ts +0 -30
  201. package/lib/WABinary/decode.d.ts +0 -7
  202. package/lib/WABinary/encode.d.ts +0 -3
  203. package/lib/WABinary/generic-utils.d.ts +0 -17
  204. package/lib/WABinary/index.d.ts +0 -5
  205. package/lib/WABinary/jid-utils.d.ts +0 -31
  206. package/lib/WABinary/types.d.ts +0 -18
  207. package/lib/WAM/BinaryInfo.d.ts +0 -17
  208. package/lib/WAM/constants.d.ts +0 -38
  209. package/lib/WAM/encode.d.ts +0 -3
  210. package/lib/WAM/index.d.ts +0 -3
  211. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -9
  212. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -22
  213. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -12
  214. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -12
  215. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -25
  216. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -8
  217. package/lib/WAUSync/Protocols/index.d.ts +0 -4
  218. package/lib/WAUSync/USyncQuery.d.ts +0 -28
  219. package/lib/WAUSync/USyncUser.d.ts +0 -12
  220. package/lib/index.d.ts +0 -12
@@ -1,19 +1,4 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./Protocols"), exports);
18
- __exportStar(require("./USyncQuery"), exports);
19
- __exportStar(require("./USyncUser"), exports);
1
+ export * from './Protocols/index.js';
2
+ export * from './USyncQuery.js';
3
+ export * from './USyncUser.js';
4
+ //# sourceMappingURL=index.js.map
package/lib/index.js CHANGED
@@ -1,7 +1,5 @@
1
- "use strict";
2
-
3
- const chalk = require("chalk");
4
-
1
+ import makeWASocket from './Socket/index.js';
2
+ import chalk from "chalk";
5
3
  console.log(chalk.cyan(`
6
4
  ░█▀█░█░░░█▀█░█▀█░█▀█░█░█░█▀▄
7
5
  ░█▀█░█░░░█▀█░█░█░█░█░▄▀▄░█░█
@@ -20,35 +18,14 @@ fetch('https://raw.githubusercontent.com/alannzxd/xclient/refs/heads/main/inform
20
18
  console.log(chalk.yellow("📁 Information: ") + chalk.white(message));
21
19
  console.log("");
22
20
  });
23
-
24
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
25
- if (k2 === undefined) k2 = k;
26
- var desc = Object.getOwnPropertyDescriptor(m, k);
27
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
28
- desc = { enumerable: true, get: function() { return m[k]; } };
29
- }
30
- Object.defineProperty(o, k2, desc);
31
- }) : (function(o, m, k, k2) {
32
- if (k2 === undefined) k2 = k;
33
- o[k2] = m[k];
34
- }));
35
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
- };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.makeWASocket = void 0;
43
- const Socket_1 = __importDefault(require("./Socket"));
44
- exports.makeWASocket = Socket_1.default;
45
- __exportStar(require("../WAProto"), exports);
46
- __exportStar(require("./Utils"), exports);
47
- __exportStar(require("./Types"), exports);
48
- __exportStar(require("./Store"), exports);
49
- __exportStar(require("./Defaults"), exports);
50
- __exportStar(require("./WABinary"), exports);
51
- __exportStar(require("./WAM"), exports);
52
- __exportStar(require("./WAUSync"), exports);
53
-
54
- exports.default = Socket_1.default;
21
+ export * from '../WAProto/index.js';
22
+ export * from './Utils/index.js';
23
+ export * from './Types/index.js';
24
+ export * from './Defaults/index.js';
25
+ export * from './WABinary/index.js';
26
+ export * from './WAM/index.js';
27
+ export * from './WAUSync/index.js';
28
+ export * from './Store/index.js';
29
+ export { makeWASocket };
30
+ export default makeWASocket;
31
+ //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,15 +1,18 @@
1
1
  {
2
2
  "name": "@alannxd/baileys",
3
- "version": "6.0.6",
4
- "description": "WhatsApp API Modification By AlannXD",
3
+ "type": "module",
4
+ "version": "6.0.9",
5
+ "description": "WhatsApp API Modification",
5
6
  "keywords": [
6
7
  "whatsapp",
8
+ "automation",
7
9
  "baileys",
8
- "whatsapp-web",
9
- "whatsapp-chat",
10
- "whatsapp-group",
10
+ "wa-bot",
11
+ "whatsapp api",
12
+ "whatsapp web",
11
13
  "botwa",
12
- "alannxd"
14
+ "Holow",
15
+ "AlannXD"
13
16
  ],
14
17
  "homepage": "https://www.npmjs.com/package/@alannxd/baileys",
15
18
  "repository": {
@@ -20,8 +23,8 @@
20
23
  "main": "lib/index.js",
21
24
  "types": "lib/index.d.ts",
22
25
  "files": [
23
- "lib/*",
24
- "WAProto/*.js",
26
+ "lib/**/*",
27
+ "WAProto/**/*",
25
28
  "engine-requirements.js"
26
29
  ],
27
30
  "scripts": {
@@ -40,69 +43,100 @@
40
43
  "test": "jest"
41
44
  },
42
45
  "dependencies": {
43
- "@adiwajshing/keyed-db": "^0.2.4",
44
- "@hapi/boom": "^9.1.3",
45
46
  "@cacheable/node-cache": "^1.4.0",
47
+ "@hapi/boom": "^9.1.3",
46
48
  "async-mutex": "^0.5.0",
47
- "audio-decode": "^2.1.3",
48
- "axios": "^1.3.3",
49
- "cache-manager": "4.0.1",
50
- "chalk": "^4.1.2",
51
- "futoin-hkdf": "^1.5.1",
52
- "libphonenumber-js": "^1.10.20",
53
- "lodash": "^4.17.21",
54
49
  "libsignal": "npm:@alannxd/libsignal-node@2.5.0",
55
- "music-metadata": "^7.12.3",
56
- "node-cache": "^5.1.2",
57
- "node-fetch": "^2.6.1",
58
- "pino": "^7.0.0",
59
- "protobufjs": "^7.2.4",
60
- "uuid": "^9.0.0",
61
- "ws": "^8.13.0"
50
+ "lru-cache": "^11.1.0",
51
+ "music-metadata": "^11.12.3",
52
+ "p-queue": "^9.0.0",
53
+ "pino": "^9.6",
54
+ "protobufjs": "^7.5.6",
55
+ "whatsapp-rust-bridge": "0.5.4",
56
+ "ws": "^8.13.0",
57
+ "chalk": "^4.1.2",
58
+ "cache-manager": "^7.2.8"
62
59
  },
63
60
  "devDependencies": {
64
- "@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",
61
+ "@eslint/eslintrc": "^3.3.1",
62
+ "@eslint/js": "^9.31.0",
63
+ "@types/jest": "^30.0.0",
64
+ "@types/node": "^20.9.0",
69
65
  "@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",
66
+ "@typescript-eslint/eslint-plugin": "^8",
67
+ "@typescript-eslint/parser": "^8",
68
+ "@whiskeysockets/eslint-config": "^1.0.0",
69
+ "conventional-changelog": "^7.1.1",
70
+ "conventional-changelog-angular": "^8.0.0",
71
+ "esbuild-register": "^3.6.0",
72
+ "eslint": "^9",
73
+ "eslint-config-prettier": "^10.1.2",
74
+ "eslint-plugin-prettier": "^5.4.0",
75
+ "jest": "^30.0.5",
76
+ "jimp": "^1.6.1",
77
+ "jiti": "^2.4.2",
78
+ "json": "^11.0.0",
74
79
  "link-preview-js": "^3.0.0",
80
+ "lru-cache": "^11.1.0",
75
81
  "open": "^8.4.2",
76
- "qrcode-terminal": "^0.12.0",
77
- "release-it": "^15.10.3",
78
- "sharp": "^0.30.5",
79
- "ts-jest": "^27.0.3",
80
- "ts-node": "^10.8.1",
81
- "typedoc": "^0.24.7",
82
- "typescript": "^4.6.4",
83
- "json": "^11.0.0"
82
+ "pino-pretty": "^13.1.1",
83
+ "prettier": "^3.5.3",
84
+ "protobufjs-cli": "^1.1.3",
85
+ "release-it": "^20.0.1",
86
+ "ts-jest": "^29.4.0",
87
+ "tsc-esm-fix": "^3.1.2",
88
+ "tsx": "^4.20.3",
89
+ "typedoc": "^0.27.9",
90
+ "typedoc-plugin-markdown": "4.4.2",
91
+ "typescript": "^5.8.2"
84
92
  },
85
93
  "peerDependencies": {
86
- "jimp": "^0.16.1",
94
+ "audio-decode": "^2.1.3",
95
+ "jimp": "^1.6.1",
87
96
  "link-preview-js": "^3.0.0",
88
- "qrcode-terminal": "^0.12.0",
89
- "sharp": "^0.32.2"
97
+ "sharp": "*"
98
+ },
99
+ "resolutions": {
100
+ "ajv@npm:^6.12.4": "^6.14.0",
101
+ "basic-ftp": "^5.2.4",
102
+ "brace-expansion@npm:^1.1.7": "^1.1.13",
103
+ "brace-expansion@npm:^2.0.1": "^2.0.3",
104
+ "flatted": "^3.4.2",
105
+ "glob@npm:^10.2.2": "^10.5.0",
106
+ "glob@npm:^10.3.10": "^10.5.0",
107
+ "glob@npm:^10.5.0": "^10.5.0",
108
+ "handlebars": "^4.7.9",
109
+ "ip-address": "^10.1.1",
110
+ "js-yaml@npm:^3.13.1": "^3.14.2",
111
+ "js-yaml@npm:^4.1.0": "^4.1.1",
112
+ "markdown-it": "^14.1.1",
113
+ "minimatch@npm:^3.0.4": "^3.1.5",
114
+ "minimatch@npm:^3.1.2": "^3.1.5",
115
+ "minimatch@npm:^5.0.1": "^5.1.8",
116
+ "minimatch@npm:^9.0.4": "^9.0.9",
117
+ "minimatch@npm:^9.0.5": "^9.0.9",
118
+ "picomatch@npm:^2.0.4": "^2.3.2",
119
+ "picomatch@npm:^2.3.1": "^2.3.2",
120
+ "picomatch@npm:^4.0.0": "^4.0.4",
121
+ "picomatch@npm:^4.0.2": "^4.0.4",
122
+ "socks": "^2.8.8",
123
+ "tar": "^7.5.11",
124
+ "tmp": "^0.2.5",
125
+ "underscore": "^1.13.8",
126
+ "yaml@npm:^2.6.1": "^2.8.4"
90
127
  },
91
128
  "peerDependenciesMeta": {
92
- "jimp": {
93
- "optional": true
94
- },
95
- "link-preview-js": {
129
+ "audio-decode": {
96
130
  "optional": true
97
131
  },
98
- "qrcode-terminal": {
132
+ "jimp": {
99
133
  "optional": true
100
134
  },
101
- "sharp": {
135
+ "link-preview-js": {
102
136
  "optional": true
103
137
  }
104
138
  },
105
- "packageManager": "yarn@1.22.19",
139
+ "packageManager": "yarn@4.9.2",
106
140
  "engines": {
107
141
  "node": ">=20.0.0"
108
142
  }
@@ -1,29 +0,0 @@
1
- const { readFileSync, writeFileSync } = require 'fs';
2
- const { exit } = require 'process';
3
-
4
- const filePath = './index.js';
5
-
6
- try {
7
- // Read the file
8
- let content = readFileSync(filePath, 'utf8');
9
-
10
- // Fix the import statement
11
- content = content.replace(
12
- /import \* as (\$protobuf) from/g,
13
- 'import $1 from'
14
- );
15
-
16
- // add missing extension to the import
17
- content = content.replace(
18
- /(['"])protobufjs\/minimal(['"])/g,
19
- '$1protobufjs/minimal.js$2'
20
- );
21
-
22
- // Write back
23
- writeFileSync(filePath, content, 'utf8');
24
-
25
- console.log(`✅ Fixed imports in ${filePath}`);
26
- } catch (error) {
27
- console.error(`❌ Error fixing imports: ${error.message}`);
28
- exit(1);
29
- }
@@ -1,3 +0,0 @@
1
- {
2
- "version": [2, 3000, 1026924051]
3
- }
@@ -1,53 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { proto } from '../../WAProto';
4
- import type { MediaType, SocketConfig } from '../Types';
5
- export declare const UNAUTHORIZED_CODES: number[];
6
- export declare const DEFAULT_ORIGIN = "https://web.whatsapp.com";
7
- export declare const DEF_CALLBACK_PREFIX = "CB:";
8
- export declare const DEF_TAG_PREFIX = "TAG:";
9
- export declare const PHONE_CONNECTION_CB = "CB:Pong";
10
- export declare const WA_DEFAULT_EPHEMERAL: number;
11
- export declare const NOISE_MODE = "Noise_XX_25519_AESGCM_SHA256\0\0\0\0";
12
- export declare const DICT_VERSION = 2;
13
- export declare const KEY_BUNDLE_TYPE: Buffer;
14
- export declare const NOISE_WA_HEADER: Buffer;
15
- /** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
16
- export declare const URL_REGEX: RegExp;
17
- export declare const WA_CERT_DETAILS: {
18
- SERIAL: number;
19
- };
20
- export declare const PROCESSABLE_HISTORY_TYPES: proto.Message.HistorySyncNotification.HistorySyncType[];
21
- export declare const DEFAULT_CONNECTION_CONFIG: SocketConfig;
22
- export declare const MEDIA_PATH_MAP: {
23
- [T in MediaType]?: string;
24
- };
25
- export declare const MEDIA_HKDF_KEY_MAPPING: {
26
- audio: string;
27
- document: string;
28
- gif: string;
29
- image: string;
30
- ppic: string;
31
- product: string;
32
- ptt: string;
33
- sticker: string;
34
- video: string;
35
- 'thumbnail-document': string;
36
- 'thumbnail-image': string;
37
- 'thumbnail-video': string;
38
- 'thumbnail-link': string;
39
- 'md-msg-hist': string;
40
- 'md-app-state': string;
41
- 'product-catalog-image': string;
42
- 'payment-bg-image': string;
43
- ptv: string;
44
- };
45
- export declare const MEDIA_KEYS: ("ppic" | "product" | "image" | "video" | "sticker" | "audio" | "gif" | "ptt" | "thumbnail-document" | "thumbnail-image" | "thumbnail-link" | "thumbnail-video" | "md-app-state" | "md-msg-hist" | "document" | "product-catalog-image" | "payment-bg-image" | "ptv")[];
46
- export declare const MIN_PREKEY_COUNT = 5;
47
- export declare const INITIAL_PREKEY_COUNT = 30;
48
- export declare const DEFAULT_CACHE_TTLS: {
49
- SIGNAL_STORE: number;
50
- MSG_RETRY: number;
51
- CALL_OFFER: number;
52
- USER_DEVICES: number;
53
- };
@@ -1,223 +0,0 @@
1
- {
2
- "93": 412,
3
- "355": 276,
4
- "213": 603,
5
- "1-684": 544,
6
- "376": 213,
7
- "244": 631,
8
- "1-264": 365,
9
- "1-268": 344,
10
- "54": 722,
11
- "374": 283,
12
- "297": 363,
13
- "61": 505,
14
- "43": 232,
15
- "994": 400,
16
- "1-242": 364,
17
- "973": 426,
18
- "880": 470,
19
- "1-246": 342,
20
- "375": 257,
21
- "32": 206,
22
- "501": 702,
23
- "229": 616,
24
- "1-441": 350,
25
- "975": 402,
26
- "591": 736,
27
- "387": 218,
28
- "267": 652,
29
- "55": 724,
30
- "1-284": 348,
31
- "673": 528,
32
- "359": 284,
33
- "226": 613,
34
- "257": 642,
35
- "855": 456,
36
- "237": 624,
37
- "238": 625,
38
- "1-345": 346,
39
- "236": 623,
40
- "235": 622,
41
- "56": 730,
42
- "86": 454,
43
- "57": 732,
44
- "269": 654,
45
- "682": 548,
46
- "506": 712,
47
- "385": 219,
48
- "53": 368,
49
- "357": 280,
50
- "420": 230,
51
- "243": 630,
52
- "45": 238,
53
- "253": 638,
54
- "1-767": 366,
55
- "1-809": 370,
56
- "1-849": 370,
57
- "1-829": 370,
58
- "593": 740,
59
- "20": 602,
60
- "503": 706,
61
- "240": 627,
62
- "291": 657,
63
- "372": 248,
64
- "251": 636,
65
- "500": 750,
66
- "298": 288,
67
- "679": 542,
68
- "358": 244,
69
- "33": 208,
70
- "689": 547,
71
- "241": 628,
72
- "220": 607,
73
- "995": 282,
74
- "49": 262,
75
- "233": 620,
76
- "350": 266,
77
- "30": 202,
78
- "299": 290,
79
- "1-473": 352,
80
- "1-671": 535,
81
- "502": 704,
82
- "224": 537,
83
- "592": 738,
84
- "509": 372,
85
- "504": 708,
86
- "852": 454,
87
- "36": 216,
88
- "354": 274,
89
- "91": 404,
90
- "62": 510,
91
- "98": 432,
92
- "964": 418,
93
- "353": 234,
94
- "972": 425,
95
- "39": 222,
96
- "225": 612,
97
- "1-876": 338,
98
- "81": 440,
99
- "962": 416,
100
- "254": 639,
101
- "686": 545,
102
- "383": 221,
103
- "965": 419,
104
- "371": 247,
105
- "961": 415,
106
- "266": 651,
107
- "231": 618,
108
- "218": 606,
109
- "423": 295,
110
- "370": 246,
111
- "352": 270,
112
- "389": 294,
113
- "261": 646,
114
- "265": 650,
115
- "60": 502,
116
- "960": 472,
117
- "223": 610,
118
- "356": 278,
119
- "692": 551,
120
- "222": 609,
121
- "230": 617,
122
- "52": 334,
123
- "691": 550,
124
- "373": 259,
125
- "377": 212,
126
- "976": 428,
127
- "382": 297,
128
- "1-664": 354,
129
- "212": 604,
130
- "258": 643,
131
- "95": 414,
132
- "264": 649,
133
- "674": 536,
134
- "977": 429,
135
- "31": 204,
136
- "687": 546,
137
- "64": 530,
138
- "505": 710,
139
- "227": 614,
140
- "234": 621,
141
- "683": 555,
142
- "1-670": 534,
143
- "47": 242,
144
- "968": 226,
145
- "92": 410,
146
- "680": 552,
147
- "970": 423,
148
- "507": 714,
149
- "675": 537,
150
- "595": 744,
151
- "51": 716,
152
- "63": 515,
153
- "48": 260,
154
- "351": 268,
155
- "1-787, 1-939": 330,
156
- "974": 427,
157
- "242": 630,
158
- "40": 226,
159
- "7": 250,
160
- "250": 635,
161
- "290": 658,
162
- "1-869": 356,
163
- "1-758": 358,
164
- "508": 308,
165
- "1-784": 360,
166
- "685": 544,
167
- "378": 292,
168
- "239": 626,
169
- "966": 420,
170
- "221": 608,
171
- "381": 220,
172
- "248": 633,
173
- "232": 619,
174
- "65": 525,
175
- "386": 293,
176
- "677": 540,
177
- "27": 655,
178
- "211": 659,
179
- "34": 214,
180
- "94": 413,
181
- "249": 634,
182
- "597": 746,
183
- "268": 653,
184
- "46": 240,
185
- "41": 228,
186
- "963": 417,
187
- "886": 466,
188
- "992": 436,
189
- "255": 640,
190
- "66": 520,
191
- "228": 615,
192
- "690": 554,
193
- "676": 539,
194
- "1-868": 374,
195
- "216": 605,
196
- "90": 286,
197
- "993": 438,
198
- "1-649": 376,
199
- "688": 553,
200
- "1-340": 332,
201
- "256": 641,
202
- "380": 255,
203
- "971": 424,
204
- "44": 234,
205
- "1": 310,
206
- "598": 748,
207
- "998": 434,
208
- "678": 541,
209
- "379": 225,
210
- "58": 734,
211
- "681": 543,
212
- "967": 421,
213
- "260": 645,
214
- "263": 648,
215
- "670": 514,
216
- "245": 632,
217
- "856": 457,
218
- "599": 362,
219
- "850": 467,
220
- "262": 647,
221
- "82": 450,
222
- "84": 452
223
- }
@@ -1,9 +0,0 @@
1
- export declare class CiphertextMessage {
2
- readonly UNSUPPORTED_VERSION: number;
3
- readonly CURRENT_VERSION: number;
4
- readonly WHISPER_TYPE: number;
5
- readonly PREKEY_TYPE: number;
6
- readonly SENDERKEY_TYPE: number;
7
- readonly SENDERKEY_DISTRIBUTION_TYPE: number;
8
- readonly ENCRYPTED_MESSAGE_OVERHEAD: number;
9
- }
@@ -1,14 +0,0 @@
1
- import { SenderKeyDistributionMessage } from './sender-key-distribution-message';
2
- import { SenderKeyName } from './sender-key-name';
3
- import { SenderKeyRecord } from './sender-key-record';
4
- interface SenderKeyStore {
5
- loadSenderKey(senderKeyName: SenderKeyName): Promise<SenderKeyRecord>;
6
- storeSenderKey(senderKeyName: SenderKeyName, record: SenderKeyRecord): Promise<void>;
7
- }
8
- export declare class GroupSessionBuilder {
9
- private readonly senderKeyStore;
10
- constructor(senderKeyStore: SenderKeyStore);
11
- process(senderKeyName: SenderKeyName, senderKeyDistributionMessage: SenderKeyDistributionMessage): Promise<void>;
12
- create(senderKeyName: SenderKeyName): Promise<SenderKeyDistributionMessage>;
13
- }
14
- export {};
@@ -1,17 +0,0 @@
1
- import { SenderKeyName } from './sender-key-name';
2
- import { SenderKeyRecord } from './sender-key-record';
3
- export interface SenderKeyStore {
4
- loadSenderKey(senderKeyName: SenderKeyName): Promise<SenderKeyRecord>;
5
- storeSenderKey(senderKeyName: SenderKeyName, record: SenderKeyRecord): Promise<void>;
6
- }
7
- export declare class GroupCipher {
8
- private readonly senderKeyStore;
9
- private readonly senderKeyName;
10
- constructor(senderKeyStore: SenderKeyStore, senderKeyName: SenderKeyName);
11
- private queueJob;
12
- encrypt(paddedPlaintext: Uint8Array | string): Promise<Uint8Array>;
13
- decrypt(senderKeyMessageBytes: Uint8Array): Promise<Uint8Array>;
14
- private getSenderKey;
15
- private getPlainText;
16
- private getCipherText;
17
- }
@@ -1,11 +0,0 @@
1
- export { GroupSessionBuilder } from './group-session-builder';
2
- export { SenderKeyDistributionMessage } from './sender-key-distribution-message';
3
- export { SenderKeyRecord } from './sender-key-record';
4
- export { SenderKeyName } from './sender-key-name';
5
- export { GroupCipher } from './group_cipher';
6
- export { SenderKeyState } from './sender-key-state';
7
- export { SenderKeyMessage } from './sender-key-message';
8
- export { SenderMessageKey } from './sender-message-key';
9
- export { SenderChainKey } from './sender-chain-key';
10
- export { CiphertextMessage } from './ciphertext-message';
11
- export * as keyhelper from './keyhelper';
@@ -1,10 +0,0 @@
1
- import { generateKeyPair } from 'libsignal/src/curve';
2
- type KeyPairType = ReturnType<typeof generateKeyPair>;
3
- export declare function generateSenderKey(): Buffer;
4
- export declare function generateSenderKeyId(): number;
5
- export interface SigningKeyPair {
6
- public: Buffer;
7
- private: Buffer;
8
- }
9
- export declare function generateSenderSigningKey(key?: KeyPairType): SigningKeyPair;
10
- export {};
@@ -1 +0,0 @@
1
- export default function queueJob<T>(bucket: string | number, awaitable: () => Promise<T>): Promise<T>;