sanka-baileyss 2.1.3 → 2.1.4

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.
@@ -7,474 +7,385 @@ import { MEDIA_HKDF_KEY_MAPPING } from '../Defaults'
7
7
  import { BinaryNode } from '../WABinary'
8
8
  import type { GroupMetadata } from './GroupMetadata'
9
9
  import { CacheStore } from './Socket'
10
-
11
10
  export { proto as WAProto }
12
-
13
11
  export type WAMessage = proto.IWebMessageInfo
14
12
  export type WAMessageContent = proto.IMessage
15
13
  export type WAContactMessage = proto.Message.IContactMessage
16
14
  export type WAContactsArrayMessage = proto.Message.IContactsArrayMessage
15
+ export type WAMessageKey = proto.IMessageKey & {
16
+ newsletter_server_id?: string
17
+ }
17
18
  export type WATextMessage = proto.Message.IExtendedTextMessage
18
19
  export type WAContextInfo = proto.IContextInfo
19
20
  export type WAEventMessage = proto.Message.IEventMessage
20
21
  export type WALocationMessage = proto.Message.ILocationMessage
21
22
  export type WAOrderMessage = proto.Message.IOrderMessage
22
- export type WAGenericMediaMessage =
23
- | proto.Message.IVideoMessage
24
- | proto.Message.IImageMessage
25
- | proto.Message.IAudioMessage
26
- | proto.Message.IDocumentMessage
27
- | proto.Message.IStickerMessage
28
-
29
- export const WAMessageStubType = proto.WebMessageInfo.StubType
30
- export const WAMessageStatus = proto.WebMessageInfo.Status
31
-
32
- // Actualización de WAMessageKey para incluir ambos conjuntos de propiedades
33
- export type WAMessageKey = proto.IMessageKey & {
34
- newsletter_server_id?: string
35
- senderLid?: string
36
- participantLid?: string
37
- senderPn?: string
38
- }
39
-
40
- export type WAMediaPayloadURL = { url: URL | string }
41
- export type WAMediaPayloadStream = { stream: Readable }
42
- export type WAMediaUpload = Buffer | WAMediaPayloadStream | WAMediaPayloadURL
43
-
23
+ export type WAGenericMediaMessage = proto.Message.IVideoMessage | proto.Message.IImageMessage | proto.Message.IAudioMessage | proto.Message.IDocumentMessage | proto.Message.IStickerMessage
24
+ export declare const WAMessageStubType = proto.WebMessageInfo.StubType
25
+ export declare const WAMessageStatus = proto.WebMessageInfo.Status
26
+ export type WAMediaUpload = Buffer | {
27
+ url: URL | string
28
+ } | {
29
+ stream: Readable
30
+ }
44
31
  /** Set of message types that are supported by the library */
45
32
  export type MessageType = keyof proto.Message
46
-
47
- export type DownloadableMessage = {
48
- mediaKey?: Uint8Array | null
49
- directPath?: string | null
50
- url?: string | null
51
- }
52
-
53
- export type MessageReceiptType =
54
- | 'read'
55
- | 'read-self'
56
- | 'hist_sync'
57
- | 'peer_msg'
58
- | 'sender'
59
- | 'inactive'
60
- | 'played'
61
- | undefined
62
-
33
+ export type DownloadableMessage = {
34
+ mediaKey?: Uint8Array | null
35
+ directPath?: string | null
36
+ url?: string | null
37
+ }
38
+ export type MessageReceiptType = 'read' | 'read-self' | 'hist_sync' | 'peer_msg' | 'sender' | 'inactive' | 'played' | undefined
63
39
  export type MediaConnInfo = {
64
- auth: string
65
- ttl: number
66
- hosts: { hostname: string; maxContentLengthBytes: number }[]
67
- fetchDate: Date
40
+ auth: string
41
+ ttl: number
42
+ hosts: {
43
+ hostname: string
44
+ maxContentLengthBytes: number
45
+ }[]
46
+ fetchDate: Date
68
47
  }
