@nerxa/socketon 0.0.0-stage → 1.21.1

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 (289) hide show
  1. package/EXPERIMENTAL.md +350 -0
  2. package/LICENSE +24 -0
  3. package/README.md +6317 -2
  4. package/WAProto/index.d.ts +17301 -0
  5. package/WAProto/index.js +125088 -0
  6. package/engine-requirements.js +14 -0
  7. package/package.json +125 -4
  8. package/src/Defaults/index.d.ts +152 -0
  9. package/src/Defaults/index.js +164 -0
  10. package/src/MessageBuilder/bot-signature.d.ts +22 -0
  11. package/src/MessageBuilder/bot-signature.js +122 -0
  12. package/src/MessageBuilder/extras.d.ts +449 -0
  13. package/src/MessageBuilder/extras.js +1356 -0
  14. package/src/MessageBuilder/index.d.ts +210 -0
  15. package/src/MessageBuilder/index.js +3594 -0
  16. package/src/MessageBuilder/metaai.d.ts +438 -0
  17. package/src/MessageBuilder/metaai.js +890 -0
  18. package/src/Signal/Group/ciphertext-message.d.ts +9 -0
  19. package/src/Signal/Group/ciphertext-message.js +11 -0
  20. package/src/Signal/Group/group-session-builder.d.ts +7 -0
  21. package/src/Signal/Group/group-session-builder.js +27 -0
  22. package/src/Signal/Group/group_cipher.d.ts +11 -0
  23. package/src/Signal/Group/group_cipher.js +78 -0
  24. package/src/Signal/Group/index.d.ts +11 -0
  25. package/src/Signal/Group/index.js +11 -0
  26. package/src/Signal/Group/keyhelper.d.ts +6 -0
  27. package/src/Signal/Group/keyhelper.js +17 -0
  28. package/src/Signal/Group/sender-chain-key.d.ts +13 -0
  29. package/src/Signal/Group/sender-chain-key.js +25 -0
  30. package/src/Signal/Group/sender-key-distribution-message.d.ts +16 -0
  31. package/src/Signal/Group/sender-key-distribution-message.js +62 -0
  32. package/src/Signal/Group/sender-key-message.d.ts +18 -0
  33. package/src/Signal/Group/sender-key-message.js +65 -0
  34. package/src/Signal/Group/sender-key-name.d.ts +11 -0
  35. package/src/Signal/Group/sender-key-name.js +47 -0
  36. package/src/Signal/Group/sender-key-record.d.ts +12 -0
  37. package/src/Signal/Group/sender-key-record.js +40 -0
  38. package/src/Signal/Group/sender-key-state.d.ts +16 -0
  39. package/src/Signal/Group/sender-key-state.js +83 -0
  40. package/src/Signal/Group/sender-message-key.d.ts +11 -0
  41. package/src/Signal/Group/sender-message-key.js +25 -0
  42. package/src/Signal/libsignal.d.ts +54 -0
  43. package/src/Signal/libsignal.js +427 -0
  44. package/src/Signal/lid-mapping.d.ts +20 -0
  45. package/src/Signal/lid-mapping.js +274 -0
  46. package/src/Socket/Client/index.d.ts +2 -0
  47. package/src/Socket/Client/index.js +3 -0
  48. package/src/Socket/Client/tcp.js +177 -0
  49. package/src/Socket/Client/types.d.ts +5 -0
  50. package/src/Socket/Client/types.js +9 -0
  51. package/src/Socket/Client/websocket.d.ts +12 -0
  52. package/src/Socket/Client/websocket.js +53 -0
  53. package/src/Socket/business.d.ts +431 -0
  54. package/src/Socket/business.js +379 -0
  55. package/src/Socket/chats.d.ts +247 -0
  56. package/src/Socket/chats.js +1484 -0
  57. package/src/Socket/communities.d.ts +598 -0
  58. package/src/Socket/communities.js +421 -0
  59. package/src/Socket/email.js +145 -0
  60. package/src/Socket/groups.d.ts +298 -0
  61. package/src/Socket/groups.js +339 -0
  62. package/src/Socket/index.d.ts +581 -0
  63. package/src/Socket/index.js +77 -0
  64. package/src/Socket/messages-recv.d.ts +370 -0
  65. package/src/Socket/messages-recv.js +1864 -0
  66. package/src/Socket/messages-send.d.ts +390 -0
  67. package/src/Socket/messages-send.js +1574 -0
  68. package/src/Socket/mex.d.ts +1 -0
  69. package/src/Socket/mex.js +44 -0
  70. package/src/Socket/mobile-builders.js +72 -0
  71. package/src/Socket/mobile.js +424 -0
  72. package/src/Socket/newsletter.d.ts +468 -0
  73. package/src/Socket/newsletter.js +671 -0
  74. package/src/Socket/socket.d.ts +77 -0
  75. package/src/Socket/socket.js +1106 -0
  76. package/src/Store/index.d.ts +3 -0
  77. package/src/Store/index.js +3 -0
  78. package/src/Store/make-in-memory-store.d.ts +62 -0
  79. package/src/Store/make-in-memory-store.js +396 -0
  80. package/src/Store/make-ordered-dictionary.d.ts +12 -0
  81. package/src/Store/make-ordered-dictionary.js +78 -0
  82. package/src/Store/object-repository.d.ts +10 -0
  83. package/src/Store/object-repository.js +23 -0
  84. package/src/Types/Auth.d.ts +1 -0
  85. package/src/Types/Auth.js +1 -0
  86. package/src/Types/Bussines.d.ts +1 -0
  87. package/src/Types/Bussines.js +1 -0
  88. package/src/Types/Call.d.ts +1 -0
  89. package/src/Types/Call.js +1 -0
  90. package/src/Types/Chat.d.ts +2 -0
  91. package/src/Types/Chat.js +24 -0
  92. package/src/Types/Contact.d.ts +1 -0
  93. package/src/Types/Contact.js +1 -0
  94. package/src/Types/Events.d.ts +1 -0
  95. package/src/Types/Events.js +0 -0
  96. package/src/Types/GroupMetadata.d.ts +5 -0
  97. package/src/Types/GroupMetadata.js +6 -0
  98. package/src/Types/Label.d.ts +2 -0
  99. package/src/Types/Label.js +24 -0
  100. package/src/Types/LabelAssociation.d.ts +2 -0
  101. package/src/Types/LabelAssociation.js +6 -0
  102. package/src/Types/Message.d.ts +13 -0
  103. package/src/Types/Message.js +23 -0
  104. package/src/Types/Mex.d.ts +2 -0
  105. package/src/Types/Mex.js +95 -0
  106. package/src/Types/Product.d.ts +1 -0
  107. package/src/Types/Product.js +1 -0
  108. package/src/Types/Signal.d.ts +1 -0
  109. package/src/Types/Signal.js +0 -0
  110. package/src/Types/Socket.d.ts +1 -0
  111. package/src/Types/Socket.js +0 -0
  112. package/src/Types/State.d.ts +5 -0
  113. package/src/Types/State.js +54 -0
  114. package/src/Types/USync.d.ts +1 -0
  115. package/src/Types/USync.js +0 -0
  116. package/src/Types/index.d.ts +13 -0
  117. package/src/Types/index.js +25 -0
  118. package/src/Utils/auth-store.d.ts +29 -0
  119. package/src/Utils/auth-store.js +76 -0
  120. package/src/Utils/auth-utils.d.ts +58 -0
  121. package/src/Utils/auth-utils.js +273 -0
  122. package/src/Utils/browser-utils.d.ts +9 -0
  123. package/src/Utils/browser-utils.js +28 -0
  124. package/src/Utils/business.d.ts +49 -0
  125. package/src/Utils/business.js +226 -0
  126. package/src/Utils/chat-utils.d.ts +408 -0
  127. package/src/Utils/chat-utils.js +846 -0
  128. package/src/Utils/companion-reg-client-utils.d.ts +4 -0
  129. package/src/Utils/companion-reg-client-utils.js +39 -0
  130. package/src/Utils/crypto.d.ts +39 -0
  131. package/src/Utils/crypto.js +110 -0
  132. package/src/Utils/decode-wa-message.d.ts +99 -0
  133. package/src/Utils/decode-wa-message.js +373 -0
  134. package/src/Utils/event-buffer.d.ts +22 -0
  135. package/src/Utils/event-buffer.js +624 -0
  136. package/src/Utils/generics.d.ts +63 -0
  137. package/src/Utils/generics.js +375 -0
  138. package/src/Utils/group-metadata-cache.d.ts +4 -0
  139. package/src/Utils/group-metadata-cache.js +25 -0
  140. package/src/Utils/history.d.ts +75 -0
  141. package/src/Utils/history.js +131 -0
  142. package/src/Utils/html-app.d.ts +19 -0
  143. package/src/Utils/html-app.js +96 -0
  144. package/src/Utils/html-multiplayer.d.ts +10 -0
  145. package/src/Utils/html-multiplayer.js +94 -0
  146. package/src/Utils/identity-change-handler.d.ts +13 -0
  147. package/src/Utils/identity-change-handler.js +48 -0
  148. package/src/Utils/index.d.ts +44 -0
  149. package/src/Utils/index.js +44 -0
  150. package/src/Utils/link-preview-metadata.d.ts +47 -0
  151. package/src/Utils/link-preview-metadata.js +88 -0
  152. package/src/Utils/link-preview.d.ts +12 -0
  153. package/src/Utils/link-preview.js +79 -0
  154. package/src/Utils/logger.d.ts +2 -0
  155. package/src/Utils/logger.js +2 -0
  156. package/src/Utils/lt-hash.d.ts +6 -0
  157. package/src/Utils/lt-hash.js +3 -0
  158. package/src/Utils/make-mutex.d.ts +6 -0
  159. package/src/Utils/make-mutex.js +32 -0
  160. package/src/Utils/message-retry-manager.d.ts +79 -0
  161. package/src/Utils/message-retry-manager.js +255 -0
  162. package/src/Utils/messages-media.d.ts +136 -0
  163. package/src/Utils/messages-media.js +814 -0
  164. package/src/Utils/messages.d.ts +62 -0
  165. package/src/Utils/messages.js +2223 -0
  166. package/src/Utils/mobile-companion-crypto.js +191 -0
  167. package/src/Utils/modern-messages.d.ts +150 -0
  168. package/src/Utils/modern-messages.js +496 -0
  169. package/src/Utils/native-flow.d.ts +11 -0
  170. package/src/Utils/native-flow.js +115 -0
  171. package/src/Utils/newsletter-status.d.ts +158 -0
  172. package/src/Utils/newsletter-status.js +651 -0
  173. package/src/Utils/noise-handler.d.ts +20 -0
  174. package/src/Utils/noise-handler.js +200 -0
  175. package/src/Utils/offline-node-processor.d.ts +9 -0
  176. package/src/Utils/offline-node-processor.js +33 -0
  177. package/src/Utils/optional-media.d.ts +3 -0
  178. package/src/Utils/optional-media.js +45 -0
  179. package/src/Utils/payment-messages.d.ts +66 -0
  180. package/src/Utils/payment-messages.js +160 -0
  181. package/src/Utils/pre-key-manager.d.ts +25 -0
  182. package/src/Utils/pre-key-manager.js +95 -0
  183. package/src/Utils/process-message.d.ts +60 -0
  184. package/src/Utils/process-message.js +688 -0
  185. package/src/Utils/reporting-utils.d.ts +12 -0
  186. package/src/Utils/reporting-utils.js +256 -0
  187. package/src/Utils/scheduled-message.d.ts +51 -0
  188. package/src/Utils/scheduled-message.js +112 -0
  189. package/src/Utils/sender-key-memory.d.ts +19 -0
  190. package/src/Utils/sender-key-memory.js +51 -0
  191. package/src/Utils/signal.d.ts +82 -0
  192. package/src/Utils/signal.js +193 -0
  193. package/src/Utils/stanza-ack.d.ts +16 -0
  194. package/src/Utils/stanza-ack.js +30 -0
  195. package/src/Utils/status-stickers.d.ts +127 -0
  196. package/src/Utils/status-stickers.js +260 -0
  197. package/src/Utils/sync-action-utils.d.ts +2 -0
  198. package/src/Utils/sync-action-utils.js +44 -0
  199. package/src/Utils/tc-token-utils.d.ts +29 -0
  200. package/src/Utils/tc-token-utils.js +155 -0
  201. package/src/Utils/ttl-cache.d.ts +28 -0
  202. package/src/Utils/ttl-cache.js +120 -0
  203. package/src/Utils/use-mongo-auth-state.d.ts +21 -0
  204. package/src/Utils/use-mongo-auth-state.js +67 -0
  205. package/src/Utils/use-multi-file-auth-state.d.ts +11 -0
  206. package/src/Utils/use-multi-file-auth-state.js +106 -0
  207. package/src/Utils/use-mysql-auth-state.d.ts +19 -0
  208. package/src/Utils/use-mysql-auth-state.js +79 -0
  209. package/src/Utils/use-postgres-auth-state.d.ts +19 -0
  210. package/src/Utils/use-postgres-auth-state.js +79 -0
  211. package/src/Utils/use-redis-auth-state.d.ts +19 -0
  212. package/src/Utils/use-redis-auth-state.js +89 -0
  213. package/src/Utils/use-single-file-auth-state.d.ts +10 -0
  214. package/src/Utils/use-single-file-auth-state.js +108 -0
  215. package/src/Utils/use-sqlite-auth-state.d.ts +12 -0
  216. package/src/Utils/use-sqlite-auth-state.js +120 -0
  217. package/src/Utils/useNekoDBAuth.d.ts +19 -0
  218. package/src/Utils/useNekoDBAuth.js +111 -0
  219. package/src/Utils/username.d.ts +12 -0
  220. package/src/Utils/username.js +58 -0
  221. package/src/Utils/validate-connection.d.ts +43 -0
  222. package/src/Utils/validate-connection.js +277 -0
  223. package/src/Utils/voice-recognition.d.ts +53 -0
  224. package/src/Utils/voice-recognition.js +219 -0
  225. package/src/Voip/audio-feeder.d.ts +24 -0
  226. package/src/Voip/audio-feeder.js +268 -0
  227. package/src/Voip/index.d.ts +88 -0
  228. package/src/Voip/index.js +936 -0
  229. package/src/Voip/relay-transport.d.ts +5 -0
  230. package/src/Voip/relay-transport.js +824 -0
  231. package/src/Voip/signaling.d.ts +11 -0
  232. package/src/Voip/signaling.js +1099 -0
  233. package/src/Voip/types.d.ts +2 -0
  234. package/src/Voip/types.js +12 -0
  235. package/src/Voip/video-feeder.d.ts +24 -0
  236. package/src/Voip/video-feeder.js +268 -0
  237. package/src/Voip/wasm-engine.d.ts +26 -0
  238. package/src/Voip/wasm-engine.js +1307 -0
  239. package/src/Voip/worker-bootstrap.js +1023 -0
  240. package/src/WABinary/constants.d.ts +22 -0
  241. package/src/WABinary/constants.js +1300 -0
  242. package/src/WABinary/decode.d.ts +9 -0
  243. package/src/WABinary/decode.js +261 -0
  244. package/src/WABinary/encode.d.ts +2 -0
  245. package/src/WABinary/encode.js +219 -0
  246. package/src/WABinary/generic-utils.d.ts +76 -0
  247. package/src/WABinary/generic-utils.js +214 -0
  248. package/src/WABinary/index.d.ts +5 -0
  249. package/src/WABinary/index.js +5 -0
  250. package/src/WABinary/jid-utils.d.ts +30 -0
  251. package/src/WABinary/jid-utils.js +97 -0
  252. package/src/WABinary/types.d.ts +1 -0
  253. package/src/WABinary/types.js +0 -0
  254. package/src/WAM/BinaryInfo.d.ts +7 -0
  255. package/src/WAM/BinaryInfo.js +9 -0
  256. package/src/WAM/constants.d.ts +34926 -0
  257. package/src/WAM/constants.js +22852 -0
  258. package/src/WAM/encode.d.ts +1 -0
  259. package/src/WAM/encode.js +148 -0
  260. package/src/WAM/index.d.ts +3 -0
  261. package/src/WAM/index.js +3 -0
  262. package/src/WAUSync/Protocols/USyncContactProtocol.d.ts +36 -0
  263. package/src/WAUSync/Protocols/USyncContactProtocol.js +50 -0
  264. package/src/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
  265. package/src/WAUSync/Protocols/USyncDeviceProtocol.js +51 -0
  266. package/src/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  267. package/src/WAUSync/Protocols/USyncDisappearingModeProtocol.js +26 -0
  268. package/src/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  269. package/src/WAUSync/Protocols/USyncStatusProtocol.js +37 -0
  270. package/src/WAUSync/Protocols/USyncUsernameProtocol.d.ts +9 -0
  271. package/src/WAUSync/Protocols/USyncUsernameProtocol.js +23 -0
  272. package/src/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +38 -0
  273. package/src/WAUSync/Protocols/UsyncBotProfileProtocol.js +49 -0
  274. package/src/WAUSync/Protocols/UsyncLIDProtocol.d.ts +14 -0
  275. package/src/WAUSync/Protocols/UsyncLIDProtocol.js +28 -0
  276. package/src/WAUSync/Protocols/index.d.ts +5 -0
  277. package/src/WAUSync/Protocols/index.js +5 -0
  278. package/src/WAUSync/USyncQuery.d.ts +20 -0
  279. package/src/WAUSync/USyncQuery.js +93 -0
  280. package/src/WAUSync/USyncUser.d.ts +16 -0
  281. package/src/WAUSync/USyncUser.js +30 -0
  282. package/src/WAUSync/index.d.ts +3 -0
  283. package/src/WAUSync/index.js +3 -0
  284. package/src/assets/wasm/README.md +76 -0
  285. package/src/assets/wasm/loader.js +5 -0
  286. package/src/assets/wasm/whatsapp.wasm +0 -0
  287. package/src/assets/wasm/worker-modules.js +273 -0
  288. package/src/index.d.ts +43 -0
  289. package/src/index.js +48 -0
