@neelegirly/baileys 2.2.21 → 2.2.22
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 +20 -18
- package/lib/Socket/messages-recv.js +71 -0
- package/lib/Types/Events.d.ts +2 -1
- package/lib/Utils/link-preview.js +3 -3
- package/package.json +6 -4
- package/tsconfig.json +15 -0
package/README.md
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
### *Die WhatsApp Web API mit sauberem Neelegirly-Glow-up*
|
|
6
6
|
### *QR Branding · Wrapper-Aware Update Notify · LID · Smart Queue*
|
|
7
7
|
|
|
8
|
-
[](https://www.npmjs.com/package/@neelegirly/baileys)
|
|
9
9
|
[](https://www.npmjs.com/package/@neelegirly/wa-api)
|
|
10
|
-
[](https://www.npmjs.com/package/@neelegirly/libsignal)
|
|
11
11
|
[](https://nodejs.org)
|
|
12
12
|
[](https://www.npmjs.com/package/@neelegirly/baileys)
|
|
13
13
|
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
<img src="https://files.catbox.moe/5bqumy.jpeg" width="780" alt="@neelegirly/baileys Hero" />
|
|
16
16
|
</p>
|
|
17
17
|
|
|
18
|
-
<p align="center"><sub>2026 Glow-Up Edition · frische WA-API-, USync- und libsignal-Patches · Companion-Stack auf <strong>2.2.
|
|
18
|
+
<p align="center"><sub>2026 Glow-Up Edition · frische WA-API-, USync- und libsignal-Patches · Companion-Stack auf <strong>2.2.22 / 1.8.6 / 1.0.31</strong></sub></p>
|
|
19
19
|
|
|
20
|
-
[**Installation**](#-installation) · [**Quickstart**](#-quickstart) · [**Highlights**](#-highlights) · [**QR Branding**](#-qr-branding--update-status) · [**Migration**](#-namespace-migration) · [**Release Notes**](#-release-notes-
|
|
20
|
+
[**Installation**](#-installation) · [**Quickstart**](#-quickstart) · [**Highlights**](#-highlights) · [**QR Branding**](#-qr-branding--update-status) · [**Migration**](#-namespace-migration) · [**Release Notes**](#-release-notes-2222)
|
|
21
21
|
|
|
22
22
|
</div>
|
|
23
23
|
|
|
@@ -42,7 +42,7 @@ Neelegirlys Variante von Baileys ist die WhatsApp-Web-Basis für stabile Bots, s
|
|
|
42
42
|
|
|
43
43
|
---
|
|
44
44
|
|
|
45
|
-
## 🆕 Was sich in `v2.2.
|
|
45
|
+
## 🆕 Was sich in `v2.2.22` geändert hat
|
|
46
46
|
|
|
47
47
|
- ✅ Aktuelle Baileys-Upstream-Fixes vom 24./25. April 2026 sauber übernommen
|
|
48
48
|
- ✅ AB-Props-Query nutzt wieder den aktuellen `abt`/Protocol-1-Flow
|
|
@@ -50,8 +50,9 @@ Neelegirlys Variante von Baileys ist die WhatsApp-Web-Basis für stabile Bots, s
|
|
|
50
50
|
- ✅ App-State-Sync robuster bei fehlenden Keys, Snapshot-Retry und Reconnects
|
|
51
51
|
- ✅ Call-Events, Album-Messages und History/Media-Streaming erweitert
|
|
52
52
|
- ✅ Baileys-WA-API mit robusteren Group-/Message-Guards, Reachout-/Message-Cap-Abfragen und Newsletter-Join/Leave-IDs aktualisiert
|
|
53
|
-
- ✅ libsignal-Dependency auf `1.0.
|
|
53
|
+
- ✅ libsignal-Dependency auf `1.0.31` mit TypeScript-Definitionen und ProtocolAddress-Typen aktualisiert
|
|
54
54
|
- ✅ MEX-LID-Mappings werden in die Signal-Store-Anbindung übernommen
|
|
55
|
+
- ✅ Link-Preview-Redirect-Retry und serverseitige MEX-Notifications fuer Reachout/Message-Capping geprueft
|
|
55
56
|
|
|
56
57
|
---
|
|
57
58
|
|
|
@@ -59,9 +60,9 @@ Neelegirlys Variante von Baileys ist die WhatsApp-Web-Basis für stabile Bots, s
|
|
|
59
60
|
|
|
60
61
|
| Paket | Empfohlene Version |
|
|
61
62
|
| --- | --- |
|
|
62
|
-
| `@neelegirly/baileys` | `2.2.
|
|
63
|
+
| `@neelegirly/baileys` | `2.2.22` |
|
|
63
64
|
| `@neelegirly/wa-api` | `1.8.6` |
|
|
64
|
-
| `@neelegirly/libsignal` | `1.0.
|
|
65
|
+
| `@neelegirly/libsignal` | `1.0.31` |
|
|
65
66
|
|
|
66
67
|
---
|
|
67
68
|
|
|
@@ -70,19 +71,19 @@ Neelegirlys Variante von Baileys ist die WhatsApp-Web-Basis für stabile Bots, s
|
|
|
70
71
|
### npm
|
|
71
72
|
|
|
72
73
|
```bash
|
|
73
|
-
npm install @neelegirly/baileys@2.2.
|
|
74
|
+
npm install @neelegirly/baileys@2.2.22 @neelegirly/libsignal@1.0.31 --save-exact
|
|
74
75
|
```
|
|
75
76
|
|
|
76
77
|
### yarn
|
|
77
78
|
|
|
78
79
|
```bash
|
|
79
|
-
yarn add @neelegirly/baileys@2.2.
|
|
80
|
+
yarn add @neelegirly/baileys@2.2.22 @neelegirly/libsignal@1.0.31 --exact
|
|
80
81
|
```
|
|
81
82
|
|
|
82
83
|
### pnpm
|
|
83
84
|
|
|
84
85
|
```bash
|
|
85
|
-
pnpm add @neelegirly/baileys@2.2.
|
|
86
|
+
pnpm add @neelegirly/baileys@2.2.22 @neelegirly/libsignal@1.0.31 --save-exact
|
|
86
87
|
```
|
|
87
88
|
|
|
88
89
|
> Für den kompletten Neelegirly-Stack passt dazu `@neelegirly/wa-api@1.8.6`.
|
|
@@ -138,8 +139,8 @@ start().catch(console.error)
|
|
|
138
139
|
|
|
139
140
|
| Paket | Rolle |
|
|
140
141
|
|------|-------|
|
|
141
|
-
| `@neelegirly/baileys 2.2.
|
|
142
|
-
| `@neelegirly/libsignal 1.0.
|
|
142
|
+
| `@neelegirly/baileys 2.2.22` | Socket, Events, Messaging |
|
|
143
|
+
| `@neelegirly/libsignal 1.0.31` | Signal-Protokoll-Komponente |
|
|
143
144
|
| `@neelegirly/wa-api 1.8.6` | Lifecycle-, Session- und Update-Wrapper |
|
|
144
145
|
|
|
145
146
|
---
|
|
@@ -150,7 +151,7 @@ Beim QR-Scan werden automatisch Markenzeilen oberhalb und unterhalb des QR-Codes
|
|
|
150
151
|
|
|
151
152
|
Typische Anzeige:
|
|
152
153
|
|
|
153
|
-
- `Baileys Update-Status: up to date (2.2.
|
|
154
|
+
- `Baileys Update-Status: up to date (2.2.22)`
|
|
154
155
|
- `Wrapper Update-Status: up to date (1.8.6)`
|
|
155
156
|
- Bei echten Updates werden kompakte Hinweise auf `latest` eingeblendet
|
|
156
157
|
|
|
@@ -171,7 +172,7 @@ Wenn du direkt prüfen willst:
|
|
|
171
172
|
```ts
|
|
172
173
|
import { checkNpmVersion } from '@neelegirly/baileys'
|
|
173
174
|
|
|
174
|
-
const info = await checkNpmVersion('@neelegirly/baileys', '2.2.
|
|
175
|
+
const info = await checkNpmVersion('@neelegirly/baileys', '2.2.22', {
|
|
175
176
|
githubRepo: 'neelegirly/baileys'
|
|
176
177
|
})
|
|
177
178
|
|
|
@@ -191,14 +192,15 @@ Wenn du vom Upstream kommst, nutze den Neelegirly-Scope:
|
|
|
191
192
|
|
|
192
193
|
---
|
|
193
194
|
|
|
194
|
-
## 📝 Release Notes `2.2.
|
|
195
|
+
## 📝 Release Notes `2.2.22`
|
|
195
196
|
|
|
196
197
|
- 🔧 Upstream-Änderungen vom 24./25. April 2026 portiert, ohne QR-/Update-Notify- oder Message-ID-Handling umzubauen
|
|
197
198
|
- 🧩 Username-USync und Inbound-Username-Felder für Kontakte, Gruppen und Message Keys ergänzt
|
|
198
199
|
- 🛡️ App-State-Sync und libsignal-LID/PN-Typen robuster gemacht
|
|
199
200
|
- 🖼️ Album-Message-Sending und erweiterte Call-Event-Typen ergänzt
|
|
200
|
-
- 🔐 libsignal auf `1.0.
|
|
201
|
-
- 🔗 Companion-Stack auf `2.2.
|
|
201
|
+
- 🔐 libsignal auf `1.0.31` mit WhiskeySockets-TypeScript-Definitionen und ProtocolAddress-Typen gepinnt
|
|
202
|
+
- 🔗 Companion-Stack auf `2.2.22 / 1.8.6 / 1.0.31` aktualisiert
|
|
202
203
|
- 🛡️ Null-/Undefined-Pfade in Gruppen-, Nachrichten- und Chat-ID-Verarbeitung gehärtet
|
|
203
204
|
- 🧷 MEX-LID-Mappings werden in den Signal-Store übernommen
|
|
204
205
|
- 🧩 Reachout- und Message-Cap-WA-API-Abfragen plus TypeScript-Definitionen ergänzt
|
|
206
|
+
- 🔁 Link-Preview-Redirect-Retry-Counter repariert und Server-Push-MEX-Updates verarbeitet
|
|
@@ -20,6 +20,13 @@ const WABinary_1 = require("../WABinary");
|
|
|
20
20
|
const groups_1 = require("./groups");
|
|
21
21
|
const messages_send_1 = require("./messages-send");
|
|
22
22
|
|
|
23
|
+
const ENFORCEMENT_TYPE_VALUES = new Set(
|
|
24
|
+
Object.values(Types_1.ReachoutTimelockEnforcementType)
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const isValidEnforcementType = (value) =>
|
|
28
|
+
typeof value === "string" && ENFORCEMENT_TYPE_VALUES.has(value);
|
|
29
|
+
|
|
23
30
|
const makeMessagesRecvSocket = (config) => {
|
|
24
31
|
const {
|
|
25
32
|
logger,
|
|
@@ -678,6 +685,53 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
678
685
|
}
|
|
679
686
|
};
|
|
680
687
|
|
|
688
|
+
const handleReachoutTimelockNotification = (payload) => {
|
|
689
|
+
if (!payload) {
|
|
690
|
+
logger.warn("reachout timelock notification missing payload");
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
if (!payload.is_active) {
|
|
695
|
+
logger.info("reachout timelock restriction lifted");
|
|
696
|
+
ev.emit("connection.update", {
|
|
697
|
+
reachoutTimeLock: {
|
|
698
|
+
isActive: false,
|
|
699
|
+
enforcementType: Types_1.ReachoutTimelockEnforcementType.DEFAULT,
|
|
700
|
+
},
|
|
701
|
+
});
|
|
702
|
+
return;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
const timeEnforcementEnds = payload.time_enforcement_ends
|
|
706
|
+
? new Date(Number.parseInt(payload.time_enforcement_ends, 10) * 1000)
|
|
707
|
+
: new Date(Date.now() + 60_000);
|
|
708
|
+
const enforcementType = isValidEnforcementType(payload.enforcement_type)
|
|
709
|
+
? payload.enforcement_type
|
|
710
|
+
: Types_1.ReachoutTimelockEnforcementType.DEFAULT;
|
|
711
|
+
|
|
712
|
+
logger.info(
|
|
713
|
+
{ enforcementType, timeEnforcementEnds },
|
|
714
|
+
"reachout timelock restriction set"
|
|
715
|
+
);
|
|
716
|
+
ev.emit("connection.update", {
|
|
717
|
+
reachoutTimeLock: {
|
|
718
|
+
isActive: true,
|
|
719
|
+
timeEnforcementEnds,
|
|
720
|
+
enforcementType,
|
|
721
|
+
},
|
|
722
|
+
});
|
|
723
|
+
};
|
|
724
|
+
|
|
725
|
+
const handleMessageCappingNotification = (payload) => {
|
|
726
|
+
if (!payload) {
|
|
727
|
+
logger.warn("message capping notification missing payload");
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
logger.info({ payload }, "received message capping update");
|
|
732
|
+
ev.emit("message-capping.update", payload);
|
|
733
|
+
};
|
|
734
|
+
|
|
681
735
|
const handleMexNotification = async (id, node) => {
|
|
682
736
|
const updateNode = !node || node.content ? null : WABinary_1.getBinaryNodeChild(node, "update") || WABinary_1.getAllBinaryNodeChildren(node)[0];
|
|
683
737
|
const payloadNode = node?.content ? node : updateNode;
|
|
@@ -704,6 +758,23 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
704
758
|
}
|
|
705
759
|
|
|
706
760
|
const operation = content?.operation || payloadNode?.attrs?.op_name || node?.attrs?.op_name;
|
|
761
|
+
if (Array.isArray(content?.errors) && content.errors.length) {
|
|
762
|
+
logger.warn({ errors: content.errors, operation }, "mex notification has GQL errors");
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
const data = content?.data || {};
|
|
767
|
+
|
|
768
|
+
if (operation === "NotificationUserReachoutTimelockUpdate") {
|
|
769
|
+
handleReachoutTimelockNotification(data.xwa2_notify_account_reachout_timelock);
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
if (operation === "MessageCappingInfoNotification") {
|
|
774
|
+
handleMessageCappingNotification(data.xwa2_notify_new_chat_messages_capping_info_update);
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
|
|
707
778
|
const linkedProfiles = content?.data?.[Types_1.XWAPathsMexUpdates.LINKED_PROFILES];
|
|
708
779
|
const updates = content?.updates || (linkedProfiles ? [linkedProfiles] : undefined);
|
|
709
780
|
|
package/lib/Types/Events.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { Label } from './Label'
|
|
|
9
9
|
import { LabelAssociation } from './LabelAssociation'
|
|
10
10
|
import { MessageUpsertType, MessageUserReceiptUpdate, WAMessage, WAMessageKey, WAMessageUpdate } from './Message'
|
|
11
11
|
import { NewsletterViewRole, SubscriberAction, NewsletterSettingsUpdate } from './Newsletter'
|
|
12
|
-
import { ConnectionState } from './State'
|
|
12
|
+
import { ConnectionState, NewChatMessageCapInfo } from './State'
|
|
13
13
|
|
|
14
14
|
export type BaileysEventMap = {
|
|
15
15
|
/** connection state has been updated -- WS closed, opened, connecting etc. */
|
|
@@ -145,6 +145,7 @@ export type BaileysEventMap = {
|
|
|
145
145
|
id: string
|
|
146
146
|
update: NewsletterSettingsUpdate
|
|
147
147
|
}
|
|
148
|
+
'message-capping.update': NewChatMessageCapInfo
|
|
148
149
|
'limit-sharing.update': {
|
|
149
150
|
id: string
|
|
150
151
|
author: string
|
|
@@ -47,7 +47,7 @@ const getCompressedJpegThumbnail = async (url, { thumbnailWidth, fetchOpts }) =>
|
|
|
47
47
|
*/
|
|
48
48
|
const getUrlInfo = async (text, opts = { thumbnailWidth: THUMBNAIL_WIDTH_PX, fetchOpts: { timeout: 3000 }}) => {
|
|
49
49
|
try {
|
|
50
|
-
|
|
50
|
+
let retries = 0
|
|
51
51
|
const maxRetry = 5
|
|
52
52
|
const { getLinkPreview } = await Promise.resolve().then(() => __importStar(require('link-preview-js')))
|
|
53
53
|
let previewLink = text
|
|
@@ -66,7 +66,7 @@ const getUrlInfo = async (text, opts = { thumbnailWidth: THUMBNAIL_WIDTH_PX, fet
|
|
|
66
66
|
if (forwardedURLObj.hostname === urlObj.hostname
|
|
67
67
|
|| forwardedURLObj.hostname === 'www.' + urlObj.hostname
|
|
68
68
|
|| 'www.' + forwardedURLObj.hostname === urlObj.hostname) {
|
|
69
|
-
retries
|
|
69
|
+
retries += 1
|
|
70
70
|
return true
|
|
71
71
|
}
|
|
72
72
|
else {
|
|
@@ -117,4 +117,4 @@ const getUrlInfo = async (text, opts = { thumbnailWidth: THUMBNAIL_WIDTH_PX, fet
|
|
|
117
117
|
|
|
118
118
|
module.exports = {
|
|
119
119
|
getUrlInfo
|
|
120
|
-
}
|
|
120
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neelegirly/baileys",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.22",
|
|
4
4
|
"description": "Neelegirly fork of Baileys: multi-device WhatsApp Web API for Node.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"whatsapp",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"files": [
|
|
28
28
|
"lib/**/*",
|
|
29
29
|
"WAProto/**/*",
|
|
30
|
+
"tsconfig.json",
|
|
30
31
|
"README.md",
|
|
31
32
|
"LICENSE"
|
|
32
33
|
],
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
"@adiwajshing/keyed-db": "^0.2.4",
|
|
44
45
|
"@cacheable/node-cache": "^1.5.4",
|
|
45
46
|
"@hapi/boom": "^9.1.3",
|
|
46
|
-
"@neelegirly/libsignal": "1.0.
|
|
47
|
+
"@neelegirly/libsignal": "1.0.31",
|
|
47
48
|
"async-mutex": "^0.5.0",
|
|
48
49
|
"audio-decode": "^2.1.3",
|
|
49
50
|
"axios": "^1.3.3",
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
"ws": "^8.13.0"
|
|
59
60
|
},
|
|
60
61
|
"overrides": {
|
|
61
|
-
"@neelegirly/libsignal": "1.0.
|
|
62
|
+
"@neelegirly/libsignal": "1.0.31"
|
|
62
63
|
},
|
|
63
64
|
"devDependencies": {
|
|
64
65
|
"@adiwajshing/eslint-config": "github:adiwajshing/eslint-config",
|
|
@@ -115,6 +116,7 @@
|
|
|
115
116
|
"scripts": {
|
|
116
117
|
"build:all": "tsc && typedoc",
|
|
117
118
|
"build:docs": "typedoc",
|
|
118
|
-
"build:tsc": "tsc"
|
|
119
|
+
"build:tsc": "tsc",
|
|
120
|
+
"test": "node --check lib/Socket/groups.js && node --check lib/Socket/messages-recv.js && node --check lib/Socket/messages-send.js && node --check lib/Socket/socket.js && node --check lib/Utils/auth-utils.js && node --check lib/Utils/decode-wa-message.js && node --check lib/Utils/process-message.js && node --check lib/Utils/link-preview.js && node -e \"const b=require('./'); if(typeof b.makeWASocket !== 'function' || b.NACK_REASONS.SenderReachoutTimelocked !== 463 || b.QueryIds.FOLLOW !== '24404358912487870') process.exit(1)\""
|
|
119
121
|
}
|
|
120
122
|
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowJs": true,
|
|
4
|
+
"checkJs": false,
|
|
5
|
+
"esModuleInterop": true,
|
|
6
|
+
"module": "commonjs",
|
|
7
|
+
"moduleResolution": "node",
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"target": "es2020",
|
|
11
|
+
"types": ["node"]
|
|
12
|
+
},
|
|
13
|
+
"include": ["lib/**/*.js", "lib/**/*.d.ts", "WAProto/**/*.js", "WAProto/**/*.d.ts"],
|
|
14
|
+
"exclude": ["node_modules"]
|
|
15
|
+
}
|