69
-
70
48
  export interface Carousel {
71
- image?: WAMediaUpload
72
- video?: WAMediaUpload
73
- product?: WASendableProduct
74
- title?: string
75
- body?: string
76
- footer?: string
77
- buttons?: proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton[]
78
- }
79
-
49
+ image?: WAMediaUpload
50
+ video?: WAMediaUpload
51
+ product?: WASendableProduct
52
+ title?: string
53
+ body?: string
54
+ footer?: string
55
+ buttons?: proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton[]
56
+ }
80
57
  export interface WAUrlInfo {
81
- 'canonical-url': string
82
- 'matched-text': string
83
- title: string
84
- description?: string
85
- jpegThumbnail?: Buffer
86
- highQualityThumbnail?: proto.Message.IImageMessage
87
- originalThumbnailUrl?: string
88
- }
89
-
90
- // Tipos combinados
58
+ 'canonical-url': string
59
+ 'matched-text': string
60
+ title: string
61
+ description?: string
62
+ jpegThumbnail?: Buffer
63
+ highQualityThumbnail?: proto.Message.IImageMessage
64
+ originalThumbnailUrl?: string
65
+ }
91
66
  type Mentionable = {
92
- /** list of jids that are mentioned in the accompanying text */
93
- mentions?: string[]
67
+ /** list of jids that are mentioned in the accompanying text */
68
+ mentions?: string[]
94
69
  }
95
-
96
70
  type Contextable = {
97
- /** add contextInfo to the message */
98
- contextInfo?: proto.IContextInfo
71
+ /** add contextInfo to the message */
72
+ contextInfo?: proto.IContextInfo
99
73
  }
100
-
101
74
  type Ephemeral = {
102
- ephemeral?: boolean
75
+ ephemeral?: boolean
103
76
  }
104
-
105
77
  type ViewOnce = {
106
- viewOnce?: boolean
78
+ viewOnce?: boolean
107
79
  }
108
-
109
80
  type ViewOnceV2 = {
110
- viewOnceV2?: boolean
81
+ viewOnceV2?: boolean
111
82
  }
112
-
113
83
  type ViewOnceV2Ext = {
114
- viewOnceV2Ext?: boolean
84
+ viewOnceV2Ext?: boolean
115
85
  }
116
-
117
86
  type Buttonable = {
118
- /** add buttons to the message */
119
- buttons?: proto.Message.ButtonsMessage.IButton[]
87
+ /** add buttons to the message */
88
+ buttons?: proto.Message.ButtonsMessage.IButton[]
120
89
  }
121
-
122
90
  type Templatable = {
123
- /** add buttons to the message (conflicts with normal buttons)*/
124
- templateButtons?: proto.IHydratedTemplateButton[]
125
- footer?: string
91
+ /** add buttons to the message (conflicts with normal buttons)*/
92
+ templateButtons?: proto.IHydratedTemplateButton[]
93
+ footer?: string
126
94
  }
127
-
128
95
  type Interactiveable = {
129
- /** add buttons to the message (conflicts with normal buttons)*/
130
- interactiveButtons?: proto.Message.InteractiveMessage.NativeFlowMessage.INativeFlowButton[]
131
- title?: string
132
- subtitle?: string
133
- footer?: string
134
- hasMediaAttachment?: boolean
135
- }
136
-
96
+ /** add buttons to the message (conflicts with normal buttons)*/
97
+ interactiveButtons?: proto.Message.InteractiveMessage.NativeFlowMessage.INativeFlowButton[]
98
+ title?: string
99
+ subtitle?: string
100
+ footer?: string
101
+ hasMediaAttachment?: boolean
102
+ }
137
103
  type Shopable = {
138
- shop?: proto.Message.InteractiveMessage.ShopMessage
139
- title?: string
140
- subtitle?: string
141
- footer?: string
142
- hasMediaAttachment?: boolean
104
+ shop?: proto.Message.InteractiveMessage.ShopMessage
105
+ title?: string
106
+ subtitle?: string
107
+ footer?: string
108
+ hasMediaAttachment?: boolean
143
109
  }
144
-
145
110
  type Collectionable = {
146
- collection?: proto.Message.InteractiveMessage.CollectionMessage
147
- title?: string
148
- subtitle?: string
149
- footer?: string
150
- hasMediaAttachment?: boolean
111
+ collection?: proto.Message.InteractiveMessage.CollectionMessage
112
+ title?: string
113
+ subtitle?: string
114
+ footer?: string
115
+ hasMediaAttachment?: boolean
151
116
  }
