@rizzxdc/baileys 8.0.10 → 8.1.0

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 (220) hide show
  1. package/LICENSE +4 -2
  2. package/README.md +107 -245
  3. package/WAProto/index.d.ts +15795 -0
  4. package/WAProto/index.js +25587 -4867
  5. package/lib/Defaults/index.d.ts +147 -0
  6. package/lib/Defaults/index.js +134 -104
  7. package/lib/Signal/Group/ciphertext-message.d.ts +10 -0
  8. package/lib/Signal/Group/ciphertext-message.js +9 -11
  9. package/lib/Signal/Group/group-session-builder.d.ts +8 -0
  10. package/lib/Signal/Group/group-session-builder.js +5 -8
  11. package/lib/Signal/Group/group_cipher.d.ts +11 -0
  12. package/lib/Signal/Group/group_cipher.js +72 -75
  13. package/lib/Signal/Group/index.d.ts +12 -0
  14. package/lib/Signal/Group/index.js +11 -13
  15. package/lib/Signal/Group/keyhelper.d.ts +7 -0
  16. package/lib/Signal/Group/keyhelper.js +11 -14
  17. package/lib/Signal/Group/sender-chain-key.d.ts +14 -0
  18. package/lib/Signal/Group/sender-chain-key.js +23 -26
  19. package/lib/Signal/Group/sender-key-distribution-message.d.ts +17 -0
  20. package/lib/Signal/Group/sender-key-distribution-message.js +58 -61
  21. package/lib/Signal/Group/sender-key-message.d.ts +19 -0
  22. package/lib/Signal/Group/sender-key-message.js +61 -64
  23. package/lib/Signal/Group/sender-key-name.d.ts +12 -0
  24. package/lib/Signal/Group/sender-key-name.js +39 -44
  25. package/lib/Signal/Group/sender-key-record.d.ts +13 -0
  26. package/lib/Signal/Group/sender-key-record.js +35 -38
  27. package/lib/Signal/Group/sender-key-state.d.ts +17 -0
  28. package/lib/Signal/Group/sender-key-state.js +76 -79
  29. package/lib/Signal/Group/sender-message-key.d.ts +12 -0
  30. package/lib/Signal/Group/sender-message-key.js +23 -26
  31. package/lib/Signal/libsignal.d.ts +55 -0
  32. package/lib/Signal/libsignal.js +414 -308
  33. package/lib/Signal/lid-mapping.d.ts +21 -0
  34. package/lib/Signal/lid-mapping.js +270 -149
  35. package/lib/Socket/Client/index.d.ts +3 -0
  36. package/lib/Socket/Client/index.js +2 -4
  37. package/lib/Socket/Client/types.d.ts +6 -0
  38. package/lib/Socket/Client/types.js +8 -11
  39. package/lib/Socket/Client/websocket.d.ts +13 -0
  40. package/lib/Socket/Client/websocket.js +51 -50
  41. package/lib/Socket/business.d.ts +395 -0
  42. package/lib/Socket/business.js +357 -355
  43. package/lib/Socket/chats.d.ts +137 -0
  44. package/lib/Socket/chats.js +1195 -867
  45. package/lib/Socket/communities.d.ts +562 -0
  46. package/lib/Socket/communities.js +416 -398
  47. package/lib/Socket/dugong.js +8 -1
  48. package/lib/Socket/groups.d.ts +286 -0
  49. package/lib/Socket/groups.js +336 -301
  50. package/lib/Socket/index.d.ts +530 -0
  51. package/lib/Socket/index.js +8 -13
  52. package/lib/Socket/messages-recv.d.ts +334 -0
  53. package/lib/Socket/messages-recv.js +1729 -1121
  54. package/lib/Socket/messages-send.d.ts +330 -0
  55. package/lib/Socket/messages-send.js +684 -462
  56. package/lib/Socket/mex.d.ts +2 -0
  57. package/lib/Socket/mex.js +36 -40
  58. package/lib/Socket/newsletter.d.ts +284 -0
  59. package/lib/Socket/newsletter.js +247 -237
  60. package/lib/Socket/socket.d.ts +61 -0
  61. package/lib/Socket/socket.js +968 -790
  62. package/lib/Store/index.d.ts +4 -0
  63. package/lib/Store/index.js +4 -6
  64. package/lib/Store/make-cache-manager-store.js +2 -2
  65. package/lib/Store/make-in-memory-store.d.ts +63 -0
  66. package/lib/Store/make-in-memory-store.js +414 -284
  67. package/lib/Store/make-ordered-dictionary.d.ts +13 -0
  68. package/lib/Store/make-ordered-dictionary.js +75 -76
  69. package/lib/Store/object-repository.d.ts +11 -0
  70. package/lib/Store/object-repository.js +21 -23
  71. package/lib/Types/Auth.d.ts +2 -0
  72. package/lib/Types/Auth.js +0 -2
  73. package/lib/Types/Bussines.d.ts +2 -0
  74. package/lib/Types/Bussines.js +0 -2
  75. package/lib/Types/Call.d.ts +2 -0
  76. package/lib/Types/Call.js +0 -2
  77. package/lib/Types/Chat.d.ts +2 -0
  78. package/lib/Types/Chat.js +5 -7
  79. package/lib/Types/Contact.d.ts +2 -0
  80. package/lib/Types/Contact.js +0 -2
  81. package/lib/Types/Events.d.ts +2 -0
  82. package/lib/Types/Events.js +1 -3
  83. package/lib/Types/GroupMetadata.d.ts +2 -0
  84. package/lib/Types/GroupMetadata.js +0 -2
  85. package/lib/Types/Label.d.ts +3 -0
  86. package/lib/Types/Label.js +21 -22
  87. package/lib/Types/LabelAssociation.d.ts +3 -0
  88. package/lib/Types/LabelAssociation.js +3 -4
  89. package/lib/Types/Message.d.ts +12 -0
  90. package/lib/Types/Message.js +11 -6
  91. package/lib/Types/Mex.d.ts +3 -0
  92. package/lib/Types/Mex.js +38 -0
  93. package/lib/Types/Product.d.ts +2 -0
  94. package/lib/Types/Product.js +0 -2
  95. package/lib/Types/RichType.d.ts +3 -0
  96. package/lib/Types/RichType.js +22 -0
  97. package/lib/Types/Signal.d.ts +2 -0
  98. package/lib/Types/Signal.js +1 -3
  99. package/lib/Types/Socket.d.ts +2 -0
  100. package/lib/Types/Socket.js +1 -4
  101. package/lib/Types/State.d.ts +6 -0
  102. package/lib/Types/State.js +52 -8
  103. package/lib/Types/USync.d.ts +2 -0
  104. package/lib/Types/USync.js +1 -3
  105. package/lib/Types/index.d.ts +14 -0
  106. package/lib/Types/index.js +22 -25
  107. package/lib/Utils/auth-utils.d.ts +58 -0
  108. package/lib/Utils/auth-utils.js +285 -203
  109. package/lib/Utils/browser-utils.d.ts +9 -0
  110. package/lib/Utils/browser-utils.js +21 -19
  111. package/lib/Utils/business.d.ts +50 -0
  112. package/lib/Utils/business.js +206 -209
  113. package/lib/Utils/chat-utils.d.ts +409 -0
  114. package/lib/Utils/chat-utils.js +825 -706
  115. package/lib/Utils/companion-reg-client-utils.d.ts +5 -0
  116. package/lib/Utils/companion-reg-client-utils.js +39 -0
  117. package/lib/Utils/crypto.d.ts +40 -0
  118. package/lib/Utils/crypto.js +88 -101
  119. package/lib/Utils/decode-wa-message.d.ts +84 -0
  120. package/lib/Utils/decode-wa-message.js +287 -238
  121. package/lib/Utils/event-buffer.d.ts +13 -0
  122. package/lib/Utils/event-buffer.js +602 -509
  123. package/lib/Utils/generics.d.ts +64 -0
  124. package/lib/Utils/generics.js +334 -295
  125. package/lib/Utils/history.d.ts +76 -0
  126. package/lib/Utils/history.js +125 -79
  127. package/lib/Utils/identity-change-handler.d.ts +14 -0
  128. package/lib/Utils/identity-change-handler.js +49 -0
  129. package/lib/Utils/index.d.ts +25 -0
  130. package/lib/Utils/index.js +25 -21
  131. package/lib/Utils/link-preview.d.ts +13 -0
  132. package/lib/Utils/link-preview.js +73 -70
  133. package/lib/Utils/logger.d.ts +3 -0
  134. package/lib/Utils/logger.js +1 -4
  135. package/lib/Utils/lt-hash.d.ts +7 -0
  136. package/lib/Utils/lt-hash.js +7 -45
  137. package/lib/Utils/make-mutex.d.ts +7 -0
  138. package/lib/Utils/make-mutex.js +27 -31
  139. package/lib/Utils/message-retry-manager.d.ts +80 -0
  140. package/lib/Utils/message-retry-manager.js +165 -14
  141. package/lib/Utils/messages-media.d.ts +137 -0
  142. package/lib/Utils/messages-media.js +768 -572
  143. package/lib/Utils/messages.d.ts +46 -0
  144. package/lib/Utils/messages.js +1082 -130
  145. package/lib/Utils/noise-handler.d.ts +21 -0
  146. package/lib/Utils/noise-handler.js +191 -135
  147. package/lib/Utils/offline-node-processor.d.ts +10 -0
  148. package/lib/Utils/offline-node-processor.js +39 -0
  149. package/lib/Utils/pre-key-manager.d.ts +26 -0
  150. package/lib/Utils/pre-key-manager.js +96 -76
  151. package/lib/Utils/process-message.d.ts +84 -0
  152. package/lib/Utils/process-message.js +718 -311
  153. package/lib/Utils/reporting-utils.d.ts +13 -0
  154. package/lib/Utils/reporting-utils.js +257 -0
  155. package/lib/Utils/rich-message-utils.d.ts +49 -0
  156. package/lib/Utils/rich-message-utils.js +257 -0
  157. package/lib/Utils/signal.d.ts +83 -0
  158. package/lib/Utils/signal.js +174 -135
  159. package/lib/Utils/stanza-ack.d.ts +17 -0
  160. package/lib/Utils/stanza-ack.js +37 -0
  161. package/lib/Utils/sync-action-utils.d.ts +3 -0
  162. package/lib/Utils/sync-action-utils.js +48 -0
  163. package/lib/Utils/tc-token-utils.d.ts +30 -0
  164. package/lib/Utils/tc-token-utils.js +162 -0
  165. package/lib/Utils/use-multi-file-auth-state.d.ts +11 -0
  166. package/lib/Utils/use-multi-file-auth-state.js +104 -95
  167. package/lib/Utils/use-single-file-auth-state.d.ts +11 -0
  168. package/lib/Utils/use-single-file-auth-state.js +108 -0
  169. package/lib/Utils/use-sqlite-auth-state.d.ts +11 -0
  170. package/lib/Utils/use-sqlite-auth-state.js +108 -0
  171. package/lib/Utils/validate-connection.d.ts +44 -0
  172. package/lib/Utils/validate-connection.js +182 -180
  173. package/lib/WABinary/constants.d.ts +62 -0
  174. package/lib/WABinary/constants.js +1455 -1292
  175. package/lib/WABinary/decode.d.ts +10 -0
  176. package/lib/WABinary/decode.js +249 -228
  177. package/lib/WABinary/encode.d.ts +3 -0
  178. package/lib/WABinary/encode.js +207 -206
  179. package/lib/WABinary/generic-utils.d.ts +77 -0
  180. package/lib/WABinary/generic-utils.js +135 -99
  181. package/lib/WABinary/index.d.ts +6 -0
  182. package/lib/WABinary/index.js +5 -7
  183. package/lib/WABinary/jid-utils.d.ts +29 -0
  184. package/lib/WABinary/jid-utils.js +80 -78
  185. package/lib/WABinary/types.d.ts +2 -0
  186. package/lib/WABinary/types.js +1 -3
  187. package/lib/WAM/BinaryInfo.d.ts +8 -0
  188. package/lib/WAM/BinaryInfo.js +7 -9
  189. package/lib/WAM/constants.d.ts +34927 -0
  190. package/lib/WAM/constants.js +22847 -22848
  191. package/lib/WAM/encode.d.ts +2 -0
  192. package/lib/WAM/encode.js +129 -134
  193. package/lib/WAM/index.d.ts +4 -0
  194. package/lib/WAM/index.js +3 -5
  195. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +37 -0
  196. package/lib/WAUSync/Protocols/USyncContactProtocol.js +48 -27
  197. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +23 -0
  198. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +48 -48
  199. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +13 -0
  200. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +23 -26
  201. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +13 -0
  202. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +33 -35
  203. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +10 -0
  204. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +24 -0
  205. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +39 -0
  206. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +46 -49
  207. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +15 -0
  208. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +23 -25
  209. package/lib/WAUSync/Protocols/index.d.ts +6 -0
  210. package/lib/WAUSync/Protocols/index.js +5 -6
  211. package/lib/WAUSync/USyncQuery.d.ts +21 -0
  212. package/lib/WAUSync/USyncQuery.js +92 -85
  213. package/lib/WAUSync/USyncUser.d.ts +17 -0
  214. package/lib/WAUSync/USyncUser.js +28 -22
  215. package/lib/WAUSync/index.d.ts +4 -0
  216. package/lib/WAUSync/index.js +3 -5
  217. package/lib/index.d.ts +12 -0
  218. package/lib/index.js +31 -19
  219. package/package.json +12 -6
  220. package/lib/Types/Newsletter.js +0 -33
