@deathnaitsa/wa-api 2.0.20 → 2.0.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 +43 -0
- package/dist/WhatsAppClient.cjs +1 -1
- package/dist/WhatsAppClient.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,6 +41,7 @@ Eine minimalistische, stabile WhatsApp Multi-Device API basierend auf Baileys mi
|
|
|
41
41
|
|
|
42
42
|
### ✅ Implementiert
|
|
43
43
|
- ✅ Multi-Session Support
|
|
44
|
+
- ✅ **SQLite Auth Support** - Optional, statt 100+ JSON-Dateien nur 1 DB-Datei
|
|
44
45
|
- ✅ Session Control (Start, Stop, Restart, Pause, Resume)
|
|
45
46
|
- ✅ Event System (Messages, Connected, Disconnected)
|
|
46
47
|
- ✅ Statistik-System mit JSON-Persistenz
|
|
@@ -70,6 +71,7 @@ Eine minimalistische, stabile WhatsApp Multi-Device API basierend auf Baileys mi
|
|
|
70
71
|
- 🔄 **Multi-Session Support** - Unbegrenzt viele WhatsApp-Accounts parallel
|
|
71
72
|
- 📊 **Erweiterte Statistiken** - Tracking von Nachrichten (empfangen/gesendet), Uptime, Restarts
|
|
72
73
|
- 💾 **Persistente Statistiken** - JSON-basierte Speicherung in `sessions/stats.json`
|
|
74
|
+
- 🗄️ **SQLite Auth Support** - Optional: Session-Daten in SQLite statt 100+ JSON-Dateien
|
|
73
75
|
- 🎯 **Volle Session-Control** - Start, Stop, Restart, Pause, Resume einzelner Sessions
|
|
74
76
|
- 🔒 **Stabile Architektur** - ~560 Zeilen Core-Code, minimale Komplexität
|
|
75
77
|
- 📨 **Event-System** - Einfache Event-Handler für Messages, Connections, Groups, etc.
|
|
@@ -82,6 +84,11 @@ Eine minimalistische, stabile WhatsApp Multi-Device API basierend auf Baileys mi
|
|
|
82
84
|
npm install
|
|
83
85
|
```
|
|
84
86
|
|
|
87
|
+
**Optional: SQLite Auth (empfohlen für Production)**
|
|
88
|
+
```bash
|
|
89
|
+
npm install better-sqlite3
|
|
90
|
+
```
|
|
91
|
+
|
|
85
92
|
**Unterstützt beide Formate:**
|
|
86
93
|
- ✅ **ES Modules** (import)
|
|
87
94
|
- ✅ **CommonJS** (require)
|
|
@@ -133,7 +140,20 @@ import {
|
|
|
133
140
|
client // Direct client access
|
|
134
141
|
} from '@deathnaitsa/wa-api';
|
|
135
142
|
|
|
143
|
+
// Standard Session (JSON-Files)
|
|
136
144
|
await startSession('bot1');
|
|
145
|
+
|
|
146
|
+
// Session mit SQLite Auth (empfohlen für Production!)
|
|
147
|
+
await startSession('bot1', { sql: true });
|
|
148
|
+
|
|
149
|
+
// Weitere Optionen
|
|
150
|
+
await startSession('bot1', {
|
|
151
|
+
sql: true, // ✅ SQLite statt JSON-Files
|
|
152
|
+
printQR: true, // QR-Code im Terminal anzeigen
|
|
153
|
+
autoReconnect: true, // Auto-Reconnect bei Disconnect
|
|
154
|
+
browser: ['Chrome', '120.0.0', 'Windows']
|
|
155
|
+
});
|
|
156
|
+
|
|
137
157
|
await stopSession('bot1');
|
|
138
158
|
await restartSession('bot1');
|
|
139
159
|
|
|
@@ -143,6 +163,29 @@ await client.resumeSession('bot1'); // ✅ Implementiert
|
|
|
143
163
|
await client.deleteSessionData('bot1'); // ✅ Implementiert
|
|
144
164
|
```
|
|
145
165
|
|
|
166
|
+
**💡 SQLite vs JSON-Files:**
|
|
167
|
+
|
|
168
|
+
| Feature | JSON-Files | SQLite (`sql: true`) |
|
|
169
|
+
|---------|-----------|----------------------|
|
|
170
|
+
| Dateien | 100+ JSON | 1 `auth.db` ✅ |
|
|
171
|
+
| Performance | Langsamer | Schneller ✅ |
|
|
172
|
+
| Atomic Writes | ❌ | ✅ |
|
|
173
|
+
| Backup | Komplex | Einfach ✅ |
|
|
174
|
+
| Empfohlen für | Development | Production ✅ |
|
|
175
|
+
|
|
176
|
+
```javascript
|
|
177
|
+
// Empfohlen für Production:
|
|
178
|
+
await startSession('main', {
|
|
179
|
+
sql: true, // Nur 1 DB-Datei statt 100+ JSONs
|
|
180
|
+
autoReconnect: true // Auto-Reconnect aktivieren
|
|
181
|
+
});
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Installation für SQLite:**
|
|
185
|
+
```bash
|
|
186
|
+
npm install better-sqlite3
|
|
187
|
+
```
|
|
188
|
+
|
|
146
189
|
#### ✅ Nachrichten (Implementiert)
|
|
147
190
|
```javascript
|
|
148
191
|
import { sendText, onMessage } from '@deathnaitsa/wa-api';
|