@pontalabs/baileys 1.0.6 → 1.0.7

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 (185) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +839 -267
  3. package/WAProto/GenerateStatics.sh +4 -3
  4. package/WAProto/WAProto.proto +511 -1215
  5. package/WAProto/index.d.ts +55 -14017
  6. package/WAProto/index.js +29 -97689
  7. package/lib/Defaults/index.d.ts +74 -72
  8. package/lib/Defaults/index.js +108 -94
  9. package/lib/Signal/Group/ciphertext-message.d.ts +7 -8
  10. package/lib/Signal/Group/ciphertext-message.js +16 -9
  11. package/lib/Signal/Group/group-session-builder.d.ts +13 -11
  12. package/lib/Signal/Group/group-session-builder.js +61 -19
  13. package/lib/Signal/Group/group_cipher.d.ts +16 -14
  14. package/lib/Signal/Group/group_cipher.js +70 -41
  15. package/lib/Signal/Group/index.d.ts +11 -12
  16. package/lib/Signal/Group/index.js +61 -12
  17. package/lib/Signal/Group/keyhelper.d.ts +14 -9
  18. package/lib/Signal/Group/keyhelper.js +58 -10
  19. package/lib/Signal/Group/sender-chain-key.d.ts +13 -13
  20. package/lib/Signal/Group/sender-chain-key.js +34 -13
  21. package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -16
  22. package/lib/Signal/Group/sender-key-distribution-message.js +36 -28
  23. package/lib/Signal/Group/sender-key-message.d.ts +18 -18
  24. package/lib/Signal/Group/sender-key-message.js +45 -38
  25. package/lib/Signal/Group/sender-key-name.d.ts +15 -14
  26. package/lib/Signal/Group/sender-key-name.js +31 -20
  27. package/lib/Signal/Group/sender-key-record.d.ts +25 -24
  28. package/lib/Signal/Group/sender-key-record.js +35 -18
  29. package/lib/Signal/Group/sender-key-state.d.ts +34 -29
  30. package/lib/Signal/Group/sender-key-state.js +100 -37
  31. package/lib/Signal/Group/sender-message-key.d.ts +10 -11
  32. package/lib/Signal/Group/sender-message-key.js +22 -15
  33. package/lib/Signal/libsignal.d.ts +8 -5
  34. package/lib/Signal/libsignal.js +142 -288
  35. package/lib/Signal/lid-mapping.d.ts +28 -23
  36. package/lib/Signal/lid-mapping.js +184 -277
  37. package/lib/Socket/Client/index.d.ts +2 -3
  38. package/lib/Socket/Client/index.js +22 -3
  39. package/lib/Socket/Client/types.d.ts +15 -15
  40. package/lib/Socket/Client/types.js +15 -8
  41. package/lib/Socket/Client/websocket.d.ts +12 -12
  42. package/lib/Socket/Client/websocket.js +37 -29
  43. package/lib/Socket/business.d.ts +178 -208
  44. package/lib/Socket/business.js +127 -91
  45. package/lib/Socket/chats.d.ts +93 -120
  46. package/lib/Socket/chats.js +652 -727
  47. package/lib/Socket/community.js +10 -2
  48. package/lib/Socket/groups.d.ts +111 -143
  49. package/lib/Socket/groups.js +186 -165
  50. package/lib/Socket/index.d.ts +183 -252
  51. package/lib/Socket/index.js +18 -38
  52. package/lib/Socket/messages-recv.d.ts +167 -196
  53. package/lib/Socket/messages-recv.js +1567 -1443
  54. package/lib/Socket/messages-send.d.ts +158 -192
  55. package/lib/Socket/messages-send.js +1208 -1102
  56. package/lib/Socket/newsletter.d.ts +138 -163
  57. package/lib/Socket/newsletter.js +249 -153
  58. package/lib/Socket/socket.d.ts +36 -50
  59. package/lib/Socket/socket.js +820 -749
  60. package/lib/Store/index.d.ts +4 -4
  61. package/lib/Store/index.js +24 -4
  62. package/lib/Store/make-in-memory-store.d.ts +104 -44
  63. package/lib/Store/make-in-memory-store.js +213 -199
  64. package/lib/Store/make-ordered-dictionary.d.ts +12 -13
  65. package/lib/Store/make-ordered-dictionary.js +45 -38
  66. package/lib/Store/object-repository.d.ts +10 -11
  67. package/lib/Store/object-repository.js +16 -9
  68. package/lib/Types/Auth.d.ts +97 -93
  69. package/lib/Types/Auth.js +3 -2
  70. package/lib/Types/Bussines.js +3 -2
  71. package/lib/Types/Call.d.ts +13 -14
  72. package/lib/Types/Call.js +3 -2
  73. package/lib/Types/Chat.d.ts +97 -78
  74. package/lib/Types/Chat.js +9 -8
  75. package/lib/Types/Contact.d.ts +9 -12
  76. package/lib/Types/Contact.js +3 -2
  77. package/lib/Types/Events.d.ts +176 -206
  78. package/lib/Types/Events.js +3 -2
  79. package/lib/Types/GroupMetadata.d.ts +48 -53
  80. package/lib/Types/GroupMetadata.js +3 -2
  81. package/lib/Types/Label.d.ts +14 -13
  82. package/lib/Types/Label.js +30 -24
  83. package/lib/Types/LabelAssociation.d.ts +20 -15
  84. package/lib/Types/LabelAssociation.js +12 -6
  85. package/lib/Types/Message.d.ts +412 -248
  86. package/lib/Types/Message.js +19 -17
  87. package/lib/Types/Product.d.ts +71 -58
  88. package/lib/Types/Product.js +3 -2
  89. package/lib/Types/Signal.d.ts +82 -71
  90. package/lib/Types/Signal.js +3 -2
  91. package/lib/Types/Socket.d.ts +81 -76
  92. package/lib/Types/Socket.js +3 -3
  93. package/lib/Types/State.d.ts +19 -75
  94. package/lib/Types/State.js +14 -56
  95. package/lib/Types/USync.d.ts +8 -8
  96. package/lib/Types/USync.js +3 -2
  97. package/lib/Types/index.d.ts +62 -47
  98. package/lib/Types/index.js +50 -26
  99. package/lib/Utils/auth-utils.d.ts +10 -13
  100. package/lib/Utils/auth-utils.js +472 -213
  101. package/lib/Utils/business.d.ts +20 -14
  102. package/lib/Utils/business.js +134 -110
  103. package/lib/Utils/chat-utils.d.ts +70 -88
  104. package/lib/Utils/chat-utils.js +403 -466
  105. package/lib/Utils/crypto.d.ts +46 -27
  106. package/lib/Utils/crypto.js +188 -117
  107. package/lib/Utils/decode-wa-message.d.ts +45 -58
  108. package/lib/Utils/decode-wa-message.js +311 -212
  109. package/lib/Utils/event-buffer.d.ts +17 -14
  110. package/lib/Utils/event-buffer.js +296 -321
  111. package/lib/Utils/generics.d.ts +92 -66
  112. package/lib/Utils/generics.js +436 -270
  113. package/lib/Utils/history.d.ts +23 -24
  114. package/lib/Utils/history.js +76 -106
  115. package/lib/Utils/index.d.ts +21 -24
  116. package/lib/Utils/index.js +41 -24
  117. package/lib/Utils/link-preview.d.ts +14 -12
  118. package/lib/Utils/link-preview.js +75 -40
  119. package/lib/Utils/logger.d.ts +11 -10
  120. package/lib/Utils/logger.js +7 -3
  121. package/lib/Utils/lt-hash.d.ts +14 -8
  122. package/lib/Utils/lt-hash.js +53 -3
  123. package/lib/Utils/make-mutex.d.ts +7 -7
  124. package/lib/Utils/make-mutex.js +44 -28
  125. package/lib/Utils/message-retry-manager.d.ts +88 -115
  126. package/lib/Utils/message-retry-manager.js +160 -265
  127. package/lib/Utils/messages-media.d.ts +107 -105
  128. package/lib/Utils/messages-media.js +619 -548
  129. package/lib/Utils/messages.d.ts +66 -52
  130. package/lib/Utils/messages.js +1558 -1730
  131. package/lib/Utils/noise-handler.d.ts +18 -18
  132. package/lib/Utils/noise-handler.js +130 -176
  133. package/lib/Utils/process-message.d.ts +32 -43
  134. package/lib/Utils/process-message.js +282 -484
  135. package/lib/Utils/rich-message-utils.js +724 -1220
  136. package/lib/Utils/signal.d.ts +32 -37
  137. package/lib/Utils/signal.js +105 -140
  138. package/lib/Utils/use-multi-file-auth-state.d.ts +5 -5
  139. package/lib/Utils/use-multi-file-auth-state.js +120 -70
  140. package/lib/Utils/use-single-file-auth-state.d.ts +13 -11
  141. package/lib/Utils/use-single-file-auth-state.js +66 -92
  142. package/lib/Utils/validate-connection.d.ts +13 -11
  143. package/lib/Utils/validate-connection.js +113 -128
  144. package/lib/WABinary/constants.d.ts +27 -25
  145. package/lib/WABinary/constants.js +1292 -1451
  146. package/lib/WABinary/decode.d.ts +9 -7
  147. package/lib/WABinary/decode.js +189 -163
  148. package/lib/WABinary/encode.d.ts +3 -3
  149. package/lib/WABinary/encode.js +155 -110
  150. package/lib/WABinary/generic-utils.d.ts +27 -14
  151. package/lib/WABinary/generic-utils.js +105 -177
  152. package/lib/WABinary/index.d.ts +5 -6
  153. package/lib/WABinary/index.js +25 -6
  154. package/lib/WABinary/jid-utils.d.ts +54 -41
  155. package/lib/WABinary/jid-utils.js +152 -83
  156. package/lib/WABinary/types.d.ts +13 -10
  157. package/lib/WABinary/types.js +3 -2
  158. package/lib/WAM/BinaryInfo.d.ts +15 -8
  159. package/lib/WAM/BinaryInfo.js +14 -7
  160. package/lib/WAM/constants.d.ts +37 -30
  161. package/lib/WAM/constants.js +11983 -19465
  162. package/lib/WAM/encode.d.ts +3 -3
  163. package/lib/WAM/encode.js +109 -95
  164. package/lib/WAM/index.d.ts +3 -4
  165. package/lib/WAM/index.js +23 -4
  166. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -9
  167. package/lib/WAUSync/Protocols/USyncContactProtocol.js +21 -37
  168. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -19
  169. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +26 -18
  170. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -11
  171. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +20 -12
  172. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -11
  173. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +24 -16
  174. package/lib/WAUSync/Protocols/index.d.ts +6 -6
  175. package/lib/WAUSync/Protocols/index.js +26 -6
  176. package/lib/WAUSync/USyncQuery.d.ts +28 -27
  177. package/lib/WAUSync/USyncQuery.js +62 -68
  178. package/lib/WAUSync/USyncUser.d.ts +10 -15
  179. package/lib/WAUSync/USyncUser.js +19 -20
  180. package/lib/WAUSync/index.d.ts +3 -4
  181. package/lib/WAUSync/index.js +23 -4
  182. package/lib/index.d.ts +12 -11
  183. package/lib/index.js +39 -12
  184. package/package.json +42 -86
  185. package/engine-requirements.js +0 -10
