@neelegirl/wa-api 1.6.2 → 1.6.4
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/dist/Messaging/index.d.ts +18 -39
- package/dist/Messaging/index.js +42 -100
- package/dist/Socket/index.d.ts +32 -11
- package/dist/Socket/index.js +293 -341
- package/dist/Types/index.d.ts +1 -1
- package/dist/whatsapp/index.js +2 -1
- package/package.json +33 -25
- package/readme.md +94 -89
package/dist/Types/index.d.ts
CHANGED
package/dist/whatsapp/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,41 +1,49 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
2
|
"name": "@neelegirl/wa-api",
|
|
3
|
-
"version": "1.6.
|
|
4
|
-
"description": "Multi-session WhatsApp wrapper built on @neelegirl/baileys
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"wa-api",
|
|
8
|
-
"multi-session",
|
|
9
|
-
"pairing",
|
|
10
|
-
"qr",
|
|
11
|
-
"automation",
|
|
12
|
-
"neelegirl"
|
|
13
|
-
],
|
|
14
|
-
"homepage": "https://github.com/neelegirly/neelegirl-wa-api#readme",
|
|
3
|
+
"version": "1.6.4",
|
|
4
|
+
"description": "Multi-session WhatsApp API wrapper built on @neelegirl/baileys",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
15
7
|
"repository": {
|
|
16
8
|
"type": "git",
|
|
17
|
-
"url": "git+https://github.com/
|
|
9
|
+
"url": "git+https://github.com/neelegirl/wa-api.git"
|
|
18
10
|
},
|
|
11
|
+
"homepage": "https://github.com/neelegirl/wa-api#readme",
|
|
19
12
|
"bugs": {
|
|
20
|
-
"url": "https://github.com/
|
|
13
|
+
"url": "https://github.com/neelegirl/wa-api/issues"
|
|
21
14
|
},
|
|
22
|
-
"license": "ISC",
|
|
23
|
-
"author": "Neele",
|
|
24
|
-
"main": "dist/index.js",
|
|
25
|
-
"types": "dist/index.d.ts",
|
|
26
15
|
"files": [
|
|
27
16
|
"dist/**/*",
|
|
28
|
-
"readme.md"
|
|
29
|
-
"LICENSE"
|
|
17
|
+
"readme.md"
|
|
30
18
|
],
|
|
31
19
|
"scripts": {
|
|
32
|
-
"
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"start": "node ./dist/index.js",
|
|
22
|
+
"start:dev": "tsc && node ./dist/index.js",
|
|
23
|
+
"test": "node -e \"console.log('No tests configured')\""
|
|
33
24
|
},
|
|
25
|
+
"author": "Neele",
|
|
26
|
+
"license": "MIT",
|
|
34
27
|
"dependencies": {
|
|
35
|
-
"@neelegirl/baileys": "^2.1.
|
|
36
|
-
"pino": "^
|
|
28
|
+
"@neelegirl/baileys": "^2.1.4",
|
|
29
|
+
"pino": "^8.11.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/mime": "^3.0.1",
|
|
33
|
+
"jest": "^29.0.0"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"whatsapp",
|
|
37
|
+
"baileys",
|
|
38
|
+
"api",
|
|
39
|
+
"multi-session",
|
|
40
|
+
"automation",
|
|
41
|
+
"neelegirl"
|
|
42
|
+
],
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"@neelegirl/baileys": "^2.1.4"
|
|
37
45
|
},
|
|
38
46
|
"engines": {
|
|
39
47
|
"node": ">=20.0.0"
|
|
40
48
|
}
|
|
41
|
-
}
|
|
49
|
+
}
|
package/readme.md
CHANGED
|
@@ -1,28 +1,54 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# @neelegirl/wa-api
|
|
4
|
+
|
|
5
|
+
### High-level multi-session WhatsApp API on top of @neelegirl/baileys
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@neelegirl/wa-api)
|
|
8
|
+
[](https://www.npmjs.com/package/@neelegirl/baileys)
|
|
9
|
+
[](https://nodejs.org)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
|
|
1
12
|
<p align="center">
|
|
2
|
-
<img src="https://files.catbox.moe/6np1ii.JPG" alt="
|
|
13
|
+
<img src="https://files.catbox.moe/6np1ii.JPG" width="760" alt="Neelegirl wa-api Header" />
|
|
3
14
|
</p>
|
|
4
15
|
|
|
5
|
-
|
|
16
|
+
| Package | Latest Version | Depends On |
|
|
17
|
+
|---|---:|---|
|
|
18
|
+
| `@neelegirl/wa-api` | `1.6.4` | `@neelegirl/baileys ^2.1.4` |
|
|
19
|
+
|
|
20
|
+
[Installation](#installation) · [Quickstart](#quickstart) · [API Overview](#api-overview) · [Operational Notes](#operational-notes)
|
|
6
21
|
|
|
7
|
-
|
|
8
|
-
Das Paket kapselt Session-Start, Pairing, Listener und einfache Message-Helper,
|
|
9
|
-
ohne selbst ein eigenes REST- oder Queue-System mitzubringen.
|
|
22
|
+
</div>
|
|
10
23
|
|
|
11
|
-
|
|
24
|
+
---
|
|
12
25
|
|
|
13
|
-
##
|
|
26
|
+
## Table of Contents
|
|
14
27
|
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
28
|
+
- [Overview](#overview)
|
|
29
|
+
- [Installation](#installation)
|
|
30
|
+
- [Quickstart](#quickstart)
|
|
31
|
+
- [API Overview](#api-overview)
|
|
32
|
+
- [Operational Notes](#operational-notes)
|
|
33
|
+
- [Word2Web Notes](#word2web-notes)
|
|
34
|
+
- [Changelog](#changelog)
|
|
35
|
+
- [Legal](#legal)
|
|
20
36
|
|
|
21
|
-
|
|
37
|
+
---
|
|
22
38
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
39
|
+
## Overview
|
|
40
|
+
|
|
41
|
+
`@neelegirl/wa-api` provides a higher-level interface for multi-session WhatsApp automation while delegating socket/runtime behavior to `@neelegirl/baileys`.
|
|
42
|
+
|
|
43
|
+
Main capabilities:
|
|
44
|
+
|
|
45
|
+
- Session lifecycle management (`start`, `stop`, `delete`, `load`)
|
|
46
|
+
- QR callback flow and pairing-code callback flow
|
|
47
|
+
- Message receive/update callbacks
|
|
48
|
+
- Helper senders (`sendMessage`, `sendStatusMentions`, `relayMessage`)
|
|
49
|
+
- File-based credential persistence per session
|
|
50
|
+
|
|
51
|
+
---
|
|
26
52
|
|
|
27
53
|
## Installation
|
|
28
54
|
|
|
@@ -30,111 +56,90 @@ ohne selbst ein eigenes REST- oder Queue-System mitzubringen.
|
|
|
30
56
|
npm install @neelegirl/wa-api
|
|
31
57
|
```
|
|
32
58
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
npm install qrcode-terminal
|
|
37
|
-
```
|
|
59
|
+
---
|
|
38
60
|
|
|
39
|
-
##
|
|
61
|
+
## Quickstart
|
|
40
62
|
|
|
41
63
|
```js
|
|
42
64
|
const wa = require('@neelegirl/wa-api')
|
|
43
65
|
|
|
44
66
|
wa.onQRUpdated(({ sessionId, qr }) => {
|
|
45
|
-
console.log('QR
|
|
67
|
+
console.log('QR updated:', sessionId)
|
|
68
|
+
console.log(qr)
|
|
46
69
|
})
|
|
47
70
|
|
|
48
71
|
wa.onConnected((sessionId) => {
|
|
49
|
-
console.log('
|
|
72
|
+
console.log('Connected:', sessionId)
|
|
50
73
|
})
|
|
51
74
|
|
|
52
|
-
wa.onMessageReceived((msg) => {
|
|
53
|
-
|
|
54
|
-
|
|
75
|
+
wa.onMessageReceived(async (msg) => {
|
|
76
|
+
const jid = msg.key?.remoteJid
|
|
77
|
+
const text = msg.message?.conversation || msg.message?.extendedTextMessage?.text || ''
|
|
55
78
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
79
|
+
if (jid && text.toLowerCase() === 'ping') {
|
|
80
|
+
await wa.sendMessage(msg.sessionId, jid, { text: 'pong' })
|
|
81
|
+
}
|
|
82
|
+
})
|
|
59
83
|
|
|
60
|
-
main
|
|
84
|
+
wa.startSession('main', { printQR: true }).catch(console.error)
|
|
61
85
|
```
|
|
62
86
|
|
|
63
|
-
|
|
87
|
+
---
|
|
64
88
|
|
|
65
|
-
|
|
66
|
-
const wa = require('@neelegirl/wa-api')
|
|
89
|
+
## API Overview
|
|
67
90
|
|
|
68
|
-
|
|
69
|
-
await wa.startSessionWithPairingCode(
|
|
70
|
-
'session2',
|
|
71
|
-
{ phoneNumber: '491234567890' },
|
|
72
|
-
'ONIMAIII'
|
|
73
|
-
)
|
|
74
|
-
}
|
|
91
|
+
Session lifecycle:
|
|
75
92
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
93
|
+
- `startSession(sessionId, options)`
|
|
94
|
+
- `startSessionWithPairingCode(sessionId, { phoneNumber }, pairingCode?)`
|
|
95
|
+
- `deleteSession(sessionId)`
|
|
96
|
+
- `getSession(sessionId)`
|
|
97
|
+
- `getAllSession()`
|
|
98
|
+
- `loadSessionsFromStorage()`
|
|
79
99
|
|
|
80
|
-
|
|
81
|
-
```
|
|
100
|
+
Messaging:
|
|
82
101
|
|
|
83
|
-
|
|
84
|
-
|
|
102
|
+
- `sendMessage(sessionId, jidOrPhone, content, options?)`
|
|
103
|
+
- `sendStatusMentions(sessionId, content, options?)`
|
|
104
|
+
- `relayMessage(sessionId, jidOrPhone, content, options?)`
|
|
85
105
|
|
|
86
|
-
|
|
106
|
+
Event hooks:
|
|
87
107
|
|
|
88
|
-
|
|
89
|
-
|
|
108
|
+
- `onMessageReceived(listener)`
|
|
109
|
+
- `onMessageUpdate(listener)`
|
|
110
|
+
- `onQRUpdated(listener)`
|
|
111
|
+
- `onConnected(listener)`
|
|
112
|
+
- `onConnecting(listener)`
|
|
113
|
+
- `onDisconnected(listener)`
|
|
114
|
+
- `onPairingCode(listener)`
|
|
90
115
|
|
|
91
|
-
|
|
116
|
+
---
|
|
92
117
|
|
|
93
|
-
|
|
94
|
-
text: 'Status mit Mentions'
|
|
95
|
-
})
|
|
118
|
+
## Operational Notes
|
|
96
119
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
protocolMessage: {
|
|
102
|
-
type: 14
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
{}
|
|
106
|
-
)
|
|
107
|
-
```
|
|
120
|
+
- Node.js `>=20` required
|
|
121
|
+
- Credentials default path: `wa_credentials/<session>_credentials`
|
|
122
|
+
- Reconnect retries are handled internally
|
|
123
|
+
- Depends on `@neelegirl/baileys` runtime behavior, including custom Neelegirl compatibility logic
|
|
108
124
|
|
|
109
|
-
|
|
125
|
+
---
|
|
110
126
|
|
|
111
|
-
|
|
112
|
-
const wa = require('@neelegirl/wa-api')
|
|
127
|
+
## Word2Web Notes
|
|
113
128
|
|
|
114
|
-
|
|
115
|
-
console.log('Geladene Sessions:', loaded)
|
|
116
|
-
```
|
|
129
|
+
No dedicated Word2Web module is bundled in this package. Only document Word2Web behavior if implemented by your own host app.
|
|
117
130
|
|
|
118
|
-
|
|
131
|
+
---
|
|
119
132
|
|
|
120
|
-
##
|
|
133
|
+
## Changelog
|
|
121
134
|
|
|
122
|
-
|
|
123
|
-
- `onConnected`
|
|
124
|
-
- `onDisconnected`
|
|
125
|
-
- `onConnecting`
|
|
126
|
-
- `onMessageReceived`
|
|
127
|
-
- `onMessageUpdate`
|
|
128
|
-
- `onPairingCode`
|
|
135
|
+
### 1.6.4
|
|
129
136
|
|
|
130
|
-
|
|
137
|
+
- README restyled to match the main project presentation style
|
|
138
|
+
- Package metadata aligned with current dependency versions
|
|
139
|
+
- Dependency/peer range updated to `@neelegirl/baileys ^2.1.4`
|
|
131
140
|
|
|
132
|
-
|
|
133
|
-
- kein Queue-System
|
|
134
|
-
- keine Word2Web-spezifischen Features im Paket
|
|
135
|
-
- veroeffentlicht als vorgebaute `dist/`-Distribution
|
|
136
|
-
- das Low-Level-Verhalten kommt direkt aus `@neelegirl/baileys`
|
|
141
|
+
---
|
|
137
142
|
|
|
138
|
-
##
|
|
143
|
+
## Legal
|
|
139
144
|
|
|
140
|
-
|
|
145
|
+
This project is not affiliated with WhatsApp. Use responsibly and comply with platform terms and local laws.
|