sanka-baileyss 2.3.2 → 2.3.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.
Files changed (159) hide show
  1. package/WAProto/BotMetadata/BotMetadata.d.ts +594 -1
  2. package/WAProto/BotMetadata/BotMetadata.js +1910 -148
  3. package/WAProto/BotMetadata/BotMetadata.proto +36 -0
  4. package/WAProto/E2E/E2E.d.ts +570 -6
  5. package/WAProto/E2E/E2E.js +1591 -26
  6. package/WAProto/E2E/E2E.proto +10 -1
  7. package/WAProto/HistorySync/HistorySync.d.ts +806 -6
  8. package/WAProto/HistorySync/HistorySync.js +2193 -29
  9. package/WAProto/HistorySync/HistorySync.proto +2 -1
  10. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.d.ts +570 -6
  11. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.js +1591 -26
  12. package/WAProto/StatusAttributions/StatusAttributions.d.ts +2 -1
  13. package/WAProto/StatusAttributions/StatusAttributions.js +7 -0
  14. package/WAProto/StatusAttributions/StatusAttributions.proto +1 -0
  15. package/WAProto/SyncAction/SyncAction.d.ts +230 -0
  16. package/WAProto/SyncAction/SyncAction.js +578 -2
  17. package/WAProto/SyncAction/SyncAction.proto +13 -1
  18. package/WAProto/Web/Web.d.ts +570 -6
  19. package/WAProto/Web/Web.js +1591 -26
  20. package/lib/Defaults/baileys-version.json +2 -2
  21. package/lib/Defaults/index.d.ts +42 -25
  22. package/lib/Defaults/index.js +6 -2
  23. package/lib/Signal/Group/sender-key-record.js +23 -28
  24. package/lib/Signal/libsignal.d.ts +1 -0
  25. package/lib/Socket/Client/index.js +13 -9
  26. package/lib/Socket/Client/types.d.ts +11 -10
  27. package/lib/Socket/Client/types.js +11 -7
  28. package/lib/Socket/Client/websocket.d.ts +9 -8
  29. package/lib/Socket/Client/websocket.js +52 -47
  30. package/lib/Socket/business.d.ts +185 -182
  31. package/lib/Socket/business.js +258 -249
  32. package/lib/Socket/chats.d.ts +90 -87
  33. package/lib/Socket/chats.js +1095 -888
  34. package/lib/Socket/community.d.ts +131 -0
  35. package/lib/Socket/community.js +369 -0
  36. package/lib/Socket/groups.d.ts +50 -41
  37. package/lib/Socket/groups.js +10 -3
  38. package/lib/Socket/index.d.ts +5 -1
  39. package/lib/Socket/index.js +19 -5
  40. package/lib/Socket/messages-recv.d.ts +6 -2
  41. package/lib/Socket/messages-recv.js +31 -8
  42. package/lib/Socket/messages-send.d.ts +5 -1
  43. package/lib/Socket/messages-send.js +1293 -1351
  44. package/lib/Socket/newsletter.d.ts +142 -135
  45. package/lib/Socket/newsletter.js +274 -230
  46. package/lib/Socket/socket.d.ts +37 -35
  47. package/lib/Socket/usync.d.ts +31 -30
  48. package/lib/Socket/usync.js +74 -62
  49. package/lib/Types/Auth.d.ts +89 -72
  50. package/lib/Types/Auth.js +1 -0
  51. package/lib/Types/Call.d.ts +11 -10
  52. package/lib/Types/Call.js +1 -0
  53. package/lib/Types/Chat.d.ts +85 -62
  54. package/lib/Types/Chat.js +4 -1
  55. package/lib/Types/Contact.js +1 -0
  56. package/lib/Types/Events.d.ts +209 -191
  57. package/lib/Types/Events.js +1 -0
  58. package/lib/Types/GroupMetadata.d.ts +12 -27
  59. package/lib/Types/GroupMetadata.js +1 -0
  60. package/lib/Types/Label.d.ts +41 -39
  61. package/lib/Types/Label.js +24 -21
  62. package/lib/Types/LabelAssociation.d.ts +18 -12
  63. package/lib/Types/LabelAssociation.js +6 -3
  64. package/lib/Types/Message.d.ts +3 -2
  65. package/lib/Types/Message.js +7 -3
  66. package/lib/Types/MexUpdates.d.ts +9 -0
  67. package/lib/Types/MexUpdates.js +18 -0
  68. package/lib/Types/Newsletter.d.ts +84 -67
  69. package/lib/Types/Newsletter.js +30 -23
  70. package/lib/Types/Product.d.ts +70 -56
  71. package/lib/Types/Product.js +1 -0
  72. package/lib/Types/Signal.d.ts +46 -35
  73. package/lib/Types/Signal.js +1 -0
  74. package/lib/Types/Socket.d.ts +105 -101
  75. package/lib/Types/Socket.js +1 -0
  76. package/lib/Types/State.d.ts +37 -23
  77. package/lib/Types/State.js +13 -1
  78. package/lib/Types/USync.d.ts +21 -20
  79. package/lib/Types/USync.js +1 -0
  80. package/lib/Types/index.d.ts +51 -42
  81. package/lib/Types/index.js +25 -19
  82. package/lib/Utils/auth-utils.d.ts +14 -11
  83. package/lib/Utils/auth-utils.js +189 -182
  84. package/lib/Utils/baileys-event-stream.d.ts +12 -10
  85. package/lib/Utils/baileys-event-stream.js +52 -46
  86. package/lib/Utils/business.d.ts +15 -8
  87. package/lib/Utils/business.js +229 -217
  88. package/lib/Utils/chat-utils.d.ts +22 -12
  89. package/lib/Utils/chat-utils.js +57 -27
  90. package/lib/Utils/crypto.d.ts +31 -15
  91. package/lib/Utils/crypto.js +136 -107
  92. package/lib/Utils/decode-wa-message.d.ts +34 -245
  93. package/lib/Utils/decode-wa-message.js +205 -217
  94. package/lib/Utils/event-buffer.d.ts +30 -26
  95. package/lib/Utils/event-buffer.js +519 -515
  96. package/lib/Utils/history.d.ts +2 -8
  97. package/lib/Utils/index.js +13 -9
  98. package/lib/Utils/link-preview.d.ts +16 -14
  99. package/lib/Utils/link-preview.js +100 -92
  100. package/lib/Utils/logger.d.ts +9 -7
  101. package/lib/Utils/logger.js +1 -1
  102. package/lib/Utils/lt-hash.d.ts +10 -8
  103. package/lib/Utils/lt-hash.js +49 -44
  104. package/lib/Utils/make-mutex.d.ts +4 -2
  105. package/lib/Utils/make-mutex.js +43 -39
  106. package/lib/Utils/messages-media.d.ts +75 -50
  107. package/lib/Utils/messages.d.ts +60 -35
  108. package/lib/Utils/messages.js +87 -8
  109. package/lib/Utils/noise-handler.d.ts +13 -12
  110. package/lib/Utils/noise-handler.js +143 -138
  111. package/lib/Utils/process-message.d.ts +32 -24
  112. package/lib/Utils/process-message.js +387 -367
  113. package/lib/Utils/signal.d.ts +24 -15
  114. package/lib/Utils/signal.js +143 -131
  115. package/lib/Utils/use-mongo-file-auth-state.d.ts +3 -2
  116. package/lib/Utils/use-mongo-file-auth-state.js +72 -63
  117. package/lib/Utils/use-multi-file-auth-state.d.ts +9 -8
  118. package/lib/Utils/use-multi-file-auth-state.js +110 -102
  119. package/lib/Utils/use-single-file-auth-state.d.ts +8 -7
  120. package/lib/Utils/use-single-file-auth-state.js +66 -61
  121. package/lib/Utils/validate-connection.d.ts +5 -2
  122. package/lib/Utils/validate-connection.js +7 -6
  123. package/lib/WABinary/constants.d.ts +24 -21
  124. package/lib/WABinary/constants.js +1302 -31
  125. package/lib/WABinary/decode.d.ts +4 -1
  126. package/lib/WABinary/decode.js +267 -234
  127. package/lib/WABinary/encode.d.ts +1 -0
  128. package/lib/WABinary/encode.js +248 -226
  129. package/lib/WABinary/generic-utils.d.ts +13 -1
  130. package/lib/WABinary/generic-utils.js +113 -96
  131. package/lib/WABinary/index.js +13 -9
  132. package/lib/WABinary/jid-utils.d.ts +23 -4
  133. package/lib/WABinary/jid-utils.js +58 -39
  134. package/lib/WABinary/types.d.ts +15 -11
  135. package/lib/WABinary/types.js +1 -0
  136. package/lib/WAM/BinaryInfo.d.ts +14 -14
  137. package/lib/WAM/BinaryInfo.js +11 -8
  138. package/lib/WAM/constants.d.ts +34 -26
  139. package/lib/WAM/constants.js +15358 -15349
  140. package/lib/WAM/encode.d.ts +1 -0
  141. package/lib/WAM/encode.js +153 -144
  142. package/lib/WAM/index.js +13 -9
  143. package/lib/index.js +11 -11
  144. package/package.json +1 -66
  145. package/WASignalGroup/GroupProtocol.js +0 -1771
  146. package/WASignalGroup/ciphertext_message.js +0 -10
  147. package/WASignalGroup/group_cipher.js +0 -103
  148. package/WASignalGroup/group_session_builder.js +0 -39
  149. package/WASignalGroup/index.js +0 -5
  150. package/WASignalGroup/keyhelper.js +0 -17
  151. package/WASignalGroup/protobufs.js +0 -2
  152. package/WASignalGroup/queue_job.js +0 -64
  153. package/WASignalGroup/sender_chain_key.js +0 -38
  154. package/WASignalGroup/sender_key_distribution_message.js +0 -68
  155. package/WASignalGroup/sender_key_message.js +0 -79
  156. package/WASignalGroup/sender_key_name.js +0 -59
  157. package/WASignalGroup/sender_key_record.js +0 -47
  158. package/WASignalGroup/sender_key_state.js +0 -110
  159. package/WASignalGroup/sender_message_key.js +0 -30
