@neelegirl/baileys 1.5.3 → 1.5.5

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 (224) hide show
  1. package/README.md +16 -195
  2. package/index.js +38 -0
  3. package/package.json +16 -96
  4. package/LICENSE +0 -21
  5. package/WAProto/WAProto.proto +0 -5308
  6. package/WAProto/index.d.ts +0 -61295
  7. package/WAProto/index.js +0 -189754
  8. package/lib/Defaults/baileys-version.json +0 -3
  9. package/lib/Defaults/index.d.ts +0 -78
  10. package/lib/Defaults/index.js +0 -149
  11. package/lib/Defaults/phonenumber-mcc.json +0 -223
  12. package/lib/Signal/WASignalGroup/GroupProtocol.js +0 -1909
  13. package/lib/Signal/WASignalGroup/ciphertext-message.d.ts +0 -9
  14. package/lib/Signal/WASignalGroup/ciphertext-message.js +0 -19
  15. package/lib/Signal/WASignalGroup/ciphertext_message.js +0 -16
  16. package/lib/Signal/WASignalGroup/generate-proto.sh +0 -1
  17. package/lib/Signal/WASignalGroup/group-session-builder.d.ts +0 -17
  18. package/lib/Signal/WASignalGroup/group-session-builder.js +0 -72
  19. package/lib/Signal/WASignalGroup/group.proto +0 -42
  20. package/lib/Signal/WASignalGroup/group_cipher.d.ts +0 -19
  21. package/lib/Signal/WASignalGroup/group_cipher.js +0 -111
  22. package/lib/Signal/WASignalGroup/group_session_builder.js +0 -46
  23. package/lib/Signal/WASignalGroup/index.d.ts +0 -11
  24. package/lib/Signal/WASignalGroup/index.js +0 -61
  25. package/lib/Signal/WASignalGroup/keyhelper.d.ts +0 -16
  26. package/lib/Signal/WASignalGroup/keyhelper.js +0 -66
  27. package/lib/Signal/WASignalGroup/protobufs.js +0 -3
  28. package/lib/Signal/WASignalGroup/queue_job.js +0 -69
  29. package/lib/Signal/WASignalGroup/readme.md +0 -6
  30. package/lib/Signal/WASignalGroup/sender-chain-key.d.ts +0 -14
  31. package/lib/Signal/WASignalGroup/sender-chain-key.js +0 -47
  32. package/lib/Signal/WASignalGroup/sender-key-distribution-message.d.ts +0 -17
  33. package/lib/Signal/WASignalGroup/sender-key-distribution-message.js +0 -71
  34. package/lib/Signal/WASignalGroup/sender-key-message.d.ts +0 -19
  35. package/lib/Signal/WASignalGroup/sender-key-message.js +0 -73
  36. package/lib/Signal/WASignalGroup/sender-key-name.d.ts +0 -19
  37. package/lib/Signal/WASignalGroup/sender-key-name.js +0 -59
  38. package/lib/Signal/WASignalGroup/sender-key-record.d.ts +0 -32
  39. package/lib/Signal/WASignalGroup/sender-key-record.js +0 -58
  40. package/lib/Signal/WASignalGroup/sender-key-state.d.ts +0 -44
  41. package/lib/Signal/WASignalGroup/sender-key-state.js +0 -147
  42. package/lib/Signal/WASignalGroup/sender-message-key.d.ts +0 -11
  43. package/lib/Signal/WASignalGroup/sender-message-key.js +0 -33
  44. package/lib/Signal/WASignalGroup/sender_chain_key.js +0 -50
  45. package/lib/Signal/WASignalGroup/sender_key_distribution_message.js +0 -78
  46. package/lib/Signal/WASignalGroup/sender_key_message.js +0 -92
  47. package/lib/Signal/WASignalGroup/sender_key_name.js +0 -70
  48. package/lib/Signal/WASignalGroup/sender_key_record.js +0 -56
  49. package/lib/Signal/WASignalGroup/sender_key_state.js +0 -129
  50. package/lib/Signal/WASignalGroup/sender_message_key.js +0 -39
  51. package/lib/Signal/libsignal.d.ts +0 -8
  52. package/lib/Signal/libsignal.js +0 -391
  53. package/lib/Signal/lid-mapping.d.ts +0 -28
  54. package/lib/Signal/lid-mapping.js +0 -184
  55. package/lib/Socket/Client/abstract-socket-client.d.ts +0 -15
  56. package/lib/Socket/Client/abstract-socket-client.js +0 -13
  57. package/lib/Socket/Client/index.d.ts +0 -2
  58. package/lib/Socket/Client/index.js +0 -22
  59. package/lib/Socket/Client/mobile-socket-client.d.ts +0 -12
  60. package/lib/Socket/Client/mobile-socket-client.js +0 -65
  61. package/lib/Socket/Client/types.d.ts +0 -16
  62. package/lib/Socket/Client/types.js +0 -18
  63. package/lib/Socket/Client/websocket.d.ts +0 -13
  64. package/lib/Socket/Client/websocket.js +0 -62
  65. package/lib/Socket/business.d.ts +0 -187
  66. package/lib/Socket/business.js +0 -415
  67. package/lib/Socket/chats.d.ts +0 -97
  68. package/lib/Socket/chats.js +0 -1118
  69. package/lib/Socket/communities.d.ts +0 -223
  70. package/lib/Socket/communities.js +0 -433
  71. package/lib/Socket/groups.d.ts +0 -129
  72. package/lib/Socket/groups.js +0 -360
  73. package/lib/Socket/index.d.ts +0 -191
  74. package/lib/Socket/index.js +0 -24
  75. package/lib/Socket/messages-recv.d.ts +0 -174
  76. package/lib/Socket/messages-recv.js +0 -1506
  77. package/lib/Socket/messages-send.d.ts +0 -165
  78. package/lib/Socket/messages-send.js +0 -1785
  79. package/lib/Socket/mex.d.ts +0 -2
  80. package/lib/Socket/mex.js +0 -47
  81. package/lib/Socket/newsletter.d.ts +0 -145
  82. package/lib/Socket/newsletter.js +0 -295
  83. package/lib/Socket/socket.d.ts +0 -45
  84. package/lib/Socket/socket.js +0 -934
  85. package/lib/Socket/usync.d.ts +0 -37
  86. package/lib/Socket/usync.js +0 -83
  87. package/lib/Store/index.d.ts +0 -4
  88. package/lib/Store/index.js +0 -24
  89. package/lib/Store/make-cache-manager-store.d.ts +0 -14
  90. package/lib/Store/make-cache-manager-store.js +0 -90
  91. package/lib/Store/make-in-memory-store.d.ts +0 -123
  92. package/lib/Store/make-in-memory-store.js +0 -429
  93. package/lib/Store/make-ordered-dictionary.d.ts +0 -12
  94. package/lib/Store/make-ordered-dictionary.js +0 -86
  95. package/lib/Store/object-repository.d.ts +0 -10
  96. package/lib/Store/object-repository.js +0 -31
  97. package/lib/Types/Auth.d.ts +0 -121
  98. package/lib/Types/Auth.js +0 -3
  99. package/lib/Types/Bussines.js +0 -3
  100. package/lib/Types/Bussiness.d.ts +0 -28
  101. package/lib/Types/Call.d.ts +0 -14
  102. package/lib/Types/Call.js +0 -3
  103. package/lib/Types/Chat.d.ts +0 -143
  104. package/lib/Types/Chat.js +0 -9
  105. package/lib/Types/Contact.d.ts +0 -23
  106. package/lib/Types/Contact.js +0 -3
  107. package/lib/Types/Events.d.ts +0 -226
  108. package/lib/Types/Events.js +0 -3
  109. package/lib/Types/GroupMetadata.d.ts +0 -66
  110. package/lib/Types/GroupMetadata.js +0 -3
  111. package/lib/Types/Label.d.ts +0 -48
  112. package/lib/Types/Label.js +0 -31
  113. package/lib/Types/LabelAssociation.d.ts +0 -35
  114. package/lib/Types/LabelAssociation.js +0 -13
  115. package/lib/Types/Message.d.ts +0 -484
  116. package/lib/Types/Message.js +0 -19
  117. package/lib/Types/MexUpdates.d.ts +0 -9
  118. package/lib/Types/MexUpdates.js +0 -18
  119. package/lib/Types/Newsletter.d.ts +0 -109
  120. package/lib/Types/Newsletter.js +0 -40
  121. package/lib/Types/Product.d.ts +0 -92
  122. package/lib/Types/Product.js +0 -3
  123. package/lib/Types/Signal.d.ts +0 -98
  124. package/lib/Types/Signal.js +0 -3
  125. package/lib/Types/Socket.d.ts +0 -141
  126. package/lib/Types/Socket.js +0 -3
  127. package/lib/Types/State.d.ts +0 -41
  128. package/lib/Types/State.js +0 -14
  129. package/lib/Types/USync.d.ts +0 -26
  130. package/lib/Types/USync.js +0 -3
  131. package/lib/Types/index.d.ts +0 -80
  132. package/lib/Types/index.js +0 -50
  133. package/lib/Utils/auth-utils.d.ts +0 -21
  134. package/lib/Utils/auth-utils.js +0 -528
  135. package/lib/Utils/baileys-event-stream.d.ts +0 -18
  136. package/lib/Utils/baileys-event-stream.js +0 -70
  137. package/lib/Utils/business.d.ts +0 -29
  138. package/lib/Utils/business.js +0 -255
  139. package/lib/Utils/chat-utils.d.ts +0 -82
  140. package/lib/Utils/chat-utils.js +0 -809
  141. package/lib/Utils/crypto.d.ts +0 -56
  142. package/lib/Utils/crypto.js +0 -189
  143. package/lib/Utils/decode-wa-message.d.ts +0 -53
  144. package/lib/Utils/decode-wa-message.js +0 -323
  145. package/lib/Utils/event-buffer.d.ts +0 -39
  146. package/lib/Utils/event-buffer.js +0 -595
  147. package/lib/Utils/generics.d.ts +0 -131
  148. package/lib/Utils/generics.js +0 -630
  149. package/lib/Utils/history.d.ts +0 -23
  150. package/lib/Utils/history.js +0 -104
  151. package/lib/Utils/index.d.ts +0 -20
  152. package/lib/Utils/index.js +0 -40
  153. package/lib/Utils/link-preview.d.ts +0 -23
  154. package/lib/Utils/link-preview.js +0 -120
  155. package/lib/Utils/logger.d.ts +0 -13
  156. package/lib/Utils/logger.js +0 -7
  157. package/lib/Utils/lt-hash.d.ts +0 -14
  158. package/lib/Utils/lt-hash.js +0 -58
  159. package/lib/Utils/make-mutex.d.ts +0 -9
  160. package/lib/Utils/make-mutex.js +0 -49
  161. package/lib/Utils/message-retry-manager.d.ts +0 -88
  162. package/lib/Utils/message-retry-manager.js +0 -160
  163. package/lib/Utils/messages-media.d.ts +0 -135
  164. package/lib/Utils/messages-media.js +0 -869
  165. package/lib/Utils/messages.d.ts +0 -105
  166. package/lib/Utils/messages.js +0 -1745
  167. package/lib/Utils/noise-handler.d.ts +0 -21
  168. package/lib/Utils/noise-handler.js +0 -165
  169. package/lib/Utils/process-message.d.ts +0 -49
  170. package/lib/Utils/process-message.js +0 -427
  171. package/lib/Utils/signal.d.ts +0 -42
  172. package/lib/Utils/signal.js +0 -166
  173. package/lib/Utils/use-mongo-file-auth-state.d.ts +0 -6
  174. package/lib/Utils/use-mongo-file-auth-state.js +0 -84
  175. package/lib/Utils/use-multi-file-auth-state.d.ts +0 -18
  176. package/lib/Utils/use-multi-file-auth-state.js +0 -238
  177. package/lib/Utils/use-single-file-auth-state.d.ts +0 -13
  178. package/lib/Utils/use-single-file-auth-state.js +0 -80
  179. package/lib/Utils/validate-connection.d.ts +0 -13
  180. package/lib/Utils/validate-connection.js +0 -220
  181. package/lib/WABinary/constants.d.ts +0 -30
  182. package/lib/WABinary/constants.js +0 -1316
  183. package/lib/WABinary/decode.d.ts +0 -9
  184. package/lib/WABinary/decode.js +0 -288
  185. package/lib/WABinary/encode.d.ts +0 -3
  186. package/lib/WABinary/encode.js +0 -265
  187. package/lib/WABinary/generic-utils.d.ts +0 -28
  188. package/lib/WABinary/generic-utils.js +0 -142
  189. package/lib/WABinary/index.d.ts +0 -5
  190. package/lib/WABinary/index.js +0 -25
  191. package/lib/WABinary/jid-utils.d.ts +0 -58
  192. package/lib/WABinary/jid-utils.js +0 -104
  193. package/lib/WABinary/types.d.ts +0 -22
  194. package/lib/WABinary/types.js +0 -3
  195. package/lib/WAM/BinaryInfo.d.ts +0 -16
  196. package/lib/WAM/BinaryInfo.js +0 -17
  197. package/lib/WAM/constants.d.ts +0 -47
  198. package/lib/WAM/constants.js +0 -15371
  199. package/lib/WAM/encode.d.ts +0 -3
  200. package/lib/WAM/encode.js +0 -164
  201. package/lib/WAM/index.d.ts +0 -3
  202. package/lib/WAM/index.js +0 -23
  203. package/lib/WAUSync/Protocols/USyncBotProfileProtocol.d.ts +0 -28
  204. package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +0 -69
  205. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -10
  206. package/lib/WAUSync/Protocols/USyncContactProtocol.js +0 -36
  207. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -26
  208. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +0 -62
  209. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -14
  210. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +0 -35
  211. package/lib/WAUSync/Protocols/USyncLIDProtocol.d.ts +0 -10
  212. package/lib/WAUSync/Protocols/USyncLIDProtocol.js +0 -38
  213. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -14
  214. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +0 -46
  215. package/lib/WAUSync/Protocols/index.d.ts +0 -6
  216. package/lib/WAUSync/Protocols/index.js +0 -26
  217. package/lib/WAUSync/USyncQuery.d.ts +0 -31
  218. package/lib/WAUSync/USyncQuery.js +0 -92
  219. package/lib/WAUSync/USyncUser.d.ts +0 -12
  220. package/lib/WAUSync/USyncUser.js +0 -30
  221. package/lib/WAUSync/index.d.ts +0 -3
  222. package/lib/WAUSync/index.js +0 -23
  223. package/lib/index.d.ts +0 -13
  224. package/lib/index.js +0 -33