152
-
153
117
  type Listable = {
154
- /** Sections of the List */
155
- sections?: proto.Message.ListMessage.ISection[]
156
- /** Title of a List Message only */
157
- title?: string
158
- /** Text of the button on the list (required) */
159
- buttonText?: string
160
- /** ListType of a List Message only */
161
- listType?: proto.Message.ListMessage.ListType
162
- }
163
-
118
+ /** Sections of the List */
119
+ sections?: proto.Message.ListMessage.ISection[]
120
+ /** Title of a List Message only */
121
+ title?: string
122
+ /** Text of the button on the list (required) */
123
+ buttonText?: string
124
+ /** ListType of a List Message only */
125
+ listType?: proto.Message.ListMessage.ListType
126
+ }
164
127
  type Cardsable = {
165
- cards?: Carousel[]
166
- title?: string
167
- subtitle?: string
168
- footer?: string
128
+ cards?: Carousel[]
129
+ title?: string
130
+ subtitle?: string
131
+ footer?: string
169
132
  }
170
-
171
133
  type Editable = {
172
- edit?: WAMessageKey
134
+ edit?: WAMessageKey
173
135
  }
174
-
175
136
  type WithDimensions = {
176
- width?: number
177
- height?: number
137
+ width?: number
138
+ height?: number
178
139
  }
179
-
180
140
  export type PollMessageOptions = {
181
- name: string
182
- selectableCount?: number
183
- values: string[]
184
- /** 32 byte message secret to encrypt poll selections */
185
- messageSecret?: Uint8Array
186
- toAnnouncementGroup?: boolean
187
- }
188
-
141
+ name: string
142
+ selectableCount?: number
143
+ values: string[]
144
+ /** 32 byte message secret to encrypt poll selections */
145
+ messageSecret?: Uint8Array
146
+ toAnnouncementGroup?: boolean
147
+ }
189
148
  export type PollResultOptions = {
190
- name: string
191
- values: string[]
149
+ name: string
150
+ values: string[]
192
151
  }
193
-
194
152
  type SharePhoneNumber = {
195
- sharePhoneNumber: boolean
153
+ sharePhoneNumber: boolean
196
154
  }
197
-
198
155
  type RequestPhoneNumber = {
199
- requestPhoneNumber: boolean
156
+ requestPhoneNumber: boolean
200
157
  }
201
-
202
158
  export type MediaType = keyof typeof MEDIA_HKDF_KEY_MAPPING
203
-
204
159
  export type AnyMediaMessageContent = (({
205
- image: WAMediaUpload
206
- caption?: string
207
- jpegThumbnail?: string
208
- /** if set to true, will send as a `view once` image */
209
- ptv?: boolean
160
+ image: WAMediaUpload
161
+ caption?: string
162
+ jpegThumbnail?: string
210
163
  } & Mentionable & Contextable & Buttonable & Templatable & Interactiveable & WithDimensions) | ({
211
- video: WAMediaUpload
212
- caption?: string
213
- gifPlayback?: boolean
214
- jpegThumbnail?: string
215
- /** if set to true, will send as a `video note` */
216
- ptv?: boolean
164
+ video: WAMediaUpload
165
+ caption?: string
166
+ gifPlayback?: boolean
167
+ jpegThumbnail?: string
217
168
  } & Mentionable & Contextable & Buttonable & Templatable & Interactiveable & WithDimensions) | {
218
- audio: WAMediaUpload
219
- /** if set to true, will send as a `voice note` */
220
- ptt?: boolean
221
- /** optionally tell the duration of the audio */
222
- seconds?: number
169
+ audio: WAMediaUpload
170
+ /** if set to true, will send as a `voice note` */
171
+ ptt?: boolean
172
+ /** optionally tell the duration of the audio */
173
+ seconds?: number
223
174
  } | ({
224
- sticker: WAMediaUpload
225
- isAnimated?: boolean
175
+ sticker: WAMediaUpload
176
+ isAnimated?: boolean
226
177
  } & WithDimensions) | ({
227
- document: WAMediaUpload
228
- mimetype: string
229
- fileName?: string
230
- caption?: string
178
+ document: WAMediaUpload
179
+ mimetype: string
180
+ fileName?: string
181
+ caption?: string
231
182
  } & Contextable & Buttonable & Templatable & Interactiveable )) & {
232
- mimetype?: string
183
+ mimetype?: string
233
184
  } & Editable
234
-
235
185
  export type ButtonReplyInfo = {
236
- displayText: string
237
- id: string
238
- index: number
186
+ displayText: string
187
+ id: string
188
+ index: number
239
189
  }
240
-
241
190
  export type GroupInviteInfo = {
242
- code: string
243
- expiration: number
244
- caption: string
245
- jid: string
246
- name: string
247
- jpegThumbnail?: string
248
- } | {
249
- inviteCode: string
250
- inviteExpiration: number
251
- text: string
252
- jid: string
253
- subject: string
191
+ code: string
192
+ expiration: number
193
+ caption: string
194
+ jid: string
195
+ name: string
196
+ jpegThumbnail?: string
254
197
  }