@@ -4,92 +4,95 @@ import { BotListInfo, ChatModification, ContactAction, MessageUpsertType, Socket
4
4
  import { LabelActionBody } from '../Types/Label'
5
5
  import { BinaryNode } from '../WABinary'
6
6
  import { USyncQuery } from '../WAUSync'
7
+
7
8
  export declare const makeChatsSocket: (config: SocketConfig) => {
8
- processingMutex: {
9
- mutex<T>(code: () => T | Promise<T>): Promise<T>
10
- }
11
- fetchPrivacySettings: (force?: boolean) => Promise<{
12
- [_: string]: string
13
- }>
14
- upsertMessage: (msg: proto.IWebMessageInfo, type: MessageUpsertType) => Promise<void>
15
- appPatch: (patchCreate: WAPatchCreate) => Promise<void>
16
- sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>
17
- presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>
18
- getBotListV2: () => Promise<BotListInfo[]>
19
- getLidUser: (jid: string) => Promise<{
20
- lid: string
21
- id: string
22
- }[] | undefined>
23
- onWhatsApp: (...jids: string[]) => Promise<{
24
- jid: string
25
- exists: unknown
26
- }[] | undefined>
27
- fetchBlocklist: () => Promise<string[]>
28
- fetchStatus: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>
29
- fetchDisappearingDuration: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>
30
- updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>
31
- removeProfilePicture: (jid: string) => Promise<void>
32
- updateProfileStatus: (status: string) => Promise<void>
33
- updateProfileName: (name: string) => Promise<void>
34
- updateBlockStatus: (jid: string, action: 'block' | 'unblock') => Promise<void>
35
- updateCallPrivacy: (value: WAPrivacyCallValue) => Promise<void>
36
- updateMessagesPrivacy: (value: WAPrivacyMessagesValue) => Promise<void>
37
- updateLastSeenPrivacy: (value: WAPrivacyValue) => Promise<void>
38
- updateOnlinePrivacy: (value: WAPrivacyOnlineValue) => Promise<void>
39
- updateProfilePicturePrivacy: (value: WAPrivacyValue) => Promise<void>
40
- updateStatusPrivacy: (value: WAPrivacyValue) => Promise<void>
41
- updateReadReceiptsPrivacy: (value: WAReadReceiptsValue) => Promise<void>
42
- updateGroupsAddPrivacy: (value: WAPrivacyGroupAddValue) => Promise<void>
43
- updateDefaultDisappearingMode: (duration: number) => Promise<void>
44
- getBusinessProfile: (jid: string) => Promise<WABusinessProfile | void>
45
- resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>
46
- chatModify: (mod: ChatModification, jid: string) => Promise<void>
47
- cleanDirtyBits: (type: 'account_sync' | 'groups', fromTimestamp?: number | string) => Promise<void>
48
- addLabel: (jid: string, labels: LabelActionBody) => Promise<void>
49
- addChatLabel: (jid: string, labelId: string) => Promise<void>
50
- removeChatLabel: (jid: string, labelId: string) => Promise<void>
51
- addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>
52
- removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>
53
- clearMessage: (jid: string, key: import("../Types").WAProto.IMessageKey, timeStamp: number | import("long").Long) => Promise<void>
54
- star: (jid: string, messages: {
55
- id: string
56
- fromMe?: boolean
57
- }[], star: boolean) => Promise<void>
58
- addOrEditContact: (jid: string, contact: ContactAction) => Promise<void>
59
- removeContact: (jid: string) => Promise<void>
60
- executeUSyncQuery: (usyncQuery: USyncQuery) => Promise<import("../WAUSync").USyncQueryResult | undefined>
61
- type: "md"
62
- ws: import("./Client").WebSocketClient
63
- ev: import("../Types").BaileysEventEmitter & {
64
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void
65
- buffer(): void
66
- createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>
67
- flush(force?: boolean | undefined): boolean
68
- isBuffering(): boolean
69
- }
70
- authState: {
71
- creds: import("../Types").AuthenticationCreds
72
- keys: import("../Types").SignalKeyStoreWithTransaction
73
- }
74
- signalRepository: import("../Types").SignalRepository
75
- user: import("../Types").Contact | undefined
76
- generateMessageTag: () => string
77
- query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>
78
- waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>
79
- waitForSocketOpen: () => Promise<void>
80
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>
81
- sendNode: (frame: BinaryNode) => Promise<void>
82
- logout: (msg?: string | undefined) => Promise<void>
83
- end: (error: Error | undefined) => void
84
- onUnexpectedError: (err: Error | Boom<any>, msg: string) => void
85
- uploadPreKeys: (count?: number) => Promise<void>
86
- uploadPreKeysToServerIfRequired: () => Promise<void>
87
- requestPairingCode: (phoneNumber: string, code?: string) => Promise<string>
88
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>
89
- /**
90
- * modify a chat -- mark unread, read etc.
91
- * lastMessages must be sorted in reverse chronologically
92
- * requires the last messages till the last message received required for archive & unread
93
- */
94
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>
9
+ processingMutex: {
10
+ mutex<T>(code: () => T | Promise<T>): Promise<T>
11
+ }
12
+ fetchPrivacySettings: (force?: boolean) => Promise<{
13
+ [_: string]: string
14
+ }>
15
+ upsertMessage: (msg: proto.IWebMessageInfo, type: MessageUpsertType) => Promise<void>
16
+ appPatch: (patchCreate: WAPatchCreate) => Promise<void>
17
+ createCallLink: (type: 'audio' | 'video', event?: number, timeoutMs?: number) => Promise<void>
18
+ sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>
19
+ presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>
20
+ getBotListV2: () => Promise<BotListInfo[]>
21
+ getLidUser: (jid: string) => Promise<{
22
+ lid: string
23
+ id: string
24
+ }[] | undefined>
25
+ onWhatsApp: (...jids: string[]) => Promise<{
26
+ jid: string
27
+ exists: unknown
28
+ }[] | undefined>
29
+ fetchBlocklist: () => Promise<string[]>
30
+ fetchStatus: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>
31
+ fetchDisappearingDuration: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>
32
+ updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>
33
+ removeProfilePicture: (jid: string) => Promise<void>
34
+ updateProfileStatus: (status: string) => Promise<void>
35
+ updateProfileName: (name: string) => Promise<void>
36
+ updateBlockStatus: (jid: string, action: 'block' | 'unblock') => Promise<void>
37
+ updateCallPrivacy: (value: WAPrivacyCallValue) => Promise<void>
38
+ updateMessagesPrivacy: (value: WAPrivacyMessagesValue) => Promise<void>
39
+ updateLastSeenPrivacy: (value: WAPrivacyValue) => Promise<void>
40
+ updateOnlinePrivacy: (value: WAPrivacyOnlineValue) => Promise<void>
41
+ updateProfilePicturePrivacy: (value: WAPrivacyValue) => Promise<void>
42
+ updateStatusPrivacy: (value: WAPrivacyValue) => Promise<void>
43
+ updateReadReceiptsPrivacy: (value: WAReadReceiptsValue) => Promise<void>
44
+ updateGroupsAddPrivacy: (value: WAPrivacyGroupAddValue) => Promise<void>
45
+ updateDefaultDisappearingMode: (duration: number) => Promise<void>
46
+ updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>
47
+ getBusinessProfile: (jid: string) => Promise<WABusinessProfile | void>
48
+ resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>
49
+ chatModify: (mod: ChatModification, jid: string) => Promise<void>
50
+ cleanDirtyBits: (type: 'account_sync' | 'groups', fromTimestamp?: number | string) => Promise<void>
51
+ addLabel: (jid: string, labels: LabelActionBody) => Promise<void>
52
+ addChatLabel: (jid: string, labelId: string) => Promise<void>
53
+ removeChatLabel: (jid: string, labelId: string) => Promise<void>
54
+ addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>
55
+ removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>
56
+ clearMessage: (jid: string, key: import("../Types").WAProto.IMessageKey, timeStamp: number | import("long").Long) => Promise<void>
57
+ star: (jid: string, messages: {
58
+ id: string
59
+ fromMe?: boolean
60
+ }[], star: boolean) => Promise<void>
61
+ addOrEditContact: (jid: string, contact: ContactAction) => Promise<void>
62
+ removeContact: (jid: string) => Promise<void>
63
+ executeUSyncQuery: (usyncQuery: USyncQuery) => Promise<import("../WAUSync").USyncQueryResult | undefined>
64
+ type: "md"
65
+ ws: import("./Client").WebSocketClient
66
+ ev: import("../Types").BaileysEventEmitter & {
67
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void
68
+ buffer(): void
69
+ createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>
70
+ flush(force?: boolean | undefined): boolean
71
+ isBuffering(): boolean
72
+ }
73
+ authState: {
74
+ creds: import("../Types").AuthenticationCreds
75
+ keys: import("../Types").SignalKeyStoreWithTransaction
76
+ }
77
+ signalRepository: import("../Types").SignalRepository
78
+ user: import("../Types").Contact | undefined
79
+ generateMessageTag: () => string
80
+ query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>
81
+ waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>
82
+ waitForSocketOpen: () => Promise<void>
83
+ sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>
84
+ sendNode: (frame: BinaryNode) => Promise<void>
85
+ logout: (msg?: string | undefined) => Promise<void>
86
+ end: (error: Error | undefined) => void
87
+ onUnexpectedError: (err: Error | Boom<any>, msg: string) => void
88
+ uploadPreKeys: (count?: number) => Promise<void>
89
+ uploadPreKeysToServerIfRequired: () => Promise<void>
90
+ requestPairingCode: (phoneNumber: string, code?: string) => Promise<string>
91
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>
92
+ /**
93
+ * modify a chat -- mark unread, read etc.
94
+ * lastMessages must be sorted in reverse chronologically
95
+ * requires the last messages till the last message received required for archive & unread
96
+ */
97
+ sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>
95
98
  }