@@ -1,484 +0,0 @@
1
- import { AxiosRequestConfig } from 'axios'
2
- import { ILogger } from '@neelegirl/baileys/lib/Utils/logger'
3
- import type { Readable } from 'stream'
4
- import type { URL } from 'url'
5
- import { proto } from '@neelegirl/baileys/WAProto'
6
- import { MEDIA_HKDF_KEY_MAPPING } from '@neelegirl/baileys/lib/Defaults'
7
- import { BinaryNode } from '@neelegirl/baileys/lib/WABinary'
8
- import type { GroupMetadata } from '@neelegirl/baileys/lib/Types/GroupMetadata'
9
- import { CacheStore } from '@neelegirl/baileys/lib/Types/Socket'
10
-
11
- export { proto as WAProto }
12
-
13
- export type WAMessage = proto.IWebMessageInfo
14
-
15
- export type WAMessageContent = proto.IMessage
16
-
17
- export type WAContactMessage = proto.Message.IContactMessage
18
-
19
- export type WAContactsArrayMessage = proto.Message.IContactsArrayMessage
20
-
21
- export type WAMessageKey = proto.IMessageKey & {
22
- remoteJidAlt?: string
23
- participantAlt?: string
24
- newsletter_server_id?: string
25
- isViewOnce?: boolean
26
- };
27
-
28
- export type WATextMessage = proto.Message.IExtendedTextMessage
29
-
30
- export type WAContextInfo = proto.IContextInfo
31
-
32
- export type WALocationMessage = proto.Message.ILocationMessage
33
-
34
- export type WAOrderMessage = proto.Message.IOrderMessage
35
-
36
- export type WAEventMessage = proto.Message.IEventMessage
37
-
38
- export type WAGenericMediaMessage = proto.Message.IVideoMessage | proto.Message.IImageMessage | proto.Message.IAudioMessage | proto.Message.IDocumentMessage | proto.Message.IStickerMessage
39
-
40
- export declare const WAMessageStubType = proto.WebMessageInfo.StubType
41
-
42
- export declare const WAMessageStatus = proto.WebMessageInfo.Status
43
-
44
- export type WAMediaUpload = Buffer | {
45
- url: URL | string
46
- } | {
47
- stream: Readable
48
- }
49
-
50
- /** Set of message types that are supported by the library */
51
- export type MessageType = keyof proto.Message
52
-
53
- export declare enum WAMessageAddressingMode {
54
- PN = 'pn',
55
- LID = 'lid'
56
- }
57
-
58
- export type DownloadableMessage = {
59
- mediaKey?: Uint8Array | null
60
- directPath?: string | null
61
- url?: string | null
62
- }
63
-
64
- export type MessageReceiptType = 'read' | 'read-self' | 'hist_sync' | 'peer_msg' | 'sender' | 'inactive' | 'played' | undefined
65
-
66
- export type MediaConnInfo = {
67
- auth: string
68
- ttl: number
69
- hosts: {
70
- hostname: string
71
- maxContentLengthBytes: number
72
- }[]
73
- fetchDate: Date
74
- }
75
-
76
- export interface StickerPack {
77
- stickers: Sticker[]
78
- cover: WAMediaUpload
79
- name: string
80
- publisher: string
81
- description?: string
82
- packId?: string
83
- }
84
-
85
- export interface Carousel {
86
- image?: WAMediaUpload
87
- video?: WAMediaUpload
88
- product?: WASendableProduct
89
- title?: string
90
- body?: string
91
- footer?: string
92
- buttons?: proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton[]
93
- }
94
-
95
- export interface WAUrlInfo {
96
- 'canonical-url': string
97
- 'matched-text': string
98
- title: string
99
- description?: string
100
- jpegThumbnail?: Buffer
101
- highQualityThumbnail?: proto.Message.IImageMessage
102
- originalThumbnailUrl?: string
103
- }
104
-
105
- type Mentionable = {
106
- /** list of jids that are mentioned in the accompanying text */
107
- mentions?: string[]
108
- }
109
-
110
- type Contextable = {
111
- /** add contextInfo to the message */
112
- contextInfo?: proto.IContextInfo
113
- }
114
-
115
- type Ephemeral = {
116
- ephemeral?: boolean
117
- }
118
-
119
- type ViewOnce = {
120
- viewOnce?: boolean
121
- }
122
-
123
- type ViewOnceExt = {
124
- viewOnceExt?: boolean
125
- }
126
-
127
- type Buttonable = {
128
- /** add buttons to the message */
129
- buttons?: proto.Message.ButtonsMessage.IButton[]
130
- }
131
-
132
- type Templatable = {
133
- /** add buttons to the message (conflicts with normal buttons)*/
134
- templateButtons?: proto.IHydratedTemplateButton[]
135
- footer?: string
136
- }
137
-
138
- type Interactiveable = {
139
- /** add buttons to the message (conflicts with normal buttons)*/
140
- interactiveButtons?: proto.Message.InteractiveMessage.NativeFlowMessage.INativeFlowButton[]
141
- title?: string
142
- subtitle?: string
143
- footer?: string
144
- hasMediaAttachment?: boolean
145
- }
146
-
147
- type Shopable = {
148
- shop?: proto.Message.InteractiveMessage.ShopMessage
149
- title?: string
150
- subtitle?: string
151
- footer?: string
152
- hasMediaAttachment?: boolean
153
- }
154
-
155
- type Collectionable = {
156
- collection?: proto.Message.InteractiveMessage.CollectionMessage
157
- title?: string
158
- subtitle?: string
159
- footer?: string
160
- hasMediaAttachment?: boolean
161
- }
162
-
163
- type Listable = {
164
- /** Sections of the List */
165
- sections?: proto.Message.ListMessage.ISection[]
166
- /** Title of a List Message only */
167
- title?: string
168
- /** Text of the button on the list (required) */
169
- buttonText?: string
170
- /** ListType of a List Message only */
171
- listType?: proto.Message.ListMessage.ListType
172
- }
173
-
174
- type Cardsable = {
175
- cards?: Carousel[]
176
- title?: string
177
- subtitle?: string
178
- footer?: string
179
- }
180
-
181
- type Editable = {
182
- edit?: WAMessageKey
183
- }
184
-
185
- type WithDimensions = {
186
- width?: number
187
- height?: number
188
- }
189
-
190
- export type Sticker = {
191
- data: WAMediaUpload
192
- emojis?: string[]
193
- accessibilityLabel?: string
194
- }
195
-
196
- export type PollMessageOptions = {
197
- name: string
198
- selectableCount?: number
199
- values: string[]
200
- /** 32 byte message secret to encrypt poll selections */
201
- messageSecret?: Uint8Array
202
- toAnnouncementGroup?: boolean
203
- }
204
-
205
- export type PollResultOptions = {
206
- name: string
207
- values: string[]
208
- }
209
-
210
- type SharePhoneNumber = {
211
- sharePhoneNumber: boolean
212
- }
213
-
214
- type RequestPhoneNumber = {
215
- requestPhoneNumber: boolean
216
- }
217
-
218
- export type MediaType = keyof typeof MEDIA_HKDF_KEY_MAPPING
219
-
220
- export type AnyMediaMessageContent = (({
221
- image: WAMediaUpload
222
- caption?: string
223
- jpegThumbnail?: string
224
- } & Mentionable & Contextable & Buttonable & Templatable & Interactiveable & WithDimensions) | ({
225
- video: WAMediaUpload
226
- caption?: string
227
- gifPlayback?: boolean
228
- jpegThumbnail?: string
229
- } & Mentionable & Contextable & Buttonable & Templatable & Interactiveable & WithDimensions) | {
230
- audio: WAMediaUpload
231
- /** if set to true, will send as a `voice note` */
232
- ptt?: boolean
233
- /** optionally tell the duration of the audio */
234
- seconds?: number
235
- } | ({
236
- sticker: WAMediaUpload
237
- isAnimated?: boolean
238
- } & WithDimensions) | ({
239
- document: WAMediaUpload
240
- mimetype: string
241
- fileName?: string
242
- caption?: string
243
- } & Contextable & Buttonable & Templatable & Interactiveable )) & {
244
- mimetype?: string
245
- } & Editable
246
-
247
- export type ButtonReplyInfo = {
248
- displayText: string
249
- id: string
250
- index: number
251
- }
252
-
253
- export type GroupInviteInfo = {
254
- code: string
255
- expiration: number
256
- caption: string
257
- jid: string
258
- name: string
259
- jpegThumbnail?: string
260
- }
261
-
262
- export type CallCreationInfo = {
263
- time?: number
264
- type?: number
265
- name: string
266
- }
267
-
268
- export type AdminInviteInfo = {
269
- jid: string
270
- name: string
271
- caption: string
272
- expiration: number
273
- jpegThumbnail: string
274
- }
275
-
276
- export type PinInfo = {
277
- key: WAMessageKey
278
- type?: number
279
- time?: number
280
- }
281
-
282
- export type KeepInfo = {
283
- key: WAMessageKey
284
- type: number
285
- }
286
-
287
- export type PaymentInfo = {
288
- note: string
289
- currency?: string
290
- offset?: number
291
- amount?: number
292
- expiry?: number
293
- from?: string
294
- image?: {
295
- placeholderArgb: number
296
- textArgb: number
297
- subtextArgb: number
298
- }
299
- }
300
-
301
- export type WASendableProduct = Omit<proto.Message.ProductMessage.IProductSnapshot, 'productImage'> & {
302
- productImage: WAMediaUpload
303
- }
304
-
305
- export type AnyRegularMessageContent = (({
306
- text: string
307
- linkPreview?: WAUrlInfo | null
308
- } & Mentionable & Contextable & Buttonable & Templatable & Interactiveable & Shopable & Collectionable & Cardsable & Listable & Editable & WithDimensions) | AnyMediaMessageContent | ({
309
- poll: PollMessageOptions
310
- } & Mentionable & Contextable & Buttonable & Templatable & Interactiveable & Shopable & Collectionable & Cardsable & Listable & Editable & WithDimensions) | {
311
- contacts: {
312
- displayName?: string
313
- contacts: proto.Message.IContactMessage[]
314
- }
315
- } | {
316
- location: WALocationMessage
317
- } | {
318
- react: proto.Message.IReactionMessage
319
- } | {
320
- buttonReply: ButtonReplyInfo
321
- type: 'template' | 'plain' | 'list' | 'interactive'
322
- } | {
323
- groupInvite: GroupInviteInfo
324
- } | {
325
- pin: PinInfo
326
- } | {
327
- keep: KeepInfo
328
- } | {
329
- call: CallCreationInfo
330
- } | {
331
- event: WAEventMessage
332
- } | {
333
- adminInvite: AdminInviteInfo
334
- } | {
335
- payment: PaymentInfo
336
- } | {
337
- paymentInvite: {
338
- type: number
339
- expiry: number
340
- }
341
- } | {
342
- pollResult: PollResultOptions
343
- } | {
344
- order: WAOrderMessage
345
- } | {
346
- product: WASendableProduct
347
- businessOwnerJid?: string
348
- body?: string
349
- footer?: string
350
- } | {
351
- stickerPack: StickerPack
352
- } | SharePhoneNumber | RequestPhoneNumber) & ViewOnce & ViewOnceExt
353
-
354
- export type AnyMessageContent = AnyRegularMessageContent | {
355
- forward: WAMessage
356
- force?: boolean
357
- } | {
358
- /** Delete your message or anyone's message in a group (admin required) */
359
- delete: WAMessageKey
360
- } | {
361
- disappearingMessagesInChat: boolean | number
362
- }
363
-
364
- export type GroupMetadataParticipants = Pick<GroupMetadata, 'participants'>
365
-
366
- type MinimalRelayOptions = {
367
- /** override the message ID with a custom provided string */
368
- messageId?: string
369
- /** should we use group metadata cache, or fetch afresh from the server default assumed to be "true" */
370
- useCachedGroupMetadata?: boolean
371
- }
372
-
373
- export type MessageRelayOptions = MinimalRelayOptions & {
374
- /** only send to a specific participant used when a message decryption fails for a single user */
375
- participant?: {
376
- jid: string
377
- count: number
378
- }
379
- /** additional attributes to add to the WA binary node */
380
- additionalAttributes?: {
381
- [_: string]: string
382
- }
383
- additionalNodes?: BinaryNode[]
384
- /** should we use the devices cache, or fetch afresh from the server default assumed to be "true" */
385
- useUserDevicesCache?: boolean
386
- /** jid list of participants for status@broadcast */
387
- statusJidList?: string[]
388
- newsletter?: boolean
389
- }
390
-
391
- export type MiscMessageGenerationOptions = MinimalRelayOptions & {
392
- /** optional, if you want to manually set the timestamp of the message */
393
- timestamp?: Date
394
- /** the message you want to quote */
395
- quoted?: WAMessage
396
- /** disappearing messages settings */
397
- ephemeralExpiration?: number | string
398
- /** timeout for media upload to WA server */
399
- mediaUploadTimeoutMs?: number
400
- /** jid list of participants for status@broadcast */
401
- statusJidList?: string[]
402
- /** backgroundcolor for status */
403
- backgroundColor?: string
404
- /** font type for status */
405
- font?: number
406
- /** if it is broadcast */
407
- broadcast?: boolean
408
- newsletter?: boolean
409
- additionalNodes?: BinaryNode[]
410
- }
411
-
412
- export type MessageGenerationOptionsFromContent = MiscMessageGenerationOptions & {
413
- userJid: string
414
- }
415
-
416
- export type WAMediaUploadFunctionOpts = {
417
- fileEncSha256B64: string
418
- mediaType: MediaType
419
- newsletter?: boolean
420
- timeoutMs?: number
421
- }
422
-
423
- export type WAMediaUploadFunction = (encFilePath: string | Buffer, opts: WAMediaUploadFunctionOpts) => Promise<{
424
- mediaUrl: string
425
- directPath: string
426
- handle?: string
427
- meta_hmac?: string
428
- ts?: number
429
- fbid?: number
430
- }>
431
-
432
- export type MediaGenerationOptions = {
433
- logger?: ILogger
434
- mediaTypeOverride?: MediaType
435
- upload: WAMediaUploadFunction
436
- /** cache media so it does not have to be uploaded again */
437
- mediaCache?: CacheStore
438
- mediaUploadTimeoutMs?: number
439
- options?: AxiosRequestConfig
440
- backgroundColor?: string
441
- font?: number
442
- /** The message is for newsletter? */
443
- newsletter?: boolean
444
- }
445
-
446
- export type MessageContentGenerationOptions = MediaGenerationOptions & {
447
- getUrlInfo?: (text: string) => Promise<WAUrlInfo | undefined>
448
- getProfilePicUrl?: (jid: string) => Promise<string | undefined>
449
- getCallLink?: (type: 'audio' | 'video', event?: number) => Promise<string | undefined>
450
- }
451
-
452
- export type MessageGenerationOptions = MessageContentGenerationOptions & MessageGenerationOptionsFromContent
453
- /**
454
- * Type of message upsert
455
- * 1. notify => notify the user, this message was just received
456
- * 2. append => append the message to the chat history, no notification required
457
- */
458
- export type MessageUpsertType = 'append' | 'notify'
459
-
460
- export type MessageUserReceipt = proto.IUserReceipt
461
-
462
- export type WAMessageUpdate = {
463
- update: Partial<WAMessage>
464
- key: proto.IMessageKey
465
- }
466
-
467
- export type WAMessageCursor = {
468
- before: WAMessageKey | undefined
469
- } | {
470
- after: WAMessageKey | undefined
471
- }
472
-
473
- export type MessageUserReceiptUpdate = {
474
- key: proto.IMessageKey
475
- receipt: MessageUserReceipt
476
- }
477
-
478
- export type MediaDecryptionKeyInfo = {
479
- iv: Buffer
480
- cipherKey: Buffer
481
- macKey?: Buffer
482
- }
483
-
484
- export type MinimalMessage = Pick<proto.IWebMessageInfo, 'key' | 'messageTimestamp'>
@@ -1,19 +0,0 @@
1
- "use strict"
2
-
3
- Object.defineProperty(exports, "__esModule", { value: true })
4
-
5
- const WAProto_1 = require("../../WAProto")
6
-
7
- Object.defineProperty(exports, "__esModule", { value: true })
8
-
9
- const WAMessageAddressingMode = {
10
- PN: 'pn',
11
- LID: 'lid'
12
- }
13
-
14
- module.exports = {
15
- WAMessageAddressingMode,
16
- WAMessageStubType: WAProto_1.proto.WebMessageInfo.StubType,
17
- WAMessageStatus: WAProto_1.proto.WebMessageInfo.Status,
18
- WAProto: WAProto_1.proto
19
- }
@@ -1,9 +0,0 @@
1
- export declare const enum MexUpdatesOperations {
2
- OWNER_COMMUNITY = "NotificationCommunityOwnerUpdate",
3
- GROUP_LIMIT_SHARING = "NotificationGroupLimitSharingPropertyUpdate"
4
- }
5
-
6
- export declare const enum XWAPathsUpdates {
7
- GROUP_SHARING_CHANGE = "xwa2_notify_group_on_prop_change",
8
- COMMUNITY_OWNER_CHANGE = "xwa2_notify_group_on_participants_roles_change"
9
- }
@@ -1,18 +0,0 @@
1
- "use strict"
2
-
3
- Object.defineProperty(exports, "__esModule", { value: true })
4
-
5
- const MexUpdatesOperations = {
6
- OWNER_COMMUNITY: "NotificationCommunityOwnerUpdate",
7
- GROUP_LIMIT_SHARING: "NotificationGroupLimitSharingPropertyUpdate"
8
- }
9
-
10
- const XWAPathsMexUpdates = {
11
- GROUP_SHARING_CHANGE: "xwa2_notify_group_on_prop_change",
12
- COMMUNITY_OWNER_CHANGE: "xwa2_notify_group_on_participants_roles_change"
13
- }
14
-
15
- module.exports = {
16
- MexUpdatesOperations,
17
- XWAPathsMexUpdates
18
- }
@@ -1,109 +0,0 @@
1
- import { proto } from '@neelegirl/baileys/WAProto'
2
-
3
- export type NewsletterReactionMode = 'ALL' | 'BASIC' | 'NONE'
4
-
5
- export type NewsletterState = 'ACTIVE' | 'GEOSUSPENDED' | 'SUSPENDED'
6
-
7
- export type NewsletterVerification = 'VERIFIED' | 'UNVERIFIED'
8
-
9
- export type NewsletterMute = 'ON' | 'OFF' | 'UNDEFINED'
10
-
11
- export type NewsletterViewRole = 'ADMIN' | 'GUEST' | 'OWNER' | 'SUBSCRIBER'
12
-
13
- export type NewsletterViewerMetadata = {
14
- mute: NewsletterMute
15
- view_role: NewsletterViewRole
16
- }
17
-
18
- export type NewsletterMetadata = {
19
- /**jid of newsletter */
20
- id: string
21
- /**state of newsletter */
22
- state: NewsletterState
23
- /**creation timestamp of newsletter */
24
- creation_time: number
25
- /**name of newsletter */
26
- name: string
27
- /**timestamp of last name modification of newsletter */
28
- nameTime: number
29
- /**description of newsletter */
30
- description: string
31
- /**timestamp of last description modification of newsletter */
32
- descriptionTime: number
33
- /**invite code of newsletter */
34
- invite: string
35
- /**i dont know */
36
- handle: null
37
- /**direct path of picture */
38
- picture: string | null
39
- /**direct path of picture preview (lower quality) */
40
- preview: string | null
41
- /**reaction mode of newsletter */
42
- reaction_codes?: NewsletterReactionMode
43
- /**subscribers count of newsletter */
44
- subscribers: number
45
- /**verification state of newsletter */
46
- verification: NewsletterVerification
47
- /**viewer metadata */
48
- viewer_metadata: NewsletterViewerMetadata
49
- }
50
-
51
- export type SubscriberAction = 'promote' | 'demote'
52
-
53
- export type ReactionModeUpdate = {
54
- reaction_codes: {
55
- blocked_codes: null
56
- enabled_ts_sec: null
57
- value: NewsletterReactionMode
58
- }
59
- }
60
-
61
- /**only exists reaction mode update */
62
- export type NewsletterSettingsUpdate = ReactionModeUpdate
63
-
64
- export type NewsletterReaction = {
65
- count: number
66
- code: string
67
- }
68
-
69
- export type NewsletterFetchedUpdate = {
70
- /**id of message in newsletter, starts from 100 */
71
- server_id: string
72
- /**count of views in this message */
73
- views?: number
74
- /**reactions in this message */
75
- reactions: NewsletterReaction[]
76
- /**the message, if you requested only updates, you will not receive message */
77
- message?: proto.IWebMessageInfo
78
- }
79
-
80
- export declare const enum MexOperations {
81
- PROMOTE = "NotificationNewsletterAdminPromote",
82
- DEMOTE = "NotificationNewsletterAdminDemote",
83
- UPDATE = "NotificationNewsletterUpdate"
84
- }
85
-
86
- export declare const enum XWAPaths {
87
- PROMOTE = "xwa2_notify_newsletter_admin_promote",
88
- DEMOTE = "xwa2_notify_newsletter_admin_demote",
89
- ADMIN_COUNT = "xwa2_newsletter_admin",
90
- CREATE = "xwa2_newsletter_create",
91
- NEWSLETTER = "xwa2_newsletter",
92
- SUBSCRIBED = "xwa2_newsletter_subscribed",
93
- METADATA_UPDATE = "xwa2_notify_newsletter_on_metadata_update"
94
- }
95
-
96
- export declare const enum QueryIds {
97
- JOB_MUTATION = "7150902998257522",
98
- METADATA = "6620195908089573",
99
- UNFOLLOW = "7238632346214362",
100
- FOLLOW = "7871414976211147",
101
- UNMUTE = "7337137176362961",
102
- MUTE = "25151904754424642",
103
- CREATE = "6996806640408138",
104
- ADMIN_COUNT = "7130823597031706",
105
- CHANGE_OWNER = "7341777602580933",
106
- DELETE = "8316537688363079",
107
- DEMOTE = "6551828931592903",
108
- SUBSCRIBED = "6388546374527196"
109
- }
@@ -1,40 +0,0 @@
1
- "use strict"
2
-
3
- Object.defineProperty(exports, "__esModule", { value: true })
4
-
5
- const MexOperations = {
6
- PROMOTE: "NotificationNewsletterAdminPromote",
7
- DEMOTE: "NotificationNewsletterAdminDemote",
8
- UPDATE: "NotificationNewsletterUpdate"
9
- }
10
-
11
- const XWAPaths = {
12
- PROMOTE: "xwa2_notify_newsletter_admin_promote",
13
- DEMOTE: "xwa2_notify_newsletter_admin_demote",
14
- ADMIN_COUNT: "xwa2_newsletter_admin",
15
- CREATE: "xwa2_newsletter_create",
16
- NEWSLETTER: "xwa2_newsletter",
17
- SUBSCRIBED: "xwa2_newsletter_subscribed",
18
- METADATA_UPDATE: "xwa2_notify_newsletter_on_metadata_update"
19
- }
20
-
21
- const QueryIds = {
22
- JOB_MUTATION: "7150902998257522",
23
- METADATA: "6620195908089573",
24
- UNFOLLOW: "7238632346214362",
25
- FOLLOW: "7871414976211147",
26
- UNMUTE: "7337137176362961",
27
- MUTE: "25151904754424642",
28
- CREATE: "6996806640408138",
29
- ADMIN_COUNT: "7130823597031706",
30
- CHANGE_OWNER: "7341777602580933",
31
- DELETE: "8316537688363079",
32
- DEMOTE: "6551828931592903",
33
- SUBSCRIBED: "6388546374527196"
34
- }
35
-
36
- module.exports = {
37
- MexOperations,
38
- XWAPaths,
39
- QueryIds
40
- }