@vanzxy/baileys 2.0.0

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 (281) hide show
  1. package/NOTICE.md +111 -0
  2. package/README.md +830 -0
  3. package/WAProto/index.d.ts +9 -0
  4. package/WAProto/index.js +142036 -0
  5. package/engine-requirements.js +13 -0
  6. package/lib/Defaults/index.d.ts +152 -0
  7. package/lib/Defaults/index.js +179 -0
  8. package/lib/Framework/Bot.js +209 -0
  9. package/lib/Framework/Context.js +90 -0
  10. package/lib/Framework/MediaManager.js +152 -0
  11. package/lib/Framework/SessionManager.js +34 -0
  12. package/lib/Framework/StatsManager.js +120 -0
  13. package/lib/Framework/Store/SQLiteStore.js +74 -0
  14. package/lib/Framework/index.js +11 -0
  15. package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
  16. package/lib/Signal/Group/ciphertext-message.js +12 -0
  17. package/lib/Signal/Group/group-session-builder.d.ts +7 -0
  18. package/lib/Signal/Group/group-session-builder.js +30 -0
  19. package/lib/Signal/Group/group_cipher.d.ts +10 -0
  20. package/lib/Signal/Group/group_cipher.js +82 -0
  21. package/lib/Signal/Group/index.d.ts +11 -0
  22. package/lib/Signal/Group/index.js +12 -0
  23. package/lib/Signal/Group/keyhelper.d.ts +6 -0
  24. package/lib/Signal/Group/keyhelper.js +18 -0
  25. package/lib/Signal/Group/sender-chain-key.d.ts +13 -0
  26. package/lib/Signal/Group/sender-chain-key.js +26 -0
  27. package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
  28. package/lib/Signal/Group/sender-key-distribution-message.js +63 -0
  29. package/lib/Signal/Group/sender-key-message.d.ts +18 -0
  30. package/lib/Signal/Group/sender-key-message.js +66 -0
  31. package/lib/Signal/Group/sender-key-name.d.ts +11 -0
  32. package/lib/Signal/Group/sender-key-name.js +48 -0
  33. package/lib/Signal/Group/sender-key-record.d.ts +12 -0
  34. package/lib/Signal/Group/sender-key-record.js +41 -0
  35. package/lib/Signal/Group/sender-key-state.d.ts +16 -0
  36. package/lib/Signal/Group/sender-key-state.js +84 -0
  37. package/lib/Signal/Group/sender-message-key.d.ts +11 -0
  38. package/lib/Signal/Group/sender-message-key.js +26 -0
  39. package/lib/Signal/libsignal.d.ts +54 -0
  40. package/lib/Signal/libsignal.js +431 -0
  41. package/lib/Signal/lid-mapping.d.ts +20 -0
  42. package/lib/Signal/lid-mapping.js +277 -0
  43. package/lib/Socket/Client/index.d.ts +2 -0
  44. package/lib/Socket/Client/index.js +3 -0
  45. package/lib/Socket/Client/types.d.ts +5 -0
  46. package/lib/Socket/Client/types.js +11 -0
  47. package/lib/Socket/Client/websocket.d.ts +12 -0
  48. package/lib/Socket/Client/websocket.js +54 -0
  49. package/lib/Socket/business.d.ts +395 -0
  50. package/lib/Socket/business.js +380 -0
  51. package/lib/Socket/chats.d.ts +136 -0
  52. package/lib/Socket/chats.js +1328 -0
  53. package/lib/Socket/communities.d.ts +561 -0
  54. package/lib/Socket/communities.js +434 -0
  55. package/lib/Socket/dugong.d.ts +117 -0
  56. package/lib/Socket/dugong.js +799 -0
  57. package/lib/Socket/groups.d.ts +285 -0
  58. package/lib/Socket/groups.js +355 -0
  59. package/lib/Socket/index.d.ts +531 -0
  60. package/lib/Socket/index.js +34 -0
  61. package/lib/Socket/messages-recv.d.ts +333 -0
  62. package/lib/Socket/messages-recv.js +1782 -0
  63. package/lib/Socket/messages-send.d.ts +329 -0
  64. package/lib/Socket/messages-send.js +1383 -0
  65. package/lib/Socket/mex.d.ts +1 -0
  66. package/lib/Socket/mex.js +42 -0
  67. package/lib/Socket/newsletter.d.ts +281 -0
  68. package/lib/Socket/newsletter.js +321 -0
  69. package/lib/Socket/socket.d.ts +60 -0
  70. package/lib/Socket/socket.js +1001 -0
  71. package/lib/Socket/username.js +153 -0
  72. package/lib/Store/index.d.ts +3 -0
  73. package/lib/Store/index.js +4 -0
  74. package/lib/Store/make-in-memory-store.d.ts +62 -0
  75. package/lib/Store/make-in-memory-store.js +429 -0
  76. package/lib/Store/make-ordered-dictionary.d.ts +12 -0
  77. package/lib/Store/make-ordered-dictionary.js +79 -0
  78. package/lib/Store/object-repository.d.ts +10 -0
  79. package/lib/Store/object-repository.js +24 -0
  80. package/lib/Types/Auth.d.ts +117 -0
  81. package/lib/Types/Auth.js +2 -0
  82. package/lib/Types/Bussines.d.ts +25 -0
  83. package/lib/Types/Bussines.js +2 -0
  84. package/lib/Types/Call.d.ts +15 -0
  85. package/lib/Types/Call.js +2 -0
  86. package/lib/Types/Chat.d.ts +124 -0
  87. package/lib/Types/Chat.js +8 -0
  88. package/lib/Types/Contact.d.ts +26 -0
  89. package/lib/Types/Contact.js +2 -0
  90. package/lib/Types/Events.d.ts +256 -0
  91. package/lib/Types/Events.js +2 -0
  92. package/lib/Types/GroupMetadata.d.ts +71 -0
  93. package/lib/Types/GroupMetadata.js +2 -0
  94. package/lib/Types/Label.d.ts +2 -0
  95. package/lib/Types/Label.js +25 -0
  96. package/lib/Types/LabelAssociation.d.ts +2 -0
  97. package/lib/Types/LabelAssociation.js +7 -0
  98. package/lib/Types/Message.d.ts +11 -0
  99. package/lib/Types/Message.js +18 -0
  100. package/lib/Types/Mex.d.ts +2 -0
  101. package/lib/Types/Mex.js +39 -0
  102. package/lib/Types/Product.d.ts +79 -0
  103. package/lib/Types/Product.js +2 -0
  104. package/lib/Types/RichType.d.ts +2 -0
  105. package/lib/Types/RichType.js +23 -0
  106. package/lib/Types/Signal.d.ts +87 -0
  107. package/lib/Types/Signal.js +2 -0
  108. package/lib/Types/Socket.d.ts +136 -0
  109. package/lib/Types/Socket.js +2 -0
  110. package/lib/Types/State.d.ts +5 -0
  111. package/lib/Types/State.js +56 -0
  112. package/lib/Types/USync.d.ts +26 -0
  113. package/lib/Types/USync.js +2 -0
  114. package/lib/Types/index.d.ts +66 -0
  115. package/lib/Types/index.js +26 -0
  116. package/lib/Utils/A2UI.js +277 -0
  117. package/lib/Utils/MessageBuilder.js +4405 -0
  118. package/lib/Utils/MessageBuilder_d.ts +411 -0
  119. package/lib/Utils/PersistentStore.js +592 -0
  120. package/lib/Utils/PersistentStore_d.ts +60 -0
  121. package/lib/Utils/anti-delete.d.ts +74 -0
  122. package/lib/Utils/anti-delete.js +222 -0
  123. package/lib/Utils/auth-utils.d.ts +57 -0
  124. package/lib/Utils/auth-utils.js +307 -0
  125. package/lib/Utils/auto-reply.d.ts +47 -0
  126. package/lib/Utils/auto-reply.js +158 -0
  127. package/lib/Utils/baileys-event-stream.d.ts +8 -0
  128. package/lib/Utils/baileys-event-stream.js +62 -0
  129. package/lib/Utils/browser-utils.d.ts +8 -0
  130. package/lib/Utils/browser-utils.js +28 -0
  131. package/lib/Utils/business.d.ts +49 -0
  132. package/lib/Utils/business.js +240 -0
  133. package/lib/Utils/button-helper-utils.js +314 -0
  134. package/lib/Utils/button-sender.js +824 -0
  135. package/lib/Utils/chat-control.d.ts +159 -0
  136. package/lib/Utils/chat-control.js +232 -0
  137. package/lib/Utils/chat-history-helpers.d.ts +21 -0
  138. package/lib/Utils/chat-history-helpers.js +71 -0
  139. package/lib/Utils/chat-utils.d.ts +407 -0
  140. package/lib/Utils/chat-utils.js +886 -0
  141. package/lib/Utils/companion-reg-client-utils.d.ts +4 -0
  142. package/lib/Utils/companion-reg-client-utils.js +40 -0
  143. package/lib/Utils/crypto.d.ts +41 -0
  144. package/lib/Utils/crypto.js +148 -0
  145. package/lib/Utils/decode-wa-message.d.ts +83 -0
  146. package/lib/Utils/decode-wa-message.js +317 -0
  147. package/lib/Utils/event-buffer.d.ts +12 -0
  148. package/lib/Utils/event-buffer.js +636 -0
  149. package/lib/Utils/generics.d.ts +69 -0
  150. package/lib/Utils/generics.js +439 -0
  151. package/lib/Utils/history.d.ts +90 -0
  152. package/lib/Utils/history.js +147 -0
  153. package/lib/Utils/identity-change-handler.d.ts +13 -0
  154. package/lib/Utils/identity-change-handler.js +50 -0
  155. package/lib/Utils/index.d.ts +39 -0
  156. package/lib/Utils/index.js +46 -0
  157. package/lib/Utils/link-preview.d.ts +12 -0
  158. package/lib/Utils/link-preview.js +85 -0
  159. package/lib/Utils/logger.d.ts +2 -0
  160. package/lib/Utils/logger.js +3 -0
  161. package/lib/Utils/lt-hash.d.ts +12 -0
  162. package/lib/Utils/lt-hash.js +27 -0
  163. package/lib/Utils/make-mutex.d.ts +6 -0
  164. package/lib/Utils/make-mutex.js +33 -0
  165. package/lib/Utils/media-messages.d.ts +18 -0
  166. package/lib/Utils/media-messages.js +71 -0
  167. package/lib/Utils/media-set.d.ts +13 -0
  168. package/lib/Utils/media-set.js +172 -0
  169. package/lib/Utils/message-kind.js +139 -0
  170. package/lib/Utils/message-retry-manager.d.ts +79 -0
  171. package/lib/Utils/message-retry-manager.js +265 -0
  172. package/lib/Utils/message-search.d.ts +44 -0
  173. package/lib/Utils/message-search.js +189 -0
  174. package/lib/Utils/messages-media.d.ts +135 -0
  175. package/lib/Utils/messages-media.js +869 -0
  176. package/lib/Utils/messages.d.ts +44 -0
  177. package/lib/Utils/messages.js +2155 -0
  178. package/lib/Utils/noise-handler.d.ts +20 -0
  179. package/lib/Utils/noise-handler.js +201 -0
  180. package/lib/Utils/offline-node-processor.d.ts +9 -0
  181. package/lib/Utils/offline-node-processor.js +40 -0
  182. package/lib/Utils/past-participants.d.ts +14 -0
  183. package/lib/Utils/past-participants.js +40 -0
  184. package/lib/Utils/pre-key-manager.d.ts +25 -0
  185. package/lib/Utils/pre-key-manager.js +106 -0
  186. package/lib/Utils/process-message.d.ts +82 -0
  187. package/lib/Utils/process-message.js +809 -0
  188. package/lib/Utils/reporting-utils.d.ts +12 -0
  189. package/lib/Utils/reporting-utils.js +258 -0
  190. package/lib/Utils/rich-message-utils.d.ts +48 -0
  191. package/lib/Utils/rich-message-utils.js +445 -0
  192. package/lib/Utils/scheduling.d.ts +42 -0
  193. package/lib/Utils/scheduling.js +140 -0
  194. package/lib/Utils/signal.d.ts +82 -0
  195. package/lib/Utils/signal.js +201 -0
  196. package/lib/Utils/stanza-ack.d.ts +16 -0
  197. package/lib/Utils/stanza-ack.js +38 -0
  198. package/lib/Utils/status.d.ts +50 -0
  199. package/lib/Utils/status.js +108 -0
  200. package/lib/Utils/stickerpack.d.ts +51 -0
  201. package/lib/Utils/stickerpack.js +275 -0
  202. package/lib/Utils/sync-action-utils.d.ts +2 -0
  203. package/lib/Utils/sync-action-utils.js +49 -0
  204. package/lib/Utils/tc-token-utils.d.ts +29 -0
  205. package/lib/Utils/tc-token-utils.js +163 -0
  206. package/lib/Utils/templates.d.ts +76 -0
  207. package/lib/Utils/templates.js +151 -0
  208. package/lib/Utils/use-cache-manager-auth-state.d.ts +13 -0
  209. package/lib/Utils/use-cache-manager-auth-state.js +82 -0
  210. package/lib/Utils/use-multi-file-auth-state.d.ts +10 -0
  211. package/lib/Utils/use-multi-file-auth-state.js +167 -0
  212. package/lib/Utils/use-single-file-auth-state.d.ts +10 -0
  213. package/lib/Utils/use-single-file-auth-state.js +114 -0
  214. package/lib/Utils/use-sqlite-auth-state.d.ts +11 -0
  215. package/lib/Utils/use-sqlite-auth-state.js +170 -0
  216. package/lib/Utils/validate-connection.d.ts +42 -0
  217. package/lib/Utils/validate-connection.js +199 -0
  218. package/lib/Utils/vcard.d.ts +58 -0
  219. package/lib/Utils/vcard.js +105 -0
  220. package/lib/VoIP/audio-feeder.d.ts +15 -0
  221. package/lib/VoIP/audio-feeder.js +132 -0
  222. package/lib/VoIP/index.js +277 -0
  223. package/lib/VoIP/relay-transport.d.ts +43 -0
  224. package/lib/VoIP/relay-transport.js +559 -0
  225. package/lib/VoIP/signaling.js +624 -0
  226. package/lib/VoIP/types.d.ts +69 -0
  227. package/lib/VoIP/types.js +17 -0
  228. package/lib/VoIP/wasm-engine.d.ts +103 -0
  229. package/lib/VoIP/wasm-engine.js +1214 -0
  230. package/lib/VoIP/worker-bootstrap.js +1042 -0
  231. package/lib/WABinary/constants.d.ts +61 -0
  232. package/lib/WABinary/constants.js +1467 -0
  233. package/lib/WABinary/decode.d.ts +9 -0
  234. package/lib/WABinary/decode.js +262 -0
  235. package/lib/WABinary/encode.d.ts +2 -0
  236. package/lib/WABinary/encode.js +220 -0
  237. package/lib/WABinary/generic-utils.d.ts +74 -0
  238. package/lib/WABinary/generic-utils.js +277 -0
  239. package/lib/WABinary/index.d.ts +5 -0
  240. package/lib/WABinary/index.js +6 -0
  241. package/lib/WABinary/jid-utils.d.ts +28 -0
  242. package/lib/WABinary/jid-utils.js +96 -0
  243. package/lib/WABinary/types.d.ts +19 -0
  244. package/lib/WABinary/types.js +2 -0
  245. package/lib/WAM/BinaryInfo.d.ts +7 -0
  246. package/lib/WAM/BinaryInfo.js +10 -0
  247. package/lib/WAM/constants.d.ts +34926 -0
  248. package/lib/WAM/constants.js +22853 -0
  249. package/lib/WAM/encode.d.ts +1 -0
  250. package/lib/WAM/encode.js +150 -0
  251. package/lib/WAM/index.d.ts +3 -0
  252. package/lib/WAM/index.js +4 -0
  253. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +36 -0
  254. package/lib/WAUSync/Protocols/USyncContactProtocol.js +52 -0
  255. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +29 -0
  256. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +63 -0
  257. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  258. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
  259. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  260. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
  261. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +9 -0
  262. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
  263. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +38 -0
  264. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +51 -0
  265. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +14 -0
  266. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
  267. package/lib/WAUSync/Protocols/index.d.ts +7 -0
  268. package/lib/WAUSync/Protocols/index.js +8 -0
  269. package/lib/WAUSync/USyncQuery.d.ts +20 -0
  270. package/lib/WAUSync/USyncQuery.js +122 -0
  271. package/lib/WAUSync/USyncUser.d.ts +16 -0
  272. package/lib/WAUSync/USyncUser.js +31 -0
  273. package/lib/WAUSync/index.d.ts +3 -0
  274. package/lib/WAUSync/index.js +4 -0
  275. package/lib/assets/wasm/loader.js +5 -0
  276. package/lib/assets/wasm/whatsapp.wasm +0 -0
  277. package/lib/assets/wasm/worker-modules.js +273 -0
  278. package/lib/index.d.ts +12 -0
  279. package/lib/index.js +20 -0
  280. package/package.json +175 -0
  281. package/postinstall-banner.js +56 -0
