gifted-baileys 1.5.0 → 1.5.5

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 (222) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1429 -684
  3. package/package.json +11 -26
  4. package/src/Defaults/baileys-version.json +3 -0
  5. package/{lib → src}/Defaults/index.js +16 -8
  6. package/src/Defaults/index.ts +131 -0
  7. package/src/Defaults/phonenumber-mcc.json +223 -0
  8. package/src/Signal/libsignal.js +180 -0
  9. package/src/Signal/libsignal.ts +141 -0
  10. package/src/Socket/Client/abstract-socket-client.ts +19 -0
  11. package/src/Socket/Client/index.ts +3 -0
  12. package/src/Socket/Client/mobile-socket-client.js +78 -0
  13. package/src/Socket/Client/mobile-socket-client.ts +66 -0
  14. package/src/Socket/Client/web-socket-client.js +75 -0
  15. package/src/Socket/Client/web-socket-client.ts +57 -0
  16. package/{lib → src}/Socket/business.js +33 -27
  17. package/src/Socket/business.ts +281 -0
  18. package/{lib → src}/Socket/chats.js +197 -178
  19. package/src/Socket/chats.ts +1030 -0
  20. package/{lib → src}/Socket/groups.js +69 -79
  21. package/src/Socket/groups.ts +356 -0
  22. package/{lib → src}/Socket/index.js +1 -4
  23. package/src/Socket/index.ts +13 -0
  24. package/{lib → src}/Socket/messages-recv.js +160 -108
  25. package/src/Socket/messages-recv.ts +985 -0
  26. package/{lib → src}/Socket/messages-send.js +183 -100
  27. package/src/Socket/messages-send.ts +871 -0
  28. package/src/Socket/newsletter.js +227 -0
  29. package/src/Socket/newsletter.ts +282 -0
  30. package/{lib → src}/Socket/registration.js +55 -63
  31. package/src/Socket/registration.ts +250 -0
  32. package/{lib → src}/Socket/socket.js +107 -66
  33. package/src/Socket/socket.ts +777 -0
  34. package/src/Store/index.ts +3 -0
  35. package/{lib → src}/Store/make-cache-manager-store.js +34 -25
  36. package/src/Store/make-cache-manager-store.ts +100 -0
  37. package/{lib → src}/Store/make-in-memory-store.js +51 -61
  38. package/src/Store/make-in-memory-store.ts +475 -0
  39. package/src/Store/make-ordered-dictionary.ts +86 -0
  40. package/{lib → src}/Store/object-repository.js +1 -1
  41. package/src/Store/object-repository.ts +32 -0
  42. package/src/Tests/test.app-state-sync.js +204 -0
  43. package/src/Tests/test.app-state-sync.ts +207 -0
  44. package/src/Tests/test.event-buffer.js +270 -0
  45. package/src/Tests/test.event-buffer.ts +319 -0
  46. package/src/Tests/test.key-store.js +76 -0
  47. package/src/Tests/test.key-store.ts +92 -0
  48. package/src/Tests/test.libsignal.js +141 -0
  49. package/src/Tests/test.libsignal.ts +186 -0
  50. package/src/Tests/test.media-download.js +93 -0
  51. package/src/Tests/test.media-download.ts +76 -0
  52. package/src/Tests/test.messages.js +33 -0
  53. package/src/Tests/test.messages.ts +37 -0
  54. package/src/Tests/utils.js +34 -0
  55. package/src/Tests/utils.ts +36 -0
  56. package/src/Types/Auth.ts +113 -0
  57. package/src/Types/Call.ts +15 -0
  58. package/src/Types/Chat.ts +106 -0
  59. package/{lib/Types/Contact.d.ts → src/Types/Contact.ts} +9 -8
  60. package/src/Types/Events.ts +93 -0
  61. package/src/Types/GroupMetadata.ts +53 -0
  62. package/{lib → src}/Types/Label.js +1 -1
  63. package/src/Types/Label.ts +36 -0
  64. package/{lib → src}/Types/LabelAssociation.js +1 -1
  65. package/{lib/Types/LabelAssociation.d.ts → src/Types/LabelAssociation.ts} +22 -16
  66. package/src/Types/Message.ts +288 -0
  67. package/src/Types/Newsletter.js +32 -0
  68. package/src/Types/Newsletter.ts +98 -0
  69. package/src/Types/Product.ts +85 -0
  70. package/src/Types/Signal.ts +68 -0
  71. package/{lib/Types/Socket.d.ts → src/Types/Socket.ts} +68 -56
  72. package/src/Types/State.ts +29 -0
  73. package/{lib → src}/Types/index.js +2 -1
  74. package/src/Types/index.ts +59 -0
  75. package/{lib → src}/Utils/auth-utils.js +95 -76
  76. package/src/Utils/auth-utils.ts +222 -0
  77. package/src/Utils/baileys-event-stream.js +92 -0
  78. package/src/Utils/baileys-event-stream.ts +66 -0
  79. package/{lib → src}/Utils/business.js +45 -17
  80. package/src/Utils/business.ts +275 -0
  81. package/{lib → src}/Utils/chat-utils.js +74 -46
  82. package/src/Utils/chat-utils.ts +860 -0
  83. package/{lib → src}/Utils/crypto.js +31 -21
  84. package/src/Utils/crypto.ts +131 -0
  85. package/src/Utils/decode-wa-message.js +211 -0
  86. package/src/Utils/decode-wa-message.ts +228 -0
  87. package/{lib → src}/Utils/event-buffer.js +13 -4
  88. package/src/Utils/event-buffer.ts +613 -0
  89. package/{lib → src}/Utils/generics.js +98 -45
  90. package/src/Utils/generics.ts +434 -0
  91. package/{lib → src}/Utils/history.js +39 -10
  92. package/src/Utils/history.ts +112 -0
  93. package/src/Utils/index.ts +17 -0
  94. package/{lib → src}/Utils/link-preview.js +54 -17
  95. package/src/Utils/link-preview.ts +122 -0
  96. package/src/Utils/logger.ts +3 -0
  97. package/src/Utils/lt-hash.ts +61 -0
  98. package/{lib → src}/Utils/make-mutex.js +13 -4
  99. package/src/Utils/make-mutex.ts +44 -0
  100. package/{lib → src}/Utils/messages-media.js +296 -192
  101. package/src/Utils/messages-media.ts +847 -0
  102. package/{lib → src}/Utils/messages.js +124 -113
  103. package/src/Utils/messages.ts +956 -0
  104. package/{lib → src}/Utils/noise-handler.js +16 -3
  105. package/src/Utils/noise-handler.ts +197 -0
  106. package/{lib → src}/Utils/process-message.js +33 -29
  107. package/src/Utils/process-message.ts +414 -0
  108. package/{lib → src}/Utils/signal.js +23 -14
  109. package/src/Utils/signal.ts +177 -0
  110. package/{lib → src}/Utils/use-multi-file-auth-state.js +28 -19
  111. package/src/Utils/use-multi-file-auth-state.ts +90 -0
  112. package/{lib → src}/Utils/validate-connection.js +25 -42
  113. package/src/Utils/validate-connection.ts +238 -0
  114. package/src/WABinary/constants.ts +42 -0
  115. package/{lib → src}/WABinary/decode.js +17 -7
  116. package/src/WABinary/decode.ts +265 -0
  117. package/{lib → src}/WABinary/encode.js +17 -7
  118. package/src/WABinary/encode.ts +236 -0
  119. package/{lib → src}/WABinary/generic-utils.js +2 -2
  120. package/src/WABinary/generic-utils.ts +121 -0
  121. package/src/WABinary/index.ts +5 -0
  122. package/{lib → src}/WABinary/jid-utils.js +4 -1
  123. package/src/WABinary/jid-utils.ts +68 -0
  124. package/src/WABinary/types.ts +17 -0
  125. package/src/WAM/BinaryInfo.js +13 -0
  126. package/src/WAM/BinaryInfo.ts +12 -0
  127. package/src/WAM/constants.js +15350 -0
  128. package/src/WAM/constants.ts +15382 -0
  129. package/src/WAM/encode.js +155 -0
  130. package/src/WAM/encode.ts +174 -0
  131. package/src/WAM/index.js +19 -0
  132. package/src/WAM/index.ts +3 -0
  133. package/src/gifted +1 -0
  134. package/{lib → src}/index.js +1 -0
  135. package/src/index.ts +13 -0
  136. package/lib/Defaults/baileys-version.json +0 -3
  137. package/lib/Defaults/index.d.ts +0 -284
  138. package/lib/Defaults/phonenumber-mcc.json +0 -223
  139. package/lib/Signal/libsignal.d.ts +0 -3
  140. package/lib/Signal/libsignal.js +0 -152
  141. package/lib/Socket/Client/abstract-socket-client.d.ts +0 -17
  142. package/lib/Socket/Client/index.d.ts +0 -3
  143. package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
  144. package/lib/Socket/Client/mobile-socket-client.js +0 -65
  145. package/lib/Socket/Client/web-socket-client.d.ts +0 -12
  146. package/lib/Socket/Client/web-socket-client.js +0 -62
  147. package/lib/Socket/business.d.ts +0 -135
  148. package/lib/Socket/chats.d.ts +0 -79
  149. package/lib/Socket/groups.d.ts +0 -113
  150. package/lib/Socket/index.d.ts +0 -137
  151. package/lib/Socket/messages-recv.d.ts +0 -124
  152. package/lib/Socket/messages-send.d.ts +0 -119
  153. package/lib/Socket/registration.d.ts +0 -232
  154. package/lib/Socket/socket.d.ts +0 -42
  155. package/lib/Store/index.d.ts +0 -3
  156. package/lib/Store/make-cache-manager-store.d.ts +0 -13
  157. package/lib/Store/make-in-memory-store.d.ts +0 -117
  158. package/lib/Store/make-ordered-dictionary.d.ts +0 -13
  159. package/lib/Store/object-repository.d.ts +0 -10
  160. package/lib/Types/Auth.d.ts +0 -108
  161. package/lib/Types/Call.d.ts +0 -13
  162. package/lib/Types/Chat.d.ts +0 -102
  163. package/lib/Types/Events.d.ts +0 -157
  164. package/lib/Types/GroupMetadata.d.ts +0 -52
  165. package/lib/Types/Label.d.ts +0 -35
  166. package/lib/Types/Message.d.ts +0 -261
  167. package/lib/Types/Product.d.ts +0 -78
  168. package/lib/Types/Signal.d.ts +0 -57
  169. package/lib/Types/State.d.ts +0 -27
  170. package/lib/Types/index.d.ts +0 -56
  171. package/lib/Utils/auth-utils.d.ts +0 -18
  172. package/lib/Utils/baileys-event-stream.d.ts +0 -16
  173. package/lib/Utils/baileys-event-stream.js +0 -63
  174. package/lib/Utils/business.d.ts +0 -22
  175. package/lib/Utils/chat-utils.d.ts +0 -71
  176. package/lib/Utils/crypto.d.ts +0 -41
  177. package/lib/Utils/decode-wa-message.d.ts +0 -19
  178. package/lib/Utils/decode-wa-message.js +0 -174
  179. package/lib/Utils/event-buffer.d.ts +0 -35
  180. package/lib/Utils/generics.d.ts +0 -94
  181. package/lib/Utils/history.d.ts +0 -15
  182. package/lib/Utils/index.d.ts +0 -17
  183. package/lib/Utils/link-preview.d.ts +0 -21
  184. package/lib/Utils/logger.d.ts +0 -4
  185. package/lib/Utils/lt-hash.d.ts +0 -12
  186. package/lib/Utils/make-mutex.d.ts +0 -7
  187. package/lib/Utils/messages-media.d.ts +0 -107
  188. package/lib/Utils/messages.d.ts +0 -76
  189. package/lib/Utils/noise-handler.d.ts +0 -20
  190. package/lib/Utils/process-message.d.ts +0 -41
  191. package/lib/Utils/signal.d.ts +0 -32
  192. package/lib/Utils/use-multi-file-auth-state.d.ts +0 -12
  193. package/lib/Utils/validate-connection.d.ts +0 -11
  194. package/lib/WABinary/constants.d.ts +0 -27
  195. package/lib/WABinary/decode.d.ts +0 -7
  196. package/lib/WABinary/encode.d.ts +0 -3
  197. package/lib/WABinary/generic-utils.d.ts +0 -15
  198. package/lib/WABinary/index.d.ts +0 -5
  199. package/lib/WABinary/jid-utils.d.ts +0 -29
  200. package/lib/WABinary/types.d.ts +0 -18
  201. package/lib/index.d.ts +0 -10
  202. /package/{lib → src}/Socket/Client/abstract-socket-client.js +0 -0
  203. /package/{lib → src}/Socket/Client/index.js +0 -0
  204. /package/{lib → src}/Store/index.js +0 -0
  205. /package/{lib → src}/Store/make-ordered-dictionary.js +0 -0
  206. /package/{lib → src}/Types/Auth.js +0 -0
  207. /package/{lib → src}/Types/Call.js +0 -0
  208. /package/{lib → src}/Types/Chat.js +0 -0
  209. /package/{lib → src}/Types/Contact.js +0 -0
  210. /package/{lib → src}/Types/Events.js +0 -0
  211. /package/{lib → src}/Types/GroupMetadata.js +0 -0
  212. /package/{lib → src}/Types/Message.js +0 -0
  213. /package/{lib → src}/Types/Product.js +0 -0
  214. /package/{lib → src}/Types/Signal.js +0 -0
  215. /package/{lib → src}/Types/Socket.js +0 -0
  216. /package/{lib → src}/Types/State.js +0 -0
  217. /package/{lib → src}/Utils/index.js +0 -0
  218. /package/{lib → src}/Utils/logger.js +0 -0
  219. /package/{lib → src}/Utils/lt-hash.js +0 -0
  220. /package/{lib → src}/WABinary/constants.js +0 -0
  221. /package/{lib → src}/WABinary/index.js +0 -0
  222. /package/{lib → src}/WABinary/types.js +0 -0
