@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.
Files changed (2) hide show
  1. package/package.json +8 -6
  2. 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",
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.0",
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
- "wa-api"
40
+ "automation",
41
+ "neelegirl"
40
42
  ],
41
43
  "peerDependencies": {
42
- "@neelegirl/baileys": "^2.1.0"
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
- # @neelegirl/wa-api
1
+ <div align="center">
2
2
 
3
- ![Neelegirl wa-api](https://files.catbox.moe/6np1ii.JPG)
3
+ # @neelegirl/wa-api
4
4
 
5
- High-level multi-session API wrapper for WhatsApp automation, built on `@neelegirl/baileys`.
5
+ ### High-level multi-session WhatsApp API on top of @neelegirl/baileys
6
6
 
7
- ## Status
7
+ [![Version](https://img.shields.io/badge/Version-1.6.4-ff69b4?style=for-the-badge)](https://www.npmjs.com/package/@neelegirl/wa-api)
8
+ [![Core](https://img.shields.io/badge/Core-@neelegirl%2Fbaileys%202.1.4-9b59b6?style=for-the-badge)](https://www.npmjs.com/package/@neelegirl/baileys)
9
+ [![Node](https://img.shields.io/badge/Node-20%2B-2ea043?style=for-the-badge&logo=node.js)](https://nodejs.org)
10
+ [![License](https://img.shields.io/badge/License-MIT-f97316?style=for-the-badge)](LICENSE)
8
11
 
9
- - Package version: `1.6.0`
10
- - Runtime: Node.js `>=20`
11
- - Core dependency: `@neelegirl/baileys` `^2.1.0`
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
- ## Features
16
+ | Package | Latest Version | Depends On |
17
+ |---|---:|---|
18
+ | `@neelegirl/wa-api` | `1.6.4` | `@neelegirl/baileys ^2.1.4` |
14
19
 
15
- - Multi-session start/stop with filesystem credentials
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
- ## Install
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
- ## Quick Start
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 for session:', sessionId)
67
+ console.log('QR updated:', sessionId)
35
68
  console.log(qr)
36
69
  })
37
70
 
38
71
  wa.onConnected((sessionId) => {
39
- console.log('connected:', sessionId)
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
- ## API Surface
56
-
57
- - Session lifecycle
58
- - `startSession(sessionId, options)`
59
- - `startSessionWithPairingCode(sessionId, { phoneNumber }, pairingCode?)`
60
- - `deleteSession(sessionId)`
61
- - `getSession(sessionId)`
62
- - `getAllSession()`
63
- - `loadSessionsFromStorage()`
64
-
65
- - Messaging
66
- - `sendMessage(sessionId, jidOrPhone, content, options?)`
67
- - `sendStatusMentions(sessionId, content, options?)`
68
- - `relayMessage(sessionId, jidOrPhone, content, options?)`
69
-
70
- - Events
71
- - `onMessageReceived(listener)`
72
- - `onMessageUpdate(listener)`
73
- - `onQRUpdated(listener)`
74
- - `onConnected(listener)`
75
- - `onConnecting(listener)`
76
- - `onDisconnected(listener)`
77
- - `onPairingCode(listener)`
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
- - Credentials are stored under `wa_credentials/<session>_credentials`.
82
- - The package performs a lightweight npm update check once per process start.
83
- - No dedicated Word2Web module is shipped in this package.
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.