@alannxd/baileys 6.0.5 → 6.0.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.
Files changed (234) hide show
  1. package/WAProto/fix-import.js +29 -0
  2. package/WAProto/index.js +160 -201
  3. package/engine-requirements.js +1 -1
  4. package/lib/Defaults/baileys-version.json +3 -0
  5. package/lib/Defaults/index.d.ts +15 -37
  6. package/lib/Defaults/index.js +136 -119
  7. package/lib/Defaults/phonenumber-mcc.json +223 -0
  8. package/lib/Signal/Group/ciphertext-message.d.ts +0 -1
  9. package/lib/Signal/Group/ciphertext-message.js +5 -2
  10. package/lib/Signal/Group/group-session-builder.d.ts +3 -4
  11. package/lib/Signal/Group/group-session-builder.js +41 -7
  12. package/lib/Signal/Group/group_cipher.d.ts +4 -4
  13. package/lib/Signal/Group/group_cipher.js +51 -37
  14. package/lib/Signal/Group/index.d.ts +11 -12
  15. package/lib/Signal/Group/index.js +57 -12
  16. package/lib/Signal/Group/keyhelper.d.ts +1 -2
  17. package/lib/Signal/Group/keyhelper.js +44 -7
  18. package/lib/Signal/Group/queue-job.d.ts +1 -0
  19. package/lib/Signal/Group/queue-job.js +57 -0
  20. package/lib/Signal/Group/sender-chain-key.d.ts +2 -3
  21. package/lib/Signal/Group/sender-chain-key.js +15 -7
  22. package/lib/Signal/Group/sender-key-distribution-message.d.ts +1 -2
  23. package/lib/Signal/Group/sender-key-distribution-message.js +11 -8
  24. package/lib/Signal/Group/sender-key-message.d.ts +1 -2
  25. package/lib/Signal/Group/sender-key-message.js +12 -9
  26. package/lib/Signal/Group/sender-key-name.d.ts +0 -1
  27. package/lib/Signal/Group/sender-key-name.js +5 -2
  28. package/lib/Signal/Group/sender-key-record.d.ts +2 -3
  29. package/lib/Signal/Group/sender-key-record.js +21 -9
  30. package/lib/Signal/Group/sender-key-state.d.ts +6 -7
  31. package/lib/Signal/Group/sender-key-state.js +42 -27
  32. package/lib/Signal/Group/sender-message-key.d.ts +0 -1
  33. package/lib/Signal/Group/sender-message-key.js +7 -4
  34. package/lib/Signal/libsignal.d.ts +3 -5
  35. package/lib/Signal/libsignal.js +90 -347
  36. package/lib/Socket/Client/{types.d.ts → abstract-socket-client.d.ts} +5 -4
  37. package/lib/Socket/Client/abstract-socket-client.js +13 -0
  38. package/lib/Socket/Client/index.d.ts +3 -3
  39. package/lib/Socket/Client/index.js +19 -3
  40. package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
  41. package/lib/Socket/Client/mobile-socket-client.js +65 -0
  42. package/lib/Socket/Client/{websocket.d.ts → web-socket-client.d.ts} +2 -3
  43. package/lib/Socket/Client/web-socket-client.js +62 -0
  44. package/lib/Socket/business.d.ts +108 -154
  45. package/lib/Socket/business.js +43 -162
  46. package/lib/Socket/chats.d.ts +239 -96
  47. package/lib/Socket/chats.js +427 -627
  48. package/lib/Socket/communities.d.ts +146 -239
  49. package/lib/Socket/communities.js +80 -90
  50. package/lib/Socket/groups.d.ts +57 -104
  51. package/lib/Socket/groups.js +161 -154
  52. package/lib/Socket/index.d.ts +115 -202
  53. package/lib/Socket/index.js +10 -11
  54. package/lib/Socket/luxu.d.ts +266 -22
  55. package/lib/Socket/luxu.js +465 -422
  56. package/lib/Socket/messages-recv.d.ts +84 -136
  57. package/lib/Socket/messages-recv.js +615 -1421
  58. package/lib/Socket/messages-send.d.ts +126 -142
  59. package/lib/Socket/messages-send.js +671 -878
  60. package/lib/Socket/newsletter.d.ts +85 -121
  61. package/lib/Socket/newsletter.js +272 -147
  62. package/lib/Socket/registration.d.ts +267 -0
  63. package/lib/Socket/registration.js +166 -0
  64. package/lib/Socket/socket.d.ts +19 -34
  65. package/lib/Socket/socket.js +313 -544
  66. package/lib/Socket/usync.d.ts +36 -0
  67. package/lib/Socket/usync.js +70 -0
  68. package/lib/Store/index.d.ts +3 -10
  69. package/lib/Store/index.js +10 -10
  70. package/lib/Store/make-cache-manager-store.d.ts +11 -17
  71. package/lib/Store/make-cache-manager-store.js +41 -43
  72. package/lib/Store/make-in-memory-store.d.ts +118 -39
  73. package/lib/Store/make-in-memory-store.js +341 -112
  74. package/lib/Store/make-ordered-dictionary.d.ts +10 -11
  75. package/lib/Store/make-ordered-dictionary.js +20 -14
  76. package/lib/Store/object-repository.d.ts +9 -10
  77. package/lib/Store/object-repository.js +6 -11
  78. package/lib/Types/Auth.d.ts +12 -19
  79. package/lib/Types/Auth.js +2 -2
  80. package/lib/Types/Call.d.ts +1 -3
  81. package/lib/Types/Call.js +2 -2
  82. package/lib/Types/Chat.d.ts +13 -35
  83. package/lib/Types/Chat.js +4 -8
  84. package/lib/Types/Contact.d.ts +1 -8
  85. package/lib/Types/Contact.js +2 -2
  86. package/lib/Types/Events.d.ts +17 -116
  87. package/lib/Types/Events.js +2 -2
  88. package/lib/Types/GroupMetadata.d.ts +5 -21
  89. package/lib/Types/GroupMetadata.js +2 -2
  90. package/lib/Types/Label.d.ts +0 -12
  91. package/lib/Types/Label.js +5 -3
  92. package/lib/Types/LabelAssociation.d.ts +0 -1
  93. package/lib/Types/LabelAssociation.js +5 -3
  94. package/lib/Types/Message.d.ts +58 -105
  95. package/lib/Types/Message.js +9 -11
  96. package/lib/Types/Newsletter.d.ts +103 -0
  97. package/lib/Types/Newsletter.js +38 -0
  98. package/lib/Types/Product.d.ts +1 -2
  99. package/lib/Types/Product.js +2 -2
  100. package/lib/Types/Signal.d.ts +2 -32
  101. package/lib/Types/Signal.js +2 -2
  102. package/lib/Types/Socket.d.ts +25 -50
  103. package/lib/Types/Socket.js +2 -3
  104. package/lib/Types/State.d.ts +2 -72
  105. package/lib/Types/State.js +2 -56
  106. package/lib/Types/USync.d.ts +2 -3
  107. package/lib/Types/USync.js +2 -2
  108. package/lib/Types/index.d.ts +14 -22
  109. package/lib/Types/index.js +31 -15
  110. package/lib/Utils/auth-utils.d.ts +6 -12
  111. package/lib/Utils/auth-utils.js +143 -239
  112. package/lib/Utils/baileys-event-stream.d.ts +16 -0
  113. package/lib/Utils/baileys-event-stream.js +63 -0
  114. package/lib/Utils/business.d.ts +2 -3
  115. package/lib/Utils/business.js +69 -66
  116. package/lib/Utils/chat-utils.d.ts +23 -52
  117. package/lib/Utils/chat-utils.js +253 -396
  118. package/lib/Utils/crypto.d.ts +22 -18
  119. package/lib/Utils/crypto.js +90 -57
  120. package/lib/Utils/decode-wa-message.d.ts +8 -55
  121. package/lib/Utils/decode-wa-message.js +84 -203
  122. package/lib/Utils/event-buffer.d.ts +8 -9
  123. package/lib/Utils/event-buffer.js +77 -185
  124. package/lib/Utils/generics.d.ts +29 -28
  125. package/lib/Utils/generics.js +210 -180
  126. package/lib/Utils/history.d.ts +9 -18
  127. package/lib/Utils/history.js +55 -93
  128. package/lib/Utils/index.d.ts +17 -22
  129. package/lib/Utils/index.js +33 -22
  130. package/lib/Utils/link-preview.d.ts +5 -5
  131. package/lib/Utils/link-preview.js +24 -16
  132. package/lib/Utils/logger.d.ts +3 -11
  133. package/lib/Utils/logger.js +7 -3
  134. package/lib/Utils/lt-hash.d.ts +12 -8
  135. package/lib/Utils/lt-hash.js +46 -3
  136. package/lib/Utils/make-mutex.d.ts +2 -4
  137. package/lib/Utils/make-mutex.js +34 -24
  138. package/lib/Utils/messages-media.d.ts +44 -61
  139. package/lib/Utils/messages-media.js +482 -451
  140. package/lib/Utils/messages.d.ts +18 -32
  141. package/lib/Utils/messages.js +369 -458
  142. package/lib/Utils/noise-handler.d.ts +14 -13
  143. package/lib/Utils/noise-handler.js +99 -145
  144. package/lib/Utils/process-message.d.ts +12 -31
  145. package/lib/Utils/process-message.js +150 -459
  146. package/lib/Utils/signal.d.ts +5 -20
  147. package/lib/Utils/signal.js +72 -120
  148. package/lib/Utils/use-multi-file-auth-state.d.ts +2 -2
  149. package/lib/Utils/use-multi-file-auth-state.js +27 -29
  150. package/lib/Utils/validate-connection.d.ts +7 -7
  151. package/lib/Utils/validate-connection.js +99 -73
  152. package/lib/WABinary/constants.d.ts +27 -25
  153. package/lib/WABinary/constants.js +20 -1281
  154. package/lib/WABinary/decode.d.ts +5 -5
  155. package/lib/WABinary/decode.js +42 -52
  156. package/lib/WABinary/encode.d.ts +3 -3
  157. package/lib/WABinary/encode.js +155 -110
  158. package/lib/WABinary/generic-utils.d.ts +7 -8
  159. package/lib/WABinary/generic-utils.js +49 -48
  160. package/lib/WABinary/index.d.ts +5 -6
  161. package/lib/WABinary/index.js +21 -6
  162. package/lib/WABinary/jid-utils.d.ts +8 -25
  163. package/lib/WABinary/jid-utils.js +40 -74
  164. package/lib/WABinary/types.d.ts +1 -2
  165. package/lib/WABinary/types.js +2 -2
  166. package/lib/WAM/BinaryInfo.d.ts +11 -3
  167. package/lib/WAM/BinaryInfo.js +5 -2
  168. package/lib/WAM/constants.d.ts +3 -5
  169. package/lib/WAM/constants.js +11958 -19461
  170. package/lib/WAM/encode.d.ts +3 -3
  171. package/lib/WAM/encode.js +22 -17
  172. package/lib/WAM/index.d.ts +3 -4
  173. package/lib/WAM/index.js +19 -4
  174. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +3 -4
  175. package/lib/WAUSync/Protocols/USyncContactProtocol.js +13 -33
  176. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +2 -3
  177. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +14 -11
  178. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +2 -3
  179. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +12 -9
  180. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +2 -3
  181. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +13 -9
  182. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +3 -4
  183. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +22 -20
  184. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +3 -5
  185. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +8 -13
  186. package/lib/WAUSync/Protocols/index.d.ts +4 -6
  187. package/lib/WAUSync/Protocols/index.js +20 -6
  188. package/lib/WAUSync/USyncQuery.d.ts +4 -6
  189. package/lib/WAUSync/USyncQuery.js +35 -44
  190. package/lib/WAUSync/USyncUser.d.ts +5 -10
  191. package/lib/WAUSync/USyncUser.js +5 -10
  192. package/lib/WAUSync/index.js +19 -4
  193. package/lib/index.d.ts +9 -10
  194. package/lib/index.js +34 -12
  195. package/package.json +50 -83
  196. package/WAProto/GenerateStatics.sh +0 -3
  197. package/WAProto/WAProto.proto +0 -5479
  198. package/WAProto/fix-imports.js +0 -85
  199. package/WAProto/index.d.ts +0 -14017
  200. package/lib/Signal/lid-mapping.d.ts +0 -23
  201. package/lib/Signal/lid-mapping.js +0 -277
  202. package/lib/Socket/Client/types.js +0 -11
  203. package/lib/Socket/Client/websocket.js +0 -54
  204. package/lib/Socket/mex.d.ts +0 -3
  205. package/lib/Socket/mex.js +0 -42
  206. package/lib/Store/keyed-db.d.ts +0 -22
  207. package/lib/Store/keyed-db.js +0 -108
  208. package/lib/Types/Bussines.d.ts +0 -25
  209. package/lib/Types/Bussines.js +0 -2
  210. package/lib/Types/Mex.d.ts +0 -141
  211. package/lib/Types/Mex.js +0 -37
  212. package/lib/Utils/browser-utils.d.ts +0 -4
  213. package/lib/Utils/browser-utils.js +0 -28
  214. package/lib/Utils/companion-reg-client-utils.d.ts +0 -17
  215. package/lib/Utils/companion-reg-client-utils.js +0 -35
  216. package/lib/Utils/identity-change-handler.d.ts +0 -44
  217. package/lib/Utils/identity-change-handler.js +0 -50
  218. package/lib/Utils/message-retry-manager.d.ts +0 -115
  219. package/lib/Utils/message-retry-manager.js +0 -265
  220. package/lib/Utils/offline-node-processor.d.ts +0 -17
  221. package/lib/Utils/offline-node-processor.js +0 -40
  222. package/lib/Utils/pre-key-manager.d.ts +0 -28
  223. package/lib/Utils/pre-key-manager.js +0 -106
  224. package/lib/Utils/reporting-utils.d.ts +0 -11
  225. package/lib/Utils/reporting-utils.js +0 -258
  226. package/lib/Utils/stanza-ack.d.ts +0 -11
  227. package/lib/Utils/stanza-ack.js +0 -38
  228. package/lib/Utils/sync-action-utils.d.ts +0 -19
  229. package/lib/Utils/sync-action-utils.js +0 -49
  230. package/lib/Utils/tc-token-utils.d.ts +0 -37
  231. package/lib/Utils/tc-token-utils.js +0 -163
  232. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +0 -10
  233. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +0 -25
  234. package/lib/WAUSync/index.d.ts +0 -4
