angularsockets 1.0.3 → 1.4.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 (156) hide show
  1. package/LICENSE +21 -0
  2. package/README.MD +170 -0
  3. package/README.md +1 -1900
  4. package/WAProto/GenerateStatics.sh +4 -0
  5. package/WAProto/WAProto.proto +4775 -0
  6. package/WAProto/index.d.ts +4798 -124
  7. package/WAProto/index.js +14270 -302
  8. package/WAProto/index.ts.ts +53473 -0
  9. package/engine-requirements.js +10 -0
  10. package/lib/Defaults/baileys-version.json +1 -1
  11. package/lib/Defaults/index.d.ts +4 -6
  12. package/lib/Defaults/index.js +4 -6
  13. package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
  14. package/lib/Signal/Group/ciphertext-message.js +15 -0
  15. package/lib/Signal/Group/group-session-builder.d.ts +14 -0
  16. package/lib/Signal/Group/group-session-builder.js +64 -0
  17. package/lib/Signal/Group/group_cipher.d.ts +17 -0
  18. package/lib/Signal/Group/group_cipher.js +96 -0
  19. package/lib/Signal/Group/index.d.ts +11 -0
  20. package/lib/Signal/Group/index.js +57 -0
  21. package/lib/Signal/Group/keyhelper.d.ts +10 -0
  22. package/lib/Signal/Group/keyhelper.js +55 -0
  23. package/lib/Signal/Group/queue-job.d.ts +1 -0
  24. package/lib/Signal/Group/queue-job.js +57 -0
  25. package/lib/Signal/Group/sender-chain-key.d.ts +13 -0
  26. package/lib/Signal/Group/sender-chain-key.js +34 -0
  27. package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
  28. package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
  29. package/lib/Signal/Group/sender-key-message.d.ts +18 -0
  30. package/lib/Signal/Group/sender-key-message.js +69 -0
  31. package/lib/Signal/Group/sender-key-name.d.ts +17 -0
  32. package/lib/Signal/Group/sender-key-name.js +51 -0
  33. package/lib/Signal/Group/sender-key-record.d.ts +30 -0
  34. package/lib/Signal/Group/sender-key-record.js +53 -0
  35. package/lib/Signal/Group/sender-key-state.d.ts +38 -0
  36. package/lib/Signal/Group/sender-key-state.js +99 -0
  37. package/lib/Signal/Group/sender-message-key.d.ts +11 -0
  38. package/{WASignalGroup/sender_message_key.js → lib/Signal/Group/sender-message-key.js} +6 -16
  39. package/lib/Signal/libsignal.js +51 -29
  40. package/lib/Socket/Client/index.d.ts +2 -3
  41. package/lib/Socket/Client/index.js +2 -3
  42. package/lib/Socket/Client/{abstract-socket-client.d.ts → types.d.ts} +1 -2
  43. package/lib/Socket/Client/{web-socket-client.d.ts → websocket.d.ts} +2 -1
  44. package/lib/Socket/Client/{web-socket-client.js → websocket.js} +54 -5
  45. package/lib/Socket/RHandler.d.ts +416 -0
  46. package/lib/Socket/RHandler.js +530 -0
  47. package/lib/Socket/business.d.ts +39 -37
  48. package/lib/Socket/chats.d.ts +36 -23
  49. package/lib/Socket/chats.js +74 -116
  50. package/lib/Socket/groups.d.ts +42 -33
  51. package/lib/Socket/groups.js +26 -9
  52. package/lib/Socket/index.d.ts +39 -39
  53. package/lib/Socket/index.js +2 -2
  54. package/lib/Socket/messages-recv.d.ts +37 -34
  55. package/lib/Socket/messages-recv.js +111 -29
  56. package/lib/Socket/messages-send.d.ts +50 -53
  57. package/lib/Socket/messages-send.js +213 -397
  58. package/lib/Socket/newsletter.d.ts +25 -21
  59. package/lib/Socket/newsletter.js +92 -25
  60. package/lib/Socket/socket.d.ts +10 -11
  61. package/lib/Socket/socket.js +34 -23
  62. package/lib/Socket/usync.d.ts +11 -12
  63. package/lib/Store/index.d.ts +1 -2
  64. package/lib/Store/index.js +1 -3
  65. package/lib/Store/make-in-memory-store.d.ts +22 -22
  66. package/lib/Store/make-in-memory-store.js +21 -13
  67. package/lib/Store/make-ordered-dictionary.d.ts +1 -1
  68. package/lib/Types/Auth.d.ts +0 -6
  69. package/lib/Types/Chat.d.ts +6 -4
  70. package/lib/Types/Contact.d.ts +5 -1
  71. package/lib/Types/Events.d.ts +27 -0
  72. package/lib/Types/GroupMetadata.d.ts +8 -0
  73. package/lib/Types/Label.d.ts +0 -11
  74. package/lib/Types/Message.d.ts +59 -90
  75. package/lib/Types/Message.js +0 -2
  76. package/lib/Types/Newsletter.d.ts +97 -86
  77. package/lib/Types/Newsletter.js +38 -32
  78. package/lib/Types/Socket.d.ts +10 -7
  79. package/lib/Types/index.d.ts +1 -3
  80. package/lib/Types/index.js +1 -1
  81. package/lib/Utils/audioToBuffer.js +29 -0
  82. package/lib/Utils/auth-utils.d.ts +3 -3
  83. package/lib/Utils/auth-utils.js +13 -41
  84. package/lib/Utils/business.d.ts +1 -1
  85. package/lib/Utils/chat-utils.d.ts +12 -12
  86. package/lib/Utils/chat-utils.js +4 -19
  87. package/lib/Utils/crypto.d.ts +15 -15
  88. package/lib/Utils/crypto.js +6 -12
  89. package/lib/Utils/decode-wa-message.d.ts +5 -6
  90. package/lib/Utils/decode-wa-message.js +28 -55
  91. package/lib/Utils/event-buffer.d.ts +2 -2
  92. package/lib/Utils/event-buffer.js +2 -1
  93. package/lib/Utils/generics.d.ts +12 -11
  94. package/lib/Utils/generics.js +64 -38
  95. package/lib/Utils/history.d.ts +2 -2
  96. package/lib/Utils/history.js +1 -1
  97. package/lib/Utils/index.d.ts +2 -0
  98. package/lib/Utils/index.js +3 -0
  99. package/lib/Utils/link-preview.d.ts +2 -2
  100. package/lib/Utils/link-preview.js +34 -1
  101. package/lib/Utils/logger.d.ts +10 -1
  102. package/lib/Utils/lt-hash.d.ts +2 -2
  103. package/lib/Utils/lt-hash.js +6 -6
  104. package/lib/Utils/messages-media.d.ts +40 -29
  105. package/lib/Utils/messages-media.js +276 -110
  106. package/lib/Utils/messages.d.ts +8 -10
  107. package/lib/Utils/messages.js +126 -317
  108. package/lib/Utils/noise-handler.d.ts +10 -11
  109. package/lib/Utils/noise-handler.js +3 -13
  110. package/lib/Utils/process-message.d.ts +3 -2
  111. package/lib/Utils/process-message.js +17 -5
  112. package/lib/Utils/signal.js +2 -8
  113. package/lib/Utils/streamToBuffer.js +15 -0
  114. package/lib/Utils/use-multi-file-auth-state.js +72 -242
  115. package/lib/Utils/validate-connection.d.ts +2 -3
  116. package/lib/Utils/validate-connection.js +19 -51
  117. package/lib/WABinary/constants.d.ts +4 -4
  118. package/lib/WABinary/constants.js +1276 -13
  119. package/lib/WABinary/decode.d.ts +2 -2
  120. package/lib/WABinary/decode.js +3 -2
  121. package/lib/WABinary/encode.js +5 -7
  122. package/lib/WABinary/generic-utils.d.ts +2 -2
  123. package/lib/WABinary/jid-utils.d.ts +9 -4
  124. package/lib/WABinary/jid-utils.js +26 -5
  125. package/lib/WABinary/jid-utils.js.bak +83 -0
  126. package/lib/WAM/encode.d.ts +1 -1
  127. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +1 -1
  128. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +3 -3
  129. package/lib/WAUSync/USyncUser.d.ts +2 -0
  130. package/lib/index.d.ts +16 -0
  131. package/lib/index.js +48 -4
  132. package/lib/index.js.bak +56 -0
  133. package/package.json +43 -35
  134. package/WASignalGroup/GroupProtocol.js +0 -1697
  135. package/WASignalGroup/ciphertext_message.js +0 -16
  136. package/WASignalGroup/group_cipher.js +0 -120
  137. package/WASignalGroup/group_session_builder.js +0 -46
  138. package/WASignalGroup/index.js +0 -5
  139. package/WASignalGroup/keyhelper.js +0 -21
  140. package/WASignalGroup/protobufs.js +0 -3
  141. package/WASignalGroup/queue_job.js +0 -69
  142. package/WASignalGroup/sender_chain_key.js +0 -50
  143. package/WASignalGroup/sender_key_distribution_message.js +0 -78
  144. package/WASignalGroup/sender_key_message.js +0 -92
  145. package/WASignalGroup/sender_key_name.js +0 -70
  146. package/WASignalGroup/sender_key_record.js +0 -56
  147. package/WASignalGroup/sender_key_state.js +0 -129
  148. package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
  149. package/lib/Socket/Client/mobile-socket-client.js +0 -65
  150. package/lib/Socket/registration.d.ts +0 -264
  151. package/lib/Socket/registration.js +0 -166
  152. package/lib/Store/make-cache-manager-store.d.ts +0 -14
  153. package/lib/Store/make-cache-manager-store.js +0 -83
  154. package/lib/Utils/use-single-file-auth-state.d.ts +0 -12
  155. package/lib/Utils/use-single-file-auth-state.js +0 -75
  156. /package/lib/Socket/Client/{abstract-socket-client.js → types.js} +0 -0
