@pontalabs/baileys 1.0.6 → 1.0.8

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