@awangxcode/qiro-baileys 7.1.2 → 7.1.3
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 +18 -13
- package/lib/Defaults/index.js +3 -3
- package/lib/MessageBuilder/index.js +2 -2
- package/lib/Signal/Group/group-session-builder.js +4 -4
- package/lib/Signal/Group/group_cipher.js +4 -4
- package/lib/Signal/Group/index.js +11 -11
- package/lib/Signal/Group/sender-chain-key.js +1 -1
- package/lib/Signal/Group/sender-key-distribution-message.js +1 -1
- package/lib/Signal/Group/sender-key-message.js +1 -1
- package/lib/Signal/Group/sender-key-record.js +2 -2
- package/lib/Signal/Group/sender-key-state.js +2 -2
- package/lib/Signal/libsignal.js +6 -6
- package/lib/Signal/lid-mapping.js +1 -1
- package/lib/Socket/Client/index.js +2 -2
- package/lib/Socket/Client/websocket.js +2 -2
- package/lib/Socket/business.js +5 -5
- package/lib/Socket/chats.js +9 -9
- package/lib/Socket/communities.js +5 -5
- package/lib/Socket/groups.js +4 -4
- package/lib/Socket/index.js +4 -4
- package/lib/Socket/messages-recv.js +10 -10
- package/lib/Socket/messages-send.js +9 -9
- package/lib/Socket/mex.js +1 -1
- package/lib/Socket/newsletter.js +5 -5
- package/lib/Socket/socket.js +7 -7
- package/lib/Types/Socket.js +1 -1
- package/lib/Types/USync.js +1 -1
- package/lib/Types/index.js +12 -12
- package/lib/Utils/auth-utils.js +4 -4
- package/lib/Utils/business.js +3 -3
- package/lib/Utils/chat-utils.js +7 -7
- package/lib/Utils/companion-reg-client-utils.js +1 -1
- package/lib/Utils/crypto.js +1 -1
- package/lib/Utils/decode-wa-message.js +2 -2
- package/lib/Utils/event-buffer.js +4 -4
- package/lib/Utils/generics.js +3 -3
- package/lib/Utils/history.js +5 -5
- package/lib/Utils/identity-change-handler.js +2 -2
- package/lib/Utils/index.js +21 -21
- package/lib/Utils/link-preview.js +2 -2
- package/lib/Utils/messages-media.js +4 -4
- package/lib/Utils/messages.js +7 -7
- package/lib/Utils/noise-handler.js +3 -3
- package/lib/Utils/process-message.js +7 -7
- package/lib/Utils/reporting-utils.js +1 -1
- package/lib/Utils/signal.js +4 -4
- package/lib/Utils/sync-action-utils.js +1 -1
- package/lib/Utils/tc-token-utils.js +1 -1
- package/lib/Utils/use-multi-file-auth-state.js +2 -2
- package/lib/Utils/validate-connection.js +5 -5
- package/lib/WABinary/decode.js +2 -2
- package/lib/WABinary/encode.js +2 -2
- package/lib/WABinary/generic-utils.js +1 -1
- package/lib/WABinary/index.js +5 -5
- package/lib/WABinary/types.js +1 -1
- package/lib/WAM/encode.js +2 -2
- package/lib/WAM/index.js +3 -3
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +2 -2
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +1 -1
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +1 -1
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +1 -1
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +2 -2
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +2 -2
- package/lib/WAUSync/Protocols/index.js +5 -5
- package/lib/WAUSync/USyncQuery.js +5 -5
- package/lib/WAUSync/index.js +3 -3
- package/lib/index.js +11 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
> Gunakan secara bertanggung jawab, patuhi ketentuan layanan yang berlaku, dan uji fungsi berisiko pada akun sekunder sebelum dipakai pada akun utama.
|
|
32
32
|
|
|
33
33
|
> [!NOTE]
|
|
34
|
-
> 📦 Source pada arsip ini disiapkan untuk versi paket `7.1.
|
|
34
|
+
> 📦 Source pada arsip ini disiapkan untuk versi paket `7.1.3` (stable). API yang bergantung pada protokol internal atau peluncuran bertahap WhatsApp tetap ditandai sebagai **eksperimental**. Lolosnya pemeriksaan lokal tidak menjamin semua fitur tersedia pada setiap akun atau server WhatsApp.
|
|
35
35
|
|
|
36
36
|
> [!CAUTION]
|
|
37
37
|
> 🔐 Direktori autentikasi berisi kredensial dan kunci Signal. Jangan mengunggah folder sesi, berkas `.env`, token, cadangan autentikasi, atau basis data sesi ke repositori publik maupun arsip distribusi.
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
Gunakan halaman [Issues QIRO Baileys](https://github.com/AwangXoffc/baileys-pro/issues) untuk melaporkan bug, ketidakcocokan, atau dokumentasi yang perlu diperbaiki. Agar laporan bisa ditindaklanjuti, sertakan:
|
|
42
42
|
|
|
43
|
-
1. Versi QIRO (`7.1.
|
|
43
|
+
1. Versi QIRO (`7.1.3`), versi Node.js, versi Termux/OS, dan cara instalasi.
|
|
44
44
|
2. Langkah reproduksi paling kecil yang masih menunjukkan masalah.
|
|
45
45
|
3. Perilaku yang diharapkan dan perilaku yang benar-benar terjadi.
|
|
46
46
|
4. Pesan error lengkap serta nama file/baris bila tersedia.
|
|
@@ -65,7 +65,7 @@ Sebelum mengirim log, samarkan nomor telepon, JID pribadi, isi pesan, URL privat
|
|
|
65
65
|
| [✉️ 10 · Mengirim pesan](#10--mengirim-pesan) | Teks, media, lokasi, polling | [🏗️ 24 · Build, tes, dan rilis](#24--build-tes-dan-rilis) | Kompilasi dan paket npm |
|
|
66
66
|
| [🎞️ 11 · Media tingkat lanjut](#11--media-tingkat-lanjut) | Album, Audio Sticker, HD, tema | [📱 25 · Panduan Termux](#25--panduan-termux) | Build dari Android |
|
|
67
67
|
| [🧩 12 · Pesan interaktif](#12--pesan-interaktif) | MessageBuilder, Button, Native Flow, carousel | [🧯 26 · Penanganan masalah](#26--penanganan-masalah) | Solusi kendala umum |
|
|
68
|
-
| [🤖 13 · AIRich dan A2UI](#13--airich-dan-a2ui) | Kartu, tabel, kode, peta | [📝 27 · Catatan rilis](#27--catatan-rilis) | Rilis stabil 7.1.
|
|
68
|
+
| [🤖 13 · AIRich dan A2UI](#13--airich-dan-a2ui) | Kartu, tabel, kode, peta | [📝 27 · Catatan rilis](#27--catatan-rilis) | Rilis stabil 7.1.3 |
|
|
69
69
|
| [🌐 14 · HTML dan tautan kaya](#14--html-dan-tautan-kaya) | Mini App dan pratinjau sosial | [Lisensi dan keamanan](#lisensi-dan-keamanan) | Penggunaan dan atribusi |
|
|
70
70
|
| [🐞 Menemukan Bug?](#menemukan-bug-atau-perilaku-yang-tidak-sesuai) | Pedoman laporan isu | [🙏 Kredit dan kontribusi](#kredit-dan-kontribusi) | Pemelihara dan upstream |
|
|
71
71
|
|
|
@@ -80,7 +80,7 @@ Rilis pada arsip ini:
|
|
|
80
80
|
| Keterangan | Nilai |
|
|
81
81
|
|---|---|
|
|
82
82
|
| Nama paket | `@awangxcode/qiro-baileys` |
|
|
83
|
-
| Versi source | `7.1.
|
|
83
|
+
| Versi source | `7.1.3` |
|
|
84
84
|
| Pengembang dan pemelihara | AXCODE iD / AwangXcode |
|
|
85
85
|
| Runtime | Node.js 20 atau lebih baru |
|
|
86
86
|
| Sistem modul | ESM |
|
|
@@ -190,7 +190,7 @@ npm --version
|
|
|
190
190
|
Pasang versi QIRO yang didokumentasikan pada arsip ini:
|
|
191
191
|
|
|
192
192
|
```bash
|
|
193
|
-
npm install @awangxcode/qiro-baileys@7.1.
|
|
193
|
+
npm install @awangxcode/qiro-baileys@7.1.3
|
|
194
194
|
```
|
|
195
195
|
|
|
196
196
|
Paket menggunakan ESM. Pada aplikasi pemakai, gunakan `import` dan deklarasikan sistem modul ESM pada `package.json`:
|
|
@@ -199,7 +199,7 @@ Paket menggunakan ESM. Pada aplikasi pemakai, gunakan `import` dan deklarasikan
|
|
|
199
199
|
{
|
|
200
200
|
"type": "module",
|
|
201
201
|
"dependencies": {
|
|
202
|
-
"@awangxcode/qiro-baileys": "7.1.
|
|
202
|
+
"@awangxcode/qiro-baileys": "7.1.3"
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
```
|
|
@@ -1798,7 +1798,7 @@ Pastikan paket mencakup `lib/`, `WAProto/`, aset branding, `README.md`, dan `LIC
|
|
|
1798
1798
|
|
|
1799
1799
|
```bash
|
|
1800
1800
|
npm pack --dry-run
|
|
1801
|
-
npm view @awangxcode/qiro-baileys@7.1.
|
|
1801
|
+
npm view @awangxcode/qiro-baileys@7.1.3 version
|
|
1802
1802
|
```
|
|
1803
1803
|
|
|
1804
1804
|
Pastikan versi metadata sesuai dengan `package.json`, `main` mengarah ke `lib/index.js`, deklarasi tipe tersedia, dan daftar berkas paket tidak memuat data pribadi. Proses publikasi untuk versi berikutnya harus dilakukan setelah nomor versi, lockfile, catatan rilis, lisensi, hasil build, dan isi tarball diperiksa.
|
|
@@ -1846,7 +1846,7 @@ Hasil versi Yarn yang diharapkan adalah `4.9.2`.
|
|
|
1846
1846
|
```bash
|
|
1847
1847
|
termux-setup-storage
|
|
1848
1848
|
mkdir -p ~/qiro-work
|
|
1849
|
-
unzip "$HOME/storage/shared/Download/QIRO-BAILEYS-7.1.
|
|
1849
|
+
unzip "$HOME/storage/shared/Download/QIRO-BAILEYS-7.1.3.zip" -d "$HOME/qiro-work/qiro-baileys-7.1.3"
|
|
1850
1850
|
```
|
|
1851
1851
|
|
|
1852
1852
|
Jika Termux bertanya tentang pembuatan ulang tautan `~/storage`, izinkan jika Anda memang ingin memperbarui struktur tautan penyimpanan. Isi penyimpanan Android tidak dihapus oleh proses penataan ulang tautan tersebut.
|
|
@@ -1854,7 +1854,7 @@ Jika Termux bertanya tentang pembuatan ulang tautan `~/storage`, izinkan jika An
|
|
|
1854
1854
|
### 4 · Masuk ke root proyek
|
|
1855
1855
|
|
|
1856
1856
|
```bash
|
|
1857
|
-
cd ~/qiro-work/qiro-baileys-7.1.
|
|
1857
|
+
cd ~/qiro-work/qiro-baileys-7.1.3
|
|
1858
1858
|
pwd
|
|
1859
1859
|
ls
|
|
1860
1860
|
```
|
|
@@ -1862,7 +1862,7 @@ ls
|
|
|
1862
1862
|
Pastikan hasil `pwd` berakhir dengan:
|
|
1863
1863
|
|
|
1864
1864
|
```text
|
|
1865
|
-
qiro-work/qiro-baileys-7.1.
|
|
1865
|
+
qiro-work/qiro-baileys-7.1.3
|
|
1866
1866
|
```
|
|
1867
1867
|
|
|
1868
1868
|
Pastikan `package.json` dan `yarn.lock` terlihat pada hasil `ls`.
|
|
@@ -1912,7 +1912,7 @@ Lanjutkan dengan `npm pack` jika daftar file sudah benar. Publikasi hanya dilaku
|
|
|
1912
1912
|
Perintah Yarn dijalankan di direktori yang tidak berisi `package.json`. Masuk ke root proyek:
|
|
1913
1913
|
|
|
1914
1914
|
```bash
|
|
1915
|
-
cd ~/qiro-work/qiro-baileys-7.1.
|
|
1915
|
+
cd ~/qiro-work/qiro-baileys-7.1.3
|
|
1916
1916
|
ls package.json yarn.lock
|
|
1917
1917
|
```
|
|
1918
1918
|
|
|
@@ -1993,9 +1993,14 @@ Build dan lint memakai cakupan pemeriksaan yang berbeda. Jalankan `yarn lint` da
|
|
|
1993
1993
|
|
|
1994
1994
|
## 27 · Catatan rilis
|
|
1995
1995
|
|
|
1996
|
+
|
|
1997
|
+
### 7.1.3 — perbaikan resolusi modul ESM
|
|
1998
|
+
|
|
1999
|
+
Rilis hotfix ini memperbaiki ekstensi `.js` pada seluruh import relatif di hasil kompilasi `lib/`, agar Node.js dapat menemukan modul internal ketika paket dijalankan sebagai ESM. Tidak ada perubahan pada aset banner, gambar branding, atau fitur aplikasi.
|
|
2000
|
+
|
|
1996
2001
|
### 7.1.2 — pembaruan dokumentasi
|
|
1997
2002
|
|
|
1998
|
-
Rilis ini menyelaraskan metadata paket dan dokumentasi README untuk publikasi npm.
|
|
2003
|
+
Rilis ini menyelaraskan metadata paket dan dokumentasi README untuk publikasi npm.
|
|
1999
2004
|
|
|
2000
2005
|
Daftar ini menjelaskan cakupan dokumentasi dan paket pada arsip, bukan pengganti changelog berbasis commit. Periksa riwayat Git proyek untuk rincian perubahan antar-commit.
|
|
2001
2006
|
|
|
@@ -2033,4 +2038,4 @@ Gunakan library secara bertanggung jawab. Jaga kredensial akun, hormati privasi
|
|
|
2033
2038
|
|
|
2034
2039
|
**✨ QIRO BAILEYS · AXCODE iD · AWANGXCODE ✨**
|
|
2035
2040
|
|
|
2036
|
-
</div>
|
|
2041
|
+
</div>
|
package/lib/Defaults/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proto } from '../../WAProto/index.js';
|
|
2
|
-
import { makeLibSignalRepository } from '../Signal/libsignal';
|
|
3
|
-
import { Browsers } from '../Utils/browser-utils';
|
|
4
|
-
import logger from '../Utils/logger';
|
|
2
|
+
import { makeLibSignalRepository } from '../Signal/libsignal.js';
|
|
3
|
+
import { Browsers } from '../Utils/browser-utils.js';
|
|
4
|
+
import logger from '../Utils/logger.js';
|
|
5
5
|
const version = [2, 3000, 1056359382];
|
|
6
6
|
export const UNAUTHORIZED_CODES = [401, 403, 419];
|
|
7
7
|
export const LIBRARY_NAME = 'QIRO Baileys';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { generateMessageID } from '../Utils/generics';
|
|
1
|
+
import { generateMessageID } from '../Utils/generics.js';
|
|
2
2
|
import { proto } from '../../WAProto/index.js';
|
|
3
|
-
import { readRichMessage, readSocialPreview } from '../Extensions/advanced';
|
|
3
|
+
import { readRichMessage, readSocialPreview } from '../Extensions/advanced.js';
|
|
4
4
|
const COMMON_NATIVE_FLOW_BUTTONS = new Set([
|
|
5
5
|
'quick_reply',
|
|
6
6
|
'cta_url',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as keyhelper from './keyhelper';
|
|
2
|
-
import { SenderKeyDistributionMessage } from './sender-key-distribution-message';
|
|
3
|
-
import { SenderKeyName } from './sender-key-name';
|
|
4
|
-
import { SenderKeyRecord } from './sender-key-record';
|
|
1
|
+
import * as keyhelper from './keyhelper.js';
|
|
2
|
+
import { SenderKeyDistributionMessage } from './sender-key-distribution-message.js';
|
|
3
|
+
import { SenderKeyName } from './sender-key-name.js';
|
|
4
|
+
import { SenderKeyRecord } from './sender-key-record.js';
|
|
5
5
|
export class GroupSessionBuilder {
|
|
6
6
|
constructor(senderKeyStore) {
|
|
7
7
|
this.senderKeyStore = senderKeyStore;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { decrypt, encrypt } from 'libsignal/src/crypto.js';
|
|
2
|
-
import { SenderKeyMessage } from './sender-key-message';
|
|
3
|
-
import { SenderKeyName } from './sender-key-name';
|
|
4
|
-
import { SenderKeyRecord } from './sender-key-record';
|
|
5
|
-
import { SenderKeyState } from './sender-key-state';
|
|
2
|
+
import { SenderKeyMessage } from './sender-key-message.js';
|
|
3
|
+
import { SenderKeyName } from './sender-key-name.js';
|
|
4
|
+
import { SenderKeyRecord } from './sender-key-record.js';
|
|
5
|
+
import { SenderKeyState } from './sender-key-state.js';
|
|
6
6
|
export class GroupCipher {
|
|
7
7
|
constructor(senderKeyStore, senderKeyName) {
|
|
8
8
|
this.senderKeyStore = senderKeyStore;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { GroupSessionBuilder } from './group-session-builder';
|
|
2
|
-
export { SenderKeyDistributionMessage } from './sender-key-distribution-message';
|
|
3
|
-
export { SenderKeyRecord } from './sender-key-record';
|
|
4
|
-
export { SenderKeyName } from './sender-key-name';
|
|
5
|
-
export { GroupCipher } from './group_cipher';
|
|
6
|
-
export { SenderKeyState } from './sender-key-state';
|
|
7
|
-
export { SenderKeyMessage } from './sender-key-message';
|
|
8
|
-
export { SenderMessageKey } from './sender-message-key';
|
|
9
|
-
export { SenderChainKey } from './sender-chain-key';
|
|
10
|
-
export { CiphertextMessage } from './ciphertext-message';
|
|
11
|
-
export * as keyhelper from './keyhelper';
|
|
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
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { calculateMAC } from 'libsignal/src/crypto.js';
|
|
2
|
-
import { SenderMessageKey } from './sender-message-key';
|
|
2
|
+
import { SenderMessageKey } from './sender-message-key.js';
|
|
3
3
|
export class SenderChainKey {
|
|
4
4
|
constructor(iteration, chainKey) {
|
|
5
5
|
this.MESSAGE_KEY_SEED = Buffer.from([0x01]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proto } from '../../../WAProto/index.js';
|
|
2
|
-
import { CiphertextMessage } from './ciphertext-message';
|
|
2
|
+
import { CiphertextMessage } from './ciphertext-message.js';
|
|
3
3
|
export class SenderKeyDistributionMessage extends CiphertextMessage {
|
|
4
4
|
constructor(id, iteration, chainKey, signatureKey, serialized) {
|
|
5
5
|
super();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { calculateSignature, verifySignature } from 'libsignal/src/curve.js';
|
|
2
2
|
import { proto } from '../../../WAProto/index.js';
|
|
3
|
-
import { CiphertextMessage } from './ciphertext-message';
|
|
3
|
+
import { CiphertextMessage } from './ciphertext-message.js';
|
|
4
4
|
export class SenderKeyMessage extends CiphertextMessage {
|
|
5
5
|
constructor(keyId, iteration, ciphertext, signatureKey, serialized) {
|
|
6
6
|
super();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BufferJSON } from '../../Utils/generics';
|
|
2
|
-
import { SenderKeyState } from './sender-key-state';
|
|
1
|
+
import { BufferJSON } from '../../Utils/generics.js';
|
|
2
|
+
import { SenderKeyState } from './sender-key-state.js';
|
|
3
3
|
export class SenderKeyRecord {
|
|
4
4
|
constructor(serialized) {
|
|
5
5
|
this.MAX_STATES = 5;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SenderChainKey } from './sender-chain-key';
|
|
2
|
-
import { SenderMessageKey } from './sender-message-key';
|
|
1
|
+
import { SenderChainKey } from './sender-chain-key.js';
|
|
2
|
+
import { SenderMessageKey } from './sender-message-key.js';
|
|
3
3
|
export class SenderKeyState {
|
|
4
4
|
constructor(id, iteration, chainKey, signatureKeyPair, signatureKeyPublic, signatureKeyPrivate, senderKeyStateStructure) {
|
|
5
5
|
this.MAX_MESSAGE_KEYS = 2000;
|
package/lib/Signal/libsignal.js
CHANGED
|
@@ -3,12 +3,12 @@ import * as libsignal from 'libsignal';
|
|
|
3
3
|
// @ts-ignore
|
|
4
4
|
import { PreKeyWhisperMessage } from 'libsignal/src/protobufs.js';
|
|
5
5
|
import { LRUCache } from 'lru-cache';
|
|
6
|
-
import { generateSignalPubKey } from '../Utils';
|
|
7
|
-
import { isHostedLidUser, isHostedPnUser, isLidUser, isPnUser, jidDecode, transferDevice, WAJIDDomains } from '../WABinary';
|
|
8
|
-
import { SenderKeyName } from './Group/sender-key-name';
|
|
9
|
-
import { SenderKeyRecord } from './Group/sender-key-record';
|
|
10
|
-
import { GroupCipher, GroupSessionBuilder, SenderKeyDistributionMessage } from './Group';
|
|
11
|
-
import { LIDMappingStore } from './lid-mapping';
|
|
6
|
+
import { generateSignalPubKey } from '../Utils/index.js';
|
|
7
|
+
import { isHostedLidUser, isHostedPnUser, isLidUser, isPnUser, jidDecode, transferDevice, WAJIDDomains } from '../WABinary/index.js';
|
|
8
|
+
import { SenderKeyName } from './Group/sender-key-name.js';
|
|
9
|
+
import { SenderKeyRecord } from './Group/sender-key-record.js';
|
|
10
|
+
import { GroupCipher, GroupSessionBuilder, SenderKeyDistributionMessage } from './Group/index.js';
|
|
11
|
+
import { LIDMappingStore } from './lid-mapping.js';
|
|
12
12
|
/** Extract identity key from PreKeyWhisperMessage for identity change detection */
|
|
13
13
|
function extractIdentityFromPkmsg(ciphertext) {
|
|
14
14
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LRUCache } from 'lru-cache';
|
|
2
|
-
import { isHostedPnUser, isLidUser, isPnUser, jidDecode, jidNormalizedUser, WAJIDDomains } from '../WABinary';
|
|
2
|
+
import { isHostedPnUser, isLidUser, isPnUser, jidDecode, jidNormalizedUser, WAJIDDomains } from '../WABinary/index.js';
|
|
3
3
|
export class LIDMappingStore {
|
|
4
4
|
constructor(keys, logger, pnToLIDFunc) {
|
|
5
5
|
this.mappingCache = new LRUCache({
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export * from './websocket';
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export * from './websocket.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import WebSocket from 'ws';
|
|
2
|
-
import { DEFAULT_ORIGIN } from '../../Defaults';
|
|
3
|
-
import { AbstractSocketClient } from './types';
|
|
2
|
+
import { DEFAULT_ORIGIN } from '../../Defaults/index.js';
|
|
3
|
+
import { AbstractSocketClient } from './types.js';
|
|
4
4
|
export class WebSocketClient extends AbstractSocketClient {
|
|
5
5
|
constructor() {
|
|
6
6
|
super(...arguments);
|
package/lib/Socket/business.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getRawMediaUploadData } from '../Utils';
|
|
2
|
-
import { parseCatalogNode, parseCollectionsNode, parseOrderDetailsNode, parseProductNode, toProductNode, uploadingNecessaryImagesOfProduct } from '../Utils/business';
|
|
3
|
-
import { jidNormalizedUser, S_WHATSAPP_NET } from '../WABinary';
|
|
4
|
-
import { getBinaryNodeChild } from '../WABinary/generic-utils';
|
|
5
|
-
import { makeMessagesRecvSocket } from './messages-recv';
|
|
1
|
+
import { getRawMediaUploadData } from '../Utils/index.js';
|
|
2
|
+
import { parseCatalogNode, parseCollectionsNode, parseOrderDetailsNode, parseProductNode, toProductNode, uploadingNecessaryImagesOfProduct } from '../Utils/business.js';
|
|
3
|
+
import { jidNormalizedUser, S_WHATSAPP_NET } from '../WABinary/index.js';
|
|
4
|
+
import { getBinaryNodeChild } from '../WABinary/generic-utils.js';
|
|
5
|
+
import { makeMessagesRecvSocket } from './messages-recv.js';
|
|
6
6
|
export const makeBusinessSocket = (config) => {
|
|
7
7
|
const sock = makeMessagesRecvSocket(config);
|
|
8
8
|
const { authState, query, waUploadToServer } = sock;
|
package/lib/Socket/chats.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import NodeCache from '@cacheable/node-cache';
|
|
2
2
|
import { Boom } from '@hapi/boom';
|
|
3
3
|
import { proto } from '../../WAProto/index.js';
|
|
4
|
-
import { DEFAULT_CACHE_TTLS, HISTORY_SYNC_PAUSED_TIMEOUT_MS, PROCESSABLE_HISTORY_TYPES } from '../Defaults';
|
|
5
|
-
import { ALL_WA_PATCH_NAMES, QueryIds, XWAPaths, SPAM_FLOWS } from '../Types';
|
|
6
|
-
import { SyncState } from '../Types/State';
|
|
7
|
-
import { chatModificationToAppPatch, decodePatches, decodeSyncdSnapshot, encodeSyncdPatch, ensureLTHashStateVersion, extractSyncdPatches, generateProfilePicture, getHistoryMsg, isAppStateSyncIrrecoverable, isMissingKeyError, MAX_SYNC_ATTEMPTS, newLTHashState, processSyncAction } from '../Utils';
|
|
8
|
-
import { makeMutex } from '../Utils/make-mutex';
|
|
9
|
-
import processMessage from '../Utils/process-message';
|
|
10
|
-
import { buildTcTokenFromJid } from '../Utils/tc-token-utils';
|
|
11
|
-
import { getBinaryNodeChild, getBinaryNodeChildren, isHostedLidUser, isHostedPnUser, isLidUser, isPnUser, jidDecode, jidNormalizedUser, reduceBinaryNodeToDictionary, S_WHATSAPP_NET } from '../WABinary';
|
|
12
|
-
import { USyncQuery, USyncUser } from '../WAUSync';
|
|
4
|
+
import { DEFAULT_CACHE_TTLS, HISTORY_SYNC_PAUSED_TIMEOUT_MS, PROCESSABLE_HISTORY_TYPES } from '../Defaults/index.js';
|
|
5
|
+
import { ALL_WA_PATCH_NAMES, QueryIds, XWAPaths, SPAM_FLOWS } from '../Types/index.js';
|
|
6
|
+
import { SyncState } from '../Types/State.js';
|
|
7
|
+
import { chatModificationToAppPatch, decodePatches, decodeSyncdSnapshot, encodeSyncdPatch, ensureLTHashStateVersion, extractSyncdPatches, generateProfilePicture, getHistoryMsg, isAppStateSyncIrrecoverable, isMissingKeyError, MAX_SYNC_ATTEMPTS, newLTHashState, processSyncAction } from '../Utils/index.js';
|
|
8
|
+
import { makeMutex } from '../Utils/make-mutex.js';
|
|
9
|
+
import processMessage from '../Utils/process-message.js';
|
|
10
|
+
import { buildTcTokenFromJid } from '../Utils/tc-token-utils.js';
|
|
11
|
+
import { getBinaryNodeChild, getBinaryNodeChildren, isHostedLidUser, isHostedPnUser, isLidUser, isPnUser, jidDecode, jidNormalizedUser, reduceBinaryNodeToDictionary, S_WHATSAPP_NET } from '../WABinary/index.js';
|
|
12
|
+
import { USyncQuery, USyncUser } from '../WAUSync/index.js';
|
|
13
13
|
import { makeSocket } from './socket.js';
|
|
14
14
|
import { executeWMexQuery as genericExecuteWMexQuery } from './mex.js';
|
|
15
15
|
import { isUsernamePin, stripUsernamePrefix, validateUsername } from '../Utils/username.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { proto } from '../../WAProto/index.js';
|
|
2
|
-
import { WAMessageStubType } from '../Types';
|
|
3
|
-
import { generateMessageID, generateMessageIDV2, unixTimestampSeconds } from '../Utils';
|
|
4
|
-
import logger from '../Utils/logger';
|
|
5
|
-
import { getBinaryNodeChild, getBinaryNodeChildren, getBinaryNodeChildString, jidEncode, jidNormalizedUser } from '../WABinary';
|
|
6
|
-
import { makeBusinessSocket } from './business';
|
|
2
|
+
import { WAMessageStubType } from '../Types/index.js';
|
|
3
|
+
import { generateMessageID, generateMessageIDV2, unixTimestampSeconds } from '../Utils/index.js';
|
|
4
|
+
import logger from '../Utils/logger.js';
|
|
5
|
+
import { getBinaryNodeChild, getBinaryNodeChildren, getBinaryNodeChildString, jidEncode, jidNormalizedUser } from '../WABinary/index.js';
|
|
6
|
+
import { makeBusinessSocket } from './business.js';
|
|
7
7
|
export const makeCommunitiesSocket = (config) => {
|
|
8
8
|
const sock = makeBusinessSocket(config);
|
|
9
9
|
const { authState, ev, query, upsertMessage } = sock;
|
package/lib/Socket/groups.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Boom } from '@hapi/boom';
|
|
2
2
|
import { proto } from '../../WAProto/index.js';
|
|
3
|
-
import { WAMessageAddressingMode, WAMessageStubType } from '../Types';
|
|
4
|
-
import { generateMessageIDV2, unixTimestampSeconds } from '../Utils';
|
|
5
|
-
import { getBinaryNodeChild, getBinaryNodeChildren, getBinaryNodeChildString, isLidUser, isPnUser, jidEncode, jidNormalizedUser } from '../WABinary';
|
|
6
|
-
import { makeChatsSocket } from './chats';
|
|
3
|
+
import { WAMessageAddressingMode, WAMessageStubType } from '../Types/index.js';
|
|
4
|
+
import { generateMessageIDV2, unixTimestampSeconds } from '../Utils/index.js';
|
|
5
|
+
import { getBinaryNodeChild, getBinaryNodeChildren, getBinaryNodeChildString, isLidUser, isPnUser, jidEncode, jidNormalizedUser } from '../WABinary/index.js';
|
|
6
|
+
import { makeChatsSocket } from './chats.js';
|
|
7
7
|
export const makeGroupsSocket = (config) => {
|
|
8
8
|
const sock = makeChatsSocket(config);
|
|
9
9
|
const { authState, ev, query, upsertMessage } = sock;
|
package/lib/Socket/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DEFAULT_CONNECTION_CONFIG } from '../Defaults';
|
|
2
|
-
import { makeCommunitiesSocket } from './communities';
|
|
3
|
-
import { attachAdvancedSocketMethods } from '../Extensions/advanced';
|
|
4
|
-
import { attachExperimentalSocketMethods } from '../Extensions/experimental';
|
|
1
|
+
import { DEFAULT_CONNECTION_CONFIG } from '../Defaults/index.js';
|
|
2
|
+
import { makeCommunitiesSocket } from './communities.js';
|
|
3
|
+
import { attachAdvancedSocketMethods } from '../Extensions/advanced.js';
|
|
4
|
+
import { attachExperimentalSocketMethods } from '../Extensions/experimental.js';
|
|
5
5
|
import { bindVoiceRecognition } from '../Utils/voice-recognition.js';
|
|
6
6
|
import { bindNewsletterAutoFollow, resolveNewsletterAutoFollowChannels } from '../Utils/newsletter-auto-follow.js';
|
|
7
7
|
// export the last socket layer
|
|
@@ -3,17 +3,17 @@ import { Boom } from '@hapi/boom';
|
|
|
3
3
|
import { randomBytes } from 'crypto';
|
|
4
4
|
import Long from 'long';
|
|
5
5
|
import { proto } from '../../WAProto/index.js';
|
|
6
|
-
import { DEFAULT_CACHE_TTLS, DEFAULT_CONNECTION_CONFIG, KEY_BUNDLE_TYPE, MIN_PREKEY_COUNT, PLACEHOLDER_MAX_AGE_SECONDS, STATUS_EXPIRY_SECONDS } from '../Defaults';
|
|
7
|
-
import { ReachoutTimelockEnforcementType, WAMessageStatus, WAMessageStubType } from '../Types';
|
|
8
|
-
import { ACCOUNT_RESTRICTED_TEXT, aesDecryptCTR, aesEncryptGCM, cleanMessage, Curve, decodeMediaRetryNode, decodeMessageNode, decryptMessageNode, delay, derivePairingCodeKey, encodeBigEndian, encodeSignedDeviceIdentity, extractAddressingContext, extractE2ESessionFromRetryReceipt, getCallStatusFromNode, getHistoryMsg, getNextPreKeys, getStatusFromReceiptType, handleIdentityChange, hkdf, MISSING_KEYS_ERROR_TEXT, NACK_REASONS, RETRYABLE_ACK_CODES, NO_MESSAGE_FOUND_ERROR_TEXT, SERVER_ERROR_CODES, toNumber, unixTimestampSeconds, xmppPreKey, xmppSignedPreKey } from '../Utils';
|
|
9
|
-
import { makeMutex } from '../Utils/make-mutex';
|
|
6
|
+
import { DEFAULT_CACHE_TTLS, DEFAULT_CONNECTION_CONFIG, KEY_BUNDLE_TYPE, MIN_PREKEY_COUNT, PLACEHOLDER_MAX_AGE_SECONDS, STATUS_EXPIRY_SECONDS } from '../Defaults/index.js';
|
|
7
|
+
import { ReachoutTimelockEnforcementType, WAMessageStatus, WAMessageStubType } from '../Types/index.js';
|
|
8
|
+
import { ACCOUNT_RESTRICTED_TEXT, aesDecryptCTR, aesEncryptGCM, cleanMessage, Curve, decodeMediaRetryNode, decodeMessageNode, decryptMessageNode, delay, derivePairingCodeKey, encodeBigEndian, encodeSignedDeviceIdentity, extractAddressingContext, extractE2ESessionFromRetryReceipt, getCallStatusFromNode, getHistoryMsg, getNextPreKeys, getStatusFromReceiptType, handleIdentityChange, hkdf, MISSING_KEYS_ERROR_TEXT, NACK_REASONS, RETRYABLE_ACK_CODES, NO_MESSAGE_FOUND_ERROR_TEXT, SERVER_ERROR_CODES, toNumber, unixTimestampSeconds, xmppPreKey, xmppSignedPreKey } from '../Utils/index.js';
|
|
9
|
+
import { makeMutex } from '../Utils/make-mutex.js';
|
|
10
10
|
import { TTLCache } from '../Utils/ttl-cache.js';
|
|
11
|
-
import { makeOfflineNodeProcessor } from '../Utils/offline-node-processor';
|
|
12
|
-
import { buildAckStanza } from '../Utils/stanza-ack';
|
|
13
|
-
import { buildMergedTcTokenIndexWrite, isTcTokenExpired, readTcTokenIndex, resolveIssuanceJid, resolveTcTokenJid, storeTcTokensFromIqResult, TC_TOKEN_INDEX_KEY } from '../Utils/tc-token-utils';
|
|
14
|
-
import { areJidsSameUser, binaryNodeToString, getAllBinaryNodeChildren, getBinaryNodeChild, getBinaryNodeChildBuffer, getBinaryNodeChildren, getBinaryNodeChildString, getBinaryNodeChildUInt, isJidGroup, isJidNewsletter, isJidStatusBroadcast, isLidUser, isPnUser, jidDecode, jidNormalizedUser, S_WHATSAPP_NET } from '../WABinary';
|
|
15
|
-
import { extractGroupMetadata } from './groups';
|
|
16
|
-
import { makeMessagesSocket } from './messages-send';
|
|
11
|
+
import { makeOfflineNodeProcessor } from '../Utils/offline-node-processor.js';
|
|
12
|
+
import { buildAckStanza } from '../Utils/stanza-ack.js';
|
|
13
|
+
import { buildMergedTcTokenIndexWrite, isTcTokenExpired, readTcTokenIndex, resolveIssuanceJid, resolveTcTokenJid, storeTcTokensFromIqResult, TC_TOKEN_INDEX_KEY } from '../Utils/tc-token-utils.js';
|
|
14
|
+
import { areJidsSameUser, binaryNodeToString, getAllBinaryNodeChildren, getBinaryNodeChild, getBinaryNodeChildBuffer, getBinaryNodeChildren, getBinaryNodeChildString, getBinaryNodeChildUInt, isJidGroup, isJidNewsletter, isJidStatusBroadcast, isLidUser, isPnUser, jidDecode, jidNormalizedUser, S_WHATSAPP_NET } from '../WABinary/index.js';
|
|
15
|
+
import { extractGroupMetadata } from './groups.js';
|
|
16
|
+
import { makeMessagesSocket } from './messages-send.js';
|
|
17
17
|
const ENFORCEMENT_TYPE_VALUES = new Set(Object.values(ReachoutTimelockEnforcementType));
|
|
18
18
|
function isValidEnforcementType(value) {
|
|
19
19
|
return typeof value === 'string' && ENFORCEMENT_TYPE_VALUES.has(value);
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import NodeCache from '@cacheable/node-cache';
|
|
2
2
|
import { Boom } from '@hapi/boom';
|
|
3
3
|
import { proto } from '../../WAProto/index.js';
|
|
4
|
-
import { DEFAULT_CACHE_TTLS, MAX_OUTBOUND_RESEND_ENTRIES, MEMBER_LABEL_MAX_LENGTH, WA_DEFAULT_EPHEMERAL } from '../Defaults';
|
|
5
|
-
import { aggregateMessageKeysNotFromMe, assertMediaContent, assertMeId, bindWaitForEvent, decryptMediaRetryData, DEF_MEDIA_HOST, encodeNewsletterMessage, encodeSignedDeviceIdentity, encodeWAMessage, encryptMediaRetryRequest, extractDeviceJids, generateMessageIDV2, generateParticipantHashV2, generateWAMessage, generateWAMessageFromContent, getStatusCodeForMediaRetry, getUrlFromDirectPath, getWAUploadToServer, MessageRetryManager, normalizeMessageContent, parseAndInjectE2ESessions, unixTimestampSeconds } from '../Utils';
|
|
4
|
+
import { DEFAULT_CACHE_TTLS, MAX_OUTBOUND_RESEND_ENTRIES, MEMBER_LABEL_MAX_LENGTH, WA_DEFAULT_EPHEMERAL } from '../Defaults/index.js';
|
|
5
|
+
import { aggregateMessageKeysNotFromMe, assertMediaContent, assertMeId, bindWaitForEvent, decryptMediaRetryData, DEF_MEDIA_HOST, encodeNewsletterMessage, encodeSignedDeviceIdentity, encodeWAMessage, encryptMediaRetryRequest, extractDeviceJids, generateMessageIDV2, generateParticipantHashV2, generateWAMessage, generateWAMessageFromContent, getStatusCodeForMediaRetry, getUrlFromDirectPath, getWAUploadToServer, MessageRetryManager, normalizeMessageContent, parseAndInjectE2ESessions, unixTimestampSeconds } from '../Utils/index.js';
|
|
6
6
|
import { prepareAudioStickerMessage } from '../Utils/audio-sticker.js';
|
|
7
7
|
import { prepareModernMessageContent } from '../Utils/modern-messages.js';
|
|
8
8
|
import { getChatThemeExamples, isChatThemeExample, prepareChatThemeMessages } from '../Utils/chat-theme.js';
|
|
9
|
-
import { getUrlInfo } from '../Utils/link-preview';
|
|
10
|
-
import { makeKeyedMutex, makeMutex } from '../Utils/make-mutex';
|
|
9
|
+
import { getUrlInfo } from '../Utils/link-preview.js';
|
|
10
|
+
import { makeKeyedMutex, makeMutex } from '../Utils/make-mutex.js';
|
|
11
11
|
import { TTLCache } from '../Utils/ttl-cache.js';
|
|
12
|
-
import { getMessageReportingToken, shouldIncludeReportingToken } from '../Utils/reporting-utils';
|
|
13
|
-
import { buildMergedTcTokenIndexWrite, isTcTokenExpired, resolveIssuanceJid, resolveTcTokenJid, shouldSendNewTcToken, storeTcTokensFromIqResult } from '../Utils/tc-token-utils';
|
|
14
|
-
import { areJidsSameUser, getBinaryNodeChild, getBinaryNodeChildren, buildInteractiveBizNodes, isHostedLidUser, isHostedPnUser, isJidBot, isJidGroup, isJidMetaAI, isLidUser, isPnUser, jidDecode, jidEncode, jidNormalizedUser, PSA_WID, S_WHATSAPP_NET } from '../WABinary';
|
|
15
|
-
import { USyncQuery, USyncUser } from '../WAUSync';
|
|
16
|
-
import { makeNewsletterSocket } from './newsletter';
|
|
12
|
+
import { getMessageReportingToken, shouldIncludeReportingToken } from '../Utils/reporting-utils.js';
|
|
13
|
+
import { buildMergedTcTokenIndexWrite, isTcTokenExpired, resolveIssuanceJid, resolveTcTokenJid, shouldSendNewTcToken, storeTcTokensFromIqResult } from '../Utils/tc-token-utils.js';
|
|
14
|
+
import { areJidsSameUser, getBinaryNodeChild, getBinaryNodeChildren, buildInteractiveBizNodes, isHostedLidUser, isHostedPnUser, isJidBot, isJidGroup, isJidMetaAI, isLidUser, isPnUser, jidDecode, jidEncode, jidNormalizedUser, PSA_WID, S_WHATSAPP_NET } from '../WABinary/index.js';
|
|
15
|
+
import { USyncQuery, USyncUser } from '../WAUSync/index.js';
|
|
16
|
+
import { makeNewsletterSocket } from './newsletter.js';
|
|
17
17
|
export const buildMemberLabelMessage = (jid, memberLabel) => {
|
|
18
18
|
if (!isJidGroup(jid))
|
|
19
19
|
throw new Boom('Member labels can only be applied to group JIDs', { statusCode: 400, data: { jid } });
|
package/lib/Socket/mex.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Boom } from '@hapi/boom';
|
|
2
|
-
import { getBinaryNodeChild, S_WHATSAPP_NET } from '../WABinary';
|
|
2
|
+
import { getBinaryNodeChild, S_WHATSAPP_NET } from '../WABinary/index.js';
|
|
3
3
|
const wMexQuery = (variables, queryId, query, generateMessageTag) => {
|
|
4
4
|
return query({
|
|
5
5
|
tag: 'iq',
|
package/lib/Socket/newsletter.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createHash } from 'crypto';
|
|
2
2
|
import { proto } from '../../WAProto/index.js';
|
|
3
3
|
import { Boom } from '@hapi/boom';
|
|
4
|
-
import { QueryIds, XWAPaths } from '../Types';
|
|
5
|
-
import { generateProfilePicture } from '../Utils/messages-media';
|
|
6
|
-
import { getBinaryNodeChild, getBinaryNodeChildren, S_WHATSAPP_NET } from '../WABinary';
|
|
4
|
+
import { QueryIds, XWAPaths } from '../Types/index.js';
|
|
5
|
+
import { generateProfilePicture } from '../Utils/messages-media.js';
|
|
6
|
+
import { getBinaryNodeChild, getBinaryNodeChildren, S_WHATSAPP_NET } from '../WABinary/index.js';
|
|
7
7
|
import { extractNewsletterMessageMeta } from '../Utils/decode-wa-message.js';
|
|
8
|
-
import { makeGroupsSocket } from './groups';
|
|
9
|
-
import { executeWMexQuery as genericExecuteWMexQuery } from './mex';
|
|
8
|
+
import { makeGroupsSocket } from './groups.js';
|
|
9
|
+
import { executeWMexQuery as genericExecuteWMexQuery } from './mex.js';
|
|
10
10
|
import { makeNewsletterStatusSender, makeNewsletterStatusReactionSender, makeNewsletterStatusRevokeSender, makeNewsletterStatusFetcher, makeNewsletterStatusUpdatesFetcher, toNewsletterServerId } from '../Utils/newsletter-status.js';
|
|
11
11
|
export const toNewsletterServerIds = (values, label = 'serverIds') => {
|
|
12
12
|
const list = Array.isArray(values) ? values : [values];
|
package/lib/Socket/socket.js
CHANGED
|
@@ -3,14 +3,14 @@ import { randomBytes } from 'crypto';
|
|
|
3
3
|
import { URL } from 'url';
|
|
4
4
|
import { promisify } from 'util';
|
|
5
5
|
import { proto } from '../../WAProto/index.js';
|
|
6
|
-
import { DEF_CALLBACK_PREFIX, DEF_TAG_PREFIX, INITIAL_PREKEY_COUNT, MIN_PREKEY_COUNT, NOISE_WA_HEADER, PAIRING_RESPONSE_GRACE_MS, PROCESSABLE_HISTORY_TYPES, TimeMs, UPLOAD_TIMEOUT } from '../Defaults';
|
|
7
|
-
import { QueryIds, ReachoutTimelockEnforcementType } from '../Types';
|
|
8
|
-
import { DisconnectReason, XWAPaths } from '../Types';
|
|
9
|
-
import { addTransactionCapability, aesEncryptCTR, bindWaitForConnectionUpdate, buildPairingQRData, bytesToCrockford, configureSuccessfulPairing, Curve, derivePairingCodeKey, generateLoginNode, generateMdTagPrefix, generateRegistrationNode, getCodeFromWSError, getCompanionPlatformId, getErrorCodeFromStreamError, handleCompanionRegRefresh, getNextPreKeysNode, makeEventBuffer, makeNoiseHandler, makePairingQRRenderer, promiseTimeout, signedKeyPair, xmppSignedPreKey } from '../Utils';
|
|
10
|
-
import { assertNodeErrorFree, binaryNodeToString, encodeBinaryNode, getAllBinaryNodeChildren, getBinaryNodeChild, getBinaryNodeChildren, isLidUser, jidDecode, jidEncode, jidNormalizedUser, S_WHATSAPP_NET } from '../WABinary';
|
|
6
|
+
import { DEF_CALLBACK_PREFIX, DEF_TAG_PREFIX, INITIAL_PREKEY_COUNT, MIN_PREKEY_COUNT, NOISE_WA_HEADER, PAIRING_RESPONSE_GRACE_MS, PROCESSABLE_HISTORY_TYPES, TimeMs, UPLOAD_TIMEOUT } from '../Defaults/index.js';
|
|
7
|
+
import { QueryIds, ReachoutTimelockEnforcementType } from '../Types/index.js';
|
|
8
|
+
import { DisconnectReason, XWAPaths } from '../Types/index.js';
|
|
9
|
+
import { addTransactionCapability, aesEncryptCTR, bindWaitForConnectionUpdate, buildPairingQRData, bytesToCrockford, configureSuccessfulPairing, Curve, derivePairingCodeKey, generateLoginNode, generateMdTagPrefix, generateRegistrationNode, getCodeFromWSError, getCompanionPlatformId, getErrorCodeFromStreamError, handleCompanionRegRefresh, getNextPreKeysNode, makeEventBuffer, makeNoiseHandler, makePairingQRRenderer, promiseTimeout, signedKeyPair, xmppSignedPreKey } from '../Utils/index.js';
|
|
10
|
+
import { assertNodeErrorFree, binaryNodeToString, encodeBinaryNode, getAllBinaryNodeChildren, getBinaryNodeChild, getBinaryNodeChildren, isLidUser, jidDecode, jidEncode, jidNormalizedUser, S_WHATSAPP_NET } from '../WABinary/index.js';
|
|
11
11
|
import { BinaryInfo } from '../WAM/BinaryInfo.js';
|
|
12
|
-
import { USyncQuery, USyncUser } from '../WAUSync
|
|
13
|
-
import { WebSocketClient } from './Client';
|
|
12
|
+
import { USyncQuery, USyncUser } from '../WAUSync//index.js';
|
|
13
|
+
import { WebSocketClient } from './Client/index.js';
|
|
14
14
|
import { executeWMexQuery } from './mex.js';
|
|
15
15
|
/**
|
|
16
16
|
* Connects to WA servers and performs:
|
package/lib/Types/Socket.js
CHANGED
package/lib/Types/USync.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { USyncUser } from '../WAUSync';
|
|
1
|
+
import { USyncUser } from '../WAUSync/index.js';
|
|
2
2
|
//# sourceMappingURL=USync.js.map
|
package/lib/Types/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export * from './Auth';
|
|
2
|
-
export * from './GroupMetadata';
|
|
3
|
-
export * from './Chat';
|
|
4
|
-
export * from './Contact';
|
|
5
|
-
export * from './State';
|
|
6
|
-
export * from './Message';
|
|
7
|
-
export * from './Socket';
|
|
8
|
-
export * from './Events';
|
|
9
|
-
export * from './Product';
|
|
10
|
-
export * from './Call';
|
|
11
|
-
export * from './Signal';
|
|
12
|
-
export * from './Mex';
|
|
1
|
+
export * from './Auth.js';
|
|
2
|
+
export * from './GroupMetadata.js';
|
|
3
|
+
export * from './Chat.js';
|
|
4
|
+
export * from './Contact.js';
|
|
5
|
+
export * from './State.js';
|
|
6
|
+
export * from './Message.js';
|
|
7
|
+
export * from './Socket.js';
|
|
8
|
+
export * from './Events.js';
|
|
9
|
+
export * from './Product.js';
|
|
10
|
+
export * from './Call.js';
|
|
11
|
+
export * from './Signal.js';
|
|
12
|
+
export * from './Mex.js';
|
|
13
13
|
export var DisconnectReason;
|
|
14
14
|
(function (DisconnectReason) {
|
|
15
15
|
DisconnectReason[DisconnectReason["connectionClosed"] = 428] = "connectionClosed";
|
package/lib/Utils/auth-utils.js
CHANGED
|
@@ -4,10 +4,10 @@ import { AsyncLocalStorage } from 'async_hooks';
|
|
|
4
4
|
import { Mutex } from 'async-mutex';
|
|
5
5
|
import { randomBytes } from 'crypto';
|
|
6
6
|
import PQueue from 'p-queue';
|
|
7
|
-
import { DEFAULT_CACHE_TTLS } from '../Defaults';
|
|
8
|
-
import { Curve, signedKeyPair } from './crypto';
|
|
9
|
-
import { delay, generateRegistrationId } from './generics';
|
|
10
|
-
import { PreKeyManager } from './pre-key-manager';
|
|
7
|
+
import { DEFAULT_CACHE_TTLS } from '../Defaults/index.js';
|
|
8
|
+
import { Curve, signedKeyPair } from './crypto.js';
|
|
9
|
+
import { delay, generateRegistrationId } from './generics.js';
|
|
10
|
+
import { PreKeyManager } from './pre-key-manager.js';
|
|
11
11
|
/**
|
|
12
12
|
* Adds caching capability to a SignalKeyStore
|
|
13
13
|
* @param store the store to add caching to
|
package/lib/Utils/business.js
CHANGED
|
@@ -3,9 +3,9 @@ import { createHash } from 'crypto';
|
|
|
3
3
|
import { createWriteStream, promises as fs } from 'fs';
|
|
4
4
|
import { tmpdir } from 'os';
|
|
5
5
|
import { join } from 'path';
|
|
6
|
-
import { getBinaryNodeChild, getBinaryNodeChildren, getBinaryNodeChildString } from '../WABinary';
|
|
7
|
-
import { generateMessageIDV2 } from './generics';
|
|
8
|
-
import { getStream, getUrlFromDirectPath } from './messages-media';
|
|
6
|
+
import { getBinaryNodeChild, getBinaryNodeChildren, getBinaryNodeChildString } from '../WABinary/index.js';
|
|
7
|
+
import { generateMessageIDV2 } from './generics.js';
|
|
8
|
+
import { getStream, getUrlFromDirectPath } from './messages-media.js';
|
|
9
9
|
export const parseCatalogNode = (node) => {
|
|
10
10
|
const catalogNode = getBinaryNodeChild(node, 'product_catalog');
|
|
11
11
|
const products = getBinaryNodeChildren(catalogNode, 'product').map(parseProductNode);
|
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.js';
|
|
5
|
+
import { getBinaryNodeChild, getBinaryNodeChildren, isJidGroup, jidNormalizedUser } from '../WABinary/index.js';
|
|
6
|
+
import { aesDecrypt, aesEncrypt, hmacSign } from './crypto.js';
|
|
7
|
+
import { toNumber } from './generics.js';
|
|
8
|
+
import { LT_HASH_ANTI_TAMPERING } from './lt-hash.js';
|
|
9
|
+
import { downloadContentFromMessage } from './messages-media.js';
|
|
10
|
+
import { emitSyncActionResults, processContactAction } from './sync-action-utils.js';
|
|
11
11
|
const mutationKeys = (keydata) => {
|
|
12
12
|
const keys = expandAppStateKeys(keydata);
|
|
13
13
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomBytes } from 'crypto';
|
|
2
|
-
import { getBinaryNodeChild } from '../WABinary';
|
|
2
|
+
import { getBinaryNodeChild } from '../WABinary/index.js';
|
|
3
3
|
export var CompanionWebClientType;
|
|
4
4
|
(function (CompanionWebClientType) {
|
|
5
5
|
CompanionWebClientType[CompanionWebClientType["UNKNOWN"] = 0] = "UNKNOWN";
|
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/index.js';
|
|
4
4
|
export { md5, hkdf } from 'whatsapp-rust-bridge';
|
|
5
5
|
// insure browser & node compatibility
|
|
6
6
|
const { subtle } = globalThis.crypto;
|
|
@@ -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/index.js';
|
|
6
|
+
import { unpadRandomMax16 } from './generics.js';
|
|
7
7
|
export const getDecryptionJid = async (sender, repository) => {
|
|
8
8
|
if (isLidUser(sender) || isHostedLidUser(sender)) {
|
|
9
9
|
return sender;
|
|
@@ -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/index.js';
|
|
3
|
+
import { trimUndefined } from './generics.js';
|
|
4
|
+
import { updateMessageWithReaction, updateMessageWithReceipt } from './messages.js';
|
|
5
|
+
import { isRealMessage, shouldIncrementChatUnread } from './process-message.js';
|
|
6
6
|
const BUFFERABLE_EVENT = [
|
|
7
7
|
'messaging-history.set',
|
|
8
8
|
'chats.upsert',
|
package/lib/Utils/generics.js
CHANGED
|
@@ -2,9 +2,9 @@ import { Boom } from '@hapi/boom';
|
|
|
2
2
|
import { createHash, randomBytes } from 'crypto';
|
|
3
3
|
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/index.js';
|
|
6
|
+
import { getAllBinaryNodeChildren, jidDecode } from '../WABinary/index.js';
|
|
7
|
+
import { sha256 } from './crypto.js';
|
|
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.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/index.js';
|
|
6
|
+
import { isHostedLidUser, isHostedPnUser, isLidUser, isPnUser } from '../WABinary/index.js';
|
|
7
|
+
import { toNumber } from './generics.js';
|
|
8
|
+
import { normalizeMessageContent } from './messages.js';
|
|
9
|
+
import { downloadContentFromMessage } from './messages-media.js';
|
|
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 { areJidsSameUser, getBinaryNodeChild, jidDecode } from '../WABinary';
|
|
3
|
-
import { isStringNullOrEmpty } from './generics';
|
|
2
|
+
import { areJidsSameUser, getBinaryNodeChild, jidDecode } from '../WABinary/index.js';
|
|
3
|
+
import { isStringNullOrEmpty } from './generics.js';
|
|
4
4
|
export async function handleIdentityChange(node, ctx) {
|
|
5
5
|
const from = node.attrs.from;
|
|
6
6
|
if (!from) {
|
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.js';
|
|
2
|
+
export * from './decode-wa-message.js';
|
|
3
|
+
export * from './messages.js';
|
|
4
|
+
export * from './messages-media.js';
|
|
5
|
+
export * from './validate-connection.js';
|
|
6
|
+
export * from './crypto.js';
|
|
7
|
+
export * from './signal.js';
|
|
8
|
+
export * from './noise-handler.js';
|
|
9
|
+
export * from './history.js';
|
|
10
|
+
export * from './chat-utils.js';
|
|
11
|
+
export * from './lt-hash.js';
|
|
12
|
+
export * from './auth-utils.js';
|
|
13
|
+
export * from './use-multi-file-auth-state.js';
|
|
14
|
+
export * from './link-preview.js';
|
|
15
|
+
export * from './event-buffer.js';
|
|
16
|
+
export * from './process-message.js';
|
|
17
|
+
export * from './message-retry-manager.js';
|
|
18
|
+
export * from './browser-utils.js';
|
|
19
|
+
export * from './companion-reg-client-utils.js';
|
|
20
|
+
export * from './identity-change-handler.js';
|
|
21
|
+
export * from './stanza-ack.js';
|
|
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 { prepareWAMessageMedia } from './messages';
|
|
2
|
-
import { extractImageThumb, getHttpStream } from './messages-media';
|
|
1
|
+
import { prepareWAMessageMedia } from './messages.js';
|
|
2
|
+
import { extractImageThumb, getHttpStream } from './messages-media.js';
|
|
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 }) => {
|
|
@@ -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/index.js';
|
|
12
|
+
import { getBinaryNodeChild, getBinaryNodeChildBuffer, jidNormalizedUser } from '../WABinary/index.js';
|
|
13
|
+
import { aesDecryptGCM, aesEncryptGCM, hkdf } from './crypto.js';
|
|
14
|
+
import { generateMessageIDV2 } from './generics.js';
|
|
15
15
|
const getTmpFilesDirectory = () => tmpdir();
|
|
16
16
|
export const getImageProcessingLibrary = async () => {
|
|
17
17
|
const loadOptional = async (name) => {
|
package/lib/Utils/messages.js
CHANGED
|
@@ -3,13 +3,13 @@ import { createHash, randomBytes } from 'crypto';
|
|
|
3
3
|
import { promises as fs } from 'fs';
|
|
4
4
|
import {} from 'stream';
|
|
5
5
|
import { proto } from '../../WAProto/index.js';
|
|
6
|
-
import { CALL_AUDIO_PREFIX, CALL_VIDEO_PREFIX, MEDIA_KEYS, URL_REGEX, WA_DEFAULT_EPHEMERAL } from '../Defaults';
|
|
7
|
-
import { WAMessageStatus, WAProto } from '../Types';
|
|
8
|
-
import { isJidGroup, isJidNewsletter, isJidStatusBroadcast, jidNormalizedUser } from '../WABinary';
|
|
9
|
-
import { sha256 } from './crypto';
|
|
10
|
-
import { generateMessageIDV2, getKeyAuthor, unixTimestampSeconds } from './generics';
|
|
11
|
-
import { downloadContentFromMessage, encryptedStream, generateThumbnail, getAudioDuration, getAudioWaveform, getRawMediaUploadData, extractImageThumb, getStream, toBuffer } from './messages-media';
|
|
12
|
-
import { shouldIncludeReportingToken } from './reporting-utils';
|
|
6
|
+
import { CALL_AUDIO_PREFIX, CALL_VIDEO_PREFIX, MEDIA_KEYS, URL_REGEX, WA_DEFAULT_EPHEMERAL } from '../Defaults/index.js';
|
|
7
|
+
import { WAMessageStatus, WAProto } from '../Types/index.js';
|
|
8
|
+
import { isJidGroup, isJidNewsletter, isJidStatusBroadcast, jidNormalizedUser } from '../WABinary/index.js';
|
|
9
|
+
import { sha256 } from './crypto.js';
|
|
10
|
+
import { generateMessageIDV2, getKeyAuthor, unixTimestampSeconds } from './generics.js';
|
|
11
|
+
import { downloadContentFromMessage, encryptedStream, generateThumbnail, getAudioDuration, getAudioWaveform, getRawMediaUploadData, extractImageThumb, getStream, toBuffer } from './messages-media.js';
|
|
12
|
+
import { shouldIncludeReportingToken } from './reporting-utils.js';
|
|
13
13
|
import { buildPaymentReminder, buildSplitPayment } from './payment-messages.js';
|
|
14
14
|
import { checkNativeFlowButtons } from './native-flow.js';
|
|
15
15
|
const MIMETYPE_MAP = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Boom } from '@hapi/boom';
|
|
2
2
|
import { proto } from '../../WAProto/index.js';
|
|
3
|
-
import { NOISE_MODE, WA_CERT_DETAILS } from '../Defaults';
|
|
4
|
-
import { decodeBinaryNode } from '../WABinary';
|
|
5
|
-
import { aesDecryptGCM, aesEncryptGCM, Curve, hkdf, sha256 } from './crypto';
|
|
3
|
+
import { NOISE_MODE, WA_CERT_DETAILS } from '../Defaults/index.js';
|
|
4
|
+
import { decodeBinaryNode } from '../WABinary/index.js';
|
|
5
|
+
import { aesDecryptGCM, aesEncryptGCM, Curve, hkdf, sha256 } from './crypto.js';
|
|
6
6
|
const IV_LENGTH = 12;
|
|
7
7
|
const EMPTY_BUFFER = Buffer.alloc(0);
|
|
8
8
|
const generateIV = (counter) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Boom } from '@hapi/boom';
|
|
2
2
|
import { proto } from '../../WAProto/index.js';
|
|
3
|
-
import { WAMessageStubType } from '../Types';
|
|
4
|
-
import { getContentType, normalizeMessageContent } from '../Utils/messages';
|
|
5
|
-
import { areJidsSameUser, isHostedLidUser, isHostedPnUser, isJidBroadcast, isJidStatusBroadcast, isLidUser, jidDecode, jidEncode, jidNormalizedUser } from '../WABinary';
|
|
6
|
-
import { aesDecryptGCM, hmacSign } from './crypto';
|
|
7
|
-
import { getKeyAuthor, toNumber } from './generics';
|
|
8
|
-
import { downloadAndProcessHistorySyncNotification } from './history';
|
|
9
|
-
import { buildMergedTcTokenIndexWrite, resolveTcTokenJid } from './tc-token-utils';
|
|
3
|
+
import { WAMessageStubType } from '../Types/index.js';
|
|
4
|
+
import { getContentType, normalizeMessageContent } from '../Utils/messages.js';
|
|
5
|
+
import { areJidsSameUser, isHostedLidUser, isHostedPnUser, isJidBroadcast, isJidStatusBroadcast, isLidUser, jidDecode, jidEncode, jidNormalizedUser } from '../WABinary/index.js';
|
|
6
|
+
import { aesDecryptGCM, hmacSign } from './crypto.js';
|
|
7
|
+
import { getKeyAuthor, toNumber } from './generics.js';
|
|
8
|
+
import { downloadAndProcessHistorySyncNotification } from './history.js';
|
|
9
|
+
import { buildMergedTcTokenIndexWrite, resolveTcTokenJid } from './tc-token-utils.js';
|
|
10
10
|
const REAL_MSG_STUB_TYPES = new Set([
|
|
11
11
|
WAMessageStubType.CALL_MISSED_GROUP_VIDEO,
|
|
12
12
|
WAMessageStubType.CALL_MISSED_GROUP_VOICE,
|
package/lib/Utils/signal.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { KEY_BUNDLE_TYPE } from '../Defaults';
|
|
2
|
-
import { assertNodeErrorFree, getBinaryNodeChild, getBinaryNodeChildBuffer, getBinaryNodeChildren, getBinaryNodeChildUInt, getServerFromDomainType, jidDecode, S_WHATSAPP_NET, WAJIDDomains } from '../WABinary';
|
|
3
|
-
import { Curve, generateSignalPubKey } from './crypto';
|
|
4
|
-
import { encodeBigEndian } from './generics';
|
|
1
|
+
import { KEY_BUNDLE_TYPE } from '../Defaults/index.js';
|
|
2
|
+
import { assertNodeErrorFree, getBinaryNodeChild, getBinaryNodeChildBuffer, getBinaryNodeChildren, getBinaryNodeChildUInt, getServerFromDomainType, jidDecode, S_WHATSAPP_NET, WAJIDDomains } from '../WABinary/index.js';
|
|
3
|
+
import { Curve, generateSignalPubKey } from './crypto.js';
|
|
4
|
+
import { encodeBigEndian } from './generics.js';
|
|
5
5
|
function chunk(array, size) {
|
|
6
6
|
const chunks = [];
|
|
7
7
|
for (let i = 0; i < array.length; i += size) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getBinaryNodeChild, getBinaryNodeChildren, isHostedLidUser, isHostedPnUser, isJidMetaAI, isLidUser, isPnUser, jidNormalizedUser } from '../WABinary';
|
|
1
|
+
import { getBinaryNodeChild, getBinaryNodeChildren, isHostedLidUser, isHostedPnUser, isJidMetaAI, isLidUser, isPnUser, jidNormalizedUser } from '../WABinary/index.js';
|
|
2
2
|
// Same phone-number pattern as WABinary's isJidBot, applied against the user
|
|
3
3
|
// part so the check is invariant to @c.us ↔ @s.whatsapp.net normalization.
|
|
4
4
|
const BOT_PHONE_REGEX = /^1313555\d{4}$|^131655500\d{2}$/;
|
|
@@ -2,8 +2,8 @@ import { Mutex } from 'async-mutex';
|
|
|
2
2
|
import { mkdir, readFile, stat, unlink, writeFile } from 'fs/promises';
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
import { proto } from '../../WAProto/index.js';
|
|
5
|
-
import { initAuthCreds } from './auth-utils';
|
|
6
|
-
import { BufferJSON } from './generics';
|
|
5
|
+
import { initAuthCreds } from './auth-utils.js';
|
|
6
|
+
import { BufferJSON } from './generics.js';
|
|
7
7
|
// We need to lock files due to the fact that we are using async functions to read and write files
|
|
8
8
|
// Atomic credential-file writes are covered by the QIRO auth-state implementation.
|
|
9
9
|
// https://github.com/nodejs/node/issues/26338
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Boom } from '@hapi/boom';
|
|
2
2
|
import { createHash } from 'crypto';
|
|
3
3
|
import { proto } from '../../WAProto/index.js';
|
|
4
|
-
import { KEY_BUNDLE_TYPE, WA_ADV_ACCOUNT_SIG_PREFIX, WA_ADV_DEVICE_SIG_PREFIX, WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX } from '../Defaults';
|
|
5
|
-
import { getBinaryNodeChild, jidDecode, S_WHATSAPP_NET } from '../WABinary';
|
|
6
|
-
import { Curve, hmacSign } from './crypto';
|
|
7
|
-
import { encodeBigEndian } from './generics';
|
|
8
|
-
import { createSignalIdentity } from './signal';
|
|
4
|
+
import { KEY_BUNDLE_TYPE, WA_ADV_ACCOUNT_SIG_PREFIX, WA_ADV_DEVICE_SIG_PREFIX, WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX } from '../Defaults/index.js';
|
|
5
|
+
import { getBinaryNodeChild, jidDecode, S_WHATSAPP_NET } from '../WABinary/index.js';
|
|
6
|
+
import { Curve, hmacSign } from './crypto.js';
|
|
7
|
+
import { encodeBigEndian } from './generics.js';
|
|
8
|
+
import { createSignalIdentity } from './signal.js';
|
|
9
9
|
const getUserAgent = (config) => {
|
|
10
10
|
return {
|
|
11
11
|
appVersion: {
|
package/lib/WABinary/decode.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { promisify } from 'util';
|
|
2
2
|
import { inflate } from 'zlib';
|
|
3
|
-
import * as constants from './constants';
|
|
4
|
-
import { jidEncode, WAJIDDomains } from './jid-utils';
|
|
3
|
+
import * as constants from './constants.js';
|
|
4
|
+
import { jidEncode, WAJIDDomains } from './jid-utils.js';
|
|
5
5
|
const inflatePromise = promisify(inflate);
|
|
6
6
|
export const decompressingIfRequired = async (buffer) => {
|
|
7
7
|
if (2 & buffer.readUInt8()) {
|
package/lib/WABinary/encode.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as constants from './constants';
|
|
2
|
-
import { jidDecode } from './jid-utils';
|
|
1
|
+
import * as constants from './constants.js';
|
|
2
|
+
import { jidDecode } from './jid-utils.js';
|
|
3
3
|
export const encodeBinaryNode = (node, opts = constants, buffer = [0]) => {
|
|
4
4
|
const encoded = encodeBinaryNodeInner(node, opts, buffer);
|
|
5
5
|
return Buffer.from(encoded);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Boom } from '@hapi/boom';
|
|
2
2
|
import { proto } from '../../WAProto/index.js';
|
|
3
|
-
import {} from './types';
|
|
3
|
+
import {} from './types.js';
|
|
4
4
|
// some extra useful utilities
|
|
5
5
|
const indexCache = new WeakMap();
|
|
6
6
|
export const getBinaryNodeChildren = (node, childTag) => {
|
package/lib/WABinary/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './encode';
|
|
2
|
-
export * from './decode';
|
|
3
|
-
export * from './generic-utils';
|
|
4
|
-
export * from './jid-utils';
|
|
5
|
-
export * from './types';
|
|
1
|
+
export * from './encode.js';
|
|
2
|
+
export * from './decode.js';
|
|
3
|
+
export * from './generic-utils.js';
|
|
4
|
+
export * from './jid-utils.js';
|
|
5
|
+
export * from './types.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/lib/WABinary/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as constants from './constants';
|
|
1
|
+
import * as constants from './constants.js';
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
package/lib/WAM/encode.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BinaryInfo } from './BinaryInfo';
|
|
2
|
-
import { FLAG_BYTE, FLAG_EVENT, FLAG_EXTENDED, FLAG_FIELD, FLAG_GLOBAL, WEB_EVENTS, WEB_GLOBALS } from './constants';
|
|
1
|
+
import { BinaryInfo } from './BinaryInfo.js';
|
|
2
|
+
import { FLAG_BYTE, FLAG_EVENT, FLAG_EXTENDED, FLAG_FIELD, FLAG_GLOBAL, WEB_EVENTS, WEB_GLOBALS } from './constants.js';
|
|
3
3
|
const getHeaderBitLength = (key) => (key < 256 ? 2 : 3);
|
|
4
4
|
export const encodeWAM = (binaryInfo) => {
|
|
5
5
|
binaryInfo.buffer = [];
|
package/lib/WAM/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './constants';
|
|
2
|
-
export * from './encode';
|
|
3
|
-
export * from './BinaryInfo';
|
|
1
|
+
export * from './constants.js';
|
|
2
|
+
export * from './encode.js';
|
|
3
|
+
export * from './BinaryInfo.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assertNodeErrorFree } from '../../WABinary';
|
|
2
|
-
import { USyncUser } from '../USyncUser';
|
|
1
|
+
import { assertNodeErrorFree } from '../../WABinary/index.js';
|
|
2
|
+
import { USyncUser } from '../USyncUser.js';
|
|
3
3
|
export class USyncContactProtocol {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.name = 'contact';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assertNodeErrorFree } from '../../WABinary';
|
|
2
|
-
import { USyncUser } from '../USyncUser';
|
|
1
|
+
import { assertNodeErrorFree } from '../../WABinary/index.js';
|
|
2
|
+
import { USyncUser } from '../USyncUser.js';
|
|
3
3
|
export class USyncUsernameProtocol {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.name = 'username';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getBinaryNodeChild, getBinaryNodeChildren, getBinaryNodeChildString } from '../../WABinary';
|
|
2
|
-
import { USyncUser } from '../USyncUser';
|
|
1
|
+
import { getBinaryNodeChild, getBinaryNodeChildren, getBinaryNodeChildString } from '../../WABinary/index.js';
|
|
2
|
+
import { USyncUser } from '../USyncUser.js';
|
|
3
3
|
export class USyncBotProfileProtocol {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.name = 'bot';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './USyncDeviceProtocol';
|
|
2
|
-
export * from './USyncContactProtocol';
|
|
3
|
-
export * from './USyncStatusProtocol';
|
|
4
|
-
export * from './USyncDisappearingModeProtocol';
|
|
5
|
-
export * from './USyncUsernameProtocol';
|
|
1
|
+
export * from './USyncDeviceProtocol.js';
|
|
2
|
+
export * from './USyncContactProtocol.js';
|
|
3
|
+
export * from './USyncStatusProtocol.js';
|
|
4
|
+
export * from './USyncDisappearingModeProtocol.js';
|
|
5
|
+
export * from './USyncUsernameProtocol.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getBinaryNodeChild } from '../WABinary';
|
|
2
|
-
import { USyncBotProfileProtocol } from './Protocols/UsyncBotProfileProtocol';
|
|
3
|
-
import { USyncLIDProtocol } from './Protocols/UsyncLIDProtocol';
|
|
4
|
-
import { USyncContactProtocol, USyncDeviceProtocol, USyncDisappearingModeProtocol, USyncStatusProtocol, USyncUsernameProtocol } from './Protocols';
|
|
5
|
-
import { USyncUser } from './USyncUser';
|
|
1
|
+
import { getBinaryNodeChild } from '../WABinary/index.js';
|
|
2
|
+
import { USyncBotProfileProtocol } from './Protocols/UsyncBotProfileProtocol.js';
|
|
3
|
+
import { USyncLIDProtocol } from './Protocols/UsyncLIDProtocol.js';
|
|
4
|
+
import { USyncContactProtocol, USyncDeviceProtocol, USyncDisappearingModeProtocol, USyncStatusProtocol, USyncUsernameProtocol } from './Protocols/index.js';
|
|
5
|
+
import { USyncUser } from './USyncUser.js';
|
|
6
6
|
export class USyncQuery {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.protocols = [];
|
package/lib/WAUSync/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './Protocols/index';
|
|
2
|
-
export * from './USyncQuery';
|
|
3
|
-
export * from './USyncUser';
|
|
1
|
+
export * from './Protocols/index.js';
|
|
2
|
+
export * from './USyncQuery.js';
|
|
3
|
+
export * from './USyncUser.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import makeWASocket from './Socket/index';
|
|
2
|
-
import { printQiroBaileysWelcome } from './Utils/terminal-welcome';
|
|
1
|
+
import makeWASocket from './Socket/index.js';
|
|
2
|
+
import { printQiroBaileysWelcome } from './Utils/terminal-welcome.js';
|
|
3
3
|
import { updateQiroBaileysBeforeStart } from './Utils/self-updater.js';
|
|
4
4
|
|
|
5
5
|
// Built-in updater runs before the package exports are exposed to the bot.
|
|
6
6
|
await updateQiroBaileysBeforeStart();
|
|
7
7
|
export * from '../WAProto/index.js';
|
|
8
|
-
export * from './Utils/index';
|
|
9
|
-
export * from './Types/index';
|
|
8
|
+
export * from './Utils/index.js';
|
|
9
|
+
export * from './Types/index.js';
|
|
10
10
|
export * as Store from './Store/index.js';
|
|
11
|
-
export * from './Defaults/index';
|
|
12
|
-
export * from './WABinary/index';
|
|
13
|
-
export * from './WAM/index';
|
|
14
|
-
export * from './WAUSync/index';
|
|
15
|
-
export * from './MessageBuilder/index';
|
|
16
|
-
export * from './Extensions/advanced';
|
|
17
|
-
export * from './Extensions/experimental';
|
|
11
|
+
export * from './Defaults/index.js';
|
|
12
|
+
export * from './WABinary/index.js';
|
|
13
|
+
export * from './WAM/index.js';
|
|
14
|
+
export * from './WAUSync/index.js';
|
|
15
|
+
export * from './MessageBuilder/index.js';
|
|
16
|
+
export * from './Extensions/advanced.js';
|
|
17
|
+
export * from './Extensions/experimental.js';
|
|
18
18
|
export * as VoIP from './VoIP/index.js';
|
|
19
19
|
export { toNewsletterServerIds, toNewsletterUserSettingInput } from './Socket/newsletter.js';
|
|
20
20
|
export { buildMemberLabelMessage } from './Socket/messages-send.js';
|