@@ -1,203 +1,174 @@
1
- import NodeCache from '@cacheable/node-cache';
2
- import { Boom } from '@hapi/boom';
3
- import Long from 'long';
4
- import { proto } from '../../WAProto/index.js';
5
- import type { MessageReceiptType, MessageRelayOptions, NewChatMessageCapInfo, SocketConfig, WAMessage, WAMessageKey } from '../Types/index.js';
6
- import { type BinaryNode, type JidWithDevice } from '../WABinary/index.js';
1
+ import { Boom } from '@hapi/boom'
2
+ import { proto } from '../../WAProto'
3
+ import { MessageReceiptType, MessageRelayOptions, SocketConfig, WAMessageKey, ContactAction } from '../Types'
4
+ import { BinaryNode } from '../WABinary'
5
+
7
6
  export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
8
- sendMessageAck: (node: BinaryNode, errorCode?: number) => Promise<void>;
9
- sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
10
- rejectCall: (callId: string, callFrom: string) => Promise<void>;
11
- fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>;
12
- requestPlaceholderResend: (messageKey: WAMessageKey, msgData?: Partial<WAMessage>) => Promise<string | undefined>;
13
- messageRetryManager: import("../Utils/index.js").MessageRetryManager | null;
14
- userDevicesCache: import("../Types/index.js").PossiblyExtendedCacheStore | NodeCache<JidWithDevice[]>;
15
- devicesMutex: {
16
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
17
- };
18
- issuePrivacyTokens: (jids: string[], timestamp?: number) => Promise<any>;
19
- assertSessions: (jids: string[], force?: boolean) => Promise<boolean>;
20
- relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
21
- sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
22
- sendReceipts: (keys: WAMessageKey[], type: MessageReceiptType) => Promise<void>;
23
- readMessages: (keys: WAMessageKey[]) => Promise<void>;
24
- refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types/index.js").MediaConnInfo>;
25
- getMediaHost: () => string;
26
- waUploadToServer: import("../Types/index.js").WAMediaUploadFunction;
7
+ sendMessageAck: ({ tag, attrs, content }: BinaryNode, errorCode?: number) => Promise<void>
8
+ sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>
9
+ offerCall: (toJid: string, isVideo?: boolean) => Promise<{
10
+ id: any
11
+ to: string
12
+ }>
13
+ rejectCall: (callId: string, callFrom: string) => Promise<void>
14
+ fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>
15
+ requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<string | undefined>
16
+ getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>
17
+ assertSessions: (jids: string[], force: boolean) => Promise<boolean>
18
+ relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>
19
+ sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>
20
+ sendReceipts: (keys: proto.IMessageKey[], type: MessageReceiptType) => Promise<void>
21
+ readMessages: (keys: proto.IMessageKey[]) => Promise<void>
22
+ refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>
23
+ waUploadToServer: import("../Types").WAMediaUploadFunction
27
24
  fetchPrivacySettings: (force?: boolean) => Promise<{
28
- [_: string]: string;
29
- }>;
30
- sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
31
- createParticipantNodes: (recipientJids: string[], message: proto.IMessage, extraAttrs?: BinaryNode["attrs"], dsmMessage?: proto.IMessage) => Promise<{
32
- nodes: BinaryNode[];
33
- shouldIncludeDeviceIdentity: boolean;
34
- }>;
35
- getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<(JidWithDevice & {
36
- jid: string;
37
- })[]>;
38
- updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
39
- updateMediaMessage: (message: WAMessage) => Promise<WAMessage>;
40
- sendMessage: (jid: string, content: import("../Types/index.js").AnyMessageContent, options?: import("../Types/index.js").MiscMessageGenerationOptions) => Promise<WAMessage | undefined>;
41
- newsletterCreate: (name: string, description?: string) => Promise<import("../Types/index.js").NewsletterMetadata>;
42
- newsletterUpdate: (jid: string, updates: import("../Types/index.js").NewsletterUpdate) => Promise<unknown>;
43
- newsletterSubscribers: (jid: string) => Promise<{
44
- subscribers: number;
45
- }>;
46
- newsletterMetadata: (type: "invite" | "jid", key: string) => Promise<import("../Types/index.js").NewsletterMetadata | null>;
47
- newsletterFollow: (jid: string) => Promise<unknown>;
48
- newsletterUnfollow: (jid: string) => Promise<unknown>;
49
- newsletterMute: (jid: string) => Promise<unknown>;
50
- newsletterUnmute: (jid: string) => Promise<unknown>;
51
- newsletterUpdateName: (jid: string, name: string) => Promise<unknown>;
52
- newsletterUpdateDescription: (jid: string, description: string) => Promise<unknown>;
53
- newsletterUpdatePicture: (jid: string, content: import("../Types/index.js").WAMediaUpload) => Promise<unknown>;
54
- newsletterRemovePicture: (jid: string) => Promise<unknown>;
55
- newsletterReactMessage: (jid: string, serverId: string, reaction?: string) => Promise<void>;
56
- newsletterFetchMessages: (jid: string, count: number, since: number, after: number) => Promise<any>;
25
+ [_: string]: string
26
+ }>
27
+ sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>
28
+ createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: {
29
+ [key: string]: string
30
+ } | undefined) => Promise<{
31
+ nodes: BinaryNode[]
32
+ shouldIncludeDeviceIdentity: boolean
33
+ }>
34
+ profilePictureUrl: (jid: string) => Promise<string>
35
+ getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>
36
+ getEphemeralGroup: (jid: string) => Promise<number>
37
+ updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>
38
+ sendStatusMentions: (content: import("../Types").WAProto.IMessage, jid: string, Private?: boolean) => Promise<string>
39
+ sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>
57
40
  subscribeNewsletterUpdates: (jid: string) => Promise<{
58
- duration: string;
59
- } | null>;
60
- newsletterAdminCount: (jid: string) => Promise<number>;
61
- newsletterChangeOwner: (jid: string, newOwnerJid: string) => Promise<void>;
62
- newsletterDemote: (jid: string, userJid: string) => Promise<void>;
63
- newsletterDelete: (jid: string) => Promise<void>;
64
- groupMetadata: (jid: string) => Promise<import("../Types/index.js").GroupMetadata>;
65
- groupCreate: (subject: string, participants: string[]) => Promise<import("../Types/index.js").GroupMetadata>;
66
- groupLeave: (id: string) => Promise<void>;
67
- groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
41
+ duration: string
42
+ }>
43
+ newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>
44
+ newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>
45
+ newsletterUpdateName: (jid: string, name: string) => Promise<void>
46
+ newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>
47
+ newsletterRemovePicture: (jid: string) => Promise<void>
48
+ newsletterUnfollow: (jid: string) => Promise<void>
49
+ newsletterFollow: (jid: string) => Promise<void>
50
+ newsletterUnmute: (jid: string) => Promise<void>
51
+ newsletterMute: (jid: string) => Promise<void>
52
+ newsletterCreate: (name: string, description?: string, picture?: import("../Types").WAMediaUpload) => Promise<import("../Types").NewsletterMetadata>
53
+ newsletterQuery: (jid: string, type: string, content: BinaryNode) => Promise<BinaryNode>
54
+ newsletterWMexQuery: (jid?: string | undefined, query_id: number, content: BinaryNode) => Promise<BinaryNode>
55
+ newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>
56
+ newsletterFetchAllParticipating: () => Promise<{
57
+ [_: string]: import("../Types").NewsletterMetadata
58
+ }>
59
+ newsletterAdminCount: (jid: string) => Promise<number>
60
+ newsletterChangeOwner: (jid: string, userLid: string) => Promise<void>
61
+ newsletterDemote: (jid: string, userLid: string) => Promise<void>
62
+ newsletterDelete: (jid: string) => Promise<void>
63
+ newsletterReactMessage: (jid: string, server_id: string, code?: string | undefined) => Promise<void>
64
+ newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>
65
+ newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>
66
+ groupQuery: (jid: string, type: string, content: BinaryNode) => Promise<BinaryNode>
67
+ groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>
68
+ groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>
69
+ groupLeave: (id: string) => Promise<void>
70
+ groupUpdateSubject: (jid: string, subject: string) => Promise<void>
68
71
  groupRequestParticipantsList: (jid: string) => Promise<{
69
- [key: string]: string;
70
- }[]>;
71
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
72
- status: string;
73
- jid: string | undefined;
74
- }[]>;
75
- groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types/index.js").ParticipantAction) => Promise<{
76
- status: string;
77
- jid: string | undefined;
78
- content: BinaryNode;
79
- }[]>;
80
- groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
81
- groupInviteCode: (jid: string) => Promise<string | undefined>;
82
- groupRevokeInvite: (jid: string) => Promise<string | undefined>;
83
- groupAcceptInvite: (code: string) => Promise<string | undefined>;
84
- groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
85
- groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
86
- groupGetInviteInfo: (code: string) => Promise<import("../Types/index.js").GroupMetadata>;
87
- groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
88
- groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
89
- groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
90
- groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
72
+ [key: string]: string
73
+ }[]>
74
+ groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
75
+ status: string
76
+ jid: string
77
+ }[]>
78
+ groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
79
+ status: string
80
+ jid: string
81
+ content: BinaryNode
82
+ }[]>
83
+ groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>
84
+ groupInviteCode: (jid: string) => Promise<string | undefined>
85
+ groupRevokeInvite: (jid: string) => Promise<string | undefined>
86
+ groupAcceptInvite: (code: string) => Promise<string | undefined>
87
+ groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>
88
+ groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>
89
+ groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>
90
+ groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>
91
+ groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>
92
+ groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>
93
+ groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>
91
94
  groupFetchAllParticipating: () => Promise<{
92
- [_: string]: import("../Types/index.js").GroupMetadata;
93
- }>;
94
- serverProps: {
95
- privacyTokenOn1to1: boolean;
96
- profilePicPrivacyToken: boolean;
97
- lidTrustedTokenIssueToLid: boolean;
98
- };
99
- createCallLink: (type: "audio" | "video", event?: {
100
- startTime: number;
101
- }, timeoutMs?: number) => Promise<string | undefined>;
102
- getBotListV2: () => Promise<import("../Types/index.js").BotListInfo[]>;
103
- messageMutex: {
104
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
105
- };
106
- receiptMutex: {
107
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
108
- };
109
- appStatePatchMutex: {
110
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
111
- };
112
- notificationMutex: {
113
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
114
- };
115
- upsertMessage: (msg: WAMessage, type: import("../Types/index.js").MessageUpsertType) => Promise<void>;
116
- appPatch: (patchCreate: import("../Types/index.js").WAPatchCreate) => Promise<void>;
117
- sendPresenceUpdate: (type: import("../Types/index.js").WAPresence, toJid?: string) => Promise<void>;
118
- presenceSubscribe: (toJid: string) => Promise<void>;
119
- profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
120
- fetchBlocklist: () => Promise<(string | undefined)[]>;
121
- fetchStatus: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
122
- fetchDisappearingDuration: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
123
- updateProfilePicture: (jid: string, content: import("../Types/index.js").WAMediaUpload, dimensions?: {
124
- width: number;
125
- height: number;
126
- }) => Promise<void>;
127
- removeProfilePicture: (jid: string) => Promise<void>;
128
- updateProfileStatus: (status: string) => Promise<void>;
129
- updateProfileName: (name: string) => Promise<void>;
130
- updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
131
- updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>;
132
- updateCallPrivacy: (value: import("../Types/index.js").WAPrivacyCallValue) => Promise<void>;
133
- updateMessagesPrivacy: (value: import("../Types/index.js").WAPrivacyMessagesValue) => Promise<void>;
134
- updateLastSeenPrivacy: (value: import("../Types/index.js").WAPrivacyValue) => Promise<void>;
135
- updateOnlinePrivacy: (value: import("../Types/index.js").WAPrivacyOnlineValue) => Promise<void>;
136
- updateProfilePicturePrivacy: (value: import("../Types/index.js").WAPrivacyValue) => Promise<void>;
137
- updateStatusPrivacy: (value: import("../Types/index.js").WAPrivacyValue) => Promise<void>;
138
- updateReadReceiptsPrivacy: (value: import("../Types/index.js").WAReadReceiptsValue) => Promise<void>;
139
- updateGroupsAddPrivacy: (value: import("../Types/index.js").WAPrivacyGroupAddValue) => Promise<void>;
140
- updateDefaultDisappearingMode: (duration: number) => Promise<void>;
141
- getBusinessProfile: (jid: string) => Promise<import("../Types/index.js").WABusinessProfile | void>;
142
- resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
143
- chatModify: (mod: import("../Types/index.js").ChatModification, jid: string) => Promise<void>;
144
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
145
- addOrEditContact: (jid: string, contact: proto.SyncActionValue.IContactAction) => Promise<void>;
146
- removeContact: (jid: string) => Promise<void>;
147
- placeholderResendCache: import("../Types/index.js").CacheStore;
148
- addLabel: (jid: string, labels: import("../Types/Label.js").LabelActionBody) => Promise<void>;
149
- addChatLabel: (jid: string, labelId: string) => Promise<void>;
150
- removeChatLabel: (jid: string, labelId: string) => Promise<void>;
151
- addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
152
- removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
95
+ [_: string]: import("../Types").GroupMetadata
96
+ }>
97
+ processingMutex: {
98
+ mutex<T>(code: () => T | Promise<T>): Promise<T>
99
+ }
100
+ upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>
101
+ appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>
102
+ createCallLink: (type: 'audio' | 'video', event?: number, timeoutMs?: number) => Promise<void>
103
+ sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>
104
+ presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>
105
+ getLidUser: (jid: string) => Promise<{
106
+ lid: string
107
+ id: string
108
+ }[] | undefined>
109
+ fetchBlocklist: () => Promise<string[]>
110
+ fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>
111
+ fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>
112
+ updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>
113
+ removeProfilePicture: (jid: string) => Promise<void>
114
+ updateProfileStatus: (status: string) => Promise<void>
115
+ updateProfileName: (name: string) => Promise<void>
116
+ updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>
117
+ updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>
118
+ updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>
119
+ updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>
120
+ updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>
121
+ updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>
122
+ updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>
123
+ updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>
124
+ updateDefaultDisappearingMode: (duration: number) => Promise<void>
125
+ updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>
126
+ getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>
127
+ resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>
128
+ chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>
129
+ cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>
130
+ addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>
131
+ addChatLabel: (jid: string, labelId: string) => Promise<void>
132
+ removeChatLabel: (jid: string, labelId: string) => Promise<void>
133
+ addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>
134
+ removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>
135
+ clearMessage: (jid: string, key: import("../Types").WAProto.IMessageKey, timeStamp: number | import("long").Long) => Promise<void>
153
136
  star: (jid: string, messages: {
154
- id: string;
155
- fromMe?: boolean;
156
- }[], star: boolean) => Promise<void>;
157
- addOrEditQuickReply: (quickReply: import("../Types/Bussines.js").QuickReplyAction) => Promise<void>;
158
- removeQuickReply: (timestamp: string) => Promise<void>;
159
- type: "md";
160
- ws: import("./Client/websocket.js").WebSocketClient;
161
- ev: import("../Types/index.js").BaileysEventEmitter & {
162
- process(handler: (events: Partial<import("../Types/index.js").BaileysEventMap>) => void | Promise<void>): () => void;
163
- buffer(): void;
164
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): (...args: A) => Promise<T>;
165
- flush(): boolean;
166
- isBuffering(): boolean;
167
- destroy(): void;
168
- };
137
+ id: string
138
+ fromMe?: boolean | undefined
139
+ }[], star: boolean) => Promise<void>
140
+ addOrEditQuickReply: (quickReply: import("../Types/Bussines").QuickReplyAction) => Promise<void>
141
+ removeQuickReply: (timestamp: string) => Promise<void>
142
+ addOrEditContact: (jid: string, contact: ContactAction) => Promise<void>
143
+ removeContact: (jid: string) => Promise<void>
144
+ executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>
145
+ type: "md"
146
+ ws: import("./Client").WebSocketClient
147
+ ev: import("../Types").BaileysEventEmitter & {
148
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void
149
+ buffer(): void
150
+ createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>
151
+ flush(force?: boolean | undefined): boolean
152
+ isBuffering(): boolean
153
+ }
169
154
  authState: {
170
- creds: import("../Types/index.js").AuthenticationCreds;
171
- keys: import("../Types/index.js").SignalKeyStoreWithTransaction;
172
- };
173
- signalRepository: import("../Types/index.js").SignalRepositoryWithLIDStore;
174
- user: import("../Types/index.js").Contact | undefined;
175
- generateMessageTag: () => string;
176
- query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
177
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T | undefined>;
178
- waitForSocketOpen: () => Promise<void>;
179
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
180
- sendNode: (frame: BinaryNode) => Promise<void>;
181
- logout: (msg?: string) => Promise<void>;
182
- end: (error: Error | undefined) => Promise<void>;
183
- registerSocketEndHandler: (handler: (error: Error | undefined) => void | Promise<void>) => void;
184
- onUnexpectedError: (err: Error | Boom, msg: string) => void;
185
- uploadPreKeys: (count?: number) => Promise<void>;
186
- uploadPreKeysToServerIfRequired: () => Promise<void>;
187
- digestKeyBundle: () => Promise<void>;
188
- rotateSignedPreKey: () => Promise<void>;
189
- requestPairingCode: (phoneNumber: string, customPairingCode?: string) => Promise<string>;
190
- updateServerTimeOffset: ({ attrs }: BinaryNode) => void;
191
- sendUnifiedSession: () => Promise<void>;
192
- wamBuffer: import("../index.js").BinaryInfo;
193
- waitForConnectionUpdate: (check: (u: Partial<import("../Types/index.js").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
194
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
195
- executeUSyncQuery: (usyncQuery: import("../index.js").USyncQuery) => Promise<import("../index.js").USyncQueryResult | undefined>;
196
- onWhatsApp: (...phoneNumber: string[]) => Promise<{
197
- jid: string;
198
- exists: boolean;
199
- }[] | undefined>;
200
- fetchAccountReachoutTimelock: () => Promise<import("../Types/index.js").ReachoutTimelockState>;
201
- fetchNewChatMessageCap: () => Promise<NewChatMessageCapInfo>;
202
- };
203
- //# sourceMappingURL=messages-recv.d.ts.map
155
+ creds: import("../Types").AuthenticationCreds
156
+ keys: import("../Types").SignalKeyStoreWithTransaction
157
+ }
158
+ signalRepository: import("../Types").SignalRepository
159
+ user: import("../Types").Contact | undefined
160
+ generateMessageTag: () => string
161
+ query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>
162
+ waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>
163
+ waitForSocketOpen: () => Promise<void>
164
+ sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>
165
+ sendNode: (frame: BinaryNode) => Promise<void>
166
+ logout: (msg?: string | undefined) => Promise<void>
167
+ end: (error: Error | undefined) => void
168
+ onUnexpectedError: (err: Error | Boom<any>, msg: string) => void
169
+ uploadPreKeys: (count?: number) => Promise<void>
170
+ uploadPreKeysToServerIfRequired: () => Promise<void>
171
+ requestPairingCode: (phoneNumber: string, code?: string) => Promise<string>
172
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>
173
+ sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>
174
+ }