@neelegirl/wa-api 1.6.3 → 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/package.json +8 -6
- package/readme.md +105 -48
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
2
|
"name": "@neelegirl/wa-api",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.4",
|
|
4
4
|
"description": "Multi-session WhatsApp API wrapper built on @neelegirl/baileys",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"author": "Neele",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@neelegirl/baileys": "^2.1.
|
|
28
|
+
"@neelegirl/baileys": "^2.1.4",
|
|
29
29
|
"pino": "^8.11.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -35,13 +35,15 @@
|
|
|
35
35
|
"keywords": [
|
|
36
36
|
"whatsapp",
|
|
37
37
|
"baileys",
|
|
38
|
+
"api",
|
|
38
39
|
"multi-session",
|
|
39
|
-
"
|
|
40
|
+
"automation",
|
|
41
|
+
"neelegirl"
|
|
40
42
|
],
|
|
41
43
|
"peerDependencies": {
|
|
42
|
-
"@neelegirl/baileys": "^2.1.
|
|
44
|
+
"@neelegirl/baileys": "^2.1.4"
|
|
43
45
|
},
|
|
44
46
|
"engines": {
|
|
45
47
|
"node": ">=20.0.0"
|
|
46
48
|
}
|
|
47
|
-
}
|
|
49
|
+
}
|
package/readme.md
CHANGED
|
@@ -1,88 +1,145 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# @neelegirl/wa-api
|
|
4
4
|
|
|
5
|
-
High-level multi-session API
|
|
5
|
+
### High-level multi-session WhatsApp API on top of @neelegirl/baileys
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
[](https://www.npmjs.com/package/@neelegirl/wa-api)
|
|
8
|
+
[](https://www.npmjs.com/package/@neelegirl/baileys)
|
|
9
|
+
[](https://nodejs.org)
|
|
10
|
+
[](LICENSE)
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
+
<p align="center">
|
|
13
|
+
<img src="https://files.catbox.moe/6np1ii.JPG" width="760" alt="Neelegirl wa-api Header" />
|
|
14
|
+
</p>
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
| Package | Latest Version | Depends On |
|
|
17
|
+
|---|---:|---|
|
|
18
|
+
| `@neelegirl/wa-api` | `1.6.4` | `@neelegirl/baileys ^2.1.4` |
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
- QR flow via callback
|
|
17
|
-
- Pairing-code flow via callback
|
|
18
|
-
- Auto reconnect retries (up to 10 attempts)
|
|
19
|
-
- Message upsert/update callbacks with helper media savers
|
|
20
|
-
- `sendMessage`, `sendStatusMentions`, and low-level `relayMessage`
|
|
20
|
+
[Installation](#installation) · [Quickstart](#quickstart) · [API Overview](#api-overview) · [Operational Notes](#operational-notes)
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Table of Contents
|
|
27
|
+
|
|
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)
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
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
|
+
---
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
23
54
|
|
|
24
55
|
```bash
|
|
25
56
|
npm install @neelegirl/wa-api
|
|
26
57
|
```
|
|
27
58
|
|
|
28
|
-
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Quickstart
|
|
29
62
|
|
|
30
63
|
```js
|
|
31
64
|
const wa = require('@neelegirl/wa-api')
|
|
32
65
|
|
|
33
66
|
wa.onQRUpdated(({ sessionId, qr }) => {
|
|
34
|
-
console.log('QR
|
|
67
|
+
console.log('QR updated:', sessionId)
|
|
35
68
|
console.log(qr)
|
|
36
69
|
})
|
|
37
70
|
|
|
38
71
|
wa.onConnected((sessionId) => {
|
|
39
|
-
console.log('
|
|
72
|
+
console.log('Connected:', sessionId)
|
|
40
73
|
})
|
|
41
74
|
|
|
42
75
|
wa.onMessageReceived(async (msg) => {
|
|
43
|
-
const sessionId = msg.sessionId
|
|
44
76
|
const jid = msg.key?.remoteJid
|
|
45
77
|
const text = msg.message?.conversation || msg.message?.extendedTextMessage?.text || ''
|
|
46
78
|
|
|
47
79
|
if (jid && text.toLowerCase() === 'ping') {
|
|
48
|
-
await wa.sendMessage(sessionId, jid, { text: 'pong' })
|
|
80
|
+
await wa.sendMessage(msg.sessionId, jid, { text: 'pong' })
|
|
49
81
|
}
|
|
50
82
|
})
|
|
51
83
|
|
|
52
84
|
wa.startSession('main', { printQR: true }).catch(console.error)
|
|
53
85
|
```
|
|
54
86
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## API Overview
|
|
90
|
+
|
|
91
|
+
Session lifecycle:
|
|
92
|
+
|
|
93
|
+
- `startSession(sessionId, options)`
|
|
94
|
+
- `startSessionWithPairingCode(sessionId, { phoneNumber }, pairingCode?)`
|
|
95
|
+
- `deleteSession(sessionId)`
|
|
96
|
+
- `getSession(sessionId)`
|
|
97
|
+
- `getAllSession()`
|
|
98
|
+
- `loadSessionsFromStorage()`
|
|
99
|
+
|
|
100
|
+
Messaging:
|
|
101
|
+
|
|
102
|
+
- `sendMessage(sessionId, jidOrPhone, content, options?)`
|
|
103
|
+
- `sendStatusMentions(sessionId, content, options?)`
|
|
104
|
+
- `relayMessage(sessionId, jidOrPhone, content, options?)`
|
|
105
|
+
|
|
106
|
+
Event hooks:
|
|
107
|
+
|
|
108
|
+
- `onMessageReceived(listener)`
|
|
109
|
+
- `onMessageUpdate(listener)`
|
|
110
|
+
- `onQRUpdated(listener)`
|
|
111
|
+
- `onConnected(listener)`
|
|
112
|
+
- `onConnecting(listener)`
|
|
113
|
+
- `onDisconnected(listener)`
|
|
114
|
+
- `onPairingCode(listener)`
|
|
115
|
+
|
|
116
|
+
---
|
|
78
117
|
|
|
79
118
|
## Operational Notes
|
|
80
119
|
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
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
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Word2Web Notes
|
|
128
|
+
|
|
129
|
+
No dedicated Word2Web module is bundled in this package. Only document Word2Web behavior if implemented by your own host app.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Changelog
|
|
134
|
+
|
|
135
|
+
### 1.6.4
|
|
136
|
+
|
|
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`
|
|
140
|
+
|
|
141
|
+
---
|
|
84
142
|
|
|
85
143
|
## Legal
|
|
86
144
|
|
|
87
|
-
This project is not affiliated with WhatsApp.
|
|
88
|
-
Use responsibly and comply with applicable laws and platform terms.
|
|
145
|
+
This project is not affiliated with WhatsApp. Use responsibly and comply with platform terms and local laws.
|