255
-
256
198
  export type CallCreationInfo = {
257
- time?: number
258
- type?: number
259
- name: string
199
+ time?: number
200
+ type?: number
201
+ name: string
260
202
  }
261
-
262
203
  export type AdminInviteInfo = {
263
- jid: string
264
- name: string
265
- caption: string
266
- expiration: number
267
- jpegThumbnail: string
204
+ jid: string
205
+ name: string
206
+ caption: string
207
+ expiration: number
208
+ jpegThumbnail: string
268
209
  }
269
-
270
210
  export type PinInfo = {
271
- key: WAMessageKey
272
- type?: number
273
- time?: number
274
- } | {
275
- pin: WAMessageKey
276
- type: proto.PinInChat.Type
277
- /**
278
- * 24 hours, 7 days, 30 days
279
- */
280
- time?: 86400 | 604800 | 2592000
281
- }
282
-
211
+ key: WAMessageKey
212
+ type?: number
213
+ time?: number
214
+ }
283
215
  export type KeepInfo = {
284
- key: WAMessageKey
285
- type: number
216
+ key: WAMessageKey
217
+ type: number
286
218
  }
287
-
288
219
  export type PaymentInfo = {
289
- note: string
290
- currency?: string
291
- offset?: number
292
- amount?: number
293
- expiry?: number
294
- from?: string
295
- image?: {
296
- placeholderArgb: fixed32
297
- textArgb: fixed32
298
- subtextArgb: fixed32
299
- }
300
- }
301
-
220
+ note: string
221
+ currency?: string
222
+ offset?: number
223
+ amount?: number
224
+ expiry?: number
225
+ from?: string
226
+ image?: {
227
+ placeholderArgb: fixed32
228
+ textArgb: fixed32
229
+ subtextArgb: fixed32
230
+ }
231
+ }
302
232
  export type WASendableProduct = Omit<proto.Message.ProductMessage.IProductSnapshot, 'productImage'> & {
303
- productImage: WAMediaUpload
233
+ productImage: WAMediaUpload
304
234
  }
305
-
306
235
  export type AnyRegularMessageContent = (({
307
- text: string
308
- linkPreview?: WAUrlInfo | null
236
+ text: string
237
+ linkPreview?: WAUrlInfo | null
309
238
  } & Mentionable & Contextable & Buttonable & Templatable & Interactiveable & Shopable & Collectionable & Cardsable & Listable & Editable & WithDimensions) | AnyMediaMessageContent | ({
310
- poll: PollMessageOptions
239
+ poll: PollMessageOptions
311
240
  } & Mentionable & Contextable & Buttonable & Templatable & Interactiveable & Shopable & Collectionable & Cardsable & Listable & Editable & WithDimensions) | {
312
- contacts: {
313
- displayName?: string
314
- contacts: proto.Message.IContactMessage[]
315
- }
241
+ contacts: {
242
+ displayName?: string
243
+ contacts: proto.Message.IContactMessage[]
244
+ }
316
245
  } | {
317
- location: WALocationMessage
246
+ location: WALocationMessage
318
247
  } | {
319
- react: proto.Message.IReactionMessage
248
+ react: proto.Message.IReactionMessage
320
249
  } | {
321
- buttonReply: ButtonReplyInfo
322
- type: 'template' | 'plain' | 'list' | 'interactive'
250
+ buttonReply: ButtonReplyInfo
251
+ type: 'template' | 'plain' | 'list' | 'interactive'
323
252
  } | {
324
- groupInvite: GroupInviteInfo
253
+ groupInvite: GroupInviteInfo
325
254
  } | {
326
- pin: PinInfo
255
+ pin: PinInfo
327
256
  } | {
328
- keep: KeepInfo
257
+ keep: KeepInfo
329
258
  } | {
330
- call: CallCreationInfo
259
+ call: CallCreationInfo
331
260
  } | {
332
- event: WAEventMessage
261
+ event: WAEventMessage
333
262
  } | {
334
- adminInvite: AdminInviteInfo
263
+ adminInvite: AdminInviteInfo
335
264
  } | {
336
- payment: PaymentInfo
265
+ payment: PaymentInfo
337
266
  } | {
338
- paymentInvite: {
339
- type: number
340
- expiry: number
341
- }
267
+ paymentInvite: {
268
+ type: number
269
+ expiry: number
270
+ }
342
271
  } | {
343
- pollResult: PollResultOptions
272
+ pollResult: PollResultOptions
344
273
  } | {
345
- order: WAOrderMessage
274
+ order: WAOrderMessage
346
275
  } | {
347
- product: WASendableProduct
348
- businessOwnerJid?: string
349
- body?: string
350
- footer?: string
276
+ product: WASendableProduct
277
+ businessOwnerJid?: string
278
+ body?: string
279
+ footer?: string
351
280
  } | SharePhoneNumber | RequestPhoneNumber) & ViewOnce & ViewOnceV2 & ViewOnceV2Ext