@@ -1,9 +1,11 @@
1
- import { getBinaryNodeChild } from '../WABinary/index.js';
2
- import { USyncBotProfileProtocol } from './Protocols/UsyncBotProfileProtocol.js';
3
- import { USyncLIDProtocol } from './Protocols/UsyncLIDProtocol.js';
4
- import { USyncContactProtocol, USyncDeviceProtocol, USyncDisappearingModeProtocol, USyncStatusProtocol, USyncUsernameProtocol } from './Protocols/index.js';
5
- import { USyncUser } from './USyncUser.js';
6
- export class USyncQuery {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.USyncQuery = void 0;
4
+ const WABinary_1 = require("../WABinary");
5
+ const UsyncBotProfileProtocol_1 = require("./Protocols/UsyncBotProfileProtocol");
6
+ const UsyncLIDProtocol_1 = require("./Protocols/UsyncLIDProtocol");
7
+ const Protocols_1 = require("./Protocols");
8
+ class USyncQuery {
7
9
  constructor() {
8
10
  this.protocols = [];
9
11
  this.users = [];
@@ -23,76 +25,65 @@ export class USyncQuery {
23
25
  return this;
24
26
  }
25
27
  parseUSyncQueryResult(result) {
26
- if (result?.attrs.type !== 'result') {
28
+ if (result.attrs.type !== 'result') {
27
29
  return;
28
30
  }
29
- const protocolMap = Object.fromEntries(this.protocols.map(protocol => {
31
+ const protocolMap = Object.fromEntries(this.protocols.map((protocol) => {
30
32
  return [protocol.name, protocol.parser];
31
33
  }));
32
34
  const queryResult = {
33
35
  // TODO: implement errors etc.
34
36
  list: [],
35
- sideList: []
37
+ sideList: [],
36
38
  };
37
- const usyncNode = getBinaryNodeChild(result, 'usync');
39
+ const usyncNode = (0, WABinary_1.getBinaryNodeChild)(result, 'usync');
38
40
  //TODO: implement error backoff, refresh etc.
39
41
  //TODO: see if there are any errors in the result node
40
42
  //const resultNode = getBinaryNodeChild(usyncNode, 'result')
41
- const listNode = usyncNode ? getBinaryNodeChild(usyncNode, 'list') : undefined;
42
- if (listNode?.content && Array.isArray(listNode.content)) {
43
- queryResult.list = listNode.content.reduce((acc, node) => {
44
- const id = node?.attrs.jid;
45
- if (id) {
46
- const data = Array.isArray(node?.content)
47
- ? Object.fromEntries(node.content
48
- .map(content => {
49
- const protocol = content.tag;
50
- const parser = protocolMap[protocol];
51
- if (parser) {
52
- return [protocol, parser(content)];
53
- }
54
- else {
55
- return [protocol, null];
56
- }
57
- })
58
- .filter(([, b]) => b !== null))
59
- : {};
60
- acc.push({ ...data, id });
61
- }
62
- return acc;
63
- }, []);
43
+ const listNode = (0, WABinary_1.getBinaryNodeChild)(usyncNode, 'list');
44
+ if (Array.isArray(listNode === null || listNode === void 0 ? void 0 : listNode.content) && typeof listNode !== 'undefined') {
45
+ queryResult.list = listNode.content.map((node) => {
46
+ const id = node === null || node === void 0 ? void 0 : node.attrs.jid;
47
+ const data = Array.isArray(node === null || node === void 0 ? void 0 : node.content) ? Object.fromEntries(node.content.map((content) => {
48
+ const protocol = content.tag;
49
+ const parser = protocolMap[protocol];
50
+ if (parser) {
51
+ return [protocol, parser(content)];
52
+ }
53
+ else {
54
+ return [protocol, null];
55
+ }
56
+ }).filter(([, b]) => b !== null)) : {};
57
+ return { ...data, id };
58
+ });
64
59
  }
65
60
  //TODO: implement side list
66
61
  //const sideListNode = getBinaryNodeChild(usyncNode, 'side_list')
67
62
  return queryResult;
68
63
  }
69
64
  withDeviceProtocol() {
70
- this.protocols.push(new USyncDeviceProtocol());
65
+ this.protocols.push(new Protocols_1.USyncDeviceProtocol());
71
66
  return this;
72
67
  }
73
68
  withContactProtocol() {
74
- this.protocols.push(new USyncContactProtocol());
69
+ this.protocols.push(new Protocols_1.USyncContactProtocol());
75
70
  return this;
76
71
  }
77
72
  withStatusProtocol() {
78
- this.protocols.push(new USyncStatusProtocol());
73
+ this.protocols.push(new Protocols_1.USyncStatusProtocol());
79
74
  return this;
80
75
  }
81
76
  withDisappearingModeProtocol() {
82
- this.protocols.push(new USyncDisappearingModeProtocol());
77
+ this.protocols.push(new Protocols_1.USyncDisappearingModeProtocol());
83
78
  return this;
84
79
  }
85
80
  withBotProfileProtocol() {
86
- this.protocols.push(new USyncBotProfileProtocol());
81
+ this.protocols.push(new UsyncBotProfileProtocol_1.USyncBotProfileProtocol());
87
82
  return this;
88
83
  }
89
84
  withLIDProtocol() {
90
- this.protocols.push(new USyncLIDProtocol());
91
- return this;
92
- }
93
- withUsernameProtocol() {
94
- this.protocols.push(new USyncUsernameProtocol());
85
+ this.protocols.push(new UsyncLIDProtocol_1.USyncLIDProtocol());
95
86
  return this;
96
87
  }
97
88
  }
98
- //# sourceMappingURL=USyncQuery.js.map
89
+ exports.USyncQuery = USyncQuery;
@@ -1,17 +1,12 @@
1
1
  export declare class USyncUser {
2
- id?: string;
3
- lid?: string;
4
- phone?: string;
5
- username?: string;
6
- usernameKey?: string;
7
- type?: string;
8
- personaId?: string;
2
+ id: string;
3
+ lid: string;
4
+ phone: string;
5
+ type: string;
6
+ personaId: string;
9
7
  withId(id: string): this;
10
8
  withLid(lid: string): this;
11
9
  withPhone(phone: string): this;
12
- withUsername(username: string): this;
13
- withUsernameKey(usernameKey: string): this;
14
10
  withType(type: string): this;
15
11
  withPersonaId(personaId: string): this;
16
12
  }
17
- //# sourceMappingURL=USyncUser.d.ts.map
@@ -1,4 +1,7 @@
1
- export class USyncUser {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.USyncUser = void 0;
4
+ class USyncUser {
2
5
  withId(id) {
3
6
  this.id = id;
4
7
  return this;
@@ -11,14 +14,6 @@ export class USyncUser {
11
14
  this.phone = phone;
12
15
  return this;
13
16
  }
14
- withUsername(username) {
15
- this.username = username;
16
- return this;
17
- }
18
- withUsernameKey(usernameKey) {
19
- this.usernameKey = usernameKey;
20
- return this;
21
- }
22
17
  withType(type) {
23
18
  this.type = type;
24
19
  return this;
@@ -28,4 +23,4 @@ export class USyncUser {
28
23
  return this;
29
24
  }
30
25
  }
31
- //# sourceMappingURL=USyncUser.js.map
26
+ exports.USyncUser = USyncUser;
@@ -1,4 +1,19 @@
1
- export * from './Protocols/index.js';
2
- export * from './USyncQuery.js';
3
- export * from './USyncUser.js';
4
- //# sourceMappingURL=index.js.map
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);
package/lib/index.d.ts CHANGED
@@ -1,13 +1,12 @@
1
- import makeWASocket from './Socket/index.js';
2
- export * from '../WAProto/index.js';
3
- export * from './Utils/index.js';
4
- export * from './Types/index.js';
5
- export * from './Defaults/index.js';
6
- export * from './WABinary/index.js';
7
- export * from './WAM/index.js';
8
- export * from './WAUSync/index.js';
9
- export * from './Store/index.js';
1
+ import makeWASocket from './Socket';
2
+ export * from '../WAProto';
3
+ export * from './Utils';
4
+ export * from './Types';
5
+ export * from './Store';
6
+ export * from './Defaults';
7
+ export * from './WABinary';
8
+ export * from './WAM';
9
+ export * from './WAUSync';
10
10
  export type WASocket = ReturnType<typeof makeWASocket>;
11
11
  export { makeWASocket };
12
12
  export default makeWASocket;
13
- //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -1,4 +1,5 @@
1
- import makeWASocket from './Socket/index.js';
1
+ "use strict";
2
+
2
3
  const chalk = require("chalk");
3
4
 
4
5
  console.log(chalk.cyan(`
@@ -19,14 +20,35 @@ fetch('https://raw.githubusercontent.com/alannzxd/xclient/refs/heads/main/inform
19
20
  console.log(chalk.yellow("📁 Information: ") + chalk.white(message));
20
21
  console.log("");
21
22
  });
22
- export * from '../WAProto/index.js';
23
- export * from './Utils/index.js';
24
- export * from './Types/index.js';
25
- export * from './Defaults/index.js';
26
- export * from './WABinary/index.js';
27
- export * from './WAM/index.js';
28
- export * from './WAUSync/index.js';
29
- export * from './Store/index.js';
30
- export { makeWASocket };
31
- export default makeWASocket;
32
- //# sourceMappingURL=index.js.map
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;
package/package.json CHANGED
@@ -1,17 +1,14 @@
1
1
  {
2
2
  "name": "@alannxd/baileys",
3
- "type": "module",
4
- "version": "6.0.5",
5
- "description": "WhatsApp API Modification",
3
+ "version": "6.0.6",
4
+ "description": "WhatsApp API Modification By AlannXD",
6
5
  "keywords": [
7
6
  "whatsapp",
8
- "automation",
9
7
  "baileys",
10
- "wa-bot",
11
- "whatsapp api",
12
- "whatsapp web",
8
+ "whatsapp-web",
9
+ "whatsapp-chat",
10
+ "whatsapp-group",
13
11
  "botwa",
14
- "holow",
15
12
  "alannxd"
16
13
  ],
17
14
  "homepage": "https://www.npmjs.com/package/@alannxd/baileys",
@@ -23,8 +20,8 @@
23
20
  "main": "lib/index.js",
24
21
  "types": "lib/index.d.ts",
25
22
  "files": [
26
- "lib/**/*",
27
- "WAProto/**/*",
23
+ "lib/*",
24
+ "WAProto/*.js",
28
25
  "engine-requirements.js"
29
26
  ],
30
27
  "scripts": {
@@ -43,99 +40,69 @@
43
40
  "test": "jest"
44
41
  },
45
42
  "dependencies": {
46
- "@cacheable/node-cache": "^1.4.0",
43
+ "@adiwajshing/keyed-db": "^0.2.4",
47
44
  "@hapi/boom": "^9.1.3",
45
+ "@cacheable/node-cache": "^1.4.0",
48
46
  "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",
49
54
  "libsignal": "npm:@alannxd/libsignal-node@2.5.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"
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"
58
62
  },
59
63
  "devDependencies": {
60
- "@eslint/eslintrc": "^3.3.1",
61
- "@eslint/js": "^9.31.0",
62
- "@types/jest": "^30.0.0",
63
- "@types/node": "^20.9.0",
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",
64
69
  "@types/ws": "^8.0.0",
65
- "@typescript-eslint/eslint-plugin": "^8",
66
- "@typescript-eslint/parser": "^8",
67
- "@whiskeysockets/eslint-config": "^1.0.0",
68
- "conventional-changelog": "^7.1.1",
69
- "conventional-changelog-angular": "^8.0.0",
70
- "esbuild-register": "^3.6.0",
71
- "eslint": "^9",
72
- "eslint-config-prettier": "^10.1.2",
73
- "eslint-plugin-prettier": "^5.4.0",
74
- "jest": "^30.0.5",
75
- "jimp": "^1.6.1",
76
- "jiti": "^2.4.2",
77
- "json": "^11.0.0",
70
+ "conventional-changelog-cli": "^2.2.2",
71
+ "eslint": "^8.0.0",
72
+ "jest": "^27.0.6",
73
+ "jimp": "^0.16.1",
78
74
  "link-preview-js": "^3.0.0",
79
- "lru-cache": "^11.1.0",
80
75
  "open": "^8.4.2",
81
- "pino-pretty": "^13.1.1",
82
- "prettier": "^3.5.3",
83
- "protobufjs-cli": "^1.1.3",
84
- "release-it": "^20.0.1",
85
- "ts-jest": "^29.4.0",
86
- "tsc-esm-fix": "^3.1.2",
87
- "tsx": "^4.20.3",
88
- "typedoc": "^0.27.9",
89
- "typedoc-plugin-markdown": "4.4.2",
90
- "typescript": "^5.8.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"
91
84
  },
92
85
  "peerDependencies": {
93
- "audio-decode": "^2.1.3",
94
- "jimp": "^1.6.1",
86
+ "jimp": "^0.16.1",
95
87
  "link-preview-js": "^3.0.0",
96
- "sharp": "*"
97
- },
98
- "resolutions": {
99
- "ajv@npm:^6.12.4": "^6.14.0",
100
- "basic-ftp": "^5.2.4",
101
- "brace-expansion@npm:^1.1.7": "^1.1.13",
102
- "brace-expansion@npm:^2.0.1": "^2.0.3",
103
- "flatted": "^3.4.2",
104
- "glob@npm:^10.2.2": "^10.5.0",
105
- "glob@npm:^10.3.10": "^10.5.0",
106
- "glob@npm:^10.5.0": "^10.5.0",
107
- "handlebars": "^4.7.9",
108
- "ip-address": "^10.1.1",
109
- "js-yaml@npm:^3.13.1": "^3.14.2",
110
- "js-yaml@npm:^4.1.0": "^4.1.1",
111
- "markdown-it": "^14.1.1",
112
- "minimatch@npm:^3.0.4": "^3.1.5",
113
- "minimatch@npm:^3.1.2": "^3.1.5",
114
- "minimatch@npm:^5.0.1": "^5.1.8",
115
- "minimatch@npm:^9.0.4": "^9.0.9",
116
- "minimatch@npm:^9.0.5": "^9.0.9",
117
- "picomatch@npm:^2.0.4": "^2.3.2",
118
- "picomatch@npm:^2.3.1": "^2.3.2",
119
- "picomatch@npm:^4.0.0": "^4.0.4",
120
- "picomatch@npm:^4.0.2": "^4.0.4",
121
- "socks": "^2.8.8",
122
- "tar": "^7.5.11",
123
- "tmp": "^0.2.5",
124
- "underscore": "^1.13.8",
125
- "yaml@npm:^2.6.1": "^2.8.4"
88
+ "qrcode-terminal": "^0.12.0",
89
+ "sharp": "^0.32.2"
126
90
  },
127
91
  "peerDependenciesMeta": {
128
- "audio-decode": {
129
- "optional": true
130
- },
131
92
  "jimp": {
132
93
  "optional": true
133
94
  },
134
95
  "link-preview-js": {
135
96
  "optional": true
97
+ },
98
+ "qrcode-terminal": {
99
+ "optional": true
100
+ },
101
+ "sharp": {
102
+ "optional": true
136
103
  }
137
104
  },
138
- "packageManager": "yarn@4.9.2",
105
+ "packageManager": "yarn@1.22.19",
139
106
  "engines": {
140
107
  "node": ">=20.0.0"
141
108
  }
@@ -1,3 +0,0 @@
1
- yarn pbjs -t static-module --no-beautify -w es6 --no-bundle --no-delimited --no-verify --no-comments -o ./index.js ./WAProto.proto;
2
- yarn pbjs -t static-module --no-beautify -w es6 --no-bundle --no-delimited --no-verify ./WAProto.proto | yarn pbts --no-comments -o ./index.d.ts -;
3
- node ./fix-imports.js