@@ -1,135 +0,0 @@
1
- /// <reference types="node" />
2
- import { GetCatalogOptions, ProductCreate, ProductUpdate, SocketConfig } from '../Types';
3
- import { BinaryNode } from '../WABinary';
4
- export declare const makeBusinessSocket: (config: SocketConfig) => {
5
- getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
6
- getCatalog: ({ jid, limit, cursor }: GetCatalogOptions) => Promise<{
7
- products: import("../Types").Product[];
8
- nextPageCursor: string | undefined;
9
- }>;
10
- getCollections: (jid?: string, limit?: number) => Promise<{
11
- collections: import("../Types").CatalogCollection[];
12
- }>;
13
- productCreate: (create: ProductCreate) => Promise<import("../Types").Product>;
14
- productDelete: (productIds: string[]) => Promise<{
15
- deleted: number;
16
- }>;
17
- productUpdate: (productId: string, update: ProductUpdate) => Promise<import("../Types").Product>;
18
- sendMessageAck: ({ tag, attrs }: BinaryNode) => Promise<void>;
19
- sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
20
- rejectCall: (callId: string, callFrom: string) => Promise<void>;
21
- getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
22
- assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
23
- relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
24
- sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
25
- sendReceipts: (keys: import("../Types").WAProto.IMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
26
- getButtonArgs: (message: import("../Types").WAProto.IMessage) => {
27
- [key: string]: string;
28
- };
29
- readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise<void>;
30
- refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
31
- waUploadToServer: import("../Types").WAMediaUploadFunction;
32
- fetchPrivacySettings: (force?: boolean) => Promise<{
33
- [_: string]: string;
34
- }>;
35
- updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
36
- sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
37
- groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
38
- groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
39
- groupLeave: (id: string) => Promise<void>;
40
- groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
41
- groupRequestParticipantsList: (jid: string) => Promise<{
42
- [key: string]: string;
43
- }[]>;
44
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
45
- status: string;
46
- jid: string;
47
- }[]>;
48
- groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
49
- status: string;
50
- jid: string;
51
- content: BinaryNode;
52
- }[]>;
53
- groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
54
- groupInviteCode: (jid: string) => Promise<string | undefined>;
55
- groupRevokeInvite: (jid: string) => Promise<string | undefined>;
56
- groupAcceptInvite: (code: string) => Promise<string | undefined>;
57
- groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
58
- groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
59
- groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
60
- groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
61
- groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
62
- groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
63
- groupFetchAllParticipating: () => Promise<{
64
- [_: string]: import("../Types").GroupMetadata;
65
- }>;
66
- processingMutex: {
67
- mutex<T>(code: () => T | Promise<T>): Promise<T>;
68
- };
69
- upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
70
- appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
71
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
72
- presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
73
- profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
74
- onWhatsApp: (...jids: string[]) => Promise<{
75
- exists: boolean;
76
- jid: string;
77
- }[]>;
78
- fetchBlocklist: () => Promise<string[]>;
79
- fetchStatus: (jid: string) => Promise<{
80
- status: string | undefined;
81
- setAt: Date;
82
- } | undefined>;
83
- updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
84
- removeProfilePicture: (jid: string) => Promise<void>;
85
- updateProfileStatus: (status: string) => Promise<void>;
86
- updateProfileName: (name: string) => Promise<void>;
87
- updateBlockStatus: (jid: string, action: "block" | "unblock") => 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").WAPrivacyValue) => Promise<void>;
94
- updateDefaultDisappearingMode: (duration: number) => Promise<void>;
95
- getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
96
- resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
97
- chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
98
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
99
- addChatLabel: (jid: string, labelId: string) => Promise<void>;
100
- removeChatLabel: (jid: string, labelId: string) => Promise<void>;
101
- addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
102
- removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
103
- star: (jid: string, messages: {
104
- id: string;
105
- fromMe?: boolean | undefined;
106
- }[], star: boolean) => Promise<void>;
107
- type: "md";
108
- ws: any;
109
- ev: import("../Types").BaileysEventEmitter & {
110
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
111
- buffer(): void;
112
- createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
113
- flush(force?: boolean | undefined): boolean;
114
- isBuffering(): boolean;
115
- };
116
- authState: {
117
- creds: import("../Types").AuthenticationCreds;
118
- keys: import("../Types").SignalKeyStoreWithTransaction;
119
- };
120
- signalRepository: import("../Types").SignalRepository;
121
- user: import("../Types").Contact | undefined;
122
- generateMessageTag: () => string;
123
- query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
124
- waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
125
- waitForSocketOpen: () => Promise<void>;
126
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
127
- sendNode: (frame: BinaryNode) => Promise<void>;
128
- logout: (msg?: string | undefined) => Promise<void>;
129
- end: (error: Error | undefined) => void;
130
- onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
131
- uploadPreKeys: (count?: number) => Promise<void>;
132
- uploadPreKeysToServerIfRequired: () => Promise<void>;
133
- requestPairingCode: (phoneNumber: string) => Promise<string>;
134
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
135
- };
@@ -1,79 +0,0 @@
1
- /// <reference types="node" />
2
- import { Boom } from '@hapi/boom';
3
- import { proto } from '../../WAProto';
4
- import { ChatModification, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload, WAPatchCreate, WAPresence, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types';
5
- import { BinaryNode } from '../WABinary';
6
- export declare const makeChatsSocket: (config: SocketConfig) => {
7
- processingMutex: {
8
- mutex<T>(code: () => T | Promise<T>): Promise<T>;
9
- };
10
- fetchPrivacySettings: (force?: boolean) => Promise<{
11
- [_: string]: string;
12
- }>;
13
- upsertMessage: (msg: proto.IWebMessageInfo, type: MessageUpsertType) => Promise<void>;
14
- appPatch: (patchCreate: WAPatchCreate) => Promise<void>;
15
- sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>;
16
- presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
17
- profilePictureUrl: (jid: string, type?: 'preview' | 'image', timeoutMs?: number) => Promise<string | undefined>;
18
- onWhatsApp: (...jids: string[]) => Promise<{
19
- exists: boolean;
20
- jid: string;
21
- }[]>;
22
- fetchBlocklist: () => Promise<string[]>;
23
- fetchStatus: (jid: string) => Promise<{
24
- status: string | undefined;
25
- setAt: Date;
26
- } | undefined>;
27
- updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>;
28
- removeProfilePicture: (jid: string) => Promise<void>;
29
- updateProfileStatus: (status: string) => Promise<void>;
30
- updateProfileName: (name: string) => Promise<void>;
31
- updateBlockStatus: (jid: string, action: 'block' | 'unblock') => Promise<void>;
32
- updateLastSeenPrivacy: (value: WAPrivacyValue) => Promise<void>;
33
- updateOnlinePrivacy: (value: WAPrivacyOnlineValue) => Promise<void>;
34
- updateProfilePicturePrivacy: (value: WAPrivacyValue) => Promise<void>;
35
- updateStatusPrivacy: (value: WAPrivacyValue) => Promise<void>;
36
- updateReadReceiptsPrivacy: (value: WAReadReceiptsValue) => Promise<void>;
37
- updateGroupsAddPrivacy: (value: WAPrivacyValue) => Promise<void>;
38
- updateDefaultDisappearingMode: (duration: number) => Promise<void>;
39
- getBusinessProfile: (jid: string) => Promise<WABusinessProfile | void>;
40
- resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
41
- chatModify: (mod: ChatModification, jid: string) => Promise<void>;
42
- cleanDirtyBits: (type: 'account_sync' | 'groups', fromTimestamp?: number | string) => Promise<void>;
43
- addChatLabel: (jid: string, labelId: string) => Promise<void>;
44
- removeChatLabel: (jid: string, labelId: string) => Promise<void>;
45
- addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
46
- removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
47
- star: (jid: string, messages: {
48
- id: string;
49
- fromMe?: boolean;
50
- }[], star: boolean) => Promise<void>;
51
- type: "md";
52
- ws: any;
53
- ev: import("../Types").BaileysEventEmitter & {
54
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
55
- buffer(): void;
56
- createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
57
- flush(force?: boolean | undefined): boolean;
58
- isBuffering(): boolean;
59
- };
60
- authState: {
61
- creds: import("../Types").AuthenticationCreds;
62
- keys: import("../Types").SignalKeyStoreWithTransaction;
63
- };
64
- signalRepository: import("../Types").SignalRepository;
65
- user: import("../Types").Contact | undefined;
66
- generateMessageTag: () => string;
67
- query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
68
- waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
69
- waitForSocketOpen: () => Promise<void>;
70
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
71
- sendNode: (frame: BinaryNode) => Promise<void>;
72
- logout: (msg?: string | undefined) => Promise<void>;
73
- end: (error: Error | undefined) => void;
74
- onUnexpectedError: (err: Error | Boom<any>, msg: string) => void;
75
- uploadPreKeys: (count?: number) => Promise<void>;
76
- uploadPreKeysToServerIfRequired: () => Promise<void>;
77
- requestPairingCode: (phoneNumber: string) => Promise<string>;
78
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
79
- };
@@ -1,113 +0,0 @@
1
- /// <reference types="node" />
2
- import { proto } from '../../WAProto';
3
- import { GroupMetadata, ParticipantAction, SocketConfig } from '../Types';
4
- import { BinaryNode } from '../WABinary';
5
- export declare const makeGroupsSocket: (config: SocketConfig) => {
6
- groupMetadata: (jid: string) => Promise<GroupMetadata>;
7
- groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>;
8
- groupLeave: (id: string) => Promise<void>;
9
- groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
10
- groupRequestParticipantsList: (jid: string) => Promise<{
11
- [key: string]: string;
12
- }[]>;
13
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: 'approve' | 'reject') => Promise<{
14
- status: string;
15
- jid: string;
16
- }[]>;
17
- groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<{
18
- status: string;
19
- jid: string;
20
- content: BinaryNode;
21
- }[]>;
22
- groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
23
- groupInviteCode: (jid: string) => Promise<string | undefined>;
24
- groupRevokeInvite: (jid: string) => Promise<string | undefined>;
25
- groupAcceptInvite: (code: string) => Promise<string | undefined>;
26
- /**
27
- * accept a GroupInviteMessage
28
- * @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite
29
- * @param inviteMessage the message to accept
30
- */
31
- groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
32
- groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
33
- groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
34
- groupSettingUpdate: (jid: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked') => Promise<void>;
35
- groupMemberAddMode: (jid: string, mode: 'admin_add' | 'all_member_add') => Promise<void>;
36
- groupJoinApprovalMode: (jid: string, mode: 'on' | 'off') => Promise<void>;
37
- groupFetchAllParticipating: () => Promise<{
38
- [_: string]: GroupMetadata;
39
- }>;
40
- processingMutex: {
41
- mutex<T>(code: () => T | Promise<T>): Promise<T>;
42
- };
43
- fetchPrivacySettings: (force?: boolean) => Promise<{
44
- [_: string]: string;
45
- }>;
46
- upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
47
- appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
48
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
49
- presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
50
- profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
51
- onWhatsApp: (...jids: string[]) => Promise<{
52
- exists: boolean;
53
- jid: string;
54
- }[]>;
55
- fetchBlocklist: () => Promise<string[]>;
56
- fetchStatus: (jid: string) => Promise<{
57
- status: string | undefined;
58
- setAt: Date;
59
- } | undefined>;
60
- updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
61
- removeProfilePicture: (jid: string) => Promise<void>;
62
- updateProfileStatus: (status: string) => Promise<void>;
63
- updateProfileName: (name: string) => Promise<void>;
64
- updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
65
- updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
66
- updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
67
- updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
68
- updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
69
- updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
70
- updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
71
- updateDefaultDisappearingMode: (duration: number) => Promise<void>;
72
- getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
73
- resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
74
- chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
75
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
76
- addChatLabel: (jid: string, labelId: string) => Promise<void>;
77
- removeChatLabel: (jid: string, labelId: string) => Promise<void>;
78
- addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
79
- removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
80
- star: (jid: string, messages: {
81
- id: string;
82
- fromMe?: boolean | undefined;
83
- }[], star: boolean) => Promise<void>;
84
- type: "md";
85
- ws: any;
86
- ev: import("../Types").BaileysEventEmitter & {
87
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
88
- buffer(): void;
89
- createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
90
- flush(force?: boolean | undefined): boolean;
91
- isBuffering(): boolean;
92
- };
93
- authState: {
94
- creds: import("../Types").AuthenticationCreds;
95
- keys: import("../Types").SignalKeyStoreWithTransaction;
96
- };
97
- signalRepository: import("../Types").SignalRepository;
98
- user: import("../Types").Contact | undefined;
99
- generateMessageTag: () => string;
100
- query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
101
- waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
102
- waitForSocketOpen: () => Promise<void>;
103
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
104
- sendNode: (frame: BinaryNode) => Promise<void>;
105
- logout: (msg?: string | undefined) => Promise<void>;
106
- end: (error: Error | undefined) => void;
107
- onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
108
- uploadPreKeys: (count?: number) => Promise<void>;
109
- uploadPreKeysToServerIfRequired: () => Promise<void>;
110
- requestPairingCode: (phoneNumber: string) => Promise<string>;
111
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
112
- };
113
- export declare const extractGroupMetadata: (result: BinaryNode) => GroupMetadata;
@@ -1,137 +0,0 @@
1
- /// <reference types="node" />
2
- import { UserFacingSocketConfig } from '../Types';
3
- declare const makeWASocket: (config: UserFacingSocketConfig) => {
4
- register: (code: string) => Promise<import("./registration").ExistsResponse>;
5
- requestRegistrationCode: (registrationOptions?: import("./registration").RegistrationOptions | undefined) => Promise<import("./registration").ExistsResponse>;
6
- getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
7
- getCatalog: ({ jid, limit, cursor }: import("../Types").GetCatalogOptions) => Promise<{
8
- products: import("../Types").Product[];
9
- nextPageCursor: string | undefined;
10
- }>;
11
- getCollections: (jid?: string | undefined, limit?: number) => Promise<{
12
- collections: import("../Types").CatalogCollection[];
13
- }>;
14
- productCreate: (create: import("../Types").ProductCreate) => Promise<import("../Types").Product>;
15
- productDelete: (productIds: string[]) => Promise<{
16
- deleted: number;
17
- }>;
18
- productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>;
19
- sendMessageAck: ({ tag, attrs }: import("../index").BinaryNode) => Promise<void>;
20
- sendRetryRequest: (node: import("../index").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
21
- rejectCall: (callId: string, callFrom: string) => Promise<void>;
22
- getPrivacyTokens: (jids: string[]) => Promise<import("../index").BinaryNode>;
23
- assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
24
- relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
25
- sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
26
- sendReceipts: (keys: import("../Types").WAProto.IMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
27
- getButtonArgs: (message: import("../Types").WAProto.IMessage) => {
28
- [key: string]: string;
29
- };
30
- readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise<void>;
31
- refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
32
- waUploadToServer: import("../Types").WAMediaUploadFunction;
33
- fetchPrivacySettings: (force?: boolean) => Promise<{
34
- [_: string]: string;
35
- }>;
36
- updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
37
- sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
38
- groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
39
- groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
40
- groupLeave: (id: string) => Promise<void>;
41
- groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
42
- groupRequestParticipantsList: (jid: string) => Promise<{
43
- [key: string]: string;
44
- }[]>;
45
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
46
- status: string;
47
- jid: string;
48
- }[]>;
49
- groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
50
- status: string;
51
- jid: string;
52
- content: import("../index").BinaryNode;
53
- }[]>;
54
- groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
55
- groupInviteCode: (jid: string) => Promise<string | undefined>;
56
- groupRevokeInvite: (jid: string) => Promise<string | undefined>;
57
- groupAcceptInvite: (code: string) => Promise<string | undefined>;
58
- groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
59
- groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
60
- groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
61
- groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
62
- groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
63
- groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
64
- groupFetchAllParticipating: () => Promise<{
65
- [_: string]: import("../Types").GroupMetadata;
66
- }>;
67
- processingMutex: {
68
- mutex<T>(code: () => T | Promise<T>): Promise<T>;
69
- };
70
- upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
71
- appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
72
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
73
- presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
74
- profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
75
- onWhatsApp: (...jids: string[]) => Promise<{
76
- exists: boolean;
77
- jid: string;
78
- }[]>;
79
- fetchBlocklist: () => Promise<string[]>;
80
- fetchStatus: (jid: string) => Promise<{
81
- status: string | undefined;
82
- setAt: Date;
83
- } | undefined>;
84
- updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
85
- removeProfilePicture: (jid: string) => Promise<void>;
86
- updateProfileStatus: (status: string) => Promise<void>;
87
- updateProfileName: (name: string) => Promise<void>;
88
- updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
89
- updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
90
- updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
91
- updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
92
- updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
93
- updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
94
- updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
95
- updateDefaultDisappearingMode: (duration: number) => 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
- star: (jid: string, messages: {
105
- id: string;
106
- fromMe?: boolean | undefined;
107
- }[], star: boolean) => Promise<void>;
108
- type: "md";
109
- ws: any;
110
- ev: import("../Types").BaileysEventEmitter & {
111
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
112
- buffer(): void;
113
- createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
114
- flush(force?: boolean | undefined): boolean;
115
- isBuffering(): boolean;
116
- };
117
- authState: {
118
- creds: import("../Types").AuthenticationCreds;
119
- keys: import("../Types").SignalKeyStoreWithTransaction;
120
- };
121
- signalRepository: import("../Types").SignalRepository;
122
- user: import("../Types").Contact | undefined;
123
- generateMessageTag: () => string;
124
- query: (node: import("../index").BinaryNode, timeoutMs?: number | undefined) => Promise<import("../index").BinaryNode>;
125
- waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
126
- waitForSocketOpen: () => Promise<void>;
127
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
128
- sendNode: (frame: import("../index").BinaryNode) => Promise<void>;
129
- logout: (msg?: string | undefined) => Promise<void>;
130
- end: (error: Error | undefined) => void;
131
- onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
132
- uploadPreKeys: (count?: number) => Promise<void>;
133
- uploadPreKeysToServerIfRequired: () => Promise<void>;
134
- requestPairingCode: (phoneNumber: string) => Promise<string>;
135
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
136
- };
137
- export default makeWASocket;
@@ -1,124 +0,0 @@
1
- /// <reference types="node" />
2
- import { Boom } from '@hapi/boom';
3
- import { proto } from '../../WAProto';
4
- import { MessageReceiptType, MessageRelayOptions, SocketConfig } from '../Types';
5
- import { BinaryNode } from '../WABinary';
6
- export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
7
- sendMessageAck: ({ tag, attrs }: BinaryNode) => Promise<void>;
8
- sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
9
- rejectCall: (callId: string, callFrom: string) => Promise<void>;
10
- getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
11
- assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
12
- relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
13
- sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
14
- sendReceipts: (keys: proto.IMessageKey[], type: MessageReceiptType) => Promise<void>;
15
- getButtonArgs: (message: proto.IMessage) => {
16
- [key: string]: string;
17
- };
18
- readMessages: (keys: proto.IMessageKey[]) => Promise<void>;
19
- refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
20
- waUploadToServer: import("../Types").WAMediaUploadFunction;
21
- fetchPrivacySettings: (force?: boolean) => Promise<{
22
- [_: string]: string;
23
- }>;
24
- updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
25
- sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>;
26
- groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
27
- groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
28
- groupLeave: (id: string) => Promise<void>;
29
- groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
30
- groupRequestParticipantsList: (jid: string) => Promise<{
31
- [key: string]: string;
32
- }[]>;
33
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
34
- status: string;
35
- jid: string;
36
- }[]>;
37
- groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
38
- status: string;
39
- jid: string;
40
- content: BinaryNode;
41
- }[]>;
42
- groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
43
- groupInviteCode: (jid: string) => Promise<string | undefined>;
44
- groupRevokeInvite: (jid: string) => Promise<string | undefined>;
45
- groupAcceptInvite: (code: string) => Promise<string | undefined>;
46
- groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
47
- groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
48
- groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
49
- groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
50
- groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
51
- groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
52
- groupFetchAllParticipating: () => Promise<{
53
- [_: string]: import("../Types").GroupMetadata;
54
- }>;
55
- processingMutex: {
56
- mutex<T>(code: () => T | Promise<T>): Promise<T>;
57
- };
58
- upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
59
- appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
60
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
61
- presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
62
- profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
63
- onWhatsApp: (...jids: string[]) => Promise<{
64
- exists: boolean;
65
- jid: string;
66
- }[]>;
67
- fetchBlocklist: () => Promise<string[]>;
68
- fetchStatus: (jid: string) => Promise<{
69
- status: string | undefined;
70
- setAt: Date;
71
- } | undefined>;
72
- updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
73
- removeProfilePicture: (jid: string) => Promise<void>;
74
- updateProfileStatus: (status: string) => Promise<void>;
75
- updateProfileName: (name: string) => Promise<void>;
76
- updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
77
- updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
78
- updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
79
- updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
80
- updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
81
- updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
82
- updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
83
- updateDefaultDisappearingMode: (duration: number) => Promise<void>;
84
- getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
85
- resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
86
- chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
87
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
88
- addChatLabel: (jid: string, labelId: string) => Promise<void>;
89
- removeChatLabel: (jid: string, labelId: string) => Promise<void>;
90
- addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
91
- removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
92
- star: (jid: string, messages: {
93
- id: string;
94
- fromMe?: boolean | undefined;
95
- }[], star: boolean) => Promise<void>;
96
- type: "md";
97
- ws: any;
98
- ev: import("../Types").BaileysEventEmitter & {
99
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
100
- buffer(): void;
101
- createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
102
- flush(force?: boolean | undefined): boolean;
103
- isBuffering(): boolean;
104
- };
105
- authState: {
106
- creds: import("../Types").AuthenticationCreds;
107
- keys: import("../Types").SignalKeyStoreWithTransaction;
108
- };
109
- signalRepository: import("../Types").SignalRepository;
110
- user: import("../Types").Contact | undefined;
111
- generateMessageTag: () => string;
112
- query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
113
- waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
114
- waitForSocketOpen: () => Promise<void>;
115
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
116
- sendNode: (frame: BinaryNode) => Promise<void>;
117
- logout: (msg?: string | undefined) => Promise<void>;
118
- end: (error: Error | undefined) => void;
119
- onUnexpectedError: (err: Error | Boom<any>, msg: string) => void;
120
- uploadPreKeys: (count?: number) => Promise<void>;
121
- uploadPreKeysToServerIfRequired: () => Promise<void>;
122
- requestPairingCode: (phoneNumber: string) => Promise<string>;
123
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
124
- };