@zelynskybail/baileys 0.0.0-stage → 2.6.28

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 (226) hide show
  1. package/BUILD_STATUS.md +21 -0
  2. package/CHANGELOG.md +17 -0
  3. package/LICENSE +21 -0
  4. package/NOTICE.md +9 -0
  5. package/README.md +165 -2
  6. package/THANKS.md +7 -0
  7. package/THIRD_PARTY_NOTICES.md +8 -0
  8. package/WAProto/GenerateStatics.sh +3 -0
  9. package/WAProto/WAProto.proto +6035 -0
  10. package/WAProto/fix-imports.js +81 -0
  11. package/WAProto/index.d.ts +2 -0
  12. package/WAProto/index.js +132326 -0
  13. package/lib/Builders/advanced.d.ts +14 -0
  14. package/lib/Builders/advanced.js +142 -0
  15. package/lib/Builders/group-status.d.ts +9 -0
  16. package/lib/Builders/group-status.js +19 -0
  17. package/lib/Builders/index.d.ts +62 -0
  18. package/lib/Builders/index.js +242 -0
  19. package/lib/Defaults/index.d.ts +74 -0
  20. package/lib/Defaults/index.js +136 -0
  21. package/lib/Modded/MessageBuilder.js +3222 -0
  22. package/lib/Modded/message_builder.d.ts +43 -0
  23. package/lib/Modded/message_builder.js +2 -0
  24. package/lib/Signal/Group/ciphertext-message.d.ts +10 -0
  25. package/lib/Signal/Group/ciphertext-message.js +11 -0
  26. package/lib/Signal/Group/group-session-builder.d.ts +15 -0
  27. package/lib/Signal/Group/group-session-builder.js +29 -0
  28. package/lib/Signal/Group/group_cipher.d.ts +17 -0
  29. package/lib/Signal/Group/group_cipher.js +81 -0
  30. package/lib/Signal/Group/index.d.ts +12 -0
  31. package/lib/Signal/Group/index.js +11 -0
  32. package/lib/Signal/Group/keyhelper.d.ts +11 -0
  33. package/lib/Signal/Group/keyhelper.js +17 -0
  34. package/lib/Signal/Group/sender-chain-key.d.ts +14 -0
  35. package/lib/Signal/Group/sender-chain-key.js +25 -0
  36. package/lib/Signal/Group/sender-key-distribution-message.d.ts +17 -0
  37. package/lib/Signal/Group/sender-key-distribution-message.js +62 -0
  38. package/lib/Signal/Group/sender-key-message.d.ts +19 -0
  39. package/lib/Signal/Group/sender-key-message.js +65 -0
  40. package/lib/Signal/Group/sender-key-name.d.ts +18 -0
  41. package/lib/Signal/Group/sender-key-name.js +47 -0
  42. package/lib/Signal/Group/sender-key-record.d.ts +31 -0
  43. package/lib/Signal/Group/sender-key-record.js +40 -0
  44. package/lib/Signal/Group/sender-key-state.d.ts +39 -0
  45. package/lib/Signal/Group/sender-key-state.js +83 -0
  46. package/lib/Signal/Group/sender-message-key.d.ts +12 -0
  47. package/lib/Signal/Group/sender-message-key.js +25 -0
  48. package/lib/Signal/libsignal.d.ts +5 -0
  49. package/lib/Signal/libsignal.js +402 -0
  50. package/lib/Signal/lid-mapping.d.ts +19 -0
  51. package/lib/Signal/lid-mapping.js +270 -0
  52. package/lib/Socket/Client/index.d.ts +3 -0
  53. package/lib/Socket/Client/index.js +2 -0
  54. package/lib/Socket/Client/types.d.ts +16 -0
  55. package/lib/Socket/Client/types.js +10 -0
  56. package/lib/Socket/Client/websocket.d.ts +13 -0
  57. package/lib/Socket/Client/websocket.js +53 -0
  58. package/lib/Socket/business.d.ts +536 -0
  59. package/lib/Socket/business.js +421 -0
  60. package/lib/Socket/chats.d.ts +111 -0
  61. package/lib/Socket/chats.js +990 -0
  62. package/lib/Socket/communities.d.ts +645 -0
  63. package/lib/Socket/communities.js +430 -0
  64. package/lib/Socket/dugong.d.ts +130 -0
  65. package/lib/Socket/dugong.js +767 -0
  66. package/lib/Socket/groups.d.ts +150 -0
  67. package/lib/Socket/groups.js +326 -0
  68. package/lib/Socket/index.d.ts +657 -0
  69. package/lib/Socket/index.js +26 -0
  70. package/lib/Socket/messages-recv.d.ts +238 -0
  71. package/lib/Socket/messages-recv.js +1307 -0
  72. package/lib/Socket/messages-send.d.ts +579 -0
  73. package/lib/Socket/messages-send.js +1594 -0
  74. package/lib/Socket/mex.d.ts +3 -0
  75. package/lib/Socket/mex.js +47 -0
  76. package/lib/Socket/newsletter.d.ts +177 -0
  77. package/lib/Socket/newsletter.js +314 -0
  78. package/lib/Socket/socket.d.ts +55 -0
  79. package/lib/Socket/socket.js +935 -0
  80. package/lib/Types/Auth.d.ts +116 -0
  81. package/lib/Types/Auth.js +1 -0
  82. package/lib/Types/Bussines.d.ts +37 -0
  83. package/lib/Types/Bussines.js +1 -0
  84. package/lib/Types/Call.d.ts +15 -0
  85. package/lib/Types/Call.js +1 -0
  86. package/lib/Types/Chat.d.ts +123 -0
  87. package/lib/Types/Chat.js +7 -0
  88. package/lib/Types/Contact.d.ts +24 -0
  89. package/lib/Types/Contact.js +1 -0
  90. package/lib/Types/Events.d.ts +237 -0
  91. package/lib/Types/Events.js +1 -0
  92. package/lib/Types/GroupMetadata.d.ts +68 -0
  93. package/lib/Types/GroupMetadata.js +1 -0
  94. package/lib/Types/Label.d.ts +47 -0
  95. package/lib/Types/Label.js +24 -0
  96. package/lib/Types/LabelAssociation.d.ts +30 -0
  97. package/lib/Types/LabelAssociation.js +6 -0
  98. package/lib/Types/Message.d.ts +422 -0
  99. package/lib/Types/Message.js +10 -0
  100. package/lib/Types/Newsletter.d.ts +135 -0
  101. package/lib/Types/Newsletter.js +30 -0
  102. package/lib/Types/Product.d.ts +79 -0
  103. package/lib/Types/Product.js +1 -0
  104. package/lib/Types/Signal.d.ts +76 -0
  105. package/lib/Types/Signal.js +1 -0
  106. package/lib/Types/Socket.d.ts +154 -0
  107. package/lib/Types/Socket.js +2 -0
  108. package/lib/Types/State.d.ts +39 -0
  109. package/lib/Types/State.js +12 -0
  110. package/lib/Types/USync.d.ts +26 -0
  111. package/lib/Types/USync.js +1 -0
  112. package/lib/Types/index.d.ts +66 -0
  113. package/lib/Types/index.js +32 -0
  114. package/lib/Utils/auth-utils.d.ts +19 -0
  115. package/lib/Utils/auth-utils.js +289 -0
  116. package/lib/Utils/browser-utils.d.ts +4 -0
  117. package/lib/Utils/browser-utils.js +27 -0
  118. package/lib/Utils/business.d.ts +23 -0
  119. package/lib/Utils/business.js +230 -0
  120. package/lib/Utils/chat-utils.d.ts +70 -0
  121. package/lib/Utils/chat-utils.js +811 -0
  122. package/lib/Utils/crypto.d.ts +37 -0
  123. package/lib/Utils/crypto.js +117 -0
  124. package/lib/Utils/decode-wa-message.d.ts +48 -0
  125. package/lib/Utils/decode-wa-message.js +282 -0
  126. package/lib/Utils/event-buffer.d.ts +34 -0
  127. package/lib/Utils/event-buffer.js +573 -0
  128. package/lib/Utils/generics.d.ts +91 -0
  129. package/lib/Utils/generics.js +383 -0
  130. package/lib/Utils/history.d.ts +22 -0
  131. package/lib/Utils/history.js +130 -0
  132. package/lib/Utils/identity-change-handler.d.ts +37 -0
  133. package/lib/Utils/identity-change-handler.js +48 -0
  134. package/lib/Utils/index.d.ts +24 -0
  135. package/lib/Utils/index.js +24 -0
  136. package/lib/Utils/link-preview.d.ts +21 -0
  137. package/lib/Utils/link-preview.js +84 -0
  138. package/lib/Utils/logger.d.ts +13 -0
  139. package/lib/Utils/logger.js +2 -0
  140. package/lib/Utils/lt-hash.d.ts +8 -0
  141. package/lib/Utils/lt-hash.js +7 -0
  142. package/lib/Utils/make-mutex.d.ts +9 -0
  143. package/lib/Utils/make-mutex.js +32 -0
  144. package/lib/Utils/message-retry-manager.d.ts +110 -0
  145. package/lib/Utils/message-retry-manager.js +224 -0
  146. package/lib/Utils/message-tools.d.ts +31 -0
  147. package/lib/Utils/message-tools.js +182 -0
  148. package/lib/Utils/messages-media.d.ts +130 -0
  149. package/lib/Utils/messages-media.js +781 -0
  150. package/lib/Utils/messages.d.ts +91 -0
  151. package/lib/Utils/messages.js +1239 -0
  152. package/lib/Utils/noise-handler.d.ts +20 -0
  153. package/lib/Utils/noise-handler.js +200 -0
  154. package/lib/Utils/offline-node-processor.d.ts +17 -0
  155. package/lib/Utils/offline-node-processor.js +68 -0
  156. package/lib/Utils/performance.d.ts +3 -0
  157. package/lib/Utils/performance.js +35 -0
  158. package/lib/Utils/pre-key-manager.d.ts +28 -0
  159. package/lib/Utils/pre-key-manager.js +105 -0
  160. package/lib/Utils/process-message.d.ts +60 -0
  161. package/lib/Utils/process-message.js +527 -0
  162. package/lib/Utils/reporting-utils.d.ts +11 -0
  163. package/lib/Utils/reporting-utils.js +257 -0
  164. package/lib/Utils/rich-messages.d.ts +277 -0
  165. package/lib/Utils/rich-messages.js +1143 -0
  166. package/lib/Utils/signal.d.ts +34 -0
  167. package/lib/Utils/signal.js +158 -0
  168. package/lib/Utils/stanza-ack.d.ts +11 -0
  169. package/lib/Utils/stanza-ack.js +37 -0
  170. package/lib/Utils/sticker-pack.d.ts +10 -0
  171. package/lib/Utils/sticker-pack.js +111 -0
  172. package/lib/Utils/sync-action-utils.d.ts +19 -0
  173. package/lib/Utils/sync-action-utils.js +47 -0
  174. package/lib/Utils/tc-token-utils.d.ts +12 -0
  175. package/lib/Utils/tc-token-utils.js +17 -0
  176. package/lib/Utils/use-multi-file-auth-state.d.ts +13 -0
  177. package/lib/Utils/use-multi-file-auth-state.js +120 -0
  178. package/lib/Utils/validate-connection.d.ts +11 -0
  179. package/lib/Utils/validate-connection.js +199 -0
  180. package/lib/VoIP/index.d.ts +18 -0
  181. package/lib/VoIP/index.js +81 -0
  182. package/lib/WABinary/constants.d.ts +28 -0
  183. package/lib/WABinary/constants.js +1300 -0
  184. package/lib/WABinary/decode.d.ts +7 -0
  185. package/lib/WABinary/decode.js +261 -0
  186. package/lib/WABinary/encode.d.ts +3 -0
  187. package/lib/WABinary/encode.js +219 -0
  188. package/lib/WABinary/generic-utils.d.ts +17 -0
  189. package/lib/WABinary/generic-utils.js +190 -0
  190. package/lib/WABinary/index.d.ts +6 -0
  191. package/lib/WABinary/index.js +5 -0
  192. package/lib/WABinary/jid-utils.d.ts +48 -0
  193. package/lib/WABinary/jid-utils.js +95 -0
  194. package/lib/WABinary/types.d.ts +19 -0
  195. package/lib/WABinary/types.js +1 -0
  196. package/lib/WAM/BinaryInfo.d.ts +9 -0
  197. package/lib/WAM/BinaryInfo.js +9 -0
  198. package/lib/WAM/constants.d.ts +40 -0
  199. package/lib/WAM/constants.js +22852 -0
  200. package/lib/WAM/encode.d.ts +3 -0
  201. package/lib/WAM/encode.js +149 -0
  202. package/lib/WAM/index.d.ts +4 -0
  203. package/lib/WAM/index.js +3 -0
  204. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +10 -0
  205. package/lib/WAUSync/Protocols/USyncContactProtocol.js +28 -0
  206. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +23 -0
  207. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +53 -0
  208. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +13 -0
  209. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +26 -0
  210. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +13 -0
  211. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +37 -0
  212. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +26 -0
  213. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +50 -0
  214. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +10 -0
  215. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +28 -0
  216. package/lib/WAUSync/Protocols/index.d.ts +5 -0
  217. package/lib/WAUSync/Protocols/index.js +4 -0
  218. package/lib/WAUSync/USyncQuery.d.ts +29 -0
  219. package/lib/WAUSync/USyncQuery.js +93 -0
  220. package/lib/WAUSync/USyncUser.d.ts +13 -0
  221. package/lib/WAUSync/USyncUser.js +22 -0
  222. package/lib/WAUSync/index.d.ts +4 -0
  223. package/lib/WAUSync/index.js +3 -0
  224. package/lib/index.d.ts +14 -0
  225. package/lib/index.js +14 -0
  226. package/package.json +128 -4
