@kyyinfinite/zapo-message 1.0.0 → 1.1.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 +46 -0
- package/README.md +1220 -328
- package/dist/airich/airich.js +13 -8
- package/dist/btn/builders.js +8 -2
- package/dist/btn/media-slot.js +12 -3
- package/dist/btn/media-source.d.ts +1 -3
- package/dist/btn/thumbnail.js +18 -0
- package/dist/core/base-builder.d.ts +1 -0
- package/dist/core/base-builder.js +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/message/album.js +3 -2
- package/dist/message/forward.js +3 -2
- package/dist/message/index.d.ts +2 -0
- package/dist/message/index.js +1 -0
- package/dist/message/operations.d.ts +22 -0
- package/dist/message/operations.js +176 -0
- package/dist/message/reaction.js +3 -2
- package/package.json +111 -107
- package/src/airich/airich.ts +16 -7
- package/src/btn/builders.ts +12 -2
- package/src/btn/media-slot.ts +11 -3
- package/src/btn/thumbnail.ts +22 -0
- package/src/core/base-builder.ts +8 -0
- package/src/index.ts +13 -0
- package/src/message/album.ts +3 -2
- package/src/message/forward.ts +3 -2
- package/src/message/index.ts +13 -0
- package/src/message/operations.ts +325 -0
- package/src/message/reaction.ts +3 -2
- package/test/message-operations.test.ts +298 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.0 — API Consistency, Type Safety, Feature Expansion & Reliability
|
|
4
|
+
|
|
5
|
+
Versi minor: tidak ada breaking change terhadap API publik 1.0.1. Seluruh
|
|
6
|
+
hybrid async + chain tetap memakai fondasi eksekusi internal yang sama.
|
|
7
|
+
|
|
8
|
+
### Hybrid API consistency
|
|
9
|
+
|
|
10
|
+
- `defaultQuote()` kini diproses seragam oleh seluruh builder. Sebelumnya
|
|
11
|
+
`ListMessage`, `ReactionBuilder`, `ForwardBuilder`, `AlbumBuilder`, dan
|
|
12
|
+
`AIRich` melewatinya diam-diam; kini keduanya mengikuti kontrak
|
|
13
|
+
`BaseBuilder`: quote eksplisit pada `send()` menimpa default quote.
|
|
14
|
+
- `AIRich.send()` kini mengikuti resolusi target `BaseBuilder`
|
|
15
|
+
(`send(jid)` > `defaultTo()`/`to()` > error `NO_TARGET`); sebelumnya
|
|
16
|
+
`defaultTo()` diabaikan dan menghasilkan error validasi jid.
|
|
17
|
+
- `BaseBuilder` mengekspos `_mergedOptions()` sebagai satu titik penggabungan
|
|
18
|
+
default quote — async API dan chain API kini identik untuk quote.
|
|
19
|
+
|
|
20
|
+
### Message operations (baru, `message/operations.js` + root export)
|
|
21
|
+
|
|
22
|
+
- `editMessage(client, target, content)` — edit pesan terkirim via opsi
|
|
23
|
+
native `editKey` zapo-js.
|
|
24
|
+
- `revokeMessage`, `pinMessage(durationSecs?)`, `unpinMessage`, `keepMessage`,
|
|
25
|
+
`unkeepMessage` — wrapper konten terketik `type: "revoke" | "pin" | "unpin"
|
|
26
|
+
| "keep" | "unkeep"` native zapo-js.
|
|
27
|
+
- `votePoll(client, { poll, selectedOptionNames })` — vote poll dengan
|
|
28
|
+
validasi parent (`id`, `fromMe`, `authorJid`, `messageSecret`).
|
|
29
|
+
- `sendEvent(client, jid, config)` / `respondEvent(client, event, response)`
|
|
30
|
+
— event creation + response (`going` | `not_going` | `maybe`) native.
|
|
31
|
+
- Semua operasi memvalidasi input sebelum kirim dan melempar `MessageError`
|
|
32
|
+
terstruktur (`VALIDATION` / `INVALID_TARGET` / `NO_CLIENT`).
|
|
33
|
+
|
|
34
|
+
### Media handling
|
|
35
|
+
|
|
36
|
+
- Thumbnail JPEG yang sudah kecil (≤ 240px) kini lolos tanpa re-encode —
|
|
37
|
+
byte payload identik dengan input pengguna; yang lebih besar tetap di-resize.
|
|
38
|
+
- Thumbnail otomatis untuk image yang tidak bisa diproses sharp kini
|
|
39
|
+
didegradasi menjadi tanpa-thumbnail, bukan gagal kirim (upload tetap
|
|
40
|
+
berjalan; pesan tetap terkirim).
|
|
41
|
+
- Header `document()` tanpa `fileName` pada sumber non-path kini ditolak
|
|
42
|
+
lebih awal dengan `ValidationError` yang jelas.
|
|
43
|
+
|
|
44
|
+
### Testing
|
|
45
|
+
|
|
46
|
+
- 390 test existing tetap hijau (perbaikan baseline di atas), ditambah suite
|
|
47
|
+
`message-operations` dan `quote-parity` untuk kontrak default quote/target.
|
|
48
|
+
|
|
3
49
|
## 1.2.0 — Complete Hybrid API
|
|
4
50
|
|
|
5
51
|
Versi minor: hanya tambahan aditif; seluruh API 1.1.0 dipertahankan
|