@neelegirly/baileys 2.2.23 โ 2.2.25
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 +54 -0
- package/lib/Utils/messages-media.js +9 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,3 +1,57 @@
|
|
|
1
|
+
<pre align="center">
|
|
2
|
+
๐ Neelegirly Ecosystem Clean Stability Update ๐
|
|
3
|
+
4 Packages ยท 1 App ยท PM2 only runs the app
|
|
4
|
+
</pre>
|
|
5
|
+
|
|
6
|
+
# ๐ธ @neelegirly/baileys
|
|
7
|
+
|
|
8
|
+
WhatsApp Web API core connection layer.
|
|
9
|
+
|
|
10
|
+
## Clean Architecture
|
|
11
|
+
|
|
12
|
+
```text
|
|
13
|
+
@neelegirly/libsignal
|
|
14
|
+
โ
|
|
15
|
+
@neelegirly/baileys
|
|
16
|
+
โ
|
|
17
|
+
@neelegirly/wa-api
|
|
18
|
+
โ
|
|
19
|
+
App (PM2 managed)
|
|
20
|
+
โ
|
|
21
|
+
@neelegirly/downloader (optional utility)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Official Package Role
|
|
25
|
+
|
|
26
|
+
- Depends on @neelegirly/libsignal
|
|
27
|
+
- Core connection layer
|
|
28
|
+
- Used by @neelegirly/wa-api
|
|
29
|
+
|
|
30
|
+
## PM2 Rule
|
|
31
|
+
|
|
32
|
+
> WA-API handles sessions internally. PM2 only runs the app.
|
|
33
|
+
|
|
34
|
+
Start your app with PM2 like this:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pm2 start index.js --name bot
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Do not start one PM2 process per session. Sessions belong inside the app through `@neelegirly/wa-api`.
|
|
41
|
+
|
|
42
|
+
## Install
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install @neelegirly/baileys
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Clean Stability Release
|
|
49
|
+
|
|
50
|
+
This release clarifies the ecosystem structure and removes workspace/core confusion from the documentation.
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
1
55
|
<div align="center">
|
|
2
56
|
|
|
3
57
|
# ๐ธ @neelegirly/baileys ๐ธ
|
|
@@ -344,10 +344,18 @@ const getHttpStream = async (url, options = {}) => {
|
|
|
344
344
|
return fetched.data
|
|
345
345
|
}
|
|
346
346
|
|
|
347
|
+
const __ensureBaileysTmp = () => {
|
|
348
|
+
try {
|
|
349
|
+
const __tmpDir = path_1.join(process.cwd(), 'tmp')
|
|
350
|
+
if (!fs_1.existsSync(__tmpDir)) fs_1.mkdirSync(__tmpDir, { recursive: true })
|
|
351
|
+
} catch (_) { /* never break the caller */ }
|
|
352
|
+
}
|
|
353
|
+
|
|
347
354
|
const prepareStream = async (media, mediaType, { logger, saveOriginalFileIfRequired, opts } = {}) => {
|
|
348
355
|
const { stream, type } = await getStream(media, opts)
|
|
349
356
|
logger?.debug('fetched media stream')
|
|
350
357
|
|
|
358
|
+
__ensureBaileysTmp()
|
|
351
359
|
const encFilePath = path_1.join(process.cwd(), 'tmp', mediaType + generics_1.generateMessageID() + '-plain')
|
|
352
360
|
const encFileWriteStream = fs_1.createWriteStream(encFilePath)
|
|
353
361
|
|
|
@@ -423,6 +431,7 @@ const encryptedStream = async (media, mediaType, { logger, saveOriginalFileIfReq
|
|
|
423
431
|
logger?.debug('fetched media stream')
|
|
424
432
|
const mediaKey = Crypto.randomBytes(32)
|
|
425
433
|
const { cipherKey, iv, macKey } = await getMediaKeys(mediaKey, mediaType)
|
|
434
|
+
__ensureBaileysTmp()
|
|
426
435
|
const encFilePath = path_1.join(process.cwd(), 'tmp', mediaType + generics_1.generateMessageID() + '-enc')
|
|
427
436
|
const encFileWriteStream = fs_1.createWriteStream(encFilePath)
|
|
428
437
|
let originalFileStream
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neelegirly/baileys",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.25",
|
|
4
4
|
"description": "Neelegirly fork of Baileys: multi-device WhatsApp Web API for Node.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"whatsapp",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@adiwajshing/keyed-db": "^0.2.4",
|
|
45
45
|
"@cacheable/node-cache": "^1.5.4",
|
|
46
46
|
"@hapi/boom": "^9.1.3",
|
|
47
|
-
"@neelegirly/libsignal": "1.0.
|
|
47
|
+
"@neelegirly/libsignal": "1.0.32",
|
|
48
48
|
"async-mutex": "^0.5.0",
|
|
49
49
|
"audio-decode": "^2.1.3",
|
|
50
50
|
"axios": "^1.3.3",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"ws": "^8.13.0"
|
|
60
60
|
},
|
|
61
61
|
"overrides": {
|
|
62
|
-
"@neelegirly/libsignal": "1.0.
|
|
62
|
+
"@neelegirly/libsignal": "1.0.32"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@adiwajshing/eslint-config": "github:adiwajshing/eslint-config",
|