@mrlegendbot/baileys 1.2.3 → 1.2.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 (212) hide show
  1. package/README.upstream.md +1312 -0
  2. package/WAProto/WAProto.json +1 -0
  3. package/WAProto/WAProto.proto +6275 -0
  4. package/WAProto/compiler.js +550 -0
  5. package/WAProto/index.js +2 -97691
  6. package/lib/Defaults/index.js +89 -92
  7. package/lib/Signal/Group/ciphertext-message.js +9 -10
  8. package/lib/Signal/Group/group-session-builder.js +21 -22
  9. package/lib/Signal/Group/group_cipher.js +75 -69
  10. package/lib/Signal/Group/index.js +0 -1
  11. package/lib/Signal/Group/keyhelper.js +9 -10
  12. package/lib/Signal/Group/sender-chain-key.js +21 -22
  13. package/lib/Signal/Group/sender-key-distribution-message.js +51 -60
  14. package/lib/Signal/Group/sender-key-message.js +56 -62
  15. package/lib/Signal/Group/sender-key-name.js +38 -40
  16. package/lib/Signal/Group/sender-key-record.js +33 -34
  17. package/lib/Signal/Group/sender-key-state.js +72 -76
  18. package/lib/Signal/Group/sender-message-key.js +22 -23
  19. package/lib/Signal/libsignal.js +506 -405
  20. package/lib/Signal/lid-mapping.js +276 -258
  21. package/lib/Socket/Client/index.js +0 -1
  22. package/lib/Socket/Client/types.js +6 -7
  23. package/lib/Socket/Client/websocket.js +48 -49
  24. package/lib/Socket/business.js +349 -369
  25. package/lib/Socket/chats.js +1172 -1148
  26. package/lib/Socket/communities.js +473 -413
  27. package/lib/Socket/groups.js +387 -331
  28. package/lib/Socket/index.js +6 -8
  29. package/lib/Socket/messages-recv.js +1782 -1719
  30. package/lib/Socket/messages-send.js +1554 -2450
  31. package/lib/Socket/mex.js +40 -35
  32. package/lib/Socket/newsletter.js +239 -191
  33. package/lib/Socket/socket.js +992 -923
  34. package/lib/Store/index.js +8 -0
  35. package/lib/Store/keyed-db.js +108 -0
  36. package/lib/Store/make-cache-manager-store.js +70 -0
  37. package/lib/Store/make-in-memory-store.js +417 -0
  38. package/lib/Store/make-ordered-dictionary.js +69 -0
  39. package/lib/Store/object-repository.js +27 -0
  40. package/lib/Types/Auth.js +0 -1
  41. package/lib/Types/Bussines.js +0 -1
  42. package/lib/Types/Call.js +0 -1
  43. package/lib/Types/Chat.js +1 -8
  44. package/lib/Types/Contact.js +0 -1
  45. package/lib/Types/Events.js +1 -2
  46. package/lib/Types/GroupMetadata.js +0 -1
  47. package/lib/Types/Label.js +20 -22
  48. package/lib/Types/LabelAssociation.js +2 -4
  49. package/lib/Types/Message.js +3 -5
  50. package/lib/Types/Mex.js +26 -31
  51. package/lib/Types/Product.js +0 -1
  52. package/lib/Types/Signal.js +1 -2
  53. package/lib/Types/Socket.js +2 -3
  54. package/lib/Types/State.js +4 -52
  55. package/lib/Types/USync.js +0 -1
  56. package/lib/Types/index.js +10 -11
  57. package/lib/Utils/auth-utils.js +240 -277
  58. package/lib/Utils/browser-utils.js +20 -23
  59. package/lib/Utils/business.js +200 -204
  60. package/lib/Utils/chat-utils.js +836 -810
  61. package/lib/Utils/companion-reg-client-utils.js +23 -25
  62. package/lib/Utils/crypto.js +70 -86
  63. package/lib/Utils/decode-wa-message.js +277 -284
  64. package/lib/Utils/event-buffer.js +592 -595
  65. package/lib/Utils/generics.js +312 -335
  66. package/lib/Utils/history.js +123 -115
  67. package/lib/Utils/index.js +1 -2
  68. package/lib/Utils/link-preview.js +74 -73
  69. package/lib/Utils/logger.js +3 -2
  70. package/lib/Utils/lt-hash.js +0 -6
  71. package/lib/Utils/make-mutex.js +27 -27
  72. package/lib/Utils/message-retry-manager.js +213 -254
  73. package/lib/Utils/messages-media.js +741 -715
  74. package/lib/Utils/messages.js +791 -827
  75. package/lib/Utils/noise-handler.js +215 -187
  76. package/lib/Utils/pre-key-manager.js +69 -98
  77. package/lib/Utils/process-message.js +617 -586
  78. package/lib/Utils/reporting-utils.js +553 -234
  79. package/lib/Utils/signal.js +217 -170
  80. package/lib/Utils/stanza-ack.js +27 -35
  81. package/lib/Utils/sync-action-utils.js +37 -41
  82. package/lib/Utils/tc-token-utils.js +120 -141
  83. package/lib/Utils/use-multi-file-auth-state.js +87 -105
  84. package/lib/Utils/use-sqlite-auth-state.js +162 -0
  85. package/lib/Utils/validate-connection.js +190 -188
  86. package/lib/WABinary/constants.js +28 -1294
  87. package/lib/WABinary/decode.js +245 -249
  88. package/lib/WABinary/encode.js +201 -206
  89. package/lib/WABinary/generic-utils.js +86 -89
  90. package/lib/WABinary/index.js +0 -1
  91. package/lib/WABinary/jid-utils.js +68 -77
  92. package/lib/WABinary/types.js +0 -1
  93. package/lib/WAM/BinaryInfo.js +7 -8
  94. package/lib/WAM/constants.js +19892 -22853
  95. package/lib/WAM/encode.js +121 -132
  96. package/lib/WAM/index.js +0 -1
  97. package/lib/WAUSync/Protocols/USyncContactProtocol.js +46 -43
  98. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +47 -48
  99. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +22 -23
  100. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +30 -33
  101. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +19 -20
  102. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +53 -44
  103. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +24 -24
  104. package/lib/WAUSync/Protocols/index.js +0 -1
  105. package/lib/WAUSync/USyncQuery.js +79 -88
  106. package/lib/WAUSync/USyncUser.js +28 -29
  107. package/lib/WAUSync/index.js +0 -1
  108. package/lib/index.js +2 -2
  109. package/package.json +22 -86
  110. package/WAProto/GenerateStatics.sh +0 -3
  111. package/WAProto/fix-imports.js +0 -85
  112. package/WAProto/index.d.ts +0 -14017
  113. package/lib/Defaults/index.d.ts +0 -75
  114. package/lib/Signal/Group/ciphertext-message.d.ts +0 -10
  115. package/lib/Signal/Group/group-session-builder.d.ts +0 -15
  116. package/lib/Signal/Group/group_cipher.d.ts +0 -17
  117. package/lib/Signal/Group/index.d.ts +0 -12
  118. package/lib/Signal/Group/keyhelper.d.ts +0 -11
  119. package/lib/Signal/Group/sender-chain-key.d.ts +0 -14
  120. package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -17
  121. package/lib/Signal/Group/sender-key-message.d.ts +0 -19
  122. package/lib/Signal/Group/sender-key-name.d.ts +0 -18
  123. package/lib/Signal/Group/sender-key-record.d.ts +0 -31
  124. package/lib/Signal/Group/sender-key-state.d.ts +0 -39
  125. package/lib/Signal/Group/sender-message-key.d.ts +0 -12
  126. package/lib/Signal/libsignal.d.ts +0 -5
  127. package/lib/Signal/lid-mapping.d.ts +0 -23
  128. package/lib/Socket/Client/index.d.ts +0 -3
  129. package/lib/Socket/Client/types.d.ts +0 -16
  130. package/lib/Socket/Client/websocket.d.ts +0 -13
  131. package/lib/Socket/business.d.ts +0 -217
  132. package/lib/Socket/chats.d.ts +0 -125
  133. package/lib/Socket/communities.d.ts +0 -273
  134. package/lib/Socket/groups.d.ts +0 -161
  135. package/lib/Socket/index.d.ts +0 -260
  136. package/lib/Socket/messages-recv.d.ts +0 -203
  137. package/lib/Socket/messages-send.d.ts +0 -199
  138. package/lib/Socket/mex.d.ts +0 -3
  139. package/lib/Socket/newsletter.d.ts +0 -170
  140. package/lib/Socket/socket.d.ts +0 -59
  141. package/lib/Types/Auth.d.ts +0 -117
  142. package/lib/Types/Bussines.d.ts +0 -25
  143. package/lib/Types/Call.d.ts +0 -15
  144. package/lib/Types/Chat.d.ts +0 -124
  145. package/lib/Types/Contact.d.ts +0 -26
  146. package/lib/Types/Events.d.ts +0 -256
  147. package/lib/Types/GroupMetadata.d.ts +0 -71
  148. package/lib/Types/Label.d.ts +0 -47
  149. package/lib/Types/LabelAssociation.d.ts +0 -30
  150. package/lib/Types/Message.d.ts +0 -320
  151. package/lib/Types/Mex.d.ts +0 -141
  152. package/lib/Types/Product.d.ts +0 -79
  153. package/lib/Types/Signal.d.ts +0 -87
  154. package/lib/Types/Socket.d.ts +0 -136
  155. package/lib/Types/State.d.ts +0 -97
  156. package/lib/Types/USync.d.ts +0 -26
  157. package/lib/Types/index.d.ts +0 -66
  158. package/lib/Utils/auth-utils.d.ts +0 -24
  159. package/lib/Utils/browser-utils.d.ts +0 -4
  160. package/lib/Utils/business.d.ts +0 -23
  161. package/lib/Utils/chat-utils.d.ts +0 -100
  162. package/lib/Utils/companion-reg-client-utils.d.ts +0 -17
  163. package/lib/Utils/crypto.d.ts +0 -37
  164. package/lib/Utils/decode-wa-message.d.ts +0 -66
  165. package/lib/Utils/event-buffer.d.ts +0 -36
  166. package/lib/Utils/generics.d.ts +0 -92
  167. package/lib/Utils/history.d.ts +0 -24
  168. package/lib/Utils/identity-change-handler.d.ts +0 -44
  169. package/lib/Utils/identity-change-handler.js +0 -50
  170. package/lib/Utils/index.d.ts +0 -22
  171. package/lib/Utils/link-preview.d.ts +0 -21
  172. package/lib/Utils/logger.d.ts +0 -12
  173. package/lib/Utils/lt-hash.d.ts +0 -8
  174. package/lib/Utils/make-mutex.d.ts +0 -9
  175. package/lib/Utils/message-retry-manager.d.ts +0 -115
  176. package/lib/Utils/messages-media.d.ts +0 -133
  177. package/lib/Utils/messages.d.ts +0 -91
  178. package/lib/Utils/noise-handler.d.ts +0 -20
  179. package/lib/Utils/offline-node-processor.d.ts +0 -17
  180. package/lib/Utils/offline-node-processor.js +0 -40
  181. package/lib/Utils/pre-key-manager.d.ts +0 -28
  182. package/lib/Utils/process-message.d.ts +0 -60
  183. package/lib/Utils/reporting-utils.d.ts +0 -11
  184. package/lib/Utils/signal.d.ts +0 -47
  185. package/lib/Utils/stanza-ack.d.ts +0 -11
  186. package/lib/Utils/sync-action-utils.d.ts +0 -19
  187. package/lib/Utils/tc-token-utils.d.ts +0 -37
  188. package/lib/Utils/use-multi-file-auth-state.d.ts +0 -13
  189. package/lib/Utils/validate-connection.d.ts +0 -11
  190. package/lib/WABinary/constants.d.ts +0 -28
  191. package/lib/WABinary/decode.d.ts +0 -7
  192. package/lib/WABinary/encode.d.ts +0 -3
  193. package/lib/WABinary/generic-utils.d.ts +0 -15
  194. package/lib/WABinary/index.d.ts +0 -6
  195. package/lib/WABinary/jid-utils.d.ts +0 -48
  196. package/lib/WABinary/types.d.ts +0 -19
  197. package/lib/WAM/BinaryInfo.d.ts +0 -9
  198. package/lib/WAM/constants.d.ts +0 -40
  199. package/lib/WAM/encode.d.ts +0 -3
  200. package/lib/WAM/index.d.ts +0 -4
  201. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -10
  202. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -23
  203. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -13
  204. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -13
  205. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +0 -10
  206. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -26
  207. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -10
  208. package/lib/WAUSync/Protocols/index.d.ts +0 -6
  209. package/lib/WAUSync/USyncQuery.d.ts +0 -30
  210. package/lib/WAUSync/USyncUser.d.ts +0 -17
  211. package/lib/WAUSync/index.d.ts +0 -4
  212. package/lib/index.d.ts +0 -12
