ruby-baileys 0.0.0-stage → 1.5.17

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 (296) hide show
  1. package/EXPERIMENTAL.md +350 -0
  2. package/LICENSE +23 -0
  3. package/NOTICE.md +14 -0
  4. package/README.md +6265 -2
  5. package/WAProto/GenerateStatics.sh +3 -0
  6. package/WAProto/WAProto.proto +5479 -0
  7. package/WAProto/fix-imports.js +81 -0
  8. package/WAProto/index.d.ts +16877 -0
  9. package/WAProto/index.js +122159 -0
  10. package/assets/ruby_aspirant.jpg +0 -0
  11. package/assets/ruby_aspirant_4k.jpg +88 -0
  12. package/assets/ruby_aspirant_full.jpg +0 -0
  13. package/assets/ruby_aspirant_render.png +1 -0
  14. package/assets/ruby_aspirants_hd.jpg +0 -0
  15. package/assets/thumb.jpg +0 -0
  16. package/engine-requirements.js +14 -0
  17. package/index.cjs +29 -0
  18. package/index.d.ts +2 -0
  19. package/package.json +178 -4
  20. package/src/Defaults/index.d.ts +153 -0
  21. package/src/Defaults/index.js +165 -0
  22. package/src/MessageBuilder/bot-signature.d.ts +22 -0
  23. package/src/MessageBuilder/bot-signature.js +123 -0
  24. package/src/MessageBuilder/extras.d.ts +396 -0
  25. package/src/MessageBuilder/extras.js +1229 -0
  26. package/src/MessageBuilder/index.d.ts +210 -0
  27. package/src/MessageBuilder/index.js +3521 -0
  28. package/src/MessageBuilder/metaai.d.ts +438 -0
  29. package/src/MessageBuilder/metaai.js +891 -0
  30. package/src/Signal/Group/ciphertext-message.d.ts +10 -0
  31. package/src/Signal/Group/ciphertext-message.js +12 -0
  32. package/src/Signal/Group/group-session-builder.d.ts +8 -0
  33. package/src/Signal/Group/group-session-builder.js +28 -0
  34. package/src/Signal/Group/group_cipher.d.ts +11 -0
  35. package/src/Signal/Group/group_cipher.js +79 -0
  36. package/src/Signal/Group/index.d.ts +12 -0
  37. package/src/Signal/Group/index.js +12 -0
  38. package/src/Signal/Group/keyhelper.d.ts +7 -0
  39. package/src/Signal/Group/keyhelper.js +18 -0
  40. package/src/Signal/Group/sender-chain-key.d.ts +14 -0
  41. package/src/Signal/Group/sender-chain-key.js +26 -0
  42. package/src/Signal/Group/sender-key-distribution-message.d.ts +17 -0
  43. package/src/Signal/Group/sender-key-distribution-message.js +63 -0
  44. package/src/Signal/Group/sender-key-message.d.ts +19 -0
  45. package/src/Signal/Group/sender-key-message.js +66 -0
  46. package/src/Signal/Group/sender-key-name.d.ts +12 -0
  47. package/src/Signal/Group/sender-key-name.js +48 -0
  48. package/src/Signal/Group/sender-key-record.d.ts +13 -0
  49. package/src/Signal/Group/sender-key-record.js +41 -0
  50. package/src/Signal/Group/sender-key-state.d.ts +17 -0
  51. package/src/Signal/Group/sender-key-state.js +84 -0
  52. package/src/Signal/Group/sender-message-key.d.ts +12 -0
  53. package/src/Signal/Group/sender-message-key.js +26 -0
  54. package/src/Signal/libsignal.d.ts +55 -0
  55. package/src/Signal/libsignal.js +429 -0
  56. package/src/Signal/lid-mapping.d.ts +21 -0
  57. package/src/Signal/lid-mapping.js +275 -0
  58. package/src/Socket/Client/index.d.ts +3 -0
  59. package/src/Socket/Client/index.js +3 -0
  60. package/src/Socket/Client/types.d.ts +6 -0
  61. package/src/Socket/Client/types.js +10 -0
  62. package/src/Socket/Client/websocket.d.ts +13 -0
  63. package/src/Socket/Client/websocket.js +54 -0
  64. package/src/Socket/business.d.ts +432 -0
  65. package/src/Socket/business.js +380 -0
  66. package/src/Socket/chats.d.ts +248 -0
  67. package/src/Socket/chats.js +1485 -0
  68. package/src/Socket/communities.d.ts +599 -0
  69. package/src/Socket/communities.js +422 -0
  70. package/src/Socket/groups.d.ts +299 -0
  71. package/src/Socket/groups.js +340 -0
  72. package/src/Socket/index.d.ts +582 -0
  73. package/src/Socket/index.js +48 -0
  74. package/src/Socket/messages-recv.d.ts +371 -0
  75. package/src/Socket/messages-recv.js +1803 -0
  76. package/src/Socket/messages-send.d.ts +391 -0
  77. package/src/Socket/messages-send.js +1575 -0
  78. package/src/Socket/mex.d.ts +2 -0
  79. package/src/Socket/mex.js +45 -0
  80. package/src/Socket/newsletter.d.ts +469 -0
  81. package/src/Socket/newsletter.js +643 -0
  82. package/src/Socket/socket.d.ts +78 -0
  83. package/src/Socket/socket.js +1088 -0
  84. package/src/Store/index.d.ts +4 -0
  85. package/src/Store/index.js +4 -0
  86. package/src/Store/make-in-memory-store.d.ts +63 -0
  87. package/src/Store/make-in-memory-store.js +398 -0
  88. package/src/Store/make-ordered-dictionary.d.ts +13 -0
  89. package/src/Store/make-ordered-dictionary.js +79 -0
  90. package/src/Store/object-repository.d.ts +11 -0
  91. package/src/Store/object-repository.js +24 -0
  92. package/src/Types/Auth.d.ts +2 -0
  93. package/src/Types/Auth.js +2 -0
  94. package/src/Types/Bussines.d.ts +2 -0
  95. package/src/Types/Bussines.js +2 -0
  96. package/src/Types/Call.d.ts +2 -0
  97. package/src/Types/Call.js +2 -0
  98. package/src/Types/Chat.d.ts +3 -0
  99. package/src/Types/Chat.js +25 -0
  100. package/src/Types/Contact.d.ts +2 -0
  101. package/src/Types/Contact.js +2 -0
  102. package/src/Types/Events.d.ts +2 -0
  103. package/src/Types/Events.js +1 -0
  104. package/src/Types/GroupMetadata.d.ts +6 -0
  105. package/src/Types/GroupMetadata.js +7 -0
  106. package/src/Types/Label.d.ts +3 -0
  107. package/src/Types/Label.js +25 -0
  108. package/src/Types/LabelAssociation.d.ts +3 -0
  109. package/src/Types/LabelAssociation.js +7 -0
  110. package/src/Types/Message.d.ts +14 -0
  111. package/src/Types/Message.js +24 -0
  112. package/src/Types/Mex.d.ts +3 -0
  113. package/src/Types/Mex.js +96 -0
  114. package/src/Types/Product.d.ts +2 -0
  115. package/src/Types/Product.js +2 -0
  116. package/src/Types/Signal.d.ts +2 -0
  117. package/src/Types/Signal.js +1 -0
  118. package/src/Types/Socket.d.ts +2 -0
  119. package/src/Types/Socket.js +1 -0
  120. package/src/Types/State.d.ts +6 -0
  121. package/src/Types/State.js +55 -0
  122. package/src/Types/USync.d.ts +2 -0
  123. package/src/Types/USync.js +1 -0
  124. package/src/Types/index.d.ts +14 -0
  125. package/src/Types/index.js +26 -0
  126. package/src/Utils/auth-store.d.ts +30 -0
  127. package/src/Utils/auth-store.js +77 -0
  128. package/src/Utils/auth-utils.d.ts +59 -0
  129. package/src/Utils/auth-utils.js +274 -0
  130. package/src/Utils/browser-utils.d.ts +10 -0
  131. package/src/Utils/browser-utils.js +29 -0
  132. package/src/Utils/business.d.ts +50 -0
  133. package/src/Utils/business.js +227 -0
  134. package/src/Utils/chat-utils.d.ts +409 -0
  135. package/src/Utils/chat-utils.js +847 -0
  136. package/src/Utils/companion-reg-client-utils.d.ts +5 -0
  137. package/src/Utils/companion-reg-client-utils.js +40 -0
  138. package/src/Utils/crypto.d.ts +40 -0
  139. package/src/Utils/crypto.js +111 -0
  140. package/src/Utils/decode-wa-message.d.ts +100 -0
  141. package/src/Utils/decode-wa-message.js +374 -0
  142. package/src/Utils/event-buffer.d.ts +23 -0
  143. package/src/Utils/event-buffer.js +625 -0
  144. package/src/Utils/generics.d.ts +64 -0
  145. package/src/Utils/generics.js +376 -0
  146. package/src/Utils/group-metadata-cache.d.ts +5 -0
  147. package/src/Utils/group-metadata-cache.js +26 -0
  148. package/src/Utils/history.d.ts +76 -0
  149. package/src/Utils/history.js +132 -0
  150. package/src/Utils/html-app.d.ts +19 -0
  151. package/src/Utils/html-app.js +97 -0
  152. package/src/Utils/html-multiplayer.d.ts +10 -0
  153. package/src/Utils/html-multiplayer.js +95 -0
  154. package/src/Utils/identity-change-handler.d.ts +14 -0
  155. package/src/Utils/identity-change-handler.js +49 -0
  156. package/src/Utils/index.d.ts +45 -0
  157. package/src/Utils/index.js +45 -0
  158. package/src/Utils/link-preview-metadata.d.ts +47 -0
  159. package/src/Utils/link-preview-metadata.js +89 -0
  160. package/src/Utils/link-preview.d.ts +13 -0
  161. package/src/Utils/link-preview.js +80 -0
  162. package/src/Utils/logger.d.ts +3 -0
  163. package/src/Utils/logger.js +3 -0
  164. package/src/Utils/lt-hash.d.ts +7 -0
  165. package/src/Utils/lt-hash.js +4 -0
  166. package/src/Utils/make-mutex.d.ts +7 -0
  167. package/src/Utils/make-mutex.js +33 -0
  168. package/src/Utils/message-retry-manager.d.ts +80 -0
  169. package/src/Utils/message-retry-manager.js +256 -0
  170. package/src/Utils/messages-media.d.ts +137 -0
  171. package/src/Utils/messages-media.js +815 -0
  172. package/src/Utils/messages.d.ts +63 -0
  173. package/src/Utils/messages.js +2149 -0
  174. package/src/Utils/modern-messages.d.ts +150 -0
  175. package/src/Utils/modern-messages.js +496 -0
  176. package/src/Utils/native-flow.d.ts +11 -0
  177. package/src/Utils/native-flow.js +116 -0
  178. package/src/Utils/newsletter-status.d.ts +158 -0
  179. package/src/Utils/newsletter-status.js +651 -0
  180. package/src/Utils/noise-handler.d.ts +21 -0
  181. package/src/Utils/noise-handler.js +201 -0
  182. package/src/Utils/offline-node-processor.d.ts +10 -0
  183. package/src/Utils/offline-node-processor.js +34 -0
  184. package/src/Utils/optional-media.d.ts +3 -0
  185. package/src/Utils/optional-media.js +46 -0
  186. package/src/Utils/payment-messages.d.ts +66 -0
  187. package/src/Utils/payment-messages.js +161 -0
  188. package/src/Utils/pre-key-manager.d.ts +26 -0
  189. package/src/Utils/pre-key-manager.js +96 -0
  190. package/src/Utils/process-message.d.ts +61 -0
  191. package/src/Utils/process-message.js +689 -0
  192. package/src/Utils/reporting-utils.d.ts +13 -0
  193. package/src/Utils/reporting-utils.js +257 -0
  194. package/src/Utils/scheduled-message.d.ts +51 -0
  195. package/src/Utils/scheduled-message.js +113 -0
  196. package/src/Utils/sender-key-memory.d.ts +20 -0
  197. package/src/Utils/sender-key-memory.js +52 -0
  198. package/src/Utils/signal.d.ts +83 -0
  199. package/src/Utils/signal.js +194 -0
  200. package/src/Utils/stanza-ack.d.ts +17 -0
  201. package/src/Utils/stanza-ack.js +31 -0
  202. package/src/Utils/status-stickers.d.ts +127 -0
  203. package/src/Utils/status-stickers.js +261 -0
  204. package/src/Utils/sync-action-utils.d.ts +3 -0
  205. package/src/Utils/sync-action-utils.js +45 -0
  206. package/src/Utils/tc-token-utils.d.ts +30 -0
  207. package/src/Utils/tc-token-utils.js +156 -0
  208. package/src/Utils/ttl-cache.d.ts +29 -0
  209. package/src/Utils/ttl-cache.js +121 -0
  210. package/src/Utils/use-mongo-auth-state.d.ts +22 -0
  211. package/src/Utils/use-mongo-auth-state.js +68 -0
  212. package/src/Utils/use-multi-file-auth-state.d.ts +12 -0
  213. package/src/Utils/use-multi-file-auth-state.js +107 -0
  214. package/src/Utils/use-mysql-auth-state.d.ts +20 -0
  215. package/src/Utils/use-mysql-auth-state.js +80 -0
  216. package/src/Utils/use-postgres-auth-state.d.ts +20 -0
  217. package/src/Utils/use-postgres-auth-state.js +80 -0
  218. package/src/Utils/use-redis-auth-state.d.ts +20 -0
  219. package/src/Utils/use-redis-auth-state.js +90 -0
  220. package/src/Utils/use-single-file-auth-state.d.ts +11 -0
  221. package/src/Utils/use-single-file-auth-state.js +109 -0
  222. package/src/Utils/use-sqlite-auth-state.d.ts +13 -0
  223. package/src/Utils/use-sqlite-auth-state.js +121 -0
  224. package/src/Utils/useNekoDBAuth.d.ts +19 -0
  225. package/src/Utils/useNekoDBAuth.js +111 -0
  226. package/src/Utils/username.d.ts +12 -0
  227. package/src/Utils/username.js +59 -0
  228. package/src/Utils/validate-connection.d.ts +44 -0
  229. package/src/Utils/validate-connection.js +208 -0
  230. package/src/Utils/voice-recognition.d.ts +53 -0
  231. package/src/Utils/voice-recognition.js +219 -0
  232. package/src/Voip/audio-feeder.d.ts +25 -0
  233. package/src/Voip/audio-feeder.js +269 -0
  234. package/src/Voip/index.d.ts +89 -0
  235. package/src/Voip/index.js +937 -0
  236. package/src/Voip/relay-transport.d.ts +6 -0
  237. package/src/Voip/relay-transport.js +825 -0
  238. package/src/Voip/signaling.d.ts +12 -0
  239. package/src/Voip/signaling.js +1100 -0
  240. package/src/Voip/types.d.ts +3 -0
  241. package/src/Voip/types.js +13 -0
  242. package/src/Voip/video-feeder.d.ts +25 -0
  243. package/src/Voip/video-feeder.js +269 -0
  244. package/src/Voip/wasm-engine.d.ts +27 -0
  245. package/src/Voip/wasm-engine.js +1308 -0
  246. package/src/Voip/worker-bootstrap.js +1024 -0
  247. package/src/WABinary/constants.d.ts +23 -0
  248. package/src/WABinary/constants.js +1301 -0
  249. package/src/WABinary/decode.d.ts +10 -0
  250. package/src/WABinary/decode.js +262 -0
  251. package/src/WABinary/encode.d.ts +3 -0
  252. package/src/WABinary/encode.js +220 -0
  253. package/src/WABinary/generic-utils.d.ts +77 -0
  254. package/src/WABinary/generic-utils.js +214 -0
  255. package/src/WABinary/index.d.ts +6 -0
  256. package/src/WABinary/index.js +6 -0
  257. package/src/WABinary/jid-utils.d.ts +31 -0
  258. package/src/WABinary/jid-utils.js +98 -0
  259. package/src/WABinary/types.d.ts +2 -0
  260. package/src/WABinary/types.js +1 -0
  261. package/src/WAM/BinaryInfo.d.ts +8 -0
  262. package/src/WAM/BinaryInfo.js +10 -0
  263. package/src/WAM/constants.d.ts +34927 -0
  264. package/src/WAM/constants.js +22853 -0
  265. package/src/WAM/encode.d.ts +2 -0
  266. package/src/WAM/encode.js +149 -0
  267. package/src/WAM/index.d.ts +4 -0
  268. package/src/WAM/index.js +4 -0
  269. package/src/WAUSync/Protocols/USyncContactProtocol.d.ts +37 -0
  270. package/src/WAUSync/Protocols/USyncContactProtocol.js +51 -0
  271. package/src/WAUSync/Protocols/USyncDeviceProtocol.d.ts +23 -0
  272. package/src/WAUSync/Protocols/USyncDeviceProtocol.js +52 -0
  273. package/src/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +13 -0
  274. package/src/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
  275. package/src/WAUSync/Protocols/USyncStatusProtocol.d.ts +13 -0
  276. package/src/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
  277. package/src/WAUSync/Protocols/USyncUsernameProtocol.d.ts +10 -0
  278. package/src/WAUSync/Protocols/USyncUsernameProtocol.js +24 -0
  279. package/src/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +39 -0
  280. package/src/WAUSync/Protocols/UsyncBotProfileProtocol.js +50 -0
  281. package/src/WAUSync/Protocols/UsyncLIDProtocol.d.ts +15 -0
  282. package/src/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
  283. package/src/WAUSync/Protocols/index.d.ts +6 -0
  284. package/src/WAUSync/Protocols/index.js +6 -0
  285. package/src/WAUSync/USyncQuery.d.ts +21 -0
  286. package/src/WAUSync/USyncQuery.js +94 -0
  287. package/src/WAUSync/USyncUser.d.ts +17 -0
  288. package/src/WAUSync/USyncUser.js +31 -0
  289. package/src/WAUSync/index.d.ts +4 -0
  290. package/src/WAUSync/index.js +4 -0
  291. package/src/assets/wasm/README.md +76 -0
  292. package/src/assets/wasm/loader.js +5 -0
  293. package/src/assets/wasm/whatsapp.wasm +0 -0
  294. package/src/assets/wasm/worker-modules.js +273 -0
  295. package/src/index.d.ts +49 -0
  296. package/src/index.js +54 -0