@@ -0,0 +1,2 @@
1
+ export function executeWMexQuery(variables: any, queryId: any, dataPath: any, query: any, generateMessageTag: any): Promise<any>;
2
+ //# sourceMappingURL=mex.d.ts.map
package/lib/Socket/mex.js CHANGED
@@ -1,45 +1,41 @@
1
- //=======================================================//
2
- import { getBinaryNodeChild, S_WHATSAPP_NET } from "../WABinary/index.js";
3
- import { Boom } from "@hapi/boom";
4
- //=======================================================//
1
+ import { Boom } from '@hapi/boom';
2
+ import { getBinaryNodeChild, S_WHATSAPP_NET } from '../WABinary/index.js';
5
3
  const wMexQuery = (variables, queryId, query, generateMessageTag) => {
6
- return query({
7
- tag: "iq",
8
- attrs: {
9
- id: generateMessageTag(),
10
- type: "get",
11
- to: S_WHATSAPP_NET,
12
- xmlns: "w:mex"
13
- },
14
- content: [
15
- {
16
- tag: "query",
17
- attrs: { query_id: queryId },
18
- content: Buffer.from(JSON.stringify({ variables }), "utf-8")
19
- }
20
- ]
21
- });
4
+ return query({
5
+ tag: 'iq',
6
+ attrs: {
7
+ id: generateMessageTag(),
8
+ type: 'get',
9
+ to: S_WHATSAPP_NET,
10
+ xmlns: 'w:mex'
11
+ },
12
+ content: [
13
+ {
14
+ tag: 'query',
15
+ attrs: { query_id: queryId },
16
+ content: Buffer.from(JSON.stringify({ variables }), 'utf-8')
17
+ }
18
+ ]
19
+ });
22
20
  };