@@ -0,0 +1,657 @@
1
+ import type { UserFacingSocketConfig } from "../Types/index.js";
2
+ export { Dugong } from "./dugong.js";
3
+ declare const makeWASocket: (config: UserFacingSocketConfig) => {
4
+ communityMetadata: (
5
+ jid: string,
6
+ ) => Promise<import("../index.js").GroupMetadata>;
7
+ communityCreate: (
8
+ subject: string,
9
+ body: string,
10
+ ) => Promise<import("../index.js").GroupMetadata | null>;
11
+ communityCreateGroup: (
12
+ subject: string,
13
+ participants: string[],
14
+ parentCommunityJid: string,
15
+ ) => Promise<import("../index.js").GroupMetadata | null>;
16
+ communityLeave: (id: string) => Promise<void>;
17
+ communityUpdateSubject: (jid: string, subject: string) => Promise<void>;
18
+ communityLinkGroup: (
19
+ groupJid: string,
20
+ parentCommunityJid: string,
21
+ ) => Promise<void>;
22
+ communityUnlinkGroup: (
23
+ groupJid: string,
24
+ parentCommunityJid: string,
25
+ ) => Promise<void>;
26
+ communityFetchLinkedGroups: (jid: string) => Promise<{
27
+ communityJid: string;
28
+ isCommunity: boolean;
29
+ linkedGroups: {
30
+ id: string | undefined;
31
+ subject: string;
32
+ creation: number | undefined;
33
+ owner: string | undefined;
34
+ size: number | undefined;
35
+ }[];
36
+ }>;
37
+ communityRequestParticipantsList: (jid: string) => Promise<
38
+ {
39
+ [key: string]: string;
40
+ }[]
41
+ >;
42
+ communityRequestParticipantsUpdate: (
43
+ jid: string,
44
+ participants: string[],
45
+ action: "approve" | "reject",
46
+ ) => Promise<
47
+ {
48
+ status: string;
49
+ jid: string | undefined;
50
+ }[]
51
+ >;
52
+ communityParticipantsUpdate: (
53
+ jid: string,
54
+ participants: string[],
55
+ action: import("../index.js").ParticipantAction,
56
+ ) => Promise<
57
+ {
58
+ status: string;
59
+ jid: string | undefined;
60
+ content: import("../index.js").BinaryNode;
61
+ }[]
62
+ >;
63
+ communityUpdateDescription: (
64
+ jid: string,
65
+ description?: string,
66
+ ) => Promise<void>;
67
+ communityInviteCode: (jid: string) => Promise<string | undefined>;
68
+ communityRevokeInvite: (jid: string) => Promise<string | undefined>;
69
+ communityAcceptInvite: (code: string) => Promise<string | undefined>;
70
+ communityRevokeInviteV4: (
71
+ communityJid: string,
72
+ invitedJid: string,
73
+ ) => Promise<boolean>;
74
+ communityAcceptInviteV4: (
75
+ key: string | import("../index.js").WAMessageKey,
76
+ inviteMessage: import("../index.js").proto.Message.IGroupInviteMessage,
77
+ ) => Promise<any>;
78
+ communityGetInviteInfo: (
79
+ code: string,
80
+ ) => Promise<import("../index.js").GroupMetadata>;
81
+ communityToggleEphemeral: (
82
+ jid: string,
83
+ ephemeralExpiration: number,
84
+ ) => Promise<void>;
85
+ communitySettingUpdate: (
86
+ jid: string,
87
+ setting: "announcement" | "not_announcement" | "locked" | "unlocked",
88
+ ) => Promise<void>;
89
+ communityMemberAddMode: (
90
+ jid: string,
91
+ mode: "admin_add" | "all_member_add",
92
+ ) => Promise<void>;
93
+ communityJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
94
+ communityFetchAllParticipating: () => Promise<{
95
+ [_: string]: import("../index.js").GroupMetadata;
96
+ }>;
97
+ logger: import("../Utils/logger.js").ILogger;
98
+ getOrderDetails: (
99
+ orderId: string,
100
+ tokenBase64: string,
101
+ ) => Promise<import("../index.js").OrderDetails>;
102
+ getCatalog: ({
103
+ jid,
104
+ limit,
105
+ cursor,
106
+ }: import("../index.js").GetCatalogOptions) => Promise<{
107
+ products: import("../index.js").Product[];
108
+ nextPageCursor: string | undefined;
109
+ }>;
110
+ getCollections: (
111
+ jid?: string,
112
+ limit?: number,
113
+ ) => Promise<{
114
+ collections: import("../index.js").CatalogCollection[];
115
+ }>;
116
+ productCreate: (
117
+ create: import("../index.js").ProductCreate,
118
+ ) => Promise<import("../index.js").Product>;
119
+ productDelete: (productIds: string[]) => Promise<{
120
+ deleted: number;
121
+ }>;
122
+ productUpdate: (
123
+ productId: string,
124
+ update: import("../index.js").ProductUpdate,
125
+ ) => Promise<import("../index.js").Product>;
126
+ updateBusinessProfile: (
127
+ args: import("../Types/Bussines.js").UpdateBusinessProfileProps,
128
+ ) => Promise<any>;
129
+ updateBussinesProfile: (
130
+ args: import("../Types/Bussines.js").UpdateBussinesProfileProps,
131
+ ) => Promise<any>;
132
+ updateCoverPhoto: (
133
+ photo: import("../index.js").WAMediaUpload,
134
+ ) => Promise<number>;
135
+ removeCoverPhoto: (id: string) => Promise<any>;
136
+ sendMessageAck: (
137
+ node: import("../index.js").BinaryNode,
138
+ errorCode?: number,
139
+ ) => Promise<void>;
140
+ sendRetryRequest: (
141
+ node: import("../index.js").BinaryNode,
142
+ forceIncludeKeys?: boolean,
143
+ ) => Promise<void>;
144
+ rejectCall: (callId: string, callFrom: string) => Promise<void>;
145
+ fetchMessageHistory: (
146
+ count: number,
147
+ oldestMsgKey: import("../index.js").WAMessageKey,
148
+ oldestMsgTimestamp: number | import("long").default,
149
+ ) => Promise<string>;
150
+ requestPlaceholderResend: (
151
+ messageKey: import("../index.js").WAMessageKey,
152
+ msgData?: Partial<import("../index.js").WAMessage>,
153
+ ) => Promise<string | undefined>;
154
+ messageRetryManager: import("../index.js").MessageRetryManager | null;
155
+ getPrivacyTokens: (jids: string[]) => Promise<any>;
156
+ assertSessions: (jids: string[], force?: boolean) => Promise<boolean>;
157
+ relayMessage: (
158
+ jid: string,
159
+ message: import("../index.js").proto.IMessage,
160
+ {
161
+ messageId: msgId,
162
+ participant,
163
+ additionalAttributes,
164
+ additionalNodes,
165
+ useUserDevicesCache,
166
+ useCachedGroupMetadata,
167
+ statusJidList,
168
+ }: import("../index.js").MessageRelayOptions,
169
+ ) => Promise<string>;
170
+ sendReceipt: (
171
+ jid: string,
172
+ participant: string | undefined,
173
+ messageIds: string[],
174
+ type: import("../index.js").MessageReceiptType,
175
+ ) => Promise<void>;
176
+ sendReceipts: (
177
+ keys: import("../index.js").WAMessageKey[],
178
+ type: import("../index.js").MessageReceiptType,
179
+ ) => Promise<void>;
180
+ delkira: import("./dugong.js").Dugong;
181
+ readMessages: (keys: import("../index.js").WAMessageKey[]) => Promise<void>;
182
+ refreshMediaConn: (
183
+ forceGet?: boolean,
184
+ ) => Promise<import("../index.js").MediaConnInfo>;
185
+ waUploadToServer: import("../index.js").WAMediaUploadFunction;
186
+ fetchPrivacySettings: (force?: boolean) => Promise<{
187
+ [_: string]: string;
188
+ }>;
189
+ sendPeerDataOperationMessage: (
190
+ pdoMessage: import("../index.js").proto.Message.IPeerDataOperationRequestMessage,
191
+ ) => Promise<string>;
192
+ createParticipantNodes: (
193
+ recipientJids: string[],
194
+ message: import("../index.js").proto.IMessage,
195
+ extraAttrs?: import("../index.js").BinaryNode["attrs"],
196
+ dsmMessage?: import("../index.js").proto.IMessage,
197
+ ) => Promise<{
198
+ nodes: import("../index.js").BinaryNode[];
199
+ shouldIncludeDeviceIdentity: boolean;
200
+ }>;
201
+ getUSyncDevices: (
202
+ jids: string[],
203
+ useCache: boolean,
204
+ ignoreZeroDevices: boolean,
205
+ ) => Promise<
206
+ (import("../index.js").JidWithDevice & {
207
+ jid: string;
208
+ })[]
209
+ >;
210
+ updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
211
+ updateMediaMessage: (
212
+ message: import("../index.js").WAMessage,
213
+ ) => Promise<import("../index.js").WAMessage>;
214
+ sendStatusMention: (
215
+ content: any,
216
+ jids?: string[],
217
+ ) => Promise<import("../index.js").WAMessage>;
218
+ sendTable: (
219
+ jid: string,
220
+ title: string,
221
+ headers: string[],
222
+ rows: string[][],
223
+ quoted?: any,
224
+ options?: import("../index.js").RichMessageOptions,
225
+ ) => Promise<{
226
+ message: any;
227
+ messageId: string;
228
+ }>;
229
+ sendList: (
230
+ jid: string,
231
+ title: string,
232
+ items: (string | string[])[],
233
+ quoted?: any,
234
+ options?: import("../index.js").RichMessageOptions,
235
+ ) => Promise<{
236
+ message: any;
237
+ messageId: string;
238
+ }>;
239
+ sendCodeBlock: (
240
+ jid: string,
241
+ code: string,
242
+ quoted?: any,
243
+ options?: import("../index.js").CodeBlockOptions,
244
+ ) => Promise<{
245
+ message: any;
246
+ messageId: string;
247
+ }>;
248
+ sendLatex: (
249
+ jid: string,
250
+ quoted: any,
251
+ options: import("../index.js").LatexOptions,
252
+ ) => Promise<{
253
+ message: any;
254
+ messageId: string;
255
+ }>;
256
+ sendLatexImage: (
257
+ jid: string,
258
+ quoted: any,
259
+ options: import("../index.js").LatexImageOptions,
260
+ renderLatexToPng: import("../index.js").LatexRenderFn,
261
+ uploadFn: import("../index.js").MediaUploadFn,
262
+ ) => Promise<{
263
+ message: any;
264
+ messageId: string;
265
+ }>;
266
+ sendLatexInlineImage: (
267
+ jid: string,
268
+ quoted: any,
269
+ options: import("../index.js").LatexImageOptions,
270
+ renderLatexToPng: import("../index.js").LatexRenderFn,
271
+ uploadFn: import("../index.js").MediaUploadFn,
272
+ ) => Promise<{
273
+ message: any;
274
+ messageId: string;
275
+ }>;
276
+ captureUnifiedResponse: (
277
+ msg: import("../index.js").proto.IMessage,
278
+ ) => import("../index.js").CapturedUnifiedResponse | null;
279
+ sendUnifiedResponse: (
280
+ jid: string,
281
+ quoted: any,
282
+ captured: import("../index.js").CapturedUnifiedResponse,
283
+ ) => Promise<{
284
+ message: any;
285
+ messageId: string;
286
+ }>;
287
+ sendRichMessage: (
288
+ jid: string,
289
+ submessages: import("../index.js").proto.IAIRichResponseSubMessage[],
290
+ quoted?: any,
291
+ options?: {},
292
+ ) => Promise<{
293
+ message: any;
294
+ messageId: string;
295
+ }>;
296
+ sendMessage: (
297
+ jid: string,
298
+ content: import("../index.js").AnyMessageContent,
299
+ options?: import("../index.js").MiscMessageGenerationOptions,
300
+ ) => Promise<any>;
301
+ newsletterFetchAllSubscribe: () => Promise<unknown>;
302
+ newsletterMultipleFollow: (jids: string) => Promise<void>;
303
+ newsletterAction: (jid: string, type: string) => Promise<void>;
304
+ cekIDSaluran: (url: string) => Promise<{
305
+ id: any;
306
+ state: any;
307
+ creation_time: number;
308
+ name: any;
309
+ description: any;
310
+ invite: any;
311
+ picture: string;
312
+ preview: string;
313
+ subscribers: number;
314
+ verification: any;
315
+ viewer_metadata: any;
316
+ }>;
317
+ newsletterCreate: (
318
+ name: string,
319
+ description?: string,
320
+ ) => Promise<import("../index.js").NewsletterMetadata>;
321
+ newsletterUpdate: (
322
+ jid: string,
323
+ updates: import("../index.js").NewsletterUpdate,
324
+ ) => Promise<unknown>;
325
+ newsletterSubscribers: (jid: string) => Promise<{
326
+ subscribers: number;
327
+ }>;
328
+ newsletterMetadata: (
329
+ type: "invite" | "jid",
330
+ key: string,
331
+ ) => Promise<import("../index.js").NewsletterMetadata | null>;
332
+ newsletterFollow: (jid: string) => Promise<unknown>;
333
+ newsletterUnfollow: (jid: string) => Promise<unknown>;
334
+ newsletterMute: (jid: string) => Promise<unknown>;
335
+ newsletterUnmute: (jid: string) => Promise<unknown>;
336
+ newsletterUpdateName: (jid: string, name: string) => Promise<unknown>;
337
+ newsletterUpdateDescription: (
338
+ jid: string,
339
+ description: string,
340
+ ) => Promise<unknown>;
341
+ newsletterUpdatePicture: (
342
+ jid: string,
343
+ content: import("../index.js").WAMediaUpload,
344
+ ) => Promise<unknown>;
345
+ newsletterRemovePicture: (jid: string) => Promise<unknown>;
346
+ newsletterReactMessage: (
347
+ jid: string,
348
+ serverId: string,
349
+ reaction?: string,
350
+ ) => Promise<void>;
351
+ newsletterFetchMessages: (
352
+ jid: string,
353
+ count: number,
354
+ since: number,
355
+ after: number,
356
+ ) => Promise<any>;
357
+ subscribeNewsletterUpdates: (jid: string) => Promise<{
358
+ duration: string;
359
+ } | null>;
360
+ newsletterAdminCount: (jid: string) => Promise<number>;
361
+ newsletterChangeOwner: (jid: string, newOwnerJid: string) => Promise<void>;
362
+ newsletterDemote: (jid: string, userJid: string) => Promise<void>;
363
+ newsletterDelete: (jid: string) => Promise<void>;
364
+ groupMetadata: (jid: string) => Promise<import("../index.js").GroupMetadata>;
365
+ groupCreate: (
366
+ subject: string,
367
+ participants: string[],
368
+ ) => Promise<import("../index.js").GroupMetadata>;
369
+ groupLeave: (id: string) => Promise<void>;
370
+ groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
371
+ groupRequestParticipantsList: (jid: string) => Promise<
372
+ {
373
+ [key: string]: string;
374
+ }[]
375
+ >;
376
+ groupRequestParticipantsUpdate: (
377
+ jid: string,
378
+ participants: string[],
379
+ action: "approve" | "reject",
380
+ ) => Promise<
381
+ {
382
+ status: string;
383
+ jid: string | undefined;
384
+ }[]
385
+ >;
386
+ groupParticipantsUpdate: (
387
+ jid: string,
388
+ participants: string[],
389
+ action: import("../index.js").ParticipantAction,
390
+ ) => Promise<
391
+ {
392
+ status: string;
393
+ jid: string | undefined;
394
+ content: import("../index.js").BinaryNode;
395
+ }[]
396
+ >;
397
+ groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
398
+ groupInviteCode: (jid: string) => Promise<string | undefined>;
399
+ groupRevokeInvite: (jid: string) => Promise<string | undefined>;
400
+ groupAcceptInvite: (code: string) => Promise<string | undefined>;
401
+ groupRevokeInviteV4: (
402
+ groupJid: string,
403
+ invitedJid: string,
404
+ ) => Promise<boolean>;
405
+ groupAcceptInviteV4: (
406
+ key: string | import("../index.js").WAMessageKey,
407
+ inviteMessage: import("../index.js").proto.Message.IGroupInviteMessage,
408
+ ) => Promise<any>;
409
+ groupGetInviteInfo: (
410
+ code: string,
411
+ ) => Promise<import("../index.js").GroupMetadata>;
412
+ groupToggleEphemeral: (
413
+ jid: string,
414
+ ephemeralExpiration: number,
415
+ ) => Promise<void>;
416
+ groupSettingUpdate: (
417
+ jid: string,
418
+ setting: "announcement" | "not_announcement" | "locked" | "unlocked",
419
+ ) => Promise<void>;
420
+ groupMemberAddMode: (
421
+ jid: string,
422
+ mode: "admin_add" | "all_member_add",
423
+ ) => Promise<void>;
424
+ groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
425
+ groupFetchAllParticipating: () => Promise<{
426
+ [_: string]: import("../index.js").GroupMetadata;
427
+ }>;
428
+ createCallLink: (
429
+ type: "audio" | "video",
430
+ event?: {
431
+ startTime: number;
432
+ },
433
+ timeoutMs?: number,
434
+ ) => Promise<string | undefined>;
435
+ getBotListV2: () => Promise<import("../index.js").BotListInfo[]>;
436
+ messageMutex: {
437
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
438
+ };
439
+ receiptMutex: {
440
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
441
+ };
442
+ appStatePatchMutex: {
443
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
444
+ };
445
+ notificationMutex: {
446
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
447
+ };
448
+ upsertMessage: (
449
+ msg: import("../index.js").WAMessage,
450
+ type: import("../index.js").MessageUpsertType,
451
+ ) => Promise<void>;
452
+ appPatch: (patchCreate: import("../index.js").WAPatchCreate) => Promise<void>;
453
+ sendPresenceUpdate: (
454
+ type: import("../index.js").WAPresence,
455
+ toJid?: string,
456
+ ) => Promise<void>;
457
+ presenceSubscribe: (toJid: string) => Promise<void>;
458
+ profilePictureUrl: (
459
+ jid: string,
460
+ type?: "preview" | "image",
461
+ timeoutMs?: number,
462
+ ) => Promise<string | undefined>;
463
+ fetchBlocklist: () => Promise<(string | undefined)[]>;
464
+ fetchStatus: (
465
+ ...jids: string[]
466
+ ) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
467
+ fetchDisappearingDuration: (
468
+ ...jids: string[]
469
+ ) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
470
+ updateProfilePicture: (
471
+ jid: string,
472
+ content: import("../index.js").WAMediaUpload,
473
+ dimensions?: {
474
+ width: number;
475
+ height: number;
476
+ },
477
+ ) => Promise<void>;
478
+ removeProfilePicture: (jid: string) => Promise<void>;
479
+ updateProfileStatus: (status: string) => Promise<void>;
480
+ updateProfileName: (name: string) => Promise<void>;
481
+ updateBlockStatus: (
482
+ jid: string,
483
+ action: "block" | "unblock",
484
+ ) => Promise<void>;
485
+ updateDisableLinkPreviewsPrivacy: (
486
+ isPreviewsDisabled: boolean,
487
+ ) => Promise<void>;
488
+ updateCallPrivacy: (
489
+ value: import("../index.js").WAPrivacyCallValue,
490
+ ) => Promise<void>;
491
+ updateMessagesPrivacy: (
492
+ value: import("../index.js").WAPrivacyMessagesValue,
493
+ ) => Promise<void>;
494
+ updateLastSeenPrivacy: (
495
+ value: import("../index.js").WAPrivacyValue,
496
+ ) => Promise<void>;
497
+ updateOnlinePrivacy: (
498
+ value: import("../index.js").WAPrivacyOnlineValue,
499
+ ) => Promise<void>;
500
+ updateProfilePicturePrivacy: (
501
+ value: import("../index.js").WAPrivacyValue,
502
+ ) => Promise<void>;
503
+ updateStatusPrivacy: (
504
+ value: import("../index.js").WAPrivacyValue,
505
+ ) => Promise<void>;
506
+ updateReadReceiptsPrivacy: (
507
+ value: import("../index.js").WAReadReceiptsValue,
508
+ ) => Promise<void>;
509
+ updateGroupsAddPrivacy: (
510
+ value: import("../index.js").WAPrivacyGroupAddValue,
511
+ ) => Promise<void>;
512
+ updateDefaultDisappearingMode: (duration: number) => Promise<void>;
513
+ getBusinessProfile: (
514
+ jid: string,
515
+ ) => Promise<import("../index.js").WABusinessProfile | void>;
516
+ resyncAppState: (
517
+ collections: readonly (
518
+ | "critical_unblock_low"
519
+ | "regular_high"
520
+ | "regular_low"
521
+ | "critical_block"
522
+ | "regular"
523
+ )[],
524
+ isInitialSync: boolean,
525
+ ) => Promise<void>;
526
+ chatModify: (
527
+ mod: import("../index.js").ChatModification,
528
+ jid: string,
529
+ ) => Promise<void>;
530
+ cleanDirtyBits: (
531
+ type: "account_sync" | "groups",
532
+ fromTimestamp?: number | string,
533
+ ) => Promise<void>;
534
+ addOrEditContact: (
535
+ jid: string,
536
+ contact: import("../index.js").proto.SyncActionValue.IContactAction,
537
+ ) => Promise<void>;
538
+ removeContact: (jid: string) => Promise<void>;
539
+ addLabel: (
540
+ jid: string,
541
+ labels: import("../Types/Label.js").LabelActionBody,
542
+ ) => Promise<void>;
543
+ addChatLabel: (jid: string, labelId: string) => Promise<void>;
544
+ removeChatLabel: (jid: string, labelId: string) => Promise<void>;
545
+ addMessageLabel: (
546
+ jid: string,
547
+ messageId: string,
548
+ labelId: string,
549
+ ) => Promise<void>;
550
+ removeMessageLabel: (
551
+ jid: string,
552
+ messageId: string,
553
+ labelId: string,
554
+ ) => Promise<void>;
555
+ star: (
556
+ jid: string,
557
+ messages: {
558
+ id: string;
559
+ fromMe?: boolean;
560
+ }[],
561
+ star: boolean,
562
+ ) => Promise<void>;
563
+ addOrEditQuickReply: (
564
+ quickReply: import("../Types/Bussines.js").QuickReplyAction,
565
+ ) => Promise<void>;
566
+ removeQuickReply: (timestamp: string) => Promise<void>;
567
+ type: "md";
568
+ ws: import("./Client/index.js").WebSocketClient;
569
+ ev: import("../index.js").BaileysEventEmitter & {
570
+ process(
571
+ handler: (
572
+ events: Partial<import("../index.js").BaileysEventMap>,
573
+ ) => void | Promise<void>,
574
+ ): () => void;
575
+ buffer(): void;
576
+ createBufferedFunction<A extends any[], T>(
577
+ work: (...args: A) => Promise<T>,
578
+ ): (...args: A) => Promise<T>;
579
+ flush(): boolean;
580
+ isBuffering(): boolean;
581
+ };
582
+ authState: {
583
+ creds: import("../index.js").AuthenticationCreds;
584
+ keys: import("../index.js").SignalKeyStoreWithTransaction;
585
+ };
586
+ signalRepository: import("../index.js").SignalRepositoryWithLIDStore;
587
+ user: import("../index.js").Contact | undefined;
588
+ generateMessageTag: () => string;
589
+ query: (
590
+ node: import("../index.js").BinaryNode,
591
+ timeoutMs?: number,
592
+ ) => Promise<any>;
593
+ waitForMessage: <T>(
594
+ msgId: string,
595
+ timeoutMs?: number | undefined,
596
+ ) => Promise<T | undefined>;
597
+ waitForSocketOpen: () => Promise<void>;
598
+ sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
599
+ sendNode: (frame: import("../index.js").BinaryNode) => Promise<void>;
600
+ logout: (msg?: string) => Promise<void>;
601
+ end: (error: Error | undefined) => Promise<void>;
602
+ onUnexpectedError: (
603
+ err: Error | import("@hapi/boom").Boom,
604
+ msg: string,
605
+ ) => void;
606
+ uploadPreKeys: (count?: number, retryCount?: number) => Promise<void>;
607
+ uploadPreKeysToServerIfRequired: () => Promise<void>;
608
+ digestKeyBundle: () => Promise<void>;
609
+ rotateSignedPreKey: () => Promise<void>;
610
+ requestPairingCode: (
611
+ phoneNumber: string,
612
+ customPairingCode?: string,
613
+ ) => Promise<string>;
614
+ updateServerTimeOffset: ({ attrs }: import("../index.js").BinaryNode) => void;
615
+ sendUnifiedSession: () => Promise<void>;
616
+ wamBuffer: import("../index.js").BinaryInfo;
617
+ waitForConnectionUpdate: (
618
+ check: (
619
+ u: Partial<import("../index.js").ConnectionState>,
620
+ ) => Promise<boolean | undefined>,
621
+ timeoutMs?: number,
622
+ ) => Promise<void>;
623
+ sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
624
+ executeUSyncQuery: (
625
+ usyncQuery: import("../index.js").USyncQuery,
626
+ ) => Promise<import("../index.js").USyncQueryResult | undefined>;
627
+ onWhatsApp: (...phoneNumber: string[]) => Promise<
628
+ | {
629
+ jid: string;
630
+ exists: boolean;
631
+ }[]
632
+ | undefined
633
+ >;
634
+ /** ZelynskyBail call controls and optional outbound voice client. */
635
+ calls: import('../VoIP/index.js').CallManager;
636
+ createButton: () => import('../Modded/message_builder.js').Button;
637
+ createButtonV2: () => import('../Modded/message_builder.js').ButtonV2;
638
+ createButtonV3: () => import('../Builders/advanced.js').ButtonV3;
639
+ createNativeFlow: () => import('../Builders/index.js').NativeFlow;
640
+ createCarousel: () => import('../Modded/message_builder.js').Carousel;
641
+ createAIRich: () => import('../Modded/message_builder.js').AIRich;
642
+ createORich: () => import('../Modded/message_builder.js').ORich;
643
+ createPoll: () => import('../Builders/index.js').PollBuilder;
644
+ createAlbum: () => import('../Builders/index.js').AlbumBuilder;
645
+ createContact: () => import('../Builders/index.js').ContactBuilder;
646
+ createVCard: () => import('../Builders/index.js').VCardBuilder;
647
+ createLocation: () => import('../Builders/index.js').LocationBuilder;
648
+ createLinkPreview: () => import('../Builders/index.js').LinkPreviewBuilder;
649
+ createBuilders: () => import('../Builders/index.js').MessageBuilder;
650
+ createMessageBuilder: () => import('../Builders/index.js').MessageBuilder;
651
+ createA2UI: () => import('../Builders/advanced.js').A2UIBuilder;
652
+ createMessageSearch: (options?: { maxEntries?: number }) => Promise<import('../Utils/message-tools.js').MessageSearch>;
653
+ createAntiDeleteManager: (options?: Omit<ConstructorParameters<typeof import('../Utils/message-tools.js').AntiDeleteManager>[0], 'sock'>) => Promise<import('../Utils/message-tools.js').AntiDeleteManager>;
654
+ swgc: (groupJid: string, content: object, options?: object) => Promise<import('../index.js').WAMessage>;
655
+ };
656
+ export default makeWASocket;
657
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,26 @@
1
+ import { DEFAULT_CONNECTION_CONFIG } from "../Defaults/index.js";
2
+ import { getPerformanceConfig } from "../Utils/performance.js";
3
+ import { attachBuilders } from "../Builders/index.js";
4
+ import { CallManager } from "../VoIP/index.js";
5
+ import { makeCommunitiesSocket } from "./communities.js";
6
+ export { Dugong } from "./dugong.js";
7
+ const makeWASocket = (config) => {
8
+ const input = config || {};
9
+ const { performanceProfile = "balanced", ...socketConfig } = input;
10
+ const newConfig = {
11
+ ...DEFAULT_CONNECTION_CONFIG,
12
+ ...getPerformanceConfig(performanceProfile),
13
+ ...socketConfig,
14
+ };
15
+ const sock = makeCommunitiesSocket(newConfig);
16
+ attachBuilders(sock);
17
+ Object.defineProperty(sock, "calls", { value: new CallManager(sock), enumerable: false });
18
+ if (typeof sock.createMessageSearch !== "function") {
19
+ Object.defineProperty(sock, "createMessageSearch", { value: (options) => import("../Utils/message-tools.js").then(({ MessageSearch }) => new MessageSearch(options).bind(sock)), configurable: true });
20
+ }
21
+ if (typeof sock.createAntiDeleteManager !== "function") {
22
+ Object.defineProperty(sock, "createAntiDeleteManager", { value: (options = {}) => import("../Utils/message-tools.js").then(({ AntiDeleteManager }) => new AntiDeleteManager({ ...options, sock })), configurable: true });
23
+ }
24
+ return sock;
25
+ };
26
+ export default makeWASocket;