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