@@ -1,75 +0,0 @@
1
- import { proto } from '../../WAProto/index.js';
2
- import type { SocketConfig } from '../Types/index.js';
3
- export declare const UNAUTHORIZED_CODES: number[];
4
- export declare const DEFAULT_ORIGIN = "https://web.whatsapp.com";
5
- export declare const CALL_VIDEO_PREFIX = "https://call.whatsapp.com/video/";
6
- export declare const CALL_AUDIO_PREFIX = "https://call.whatsapp.com/voice/";
7
- export declare const DEF_CALLBACK_PREFIX = "CB:";
8
- export declare const DEF_TAG_PREFIX = "TAG:";
9
- export declare const PHONE_CONNECTION_CB = "CB:Pong";
10
- export declare const WA_ADV_ACCOUNT_SIG_PREFIX: Buffer<ArrayBuffer>;
11
- export declare const WA_ADV_DEVICE_SIG_PREFIX: Buffer<ArrayBuffer>;
12
- export declare const WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX: Buffer<ArrayBuffer>;
13
- export declare const WA_ADV_HOSTED_DEVICE_SIG_PREFIX: Buffer<ArrayBuffer>;
14
- export declare const WA_DEFAULT_EPHEMERAL: number;
15
- /** Status messages older than 24 hours are considered expired */
16
- export declare const STATUS_EXPIRY_SECONDS: number;
17
- /** WA Web enforces a 14-day maximum age for placeholder resend requests */
18
- export declare const PLACEHOLDER_MAX_AGE_SECONDS: number;
19
- export declare const NOISE_MODE = "Noise_XX_25519_AESGCM_SHA256\0\0\0\0";
20
- export declare const DICT_VERSION = 3;
21
- export declare const KEY_BUNDLE_TYPE: Buffer<ArrayBuffer>;
22
- export declare const NOISE_WA_HEADER: Buffer<ArrayBuffer>;
23
- /** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
24
- export declare const URL_REGEX: RegExp;
25
- export declare const WA_CERT_DETAILS: {
26
- SERIAL: number;
27
- ISSUER: string;
28
- PUBLIC_KEY: Buffer<ArrayBuffer>;
29
- };
30
- export declare const PROCESSABLE_HISTORY_TYPES: proto.HistorySync.HistorySyncType[];
31
- export declare const DEFAULT_CACHE_TTLS: {
32
- SIGNAL_STORE: number;
33
- MSG_RETRY: number;
34
- CALL_OFFER: number;
35
- USER_DEVICES: number;
36
- };
37
- export declare const DEFAULT_CONNECTION_CONFIG: SocketConfig;
38
- export declare const MEDIA_PATH_MAP: {
39
- [T in MediaType]?: string;
40
- };
41
- export declare const MEDIA_HKDF_KEY_MAPPING: {
42
- audio: string;
43
- document: string;
44
- gif: string;
45
- image: string;
46
- ppic: string;
47
- product: string;
48
- ptt: string;
49
- sticker: string;
50
- video: string;
51
- 'thumbnail-document': string;
52
- 'thumbnail-image': string;
53
- 'thumbnail-video': string;
54
- 'thumbnail-link': string;
55
- 'md-msg-hist': string;
56
- 'md-app-state': string;
57
- 'product-catalog-image': string;
58
- 'payment-bg-image': string;
59
- ptv: string;
60
- 'biz-cover-photo': string;
61
- };
62
- export type MediaType = keyof typeof MEDIA_HKDF_KEY_MAPPING;
63
- export declare const MEDIA_KEYS: MediaType[];
64
- /** 120s timeout for history sync stall detection, same as WA Web's handleChunkProgress / restartPausedTimer (g = 120) */
65
- export declare const HISTORY_SYNC_PAUSED_TIMEOUT_MS = 120000;
66
- export declare const MIN_PREKEY_COUNT = 5;
67
- export declare const INITIAL_PREKEY_COUNT = 812;
68
- export declare const UPLOAD_TIMEOUT = 30000;
69
- export declare const TimeMs: {
70
- Minute: number;
71
- Hour: number;
72
- Day: number;
73
- Week: number;
74
- };
75
- //# sourceMappingURL=index.d.ts.map
@@ -1,10 +0,0 @@
1
- export declare class CiphertextMessage {
2
- readonly UNSUPPORTED_VERSION: number;
3
- readonly CURRENT_VERSION: number;
4
- readonly WHISPER_TYPE: number;
5
- readonly PREKEY_TYPE: number;
6
- readonly SENDERKEY_TYPE: number;
7
- readonly SENDERKEY_DISTRIBUTION_TYPE: number;
8
- readonly ENCRYPTED_MESSAGE_OVERHEAD: number;
9
- }
10
- //# sourceMappingURL=ciphertext-message.d.ts.map
@@ -1,15 +0,0 @@
1
- import { SenderKeyDistributionMessage } from './sender-key-distribution-message.js';
2
- import { SenderKeyName } from './sender-key-name.js';
3
- import { SenderKeyRecord } from './sender-key-record.js';
4
- interface SenderKeyStore {
5
- loadSenderKey(senderKeyName: SenderKeyName): Promise<SenderKeyRecord>;
6
- storeSenderKey(senderKeyName: SenderKeyName, record: SenderKeyRecord): Promise<void>;
7
- }
8
- export declare class GroupSessionBuilder {
9
- private readonly senderKeyStore;
10
- constructor(senderKeyStore: SenderKeyStore);
11
- process(senderKeyName: SenderKeyName, senderKeyDistributionMessage: SenderKeyDistributionMessage): Promise<void>;
12
- create(senderKeyName: SenderKeyName): Promise<SenderKeyDistributionMessage>;
13
- }
14
- export {};
15
- //# sourceMappingURL=group-session-builder.d.ts.map
@@ -1,17 +0,0 @@
1
- import { SenderKeyName } from './sender-key-name.js';
2
- import { SenderKeyRecord } from './sender-key-record.js';
3
- export interface SenderKeyStore {
4
- loadSenderKey(senderKeyName: SenderKeyName): Promise<SenderKeyRecord>;
5
- storeSenderKey(senderKeyName: SenderKeyName, record: SenderKeyRecord): Promise<void>;
6
- }
7
- export declare class GroupCipher {
8
- private readonly senderKeyStore;
9
- private readonly senderKeyName;
10
- constructor(senderKeyStore: SenderKeyStore, senderKeyName: SenderKeyName);
11
- encrypt(paddedPlaintext: Uint8Array): Promise<Uint8Array>;
12
- decrypt(senderKeyMessageBytes: Uint8Array): Promise<Uint8Array>;
13
- private getSenderKey;
14
- private getPlainText;
15
- private getCipherText;
16
- }
17
- //# sourceMappingURL=group_cipher.d.ts.map
@@ -1,12 +0,0 @@
1
- export { GroupSessionBuilder } from './group-session-builder.js';
2
- export { SenderKeyDistributionMessage } from './sender-key-distribution-message.js';
3
- export { SenderKeyRecord } from './sender-key-record.js';
4
- export { SenderKeyName } from './sender-key-name.js';
5
- export { GroupCipher } from './group_cipher.js';
6
- export { SenderKeyState } from './sender-key-state.js';
7
- export { SenderKeyMessage } from './sender-key-message.js';
8
- export { SenderMessageKey } from './sender-message-key.js';
9
- export { SenderChainKey } from './sender-chain-key.js';
10
- export { CiphertextMessage } from './ciphertext-message.js';
11
- export * as keyhelper from './keyhelper.js';
12
- //# sourceMappingURL=index.d.ts.map
@@ -1,11 +0,0 @@
1
- import { generateKeyPair } from 'libsignal/src/curve.js';
2
- type KeyPairType = ReturnType<typeof generateKeyPair>;
3
- export declare function generateSenderKey(): Buffer;
4
- export declare function generateSenderKeyId(): number;
5
- export interface SigningKeyPair {
6
- public: Buffer;
7
- private: Buffer;
8
- }
9
- export declare function generateSenderSigningKey(key?: KeyPairType): SigningKeyPair;
10
- export {};
11
- //# sourceMappingURL=keyhelper.d.ts.map
@@ -1,14 +0,0 @@
1
- import { SenderMessageKey } from './sender-message-key.js';
2
- export declare class SenderChainKey {
3
- private readonly MESSAGE_KEY_SEED;
4
- private readonly CHAIN_KEY_SEED;
5
- private readonly iteration;
6
- private readonly chainKey;
7
- constructor(iteration: number, chainKey: Uint8Array | Buffer);
8
- getIteration(): number;
9
- getSenderMessageKey(): SenderMessageKey;
10
- getNext(): SenderChainKey;
11
- getSeed(): Uint8Array;
12
- private getDerivative;
13
- }
14
- //# sourceMappingURL=sender-chain-key.d.ts.map
@@ -1,17 +0,0 @@
1
- import { CiphertextMessage } from './ciphertext-message.js';
2
- export declare class SenderKeyDistributionMessage extends CiphertextMessage {
3
- private readonly id;
4
- private readonly iteration;
5
- private readonly chainKey;
6
- private readonly signatureKey;
7
- private readonly serialized;
8
- constructor(id?: number | null, iteration?: number | null, chainKey?: Uint8Array | null, signatureKey?: Uint8Array | null, serialized?: Uint8Array | null);
9
- private intsToByteHighAndLow;
10
- serialize(): Uint8Array;
11
- getType(): number;
12
- getIteration(): number;
13
- getChainKey(): Uint8Array;
14
- getSignatureKey(): Uint8Array;
15
- getId(): number;
16
- }
17
- //# sourceMappingURL=sender-key-distribution-message.d.ts.map
@@ -1,19 +0,0 @@
1
- import { CiphertextMessage } from './ciphertext-message.js';
2
- export declare class SenderKeyMessage extends CiphertextMessage {
3
- private readonly SIGNATURE_LENGTH;
4
- private readonly messageVersion;
5
- private readonly keyId;
6
- private readonly iteration;
7
- private readonly ciphertext;
8
- private readonly signature;
9
- private readonly serialized;
10
- constructor(keyId?: number | null, iteration?: number | null, ciphertext?: Uint8Array | null, signatureKey?: Uint8Array | null, serialized?: Uint8Array | null);
11
- getKeyId(): number;
12
- getIteration(): number;
13
- getCipherText(): Uint8Array;
14
- verifySignature(signatureKey: Uint8Array): void;
15
- private getSignature;
16
- serialize(): Uint8Array;
17
- getType(): number;
18
- }
19
- //# sourceMappingURL=sender-key-message.d.ts.map
@@ -1,18 +0,0 @@
1
- interface Sender {
2
- id: string;
3
- deviceId: number;
4
- toString(): string;
5
- }
6
- export declare class SenderKeyName {
7
- private readonly groupId;
8
- private readonly sender;
9
- constructor(groupId: string, sender: Sender);
10
- getGroupId(): string;
11
- getSender(): Sender;
12
- serialize(): string;
13
- toString(): string;
14
- equals(other: SenderKeyName | null): boolean;
15
- hashCode(): number;
16
- }
17
- export {};
18
- //# sourceMappingURL=sender-key-name.d.ts.map
@@ -1,31 +0,0 @@
1
- import { SenderKeyState } from './sender-key-state.js';
2
- export interface SenderKeyStateStructure {
3
- senderKeyId: number;
4
- senderChainKey: {
5
- iteration: number;
6
- seed: Uint8Array;
7
- };
8
- senderSigningKey: {
9
- public: Uint8Array;
10
- private?: Uint8Array;
11
- };
12
- senderMessageKeys: Array<{
13
- iteration: number;
14
- seed: Uint8Array;
15
- }>;
16
- }
17
- export declare class SenderKeyRecord {
18
- private readonly MAX_STATES;
19
- private readonly senderKeyStates;
20
- constructor(serialized?: SenderKeyStateStructure[]);
21
- isEmpty(): boolean;
22
- getSenderKeyState(keyId?: number): SenderKeyState | undefined;
23
- addSenderKeyState(id: number, iteration: number, chainKey: Uint8Array, signatureKey: Uint8Array): void;
24
- setSenderKeyState(id: number, iteration: number, chainKey: Uint8Array, keyPair: {
25
- public: Uint8Array;
26
- private: Uint8Array;
27
- }): void;
28
- serialize(): SenderKeyStateStructure[];
29
- static deserialize(data: Uint8Array): SenderKeyRecord;
30
- }
31
- //# sourceMappingURL=sender-key-record.d.ts.map
@@ -1,39 +0,0 @@
1
- import { SenderChainKey } from './sender-chain-key.js';
2
- import { SenderMessageKey } from './sender-message-key.js';
3
- interface SenderChainKeyStructure {
4
- iteration: number;
5
- seed: Uint8Array;
6
- }
7
- interface SenderSigningKeyStructure {
8
- public: Uint8Array;
9
- private?: Uint8Array;
10
- }
11
- interface SenderMessageKeyStructure {
12
- iteration: number;
13
- seed: Uint8Array;
14
- }
15
- interface SenderKeyStateStructure {
16
- senderKeyId: number;
17
- senderChainKey: SenderChainKeyStructure;
18
- senderSigningKey: SenderSigningKeyStructure;
19
- senderMessageKeys: SenderMessageKeyStructure[];
20
- }
21
- export declare class SenderKeyState {
22
- private readonly MAX_MESSAGE_KEYS;
23
- private readonly senderKeyStateStructure;
24
- constructor(id?: number | null, iteration?: number | null, chainKey?: Uint8Array | null | string, signatureKeyPair?: {
25
- public: Uint8Array | string;
26
- private: Uint8Array | string;
27
- } | null, signatureKeyPublic?: Uint8Array | string | null, signatureKeyPrivate?: Uint8Array | string | null, senderKeyStateStructure?: SenderKeyStateStructure | null);
28
- getKeyId(): number;
29
- getSenderChainKey(): SenderChainKey;
30
- setSenderChainKey(chainKey: SenderChainKey): void;
31
- getSigningKeyPublic(): Buffer;
32
- getSigningKeyPrivate(): Buffer | undefined;
33
- hasSenderMessageKey(iteration: number): boolean;
34
- addSenderMessageKey(senderMessageKey: SenderMessageKey): void;
35
- removeSenderMessageKey(iteration: number): SenderMessageKey | null;
36
- getStructure(): SenderKeyStateStructure;
37
- }
38
- export {};
39
- //# sourceMappingURL=sender-key-state.d.ts.map
@@ -1,12 +0,0 @@
1
- export declare class SenderMessageKey {
2
- private readonly iteration;
3
- private readonly iv;
4
- private readonly cipherKey;
5
- private readonly seed;
6
- constructor(iteration: number, seed: Uint8Array);
7
- getIteration(): number;
8
- getIv(): Uint8Array;
9
- getCipherKey(): Uint8Array;
10
- getSeed(): Uint8Array;
11
- }
12
- //# sourceMappingURL=sender-message-key.d.ts.map
@@ -1,5 +0,0 @@
1
- import type { LIDMapping, SignalAuthState } from '../Types/index.js';
2
- import type { SignalRepositoryWithLIDStore } from '../Types/Signal.js';
3
- import type { ILogger } from '../Utils/logger.js';
4
- export declare function makeLibSignalRepository(auth: SignalAuthState, logger: ILogger, pnToLIDFunc?: (jids: string[]) => Promise<LIDMapping[] | undefined>): SignalRepositoryWithLIDStore;
5
- //# sourceMappingURL=libsignal.d.ts.map
@@ -1,23 +0,0 @@
1
- import type { LIDMapping, SignalKeyStoreWithTransaction } from '../Types/index.js';
2
- import type { ILogger } from '../Utils/logger.js';
3
- export declare class LIDMappingStore {
4
- private readonly mappingCache;
5
- private readonly keys;
6
- private readonly logger;
7
- private pnToLIDFunc?;
8
- private readonly inflightLIDLookups;
9
- private readonly inflightPNLookups;
10
- constructor(keys: SignalKeyStoreWithTransaction, logger: ILogger, pnToLIDFunc?: (jids: string[]) => Promise<LIDMapping[] | undefined>);
11
- storeLIDPNMappings(pairs: LIDMapping[]): Promise<void>;
12
- getLIDForPN(pn: string): Promise<string | null>;
13
- getLIDsForPNs(pns: string[]): Promise<LIDMapping[] | null>;
14
- private _getLIDsForPNsImpl;
15
- getPNForLID(lid: string): Promise<string | null>;
16
- getPNsForLIDs(lids: string[]): Promise<LIDMapping[] | null>;
17
- private _getPNsForLIDsImpl;
18
- /**
19
- * Close the cache and release resources
20
- */
21
- close(): void;
22
- }
23
- //# sourceMappingURL=lid-mapping.d.ts.map
@@ -1,3 +0,0 @@
1
- export * from './types.js';
2
- export * from './websocket.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,16 +0,0 @@
1
- import { EventEmitter } from 'events';
2
- import { URL } from 'url';
3
- import type { SocketConfig } from '../../Types/index.js';
4
- export declare abstract class AbstractSocketClient extends EventEmitter {
5
- url: URL;
6
- config: SocketConfig;
7
- abstract get isOpen(): boolean;
8
- abstract get isClosed(): boolean;
9
- abstract get isClosing(): boolean;
10
- abstract get isConnecting(): boolean;
11
- constructor(url: URL, config: SocketConfig);
12
- abstract connect(): void;
13
- abstract close(): void;
14
- abstract send(str: Uint8Array | string, cb?: (err?: Error) => void): boolean;
15
- }
16
- //# sourceMappingURL=types.d.ts.map
@@ -1,13 +0,0 @@
1
- import WebSocket from 'ws';
2
- import { AbstractSocketClient } from './types.js';
3
- export declare class WebSocketClient extends AbstractSocketClient {
4
- protected socket: WebSocket | null;
5
- get isOpen(): boolean;
6
- get isClosed(): boolean;
7
- get isClosing(): boolean;
8
- get isConnecting(): boolean;
9
- connect(): void;
10
- close(): Promise<void>;
11
- send(str: string | Uint8Array, cb?: (err?: Error) => void): boolean;
12
- }
13
- //# sourceMappingURL=websocket.d.ts.map
@@ -1,217 +0,0 @@
1
- import type { GetCatalogOptions, ProductCreate, ProductUpdate, SocketConfig, WAMediaUpload } from '../Types/index.js';
2
- import type { UpdateBussinesProfileProps } from '../Types/Bussines.js';
3
- import { type BinaryNode } from '../WABinary/index.js';
4
- export declare const makeBusinessSocket: (config: SocketConfig) => {
5
- logger: import("../Utils/logger.js").ILogger;
6
- getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../index.js").OrderDetails>;
7
- getCatalog: ({ jid, limit, cursor }: GetCatalogOptions) => Promise<{
8
- products: import("../index.js").Product[];
9
- nextPageCursor: string | undefined;
10
- }>;
11
- getCollections: (jid?: string, limit?: number) => Promise<{
12
- collections: import("../index.js").CatalogCollection[];
13
- }>;
14
- productCreate: (create: ProductCreate) => Promise<import("../index.js").Product>;
15
- productDelete: (productIds: string[]) => Promise<{
16
- deleted: number;
17
- }>;
18
- productUpdate: (productId: string, update: ProductUpdate) => Promise<import("../index.js").Product>;
19
- updateBussinesProfile: (args: UpdateBussinesProfileProps) => Promise<any>;
20
- updateCoverPhoto: (photo: WAMediaUpload) => Promise<number>;
21
- removeCoverPhoto: (id: string) => Promise<any>;
22
- sendMessageAck: (node: BinaryNode, errorCode?: number) => Promise<void>;
23
- sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
24
- rejectCall: (callId: string, callFrom: string) => Promise<void>;
25
- fetchMessageHistory: (count: number, oldestMsgKey: import("../index.js").WAMessageKey, oldestMsgTimestamp: number | import("long").default) => Promise<string>;
26
- requestPlaceholderResend: (messageKey: import("../index.js").WAMessageKey, msgData?: Partial<import("../index.js").WAMessage>) => Promise<string | undefined>;
27
- messageRetryManager: import("../index.js").MessageRetryManager | null;
28
- userDevicesCache: import("../index.js").PossiblyExtendedCacheStore | import("@cacheable/node-cache").NodeCache<import("../index.js").JidWithDevice[]>;
29
- devicesMutex: {
30
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
31
- };
32
- issuePrivacyTokens: (jids: string[], timestamp?: number) => Promise<any>;
33
- assertSessions: (jids: string[], force?: boolean) => Promise<boolean>;
34
- relayMessage: (jid: string, message: import("../index.js").proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../index.js").MessageRelayOptions) => Promise<string>;
35
- sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../index.js").MessageReceiptType) => Promise<void>;
36
- sendReceipts: (keys: import("../index.js").WAMessageKey[], type: import("../index.js").MessageReceiptType) => Promise<void>;
37
- readMessages: (keys: import("../index.js").WAMessageKey[]) => Promise<void>;
38
- refreshMediaConn: (forceGet?: boolean) => Promise<import("../index.js").MediaConnInfo>;
39
- getMediaHost: () => string;
40
- waUploadToServer: import("../index.js").WAMediaUploadFunction;
41
- fetchPrivacySettings: (force?: boolean) => Promise<{
42
- [_: string]: string;
43
- }>;
44
- sendPeerDataOperationMessage: (pdoMessage: import("../index.js").proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
45
- createParticipantNodes: (recipientJids: string[], message: import("../index.js").proto.IMessage, extraAttrs?: BinaryNode["attrs"], dsmMessage?: import("../index.js").proto.IMessage) => Promise<{
46
- nodes: BinaryNode[];
47
- shouldIncludeDeviceIdentity: boolean;
48
- }>;
49
- getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<(import("../index.js").JidWithDevice & {
50
- jid: string;
51
- })[]>;
52
- updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
53
- updateMediaMessage: (message: import("../index.js").WAMessage) => Promise<import("../index.js").WAMessage>;
54
- sendMessage: (jid: string, content: import("../index.js").AnyMessageContent, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
55
- newsletterCreate: (name: string, description?: string) => Promise<import("../index.js").NewsletterMetadata>;
56
- newsletterUpdate: (jid: string, updates: import("../index.js").NewsletterUpdate) => Promise<unknown>;
57
- newsletterSubscribers: (jid: string) => Promise<{
58
- subscribers: number;
59
- }>;
60
- newsletterMetadata: (type: "invite" | "jid", key: string) => Promise<import("../index.js").NewsletterMetadata | null>;
61
- newsletterFollow: (jid: string) => Promise<unknown>;
62
- newsletterUnfollow: (jid: string) => Promise<unknown>;
63
- newsletterMute: (jid: string) => Promise<unknown>;
64
- newsletterUnmute: (jid: string) => Promise<unknown>;
65
- newsletterUpdateName: (jid: string, name: string) => Promise<unknown>;
66
- newsletterUpdateDescription: (jid: string, description: string) => Promise<unknown>;
67
- newsletterUpdatePicture: (jid: string, content: WAMediaUpload) => Promise<unknown>;
68
- newsletterRemovePicture: (jid: string) => Promise<unknown>;
69
- newsletterReactMessage: (jid: string, serverId: string, reaction?: string) => Promise<void>;
70
- newsletterFetchMessages: (jid: string, count: number, since: number, after: number) => Promise<any>;
71
- subscribeNewsletterUpdates: (jid: string) => Promise<{
72
- duration: string;
73
- } | null>;
74
- newsletterAdminCount: (jid: string) => Promise<number>;
75
- newsletterChangeOwner: (jid: string, newOwnerJid: string) => Promise<void>;
76
- newsletterDemote: (jid: string, userJid: string) => Promise<void>;
77
- newsletterDelete: (jid: string) => Promise<void>;
78
- groupMetadata: (jid: string) => Promise<import("../index.js").GroupMetadata>;
79
- groupCreate: (subject: string, participants: string[]) => Promise<import("../index.js").GroupMetadata>;
80
- groupLeave: (id: string) => Promise<void>;
81
- groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
82
- groupRequestParticipantsList: (jid: string) => Promise<{
83
- [key: string]: string;
84
- }[]>;
85
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
86
- status: string;
87
- jid: string | undefined;
88
- }[]>;
89
- groupParticipantsUpdate: (jid: string, participants: string[], action: import("../index.js").ParticipantAction) => Promise<{
90
- status: string;
91
- jid: string | undefined;
92
- content: BinaryNode;
93
- }[]>;
94
- groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
95
- groupInviteCode: (jid: string) => Promise<string | undefined>;
96
- groupRevokeInvite: (jid: string) => Promise<string | undefined>;
97
- groupAcceptInvite: (code: string) => Promise<string | undefined>;
98
- groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
99
- groupAcceptInviteV4: (key: string | import("../index.js").WAMessageKey, inviteMessage: import("../index.js").proto.Message.IGroupInviteMessage) => Promise<any>;
100
- groupGetInviteInfo: (code: string) => Promise<import("../index.js").GroupMetadata>;
101
- groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
102
- groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
103
- groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
104
- groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
105
- groupFetchAllParticipating: () => Promise<{
106
- [_: string]: import("../index.js").GroupMetadata;
107
- }>;
108
- serverProps: {
109
- privacyTokenOn1to1: boolean;
110
- profilePicPrivacyToken: boolean;
111
- lidTrustedTokenIssueToLid: boolean;
112
- };
113
- createCallLink: (type: "audio" | "video", event?: {
114
- startTime: number;
115
- }, timeoutMs?: number) => Promise<string | undefined>;
116
- getBotListV2: () => Promise<import("../index.js").BotListInfo[]>;
117
- messageMutex: {
118
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
119
- };
120
- receiptMutex: {
121
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
122
- };
123
- appStatePatchMutex: {
124
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
125
- };
126
- notificationMutex: {
127
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
128
- };
129
- upsertMessage: (msg: import("../index.js").WAMessage, type: import("../index.js").MessageUpsertType) => Promise<void>;
130
- appPatch: (patchCreate: import("../index.js").WAPatchCreate) => Promise<void>;
131
- sendPresenceUpdate: (type: import("../index.js").WAPresence, toJid?: string) => Promise<void>;
132
- presenceSubscribe: (toJid: string) => Promise<void>;
133
- profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
134
- fetchBlocklist: () => Promise<(string | undefined)[]>;
135
- fetchStatus: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
136
- fetchDisappearingDuration: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
137
- updateProfilePicture: (jid: string, content: WAMediaUpload, dimensions?: {
138
- width: number;
139
- height: number;
140
- }) => Promise<void>;
141
- removeProfilePicture: (jid: string) => Promise<void>;
142
- updateProfileStatus: (status: string) => Promise<void>;
143
- updateProfileName: (name: string) => Promise<void>;
144
- updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
145
- updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>;
146
- updateCallPrivacy: (value: import("../index.js").WAPrivacyCallValue) => Promise<void>;
147
- updateMessagesPrivacy: (value: import("../index.js").WAPrivacyMessagesValue) => Promise<void>;
148
- updateLastSeenPrivacy: (value: import("../index.js").WAPrivacyValue) => Promise<void>;
149
- updateOnlinePrivacy: (value: import("../index.js").WAPrivacyOnlineValue) => Promise<void>;
150
- updateProfilePicturePrivacy: (value: import("../index.js").WAPrivacyValue) => Promise<void>;
151
- updateStatusPrivacy: (value: import("../index.js").WAPrivacyValue) => Promise<void>;
152
- updateReadReceiptsPrivacy: (value: import("../index.js").WAReadReceiptsValue) => Promise<void>;
153
- updateGroupsAddPrivacy: (value: import("../index.js").WAPrivacyGroupAddValue) => Promise<void>;
154
- updateDefaultDisappearingMode: (duration: number) => Promise<void>;
155
- getBusinessProfile: (jid: string) => Promise<import("../index.js").WABusinessProfile | void>;
156
- resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
157
- chatModify: (mod: import("../index.js").ChatModification, jid: string) => Promise<void>;
158
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
159
- addOrEditContact: (jid: string, contact: import("../index.js").proto.SyncActionValue.IContactAction) => Promise<void>;
160
- removeContact: (jid: string) => Promise<void>;
161
- placeholderResendCache: import("../index.js").CacheStore;
162
- addLabel: (jid: string, labels: import("../Types/Label.js").LabelActionBody) => Promise<void>;
163
- addChatLabel: (jid: string, labelId: string) => Promise<void>;
164
- removeChatLabel: (jid: string, labelId: string) => Promise<void>;
165
- addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
166
- removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
167
- star: (jid: string, messages: {
168
- id: string;
169
- fromMe?: boolean;
170
- }[], star: boolean) => Promise<void>;
171
- addOrEditQuickReply: (quickReply: import("../Types/Bussines.js").QuickReplyAction) => Promise<void>;
172
- removeQuickReply: (timestamp: string) => Promise<void>;
173
- type: "md";
174
- ws: import("./Client/index.js").WebSocketClient;
175
- ev: import("../index.js").BaileysEventEmitter & {
176
- process(handler: (events: Partial<import("../index.js").BaileysEventMap>) => void | Promise<void>): () => void;
177
- buffer(): void;
178
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): (...args: A) => Promise<T>;
179
- flush(): boolean;
180
- isBuffering(): boolean;
181
- destroy(): void;
182
- };
183
- authState: {
184
- creds: import("../index.js").AuthenticationCreds;
185
- keys: import("../index.js").SignalKeyStoreWithTransaction;
186
- };
187
- signalRepository: import("../index.js").SignalRepositoryWithLIDStore;
188
- user: import("../index.js").Contact | undefined;
189
- generateMessageTag: () => string;
190
- query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
191
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T | undefined>;
192
- waitForSocketOpen: () => Promise<void>;
193
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
194
- sendNode: (frame: BinaryNode) => Promise<void>;
195
- logout: (msg?: string) => Promise<void>;
196
- end: (error: Error | undefined) => Promise<void>;
197
- registerSocketEndHandler: (handler: (error: Error | undefined) => void | Promise<void>) => void;
198
- onUnexpectedError: (err: Error | import("@hapi/boom").Boom, msg: string) => void;
199
- uploadPreKeys: (count?: number) => Promise<void>;
200
- uploadPreKeysToServerIfRequired: () => Promise<void>;
201
- digestKeyBundle: () => Promise<void>;
202
- rotateSignedPreKey: () => Promise<void>;
203
- requestPairingCode: (phoneNumber: string, customPairingCode?: string) => Promise<string>;
204
- updateServerTimeOffset: ({ attrs }: BinaryNode) => void;
205
- sendUnifiedSession: () => Promise<void>;
206
- wamBuffer: import("../index.js").BinaryInfo;
207
- waitForConnectionUpdate: (check: (u: Partial<import("../index.js").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
208
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
209
- executeUSyncQuery: (usyncQuery: import("../index.js").USyncQuery) => Promise<import("../index.js").USyncQueryResult | undefined>;
210
- onWhatsApp: (...phoneNumber: string[]) => Promise<{
211
- jid: string;
212
- exists: boolean;
213
- }[] | undefined>;
214
- fetchAccountReachoutTimelock: () => Promise<import("../index.js").ReachoutTimelockState>;
215
- fetchNewChatMessageCap: () => Promise<import("../index.js").NewChatMessageCapInfo>;
216
- };
217
- //# sourceMappingURL=business.d.ts.map