@xbibzlibrary/whatsbibz 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +143 -99
- package/README.cn.md +604 -0
- package/README.id.md +604 -0
- package/README.md +505 -181
- package/SECURITY.md +91 -0
- package/assets/logo/README.md +11 -13
- package/assets/logo/preview.png +0 -0
- package/lib/BibzWhats/banner.d.ts +31 -0
- package/lib/BibzWhats/banner.js +120 -0
- package/lib/BibzWhats/client.d.ts +7 -1
- package/lib/BibzWhats/client.js +12 -0
- package/lib/BibzWhats/index.d.ts +1 -0
- package/lib/BibzWhats/index.js +1 -0
- package/lib/BibzWhats/version.js +2 -2
- package/lib/Defaults/index.js +1 -1
- package/lib/Modded/message_builder.js +25 -8
- package/lib/Utils/browser-utils.js +2 -2
- package/lib/Utils/generics.js +1 -1
- package/lib/Utils/rich-messages.js +10 -0
- package/package.json +20 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,99 +1,143 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- **
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- `
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
- `
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- `
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@xbibzlibrary/whatsbibz` are documented here.
|
|
4
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses [Semantic Versioning](https://semver.org/).
|
|
5
|
+
|
|
6
|
+
Each entry ends with a short Indonesian summary (*Ringkasan*).
|
|
7
|
+
|
|
8
|
+
## [1.4.0] — 2026-09-08
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Banner ASCII "WhatsBibz." di terminal.** Saat `createBibzWhats()` dipanggil di terminal interaktif, dicetak banner huruf *Small Slant* (figlet) dengan filter pelangi (`Rainbow 2`) — art dirender sekali dan di-embed, jadi tanpa dependency runtime. Warna memakai truecolor (24-bit) dengan fallback palet 256 dan otomatis polos di luar TTY (`NO_COLOR` / `FORCE_COLOR` dihormati). Matikan lewat opsi `banner: false` atau paksa dengan `banner: true`. Helper publik: `renderBanner()`, `printBanner()`, `BANNER_TEXT`, `BANNER_FONT`, `BANNER_FILTER`, `colorEnabled()`.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- **`Button.build()` / `Button.send()` selalu melempar `ReferenceError: message is not defined`.** Pemanggilnya di `lib/Modded/message_builder.js` menyebar variabel `message` yang tidak pernah didefinisikan; semua tombol Native Flow yang dikirim lewat builder `Button` langsung gagal. Konten sekarang diambil dari `toCard()` (`body`/`footer`/`header`/`nativeFlowMessage`) sehingga `build()` menghasilkan `interactiveMessage` yang sah.
|
|
15
|
+
- **`Carousel.card(cb)` tidak pernah ikut terkirim.** Builder kartu ditumpuk di `_cardBuilders` tetapi `Carousel.build()` hanya memakai `_cards`, sehingga carousel terkirim dengan 0 kartu secara diam-diam. `Carousel.build()` dan `Carousel.send()` kini mengonversi builder `.card()` via `toCard()` (termasuk upload media) dan memvalidasinya lewat `addCard()`.
|
|
16
|
+
- **`Button.send()` / `Carousel.send()` menerima payload kosong** (tanpa tombol / tanpa kartu) yang pasti ditolak server. Keduanya kini melempar error eksplisit, sama seperti `ButtonV2`.
|
|
17
|
+
- **`generateUnifiedResponseContent()` (dipakai `sock.sendUnifiedResponse`) crash bila argumen `captured` bukan hasil `captureUnifiedResponse()`** — kini melempar `TypeError` yang menjelaskan pemakaian yang benar.
|
|
18
|
+
|
|
19
|
+
### Tests
|
|
20
|
+
- `test/builders.test.js`: 7 test regresi untuk `Button` (quick_reply, single_select + section/row), `Carousel` (kartu lewat `.card()` ikut terkirim, kartu tanpa media ditolak), `ButtonV2`, plus penolakan payload kosong — semua payload divalidasi bisa di-encode sebagai `proto.Message`.
|
|
21
|
+
- `test/banner.test.js`: 5 test untuk banner ASCII (kesesuaian teks dengan render figlet, konsistensi ANSI, deteksi `NO_COLOR`/`FORCE_COLOR`/TTY).
|
|
22
|
+
|
|
23
|
+
*Ringkasan: rilis fitur + perbaikan — banner ASCII "WhatsBibz." (Small Slant + pelangi) di terminal, dua bug besar builder pesan interaktif diperbaiki (`Button` yang tadinya ReferenceError kini berfungsi, kartu carousel yang tadinya hilang kini ikut terkirim), payload kosong & pemakaian `sendUnifiedResponse` yang salah ditolak lebih awal, 12 test regresi baru.*
|
|
24
|
+
|
|
25
|
+
## [1.3.2] — 2026-09-05
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
- Built-in WhatsApp Web version → `2.3000.1046874154` (still fetched live on every connect when `fetchLatestVersion` is on).
|
|
29
|
+
- README logo is served from jsDelivr (`cdn.jsdelivr.net/gh/XbibzOfficial777/whatsbibz@main/…`) so it renders on npm as well as on GitHub.
|
|
30
|
+
- `package.json` now carries `repository`, `bugs` and `homepage`, so npm links back to GitHub.
|
|
31
|
+
|
|
32
|
+
No runtime behaviour changes.
|
|
33
|
+
|
|
34
|
+
*Ringkasan: versi WA Web tertanam diperbarui, logo README lewat jsDelivr, metadata repo di package.json. Tidak ada perubahan perilaku.*
|
|
35
|
+
|
|
36
|
+
## [1.3.1] — 2026-09-03
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
- `saveCreds` failures on `creds.update` (session folder removed by a wipe or by `close()` mid-write) were unhandled promise rejections that could terminate the host process. They are now caught and logged; `ENOENT` is reported as a warning.
|
|
40
|
+
- `pairing.start()` and the QR printer are wrapped so a rejected promise can no longer escape the event handler.
|
|
41
|
+
|
|
42
|
+
### Tests
|
|
43
|
+
- `lifecycle.test.js`: deleting the session folder while the client is alive produces no unhandled rejection.
|
|
44
|
+
|
|
45
|
+
*Ringkasan: kegagalan menulis kredensial saat folder sesi hilang tidak lagi mematikan proses.*
|
|
46
|
+
|
|
47
|
+
## [1.3.0] — 2026-09-03
|
|
48
|
+
|
|
49
|
+
First release under the name **`@xbibzlibrary/whatsbibz`** (display name *WhatsBibz*). Previously distributed as the vendored package `bibzwhats`.
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
- **Configurable or automatic linked-device identity** (`lib/BibzWhats/device-identity.js`).
|
|
53
|
+
- `identity: 'auto'` (default) starts with the most stable profile (`Mac OS / Chrome`) and rotates to the next one only when the server rejects it — `428` before QR, `400 bad-request` at pairing, or `405`. Measured live: `428` → next profile → pairing acknowledged in 2.5 s; `400` → next profile → reconnect → acknowledged in 3 s.
|
|
54
|
+
- The accepted profile is persisted in `<authDir>/identity.json` and survives session wipes, so the device name on the phone stays the same across restarts.
|
|
55
|
+
- Custom identities via `identity` (tuple, `'archLinux:Firefox'`, `'Mac OS/Safari/15.6.1'`, profile id), the legacy `browser` option, or environment variables `BIBZ_BROWSER` / `BIBZ_DEVICE_OS|BROWSER|VERSION`. Custom identities are used as is and never replaced silently.
|
|
56
|
+
- New event `identity-changed`; `client.identity` now exposes `{ mode, source, profileId, linkedDeviceName, pairingDisplay, pairingDisplayAccepted, tried }`.
|
|
57
|
+
- `createPairingController` gained an `onRejected` hook.
|
|
58
|
+
- Aliases `createWhatsBibz`, `makeWhatsBibzSocket`, `Browsers.whatsbibz`, and the constant `BIBZWHATS_PACKAGE`.
|
|
59
|
+
- Detection of **`401` with a pending pairing**: when the connection drops right after a pairing code was issued, the server answers the next connect with `401`. The client now replaces the credentials and requests a new code within 2 s without consuming the `maxSessionWipes` budget; `reconnecting` carries `pairingPending: true`.
|
|
60
|
+
- New logo (`assets/logo/preview.png`) with derived icons, favicon and banner.
|
|
61
|
+
- `prepublishOnly` runs the full test suite and the export check.
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
- First reconnect after a network drop on a healthy connection (pairing code already issued) happens after 1 s instead of the 10 s back-off step.
|
|
65
|
+
- Built-in WhatsApp Web version → `2.3000.1046721733`.
|
|
66
|
+
- `Browsers.whatsbibz()` / `Browsers.bibzwhats()` now report `WhatsBibz` as the product name.
|
|
67
|
+
|
|
68
|
+
### Fixed
|
|
69
|
+
- **Leaked reconnect timers after `close()`.** Every client left one live timer behind, so processes could not exit and a "ghost" socket could reconnect. All reconnects are now scheduled through one cancellable place and `connect()` refuses to run after `close()`. Verified over 40 offline and 3 live create→close cycles.
|
|
70
|
+
- **TypeScript declarations.** Upstream shipped an effectively empty `WAProto/index.d.ts` (two lines), so `import { proto }` failed to compile. It is regenerated in full (217 namespaces). `@types/ws` and `long` are declared as dependencies and the library's `.d.ts` no longer depend on the broken declarations of `whatsapp-rust-bridge`. A strict consumer compiles with `skipLibCheck: false`.
|
|
71
|
+
|
|
72
|
+
### Tests
|
|
73
|
+
- 54 offline tests (new: `device-identity.test.js`, `lifecycle.test.js`) on Node 20 / 22 / 24 / 26, 11 live tests against production servers (auto rotation on `428` and `400`, custom identities, negative controls, forced network drop).
|
|
74
|
+
|
|
75
|
+
*Ringkasan: identitas perangkat tertaut bisa diatur atau otomatis dengan rotasi saat ditolak server; timer bocor setelah `close()` diperbaiki; `401` pairing tertunda ditangani; deklarasi TypeScript lengkap; rilis pertama di npm sebagai `@xbibzlibrary/whatsbibz`.*
|
|
76
|
+
|
|
77
|
+
## [1.2.0] — 2026-09-03
|
|
78
|
+
|
|
79
|
+
Measured against production servers (WhatsApp Web `2.3000.1046672143`) with more than 70 identity combinations; results in `test/identity-live.test.js` and `VERIFIKASI-IDENTITAS-2026-09-03.md`.
|
|
80
|
+
|
|
81
|
+
### Added
|
|
82
|
+
- `lib/Utils/platform-identity.js`: allow-list of `companion_platform_display` values accepted at pairing and `derivePairingDisplay()` which maps any identity to a valid one (Arch Linux → `Chrome (Linux)`, Mac OS Desktop → `Chrome (Mac OS)`, product names → host OS). The text under *Linked devices* (`DeviceProps.os`) is still sent unchanged.
|
|
83
|
+
- Presets `Browsers.archLinux(b)` = `['Arch Linux', b, '6.12.44']` and `Browsers.linux(b)`; `Browsers.appropriate()` reads the distro from `/etc/os-release`.
|
|
84
|
+
- Socket options `companionPlatformId` and `webSubPlatform` for explicit overrides.
|
|
85
|
+
- `lintIdentity()` warns early when a `companionPlatformDisplay` override is certain to be rejected; `client.identity` property.
|
|
86
|
+
|
|
87
|
+
### Fixed
|
|
88
|
+
- `Browsers.macOS('Desktop')` with `syncFullHistory` no longer fails with `428` before QR: the server has closed `WebSubPlatform.DARWIN`; `WEB_BROWSER` is advertised and full history is still requested via `requireFullSync`.
|
|
89
|
+
- The `400` error message from the pairing controller now explains the allow-list.
|
|
90
|
+
|
|
91
|
+
### Changed
|
|
92
|
+
- `Browsers.macOS` version → `15.6.1`; built-in WhatsApp Web version → `2.3000.1046672143`.
|
|
93
|
+
|
|
94
|
+
*Ringkasan: identitas Mac OS dan Arch Linux bekerja untuk pairing code; nilai `companion_platform_display` diturunkan otomatis ke yang diterima server.*
|
|
95
|
+
|
|
96
|
+
## [1.1.0] — 2026-09-02
|
|
97
|
+
|
|
98
|
+
Synchronised with `web.whatsapp.com` (client revision 1046603545), Baileys `7.0.0-rc14` and upstream `master`. The `ourin-baileys@9.0.21` base corresponds to Baileys rc10; the following upstream changes were ported.
|
|
99
|
+
|
|
100
|
+
### Added
|
|
101
|
+
- `Browsers.android()` and the ANDROID platform (experimental, upstream #2201).
|
|
102
|
+
- `groupOnlineCount` in group presence updates (#2545).
|
|
103
|
+
- `readyOnEveryConnect` (default `true`): `ready` is emitted for every new socket so handlers are re-attached after a reconnect; `first-ready` fires once.
|
|
104
|
+
- `test/compat-2026-09.test.js`.
|
|
105
|
+
|
|
106
|
+
### Changed
|
|
107
|
+
- `WIN32` → `WIN_HYBRID` for `Browsers.windows('Desktop')` (#2741): the server closes the handshake with `428` when `WIN32` is advertised.
|
|
108
|
+
- Built-in WhatsApp Web version `2.3000.1043857760` → `2.3000.1046603545`; `createBibzWhats` never downgrades the version when the fetch fails (#2777).
|
|
109
|
+
- `requestPairingCode` uses `query()` and stores `creds.me` only after the server acknowledgement; timeouts surface as `408`; new options `companionPlatformDisplay` and `pairingRequestTimeoutMs` (PR #2769).
|
|
110
|
+
- tctoken handling: `t` attribute, expired or timestamp-less tokens dropped, nested in `<picture>` for `profilePictureUrl`, skipped for own JID and groups (rc11+, #2607).
|
|
111
|
+
- `protocolMessage` self-only guards for history sync, app-state keys, LID migration and PDO (rc12).
|
|
112
|
+
- No `<presence/>` is sent on partial `creds.update` (PR #2789); media downloads prefer `directPath` (PR #2778); `lottieStickerMessage` is unwrapped (PR #2776); fetch `dispatcher` guard (#2557); `ev.destroy()`, `signalRepository.close()` and `registerSocketEndHandler` on socket end (#2191).
|
|
113
|
+
- Dependencies: `whatsapp-rust-bridge` 0.5.2 → 0.5.5, `protobufjs` ^7.5.6, `music-metadata` ^11.12.3.
|
|
114
|
+
|
|
115
|
+
### Fixed
|
|
116
|
+
- `client.sock` was copied once through `Object.assign` and froze on the first socket after a reconnect; it is now a live getter.
|
|
117
|
+
|
|
118
|
+
*Ringkasan: patch upstream rc11–rc14/master di-port; `ready` dipancarkan untuk tiap socket baru; `client.sock` selalu socket aktif.*
|
|
119
|
+
|
|
120
|
+
## [1.0.0] — 2026-09-01
|
|
121
|
+
|
|
122
|
+
### Added
|
|
123
|
+
- Full vendored fork of `ourin-baileys@9.0.21` (Baileys v7). Every upstream export is re-exported unchanged.
|
|
124
|
+
- Built-in handling of the `companion_reg_refresh` / `pair-device-rotate-qr` notification (`lib/Socket/socket.js`, `lib/Utils/companion-reg-client-utils.js`): the adv secret is rotated, `creds.update` emitted and the QR re-rendered from the same ref. No `postinstall` patching required.
|
|
125
|
+
- High-level layer `lib/BibzWhats/`:
|
|
126
|
+
- `createBibzWhats(options)` — latest WhatsApp Web version per connect, custom or random pairing code with QR fallback, `515` restart handling, back-off reconnect, automatic session wipe on `401 / 500 / 411 / corrupt` (max 3), group metadata cache, event emitter API.
|
|
127
|
+
- `createPairingController` — single in-flight request, 150 s refresh, custom-code fallback, exponential back-off on `428` / `429`.
|
|
128
|
+
- Helpers `sendText` (split ≤ 4000, retry, Markdown → WhatsApp), `sendMedia` (document fallback), `react`, `presence`, `extractMessage`, `unwrapMessage`, `messageTimestampMs`, `LidMap` and JID utilities.
|
|
129
|
+
- Renames: `Dugong` → `BibzWhatsEngine`, `sock.ourin` → `sock.bibz` (alias kept), `Browsers.bibzwhats()`.
|
|
130
|
+
|
|
131
|
+
### Changed
|
|
132
|
+
- Automatic newsletter/channel following on connect is disabled (`autoFollowNewsletterOnConnect: false`, no default JID).
|
|
133
|
+
- Source maps removed from the package.
|
|
134
|
+
|
|
135
|
+
*Ringkasan: fork penuh Baileys v7 dengan handler `companion_reg_refresh` tertanam dan lapisan `createBibzWhats()`.*
|
|
136
|
+
|
|
137
|
+
[Unreleased]: https://github.com/XbibzOfficial777/whatsbibz/compare/v1.3.2...HEAD
|
|
138
|
+
[1.3.2]: https://github.com/XbibzOfficial777/whatsbibz/compare/v1.3.1...v1.3.2
|
|
139
|
+
[1.3.1]: https://github.com/XbibzOfficial777/whatsbibz/compare/v1.3.0...v1.3.1
|
|
140
|
+
[1.3.0]: https://github.com/XbibzOfficial777/whatsbibz/releases/tag/v1.3.0
|
|
141
|
+
[1.2.0]: https://github.com/XbibzOfficial777/whatsbibz/releases/tag/v1.2.0
|
|
142
|
+
[1.1.0]: https://github.com/XbibzOfficial777/whatsbibz/releases/tag/v1.1.0
|
|
143
|
+
[1.0.0]: https://github.com/XbibzOfficial777/whatsbibz/releases/tag/v1.0.0
|