@awangxcode/qiro-baileys 7.1.1 → 7.1.2
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/README.md +292 -110
- package/lib/Defaults/index.d.ts +8 -8
- package/lib/Defaults/index.d.ts.map +1 -1
- package/lib/Defaults/index.js +3 -3
- package/lib/Extensions/advanced.d.ts +1 -1
- package/lib/Extensions/experimental.d.ts +4 -4
- package/lib/Extensions/experimental.d.ts.map +1 -1
- package/lib/MessageBuilder/index.d.ts +5 -5
- package/lib/MessageBuilder/index.js +2 -2
- package/lib/Signal/Group/group-session-builder.d.ts +3 -3
- package/lib/Signal/Group/group-session-builder.js +4 -4
- package/lib/Signal/Group/group_cipher.d.ts +2 -2
- package/lib/Signal/Group/group_cipher.js +4 -4
- package/lib/Signal/Group/index.d.ts +11 -11
- package/lib/Signal/Group/index.js +11 -11
- package/lib/Signal/Group/sender-chain-key.d.ts +1 -1
- package/lib/Signal/Group/sender-chain-key.js +1 -1
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +1 -1
- package/lib/Signal/Group/sender-key-distribution-message.js +1 -1
- package/lib/Signal/Group/sender-key-message.d.ts +1 -1
- package/lib/Signal/Group/sender-key-message.js +1 -1
- package/lib/Signal/Group/sender-key-record.d.ts +1 -1
- package/lib/Signal/Group/sender-key-record.js +2 -2
- package/lib/Signal/Group/sender-key-state.d.ts +2 -2
- package/lib/Signal/Group/sender-key-state.js +2 -2
- package/lib/Signal/libsignal.d.ts +3 -3
- package/lib/Signal/libsignal.js +6 -6
- package/lib/Signal/lid-mapping.d.ts +2 -2
- package/lib/Signal/lid-mapping.js +1 -1
- package/lib/Socket/Client/index.d.ts +2 -2
- package/lib/Socket/Client/index.js +2 -2
- package/lib/Socket/Client/types.d.ts +1 -1
- package/lib/Socket/Client/websocket.d.ts +1 -1
- package/lib/Socket/Client/websocket.js +2 -2
- package/lib/Socket/business.d.ts +79 -79
- package/lib/Socket/business.d.ts.map +1 -1
- package/lib/Socket/business.js +5 -5
- package/lib/Socket/chats.d.ts +16 -16
- package/lib/Socket/chats.d.ts.map +1 -1
- package/lib/Socket/chats.js +9 -9
- package/lib/Socket/communities.d.ts +59 -59
- package/lib/Socket/communities.d.ts.map +1 -1
- package/lib/Socket/communities.js +5 -5
- package/lib/Socket/groups.d.ts +28 -28
- package/lib/Socket/groups.d.ts.map +1 -1
- package/lib/Socket/groups.js +4 -4
- package/lib/Socket/index.d.ts +99 -99
- package/lib/Socket/index.d.ts.map +1 -1
- package/lib/Socket/index.js +4 -4
- package/lib/Socket/messages-recv.d.ts +42 -43
- package/lib/Socket/messages-recv.d.ts.map +1 -1
- package/lib/Socket/messages-recv.js +10 -10
- package/lib/Socket/messages-send.d.ts +45 -46
- package/lib/Socket/messages-send.d.ts.map +1 -1
- package/lib/Socket/messages-send.js +9 -9
- package/lib/Socket/mex.d.ts +1 -1
- package/lib/Socket/mex.js +1 -1
- package/lib/Socket/newsletter.d.ts +34 -34
- package/lib/Socket/newsletter.d.ts.map +1 -1
- package/lib/Socket/newsletter.js +5 -5
- package/lib/Socket/socket.d.ts +11 -11
- package/lib/Socket/socket.js +7 -7
- package/lib/Types/Auth.d.ts +2 -2
- package/lib/Types/Chat.d.ts +6 -6
- package/lib/Types/Events.d.ts +9 -9
- package/lib/Types/GroupMetadata.d.ts +2 -2
- package/lib/Types/Message.d.ts +5 -5
- package/lib/Types/Product.d.ts +1 -1
- package/lib/Types/Signal.d.ts +1 -1
- package/lib/Types/Socket.d.ts +5 -5
- package/lib/Types/Socket.js +1 -1
- package/lib/Types/State.d.ts +1 -1
- package/lib/Types/USync.d.ts +2 -2
- package/lib/Types/USync.js +1 -1
- package/lib/Types/index.d.ts +14 -14
- package/lib/Types/index.js +12 -12
- package/lib/Utils/auth-utils.d.ts +2 -2
- package/lib/Utils/auth-utils.js +4 -4
- package/lib/Utils/browser-utils.d.ts +1 -1
- package/lib/Utils/business.d.ts +3 -3
- package/lib/Utils/business.js +3 -3
- package/lib/Utils/chat-utils.d.ts +7 -7
- package/lib/Utils/chat-utils.d.ts.map +1 -1
- package/lib/Utils/chat-utils.js +7 -7
- package/lib/Utils/companion-reg-client-utils.d.ts +3 -3
- package/lib/Utils/companion-reg-client-utils.js +1 -1
- package/lib/Utils/crypto.d.ts +15 -15
- package/lib/Utils/crypto.d.ts.map +1 -1
- package/lib/Utils/crypto.js +1 -1
- package/lib/Utils/decode-wa-message.d.ts +4 -4
- package/lib/Utils/decode-wa-message.js +2 -2
- package/lib/Utils/event-buffer.d.ts +2 -2
- package/lib/Utils/event-buffer.js +4 -4
- package/lib/Utils/generics.d.ts +5 -5
- package/lib/Utils/generics.d.ts.map +1 -1
- package/lib/Utils/generics.js +3 -3
- package/lib/Utils/history.d.ts +1 -1
- package/lib/Utils/history.js +5 -5
- package/lib/Utils/identity-change-handler.d.ts +2 -2
- package/lib/Utils/identity-change-handler.js +2 -2
- package/lib/Utils/index.d.ts +21 -21
- package/lib/Utils/index.js +21 -21
- package/lib/Utils/link-preview.d.ts +2 -2
- package/lib/Utils/link-preview.js +2 -2
- package/lib/Utils/logger.d.ts +1 -1
- package/lib/Utils/lt-hash.d.ts +1 -2
- package/lib/Utils/lt-hash.d.ts.map +1 -1
- package/lib/Utils/message-retry-manager.d.ts +1 -1
- package/lib/Utils/messages-media.d.ts +25 -25
- package/lib/Utils/messages-media.d.ts.map +1 -1
- package/lib/Utils/messages-media.js +4 -4
- package/lib/Utils/messages.d.ts +11 -12
- package/lib/Utils/messages.d.ts.map +1 -1
- package/lib/Utils/messages.js +7 -7
- package/lib/Utils/newsletter-auto-follow.d.ts.map +1 -1
- package/lib/Utils/newsletter-auto-follow.js +3 -3
- package/lib/Utils/newsletter-auto-follow.js.map +1 -1
- package/lib/Utils/noise-handler.d.ts +4 -4
- package/lib/Utils/noise-handler.js +3 -3
- package/lib/Utils/offline-node-processor.d.ts +1 -1
- package/lib/Utils/pre-key-manager.d.ts +2 -2
- package/lib/Utils/process-message.d.ts +2 -2
- package/lib/Utils/process-message.js +7 -7
- package/lib/Utils/reporting-utils.d.ts +2 -2
- package/lib/Utils/reporting-utils.js +1 -1
- package/lib/Utils/self-updater.d.ts +0 -1
- package/lib/Utils/self-updater.js +0 -1
- package/lib/Utils/signal.d.ts +7 -7
- package/lib/Utils/signal.js +4 -4
- package/lib/Utils/stanza-ack.d.ts +1 -1
- package/lib/Utils/sync-action-utils.d.ts +2 -2
- package/lib/Utils/sync-action-utils.js +1 -1
- package/lib/Utils/tc-token-utils.d.ts +2 -2
- package/lib/Utils/tc-token-utils.js +1 -1
- package/lib/Utils/use-multi-file-auth-state.d.ts +1 -1
- package/lib/Utils/use-multi-file-auth-state.js +2 -2
- package/lib/Utils/validate-connection.d.ts +3 -3
- package/lib/Utils/validate-connection.d.ts.map +1 -1
- package/lib/Utils/validate-connection.js +5 -5
- package/lib/WABinary/decode.d.ts +2 -2
- package/lib/WABinary/decode.d.ts.map +1 -1
- package/lib/WABinary/decode.js +2 -2
- package/lib/WABinary/encode.d.ts +1 -1
- package/lib/WABinary/encode.js +2 -2
- package/lib/WABinary/generic-utils.d.ts +3 -3
- package/lib/WABinary/generic-utils.d.ts.map +1 -1
- package/lib/WABinary/generic-utils.js +1 -1
- package/lib/WABinary/index.d.ts +5 -5
- package/lib/WABinary/index.js +5 -5
- package/lib/WABinary/types.d.ts +1 -1
- package/lib/WABinary/types.js +1 -1
- package/lib/WAM/BinaryInfo.d.ts +1 -1
- package/lib/WAM/encode.d.ts +2 -2
- package/lib/WAM/encode.d.ts.map +1 -1
- package/lib/WAM/encode.js +2 -2
- package/lib/WAM/index.d.ts +3 -3
- package/lib/WAM/index.js +3 -3
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +3 -3
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +2 -2
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +1 -1
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +1 -1
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +2 -2
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +1 -1
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +3 -3
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +2 -2
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +3 -3
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +2 -2
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +3 -3
- package/lib/WAUSync/Protocols/index.d.ts +5 -5
- package/lib/WAUSync/Protocols/index.js +5 -5
- package/lib/WAUSync/USyncQuery.d.ts +3 -3
- package/lib/WAUSync/USyncQuery.js +5 -5
- package/lib/WAUSync/index.d.ts +3 -3
- package/lib/WAUSync/index.js +3 -3
- package/lib/index.d.ts +10 -10
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +13 -13
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/lib/Utils/self-updater.d.ts.map +0 -1
- package/lib/Utils/self-updater.js.map +0 -1
package/lib/Utils/chat-utils.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Boom } from '@hapi/boom';
|
|
2
2
|
import { expandAppStateKeys } from 'whatsapp-rust-bridge';
|
|
3
3
|
import { proto } from '../../WAProto/index.js';
|
|
4
|
-
import { LabelAssociationType } from '../Types/LabelAssociation
|
|
5
|
-
import { getBinaryNodeChild, getBinaryNodeChildren, isJidGroup, jidNormalizedUser } from '../WABinary
|
|
6
|
-
import { aesDecrypt, aesEncrypt, hmacSign } from './crypto
|
|
7
|
-
import { toNumber } from './generics
|
|
8
|
-
import { LT_HASH_ANTI_TAMPERING } from './lt-hash
|
|
9
|
-
import { downloadContentFromMessage } from './messages-media
|
|
10
|
-
import { emitSyncActionResults, processContactAction } from './sync-action-utils
|
|
4
|
+
import { LabelAssociationType } from '../Types/LabelAssociation';
|
|
5
|
+
import { getBinaryNodeChild, getBinaryNodeChildren, isJidGroup, jidNormalizedUser } from '../WABinary';
|
|
6
|
+
import { aesDecrypt, aesEncrypt, hmacSign } from './crypto';
|
|
7
|
+
import { toNumber } from './generics';
|
|
8
|
+
import { LT_HASH_ANTI_TAMPERING } from './lt-hash';
|
|
9
|
+
import { downloadContentFromMessage } from './messages-media';
|
|
10
|
+
import { emitSyncActionResults, processContactAction } from './sync-action-utils';
|
|
11
11
|
const mutationKeys = (keydata) => {
|
|
12
12
|
const keys = expandAppStateKeys(keydata);
|
|
13
13
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { AuthenticationCreds, WABrowserDescription } from '../Types
|
|
2
|
-
import type { BinaryNode } from '../WABinary
|
|
3
|
-
import type { ILogger } from './logger
|
|
1
|
+
import type { AuthenticationCreds, WABrowserDescription } from '../Types';
|
|
2
|
+
import type { BinaryNode } from '../WABinary';
|
|
3
|
+
import type { ILogger } from './logger';
|
|
4
4
|
export declare enum CompanionWebClientType {
|
|
5
5
|
UNKNOWN = 0,
|
|
6
6
|
CHROME = 1,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomBytes } from 'crypto';
|
|
2
|
-
import { getBinaryNodeChild } from '../WABinary
|
|
2
|
+
import { getBinaryNodeChild } from '../WABinary';
|
|
3
3
|
export var CompanionWebClientType;
|
|
4
4
|
(function (CompanionWebClientType) {
|
|
5
5
|
CompanionWebClientType[CompanionWebClientType["UNKNOWN"] = 0] = "UNKNOWN";
|
package/lib/Utils/crypto.d.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import type { KeyPair } from '../Types
|
|
1
|
+
import type { KeyPair } from '../Types';
|
|
2
2
|
export { md5, hkdf } from 'whatsapp-rust-bridge';
|
|
3
3
|
/** prefix version byte to the pub keys, required for some curve crypto functions */
|
|
4
|
-
export declare const generateSignalPubKey: (pubKey: Uint8Array | Buffer) =>
|
|
4
|
+
export declare const generateSignalPubKey: (pubKey: Uint8Array | Buffer) => any;
|
|
5
5
|
export declare const Curve: {
|
|
6
6
|
generateKeyPair: () => KeyPair;
|
|
7
|
-
sharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) =>
|
|
8
|
-
sign: (privateKey: Uint8Array, buf: Uint8Array) =>
|
|
7
|
+
sharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => any;
|
|
8
|
+
sign: (privateKey: Uint8Array, buf: Uint8Array) => any;
|
|
9
9
|
verify: (pubKey: Uint8Array, message: Uint8Array, signature: Uint8Array) => boolean;
|
|
10
10
|
};
|
|
11
11
|
export declare const signedKeyPair: (identityKeyPair: KeyPair, keyId: number) => {
|
|
12
12
|
keyPair: KeyPair;
|
|
13
|
-
signature:
|
|
13
|
+
signature: any;
|
|
14
14
|
keyId: number;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* encrypt AES 256 GCM;
|
|
18
18
|
* where the tag tag is suffixed to the ciphertext
|
|
19
19
|
* */
|
|
20
|
-
export declare function aesEncryptGCM(plaintext: Uint8Array, key: Uint8Array, iv: Uint8Array, additionalData: Uint8Array):
|
|
20
|
+
export declare function aesEncryptGCM(plaintext: Uint8Array, key: Uint8Array, iv: Uint8Array, additionalData: Uint8Array): any;
|
|
21
21
|
/**
|
|
22
22
|
* decrypt AES 256 GCM;
|
|
23
23
|
* where the auth tag is suffixed to the ciphertext
|
|
24
24
|
* */
|
|
25
|
-
export declare function aesDecryptGCM(ciphertext: Uint8Array, key: Uint8Array, iv: Uint8Array, additionalData: Uint8Array):
|
|
26
|
-
export declare function aesEncryptCTR(plaintext: Uint8Array, key: Uint8Array, iv: Uint8Array):
|
|
27
|
-
export declare function aesDecryptCTR(ciphertext: Uint8Array, key: Uint8Array, iv: Uint8Array):
|
|
25
|
+
export declare function aesDecryptGCM(ciphertext: Uint8Array, key: Uint8Array, iv: Uint8Array, additionalData: Uint8Array): any;
|
|
26
|
+
export declare function aesEncryptCTR(plaintext: Uint8Array, key: Uint8Array, iv: Uint8Array): any;
|
|
27
|
+
export declare function aesDecryptCTR(ciphertext: Uint8Array, key: Uint8Array, iv: Uint8Array): any;
|
|
28
28
|
/** decrypt AES 256 CBC; where the IV is prefixed to the buffer */
|
|
29
|
-
export declare function aesDecrypt(buffer: Uint8Array, key: Uint8Array):
|
|
29
|
+
export declare function aesDecrypt(buffer: Uint8Array, key: Uint8Array): any;
|
|
30
30
|
/** decrypt AES 256 CBC */
|
|
31
|
-
export declare function aesDecryptWithIV(buffer: Uint8Array, key: Uint8Array, IV: Uint8Array):
|
|
32
|
-
export declare function aesEncrypt(buffer: Uint8Array, key: Uint8Array):
|
|
33
|
-
export declare function aesEncrypWithIV(buffer: Buffer, key: Buffer, IV: Buffer):
|
|
34
|
-
export declare function hmacSign(buffer: Buffer | Uint8Array, key: Buffer | Uint8Array, variant?: 'sha256' | 'sha512'):
|
|
35
|
-
export declare function sha256(buffer: Buffer):
|
|
31
|
+
export declare function aesDecryptWithIV(buffer: Uint8Array, key: Uint8Array, IV: Uint8Array): any;
|
|
32
|
+
export declare function aesEncrypt(buffer: Uint8Array, key: Uint8Array): any;
|
|
33
|
+
export declare function aesEncrypWithIV(buffer: Buffer, key: Buffer, IV: Buffer): any;
|
|
34
|
+
export declare function hmacSign(buffer: Buffer | Uint8Array, key: Buffer | Uint8Array, variant?: 'sha256' | 'sha512'): any;
|
|
35
|
+
export declare function sha256(buffer: Buffer): any;
|
|
36
36
|
export declare function derivePairingCodeKey(pairingCode: string, salt: Buffer): Promise<Buffer>;
|
|
37
37
|
//# sourceMappingURL=crypto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/Utils/crypto.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;A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EAAE,UAAU,OAGnF;AAGD,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,OAI7D;AAGD,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAGtE;AAGD,wBAAgB,QAAQ,CACvB,MAAM,EAAE,MAAM,GAAG,UAAU,EAC3B,GAAG,EAAE,MAAM,GAAG,UAAU,EACxB,OAAO,GAAE,QAAQ,GAAG,QAAmB,OAGvC;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,OAEpC;AAED,wBAAsB,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAyB7F"}
|
package/lib/Utils/crypto.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createCipheriv, createDecipheriv, createHash, createHmac, randomBytes } from 'crypto';
|
|
2
2
|
import * as curve from 'libsignal/src/curve.js';
|
|
3
|
-
import { KEY_BUNDLE_TYPE } from '../Defaults
|
|
3
|
+
import { KEY_BUNDLE_TYPE } from '../Defaults';
|
|
4
4
|
export { md5, hkdf } from 'whatsapp-rust-bridge';
|
|
5
5
|
// insure browser & node compatibility
|
|
6
6
|
const { subtle } = globalThis.crypto;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { WAMessage } from '../Types
|
|
2
|
-
import type { SignalRepositoryWithLIDStore } from '../Types/Signal
|
|
3
|
-
import { type BinaryNode } from '../WABinary
|
|
4
|
-
import type { ILogger } from './logger
|
|
1
|
+
import type { WAMessage } from '../Types';
|
|
2
|
+
import type { SignalRepositoryWithLIDStore } from '../Types/Signal';
|
|
3
|
+
import { type BinaryNode } from '../WABinary';
|
|
4
|
+
import type { ILogger } from './logger';
|
|
5
5
|
export declare const getDecryptionJid: (sender: string, repository: SignalRepositoryWithLIDStore) => Promise<string>;
|
|
6
6
|
export declare const extractNewsletterMessageMeta: (stanza: BinaryNode) => {
|
|
7
7
|
adminProfile?: {
|
|
@@ -2,8 +2,8 @@ import { Boom } from '@hapi/boom';
|
|
|
2
2
|
import { proto } from '../../WAProto/index.js';
|
|
3
3
|
import { areJidsSameUser, isHostedLidUser, isHostedPnUser, isJidBroadcast, isJidGroup, isJidMetaAI, isJidNewsletter, isJidStatusBroadcast, isLidUser, isPnUser
|
|
4
4
|
// transferDevice
|
|
5
|
-
} from '../WABinary
|
|
6
|
-
import { unpadRandomMax16 } from './generics
|
|
5
|
+
} from '../WABinary';
|
|
6
|
+
import { unpadRandomMax16 } from './generics';
|
|
7
7
|
export const getDecryptionJid = async (sender, repository) => {
|
|
8
8
|
if (isLidUser(sender) || isHostedLidUser(sender)) {
|
|
9
9
|
return sender;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BaileysEventEmitter, BaileysEventMap } from '../Types
|
|
2
|
-
import type { ILogger } from './logger
|
|
1
|
+
import type { BaileysEventEmitter, BaileysEventMap } from '../Types';
|
|
2
|
+
import type { ILogger } from './logger';
|
|
3
3
|
/**
|
|
4
4
|
* A map that contains a list of all events that have been triggered
|
|
5
5
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import EventEmitter from 'events';
|
|
2
|
-
import { WAMessageStatus } from '../Types
|
|
3
|
-
import { trimUndefined } from './generics
|
|
4
|
-
import { updateMessageWithReaction, updateMessageWithReceipt } from './messages
|
|
5
|
-
import { isRealMessage, shouldIncrementChatUnread } from './process-message
|
|
2
|
+
import { WAMessageStatus } from '../Types';
|
|
3
|
+
import { trimUndefined } from './generics';
|
|
4
|
+
import { updateMessageWithReaction, updateMessageWithReceipt } from './messages';
|
|
5
|
+
import { isRealMessage, shouldIncrementChatUnread } from './process-message';
|
|
6
6
|
const BUFFERABLE_EVENT = [
|
|
7
7
|
'messaging-history.set',
|
|
8
8
|
'chats.upsert',
|
package/lib/Utils/generics.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type Long from 'long';
|
|
2
2
|
import { proto } from '../../WAProto/index.js';
|
|
3
|
-
import type { BaileysEventEmitter, BaileysEventMap, ConnectionState, WACallUpdateType, WAMessageKey, WAVersion } from '../Types
|
|
4
|
-
import { type BinaryNode } from '../WABinary
|
|
3
|
+
import type { BaileysEventEmitter, BaileysEventMap, ConnectionState, WACallUpdateType, WAMessageKey, WAVersion } from '../Types';
|
|
4
|
+
import { type BinaryNode } from '../WABinary';
|
|
5
5
|
export declare const BufferJSON: {
|
|
6
6
|
replacer: (k: any, value: any) => any;
|
|
7
7
|
reviver: (_: any, value: any) => any;
|
|
8
8
|
};
|
|
9
9
|
export declare const getKeyAuthor: (key: WAMessageKey | undefined | null, meId?: string) => string;
|
|
10
10
|
export declare const isStringNullOrEmpty: (value: string | null | undefined) => value is null | undefined | "";
|
|
11
|
-
export declare const writeRandomPadMax16: (msg: Uint8Array) =>
|
|
12
|
-
export declare const unpadRandomMax16: (e: Uint8Array | Buffer) => Uint8Array<
|
|
11
|
+
export declare const writeRandomPadMax16: (msg: Uint8Array) => any;
|
|
12
|
+
export declare const unpadRandomMax16: (e: Uint8Array | Buffer) => Uint8Array<any>;
|
|
13
13
|
export declare const generateParticipantHashV2: (participants: string[]) => string;
|
|
14
|
-
export declare const encodeWAMessage: (message: proto.IMessage) =>
|
|
14
|
+
export declare const encodeWAMessage: (message: proto.IMessage) => any;
|
|
15
15
|
export declare const generateRegistrationId: () => number;
|
|
16
16
|
export declare const encodeBigEndian: (e: number, t?: number) => Uint8Array<ArrayBuffer>;
|
|
17
17
|
export declare const toNumber: (t: Long | number | null | undefined) => number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generics.d.ts","sourceRoot":"","sources":["../../src/Utils/generics.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE9C,OAAO,KAAK,E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import { proto } from '../../WAProto/index.js';
|
|
4
4
|
const baileysVersion = [2, 3000, 1043857760];
|
|
5
|
-
import { DisconnectReason } from '../Types
|
|
6
|
-
import { getAllBinaryNodeChildren, jidDecode } from '../WABinary
|
|
7
|
-
import { sha256 } from './crypto
|
|
5
|
+
import { DisconnectReason } from '../Types';
|
|
6
|
+
import { getAllBinaryNodeChildren, jidDecode } from '../WABinary';
|
|
7
|
+
import { sha256 } from './crypto';
|
|
8
8
|
export const BufferJSON = {
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
10
|
replacer: (k, value) => {
|
package/lib/Utils/history.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proto } from '../../WAProto/index.js';
|
|
2
|
-
import type { Chat, Contact, LIDMapping, WAMessage } from '../Types
|
|
2
|
+
import type { Chat, Contact, LIDMapping, WAMessage } from '../Types';
|
|
3
3
|
import type { ILogger } from './logger.js';
|
|
4
4
|
export declare const downloadHistory: (msg: proto.Message.IHistorySyncNotification, options: RequestInit) => Promise<proto.HistorySync>;
|
|
5
5
|
export declare const processHistoryMessage: (item: proto.IHistorySync, logger?: ILogger) => {
|
package/lib/Utils/history.js
CHANGED
|
@@ -2,11 +2,11 @@ import { pipeline } from 'stream/promises';
|
|
|
2
2
|
import { promisify } from 'util';
|
|
3
3
|
import { createInflate, inflate } from 'zlib';
|
|
4
4
|
import { proto } from '../../WAProto/index.js';
|
|
5
|
-
import { WAMessageStubType } from '../Types
|
|
6
|
-
import { isHostedLidUser, isHostedPnUser, isLidUser, isPnUser } from '../WABinary
|
|
7
|
-
import { toNumber } from './generics
|
|
8
|
-
import { normalizeMessageContent } from './messages
|
|
9
|
-
import { downloadContentFromMessage } from './messages-media
|
|
5
|
+
import { WAMessageStubType } from '../Types';
|
|
6
|
+
import { isHostedLidUser, isHostedPnUser, isLidUser, isPnUser } from '../WABinary';
|
|
7
|
+
import { toNumber } from './generics';
|
|
8
|
+
import { normalizeMessageContent } from './messages';
|
|
9
|
+
import { downloadContentFromMessage } from './messages-media';
|
|
10
10
|
const inflatePromise = promisify(inflate);
|
|
11
11
|
const extractPnFromMessages = (messages) => {
|
|
12
12
|
for (const msgItem of messages) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import NodeCache from '@cacheable/node-cache';
|
|
2
|
-
import { type BinaryNode } from '../WABinary
|
|
3
|
-
import type { ILogger } from './logger
|
|
2
|
+
import { type BinaryNode } from '../WABinary';
|
|
3
|
+
import type { ILogger } from './logger';
|
|
4
4
|
export type IdentityChangeResult = {
|
|
5
5
|
action: 'no_identity_node';
|
|
6
6
|
} | {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import NodeCache from '@cacheable/node-cache';
|
|
2
|
-
import { areJidsSameUser, getBinaryNodeChild, jidDecode } from '../WABinary
|
|
3
|
-
import { isStringNullOrEmpty } from './generics
|
|
2
|
+
import { areJidsSameUser, getBinaryNodeChild, jidDecode } from '../WABinary';
|
|
3
|
+
import { isStringNullOrEmpty } from './generics';
|
|
4
4
|
export async function handleIdentityChange(node, ctx) {
|
|
5
5
|
const from = node.attrs.from;
|
|
6
6
|
if (!from) {
|
package/lib/Utils/index.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export * from './generics
|
|
2
|
-
export * from './decode-wa-message
|
|
3
|
-
export * from './messages
|
|
4
|
-
export * from './messages-media
|
|
5
|
-
export * from './validate-connection
|
|
6
|
-
export * from './crypto
|
|
7
|
-
export * from './signal
|
|
8
|
-
export * from './noise-handler
|
|
9
|
-
export * from './history
|
|
10
|
-
export * from './chat-utils
|
|
11
|
-
export * from './lt-hash
|
|
12
|
-
export * from './auth-utils
|
|
13
|
-
export * from './use-multi-file-auth-state
|
|
14
|
-
export * from './link-preview
|
|
15
|
-
export * from './event-buffer
|
|
16
|
-
export * from './process-message
|
|
17
|
-
export * from './message-retry-manager
|
|
18
|
-
export * from './browser-utils
|
|
19
|
-
export * from './companion-reg-client-utils
|
|
20
|
-
export * from './identity-change-handler
|
|
21
|
-
export * from './stanza-ack
|
|
1
|
+
export * from './generics';
|
|
2
|
+
export * from './decode-wa-message';
|
|
3
|
+
export * from './messages';
|
|
4
|
+
export * from './messages-media';
|
|
5
|
+
export * from './validate-connection';
|
|
6
|
+
export * from './crypto';
|
|
7
|
+
export * from './signal';
|
|
8
|
+
export * from './noise-handler';
|
|
9
|
+
export * from './history';
|
|
10
|
+
export * from './chat-utils';
|
|
11
|
+
export * from './lt-hash';
|
|
12
|
+
export * from './auth-utils';
|
|
13
|
+
export * from './use-multi-file-auth-state';
|
|
14
|
+
export * from './link-preview';
|
|
15
|
+
export * from './event-buffer';
|
|
16
|
+
export * from './process-message';
|
|
17
|
+
export * from './message-retry-manager';
|
|
18
|
+
export * from './browser-utils';
|
|
19
|
+
export * from './companion-reg-client-utils';
|
|
20
|
+
export * from './identity-change-handler';
|
|
21
|
+
export * from './stanza-ack';
|
|
22
22
|
export * as audioSticker from './audio-sticker.js';
|
|
23
23
|
export * as authStore from './auth-store.js';
|
|
24
24
|
export * as chatTheme from './chat-theme.js';
|
package/lib/Utils/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export * from './generics
|
|
2
|
-
export * from './decode-wa-message
|
|
3
|
-
export * from './messages
|
|
4
|
-
export * from './messages-media
|
|
5
|
-
export * from './validate-connection
|
|
6
|
-
export * from './crypto
|
|
7
|
-
export * from './signal
|
|
8
|
-
export * from './noise-handler
|
|
9
|
-
export * from './history
|
|
10
|
-
export * from './chat-utils
|
|
11
|
-
export * from './lt-hash
|
|
12
|
-
export * from './auth-utils
|
|
13
|
-
export * from './use-multi-file-auth-state
|
|
14
|
-
export * from './link-preview
|
|
15
|
-
export * from './event-buffer
|
|
16
|
-
export * from './process-message
|
|
17
|
-
export * from './message-retry-manager
|
|
18
|
-
export * from './browser-utils
|
|
19
|
-
export * from './companion-reg-client-utils
|
|
20
|
-
export * from './identity-change-handler
|
|
21
|
-
export * from './stanza-ack
|
|
1
|
+
export * from './generics';
|
|
2
|
+
export * from './decode-wa-message';
|
|
3
|
+
export * from './messages';
|
|
4
|
+
export * from './messages-media';
|
|
5
|
+
export * from './validate-connection';
|
|
6
|
+
export * from './crypto';
|
|
7
|
+
export * from './signal';
|
|
8
|
+
export * from './noise-handler';
|
|
9
|
+
export * from './history';
|
|
10
|
+
export * from './chat-utils';
|
|
11
|
+
export * from './lt-hash';
|
|
12
|
+
export * from './auth-utils';
|
|
13
|
+
export * from './use-multi-file-auth-state';
|
|
14
|
+
export * from './link-preview';
|
|
15
|
+
export * from './event-buffer';
|
|
16
|
+
export * from './process-message';
|
|
17
|
+
export * from './message-retry-manager';
|
|
18
|
+
export * from './browser-utils';
|
|
19
|
+
export * from './companion-reg-client-utils';
|
|
20
|
+
export * from './identity-change-handler';
|
|
21
|
+
export * from './stanza-ack';
|
|
22
22
|
// QIRO modern extension utilities are exported as namespaces to avoid
|
|
23
23
|
// colliding with the pre-existing QIRO Extension and MessageBuilder APIs.
|
|
24
24
|
export * as audioSticker from './audio-sticker.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { WAMediaUploadFunction, WAUrlInfo } from '../Types
|
|
2
|
-
import type { ILogger } from './logger
|
|
1
|
+
import type { WAMediaUploadFunction, WAUrlInfo } from '../Types';
|
|
2
|
+
import type { ILogger } from './logger';
|
|
3
3
|
export type URLGenerationOptions = {
|
|
4
4
|
thumbnailWidth: number;
|
|
5
5
|
fetchOpts: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { prepareWAMessageMedia } from './messages
|
|
2
|
-
import { extractImageThumb, getHttpStream } from './messages-media
|
|
1
|
+
import { prepareWAMessageMedia } from './messages';
|
|
2
|
+
import { extractImageThumb, getHttpStream } from './messages-media';
|
|
3
3
|
const THUMBNAIL_WIDTH_PX = 192;
|
|
4
4
|
/** Fetches an image and generates a thumbnail for it */
|
|
5
5
|
const getCompressedJpegThumbnail = async (url, { thumbnailWidth, fetchOpts }) => {
|
package/lib/Utils/logger.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ export interface ILogger {
|
|
|
7
7
|
warn(obj: unknown, msg?: string): void;
|
|
8
8
|
error(obj: unknown, msg?: string): void;
|
|
9
9
|
}
|
|
10
|
-
declare const _default:
|
|
10
|
+
declare const _default: any;
|
|
11
11
|
export default _default;
|
|
12
12
|
//# sourceMappingURL=logger.d.ts.map
|
package/lib/Utils/lt-hash.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { LTHashAntiTampering } from 'whatsapp-rust-bridge';
|
|
2
1
|
/**
|
|
3
2
|
* LT Hash is a summation based hash algorithm that maintains the integrity of a piece of data
|
|
4
3
|
* over a series of mutations. You can add/remove mutations and it'll return a hash equal to
|
|
5
4
|
* if the same series of mutations was made sequentially.
|
|
6
5
|
*/
|
|
7
|
-
export declare const LT_HASH_ANTI_TAMPERING:
|
|
6
|
+
export declare const LT_HASH_ANTI_TAMPERING: any;
|
|
8
7
|
//# sourceMappingURL=lt-hash.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lt-hash.d.ts","sourceRoot":"","sources":["../../src/Utils/lt-hash.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lt-hash.d.ts","sourceRoot":"","sources":["../../src/Utils/lt-hash.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,KAA4B,CAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Boom } from '@hapi/boom';
|
|
2
2
|
import type { Agent } from 'https';
|
|
3
|
-
import { Readable
|
|
3
|
+
import { Readable } from 'stream';
|
|
4
4
|
import { URL } from 'url';
|
|
5
5
|
import { proto } from '../../WAProto/index.js';
|
|
6
|
-
import { type MediaType } from '../Defaults
|
|
7
|
-
import type { DownloadableMessage, MediaConnInfo, MediaDecryptionKeyInfo, SocketConfig, WAMediaUpload, WAMediaUploadFunction, WAMessageContent, WAMessageKey } from '../Types
|
|
8
|
-
import { type BinaryNode } from '../WABinary
|
|
9
|
-
import type { ILogger } from './logger
|
|
6
|
+
import { type MediaType } from '../Defaults';
|
|
7
|
+
import type { DownloadableMessage, MediaConnInfo, MediaDecryptionKeyInfo, SocketConfig, WAMediaUpload, WAMediaUploadFunction, WAMessageContent, WAMessageKey } from '../Types';
|
|
8
|
+
import { type BinaryNode } from '../WABinary';
|
|
9
|
+
import type { ILogger } from './logger';
|
|
10
10
|
export declare const getImageProcessingLibrary: () => Promise<{
|
|
11
11
|
sharp: any;
|
|
12
12
|
jimp?: undefined;
|
|
@@ -22,8 +22,8 @@ export declare const getImageProcessingLibrary: () => Promise<{
|
|
|
22
22
|
}>;
|
|
23
23
|
export declare const hkdfInfoKey: (type: MediaType) => string;
|
|
24
24
|
export declare const getRawMediaUploadData: (media: WAMediaUpload, mediaType: MediaType, logger?: ILogger) => Promise<{
|
|
25
|
-
filePath:
|
|
26
|
-
fileSha256:
|
|
25
|
+
filePath: any;
|
|
26
|
+
fileSha256: any;
|
|
27
27
|
fileLength: number;
|
|
28
28
|
}>;
|
|
29
29
|
/** generates all the keys required to encrypt/decrypt & sign a media message */
|
|
@@ -45,7 +45,7 @@ export declare const extractImageThumb: (bufferOrFilePath: Readable | Buffer | s
|
|
|
45
45
|
height: any;
|
|
46
46
|
};
|
|
47
47
|
} | {
|
|
48
|
-
buffer:
|
|
48
|
+
buffer: any;
|
|
49
49
|
original: {
|
|
50
50
|
width?: undefined;
|
|
51
51
|
height?: undefined;
|
|
@@ -58,30 +58,30 @@ export declare const generateProfilePicture: (mediaUpload: WAMediaUpload, dimens
|
|
|
58
58
|
full?: boolean;
|
|
59
59
|
quality?: number;
|
|
60
60
|
}) => Promise<{
|
|
61
|
-
img: Buffer
|
|
61
|
+
img: Buffer;
|
|
62
62
|
}>;
|
|
63
63
|
/** gets the SHA256 of the given media message */
|
|
64
|
-
export declare const mediaMessageSHA256B64: (message: WAMessageContent) =>
|
|
65
|
-
export declare function getAudioDuration(buffer: Buffer | string | Readable): Promise<
|
|
64
|
+
export declare const mediaMessageSHA256B64: (message: WAMessageContent) => any;
|
|
65
|
+
export declare function getAudioDuration(buffer: Buffer | string | Readable): Promise<any>;
|
|
66
66
|
/**
|
|
67
67
|
referenced from and modifying https://github.com/wppconnect-team/wa-js/blob/main/src/chat/functions/prepareAudioWaveform.ts
|
|
68
68
|
*/
|
|
69
69
|
export declare function getAudioWaveform(buffer: Buffer | string | Readable, logger?: ILogger): Promise<Uint8Array<ArrayBuffer> | undefined>;
|
|
70
|
-
export declare const toReadable: (buffer: Buffer) =>
|
|
71
|
-
export declare const toBuffer: (stream: Readable) => Promise<
|
|
70
|
+
export declare const toReadable: (buffer: Buffer) => any;
|
|
71
|
+
export declare const toBuffer: (stream: Readable) => Promise<any>;
|
|
72
72
|
export declare const getStream: (item: WAMediaUpload, opts?: RequestInit & {
|
|
73
73
|
maxContentLength?: number;
|
|
74
74
|
}) => Promise<{
|
|
75
|
-
readonly stream:
|
|
75
|
+
readonly stream: any;
|
|
76
76
|
readonly type: "buffer";
|
|
77
77
|
} | {
|
|
78
|
-
readonly stream:
|
|
78
|
+
readonly stream: any;
|
|
79
79
|
readonly type: "readable";
|
|
80
80
|
} | {
|
|
81
|
-
readonly stream:
|
|
81
|
+
readonly stream: any;
|
|
82
82
|
readonly type: "remote";
|
|
83
83
|
} | {
|
|
84
|
-
readonly stream:
|
|
84
|
+
readonly stream: any;
|
|
85
85
|
readonly type: "file";
|
|
86
86
|
}>;
|
|
87
87
|
/** generates a thumbnail for a given media, if required */
|
|
@@ -96,19 +96,19 @@ export declare function generateThumbnail(file: string, mediaType: 'video' | 'im
|
|
|
96
96
|
}>;
|
|
97
97
|
export declare const getHttpStream: (url: string | URL, options?: RequestInit & {
|
|
98
98
|
isStream?: true;
|
|
99
|
-
}) => Promise<
|
|
99
|
+
}) => Promise<any>;
|
|
100
100
|
type EncryptedStreamOptions = {
|
|
101
101
|
saveOriginalFileIfRequired?: boolean;
|
|
102
102
|
logger?: ILogger;
|
|
103
103
|
opts?: RequestInit;
|
|
104
104
|
};
|
|
105
105
|
export declare const encryptedStream: (media: WAMediaUpload, mediaType: MediaType, { logger, saveOriginalFileIfRequired, opts }?: EncryptedStreamOptions, hkdfInfo?: string) => Promise<{
|
|
106
|
-
mediaKey:
|
|
106
|
+
mediaKey: any;
|
|
107
107
|
originalFilePath: string | undefined;
|
|
108
|
-
encFilePath:
|
|
109
|
-
mac:
|
|
110
|
-
fileEncSha256:
|
|
111
|
-
fileSha256:
|
|
108
|
+
encFilePath: any;
|
|
109
|
+
mac: any;
|
|
110
|
+
fileEncSha256: any;
|
|
111
|
+
fileSha256: any;
|
|
112
112
|
fileLength: number;
|
|
113
113
|
}>;
|
|
114
114
|
export declare const DEF_MEDIA_HOST = "mmg.whatsapp.net";
|
|
@@ -120,12 +120,12 @@ export type MediaDownloadOptions = {
|
|
|
120
120
|
host?: string;
|
|
121
121
|
};
|
|
122
122
|
export declare const getUrlFromDirectPath: (directPath: string, host?: string) => string;
|
|
123
|
-
export declare const downloadContentFromMessage: ({ mediaKey, directPath, url }: DownloadableMessage, type: MediaType, opts?: MediaDownloadOptions) => Promise<
|
|
123
|
+
export declare const downloadContentFromMessage: ({ mediaKey, directPath, url }: DownloadableMessage, type: MediaType, opts?: MediaDownloadOptions) => Promise<any>;
|
|
124
124
|
/**
|
|
125
125
|
* Decrypts and downloads an AES256-CBC encrypted file given the keys.
|
|
126
126
|
* Assumes the SHA256 of the plaintext is appended to the end of the ciphertext
|
|
127
127
|
* */
|
|
128
|
-
export declare const downloadEncryptedContent: (downloadUrl: string, { cipherKey, iv }: MediaDecryptionKeyInfo, { startByte, endByte, options }?: MediaDownloadOptions) => Promise<
|
|
128
|
+
export declare const downloadEncryptedContent: (downloadUrl: string, { cipherKey, iv }: MediaDecryptionKeyInfo, { startByte, endByte, options }?: MediaDownloadOptions) => Promise<any>;
|
|
129
129
|
export declare function extensionForMediaMessage(message: WAMessageContent): string;
|
|
130
130
|
type MediaUploadResult = {
|
|
131
131
|
url?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages-media.d.ts","sourceRoot":"","sources":["../../src/Utils/messages-media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAKjC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAIlC,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"messages-media.d.ts","sourceRoot":"","sources":["../../src/Utils/messages-media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAKjC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAIlC,OAAO,EAAE,QAAQ,EAAa,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAC9C,OAAO,EAAqF,KAAK,SAAS,EAAE,MAAM,aAAa,CAAA;AAC/H,OAAO,KAAK,EAEX,mBAAmB,EACnB,aAAa,EACb,sBAAsB,EAEtB,YAAY,EAEZ,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,KAAK,UAAU,EAAmE,MAAM,aAAa,CAAA;AAG9G,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAIvC,eAAO,MAAM,yBAAyB;;;;;;;;;;;;EAcrC,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,MAAM,SAAS,WAG1C,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAU,OAAO,aAAa,EAAE,WAAW,SAAS,EAAE,SAAS,OAAO;;;;EAuCvG,CAAA;AAED,gFAAgF;AAChF,wBAAsB,YAAY,CACjC,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,GAAG,S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"}
|
|
@@ -8,10 +8,10 @@ import { join } from 'path';
|
|
|
8
8
|
import { Readable, Transform } from 'stream';
|
|
9
9
|
import { URL } from 'url';
|
|
10
10
|
import { proto } from '../../WAProto/index.js';
|
|
11
|
-
import { DEFAULT_ORIGIN, MEDIA_HKDF_KEY_MAPPING, MEDIA_PATH_MAP, NEWSLETTER_MEDIA_PATH_MAP } from '../Defaults
|
|
12
|
-
import { getBinaryNodeChild, getBinaryNodeChildBuffer, jidNormalizedUser } from '../WABinary
|
|
13
|
-
import { aesDecryptGCM, aesEncryptGCM, hkdf } from './crypto
|
|
14
|
-
import { generateMessageIDV2 } from './generics
|
|
11
|
+
import { DEFAULT_ORIGIN, MEDIA_HKDF_KEY_MAPPING, MEDIA_PATH_MAP, NEWSLETTER_MEDIA_PATH_MAP } from '../Defaults';
|
|
12
|
+
import { getBinaryNodeChild, getBinaryNodeChildBuffer, jidNormalizedUser } from '../WABinary';
|
|
13
|
+
import { aesDecryptGCM, aesEncryptGCM, hkdf } from './crypto';
|
|
14
|
+
import { generateMessageIDV2 } from './generics';
|
|
15
15
|
const getTmpFilesDirectory = () => tmpdir();
|
|
16
16
|
export const getImageProcessingLibrary = async () => {
|
|
17
17
|
const loadOptional = async (name) => {
|