@neelegirl/baileys 2.1.3 → 2.1.5
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 +165 -33
- package/package.json +18 -12
package/README.md
CHANGED
|
@@ -1,37 +1,82 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# @neelegirl/baileys
|
|
4
4
|
|
|
5
|
-
CJS-compatible
|
|
5
|
+
### CJS-compatible WhatsApp Web API foundation for the Neelegirl ecosystem
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
[](https://www.npmjs.com/package/@neelegirl/baileys)
|
|
8
|
+
[](https://github.com/WhiskeySockets/Baileys)
|
|
9
|
+
[](https://nodejs.org)
|
|
10
|
+
[](LICENSE)
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
<p align="center">
|
|
13
|
+
<img src="https://files.catbox.moe/phppor.JPG" width="760" alt="Neelegirl Baileys Header" />
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
| Paket | Version | Basis |
|
|
17
|
+
|---|---:|---|
|
|
18
|
+
| `@neelegirl/baileys` | `2.1.5` | `WhiskeySockets/Baileys v7.0.0-rc.9` |
|
|
19
|
+
|
|
20
|
+
[Installation](#installation) · [Quickstart](#quickstart) · [Funktionslogik](#funktionslogik) · [Aenderungen](#aenderungen--hinweise)
|
|
21
|
+
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Inhaltsverzeichnis
|
|
27
|
+
|
|
28
|
+
- [Uebersicht](#uebersicht)
|
|
29
|
+
- [Installation](#installation)
|
|
30
|
+
- [Quickstart](#quickstart)
|
|
31
|
+
- [Funktionslogik](#funktionslogik)
|
|
32
|
+
- [Aenderungen und Hinweise](#aenderungen--hinweise)
|
|
33
|
+
- [libsignal im Stack](#libsignal-im-stack)
|
|
34
|
+
- [Word2Web Hinweise](#word2web-hinweise)
|
|
35
|
+
- [Kompatibilitaet und Grenzen](#kompatibilitaet-und-grenzen)
|
|
36
|
+
- [Changelog](#changelog)
|
|
37
|
+
- [Legal](#legal)
|
|
38
|
+
|
|
39
|
+
---
|
|
13
40
|
|
|
14
|
-
##
|
|
41
|
+
## Uebersicht
|
|
15
42
|
|
|
16
|
-
-
|
|
17
|
-
- Existing message-id signature logic containing `NEELE` (unchanged)
|
|
18
|
-
- CJS-first runtime shape used by current Neelegirl ecosystem
|
|
43
|
+
`@neelegirl/baileys` ist die CJS-orientierte Laufzeitbasis fuer das Neelegirl-Setup. Es uebernimmt die Socket-, Event-, Auth- und Message-Mechanik und bleibt dabei kompatibel zu bestehenden `require()`-Projekten.
|
|
19
44
|
|
|
20
|
-
|
|
45
|
+
Wichtige Punkte aus den bisherigen Projekt-READMEs, auf den echten Code gemappt:
|
|
21
46
|
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
47
|
+
- QR-Flow bleibt wie im Projekt vorgesehen erhalten.
|
|
48
|
+
- Message-ID-Signatur mit `NEELE` bleibt erhalten.
|
|
49
|
+
- LID/JID-bezogene Verarbeitung ist in den Socket/Signal-Pfaden aktiv.
|
|
50
|
+
- npm-Update-Check ist enthalten (bei QR-Flow, nur einmal pro Prozess).
|
|
51
|
+
- Aktuelle lokale WA-Web-Version: `[2, 3000, 1035194821]`.
|
|
27
52
|
|
|
28
|
-
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Installation
|
|
29
56
|
|
|
30
57
|
```bash
|
|
31
58
|
npm install @neelegirl/baileys
|
|
32
59
|
```
|
|
33
60
|
|
|
34
|
-
|
|
61
|
+
Import:
|
|
62
|
+
|
|
63
|
+
```js
|
|
64
|
+
// CommonJS
|
|
65
|
+
const {
|
|
66
|
+
default: makeWASocket,
|
|
67
|
+
useMultiFileAuthState,
|
|
68
|
+
fetchLatestBaileysVersion,
|
|
69
|
+
DisconnectReason,
|
|
70
|
+
Browsers,
|
|
71
|
+
} = require('@neelegirl/baileys')
|
|
72
|
+
|
|
73
|
+
// ESM (namespace import auf CJS-Export)
|
|
74
|
+
import * as baileys from '@neelegirl/baileys'
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Quickstart
|
|
35
80
|
|
|
36
81
|
```js
|
|
37
82
|
const {
|
|
@@ -42,42 +87,129 @@ const {
|
|
|
42
87
|
Browsers,
|
|
43
88
|
} = require('@neelegirl/baileys')
|
|
44
89
|
|
|
45
|
-
async function
|
|
46
|
-
const { state, saveCreds } = await useMultiFileAuthState('./
|
|
90
|
+
async function startBot() {
|
|
91
|
+
const { state, saveCreds } = await useMultiFileAuthState('./auth_info')
|
|
47
92
|
const { version } = await fetchLatestBaileysVersion()
|
|
48
93
|
|
|
49
94
|
const sock = makeWASocket({
|
|
50
|
-
version,
|
|
51
95
|
auth: state,
|
|
96
|
+
version,
|
|
52
97
|
printQRInTerminal: true,
|
|
53
98
|
browser: Browsers.ubuntu('Chrome'),
|
|
54
99
|
})
|
|
55
100
|
|
|
56
101
|
sock.ev.on('creds.update', saveCreds)
|
|
102
|
+
|
|
57
103
|
sock.ev.on('connection.update', ({ connection, lastDisconnect }) => {
|
|
58
104
|
if (connection === 'close') {
|
|
59
105
|
const code = lastDisconnect?.error?.output?.statusCode
|
|
60
106
|
if (code !== DisconnectReason.loggedOut) {
|
|
61
|
-
|
|
107
|
+
startBot()
|
|
62
108
|
}
|
|
109
|
+
return
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (connection === 'open') {
|
|
113
|
+
console.log('Connected to WhatsApp')
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
sock.ev.on('messages.upsert', async ({ messages }) => {
|
|
118
|
+
const msg = messages?.[0]
|
|
119
|
+
const text = msg?.message?.conversation || msg?.message?.extendedTextMessage?.text || ''
|
|
120
|
+
const jid = msg?.key?.remoteJid
|
|
121
|
+
if (jid && text.toLowerCase() === 'ping') {
|
|
122
|
+
await sock.sendMessage(jid, { text: 'pong' })
|
|
63
123
|
}
|
|
64
124
|
})
|
|
65
125
|
}
|
|
66
126
|
|
|
67
|
-
|
|
127
|
+
startBot().catch(console.error)
|
|
68
128
|
```
|
|
69
129
|
|
|
70
|
-
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Funktionslogik
|
|
133
|
+
|
|
134
|
+
### Runtime und API
|
|
135
|
+
|
|
136
|
+
- Exporte aus `lib/index.js`:
|
|
137
|
+
- `default` / `makeWASocket`
|
|
138
|
+
- `Utils`, `Types`, `Store`, `Defaults`, `WABinary`, `WAM`, `WAUSync`, `WAProto`
|
|
139
|
+
- CJS-first Struktur (`main: lib/index.js`, `types: lib/index.d.ts`)
|
|
140
|
+
|
|
141
|
+
### Ereignisse und Verbindung
|
|
142
|
+
|
|
143
|
+
- `connection.update`, `messages.upsert`, `messages.update`, `creds.update`
|
|
144
|
+
- QR wird ueber den normalen Connection-Update-Flow ausgegeben
|
|
145
|
+
- Reconnect-Steuerung erfolgt ueber Disconnect-Grund (`DisconnectReason`)
|
|
146
|
+
|
|
147
|
+
### Auth und Session
|
|
148
|
+
|
|
149
|
+
- `useMultiFileAuthState` fuer persistente Session-Dateien
|
|
150
|
+
- Signale/Keys laufen ueber die integrierten Signal-Utilities
|
|
151
|
+
|
|
152
|
+
### Nachrichten und Hilfsfunktionen
|
|
153
|
+
|
|
154
|
+
- `sendMessage` fuer Text/Medien/reaktionen/polls usw.
|
|
155
|
+
- Gruppen-, Community-, Newsletter- und Store-Utilities sind enthalten
|
|
156
|
+
- LID/JID-Helfer (`jidDecode`, `jidEncode`, `isLidUser`) stehen ueber die Utility-Exports zur Verfuegung
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Aenderungen & Hinweise
|
|
161
|
+
|
|
162
|
+
Diese README uebernimmt die Dokumentationslogik aus den zwei Quell-READMEs und passt sie auf den realen Paketstand an:
|
|
163
|
+
|
|
164
|
+
- Funktionale Beschreibungen wurden beibehalten und auf echte Exporte reduziert.
|
|
165
|
+
- Historische Hinweise wurden bereinigt, wenn sie veraltete Versionen nannten.
|
|
166
|
+
- Keine nicht nachweisbaren Features aufgenommen.
|
|
167
|
+
|
|
168
|
+
Technisch relevante Punkte:
|
|
169
|
+
|
|
170
|
+
- QR-Logik unveraendert belassen.
|
|
171
|
+
- `NEELE`-Message-ID-Signatur unveraendert belassen.
|
|
172
|
+
- Update-Check auf npm-Registry aktiv.
|
|
173
|
+
- WA-Web-Version-Datei auf aktuellen lokalen Stand aktualisiert.
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## libsignal im Stack
|
|
178
|
+
|
|
179
|
+
`@neelegirl/baileys` nutzt `@neelegirl/libsignal` fuer kryptografische Session-Bausteine (Identity, PreKeys, SessionState, Cipher-Operationen). Das ist die Grundlage fuer stabile Multi-Device-Kommunikation.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Word2Web Hinweise
|
|
184
|
+
|
|
185
|
+
Es gibt in diesem Paket kein dediziertes Word2Web-Modul. Word2Web-spezifische Logik sollte nur dokumentiert/aktiviert werden, wenn sie in deiner Host-Anwendung wirklich implementiert ist.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Kompatibilitaet und Grenzen
|
|
190
|
+
|
|
191
|
+
- Node.js: `>=20`
|
|
192
|
+
- CJS-fokussiert, nicht als 1:1-ESM-Upstream-Ersatz dokumentiert
|
|
193
|
+
- Die API ist auf bestehende Neelegirl-Consumer ausgerichtet
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Changelog
|
|
198
|
+
|
|
199
|
+
### 2.1.5
|
|
200
|
+
|
|
201
|
+
- README inhaltlich mit den Desktop-Quellen zusammengefuehrt (ohne blindes Kopieren)
|
|
202
|
+
- Funktionsbeschreibungen, Nutzungslogik und technische Hinweise auf realen Paketstand gemappt
|
|
203
|
+
- Versions- und Abhaengigkeitsabgleich im Neelegirl-Stack aktualisiert
|
|
204
|
+
- QR-Flow und `NEELE`-Message-ID-Verhalten unveraendert beibehalten
|
|
71
205
|
|
|
72
|
-
|
|
73
|
-
- Official upstream Baileys is ESM-first; direct drop-in replacement may break CJS consumers.
|
|
74
|
-
- If you need strict upstream parity at source level, migrate consumers to ESM first.
|
|
206
|
+
### 2.1.4
|
|
75
207
|
|
|
76
|
-
|
|
208
|
+
- Style-/Layout-Refresh fuer konsistente Projektdokumentation
|
|
209
|
+
- Publish-Metadaten und CJS-Kompatibilitaet nachgezogen
|
|
77
210
|
|
|
78
|
-
|
|
211
|
+
---
|
|
79
212
|
|
|
80
213
|
## Legal
|
|
81
214
|
|
|
82
|
-
|
|
83
|
-
Use responsibly and comply with applicable laws and platform terms.
|
|
215
|
+
Dieses Projekt ist nicht mit WhatsApp verbunden. Nutzung nur in Uebereinstimmung mit geltendem Recht und Plattformregeln.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neelegirl/baileys",
|
|
3
|
-
"version": "2.1.
|
|
4
|
-
"description": "CJS-compatible Baileys fork for
|
|
3
|
+
"version": "2.1.5",
|
|
4
|
+
"description": "CJS-compatible Baileys fork for Neelegirl projects, aligned with WhiskeySockets/Baileys 7.0.0-rc.9 and latest web version updates",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"whatsapp",
|
|
7
7
|
"js-whatsapp",
|
|
@@ -10,13 +10,18 @@
|
|
|
10
10
|
"whatsapp-chat",
|
|
11
11
|
"whatsapp-group",
|
|
12
12
|
"automation",
|
|
13
|
-
"multi-device"
|
|
13
|
+
"multi-device",
|
|
14
|
+
"neelegirl",
|
|
15
|
+
"baileys"
|
|
14
16
|
],
|
|
15
17
|
"homepage": "https://github.com/neelegirl/baileys",
|
|
16
18
|
"repository": {
|
|
17
19
|
"type": "git",
|
|
18
20
|
"url": "git+https://github.com/neelegirl/baileys.git"
|
|
19
21
|
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/neelegirl/baileys/issues"
|
|
24
|
+
},
|
|
20
25
|
"license": "MIT",
|
|
21
26
|
"author": "Neele",
|
|
22
27
|
"main": "lib/index.js",
|
|
@@ -30,26 +35,27 @@
|
|
|
30
35
|
"build:all": "tsc && typedoc",
|
|
31
36
|
"build:docs": "typedoc",
|
|
32
37
|
"build:tsc": "tsc",
|
|
33
|
-
"preinstall": "node ./engine-requirements.js"
|
|
38
|
+
"preinstall": "node ./engine-requirements.js",
|
|
39
|
+
"test": "node -e \"console.log('No tests configured')\""
|
|
34
40
|
},
|
|
35
41
|
"dependencies": {
|
|
36
42
|
"@adiwajshing/keyed-db": "^0.2.4",
|
|
37
43
|
"@cacheable/node-cache": "^1.5.4",
|
|
38
44
|
"@hapi/boom": "^9.1.3",
|
|
39
|
-
"@neelegirl/libsignal": "^1.0.
|
|
45
|
+
"@neelegirl/libsignal": "^1.0.9",
|
|
40
46
|
"async-mutex": "^0.5.0",
|
|
41
47
|
"audio-decode": "^2.1.3",
|
|
42
48
|
"axios": "^1.3.3",
|
|
43
49
|
"cache-manager": "4.0.1",
|
|
44
50
|
"futoin-hkdf": "^1.5.1",
|
|
45
51
|
"libphonenumber-js": "^1.10.20",
|
|
52
|
+
"lru-cache": "^11.1.0",
|
|
46
53
|
"music-metadata": "^7.12.3",
|
|
47
54
|
"node-cache": "^5.1.2",
|
|
48
55
|
"pino": "^7.0.0",
|
|
49
56
|
"protobufjs": "^7.2.4",
|
|
50
57
|
"uuid": "^9.0.0",
|
|
51
|
-
"ws": "^8.13.0"
|
|
52
|
-
"lru-cache": "^11.1.0"
|
|
58
|
+
"ws": "^8.13.0"
|
|
53
59
|
},
|
|
54
60
|
"devDependencies": {
|
|
55
61
|
"@adiwajshing/eslint-config": "github:adiwajshing/eslint-config",
|
|
@@ -74,13 +80,16 @@
|
|
|
74
80
|
"typescript": "^4.6.4"
|
|
75
81
|
},
|
|
76
82
|
"peerDependencies": {
|
|
83
|
+
"audio-decode": "^2.1.3",
|
|
77
84
|
"jimp": "^0.22.12",
|
|
78
85
|
"link-preview-js": "^3.0.0",
|
|
79
86
|
"qrcode-terminal": "^0.12.0",
|
|
80
|
-
"sharp": "^0.32.6"
|
|
81
|
-
"audio-decode": "^2.1.3"
|
|
87
|
+
"sharp": "^0.32.6"
|
|
82
88
|
},
|
|
83
89
|
"peerDependenciesMeta": {
|
|
90
|
+
"audio-decode": {
|
|
91
|
+
"optional": true
|
|
92
|
+
},
|
|
84
93
|
"jimp": {
|
|
85
94
|
"optional": true
|
|
86
95
|
},
|
|
@@ -92,9 +101,6 @@
|
|
|
92
101
|
},
|
|
93
102
|
"sharp": {
|
|
94
103
|
"optional": true
|
|
95
|
-
},
|
|
96
|
-
"audio-decode": {
|
|
97
|
-
"optional": true
|
|
98
104
|
}
|
|
99
105
|
},
|
|
100
106
|
"packageManager": "yarn@1.22.19",
|