352
-
353
281
  export type AnyMessageContent = AnyRegularMessageContent | {
354
- forward: WAMessage
355
- force?: boolean
282
+ forward: WAMessage
283
+ force?: boolean
356
284
  } | {
357
- /** Delete your message or anyone's message in a group (admin required) */
358
- delete: WAMessageKey
285
+ /** Delete your message or anyone's message in a group (admin required) */
286
+ delete: WAMessageKey
359
287
  } | {
360
- disappearingMessagesInChat: boolean | number
288
+ disappearingMessagesInChat: boolean | number
361
289
  }
362
-
363
290
  export type GroupMetadataParticipants = Pick<GroupMetadata, 'participants'>
364
-
365
291
  type MinimalRelayOptions = {
366
- /** override the message ID with a custom provided string */
367
- messageId?: string
368
- /** should we use group metadata cache, or fetch afresh from the server default assumed to be "true" */
369
- useCachedGroupMetadata?: boolean
292
+ /** override the message ID with a custom provided string */
293
+ messageId?: string
294
+ /** should we use group metadata cache, or fetch afresh from the server default assumed to be "true" */
295
+ useCachedGroupMetadata?: boolean
370
296
  }
371
-
372
297
  export type MessageRelayOptions = MinimalRelayOptions & {
373
- /** only send to a specific participant used when a message decryption fails for a single user */
374
- participant?: {
375
- jid: string
376
- count: number
377
- }
378
- /** additional attributes to add to the WA binary node */
379
- additionalAttributes?: {
380
- [_: string]: string
381
- }
382
- additionalNodes?: BinaryNode[]
383
- /** should we use the devices cache, or fetch afresh from the server default assumed to be "true" */
384
- useUserDevicesCache?: boolean
385
- /** jid list of participants for status@broadcast */
386
- statusJidList?: string[]
387
- newsletter?: boolean
388
- }
389
-
298
+ /** only send to a specific participant used when a message decryption fails for a single user */
299
+ participant?: {
300
+ jid: string
301
+ count: number
302
+ }
303
+ /** additional attributes to add to the WA binary node */
304
+ additionalAttributes?: {
305
+ [_: string]: string
306
+ }
307
+ additionalNodes?: BinaryNode[]
308
+ /** should we use the devices cache, or fetch afresh from the server default assumed to be "true" */
309
+ useUserDevicesCache?: boolean
310
+ /** jid list of participants for status@broadcast */
311
+ statusJidList?: string[]
312
+ newsletter?: boolean
313
+ }
390
314
  export type MiscMessageGenerationOptions = MinimalRelayOptions & {
391
- /** optional, if you want to manually set the timestamp of the message */
392
- timestamp?: Date
393
- /** the message you want to quote */
394
- quoted?: WAMessage
395
- /** disappearing messages settings */
396
- ephemeralExpiration?: number | string
397
- /** timeout for media upload to WA server */
398
- mediaUploadTimeoutMs?: number
399
- /** jid list of participants for status@broadcast */
400
- statusJidList?: string[]
401
- /** backgroundcolor for status */
402
- backgroundColor?: string
403
- /** font type for status */
404
- font?: number
405
- /** if it is broadcast */
406
- broadcast?: boolean
407
- newsletter?: boolean
408
- additionalNodes?: BinaryNode[]
409
- }
410
-
315
+ /** optional, if you want to manually set the timestamp of the message */
316
+ timestamp?: Date
317
+ /** the message you want to quote */
318
+ quoted?: WAMessage
319
+ /** disappearing messages settings */
320
+ ephemeralExpiration?: number | string
321
+ /** timeout for media upload to WA server */
322
+ mediaUploadTimeoutMs?: number
323
+ /** jid list of participants for status@broadcast */
324
+ statusJidList?: string[]
325
+ /** backgroundcolor for status */
326
+ backgroundColor?: string
327
+ /** font type for status */
328
+ font?: number
329
+ /** if it is broadcast */
330
+ broadcast?: boolean
331
+ newsletter?: boolean
332
+ additionalNodes?: BinaryNode[]
333
+ }
411
334
  export type MessageGenerationOptionsFromContent = MiscMessageGenerationOptions & {
412
- userJid: string
335
+ userJid: string
413
336
  }
