@synacwave/baileys 0.0.0-stage → 0.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.
- package/ATTRIBUTION.md +14 -0
- package/CHANGELOG.md +35 -0
- package/LICENSE +23 -0
- package/README.md +493 -2
- package/README.upstream.md +2077 -0
- package/WAProto/index.d.ts +15942 -0
- package/WAProto/index.js +115911 -0
- package/engine-requirements.js +13 -0
- package/lib/Defaults/index.d.ts +145 -0
- package/lib/Defaults/index.js +155 -0
- package/lib/Signal/Group/ciphertext-message.d.ts +10 -0
- package/lib/Signal/Group/ciphertext-message.js +12 -0
- package/lib/Signal/Group/group-session-builder.d.ts +8 -0
- package/lib/Signal/Group/group-session-builder.js +30 -0
- package/lib/Signal/Group/group_cipher.d.ts +11 -0
- package/lib/Signal/Group/group_cipher.js +82 -0
- package/lib/Signal/Group/index.d.ts +12 -0
- package/lib/Signal/Group/index.js +12 -0
- package/lib/Signal/Group/keyhelper.d.ts +7 -0
- package/lib/Signal/Group/keyhelper.js +18 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +14 -0
- package/lib/Signal/Group/sender-chain-key.js +26 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +17 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +63 -0
- package/lib/Signal/Group/sender-key-message.d.ts +19 -0
- package/lib/Signal/Group/sender-key-message.js +66 -0
- package/lib/Signal/Group/sender-key-name.d.ts +12 -0
- package/lib/Signal/Group/sender-key-name.js +48 -0
- package/lib/Signal/Group/sender-key-record.d.ts +13 -0
- package/lib/Signal/Group/sender-key-record.js +41 -0
- package/lib/Signal/Group/sender-key-state.d.ts +17 -0
- package/lib/Signal/Group/sender-key-state.js +84 -0
- package/lib/Signal/Group/sender-message-key.d.ts +12 -0
- package/lib/Signal/Group/sender-message-key.js +26 -0
- package/lib/Signal/libsignal.d.ts +55 -0
- package/lib/Signal/libsignal.js +431 -0
- package/lib/Signal/lid-mapping.d.ts +21 -0
- package/lib/Signal/lid-mapping.js +277 -0
- package/lib/Socket/Client/index.d.ts +3 -0
- package/lib/Socket/Client/index.js +3 -0
- package/lib/Socket/Client/types.d.ts +6 -0
- package/lib/Socket/Client/types.js +11 -0
- package/lib/Socket/Client/websocket.d.ts +13 -0
- package/lib/Socket/Client/websocket.js +54 -0
- package/lib/Socket/business.d.ts +395 -0
- package/lib/Socket/business.js +380 -0
- package/lib/Socket/chats.d.ts +144 -0
- package/lib/Socket/chats.js +1219 -0
- package/lib/Socket/communities.d.ts +562 -0
- package/lib/Socket/communities.js +432 -0
- package/lib/Socket/groups.d.ts +286 -0
- package/lib/Socket/groups.js +348 -0
- package/lib/Socket/index.d.ts +531 -0
- package/lib/Socket/index.js +13 -0
- package/lib/Socket/messages-recv.d.ts +334 -0
- package/lib/Socket/messages-recv.js +1772 -0
- package/lib/Socket/messages-send.d.ts +330 -0
- package/lib/Socket/messages-send.js +1372 -0
- package/lib/Socket/mex.d.ts +2 -0
- package/lib/Socket/mex.js +42 -0
- package/lib/Socket/newsletter.d.ts +283 -0
- package/lib/Socket/newsletter.js +226 -0
- package/lib/Socket/socket.d.ts +61 -0
- package/lib/Socket/socket.js +970 -0
- package/lib/Store/index.d.ts +4 -0
- package/lib/Store/index.js +4 -0
- package/lib/Store/make-in-memory-store.d.ts +63 -0
- package/lib/Store/make-in-memory-store.js +421 -0
- package/lib/Store/make-ordered-dictionary.d.ts +13 -0
- package/lib/Store/make-ordered-dictionary.js +79 -0
- package/lib/Store/object-repository.d.ts +11 -0
- package/lib/Store/object-repository.js +24 -0
- package/lib/Types/Auth.d.ts +2 -0
- package/lib/Types/Auth.js +2 -0
- package/lib/Types/Bussines.d.ts +2 -0
- package/lib/Types/Bussines.js +2 -0
- package/lib/Types/Call.d.ts +2 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Chat.d.ts +2 -0
- package/lib/Types/Chat.js +8 -0
- package/lib/Types/Contact.d.ts +2 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Events.d.ts +2 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/GroupMetadata.d.ts +2 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/Label.d.ts +3 -0
- package/lib/Types/Label.js +25 -0
- package/lib/Types/LabelAssociation.d.ts +3 -0
- package/lib/Types/LabelAssociation.js +7 -0
- package/lib/Types/Message.d.ts +12 -0
- package/lib/Types/Message.js +18 -0
- package/lib/Types/Mex.d.ts +3 -0
- package/lib/Types/Mex.js +39 -0
- package/lib/Types/Product.d.ts +2 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/RichType.d.ts +3 -0
- package/lib/Types/RichType.js +23 -0
- package/lib/Types/Signal.d.ts +2 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Socket.d.ts +2 -0
- package/lib/Types/Socket.js +2 -0
- package/lib/Types/State.d.ts +6 -0
- package/lib/Types/State.js +56 -0
- package/lib/Types/USync.d.ts +2 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/index.d.ts +14 -0
- package/lib/Types/index.js +26 -0
- package/lib/Utils/api-wrappers.d.ts +70 -0
- package/lib/Utils/api-wrappers.js +248 -0
- package/lib/Utils/auth-utils.d.ts +58 -0
- package/lib/Utils/auth-utils.js +306 -0
- package/lib/Utils/browser-utils.d.ts +10 -0
- package/lib/Utils/browser-utils.js +29 -0
- package/lib/Utils/business.d.ts +50 -0
- package/lib/Utils/business.js +231 -0
- package/lib/Utils/chat-utils.d.ts +409 -0
- package/lib/Utils/chat-utils.js +886 -0
- package/lib/Utils/companion-reg-client-utils.d.ts +5 -0
- package/lib/Utils/companion-reg-client-utils.js +40 -0
- package/lib/Utils/crypto.d.ts +40 -0
- package/lib/Utils/crypto.js +118 -0
- package/lib/Utils/decode-wa-message.d.ts +84 -0
- package/lib/Utils/decode-wa-message.js +317 -0
- package/lib/Utils/event-buffer.d.ts +13 -0
- package/lib/Utils/event-buffer.js +622 -0
- package/lib/Utils/generics.d.ts +64 -0
- package/lib/Utils/generics.js +395 -0
- package/lib/Utils/history.d.ts +76 -0
- package/lib/Utils/history.js +134 -0
- package/lib/Utils/identity-change-handler.d.ts +14 -0
- package/lib/Utils/identity-change-handler.js +50 -0
- package/lib/Utils/index.d.ts +28 -0
- package/lib/Utils/index.js +30 -0
- package/lib/Utils/link-preview.d.ts +13 -0
- package/lib/Utils/link-preview.js +85 -0
- package/lib/Utils/logger.d.ts +3 -0
- package/lib/Utils/logger.js +3 -0
- package/lib/Utils/lt-hash.d.ts +7 -0
- package/lib/Utils/lt-hash.js +8 -0
- package/lib/Utils/make-mutex.d.ts +7 -0
- package/lib/Utils/make-mutex.js +33 -0
- package/lib/Utils/message-retry-manager.d.ts +80 -0
- package/lib/Utils/message-retry-manager.js +265 -0
- package/lib/Utils/messages-media.d.ts +137 -0
- package/lib/Utils/messages-media.js +843 -0
- package/lib/Utils/messages.d.ts +46 -0
- package/lib/Utils/messages.js +1840 -0
- package/lib/Utils/noise-handler.d.ts +21 -0
- package/lib/Utils/noise-handler.js +201 -0
- package/lib/Utils/offline-node-processor.d.ts +10 -0
- package/lib/Utils/offline-node-processor.js +40 -0
- package/lib/Utils/pre-key-manager.d.ts +26 -0
- package/lib/Utils/pre-key-manager.js +106 -0
- package/lib/Utils/process-message.d.ts +84 -0
- package/lib/Utils/process-message.js +749 -0
- package/lib/Utils/reporting-utils.d.ts +13 -0
- package/lib/Utils/reporting-utils.js +258 -0
- package/lib/Utils/rich-message-utils.d.ts +49 -0
- package/lib/Utils/rich-message-utils.js +363 -0
- package/lib/Utils/signal.d.ts +83 -0
- package/lib/Utils/signal.js +201 -0
- package/lib/Utils/stanza-ack.d.ts +17 -0
- package/lib/Utils/stanza-ack.js +38 -0
- package/lib/Utils/status-utils.js +178 -0
- package/lib/Utils/sticker-reaction.js +104 -0
- package/lib/Utils/synacwave.d.ts +111 -0
- package/lib/Utils/synacwave.js +474 -0
- package/lib/Utils/sync-action-utils.d.ts +3 -0
- package/lib/Utils/sync-action-utils.js +49 -0
- package/lib/Utils/tc-token-utils.d.ts +30 -0
- package/lib/Utils/tc-token-utils.js +164 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +11 -0
- package/lib/Utils/use-multi-file-auth-state.js +121 -0
- package/lib/Utils/use-single-file-auth-state.d.ts +11 -0
- package/lib/Utils/use-single-file-auth-state.js +109 -0
- package/lib/Utils/use-sqlite-auth-state.d.ts +11 -0
- package/lib/Utils/use-sqlite-auth-state.js +109 -0
- package/lib/Utils/validate-connection.d.ts +44 -0
- package/lib/Utils/validate-connection.js +210 -0
- package/lib/Utils/view-once-text.d.ts +32 -0
- package/lib/Utils/view-once-text.js +213 -0
- package/lib/WABinary/constants.d.ts +62 -0
- package/lib/WABinary/constants.js +1467 -0
- package/lib/WABinary/decode.d.ts +10 -0
- package/lib/WABinary/decode.js +262 -0
- package/lib/WABinary/encode.d.ts +3 -0
- package/lib/WABinary/encode.js +220 -0
- package/lib/WABinary/generic-utils.d.ts +77 -0
- package/lib/WABinary/generic-utils.js +226 -0
- package/lib/WABinary/index.d.ts +6 -0
- package/lib/WABinary/index.js +6 -0
- package/lib/WABinary/jid-utils.d.ts +29 -0
- package/lib/WABinary/jid-utils.js +96 -0
- package/lib/WABinary/types.d.ts +2 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WAM/BinaryInfo.d.ts +8 -0
- package/lib/WAM/BinaryInfo.js +10 -0
- package/lib/WAM/constants.d.ts +34927 -0
- package/lib/WAM/constants.js +22853 -0
- package/lib/WAM/encode.d.ts +2 -0
- package/lib/WAM/encode.js +150 -0
- package/lib/WAM/index.d.ts +4 -0
- package/lib/WAM/index.js +4 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +37 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +52 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +23 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +54 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +13 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +13 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +10 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +39 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +51 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +15 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
- package/lib/WAUSync/Protocols/index.d.ts +6 -0
- package/lib/WAUSync/Protocols/index.js +6 -0
- package/lib/WAUSync/USyncQuery.d.ts +21 -0
- package/lib/WAUSync/USyncQuery.js +98 -0
- package/lib/WAUSync/USyncUser.d.ts +17 -0
- package/lib/WAUSync/USyncUser.js +31 -0
- package/lib/WAUSync/index.d.ts +4 -0
- package/lib/WAUSync/index.js +4 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.js +12 -0
- package/package.json +118 -5
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/** generates all the keys required to encrypt/decrypt & sign a media message */
|
|
2
|
+
export function getMediaKeys(buffer: any, mediaType: any): Promise<{
|
|
3
|
+
iv: any;
|
|
4
|
+
cipherKey: any;
|
|
5
|
+
macKey: any;
|
|
6
|
+
}>;
|
|
7
|
+
export function getAudioDuration(buffer: any): Promise<any>;
|
|
8
|
+
/**
|
|
9
|
+
referenced from and modifying https://github.com/wppconnect-team/wa-js/blob/main/src/chat/functions/prepareAudioWaveform.ts
|
|
10
|
+
*/
|
|
11
|
+
export function getAudioWaveform(buffer: any, logger: any): Promise<Uint8Array<ArrayBuffer> | undefined>;
|
|
12
|
+
/** generates a thumbnail for a given media, if required */
|
|
13
|
+
export function generateThumbnail(file: any, mediaType: any, options: any): Promise<{
|
|
14
|
+
thumbnail: any;
|
|
15
|
+
originalImageDimensions: {
|
|
16
|
+
width: any;
|
|
17
|
+
height: any;
|
|
18
|
+
} | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
export function extensionForMediaMessage(message: any): any;
|
|
21
|
+
export function getImageProcessingLibrary(): Promise<any>;
|
|
22
|
+
export function hkdfInfoKey(type: any): string;
|
|
23
|
+
export function getRawMediaUploadData(media: any, mediaType: any, logger: any): Promise<{
|
|
24
|
+
filePath: any;
|
|
25
|
+
fileSha256: any;
|
|
26
|
+
fileLength: number;
|
|
27
|
+
}>;
|
|
28
|
+
export function extractVideoThumb(path: any, time: any, size: any): Promise<any>;
|
|
29
|
+
export function extractImageThumb(bufferOrFilePath: any, width?: number): Promise<{
|
|
30
|
+
buffer: any;
|
|
31
|
+
original: {
|
|
32
|
+
width: any;
|
|
33
|
+
height: any;
|
|
34
|
+
};
|
|
35
|
+
}>;
|
|
36
|
+
export function encodeBase64EncodedStringForUpload(b64: any): string;
|
|
37
|
+
export function generateProfilePicture(mediaUpload: any, dimensions: any): Promise<{
|
|
38
|
+
img: any;
|
|
39
|
+
}>;
|
|
40
|
+
export function mediaMessageSHA256B64(message: any): any;
|
|
41
|
+
export function toReadable(buffer: any): any;
|
|
42
|
+
export function toBuffer(stream: any): Promise<any>;
|
|
43
|
+
export function getStream(item: any, opts: any): Promise<{
|
|
44
|
+
stream: any;
|
|
45
|
+
type: string;
|
|
46
|
+
}>;
|
|
47
|
+
export function getHttpStream(url: any, options?: {}): Promise<any>;
|
|
48
|
+
export function encryptedStream(media: any, mediaType: any, { logger, saveOriginalFileIfRequired, opts }?: {}): Promise<{
|
|
49
|
+
mediaKey: any;
|
|
50
|
+
originalFilePath: any;
|
|
51
|
+
encFilePath: any;
|
|
52
|
+
mac: any;
|
|
53
|
+
fileEncSha256: any;
|
|
54
|
+
fileSha256: any;
|
|
55
|
+
fileLength: number;
|
|
56
|
+
}>;
|
|
57
|
+
export const DEF_MEDIA_HOST: "mmg.whatsapp.net";
|
|
58
|
+
export function getUrlFromDirectPath(directPath: any, host?: string): string;
|
|
59
|
+
export function downloadContentFromMessage({ mediaKey, directPath, url }: {
|
|
60
|
+
mediaKey: any;
|
|
61
|
+
directPath: any;
|
|
62
|
+
url: any;
|
|
63
|
+
}, type: any, opts?: {}): Promise<any>;
|
|
64
|
+
export function downloadEncryptedContent(downloadUrl: any, { cipherKey, iv }: {
|
|
65
|
+
cipherKey: any;
|
|
66
|
+
iv: any;
|
|
67
|
+
}, { startByte, endByte, options }?: {}): Promise<any>;
|
|
68
|
+
export function uploadWithNodeHttp({ url, filePath, headers, timeoutMs, agent }: {
|
|
69
|
+
url: any;
|
|
70
|
+
filePath: any;
|
|
71
|
+
headers: any;
|
|
72
|
+
timeoutMs: any;
|
|
73
|
+
agent: any;
|
|
74
|
+
}, redirectCount?: number): Promise<any>;
|
|
75
|
+
export function getWAUploadToServer({ customUploadHosts, fetchAgent, logger, options }: {
|
|
76
|
+
customUploadHosts: any;
|
|
77
|
+
fetchAgent: any;
|
|
78
|
+
logger: any;
|
|
79
|
+
options: any;
|
|
80
|
+
}, refreshMediaConn: any): (filePath: any, { mediaType, fileEncSha256B64, timeoutMs, newsletter }: {
|
|
81
|
+
mediaType: any;
|
|
82
|
+
fileEncSha256B64: any;
|
|
83
|
+
timeoutMs: any;
|
|
84
|
+
newsletter: any;
|
|
85
|
+
}) => Promise<{
|
|
86
|
+
mediaUrl: any;
|
|
87
|
+
directPath: any;
|
|
88
|
+
meta_hmac: any;
|
|
89
|
+
fbid: any;
|
|
90
|
+
ts: any;
|
|
91
|
+
thumbnailDirectPath: any;
|
|
92
|
+
thumbnailSha256: any;
|
|
93
|
+
}>;
|
|
94
|
+
export function encryptMediaRetryRequest(key: any, mediaKey: any, meId: any): {
|
|
95
|
+
tag: string;
|
|
96
|
+
attrs: {
|
|
97
|
+
id: any;
|
|
98
|
+
to: string;
|
|
99
|
+
type: string;
|
|
100
|
+
};
|
|
101
|
+
content: ({
|
|
102
|
+
tag: string;
|
|
103
|
+
attrs: {
|
|
104
|
+
jid?: undefined;
|
|
105
|
+
from_me?: undefined;
|
|
106
|
+
participant?: undefined;
|
|
107
|
+
};
|
|
108
|
+
content: {
|
|
109
|
+
tag: string;
|
|
110
|
+
attrs: {};
|
|
111
|
+
content: any;
|
|
112
|
+
}[];
|
|
113
|
+
} | {
|
|
114
|
+
tag: string;
|
|
115
|
+
attrs: {
|
|
116
|
+
jid: any;
|
|
117
|
+
from_me: string;
|
|
118
|
+
participant: any;
|
|
119
|
+
};
|
|
120
|
+
content?: undefined;
|
|
121
|
+
})[];
|
|
122
|
+
};
|
|
123
|
+
export function decodeMediaRetryNode(node: any): {
|
|
124
|
+
key: {
|
|
125
|
+
id: any;
|
|
126
|
+
remoteJid: any;
|
|
127
|
+
fromMe: boolean;
|
|
128
|
+
participant: any;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
export function decryptMediaRetryData({ ciphertext, iv }: {
|
|
132
|
+
ciphertext: any;
|
|
133
|
+
iv: any;
|
|
134
|
+
}, mediaKey: any, msgId: any): proto.MediaRetryNotification;
|
|
135
|
+
export function getStatusCodeForMediaRetry(code: any): any;
|
|
136
|
+
import { proto } from '../../WAProto/index.js';
|
|
137
|
+
//# sourceMappingURL=messages-media.d.ts.map
|