@@ -0,0 +1,2 @@
1
+ /* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
2
+ export function executeWMexQuery(variables: any, queryId: any, dataPath: any, query: any, generateMessageTag: any): Promise<any>;
@@ -0,0 +1,45 @@
1
+ /* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
2
+ import { Boom } from '@hapi/boom';
3
+ import { getBinaryNodeChild, S_WHATSAPP_NET } from '../WABinary/index.js';
4
+ const wMexQuery = (variables, queryId, query, generateMessageTag) => {
5
+ return query({
6
+ tag: 'iq',
7
+ attrs: {
8
+ id: generateMessageTag(),
9
+ type: 'get',
10
+ to: S_WHATSAPP_NET,
11
+ xmlns: 'w:mex'
12
+ },
13
+ content: [
14
+ {
15
+ tag: 'query',
16
+ attrs: { query_id: queryId },
17
+ content: Buffer.from(JSON.stringify({ variables }), 'utf-8')
18
+ }
19
+ ]
20
+ });
21
+ };
22
+ export const executeWMexQuery = async (variables, queryId, dataPath, query, generateMessageTag) => {
23
+ const result = await wMexQuery(variables, queryId, query, generateMessageTag);
24
+ const child = getBinaryNodeChild(result, 'result');
25
+ if (child?.content) {
26
+ const data = JSON.parse(child.content.toString());
27
+ if (data.errors && data.errors.length > 0) {
28
+ const errorMessages = data.errors.map((err) => err.message || 'Unknown error').join(', ');
29
+ const firstError = data.errors[0];
30
+ const errorCode = firstError.extensions?.error_code || 400;
31
+ throw new Boom(`GraphQL server error: ${errorMessages} (${dataPath || queryId})`, {
32
+ statusCode: errorCode,
33
+ data: { ...firstError, queryId, sent: variables }
34
+ });
35
+ }
36
+ const response = dataPath ? data?.data?.[dataPath] : data?.data;
37
+ if (typeof response !== 'undefined') {
38
+ return response;
39
+ }
40
+ }
41
+ const action = (dataPath || '').startsWith('xwa2_')
42
+ ? dataPath.substring(5).replace(/_/g, ' ')
43
+ : dataPath?.replace(/_/g, ' ');
44
+ throw new Boom(`Failed to ${action}, unexpected response structure.`, { statusCode: 400, data: result });
45
+ };
@@ -0,0 +1,469 @@
1
+ /* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
2
+ export interface NewsletterAddOnGroup {
3
+ jid?: string;
4
+ messages: {
5
+ serverId?: number;
6
+ reaction?: { code?: string; t?: number };
7
+ pollVote?: { t?: number; hashes: string[] };
8
+ }[];
9
+ }
10
+ export interface NewsletterEnforcement {
11
+ enforcementId?: string;
12
+ createdAt?: number;
13
+ violationCategory?: string;
14
+ source?: string;
15
+ appealState?: string;
16
+ appealCreatedAt?: number;
17
+ appealReasonOptions: { reason?: string; label?: string }[];
18
+ appealFormUrl?: string;
19
+ policy?: {
20
+ headline?: string;
21
+ subtitle?: string;
22
+ overview?: string;
23
+ explanation?: string;
24
+ adminDisclaimer?: string;
25
+ };
26
+ }
27
+ export function makeNewsletterSocket(config: any): {
28
+ executeWMexQuery: (variables: any, queryId: any, dataPath: any) => Promise<any>;
29
+ newsletterCreate: (name: any, description: any) => Promise<{
30
+ id: any;
31
+ owner: undefined;
32
+ name: any;
33
+ creation_time: number;
34
+ description: any;
35
+ invite: any;
36
+ subscribers: number;
37
+ verification: any;
38
+ picture: {
39
+ id: any;
40
+ directPath: any;
41
+ };
42
+ mute_state: any;
43
+ }>;
44
+ newsletterUpdate: (jid: any, updates: any) => Promise<any>;
45
+ newsletterSubscribers: (jid: string, options?: {
46
+ count?: number;
47
+ }) => Promise<{
48
+ id?: string;
49
+ phoneNumber?: string;
50
+ displayName?: string;
51
+ username?: string;
52
+ role?: string;
53
+ followTime?: number;
54
+ }[]>;
55
+ newsletterSubscribed: (options?: {
56
+ fetchStatusMetadata?: boolean;
57
+ fetchWamoSub?: boolean;
58
+ }) => Promise<any>;
59
+ newsletterMetadata: (type: 'invite' | 'jid', key: string, options?: {
60
+ fetchCreationTime?: boolean;
61
+ fetchFullImage?: boolean;
62
+ fetchViewerMetadata?: boolean;
63
+ fetchPinnedMessages?: boolean;
64
+ fetchStatusMetadata?: boolean;
65
+ fetchWamoSub?: boolean;
66
+ }) => Promise<any>;
67
+ newsletterFollow: (jid: any) => Promise<any>;
68
+ newsletterUnfollow: (jid: any) => Promise<any>;
69
+ newsletterUpdateUserSetting: (jid: string, type: 'ADMIN_NOTIFICATIONS' | 'FOLLOWER_NOTIFICATIONS', value: boolean) => Promise<{
70
+ id: string;
71
+ state?: string;
72
+ }>;
73
+ newsletterMute: (jid: any) => Promise<any>;
74
+ newsletterUnmute: (jid: any) => Promise<any>;
75
+ newsletterUpdateName: (jid: any, name: any) => Promise<any>;
76
+ newsletterUpdateReactions: (jid: string, setting: 'ALL' | 'BASIC' | 'NONE' | 'BLOCKLIST') => Promise<any>;
77
+ newsletterUpdateDescription: (jid: any, description: any) => Promise<any>;
78
+ newsletterUpdatePicture: (jid: any, content: any) => Promise<any>;
79
+ newsletterRemovePicture: (jid: any) => Promise<any>;
80
+ newsletterReactMessage: (jid: any, serverId: any, reaction: any) => Promise<void>;
81
+ newsletterFetchMessages: (type: any, key: any, count?: number, after?: any, before?: any) => Promise<{
82
+ [k: string]: any;
83
+ }[]>;
84
+ newsletterFetchMessageUpdates: (jid: string, options?: {
85
+ count?: number;
86
+ since?: number;
87
+ before?: string | number;
88
+ after?: string | number;
89
+ }) => Promise<{
90
+ jid: string;
91
+ messages: { [k: string]: any }[];
92
+ }>;
93
+ newsletterQuestionResponses: (jid: string, serverId: string | number, options?: {
94
+ count?: number;
95
+ before?: string;
96
+ filter?: 'contacts' | 'replied' | 'starred';
97
+ searchText?: string;
98
+ }) => Promise<{
99
+ jid: string;
100
+ serverId: number;
101
+ responses: {
102
+ id?: string;
103
+ t?: number;
104
+ isSender: boolean;
105
+ responseServerId?: string;
106
+ sender: {
107
+ lid?: string;
108
+ notifyName?: string;
109
+ pictureDirectPath?: string;
110
+ };
111
+ replied: boolean;
112
+ starred: boolean;
113
+ message?: any;
114
+ }[];
115
+ }>;
116
+ newsletterMyAddOns: (options?: {
117
+ limit?: number;
118
+ jid?: string;
119
+ }) => Promise<NewsletterAddOnGroup[]>;
120
+ newsletterStatusMyAddOns: (options?: {
121
+ limit?: number;
122
+ jid?: string;
123
+ }) => Promise<NewsletterAddOnGroup[]>;
124
+ subscribeNewsletterUpdates: (jid: any) => Promise<{
125
+ duration: any;
126
+ } | null>;
127
+ newsletterAdminCount: (jid: any) => Promise<any>;
128
+ newsletterChangeOwner: (jid: any, newOwnerJid: any) => Promise<void>;
129
+ newsletterDemote: (jid: any, userJid: any) => Promise<void>;
130
+ newsletterDelete: (jid: any) => Promise<void>;
131
+ newsletterAdminCapabilities: (jid: string) => Promise<string[]>;
132
+ newsletterEnforcements: (jid: string, locale?: string) => Promise<{
133
+ adminProfiles: NewsletterEnforcement[];
134
+ profilePictureDeletions: NewsletterEnforcement[];
135
+ suspensions: NewsletterEnforcement[];
136
+ violatingMessages: NewsletterEnforcement[];
137
+ geoSuspensions: NewsletterEnforcement[];
138
+ }>;
139
+ newsletterReports: (locale?: string) => Promise<any[]>;
140
+ newsletterAppealReport: (reportId: string | number, reason: string) => Promise<any>;
141
+ newsletterCanPostStatus: (jid: string) => Promise<{
142
+ canPost: boolean;
143
+ canPostMusic: boolean;
144
+ capabilities: string[];
145
+ }>;
146
+ newsletterAdminInfo: (jid: string) => Promise<{
147
+ id: string;
148
+ adminCount: number;
149
+ adminProfile?: {
150
+ id?: string;
151
+ name?: string;
152
+ picture?: {
153
+ id?: string;
154
+ directPath?: string;
155
+ };
156
+ };
157
+ adminProfilesEnabled: boolean;
158
+ }>;
159
+ newsletterPollVoters: (jid: string, serverId: string | number, options?: {
160
+ limit?: number;
161
+ voteHash?: string;
162
+ }) => Promise<any>;
163
+ newsletterReactionSenders: (jid: string, serverId: string | number) => Promise<any>;
164
+ newsletterPinMessages: (jid: string, serverIds: (string | number)[] | string | number) => Promise<any>;
165
+ newsletterUnpinMessages: (jid: string, serverIds: (string | number)[] | string | number) => Promise<any>;
166
+ newsletterLabelAiContent: (jid: string, serverId: string | number, messageType?: 'MESSAGE' | 'STATUS') => Promise<any>;
167
+ newsletterLabelPaidPartnership: (jid: string, serverId: string | number, messageType?: 'MESSAGE' | 'STATUS') => Promise<any>;
168
+ newsletterCreateAdminInvite: (jid: string, userJid: string) => Promise<any>;
169
+ newsletterRevokeAdminInvite: (jid: string, userJid: string) => Promise<any>;
170
+ newsletterAcceptAdminInvite: (jid: string) => Promise<any>;
171
+ newsletterDirectoryList: (options?: {
172
+ view?: 'RECOMMENDED' | 'NEW' | 'POPULAR' | 'FEATURED' | 'TRENDING';
173
+ categories?: string[];
174
+ countryCodes?: string[];
175
+ limit?: number;
176
+ cursorToken?: string;
177
+ fetchStatusMetadata?: boolean;
178
+ }) => Promise<any>;
179
+ newsletterDirectorySearch: (searchText: string, options?: {
180
+ categories?: string[];
181
+ limit?: number;
182
+ cursorToken?: string;
183
+ fetchStatusMetadata?: boolean;
184
+ }) => Promise<any>;
185
+ newsletterDirectoryCategories: (options?: {
186
+ categories?: string[];
187
+ countryCode?: string;
188
+ perCategoryLimit?: number;
189
+ fetchStatusMetadata?: boolean;
190
+ }) => Promise<any>;
191
+ newsletterSendPollVote: (jid: string, parentServerId: string | number, options: string[] | string) => Promise<{
192
+ id: string;
193
+ }>;
194
+ newsletterInsights: (jid: string, options?: {
195
+ metrics?: string[];
196
+ }) => Promise<any>;
197
+ newsletterFollowers: (jid: string, options?: {
198
+ count?: number;
199
+ }) => Promise<any>;
200
+ newsletterPendingAdminInvites: (jid: string) => Promise<{
201
+ id?: string;
202
+ phoneNumber?: string;
203
+ }[]>;
204
+ newsletterQuestionResponseState: (jid: string, serverId: string | number, responseServerId: string | number, state: 'HIDDEN' | 'VISIBLE') => Promise<any>;
205
+ newsletterRecommended: (options?: {
206
+ limit?: number;
207
+ countryCodes?: string[];
208
+ fetchStatusMetadata?: boolean;
209
+ }) => Promise<any>;
210
+ newsletterSimilar: (jid: string, options?: {
211
+ limit?: number;
212
+ countryCodes?: string[];
213
+ fetchStatusMetadata?: boolean;
214
+ }) => Promise<any>;
215
+ groupQuery: (jid: any, type: any, content: any) => Promise<any>;
216
+ groupMetadata: (jid: any) => Promise<{
217
+ id: any;
218
+ notify: any;
219
+ addressingMode: any;
220
+ subject: any;
221
+ subjectOwner: any;
222
+ subjectOwnerPn: any;
223
+ subjectOwnerUsername: any;
224
+ subjectTime: number;
225
+ size: any;
226
+ creation: number;
227
+ owner: string | undefined;
228
+ ownerPn: string | undefined;
229
+ ownerUsername: any;
230
+ owner_country_code: any;
231
+ desc: any;
232
+ descId: any;
233
+ descOwner: string | undefined;
234
+ descOwnerPn: string | undefined;
235
+ descOwnerUsername: any;
236
+ descTime: number | undefined;
237
+ linkedParent: any;
238
+ restrict: boolean;
239
+ announce: boolean;
240
+ isCommunity: boolean;
241
+ isCommunityAnnounce: boolean;
242
+ joinApprovalMode: boolean;
243
+ memberAddMode: boolean;
244
+ participants: any;
245
+ ephemeralDuration: number | undefined;
246
+ }>;
247
+ groupCreate: (subject: any, participants: any) => Promise<{
248
+ id: any;
249
+ notify: any;
250
+ addressingMode: any;
251
+ subject: any;
252
+ subjectOwner: any;
253
+ subjectOwnerPn: any;
254
+ subjectOwnerUsername: any;
255
+ subjectTime: number;
256
+ size: any;
257
+ creation: number;
258
+ owner: string | undefined;
259
+ ownerPn: string | undefined;
260
+ ownerUsername: any;
261
+ owner_country_code: any;
262
+ desc: any;
263
+ descId: any;
264
+ descOwner: string | undefined;
265
+ descOwnerPn: string | undefined;
266
+ descOwnerUsername: any;
267
+ descTime: number | undefined;
268
+ linkedParent: any;
269
+ restrict: boolean;
270
+ announce: boolean;
271
+ isCommunity: boolean;
272
+ isCommunityAnnounce: boolean;
273
+ joinApprovalMode: boolean;
274
+ memberAddMode: boolean;
275
+ participants: any;
276
+ ephemeralDuration: number | undefined;
277
+ }>;
278
+ groupLeave: (id: any) => Promise<void>;
279
+ groupUpdateSubject: (jid: any, subject: any) => Promise<void>;
280
+ groupRequestParticipantsList: (jid: any) => Promise<any>;
281
+ groupRequestParticipantsUpdate: (jid: any, participants: any, action: any) => Promise<any>;
282
+ groupParticipantsUpdate: (jid: any, participants: any, action: any) => Promise<any>;
283
+ groupUpdateDescription: (jid: any, description: any) => Promise<void>;
284
+ groupInviteCode: (jid: any) => Promise<any>;
285
+ groupRevokeInvite: (jid: any) => Promise<any>;
286
+ groupAcceptInvite: (code: any) => Promise<any>;
287
+ groupRevokeInviteV4: (groupJid: any, invitedJid: any) => Promise<boolean>;
288
+ groupAcceptInviteV4: (...args: any[]) => Promise<any>;
289
+ groupGetInviteInfo: (code: any) => Promise<{
290
+ id: any;
291
+ notify: any;
292
+ addressingMode: any;
293
+ subject: any;
294
+ subjectOwner: any;
295
+ subjectOwnerPn: any;
296
+ subjectOwnerUsername: any;
297
+ subjectTime: number;
298
+ size: any;
299
+ creation: number;
300
+ owner: string | undefined;
301
+ ownerPn: string | undefined;
302
+ ownerUsername: any;
303
+ owner_country_code: any;
304
+ desc: any;
305
+ descId: any;
306
+ descOwner: string | undefined;
307
+ descOwnerPn: string | undefined;
308
+ descOwnerUsername: any;
309
+ descTime: number | undefined;
310
+ linkedParent: any;
311
+ restrict: boolean;
312
+ announce: boolean;
313
+ isCommunity: boolean;
314
+ isCommunityAnnounce: boolean;
315
+ joinApprovalMode: boolean;
316
+ memberAddMode: boolean;
317
+ participants: any;
318
+ ephemeralDuration: number | undefined;
319
+ }>;
320
+ groupToggleEphemeral: (jid: any, ephemeralExpiration: any) => Promise<void>;
321
+ groupSettingUpdate: (jid: any, setting: any) => Promise<void>;
322
+ groupMemberAddMode: (jid: any, mode: any) => Promise<void>;
323
+ groupJoinApprovalMode: (jid: any, mode: any) => Promise<void>;
324
+ groupFetchAllParticipating: () => Promise<{}>;
325
+ findUserId: (pnLid: any) => Promise<{
326
+ lid: undefined;
327
+ phoneNumber: undefined;
328
+ }>;
329
+ serverProps: {
330
+ privacyTokenOn1to1: boolean;
331
+ profilePicPrivacyToken: boolean;
332
+ lidTrustedTokenIssueToLid: boolean;
333
+ };
334
+ createCallLink: (type: any, event: any, timeoutMs: any) => Promise<any>;
335
+ getBotListV2: () => Promise<{
336
+ jid: any;
337
+ personaId: any;
338
+ }[]>;
339
+ messageMutex: {
340
+ mutex(code: any): any;
341
+ };
342
+ receiptMutex: {
343
+ mutex(code: any): any;
344
+ };
345
+ appStatePatchMutex: {
346
+ mutex(code: any): any;
347
+ };
348
+ notificationMutex: {
349
+ mutex(code: any): any;
350
+ };
351
+ fetchPrivacySettings: (force?: boolean) => Promise<any>;
352
+ upsertMessage: (...args: any[]) => Promise<any>;
353
+ appPatch: (patchCreate: any) => Promise<void>;
354
+ sendPresenceUpdate: (type: any, toJid: any) => Promise<void>;
355
+ presenceSubscribe: (toJid: any) => Promise<void>;
356
+ profilePictureUrl: (jid: any, type?: string, timeoutMs?: number, shouldIncludeTcToken?: boolean) => Promise<any>;
357
+ fetchBlocklist: () => Promise<any>;
358
+ fetchStatus: (...jids: any[]) => Promise<any>;
359
+ fetchDisappearingDuration: (...jids: any[]) => Promise<any>;
360
+ updateProfilePicture: (jid: any, content: any, dimensions: any) => Promise<void>;
361
+ removeProfilePicture: (jid: any) => Promise<void>;
362
+ updateProfileStatus: (status: any) => Promise<void>;
363
+ updateProfileName: (name: any) => Promise<void>;
364
+ updateBlockStatus: (jid: any, action: any) => Promise<void>;
365
+ reportSpam: (jid: string, options?: {
366
+ flow?: string;
367
+ source?: string;
368
+ subject?: string;
369
+ isKnownChat?: boolean;
370
+ }) => Promise<{
371
+ jid: string;
372
+ flow: string;
373
+ reported: true;
374
+ node: any;
375
+ }>;
376
+ updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: any) => Promise<void>;
377
+ updateCallPrivacy: (value: any) => Promise<void>;
378
+ updateMessagesPrivacy: (value: any) => Promise<void>;
379
+ updateLastSeenPrivacy: (value: any) => Promise<void>;
380
+ updateOnlinePrivacy: (value: any) => Promise<void>;
381
+ updateProfilePicturePrivacy: (value: any) => Promise<void>;
382
+ updateStatusPrivacy: (value: any) => Promise<void>;
383
+ updateReadReceiptsPrivacy: (value: any) => Promise<void>;
384
+ updateGroupsAddPrivacy: (value: any) => Promise<void>;
385
+ updateDefaultDisappearingMode: (duration: any) => Promise<void>;
386
+ getBusinessProfile: (jid: any) => Promise<{
387
+ wid: any;
388
+ address: any;
389
+ description: any;
390
+ website: any[];
391
+ email: any;
392
+ category: any;
393
+ business_hours: {
394
+ timezone: any;
395
+ business_config: any;
396
+ };
397
+ } | undefined>;
398
+ resyncAppState: (...args: any[]) => Promise<any>;
399
+ chatModify: (mod: any, jid: any) => Promise<void>;
400
+ cleanDirtyBits: (type: any, fromTimestamp: any) => Promise<void>;
401
+ addOrEditContact: (jid: any, contact: any) => Promise<void>;
402
+ removeContact: (jid: any) => Promise<void>;
403
+ placeholderResendCache: any;
404
+ addLabel: (jid: any, labels: any) => Promise<void>;
405
+ addChatLabel: (jid: any, labelId: any) => Promise<void>;
406
+ removeChatLabel: (jid: any, labelId: any) => Promise<void>;
407
+ addMessageLabel: (jid: any, messageId: any, labelId: any) => Promise<void>;
408
+ removeMessageLabel: (jid: any, messageId: any, labelId: any) => Promise<void>;
409
+ star: (jid: any, messages: any, star: any) => Promise<void>;
410
+ addOrEditQuickReply: (quickReply: any) => Promise<void>;
411
+ removeQuickReply: (timestamp: any) => Promise<void>;
412
+ type: string;
413
+ ws: import("./Client/websocket.js").WebSocketClient;
414
+ ev: {
415
+ process(handler: any): () => void;
416
+ emit(event: any, evData: any): any;
417
+ isBuffering(): boolean;
418
+ buffer: () => void;
419
+ flush: () => boolean;
420
+ createBufferedFunction(work: any): (...args: any[]) => Promise<any>;
421
+ on: (...args: any[]) => any;
422
+ off: (...args: any[]) => any;
423
+ removeAllListeners: (...args: any[]) => any;
424
+ destroy(): void;
425
+ };
426
+ authState: {
427
+ creds: any;
428
+ keys: {
429
+ get: (type: any, ids: any) => Promise<any>;
430
+ set: (data: any) => Promise<void>;
431
+ isInTransaction: () => boolean;
432
+ transaction: (work: any, key: any) => Promise<any>;
433
+ };
434
+ };
435
+ signalRepository: any;
436
+ user: any;
437
+ generateMessageTag: () => string;
438
+ query: (node: any, timeoutMs: any) => Promise<any>;
439
+ waitForMessage: (msgId: any, timeoutMs?: any) => Promise<any>;
440
+ waitForSocketOpen: () => Promise<void>;
441
+ sendRawMessage: (data: any) => Promise<void>;
442
+ sendNode: (frame: any) => Promise<void>;
443
+ logout: (msg: any) => Promise<void>;
444
+ end: (error: any) => Promise<void>;
445
+ registerSocketEndHandler: (handler: any) => void;
446
+ onUnexpectedError: (err: any, msg: any) => void;
447
+ uploadPreKeys: (count?: number) => Promise<void>;
448
+ uploadPreKeysToServerIfRequired: () => Promise<void>;
449
+ digestKeyBundle: () => Promise<void>;
450
+ rotateSignedPreKey: () => Promise<void>;
451
+ requestPairingCode: (phoneNumber: any, customPairingCode: any) => Promise<any>;
452
+ updateServerTimeOffset: ({ attrs }: {
453
+ attrs: any;
454
+ }) => void;
455
+ sendUnifiedSession: () => Promise<void>;
456
+ wamBuffer: import("../index.js").BinaryInfo;
457
+ waitForConnectionUpdate: (check: any, timeoutMs: any) => Promise<void>;
458
+ sendWAMBuffer: (wamBuffer: any) => Promise<any>;
459
+ executeUSyncQuery: (usyncQuery: any) => Promise<any>;
460
+ onWhatsApp: (...phoneNumber: any[]) => Promise<any>;
461
+ onWhatsAppUsername: (...usernames: any[]) => Promise<any>;
462
+ getUsernames: (...jids: any[]) => Promise<any>;
463
+ fetchAccountReachoutTimelock: () => Promise<{
464
+ isActive: boolean;
465
+ timeEnforcementEnds: Date | undefined;
466
+ enforcementType: any;
467
+ }>;
468
+ fetchNewChatMessageCap: () => Promise<any>;
469
+ };