@@ -1,11 +1,11 @@
1
1
  import { GetCatalogOptions, ProductCreate, ProductUpdate, SocketConfig } from '../Types';
2
2
  import { BinaryNode } from '../WABinary';
3
3
  export declare const makeBusinessSocket: (config: SocketConfig) => {
4
- logger: Logger;
4
+ logger: import("../Utils/logger").ILogger;
5
5
  getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
6
6
  getCatalog: ({ jid, limit, cursor }: GetCatalogOptions) => Promise<{
7
7
  products: import("../Types").Product[];
8
- nextPageCursor: any;
8
+ nextPageCursor: string | undefined;
9
9
  }>;
10
10
  getCollections: (jid?: string, limit?: number) => Promise<{
11
11
  collections: import("../Types").CatalogCollection[];
@@ -17,35 +17,33 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
17
17
  productUpdate: (productId: string, update: ProductUpdate) => Promise<import("../Types").Product>;
18
18
  sendMessageAck: ({ tag, attrs, content }: BinaryNode, errorCode?: number) => Promise<void>;
19
19
  sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
20
+ rejectCall: (callId: string, callFrom: string) => Promise<void>;
20
21
  offerCall: (toJid: string, isVideo?: boolean) => Promise<{
21
- id: any;
22
- to: string;
22
+ callId: string;
23
+ toJid: string;
24
+ isVideo: boolean;
23
25
  }>;
24
- rejectCall: (callId: string, callFrom: string) => Promise<void>;
25
- fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number) => Promise<string>;
26
+ fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>;
26
27
  requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
27
- getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
28
+ getPrivacyTokens: (jids: string[]) => Promise<any>;
28
29
  assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
29
- relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
30
+ relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
30
31
  sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
31
32
  sendReceipts: (keys: import("../Types").WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
32
- getButtonArgs: (message: import("../Types").WAProto.IMessage) => BinaryNode["attrs"];
33
33
  readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
34
34
  refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
35
+ waUploadToServer: import("../Types").WAMediaUploadFunction;
36
+ fetchPrivacySettings: (force?: boolean) => Promise<{
37
+ [_: string]: string;
38
+ }>;
35
39
  getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
36
- sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
37
40
  createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: BinaryNode["attrs"]) => Promise<{
38
41
  nodes: BinaryNode[];
39
42
  shouldIncludeDeviceIdentity: boolean;
40
43
  }>;
41
- waUploadToServer: import("../Types").WAMediaUploadFunction;
42
- fetchPrivacySettings: (force?: boolean) => Promise<{
43
- [_: string]: string;
44
- }>;
44
+ sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
45
45
  updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
46
- sendStatusMentions: (content: import("../Types").AnyMessageContent, jids?: string[]) => Promise<import("../Types").WAProto.WebMessageInfo>;
47
- sendAlbumMessage: (jid: string, medias: import("../Types").Media[], options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
48
- sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
46
+ sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
49
47
  subscribeNewsletterUpdates: (jid: string) => Promise<{
50
48
  duration: string;
51
49
  }>;
@@ -58,16 +56,16 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
58
56
  newsletterFollow: (jid: string) => Promise<void>;
59
57
  newsletterUnmute: (jid: string) => Promise<void>;
60
58
  newsletterMute: (jid: string) => Promise<void>;
61
- newsletterAction: (jid: string, type: "follow" | "unfollow" | "mute" | "unmute") => Promise<void>;
62
- newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
59
+ newsletterCreate: (name: string, description?: string, picture?: import("../Types").WAMediaUpload) => Promise<import("../Types").NewsletterMetadata>;
63
60
  newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
64
61
  newsletterAdminCount: (jid: string) => Promise<number>;
65
62
  newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
66
63
  newsletterDemote: (jid: string, user: string) => Promise<void>;
67
64
  newsletterDelete: (jid: string) => Promise<void>;
68
- newsletterReactMessage: (jid: string, serverId: string, code?: string) => Promise<void>;
65
+ newsletterReactMessage: (jid: string, server_id: string, code?: string) => Promise<void>;
69
66
  newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
70
67
  newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
68
+ groupQuery: (jid: string, type: "get" | "set", content: BinaryNode[]) => Promise<any>;
71
69
  groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
72
70
  groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
73
71
  groupLeave: (id: string) => Promise<void>;
@@ -88,7 +86,8 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
88
86
  groupInviteCode: (jid: string) => Promise<string | undefined>;
89
87
  groupRevokeInvite: (jid: string) => Promise<string | undefined>;
90
88
  groupAcceptInvite: (code: string) => Promise<string | undefined>;
91
- groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
89
+ groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
90
+ groupAcceptInviteV4: (key: string | import("../Types").WAMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<any>;
92
91
  groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
93
92
  groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
94
93
  groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
@@ -97,37 +96,39 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
97
96
  groupFetchAllParticipating: () => Promise<{
98
97
  [_: string]: import("../Types").GroupMetadata;
99
98
  }>;
99
+ getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
100
100
  processingMutex: {
101
101
  mutex<T>(code: () => Promise<T> | T): Promise<T>;
102
102
  };
103
- upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
103
+ upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
104
104
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
105
105
  sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
106
106
  presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
107
107
  profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
108
108
  onWhatsApp: (...jids: string[]) => Promise<{
109
- exists: boolean;
110
109
  jid: string;
111
- }[]>;
110
+ exists: unknown;
111
+ lid: unknown;
112
+ }[] | undefined>;
112
113
  fetchBlocklist: () => Promise<string[]>;
113
- fetchStatus: (jid: string) => Promise<{
114
- status: string | undefined;
115
- setAt: Date;
116
- } | undefined>;
114
+ fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
115
+ fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
117
116
  updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
118
117
  removeProfilePicture: (jid: string) => Promise<void>;
119
118
  updateProfileStatus: (status: string) => Promise<void>;
120
119
  updateProfileName: (name: string) => Promise<void>;
121
120
  updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
121
+ updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
122
+ updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
122
123
  updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
123
124
  updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
124
125
  updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
125
126
  updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
126
127
  updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
127
- updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
128
+ updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
128
129
  updateDefaultDisappearingMode: (duration: number) => Promise<void>;
129
130
  getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
130
- resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
131
+ resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
131
132
  chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
132
133
  cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
133
134
  addChatLabel: (jid: string, labelId: string) => Promise<void>;
@@ -138,8 +139,9 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
138
139
  id: string;
139
140
  fromMe?: boolean;
140
141
  }[], star: boolean) => Promise<void>;