@@ -0,0 +1,24 @@
1
+
2
+ export var LabelColor;
3
+ (function (LabelColor) {
4
+ LabelColor[LabelColor["Color1"] = 0] = "Color1";
5
+ LabelColor[LabelColor["Color2"] = 1] = "Color2";
6
+ LabelColor[LabelColor["Color3"] = 2] = "Color3";
7
+ LabelColor[LabelColor["Color4"] = 3] = "Color4";
8
+ LabelColor[LabelColor["Color5"] = 4] = "Color5";
9
+ LabelColor[LabelColor["Color6"] = 5] = "Color6";
10
+ LabelColor[LabelColor["Color7"] = 6] = "Color7";
11
+ LabelColor[LabelColor["Color8"] = 7] = "Color8";
12
+ LabelColor[LabelColor["Color9"] = 8] = "Color9";
13
+ LabelColor[LabelColor["Color10"] = 9] = "Color10";
14
+ LabelColor[LabelColor["Color11"] = 10] = "Color11";
15
+ LabelColor[LabelColor["Color12"] = 11] = "Color12";
16
+ LabelColor[LabelColor["Color13"] = 12] = "Color13";
17
+ LabelColor[LabelColor["Color14"] = 13] = "Color14";
18
+ LabelColor[LabelColor["Color15"] = 14] = "Color15";
19
+ LabelColor[LabelColor["Color16"] = 15] = "Color16";
20
+ LabelColor[LabelColor["Color17"] = 16] = "Color17";
21
+ LabelColor[LabelColor["Color18"] = 17] = "Color18";
22
+ LabelColor[LabelColor["Color19"] = 18] = "Color19";
23
+ LabelColor[LabelColor["Color20"] = 19] = "Color20";
24
+ })(LabelColor || (LabelColor = {}));
@@ -0,0 +1,2 @@
1
+ /** Association type */
2
+ export const LabelAssociationType: any;
@@ -0,0 +1,6 @@
1
+
2
+ export var LabelAssociationType;
3
+ (function (LabelAssociationType) {
4
+ LabelAssociationType["Chat"] = "label_jid";
5
+ LabelAssociationType["Message"] = "label_message";
6
+ })(LabelAssociationType || (LabelAssociationType = {}));
@@ -0,0 +1,13 @@
1
+ export { proto as WAProto };
2
+ export const AssociationType: typeof proto.MessageAssociation.AssociationType;
3
+ export const ButtonHeaderType: typeof proto.Message.ButtonsMessage.HeaderType;
4
+ export const ButtonType: typeof proto.Message.ButtonsMessage.Button.Type;
5
+ export const CarouselCardType: typeof proto.Message.InteractiveMessage.CarouselMessage.CarouselCardType;
6
+ export const ListType: typeof proto.Message.ListMessage.ListType;
7
+ export const StatusFont: typeof proto.Message.ExtendedTextMessage.FontType;
8
+ export const StatusNotificationType: Readonly<Record<string, number>>;
9
+ export const ProtocolType: typeof proto.Message.ProtocolMessage.Type;
10
+ export const WAMessageStubType: typeof proto.WebMessageInfo.StubType;
11
+ export const WAMessageStatus: typeof proto.WebMessageInfo.Status;
12
+ export const WAMessageAddressingMode: any;
13
+ import { proto } from '../../WAProto/index.js';
@@ -0,0 +1,23 @@
1
+ import { proto } from '../../WAProto/index.js';
2
+
3
+ export { proto as WAProto };
4
+
5
+ export const AssociationType = proto.MessageAssociation.AssociationType;
6
+ export const ButtonHeaderType = proto.Message.ButtonsMessage.HeaderType;
7
+ export const ButtonType = proto.Message.ButtonsMessage.Button.Type;
8
+ export const CarouselCardType = proto.Message.InteractiveMessage.CarouselMessage.CarouselCardType;
9
+ export const ListType = proto.Message.ListMessage.ListType;
10
+ export const StatusFont = proto.Message.ExtendedTextMessage.FontType;
11
+
12
+ export const StatusNotificationType = Object.freeze({
13
+ ...proto.Message.StatusNotificationMessage.StatusNotificationType,
14
+ STATUS_GROUP_STATUS_REPLY: 4
15
+ });
16
+ export const ProtocolType = proto.Message.ProtocolMessage.Type;
17
+ export const WAMessageStubType = proto.WebMessageInfo.StubType;
18
+ export const WAMessageStatus = proto.WebMessageInfo.Status;
19
+ export var WAMessageAddressingMode;
20
+ (function (WAMessageAddressingMode) {
21
+ WAMessageAddressingMode["PN"] = "pn";
22
+ WAMessageAddressingMode["LID"] = "lid";
23
+ })(WAMessageAddressingMode || (WAMessageAddressingMode = {}));
@@ -0,0 +1,2 @@
1
+ export const XWAPaths: any;
2
+ export const QueryIds: any;
@@ -0,0 +1,95 @@
1
+ export var XWAPaths;
2
+ (function (XWAPaths) {
3
+ XWAPaths["xwa2_newsletter_create"] = "xwa2_newsletter_create";
4
+ XWAPaths["xwa2_newsletter_subscribed"] = "xwa2_newsletter_subscribed";
5
+ XWAPaths["xwa2_newsletter_metadata"] = "xwa2_newsletter";
6
+ XWAPaths["xwa2_newsletter_admin_count"] = "xwa2_newsletter_admin";
7
+ XWAPaths["xwa2_channel_enforcements"] = "xwa2_channel_enforcements";
8
+ XWAPaths["xwa2_channels_reports"] = "xwa2_channels_reports";
9
+ XWAPaths["xwa2_create_channel_report_appeal_v2"] = "xwa2_create_channel_report_appeal_v2";
10
+ XWAPaths["xwa2_newsletter_update_user_setting"] = "xwa2_newsletter_update_user_setting";
11
+ XWAPaths["xwa2_newsletter_join_v2"] = "xwa2_newsletter_join_v2";
12
+ XWAPaths["xwa2_newsletter_leave_v2"] = "xwa2_newsletter_leave_v2";
13
+ XWAPaths["xwa2_newsletter_change_owner"] = "xwa2_newsletter_change_owner";
14
+ XWAPaths["xwa2_newsletter_demote"] = "xwa2_newsletter_admin_demote";
15
+ XWAPaths["xwa2_newsletter_delete_v2"] = "xwa2_newsletter_delete_v2";
16
+ XWAPaths["xwa2_fetch_account_reachout_timelock"] = "xwa2_fetch_account_reachout_timelock";
17
+ XWAPaths["xwa2_message_capping_info"] = "xwa2_message_capping_info";
18
+ XWAPaths["xwa2_newsletter_admin_capabilities"] = "xwa2_newsletter_admin";
19
+ XWAPaths["xwa2_newsletter_admin_info"] = "xwa2_newsletter_admin";
20
+ XWAPaths["admin_profile"] = "xwa2_newsletter_admin";
21
+ XWAPaths["voter_list"] = "voter_list";
22
+ XWAPaths["xwa2_newsletters_reaction_sender_list"] = "xwa2_newsletters_reaction_sender_list";
23
+ XWAPaths["xwa2_newsletter_pin_messages"] = "xwa2_newsletter_pin_messages";
24
+ XWAPaths["xwa2_newsletter_unpin_messages"] = "xwa2_newsletter_unpin_messages";
25
+ XWAPaths["xwa2_newsletter_label_ai_content"] = "xwa2_newsletter_label_ai_content";
26
+ XWAPaths["xwa2_newsletter_label_paid_partnership"] = "xwa2_newsletter_label_paid_partnership";
27
+ XWAPaths["xwa2_newsletter_admin_invite_create"] = "xwa2_newsletter_admin_invite_create";
28
+ XWAPaths["xwa2_newsletter_admin_invite_revoke"] = "xwa2_newsletter_admin_invite_revoke";
29
+ XWAPaths["xwa2_newsletter_admin_invite_accept"] = "xwa2_newsletter_admin_invite_accept";
30
+ XWAPaths["xwa2_newsletters_recommended"] = "xwa2_newsletters_recommended";
31
+ XWAPaths["xwa2_newsletters_similar"] = "xwa2_newsletters_similar";
32
+ XWAPaths["xwa2_username_get"] = "xwa2_username_get";
33
+ XWAPaths["xwa2_username_set"] = "xwa2_username_set";
34
+ XWAPaths["xwa2_username_pin_set"] = "xwa2_username_pin_set";
35
+ XWAPaths["xwa2_update_text_status"] = "xwa2_update_text_status";
36
+ XWAPaths["xwa2_text_status_list"] = "xwa2_text_status_list";
37
+ XWAPaths["xwa2_users_updates_since"] = "xwa2_users_updates_since";
38
+ XWAPaths["xwa2_newsletter_link_preview"] = "xwa2_newsletter_link_preview";
39
+ XWAPaths["xwa2_newsletter_admin_insights"] = "xwa2_newsletter_admin_insights";
40
+ XWAPaths["xwa2_newsletter_followers"] = "xwa2_newsletter_followers";
41
+ XWAPaths["pending_admin_invites"] = "xwa2_newsletter_admin";
42
+ XWAPaths["xwa2_newsletter_question_response_state_update"] = "xwa2_newsletter_question_response_state_update";
43
+ XWAPaths["xwa2_username_check"] = "xwa2_username_check";
44
+ XWAPaths["xwa2_newsletters_directory_list"] = "xwa2_newsletters_directory_list";
45
+ XWAPaths["xwa2_newsletters_directory_search"] = "xwa2_newsletters_directory_search";
46
+ XWAPaths["xwa2_newsletters_directory_category_preview"] = "xwa2_newsletters_directory_category_preview";
47
+ })(XWAPaths || (XWAPaths = {}));
48
+ export var QueryIds;
49
+ (function (QueryIds) {
50
+ QueryIds["CREATE"] = "25149874324715067";
51
+ QueryIds["UPDATE_METADATA"] = "24250201037901610";
52
+ QueryIds["METADATA"] = "27456920720571478";
53
+ QueryIds["SUBSCRIBERS"] = "27472091235714801";
54
+ QueryIds["SUBSCRIBED"] = "25399611239711790";
55
+ QueryIds["FOLLOW"] = "24404358912487870";
56
+ QueryIds["UNFOLLOW"] = "9767147403369991";
57
+ QueryIds["ENFORCEMENTS"] = "27835373536068060";
58
+ QueryIds["CHANNEL_REPORTS"] = "35936238352686172";
59
+ QueryIds["CREATE_REPORT_APPEAL"] = "27103316329328467";
60
+ QueryIds["UPDATE_USER_SETTING"] = "31938993655691868";
61
+ QueryIds["ADMIN_COUNT"] = "26278439461859188";
62
+ QueryIds["CHANGE_OWNER"] = "9546742745432473";
63
+ QueryIds["DEMOTE"] = "9880997548630971";
64
+ QueryIds["DELETE"] = "30062808666639665";
65
+ QueryIds["REACHOUT_TIMELOCK"] = "23983697327930364";
66
+ QueryIds["MESSAGE_CAPPING_INFO"] = "27910975521856601";
67
+ QueryIds["ADMIN_CAPABILITIES"] = "9801384413216421";
68
+ QueryIds["ADMIN_INFO"] = "26278439461859188";
69
+ QueryIds["POLL_VOTERS"] = "9407762219322536";
70
+ QueryIds["REACTION_SENDER_LIST"] = "29575462448733991";
71
+ QueryIds["PIN_MESSAGES"] = "27165709459706559";
72
+ QueryIds["UNPIN_MESSAGES"] = "28007176042216937";
73
+ QueryIds["LABEL_AI_CONTENT"] = "27909718265289596";
74
+ QueryIds["PAID_PARTNERSHIP_LABEL"] = "26102375079404865";
75
+ QueryIds["CREATE_ADMIN_INVITE"] = "9387141988078609";
76
+ QueryIds["REVOKE_ADMIN_INVITE"] = "9656078347839416";
77
+ QueryIds["ACCEPT_ADMIN_INVITE"] = "9580828702035549";
78
+ QueryIds["RECOMMENDED"] = "25806748772361516";
79
+ QueryIds["SIMILAR"] = "26217043484590756";
80
+ QueryIds["USERNAME_GET"] = "25347099718279209";
81
+ QueryIds["USERNAME_SET"] = "25757341163897635";
82
+ QueryIds["USERNAME_PIN_SET"] = "9749436995157074";
83
+ QueryIds["UPDATE_TEXT_STATUS"] = "9152604461510864";
84
+ QueryIds["TEXT_STATUS_LIST"] = "24072923595647473";
85
+ QueryIds["ABOUT_STATUS"] = "24535500086059408";
86
+ QueryIds["PLAINTEXT_LINK_PREVIEW"] = "9101130456653613";
87
+ QueryIds["INSIGHTS"] = "9853618868050977";
88
+ QueryIds["FOLLOWERS"] = "27472091235714801";
89
+ QueryIds["PENDING_ADMIN_INVITES"] = "28049623068067370";
90
+ QueryIds["QUESTION_RESPONSE_STATE"] = "24636260219323456";
91
+ QueryIds["USERNAME_CHECK"] = "26122779627399568";
92
+ QueryIds["DIRECTORY_LIST"] = "26125047313831973";
93
+ QueryIds["DIRECTORY_SEARCH"] = "26301059626252132";
94
+ QueryIds["DIRECTORY_CATEGORIES"] = "35266481849605779";
95
+ })(QueryIds || (QueryIds = {}));
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
File without changes
@@ -0,0 +1 @@
1
+ export {};
File without changes
@@ -0,0 +1,5 @@
1
+ export const SyncState: any;
2
+ export const ReachoutTimelockEnforcementType: any;
3
+ export const NewChatMessageCappingStatusType: any;
4
+ export const NewChatMessageCappingMVStatusType: any;
5
+ export const NewChatMessageCappingOTEStatusType: any;
@@ -0,0 +1,54 @@
1
+ export var SyncState;
2
+ (function (SyncState) {
3
+
4
+ SyncState[SyncState["Connecting"] = 0] = "Connecting";
5
+
6
+ SyncState[SyncState["AwaitingInitialSync"] = 1] = "AwaitingInitialSync";
7
+
8
+ SyncState[SyncState["Syncing"] = 2] = "Syncing";
9
+
10
+ SyncState[SyncState["Online"] = 3] = "Online";
11
+ })(SyncState || (SyncState = {}));
12
+ export var ReachoutTimelockEnforcementType;
13
+ (function (ReachoutTimelockEnforcementType) {
14
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ALCOHOL"] = "BIZ_COMMERCE_VIOLATION_ALCOHOL";
15
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ADULT"] = "BIZ_COMMERCE_VIOLATION_ADULT";
16
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ANIMALS"] = "BIZ_COMMERCE_VIOLATION_ANIMALS";
17
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS"] = "BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS";
18
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DATING"] = "BIZ_COMMERCE_VIOLATION_DATING";
19
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS"] = "BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS";
20
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DRUGS"] = "BIZ_COMMERCE_VIOLATION_DRUGS";
21
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC"] = "BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC";
22
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_GAMBLING"] = "BIZ_COMMERCE_VIOLATION_GAMBLING";
23
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_HEALTHCARE"] = "BIZ_COMMERCE_VIOLATION_HEALTHCARE";
24
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY"] = "BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY";
25
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_SUPPLEMENTS"] = "BIZ_COMMERCE_VIOLATION_SUPPLEMENTS";
26
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_TOBACCO"] = "BIZ_COMMERCE_VIOLATION_TOBACCO";
27
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT"] = "BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT";
28
+ ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_WEAPONS"] = "BIZ_COMMERCE_VIOLATION_WEAPONS";
29
+ ReachoutTimelockEnforcementType["BIZ_QUALITY"] = "BIZ_QUALITY";
30
+
31
+ ReachoutTimelockEnforcementType["DEFAULT"] = "DEFAULT";
32
+ ReachoutTimelockEnforcementType["WEB_COMPANION_ONLY"] = "WEB_COMPANION_ONLY";
33
+ })(ReachoutTimelockEnforcementType || (ReachoutTimelockEnforcementType = {}));
34
+ export var NewChatMessageCappingStatusType;
35
+ (function (NewChatMessageCappingStatusType) {
36
+ NewChatMessageCappingStatusType["NONE"] = "NONE";
37
+ NewChatMessageCappingStatusType["FIRST_WARNING"] = "FIRST_WARNING";
38
+ NewChatMessageCappingStatusType["SECOND_WARNING"] = "SECOND_WARNING";
39
+ NewChatMessageCappingStatusType["CAPPED"] = "CAPPED";
40
+ })(NewChatMessageCappingStatusType || (NewChatMessageCappingStatusType = {}));
41
+ export var NewChatMessageCappingMVStatusType;
42
+ (function (NewChatMessageCappingMVStatusType) {
43
+ NewChatMessageCappingMVStatusType["NOT_ELIGIBLE"] = "NOT_ELIGIBLE";
44
+ NewChatMessageCappingMVStatusType["NOT_ACTIVE"] = "NOT_ACTIVE";
45
+ NewChatMessageCappingMVStatusType["ACTIVE"] = "ACTIVE";
46
+ NewChatMessageCappingMVStatusType["ACTIVE_UPGRADE_AVAILABLE"] = "ACTIVE_UPGRADE_AVAILABLE";
47
+ })(NewChatMessageCappingMVStatusType || (NewChatMessageCappingMVStatusType = {}));
48
+ export var NewChatMessageCappingOTEStatusType;
49
+ (function (NewChatMessageCappingOTEStatusType) {
50
+ NewChatMessageCappingOTEStatusType["NOT_ELIGIBLE"] = "NOT_ELIGIBLE";
51
+ NewChatMessageCappingOTEStatusType["ELIGIBLE"] = "ELIGIBLE";
52
+ NewChatMessageCappingOTEStatusType["ACTIVE_IN_CURRENT_CYCLE"] = "ACTIVE_IN_CURRENT_CYCLE";
53
+ NewChatMessageCappingOTEStatusType["EXHAUSTED"] = "EXHAUSTED";
54
+ })(NewChatMessageCappingOTEStatusType || (NewChatMessageCappingOTEStatusType = {}));
@@ -0,0 +1 @@
1
+ export {};
File without changes
@@ -0,0 +1,13 @@
1
+ export * from "./Auth.js";
2
+ export * from "./GroupMetadata.js";
3
+ export * from "./Chat.js";
4
+ export * from "./Contact.js";
5
+ export * from "./State.js";
6
+ export * from "./Message.js";
7
+ export * from "./Socket.js";
8
+ export * from "./Events.js";
9
+ export * from "./Product.js";
10
+ export * from "./Call.js";
11
+ export * from "./Signal.js";
12
+ export * from "./Mex.js";
13
+ export const DisconnectReason: any;
@@ -0,0 +1,25 @@
1
+ export * from './Auth.js';
2
+ export * from './GroupMetadata.js';
3
+ export * from './Chat.js';
4
+ export * from './Contact.js';
5
+ export * from './State.js';
6
+ export * from './Message.js';
7
+ export * from './Socket.js';
8
+ export * from './Events.js';
9
+ export * from './Product.js';
10
+ export * from './Call.js';
11
+ export * from './Signal.js';
12
+ export * from './Mex.js';
13
+ export var DisconnectReason;
14
+ (function (DisconnectReason) {
15
+ DisconnectReason[DisconnectReason["connectionClosed"] = 428] = "connectionClosed";
16
+ DisconnectReason[DisconnectReason["connectionLost"] = 408] = "connectionLost";
17
+ DisconnectReason[DisconnectReason["connectionReplaced"] = 440] = "connectionReplaced";
18
+ DisconnectReason[DisconnectReason["timedOut"] = 408] = "timedOut";
19
+ DisconnectReason[DisconnectReason["loggedOut"] = 401] = "loggedOut";
20
+ DisconnectReason[DisconnectReason["badSession"] = 500] = "badSession";
21
+ DisconnectReason[DisconnectReason["restartRequired"] = 515] = "restartRequired";
22
+ DisconnectReason[DisconnectReason["multideviceMismatch"] = 411] = "multideviceMismatch";
23
+ DisconnectReason[DisconnectReason["forbidden"] = 403] = "forbidden";
24
+ DisconnectReason[DisconnectReason["unavailableService"] = 503] = "unavailableService";
25
+ })(DisconnectReason || (DisconnectReason = {}));
@@ -0,0 +1,29 @@
1
+ export const CREDS_KEY: string;
2
+ export function encodeAuthValue(value: any): string;
3
+ export function decodeAuthValue(type: string, raw: any): any;
4
+ export function loadOptionalModule(name: string, usedBy: string): Promise<any>;
5
+ export interface AuthStoreEntry {
6
+ type: string;
7
+ id: string;
8
+ value: string;
9
+ }
10
+ export interface AuthStore {
11
+ read: (type: string, id: string) => Promise<any>;
12
+ readMany: (type: string, ids: string[]) => Promise<Record<string, any>>;
13
+ write: (type: string, id: string, value: string) => Promise<void>;
14
+ apply: (writes: AuthStoreEntry[], removals: Omit<AuthStoreEntry, 'value'>[]) => Promise<void>;
15
+ clear: () => Promise<void>;
16
+ close?: () => Promise<void>;
17
+ }
18
+ export function makeAuthStateFromStore(store: AuthStore): Promise<{
19
+ state: {
20
+ creds: any;
21
+ keys: {
22
+ get: (type: any, ids: any) => Promise<{}>;
23
+ set: (data: any) => Promise<void>;
24
+ };
25
+ };
26
+ saveCreds: () => Promise<void>;
27
+ clearAuth: () => Promise<void>;
28
+ close: () => Promise<void>;
29
+ }>;
@@ -0,0 +1,76 @@
1
+ import { proto } from '../../WAProto/index.js';
2
+ import { initAuthCreds } from './auth-utils.js';
3
+ import { BufferJSON } from './generics.js';
4
+ export const CREDS_KEY = 'creds';
5
+ export const encodeAuthValue = (value) => JSON.stringify(value, BufferJSON.replacer);
6
+ export const decodeAuthValue = (type, raw) => {
7
+ if (raw === null || raw === undefined) {
8
+ return null;
9
+ }
10
+ const value = typeof raw === 'string' ? JSON.parse(raw, BufferJSON.reviver) : raw;
11
+ if (type === 'app-state-sync-key' && value) {
12
+ return proto.Message.AppStateSyncKeyData.fromObject(value);
13
+ }
14
+ return value;
15
+ };
16
+ export const loadOptionalModule = async (name, usedBy) => {
17
+ try {
18
+ const mod = await import(name);
19
+ return mod.default ?? mod;
20
+ }
21
+ catch (err) {
22
+ const helpful = new Error(`\`${name}\` is required for \`${usedBy}\`. Install it as a peer dependency: \`npm install ${name}\`.`);
23
+ helpful.cause = err;
24
+ throw helpful;
25
+ }
26
+ };
27
+ export const makeAuthStateFromStore = async (store) => {
28
+ const stored = await store.read(CREDS_KEY, CREDS_KEY);
29
+ const creds = decodeAuthValue(CREDS_KEY, stored) ?? initAuthCreds();
30
+ const state = {
31
+ creds,
32
+ keys: {
33
+ get: async (type, ids) => {
34
+ const data = {};
35
+ const rows = await store.readMany(type, ids);
36
+ for (const id of ids) {
37
+ const value = decodeAuthValue(type, rows[id]);
38
+ if (value) {
39
+ data[id] = value;
40
+ }
41
+ }
42
+ return data;
43
+ },
44
+ set: async (data) => {
45
+ const writes = [];
46
+ const removals = [];
47
+ for (const type in data) {
48
+ for (const id in data[type]) {
49
+ const value = data[type][id];
50
+ if (value) {
51
+ writes.push({ type, id, value: encodeAuthValue(value) });
52
+ }
53
+ else {
54
+ removals.push({ type, id });
55
+ }
56
+ }
57
+ }
58
+ if (writes.length || removals.length) {
59
+ await store.apply(writes, removals);
60
+ }
61
+ }
62
+ }
63
+ };
64
+ return {
65
+ state,
66
+ saveCreds: async () => {
67
+ await store.write(CREDS_KEY, CREDS_KEY, encodeAuthValue(creds));
68
+ },
69
+ clearAuth: async () => {
70
+ await store.clear();
71
+ },
72
+ close: async () => {
73
+ await store.close?.();
74
+ }
75
+ };
76
+ };
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Adds caching capability to a SignalKeyStore
3
+ * @param store the store to add caching to
4
+ * @param logger to log trace events
5
+ * @param _cache cache store to use
6
+ */
7
+ export function makeCacheableSignalKeyStore(store: any, logger: any, _cache: any): {
8
+ get(type: any, ids: any): Promise<any>;
9
+ set(data: any): Promise<any>;
10
+ clear(): Promise<void>;
11
+ };
12
+ export function addTransactionCapability(state: any, logger: any, { maxCommitRetries, delayBetweenTriesMs }: {
13
+ maxCommitRetries: any;
14
+ delayBetweenTriesMs: any;
15
+ }): {
16
+ get: (type: any, ids: any) => Promise<any>;
17
+ set: (data: any) => Promise<void>;
18
+ isInTransaction: () => boolean;
19
+ transaction: (work: any, key: any) => Promise<any>;
20
+ };
21
+ export function assertMeId(creds: any): any;
22
+ export function initAuthCreds(): {
23
+ noiseKey: {
24
+ private: any;
25
+ public: any;
26
+ };
27
+ pairingEphemeralKeyPair: {
28
+ private: any;
29
+ public: any;
30
+ };
31
+ signedIdentityKey: {
32
+ private: any;
33
+ public: any;
34
+ };
35
+ signedPreKey: {
36
+ keyPair: {
37
+ private: any;
38
+ public: any;
39
+ };
40
+ signature: any;
41
+ keyId: any;
42
+ };
43
+ registrationId: number;
44
+ advSecretKey: any;
45
+ processedHistoryMessages: never[];
46
+ nextPreKeyId: number;
47
+ firstUnuploadedPreKeyId: number;
48
+ accountSyncCounter: number;
49
+ accountSettings: {
50
+ unarchiveChats: boolean;
51
+ };
52
+ registered: boolean;
53
+ pairingCode: undefined;
54
+ lastPropHash: undefined;
55
+ serverProps: undefined;
56
+ routingInfo: undefined;
57
+ additionalData: undefined;
58
+ };