@baileys-md/baileys 11.2.4 → 12.0.0
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 +113 -2
- package/WAProto/GenerateStatics.sh +4 -0
- package/WAProto/WAProto.proto +4775 -0
- package/WAProto/index.js +14270 -302
- package/lib/Defaults/index.js +50 -54
- package/lib/Defaults/wileys-version.json +3 -0
- package/lib/Signal/Group/ciphertext-message.js +15 -0
- package/lib/Signal/Group/group-session-builder.js +64 -0
- package/lib/Signal/Group/group_cipher.js +96 -0
- package/lib/Signal/Group/index.js +57 -0
- package/lib/Signal/Group/keyhelper.js +55 -0
- package/lib/Signal/Group/queue-job.js +57 -0
- package/lib/Signal/Group/sender-chain-key.js +34 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
- package/lib/Signal/Group/sender-key-message.js +69 -0
- package/lib/Signal/Group/sender-key-name.js +51 -0
- package/lib/Signal/Group/sender-key-record.js +53 -0
- package/lib/Signal/Group/sender-key-state.js +99 -0
- package/{WASignalGroup/sender_message_key.js → lib/Signal/Group/sender-message-key.js} +6 -16
- package/lib/Signal/libsignal.js +33 -20
- package/lib/Socket/Client/index.js +2 -3
- package/lib/Socket/Client/{web-socket-client.js → websocket.js} +54 -5
- package/lib/Socket/chats.js +136 -92
- package/lib/Socket/groups.js +16 -11
- package/lib/Socket/index.js +2 -2
- package/lib/Socket/messages-recv.js +26 -15
- package/lib/Socket/messages-send.js +122 -86
- package/lib/Socket/newsletter.js +23 -21
- package/lib/Socket/socket.js +29 -15
- package/lib/Store/make-in-memory-store.js +23 -15
- package/lib/Utils/auth-utils.js +0 -7
- package/lib/Utils/browser-utils.js +35 -0
- package/lib/Utils/chat-utils.js +2 -2
- package/lib/Utils/crypto.js +71 -29
- package/lib/Utils/decode-wa-message.js +15 -7
- package/lib/Utils/event-buffer.js +6 -8
- package/lib/Utils/generics.js +38 -16
- package/lib/Utils/history.js +1 -1
- package/lib/Utils/index.js +3 -1
- package/lib/Utils/message-retry-manager.js +128 -0
- package/lib/Utils/messages-media.js +212 -57
- package/lib/Utils/messages.js +38 -7
- package/lib/Utils/noise-handler.js +5 -10
- package/lib/Utils/process-message.js +34 -2
- package/lib/Utils/signal.js +26 -16
- package/lib/Utils/validate-connection.js +88 -66
- package/lib/Utils/{baileys-event-stream.js → wileys-event-stream.js} +1 -1
- package/lib/WABinary/constants.js +1276 -13
- package/lib/WABinary/jid-utils.js +20 -4
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +1 -1
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +3 -3
- package/lib/index.js +17 -6
- package/package.json +22 -17
- package/WASignalGroup/GroupProtocol.js +0 -1697
- package/WASignalGroup/ciphertext_message.js +0 -16
- package/WASignalGroup/group_cipher.js +0 -120
- package/WASignalGroup/group_session_builder.js +0 -46
- package/WASignalGroup/index.js +0 -5
- package/WASignalGroup/keyhelper.js +0 -21
- package/WASignalGroup/protobufs.js +0 -3
- package/WASignalGroup/queue_job.js +0 -69
- package/WASignalGroup/sender_chain_key.js +0 -50
- package/WASignalGroup/sender_key_distribution_message.js +0 -78
- package/WASignalGroup/sender_key_message.js +0 -92
- package/WASignalGroup/sender_key_name.js +0 -70
- package/WASignalGroup/sender_key_record.js +0 -56
- package/WASignalGroup/sender_key_state.js +0 -129
- package/lib/Defaults/baileys-version.json +0 -3
- package/lib/Defaults/phonenumber-mcc.json +0 -223
- package/lib/Socket/Client/mobile-socket-client.js +0 -65
- package/lib/Socket/registration.js +0 -166
- package/lib/Store/make-cache-manager-store.js +0 -83
- package/lib/Store/make-mongo-store.js +0 -567
- /package/lib/Socket/Client/{abstract-socket-client.js → types.js} +0 -0
package/README.md
CHANGED
|
@@ -1,2 +1,113 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
# <div align='center'>Typescript/Javascript WA Baileys Modification</div>
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
<img src="https://i.ibb.co/93c0VgP7/shamika-wa-baileys.jpg" />
|
|
6
|
+
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
## Important Note
|
|
10
|
+
|
|
11
|
+
The original repository was initially removed by its creator and subsequently taken over by [WhiskeySockets](https://github.com/WhiskeySockets). Building upon this foundation, I have implemented several enhancements and introduced new features that were not present in the original repository. These improvements aim to elevate functionality and provide a more robust and versatile experience.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
> [!CAUTION]
|
|
15
|
+
> NOTICE OF BREAKING CHANGE.
|
|
16
|
+
>
|
|
17
|
+
> As of 7.0.0, multiple breaking changes were introduced into the library.
|
|
18
|
+
>
|
|
19
|
+
> Please check out https://whiskey.so/migrate-latest for more information.
|
|
20
|
+
|
|
21
|
+
# Important Note
|
|
22
|
+
> [!IMPORTANT]
|
|
23
|
+
>This is a temporary README.md, the new guide is in development and will this file will be replaced with .github/README.md (already a default on GitHub).
|
|
24
|
+
>
|
|
25
|
+
>New guide link: https://baileys.wiki
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
### In package.json:
|
|
30
|
+
```json
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"shamika-wa-baileys": "*"
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Terminal Installation:
|
|
37
|
+
```
|
|
38
|
+
npm install shamika-wa-baileys
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Use the stable version:
|
|
42
|
+
```
|
|
43
|
+
yarn add shamika-wa-baileys
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Use the edge version (no guarantee of stability, but latest fixes + features)
|
|
47
|
+
```
|
|
48
|
+
yarn add npm:shamika-wa-baileys
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Then import your code using:
|
|
52
|
+
```ts
|
|
53
|
+
import makeWASocket from 'shamika-wa-baileys'
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Added Features and Improvements
|
|
57
|
+
Here are some of the features and improvements I have added:
|
|
58
|
+
|
|
59
|
+
- **Support for Sending Messages to Channels**
|
|
60
|
+
- **Support for Button Messages and Interactive Messages**
|
|
61
|
+
- **AI Message Icon**
|
|
62
|
+
- **Profile Picture Settings**
|
|
63
|
+
- **Custom Pairing Code**
|
|
64
|
+
- **Libsignal Fixes**
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
### How Whatsapp Communicate With Us
|
|
68
|
+
|
|
69
|
+
> [!TIP]
|
|
70
|
+
> If you want to learn whatsapp protocol, we recommend to study about Libsignal Protocol and Noise Protocol
|
|
71
|
+
|
|
72
|
+
- **Example:** Functionality to track the battery percentage of your phone. You enable logging and you'll see a message about your battery pop up in the console:
|
|
73
|
+
```
|
|
74
|
+
{
|
|
75
|
+
"level": 10,
|
|
76
|
+
"fromMe": false,
|
|
77
|
+
"frame": {
|
|
78
|
+
"tag": "ib",
|
|
79
|
+
"attrs": {
|
|
80
|
+
"from": "@s.whatsapp.net"
|
|
81
|
+
},
|
|
82
|
+
"content": [
|
|
83
|
+
{
|
|
84
|
+
"tag": "edge_routing",
|
|
85
|
+
"attrs": {},
|
|
86
|
+
"content": [
|
|
87
|
+
{
|
|
88
|
+
"tag": "routing_info",
|
|
89
|
+
"attrs": {},
|
|
90
|
+
"content": {
|
|
91
|
+
"type": "Buffer",
|
|
92
|
+
"data": [8,2,8,5]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
"msg":"communication"
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The `'frame'` is what the message received is, it has three components:
|
|
104
|
+
- `tag` -- what this frame is about (eg. message will have 'message')
|
|
105
|
+
- `attrs` -- a string key-value pair with some metadata (contains ID of the message usually)
|
|
106
|
+
- `content` -- the actual data (eg. a message node will have the actual message content in it)
|
|
107
|
+
- read more about this format [here](/src/WABinary/readme.md)
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Notes
|
|
111
|
+
Everything other than the modifications mentioned above remains the same as the original repository. You can check out the original repository at [WhiskeySockets](https://github.com/WhiskeySockets/Baileys)
|
|
112
|
+
|
|
113
|
+
This was made purely for my own enjoyment and experimentation, so the original copyright belongs to the original owners.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
yarn pbjs -t static-module -w commonjs -o ./WAProto/index.js ./WAProto/WAProto.proto;
|
|
2
|
+
yarn pbts -o ./WAProto/index.d.ts ./WAProto/index.js;
|
|
3
|
+
|
|
4
|
+
#protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=env=node,useOptionals=true,forceLong=long --ts_proto_out=. ./src/Binary/WAMessage.proto;
|