142
+ executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
141
143
  type: "md";
142
- ws: any;
144
+ ws: import("./Client").WebSocketClient;
143
145
  ev: import("../Types").BaileysEventEmitter & {
144
146
  process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
145
147
  buffer(): void;
@@ -154,17 +156,17 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
154
156
  signalRepository: import("../Types").SignalRepository;
155
157
  user: import("../Types").Contact | undefined;
156
158
  generateMessageTag: () => string;
157
- query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>;
158
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
159
+ query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
160
+ waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
159
161
  waitForSocketOpen: () => Promise<void>;
160
162
  sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
161
163
  sendNode: (frame: BinaryNode) => Promise<void>;
162
164
  logout: (msg?: string) => Promise<void>;
163
165
  end: (error: Error | undefined) => void;
164
- onUnexpectedError: (err: Error | Boom, msg: string) => void;
166
+ onUnexpectedError: (err: Error | import("@hapi/boom").Boom, msg: string) => void;
165
167
  uploadPreKeys: (count?: number) => Promise<void>;
166
168
  uploadPreKeysToServerIfRequired: () => Promise<void>;
167
- requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
168
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
169
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
169
+ requestPairingCode: (phoneNumber: any, pairKey?: string) => Promise<string>;
170
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
171
+ sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
170
172
  };