23
- //=======================================================//
24
21
  export const executeWMexQuery = async (variables, queryId, dataPath, query, generateMessageTag) => {
25
- const result = await wMexQuery(variables, queryId, query, generateMessageTag);
26
- const child = getBinaryNodeChild(result, "result");
27
- if (child?.content) {
28
- const data = JSON.parse(child.content.toString());
29
- if (data.errors && data.errors.length > 0) {
30
- const errorMessages = data.errors.map((err) => err.message || "Unknown error").join(", ");
31
- const firstError = data.errors[0];
32
- const errorCode = firstError.extensions?.error_code || 400;
33
- throw new Boom(`GraphQL server error: ${errorMessages}`, { statusCode: errorCode, data: firstError });
22
+ const result = await wMexQuery(variables, queryId, query, generateMessageTag);
23
+ const child = getBinaryNodeChild(result, 'result');
24
+ if (child?.content) {
25
+ const data = JSON.parse(child.content.toString());
26
+ if (data.errors && data.errors.length > 0) {
27
+ const errorMessages = data.errors.map((err) => err.message || 'Unknown error').join(', ');
28
+ const firstError = data.errors[0];
29
+ const errorCode = firstError.extensions?.error_code || 400;
30
+ throw new Boom(`GraphQL server error: ${errorMessages}`, { statusCode: errorCode, data: firstError });
31
+ }
32
+ const response = dataPath ? data?.data?.[dataPath] : data?.data;
33
+ if (typeof response !== 'undefined') {
34
+ return response;
35
+ }
34
36
  }
35
- const response = dataPath ? data?.data?.[dataPath] : data?.data;
36
- if (typeof response !== "undefined") {
37
- return response;
38
- }
39
- }
40
- const action = (dataPath || "").startsWith("xwa2_")
41
- ? dataPath.substring(5).replace(/_/g, " ")
42
- : dataPath?.replace(/_/g, " ");
43
- throw new Boom(`Failed to ${action}, unexpected response structure.`, { statusCode: 400, data: result });
37
+ const action = (dataPath || '').startsWith('xwa2_')
38
+ ? dataPath.substring(5).replace(/_/g, ' ')
39
+ : dataPath?.replace(/_/g, ' ');
40
+ throw new Boom(`Failed to ${action}, unexpected response structure.`, { statusCode: 400, data: result });
44
41
  };
45
- //=======================================================//
@@ -0,0 +1,284 @@
1
+ export function makeNewsletterSocket(config: any): {
2
+ executeWMexQuery: (variables: any, queryId: any, dataPath: any) => Promise<any>;
3
+ newsletterCreate: (name: any, description: any) => Promise<{
4
+ id: any;
5
+ owner: undefined;
6
+ name: any;
7
+ creation_time: number;
8
+ description: any;
9
+ invite: any;
10
+ subscribers: number;
11
+ verification: any;
12
+ picture: {
13
+ id: any;
14
+ directPath: any;
15
+ };
16
+ mute_state: any;
17
+ }>;
18
+ newsletterUpdate: (jid: any, updates: any) => Promise<any>;
19
+ newsletterSubscribers: (jid: any) => Promise<any>;
20
+ newsletterSubscribed: () => Promise<any>;
21
+ newsletterMetadata: (type: any, key: any) => Promise<any>;
22
+ newsletterFetchAllParticipating: () => Promise<{}>;
23
+ newsletterFollow: (jid: any) => Promise<any>;
24
+ newsletterUnfollow: (jid: any) => Promise<any>;
25
+ newsletterMute: (jid: any) => Promise<any>;
26
+ newsletterUnmute: (jid: any) => Promise<any>;
27
+ newsletterUpdateName: (jid: any, name: any) => Promise<any>;
28
+ newsletterUpdateDescription: (jid: any, description: any) => Promise<any>;
29
+ newsletterUpdatePicture: (jid: any, content: any) => Promise<any>;
30
+ newsletterRemovePicture: (jid: any) => Promise<any>;
31
+ newsletterReactMessage: (jid: any, serverId: any, reaction: any) => Promise<void>;
32
+ newsletterFetchMessages: (type: any, key: any, count: any, after: any, before: any) => Promise<{
33
+ [k: string]: any;
34
+ }[]>;
35
+ subscribeNewsletterUpdates: (jid: any) => Promise<{
36
+ duration: any;
37
+ } | null>;
38
+ newsletterAdminCount: (jid: any) => Promise<any>;
39
+ newsletterChangeOwner: (jid: any, newOwnerJid: any) => Promise<void>;
40
+ newsletterDemote: (jid: any, userJid: any) => Promise<void>;
41
+ newsletterDelete: (jid: any) => Promise<void>;
42
+ groupQuery: (jid: any, type: any, content: any) => Promise<any>;
43
+ groupMetadata: (jid: any) => Promise<{
44
+ id: any;
45
+ notify: any;
46
+ addressingMode: any;
47
+ subject: any;
48
+ subjectOwner: any;
49
+ subjectOwnerPn: any;
50
+ subjectOwnerUsername: any;
51
+ subjectTime: number;
52
+ size: any;
53
+ creation: number;
54
+ owner: string | undefined;
55
+ ownerPn: string | undefined;
56
+ ownerUsername: any;
57
+ owner_country_code: any;
58
+ desc: any;
59
+ descId: any;
60
+ descOwner: string | undefined;
61
+ descOwnerPn: string | undefined;
62
+ descOwnerUsername: any;
63
+ descTime: number | undefined;
64
+ linkedParent: any;
65
+ restrict: boolean;
66
+ announce: boolean;
67
+ isCommunity: boolean;
68
+ isCommunityAnnounce: boolean;
69
+ joinApprovalMode: boolean;
70
+ memberAddMode: boolean;
71
+ participants: any;
72
+ ephemeralDuration: number | undefined;
73
+ }>;
74
+ groupCreate: (subject: any, participants: any) => Promise<{
75
+ id: any;
76
+ notify: any;
77
+ addressingMode: any;
78
+ subject: any;
79
+ subjectOwner: any;
80
+ subjectOwnerPn: any;
81
+ subjectOwnerUsername: any;
82
+ subjectTime: number;
83
+ size: any;
84
+ creation: number;
85
+ owner: string | undefined;
86
+ ownerPn: string | undefined;
87
+ ownerUsername: any;
88
+ owner_country_code: any;
89
+ desc: any;
90
+ descId: any;
91
+ descOwner: string | undefined;
92
+ descOwnerPn: string | undefined;
93
+ descOwnerUsername: any;
94
+ descTime: number | undefined;
95
+ linkedParent: any;
96
+ restrict: boolean;
97
+ announce: boolean;
98
+ isCommunity: boolean;
99
+ isCommunityAnnounce: boolean;
100
+ joinApprovalMode: boolean;
101
+ memberAddMode: boolean;
102
+ participants: any;
103
+ ephemeralDuration: number | undefined;
104
+ }>;
105
+ groupLeave: (id: any) => Promise<void>;
106
+ groupUpdateSubject: (jid: any, subject: any) => Promise<void>;
107
+ groupRequestParticipantsList: (jid: any) => Promise<any>;
108
+ groupRequestParticipantsUpdate: (jid: any, participants: any, action: any) => Promise<any>;
109
+ groupParticipantsUpdate: (jid: any, participants: any, action: any) => Promise<any>;
110
+ groupUpdateDescription: (jid: any, description: any) => Promise<void>;
111
+ groupInviteCode: (jid: any) => Promise<any>;
112
+ groupRevokeInvite: (jid: any) => Promise<any>;
113
+ groupAcceptInvite: (code: any) => Promise<any>;
114
+ groupRevokeInviteV4: (groupJid: any, invitedJid: any) => Promise<boolean>;
115
+ groupAcceptInviteV4: (...args: any[]) => Promise<any>;
116
+ groupGetInviteInfo: (code: any) => Promise<{
117
+ id: any;
118
+ notify: any;
119
+ addressingMode: any;
120
+ subject: any;
121
+ subjectOwner: any;
122
+ subjectOwnerPn: any;
123
+ subjectOwnerUsername: any;
124
+ subjectTime: number;
125
+ size: any;
126
+ creation: number;
127
+ owner: string | undefined;
128
+ ownerPn: string | undefined;
129
+ ownerUsername: any;
130
+ owner_country_code: any;
131
+ desc: any;
132
+ descId: any;
133
+ descOwner: string | undefined;
134
+ descOwnerPn: string | undefined;
135
+ descOwnerUsername: any;
136
+ descTime: number | undefined;
137
+ linkedParent: any;
138
+ restrict: boolean;
139
+ announce: boolean;
140
+ isCommunity: boolean;
141
+ isCommunityAnnounce: boolean;
142
+ joinApprovalMode: boolean;
143
+ memberAddMode: boolean;
144
+ participants: any;
145
+ ephemeralDuration: number | undefined;
146
+ }>;
147
+ groupToggleEphemeral: (jid: any, ephemeralExpiration: any) => Promise<void>;
148
+ groupSettingUpdate: (jid: any, setting: any) => Promise<void>;
149
+ groupMemberAddMode: (jid: any, mode: any) => Promise<void>;
150
+ groupJoinApprovalMode: (jid: any, mode: any) => Promise<void>;
151
+ groupFetchAllParticipating: () => Promise<{}>;
152
+ findUserId: (pnLid: any) => Promise<{
153
+ lid: undefined;
154
+ phoneNumber: undefined;
155
+ }>;
156
+ serverProps: {
157
+ privacyTokenOn1to1: boolean;
158
+ profilePicPrivacyToken: boolean;
159
+ lidTrustedTokenIssueToLid: boolean;
160
+ };
161
+ createCallLink: (type: any, event: any, timeoutMs: any) => Promise<any>;
162
+ getBotListV2: () => Promise<{
163
+ jid: any;
164
+ personaId: any;
165
+ }[]>;
166
+ messageMutex: {
167
+ mutex(code: any): any;
168
+ };
169
+ receiptMutex: {
170
+ mutex(code: any): any;
171
+ };
172
+ appStatePatchMutex: {
173
+ mutex(code: any): any;
174
+ };
175
+ notificationMutex: {
176
+ mutex(code: any): any;
177
+ };
178
+ fetchPrivacySettings: (force?: boolean) => Promise<any>;
179
+ upsertMessage: (...args: any[]) => Promise<any>;
180
+ appPatch: (patchCreate: any) => Promise<void>;
181
+ sendPresenceUpdate: (type: any, toJid: any) => Promise<void>;
182
+ presenceSubscribe: (toJid: any) => Promise<void>;
183
+ profilePictureUrl: (jid: any, type: string | undefined, timeoutMs: any) => Promise<any>;
184
+ fetchBlocklist: () => Promise<any>;
185
+ fetchStatus: (...jids: any[]) => Promise<any>;
186
+ fetchDisappearingDuration: (...jids: any[]) => Promise<any>;
187
+ updateProfilePicture: (jid: any, content: any, dimensions: any) => Promise<void>;
188
+ removeProfilePicture: (jid: any) => Promise<void>;
189
+ updateProfileStatus: (status: any) => Promise<void>;
190
+ updateProfileName: (name: any) => Promise<void>;
191
+ updateBlockStatus: (jid: any, action: any) => Promise<void>;
192
+ updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: any) => Promise<void>;
193
+ updateCallPrivacy: (value: any) => Promise<void>;
194
+ updateMessagesPrivacy: (value: any) => Promise<void>;
195
+ updateLastSeenPrivacy: (value: any) => Promise<void>;
196
+ updateOnlinePrivacy: (value: any) => Promise<void>;
197
+ updateProfilePicturePrivacy: (value: any) => Promise<void>;
198
+ updateStatusPrivacy: (value: any) => Promise<void>;
199
+ updateReadReceiptsPrivacy: (value: any) => Promise<void>;
200
+ updateGroupsAddPrivacy: (value: any) => Promise<void>;
201
+ updateDefaultDisappearingMode: (duration: any) => Promise<void>;
202
+ getBusinessProfile: (jid: any) => Promise<{
203
+ wid: any;
204
+ address: any;
205
+ description: any;
206
+ website: any[];
207
+ email: any;
208
+ category: any;
209
+ business_hours: {
210
+ timezone: any;
211
+ business_config: any;
212
+ };
213
+ } | undefined>;
214
+ resyncAppState: (...args: any[]) => Promise<any>;
215
+ chatModify: (mod: any, jid: any) => Promise<void>;
216
+ cleanDirtyBits: (type: any, fromTimestamp: any) => Promise<void>;
217
+ addOrEditContact: (jid: any, contact: any) => Promise<void>;
218
+ removeContact: (jid: any) => Promise<void>;
219
+ placeholderResendCache: any;
220
+ addLabel: (jid: any, labels: any) => Promise<void>;
221
+ addChatLabel: (jid: any, labelId: any) => Promise<void>;
222
+ removeChatLabel: (jid: any, labelId: any) => Promise<void>;
223
+ addMessageLabel: (jid: any, messageId: any, labelId: any) => Promise<void>;
224
+ removeMessageLabel: (jid: any, messageId: any, labelId: any) => Promise<void>;
225
+ star: (jid: any, messages: any, star: any) => Promise<void>;
226
+ addOrEditQuickReply: (quickReply: any) => Promise<void>;
227
+ removeQuickReply: (timestamp: any) => Promise<void>;
228
+ type: string;
229
+ ws: import("./Client/websocket.js").WebSocketClient;
230
+ ev: {
231
+ process(handler: any): () => void;
232
+ emit(event: any, evData: any): any;
233
+ isBuffering(): boolean;
234
+ buffer: () => void;
235
+ flush: () => boolean;
236
+ createBufferedFunction(work: any): (...args: any[]) => Promise<any>;
237
+ on: (...args: any[]) => any;
238
+ off: (...args: any[]) => any;
239
+ removeAllListeners: (...args: any[]) => any;
240
+ destroy(): void;
241
+ };
242
+ authState: {
243
+ creds: any;
244
+ keys: {
245
+ get: (type: any, ids: any) => Promise<any>;
246
+ set: (data: any) => Promise<void>;
247
+ isInTransaction: () => boolean;
248
+ transaction: (work: any, key: any) => Promise<any>;
249
+ };
250
+ };
251
+ signalRepository: any;
252
+ user: any;
253
+ generateMessageTag: () => string;
254
+ query: (node: any, timeoutMs: any) => Promise<any>;
255
+ waitForMessage: (msgId: any, timeoutMs?: any) => Promise<any>;
256
+ waitForSocketOpen: () => Promise<void>;
257
+ sendRawMessage: (data: any) => Promise<void>;
258
+ sendNode: (frame: any) => Promise<void>;
259
+ logout: (msg: any) => Promise<void>;
260
+ end: (error: any) => Promise<void>;
261
+ registerSocketEndHandler: (handler: any) => void;
262
+ onUnexpectedError: (err: any, msg: any) => void;
263
+ uploadPreKeys: (count?: number) => Promise<void>;
264
+ uploadPreKeysToServerIfRequired: () => Promise<void>;
265
+ digestKeyBundle: () => Promise<void>;
266
+ rotateSignedPreKey: () => Promise<void>;
267
+ requestPairingCode: (phoneNumber: any, customPairingCode: any) => Promise<any>;
268
+ updateServerTimeOffset: ({ attrs }: {
269
+ attrs: any;
270
+ }) => void;
271
+ sendUnifiedSession: () => Promise<void>;
272
+ wamBuffer: import("../index.js").BinaryInfo;
273
+ waitForConnectionUpdate: (check: any, timeoutMs: any) => Promise<void>;
274
+ sendWAMBuffer: (wamBuffer: any) => Promise<any>;
275
+ executeUSyncQuery: (usyncQuery: any) => Promise<any>;
276
+ onWhatsApp: (...phoneNumber: any[]) => Promise<any>;
277
+ fetchAccountReachoutTimelock: () => Promise<{
278
+ isActive: boolean;
279
+ timeEnforcementEnds: Date | undefined;
280
+ enforcementType: any;
281
+ }>;
282
+ fetchNewChatMessageCap: () => Promise<any>;
283
+ };
284
+ //# sourceMappingURL=newsletter.d.ts.map