414
-
415
337
  export type WAMediaUploadFunctionOpts = {
416
- fileEncSha256B64: string
417
- mediaType: MediaType
418
- newsletter?: boolean
419
- timeoutMs?: number
338
+ fileEncSha256B64: string
339
+ mediaType: MediaType
340
+ newsletter?: boolean
341
+ timeoutMs?: number
420
342
  }
421
-
422
343
  export type WAMediaUploadFunction = (encFilePath: string | Buffer, opts: WAMediaUploadFunctionOpts) => Promise<{
423
- mediaUrl: string
424
- directPath: string
425
- handle?: string
344
+ mediaUrl: string
345
+ directPath: string
346
+ handle?: string
426
347
  }>
427
-
428
348
  export type MediaGenerationOptions = {
429
- logger?: ILogger
430
- mediaTypeOverride?: MediaType
431
- upload: WAMediaUploadFunction
432
- /** cache media so it does not have to be uploaded again */
433
- mediaCache?: CacheStore
434
- mediaUploadTimeoutMs?: number
435
- options?: AxiosRequestConfig
436
- backgroundColor?: string
437
- font?: number
438
- /** The message is for newsletter? */
439
- newsletter?: boolean
440
- }
441
-
349
+ logger?: ILogger
350
+ mediaTypeOverride?: MediaType
351
+ upload: WAMediaUploadFunction
352
+ /** cache media so it does not have to be uploaded again */
353
+ mediaCache?: CacheStore
354
+ mediaUploadTimeoutMs?: number
355
+ options?: AxiosRequestConfig
356
+ backgroundColor?: string
357
+ font?: number
358
+ /** The message is for newsletter? */
359
+ newsletter?: boolean
360
+ }
442
361
  export type MessageContentGenerationOptions = MediaGenerationOptions & {
443
- getUrlInfo?: (text: string) => Promise<WAUrlInfo | undefined>
444
- getProfilePicUrl?: (jid: string, type?: 'image' | 'preview') => Promise<string | undefined>
362
+ getUrlInfo?: (text: string) => Promise<WAUrlInfo | undefined>
363
+ getProfilePicUrl?: (jid: string) => Promise<string | undefined>
445
364
  }
446
-
447
365
  export type MessageGenerationOptions = MessageContentGenerationOptions & MessageGenerationOptionsFromContent
448
-
449
366
  /**
450
- * Type of message upsert
451
- * 1. notify => notify the user, this message was just received
452
- * 2. append => append the message to the chat history, no notification required
453
- */
367
+ * Type of message upsert
368
+ * 1. notify => notify the user, this message was just received
369
+ * 2. append => append the message to the chat history, no notification required
370
+ */
454
371
  export type MessageUpsertType = 'append' | 'notify'
455
-
456
372
  export type MessageUserReceipt = proto.IUserReceipt
457
-
458
373
  export type WAMessageUpdate = {
459
- update: Partial<WAMessage>
460
- key: proto.IMessageKey
374
+ update: Partial<WAMessage>
375
+ key: proto.IMessageKey
461
376
  }
462
-
463
377
  export type WAMessageCursor = {
464
- before: WAMessageKey | undefined
378
+ before: WAMessageKey | undefined
465
379
  } | {
466
- after: WAMessageKey | undefined
380
+ after: WAMessageKey | undefined
467
381
  }
468
-
469
382
  export type MessageUserReceiptUpdate = {
470
- key: proto.IMessageKey
471
- receipt: MessageUserReceipt
383
+ key: proto.IMessageKey
384
+ receipt: MessageUserReceipt
472
385
  }
473
-
474
386
  export type MediaDecryptionKeyInfo = {
475
- iv: Buffer
476
- cipherKey: Buffer
477
- macKey?: Buffer
387
+ iv: Buffer
388
+ cipherKey: Buffer
389
+ macKey?: Buffer
478
390
  }
479
-
480
391
  export type MinimalMessage = Pick<proto.IWebMessageInfo, 'key' | 'messageTimestamp'>