@@ -1,45 +1,46 @@
1
- /// <reference types="node" />
2
1
  import { Boom } from '@hapi/boom';
3
- import { proto } from '../../WAProto';
4
- import { ChatModification, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload, WAPatchCreate, WAPresence, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types';
2
+ import { BotListInfo, ChatModification, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload, WAMessage, WAPatchCreate, WAPresence, WAPrivacyCallValue, WAPrivacyGroupAddValue, WAPrivacyMessagesValue, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types';
5
3
  import { BinaryNode } from '../WABinary';
6
4
  import { USyncQuery } from '../WAUSync';
7
5
  export declare const makeChatsSocket: (config: SocketConfig) => {
8
- interactiveQuery: (userNodes: BinaryNode[], queryNode: BinaryNode) => Promise<BinaryNode[]>;
6
+ getBotListV2: () => Promise<BotListInfo[]>;
9
7
  processingMutex: {
10
- mutex<T>(code: () => T | Promise<T>): Promise<T>;
8
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
11
9
  };
12
10
  fetchPrivacySettings: (force?: boolean) => Promise<{
13
11
  [_: string]: string;
14
12
  }>;
15
- upsertMessage: (msg: proto.IWebMessageInfo, type: MessageUpsertType) => Promise<void>;
13
+ upsertMessage: (msg: WAMessage, type: MessageUpsertType) => Promise<void>;
16
14
  appPatch: (patchCreate: WAPatchCreate) => Promise<void>;
17
- fetchUserLid: (jid: string) => Promise<string | undefined>;
18
15
  sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>;
19
16
  presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
17
+ profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
20
18
  onWhatsApp: (...jids: string[]) => Promise<{
21
19
  jid: string;
22
20
  exists: unknown;
21
+ lid: unknown;
23
22
  }[] | undefined>;
24
23
  fetchBlocklist: () => Promise<string[]>;
25
- fetchStatus: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
26
24
  fetchDisappearingDuration: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
25
+ fetchStatus: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
27
26
  updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>;
28
27
  removeProfilePicture: (jid: string) => Promise<void>;
29
28
  updateProfileStatus: (status: string) => Promise<void>;
30
29
  updateProfileName: (name: string) => Promise<void>;
31
- updateBlockStatus: (jid: string, action: 'block' | 'unblock') => Promise<void>;
30
+ updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
31
+ updateCallPrivacy: (value: WAPrivacyCallValue) => Promise<void>;
32
+ updateMessagesPrivacy: (value: WAPrivacyMessagesValue) => Promise<void>;
32
33
  updateLastSeenPrivacy: (value: WAPrivacyValue) => Promise<void>;
33
34
  updateOnlinePrivacy: (value: WAPrivacyOnlineValue) => Promise<void>;
34
35
  updateProfilePicturePrivacy: (value: WAPrivacyValue) => Promise<void>;
35
36
  updateStatusPrivacy: (value: WAPrivacyValue) => Promise<void>;
36
37
  updateReadReceiptsPrivacy: (value: WAReadReceiptsValue) => Promise<void>;
37
- updateGroupsAddPrivacy: (value: WAPrivacyValue) => Promise<void>;
38
+ updateGroupsAddPrivacy: (value: WAPrivacyGroupAddValue) => Promise<void>;
38
39
  updateDefaultDisappearingMode: (duration: number) => Promise<void>;
39
40
  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
+ resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
41
42
  chatModify: (mod: ChatModification, jid: string) => Promise<void>;
42
- cleanDirtyBits: (type: 'account_sync' | 'groups', fromTimestamp?: number | string) => Promise<void>;
43
+ cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
43
44
  addChatLabel: (jid: string, labelId: string) => Promise<void>;
44
45
  removeChatLabel: (jid: string, labelId: string) => Promise<void>;
45
46
  addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
@@ -48,14 +49,26 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
48
49
  id: string;
49
50
  fromMe?: boolean;
50
51
  }[], star: boolean) => Promise<void>;
52
+ /**
53
+ * Custom: checkStatusWA (for legacy Baileys)
54
+ * - Mengecek apakah nomor WA aktif / dibanned
55
+ * - Mengambil bio/status jika masih aktif
56
+ */
57
+ checkStatusWA: (numberOrJid: string) => Promise<{
58
+ jid: string
59
+ IsBanned: boolean
60
+ Statusbio: string | null
61
+ setAt: Date | null
62
+ error?: string
63
+ }>,
51
64
  executeUSyncQuery: (usyncQuery: USyncQuery) => Promise<import("../WAUSync").USyncQueryResult | undefined>;
52
65
  type: "md";
53
- ws: any;
66
+ ws: import("./Client").WebSocketClient;
54
67
  ev: import("../Types").BaileysEventEmitter & {
55
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
68
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
56
69
  buffer(): void;
57
- createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
58
- flush(force?: boolean | undefined): boolean;
70
+ createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
71
+ flush(force?: boolean): boolean;
59
72
  isBuffering(): boolean;
60
73
  };
61
74
  authState: {
@@ -65,17 +78,17 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
65
78
  signalRepository: import("../Types").SignalRepository;
66
79
  user: import("../Types").Contact | undefined;
67
80
  generateMessageTag: () => string;
68
- query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
69
- waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
81
+ query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
82
+ waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
70
83
  waitForSocketOpen: () => Promise<void>;
71
84
  sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
72
85
  sendNode: (frame: BinaryNode) => Promise<void>;
73
- logout: (msg?: string | undefined) => Promise<void>;
86
+ logout: (msg?: string) => Promise<void>;
74
87
  end: (error: Error | undefined) => void;
75
- onUnexpectedError: (err: Error | Boom<any>, msg: string) => void;
88
+ onUnexpectedError: (err: Error | Boom, msg: string) => void;
76
89
  uploadPreKeys: (count?: number) => Promise<void>;
77
90
  uploadPreKeysToServerIfRequired: () => Promise<void>;
78
- requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
79
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
80
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
91
+ requestPairingCode: (phoneNumber: any, pairKey?: string) => Promise<string>;
92
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
93
+ sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
81
94
  };