@@ -0,0 +1,256 @@
1
+ import type { Boom } from '@hapi/boom';
2
+ import { proto } from '../../WAProto/index.js';
3
+ import type { AuthenticationCreds, LIDMapping } from './Auth.js';
4
+ import type { WACallEvent } from './Call.js';
5
+ import type { Chat, ChatUpdate, PresenceData } from './Chat.js';
6
+ import type { Contact } from './Contact.js';
7
+ import type { GroupMetadata, GroupParticipant, ParticipantAction, RequestJoinAction, RequestJoinMethod } from './GroupMetadata.js';
8
+ import type { Label } from './Label.js';
9
+ import type { LabelAssociation } from './LabelAssociation.js';
10
+ import type { MessageUpsertType, MessageUserReceiptUpdate, WAMessage, WAMessageKey, WAMessageUpdate } from './Message.js';
11
+ import type { ConnectionState, NewChatMessageCapInfo } from './State.js';
12
+ export type BaileysEventMap = {
13
+ /** connection state has been updated -- WS closed, opened, connecting etc. */
14
+ 'connection.update': Partial<ConnectionState>;
15
+ /** credentials updated -- some metadata, keys or something */
16
+ 'creds.update': Partial<AuthenticationCreds>;
17
+ /** set chats (history sync), everything is reverse chronologically sorted */
18
+ 'messaging-history.set': {
19
+ chats: Chat[];
20
+ contacts: Contact[];
21
+ messages: WAMessage[];
22
+ lidPnMappings?: LIDMapping[];
23
+ isLatest?: boolean;
24
+ progress?: number | null;
25
+ syncType?: proto.HistorySync.HistorySyncType | null;
26
+ pastParticipants?: proto.IPastParticipants[] | null;
27
+ chunkOrder?: number | null;
28
+ peerDataRequestSessionId?: string | null;
29
+ };
30
+ /** signals history sync milestones (completion or stall) per sync type */
31
+ 'messaging-history.status': {
32
+ /** which sync phase this status refers to */
33
+ syncType: proto.HistorySync.HistorySyncType;
34
+ /** the status of this sync phase */
35
+ status: 'complete' | 'paused';
36
+ /**
37
+ * progress === 100 was received from the server.
38
+ * when false, completion was inferred via timeout (no more chunks arriving).
39
+ */
40
+ explicit: boolean;
41
+ };
42
+ /** upsert chats */
43
+ 'chats.upsert': Chat[];
44
+ /** update the given chats */
45
+ 'chats.update': ChatUpdate[];
46
+ 'lid-mapping.update': LIDMapping;
47
+ /** delete chats with given ID */
48
+ 'chats.delete': string[];
49
+ /** presence of contact in a chat updated */
50
+ 'presence.update': {
51
+ id: string;
52
+ presences: {
53
+ [participant: string]: PresenceData;
54
+ };
55
+ };
56
+ 'contacts.upsert': Contact[];
57
+ 'contacts.update': Partial<Contact>[];
58
+ 'messages.delete': {
59
+ keys: WAMessageKey[];
60
+ } | {
61
+ jid: string;
62
+ all: true;
63
+ };
64
+ 'messages.update': WAMessageUpdate[];
65
+ 'messages.media-update': {
66
+ key: WAMessageKey;
67
+ media?: {
68
+ ciphertext: Uint8Array;
69
+ iv: Uint8Array;
70
+ };
71
+ error?: Boom;
72
+ }[];
73
+ /**
74
+ * add/update the given messages. If they were received while the connection was online,
75
+ * the update will have type: "notify"
76
+ * if requestId is provided, then the messages was received from the phone due to it being unavailable
77
+ * */
78
+ 'messages.upsert': {
79
+ messages: WAMessage[];
80
+ type: MessageUpsertType;
81
+ requestId?: string;
82
+ };
83
+ /** message was reacted to. If reaction was removed -- then "reaction.text" will be falsey */
84
+ 'messages.reaction': {
85
+ key: WAMessageKey;
86
+ reaction: proto.IReaction;
87
+ }[];
88
+ 'message-receipt.update': MessageUserReceiptUpdate[];
89
+ 'groups.upsert': GroupMetadata[];
90
+ 'groups.update': Partial<GroupMetadata>[];
91
+ /** apply an action to participants in a group */
92
+ 'group-participants.update': {
93
+ id: string;
94
+ author: string;
95
+ authorPn?: string;
96
+ authorUsername?: string;
97
+ participants: GroupParticipant[];
98
+ action: ParticipantAction;
99
+ };
100
+ 'group.join-request': {
101
+ id: string;
102
+ author: string;
103
+ authorPn?: string;
104
+ authorUsername?: string;
105
+ participant: string;
106
+ participantPn?: string;
107
+ action: RequestJoinAction;
108
+ method: RequestJoinMethod;
109
+ };
110
+ 'group.member-tag.update': {
111
+ groupId: string;
112
+ participant: string;
113
+ participantAlt?: string;
114
+ label: string;
115
+ messageTimestamp?: number;
116
+ };
117
+ 'blocklist.set': {
118
+ blocklist: string[];
119
+ };
120
+ 'blocklist.update': {
121
+ blocklist: string[];
122
+ type: 'add' | 'remove';
123
+ };
124
+ /** Receive an update on a call, including when the call was received, rejected, accepted */
125
+ call: WACallEvent[];
126
+ 'labels.edit': Label;
127
+ 'labels.association': {
128
+ association: LabelAssociation;
129
+ type: 'add' | 'remove';
130
+ };
131
+ /** Newsletter-related events */
132
+ 'newsletter.reaction': {
133
+ id: string;
134
+ server_id: string;
135
+ reaction: {
136
+ code?: string;
137
+ count?: number;
138
+ removed?: boolean;
139
+ };
140
+ };
141
+ 'newsletter.view': {
142
+ id: string;
143
+ server_id: string;
144
+ count: number;
145
+ };
146
+ 'newsletter-participants.update': {
147
+ id: string;
148
+ author: string;
149
+ user: string;
150
+ new_role: string;
151
+ action: string;
152
+ };
153
+ 'newsletter-settings.update': {
154
+ id: string;
155
+ update: any;
156
+ };
157
+ 'message-capping.update': NewChatMessageCapInfo;
158
+ /** Settings and actions sync events */
159
+ 'chats.lock': {
160
+ id: string;
161
+ locked: boolean;
162
+ };
163
+ 'settings.update': {
164
+ setting: 'unarchiveChats';
165
+ value: boolean;
166
+ } | {
167
+ setting: 'locale';
168
+ value: string;
169
+ } | {
170
+ setting: 'disableLinkPreviews';
171
+ value: proto.SyncActionValue.IPrivacySettingDisableLinkPreviewsAction;
172
+ } | {
173
+ setting: 'timeFormat';
174
+ value: proto.SyncActionValue.ITimeFormatAction;
175
+ } | {
176
+ setting: 'privacySettingRelayAllCalls';
177
+ value: proto.SyncActionValue.IPrivacySettingRelayAllCalls;
178
+ } | {
179
+ setting: 'statusPrivacy';
180
+ value: proto.SyncActionValue.IStatusPrivacyAction;
181
+ } | {
182
+ setting: 'notificationActivitySetting';
183
+ value: proto.SyncActionValue.NotificationActivitySettingAction.NotificationActivitySetting;
184
+ } | {
185
+ setting: 'channelsPersonalisedRecommendation';
186
+ value: proto.SyncActionValue.IPrivacySettingChannelsPersonalisedRecommendationAction;
187
+ };
188
+ };
189
+ export type BufferedEventData = {
190
+ historySets: {
191
+ chats: {
192
+ [jid: string]: Chat;
193
+ };
194
+ contacts: {
195
+ [jid: string]: Contact;
196
+ };
197
+ messages: {
198
+ [uqId: string]: WAMessage;
199
+ };
200
+ empty: boolean;
201
+ isLatest: boolean;
202
+ progress?: number | null;
203
+ syncType?: proto.HistorySync.HistorySyncType;
204
+ pastParticipants?: proto.IPastParticipants[];
205
+ chunkOrder?: number | null;
206
+ peerDataRequestSessionId?: string;
207
+ };
208
+ chatUpserts: {
209
+ [jid: string]: Chat;
210
+ };
211
+ chatUpdates: {
212
+ [jid: string]: ChatUpdate;
213
+ };
214
+ chatDeletes: Set<string>;
215
+ contactUpserts: {
216
+ [jid: string]: Contact;
217
+ };
218
+ contactUpdates: {
219
+ [jid: string]: Partial<Contact>;
220
+ };
221
+ messageUpserts: {
222
+ [key: string]: {
223
+ type: MessageUpsertType;
224
+ message: WAMessage;
225
+ };
226
+ };
227
+ messageUpdates: {
228
+ [key: string]: WAMessageUpdate;
229
+ };
230
+ messageDeletes: {
231
+ [key: string]: WAMessageKey;
232
+ };
233
+ messageReactions: {
234
+ [key: string]: {
235
+ key: WAMessageKey;
236
+ reactions: proto.IReaction[];
237
+ };
238
+ };
239
+ messageReceipts: {
240
+ [key: string]: {
241
+ key: WAMessageKey;
242
+ userReceipt: proto.IUserReceipt[];
243
+ };
244
+ };
245
+ groupUpdates: {
246
+ [jid: string]: Partial<GroupMetadata>;
247
+ };
248
+ };
249
+ export type BaileysEvent = keyof BaileysEventMap;
250
+ export interface BaileysEventEmitter {
251
+ on<T extends keyof BaileysEventMap>(event: T, listener: (arg: BaileysEventMap[T]) => void): void;
252
+ off<T extends keyof BaileysEventMap>(event: T, listener: (arg: BaileysEventMap[T]) => void): void;
253
+ removeAllListeners<T extends keyof BaileysEventMap>(event: T): void;
254
+ emit<T extends keyof BaileysEventMap>(event: T, arg: BaileysEventMap[T]): boolean;
255
+ }
256
+ //# sourceMappingURL=Events.d.ts.map
@@ -0,0 +1,2 @@
1
+ import { proto } from '../../WAProto/index.js';
2
+ //# sourceMappingURL=Events.js.map
@@ -0,0 +1,71 @@
1
+ import type { Contact } from './Contact.js';
2
+ import type { WAMessageAddressingMode } from './Message.js';
3
+ export type GroupParticipant = Contact & {
4
+ isAdmin?: boolean;
5
+ isSuperAdmin?: boolean;
6
+ admin?: 'admin' | 'superadmin' | null;
7
+ };
8
+ export type ParticipantAction = 'add' | 'remove' | 'promote' | 'demote' | 'modify';
9
+ export type RequestJoinAction = 'created' | 'revoked' | 'rejected';
10
+ export type RequestJoinMethod = 'invite_link' | 'linked_group_join' | 'non_admin_add' | undefined;
11
+ export interface GroupMetadata {
12
+ id: string;
13
+ notify?: string;
14
+ /** group uses 'lid' or 'pn' to send messages */
15
+ addressingMode?: WAMessageAddressingMode;
16
+ owner: string | undefined;
17
+ ownerPn?: string | undefined;
18
+ ownerUsername?: string | undefined;
19
+ owner_country_code?: string | undefined;
20
+ subject: string;
21
+ /** group subject owner */
22
+ subjectOwner?: string;
23
+ subjectOwnerPn?: string;
24
+ subjectOwnerUsername?: string;
25
+ /** group subject modification date */
26
+ subjectTime?: number;
27
+ creation?: number;
28
+ desc?: string;
29
+ descOwner?: string;
30
+ descOwnerPn?: string;
31
+ descOwnerUsername?: string;
32
+ descId?: string;
33
+ descTime?: number;
34
+ /** if this group is part of a community, it returns the jid of the community to which it belongs */
35
+ linkedParent?: string;
36
+ /** is set when the group only allows admins to change group settings */
37
+ restrict?: boolean;
38
+ /** is set when the group only allows admins to write messages */
39
+ announce?: boolean;
40
+ /** is set when the group also allows members to add participants */
41
+ memberAddMode?: boolean;
42
+ /** Request approval to join the group */
43
+ joinApprovalMode?: boolean;
44
+ /** is this a community */
45
+ isCommunity?: boolean;
46
+ /** is this the announce of a community */
47
+ isCommunityAnnounce?: boolean;
48
+ /** number of group participants */
49
+ size?: number;
50
+ participants: GroupParticipant[];
51
+ ephemeralDuration?: number;
52
+ inviteCode?: string;
53
+ /** the person who added you to group or changed some setting in group */
54
+ author?: string;
55
+ authorPn?: string;
56
+ authorUsername?: string;
57
+ }
58
+ export interface WAGroupCreateResponse {
59
+ status: number;
60
+ gid?: string;
61
+ participants?: [{
62
+ [key: string]: {};
63
+ }];
64
+ }
65
+ export interface GroupModificationResponse {
66
+ status: number;
67
+ participants?: {
68
+ [key: string]: {};
69
+ };
70
+ }
71
+ //# sourceMappingURL=GroupMetadata.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=GroupMetadata.js.map
@@ -0,0 +1,2 @@
1
+ /** WhatsApp has 20 predefined colors */
2
+ export const LabelColor: any;
@@ -0,0 +1,25 @@
1
+ /** WhatsApp has 20 predefined colors */
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 = {}));
25
+ //# sourceMappingURL=Label.js.map
@@ -0,0 +1,2 @@
1
+ /** Association type */
2
+ export const LabelAssociationType: any;
@@ -0,0 +1,7 @@
1
+ /** Association type */
2
+ export var LabelAssociationType;
3
+ (function (LabelAssociationType) {
4
+ LabelAssociationType["Chat"] = "label_jid";
5
+ LabelAssociationType["Message"] = "label_message";
6
+ })(LabelAssociationType || (LabelAssociationType = {}));
7
+ //# sourceMappingURL=LabelAssociation.js.map
@@ -0,0 +1,11 @@
1
+ export { proto as WAProto };
2
+ export const AssociationType: any;
3
+ export const ButtonHeaderType: any;
4
+ export const ButtonType: any;
5
+ export const CarouselCardType: any;
6
+ export const ListType: any;
7
+ export const ProtocolType: any;
8
+ export const WAMessageStubType: any;
9
+ export const WAMessageStatus: any;
10
+ export const WAMessageAddressingMode: any;
11
+ import { proto } from '../../WAProto/index.js';
@@ -0,0 +1,18 @@
1
+ import { proto } from '../../WAProto/index.js';
2
+ // export the WAMessage Prototypes
3
+ export { proto as WAProto };
4
+ // Lia@Changes 03-02-26 --- Add exported message-related enum types from proto.Message
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 ProtocolType = proto.Message.ProtocolMessage.Type;
11
+ export const WAMessageStubType = proto.WebMessageInfo.StubType;
12
+ export const WAMessageStatus = proto.WebMessageInfo.Status;
13
+ export var WAMessageAddressingMode;
14
+ (function (WAMessageAddressingMode) {
15
+ WAMessageAddressingMode["PN"] = "pn";
16
+ WAMessageAddressingMode["LID"] = "lid";
17
+ })(WAMessageAddressingMode || (WAMessageAddressingMode = {}));
18
+ //# sourceMappingURL=Message.js.map
@@ -0,0 +1,2 @@
1
+ export const XWAPaths: any;
2
+ export const QueryIds: any;
@@ -0,0 +1,39 @@
1
+ export var XWAPaths;
2
+ (function (XWAPaths) {
3
+ XWAPaths["xwa2_newsletter_create"] = "xwa2_newsletter_create";
4
+ XWAPaths["xwa2_newsletter_subscribers"] = "xwa2_newsletter_subscribers";
5
+ XWAPaths["xwa2_newsletter_subscribed"] = "xwa2_newsletter_subscribed";
6
+ XWAPaths["xwa2_newsletter_view"] = "xwa2_newsletter_view";
7
+ XWAPaths["xwa2_newsletter_metadata"] = "xwa2_newsletter";
8
+ XWAPaths["xwa2_newsletter_admin_count"] = "xwa2_newsletter_admin";
9
+ XWAPaths["xwa2_newsletter_mute_v2"] = "xwa2_newsletter_mute_v2";
10
+ XWAPaths["xwa2_newsletter_unmute_v2"] = "xwa2_newsletter_unmute_v2";
11
+ XWAPaths["xwa2_newsletter_follow"] = "xwa2_newsletter_follow";
12
+ XWAPaths["xwa2_newsletter_unfollow"] = "xwa2_newsletter_unfollow";
13
+ XWAPaths["xwa2_newsletter_join_v2"] = "xwa2_newsletter_join_v2";
14
+ XWAPaths["xwa2_newsletter_leave_v2"] = "xwa2_newsletter_leave_v2";
15
+ XWAPaths["xwa2_newsletter_change_owner"] = "xwa2_newsletter_change_owner";
16
+ XWAPaths["xwa2_newsletter_demote"] = "xwa2_newsletter_demote";
17
+ XWAPaths["xwa2_newsletter_delete_v2"] = "xwa2_newsletter_delete_v2";
18
+ XWAPaths["xwa2_fetch_account_reachout_timelock"] = "xwa2_fetch_account_reachout_timelock";
19
+ XWAPaths["xwa2_message_capping_info"] = "xwa2_message_capping_info";
20
+ })(XWAPaths || (XWAPaths = {}));
21
+ export var QueryIds;
22
+ (function (QueryIds) {
23
+ QueryIds["CREATE"] = "8823471724422422";
24
+ QueryIds["UPDATE_METADATA"] = "24250201037901610";
25
+ QueryIds["METADATA"] = "6563316087068696";
26
+ QueryIds["SUBSCRIBERS"] = "9783111038412085";
27
+ QueryIds["SUBSCRIBED"] = "6388546374527196";
28
+ QueryIds["FOLLOW"] = "24404358912487870";
29
+ QueryIds["UNFOLLOW"] = "9767147403369991";
30
+ QueryIds["MUTE"] = "29766401636284406";
31
+ QueryIds["UNMUTE"] = "9864994326891137";
32
+ QueryIds["ADMIN_COUNT"] = "7130823597031706";
33
+ QueryIds["CHANGE_OWNER"] = "7341777602580933";
34
+ QueryIds["DEMOTE"] = "6551828931592903";
35
+ QueryIds["DELETE"] = "30062808666639665";
36
+ QueryIds["REACHOUT_TIMELOCK"] = "23983697327930364";
37
+ QueryIds["MESSAGE_CAPPING_INFO"] = "24503548349331633";
38
+ })(QueryIds || (QueryIds = {}));
39
+ //# sourceMappingURL=Mex.js.map
@@ -0,0 +1,79 @@
1
+ import type { WAMediaUpload } from './Message.js';
2
+ export type CatalogResult = {
3
+ data: {
4
+ paging: {
5
+ cursors: {
6
+ before: string;
7
+ after: string;
8
+ };
9
+ };
10
+ data: any[];
11
+ };
12
+ };
13
+ export type ProductCreateResult = {
14
+ data: {
15
+ product: {};
16
+ };
17
+ };
18
+ export type CatalogStatus = {
19
+ status: string;
20
+ canAppeal: boolean;
21
+ };
22
+ export type CatalogCollection = {
23
+ id: string;
24
+ name: string;
25
+ products: Product[];
26
+ status: CatalogStatus;
27
+ };
28
+ export type ProductAvailability = 'in stock';
29
+ export type ProductBase = {
30
+ name: string;
31
+ retailerId?: string;
32
+ url?: string;
33
+ description: string;
34
+ price: number;
35
+ currency: string;
36
+ isHidden?: boolean;
37
+ };
38
+ export type ProductCreate = ProductBase & {
39
+ /** ISO country code for product origin. Set to undefined for no country */
40
+ originCountryCode: string | undefined;
41
+ /** images of the product */
42
+ images: WAMediaUpload[];
43
+ };
44
+ export type ProductUpdate = Omit<ProductCreate, 'originCountryCode'>;
45
+ export type Product = ProductBase & {
46
+ id: string;
47
+ imageUrls: {
48
+ [_: string]: string;
49
+ };
50
+ reviewStatus: {
51
+ [_: string]: string;
52
+ };
53
+ availability: ProductAvailability;
54
+ };
55
+ export type OrderPrice = {
56
+ currency: string;
57
+ total: number;
58
+ };
59
+ export type OrderProduct = {
60
+ id: string;
61
+ imageUrl: string;
62
+ name: string;
63
+ quantity: number;
64
+ currency: string;
65
+ price: number;
66
+ };
67
+ export type OrderDetails = {
68
+ price: OrderPrice;
69
+ products: OrderProduct[];
70
+ };
71
+ export type CatalogCursor = string;
72
+ export type GetCatalogOptions = {
73
+ /** cursor to start from */
74
+ cursor?: CatalogCursor;
75
+ /** number of products to fetch */
76
+ limit?: number;
77
+ jid?: string;
78
+ };
79
+ //# sourceMappingURL=Product.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Product.js.map
@@ -0,0 +1,2 @@
1
+ export const CodeHighlightType: any;
2
+ export const RichSubMessageType: any;
@@ -0,0 +1,23 @@
1
+ export var CodeHighlightType;
2
+ (function (CodeHighlightType) {
3
+ CodeHighlightType[CodeHighlightType["DEFAULT"] = 0] = "DEFAULT";
4
+ CodeHighlightType[CodeHighlightType["KEYWORD"] = 1] = "KEYWORD";
5
+ CodeHighlightType[CodeHighlightType["METHOD"] = 2] = "METHOD";
6
+ CodeHighlightType[CodeHighlightType["STRING"] = 3] = "STRING";
7
+ CodeHighlightType[CodeHighlightType["NUMBER"] = 4] = "NUMBER";
8
+ CodeHighlightType[CodeHighlightType["COMMENT"] = 5] = "COMMENT";
9
+ })(CodeHighlightType || (CodeHighlightType = {}));
10
+ export var RichSubMessageType;
11
+ (function (RichSubMessageType) {
12
+ RichSubMessageType[RichSubMessageType["UNKNOWN"] = 0] = "UNKNOWN";
13
+ RichSubMessageType[RichSubMessageType["GRID_IMAGE"] = 1] = "GRID_IMAGE";
14
+ RichSubMessageType[RichSubMessageType["TEXT"] = 2] = "TEXT";
15
+ RichSubMessageType[RichSubMessageType["INLINE_IMAGE"] = 3] = "INLINE_IMAGE";
16
+ RichSubMessageType[RichSubMessageType["TABLE"] = 4] = "TABLE";
17
+ RichSubMessageType[RichSubMessageType["CODE"] = 5] = "CODE";
18
+ RichSubMessageType[RichSubMessageType["DYNAMIC"] = 6] = "DYNAMIC";
19
+ RichSubMessageType[RichSubMessageType["MAP"] = 7] = "MAP";
20
+ RichSubMessageType[RichSubMessageType["LATEX"] = 8] = "LATEX";
21
+ RichSubMessageType[RichSubMessageType["CONTENT_ITEMS"] = 9] = "CONTENT_ITEMS";
22
+ })(RichSubMessageType || (RichSubMessageType = {}));
23
+ //# sourceMappingURL=RichType.js.map
@@ -0,0 +1,87 @@
1
+ import { proto } from '../../WAProto/index.js';
2
+ import type { LIDMappingStore } from '../Signal/lid-mapping.js';
3
+ type DecryptGroupSignalOpts = {
4
+ group: string;
5
+ authorJid: string;
6
+ msg: Uint8Array;
7
+ };
8
+ type ProcessSenderKeyDistributionMessageOpts = {
9
+ item: proto.Message.ISenderKeyDistributionMessage;
10
+ authorJid: string;
11
+ };
12
+ type DecryptSignalProtoOpts = {
13
+ jid: string;
14
+ type: 'pkmsg' | 'msg';
15
+ ciphertext: Uint8Array;
16
+ };
17
+ type EncryptMessageOpts = {
18
+ jid: string;
19
+ data: Uint8Array;
20
+ };
21
+ type EncryptGroupMessageOpts = {
22
+ group: string;
23
+ data: Uint8Array;
24
+ meId: string;
25
+ };
26
+ type GetSenderKeyDistributionMessageOpts = {
27
+ group: string;
28
+ meId: string;
29
+ };
30
+ type PreKey = {
31
+ keyId: number;
32
+ publicKey: Uint8Array;
33
+ };
34
+ type SignedPreKey = PreKey & {
35
+ signature: Uint8Array;
36
+ };
37
+ type E2ESession = {
38
+ registrationId: number;
39
+ identityKey: Uint8Array;
40
+ signedPreKey: SignedPreKey;
41
+ preKey?: PreKey;
42
+ };
43
+ type E2ESessionOpts = {
44
+ jid: string;
45
+ session: E2ESession;
46
+ };
47
+ export type SignalRepository = {
48
+ decryptGroupMessage(opts: DecryptGroupSignalOpts): Promise<Uint8Array>;
49
+ processSenderKeyDistributionMessage(opts: ProcessSenderKeyDistributionMessageOpts): Promise<void>;
50
+ decryptMessage(opts: DecryptSignalProtoOpts): Promise<Uint8Array>;
51
+ encryptMessage(opts: EncryptMessageOpts): Promise<{
52
+ type: 'pkmsg' | 'msg';
53
+ ciphertext: Uint8Array;
54
+ }>;
55
+ encryptGroupMessage(opts: EncryptGroupMessageOpts): Promise<{
56
+ senderKeyDistributionMessage: Uint8Array;
57
+ ciphertext: Uint8Array;
58
+ }>;
59
+ getSenderKeyDistributionMessage(opts: GetSenderKeyDistributionMessageOpts): Promise<Uint8Array>;
60
+ hasSenderKey(opts: GetSenderKeyDistributionMessageOpts): Promise<boolean>;
61
+ getSessionInfo(jid: string): Promise<{
62
+ baseKey: Uint8Array;
63
+ registrationId: number;
64
+ } | null>;
65
+ injectE2ESession(opts: E2ESessionOpts): Promise<void>;
66
+ validateSession(jid: string): Promise<{
67
+ exists: boolean;
68
+ reason?: string;
69
+ }>;
70
+ jidToSignalProtocolAddress(jid: string): string;
71
+ migrateSession(fromJid: string, toJid: string): Promise<{
72
+ migrated: number;
73
+ skipped: number;
74
+ total: number;
75
+ }>;
76
+ validateSession(jid: string): Promise<{
77
+ exists: boolean;
78
+ reason?: string;
79
+ }>;
80
+ deleteSession(jids: string[]): Promise<void>;
81
+ };
82
+ export interface SignalRepositoryWithLIDStore extends SignalRepository {
83
+ lidMapping: LIDMappingStore;
84
+ close?: () => void;
85
+ }
86
+ export {};
87
+ //# sourceMappingURL=Signal.d.ts.map
@@ -0,0 +1,2 @@
1
+ import { proto } from '../../WAProto/index.js';
2
+ //# sourceMappingURL=Signal.js.map