lordceaser-baileys 2.0.12 → 2.0.13

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