shurainc 3.0.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/LICENSE +21 -0
- package/README.md +405 -0
- package/WAProto/GenerateStatics.sh +3 -0
- package/WAProto/WAProto.proto +5479 -0
- package/WAProto/fix-imports.js +29 -0
- package/WAProto/index.d.ts +14017 -0
- package/WAProto/index.js +97650 -0
- package/engine-requirements.js +10 -0
- package/lib/Defaults/index.d.ts +62 -0
- package/lib/Defaults/index.d.ts.map +1 -0
- package/lib/Defaults/index.js +115 -0
- package/lib/Defaults/index.js.map +1 -0
- package/lib/Signal/Group/ciphertext-message.d.ts +10 -0
- package/lib/Signal/Group/ciphertext-message.d.ts.map +1 -0
- package/lib/Signal/Group/ciphertext-message.js +12 -0
- package/lib/Signal/Group/ciphertext-message.js.map +1 -0
- package/lib/Signal/Group/group-session-builder.d.ts +15 -0
- package/lib/Signal/Group/group-session-builder.d.ts.map +1 -0
- package/lib/Signal/Group/group-session-builder.js +30 -0
- package/lib/Signal/Group/group-session-builder.js.map +1 -0
- package/lib/Signal/Group/group_cipher.d.ts +17 -0
- package/lib/Signal/Group/group_cipher.d.ts.map +1 -0
- package/lib/Signal/Group/group_cipher.js +82 -0
- package/lib/Signal/Group/group_cipher.js.map +1 -0
- package/lib/Signal/Group/index.d.ts +12 -0
- package/lib/Signal/Group/index.d.ts.map +1 -0
- package/lib/Signal/Group/index.js +12 -0
- package/lib/Signal/Group/index.js.map +1 -0
- package/lib/Signal/Group/keyhelper.d.ts +11 -0
- package/lib/Signal/Group/keyhelper.d.ts.map +1 -0
- package/lib/Signal/Group/keyhelper.js +18 -0
- package/lib/Signal/Group/keyhelper.js.map +1 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +14 -0
- package/lib/Signal/Group/sender-chain-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-chain-key.js +26 -0
- package/lib/Signal/Group/sender-chain-key.js.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +17 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +63 -0
- package/lib/Signal/Group/sender-key-distribution-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-message.d.ts +19 -0
- package/lib/Signal/Group/sender-key-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-message.js +66 -0
- package/lib/Signal/Group/sender-key-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-name.d.ts +18 -0
- package/lib/Signal/Group/sender-key-name.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-name.js +48 -0
- package/lib/Signal/Group/sender-key-name.js.map +1 -0
- package/lib/Signal/Group/sender-key-record.d.ts +31 -0
- package/lib/Signal/Group/sender-key-record.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-record.js +41 -0
- package/lib/Signal/Group/sender-key-record.js.map +1 -0
- package/lib/Signal/Group/sender-key-state.d.ts +39 -0
- package/lib/Signal/Group/sender-key-state.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-state.js +84 -0
- package/lib/Signal/Group/sender-key-state.js.map +1 -0
- package/lib/Signal/Group/sender-message-key.d.ts +12 -0
- package/lib/Signal/Group/sender-message-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-message-key.js +26 -0
- package/lib/Signal/Group/sender-message-key.js.map +1 -0
- package/lib/Signal/libsignal.d.ts +5 -0
- package/lib/Signal/libsignal.d.ts.map +1 -0
- package/lib/Signal/libsignal.js +342 -0
- package/lib/Signal/libsignal.js.map +1 -0
- package/lib/Signal/lid-mapping.d.ts +23 -0
- package/lib/Signal/lid-mapping.d.ts.map +1 -0
- package/lib/Signal/lid-mapping.js +171 -0
- package/lib/Signal/lid-mapping.js.map +1 -0
- package/lib/Socket/Client/index.d.ts +3 -0
- package/lib/Socket/Client/index.d.ts.map +1 -0
- package/lib/Socket/Client/index.js +3 -0
- package/lib/Socket/Client/index.js.map +1 -0
- package/lib/Socket/Client/types.d.ts +16 -0
- package/lib/Socket/Client/types.d.ts.map +1 -0
- package/lib/Socket/Client/types.js +11 -0
- package/lib/Socket/Client/types.js.map +1 -0
- package/lib/Socket/Client/websocket.d.ts +13 -0
- package/lib/Socket/Client/websocket.d.ts.map +1 -0
- package/lib/Socket/Client/websocket.js +50 -0
- package/lib/Socket/Client/websocket.js.map +1 -0
- package/lib/Socket/business.d.ts +190 -0
- package/lib/Socket/business.d.ts.map +1 -0
- package/lib/Socket/business.js +376 -0
- package/lib/Socket/business.js.map +1 -0
- package/lib/Socket/chats.d.ts +100 -0
- package/lib/Socket/chats.d.ts.map +1 -0
- package/lib/Socket/chats.js +964 -0
- package/lib/Socket/chats.js.map +1 -0
- package/lib/Socket/communities.d.ts +246 -0
- package/lib/Socket/communities.d.ts.map +1 -0
- package/lib/Socket/communities.js +431 -0
- package/lib/Socket/communities.js.map +1 -0
- package/lib/Socket/groups.d.ts +139 -0
- package/lib/Socket/groups.d.ts.map +1 -0
- package/lib/Socket/groups.js +327 -0
- package/lib/Socket/groups.js.map +1 -0
- package/lib/Socket/index.d.ts +233 -0
- package/lib/Socket/index.d.ts.map +1 -0
- package/lib/Socket/index.js +18 -0
- package/lib/Socket/index.js.map +1 -0
- package/lib/Socket/messages-recv.d.ts +175 -0
- package/lib/Socket/messages-recv.d.ts.map +1 -0
- package/lib/Socket/messages-recv.js +1292 -0
- package/lib/Socket/messages-recv.js.map +1 -0
- package/lib/Socket/messages-send.d.ts +171 -0
- package/lib/Socket/messages-send.d.ts.map +1 -0
- package/lib/Socket/messages-send.js +1292 -0
- package/lib/Socket/messages-send.js.map +1 -0
- package/lib/Socket/mex.d.ts +3 -0
- package/lib/Socket/mex.d.ts.map +1 -0
- package/lib/Socket/mex.js +42 -0
- package/lib/Socket/mex.js.map +1 -0
- package/lib/Socket/newsletter.d.ts +149 -0
- package/lib/Socket/newsletter.d.ts.map +1 -0
- package/lib/Socket/newsletter.js +181 -0
- package/lib/Socket/newsletter.js.map +1 -0
- package/lib/Socket/socket.d.ts +53 -0
- package/lib/Socket/socket.d.ts.map +1 -0
- package/lib/Socket/socket.js +900 -0
- package/lib/Socket/socket.js.map +1 -0
- package/lib/Types/Auth.d.ts +115 -0
- package/lib/Types/Auth.d.ts.map +1 -0
- package/lib/Types/Auth.js +2 -0
- package/lib/Types/Auth.js.map +1 -0
- package/lib/Types/Bussines.d.ts +25 -0
- package/lib/Types/Bussines.d.ts.map +1 -0
- package/lib/Types/Bussines.js +2 -0
- package/lib/Types/Bussines.js.map +1 -0
- package/lib/Types/Call.d.ts +14 -0
- package/lib/Types/Call.d.ts.map +1 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Call.js.map +1 -0
- package/lib/Types/Chat.d.ts +123 -0
- package/lib/Types/Chat.d.ts.map +1 -0
- package/lib/Types/Chat.js +8 -0
- package/lib/Types/Chat.js.map +1 -0
- package/lib/Types/Contact.d.ts +24 -0
- package/lib/Types/Contact.d.ts.map +1 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Contact.js.map +1 -0
- package/lib/Types/Events.d.ts +202 -0
- package/lib/Types/Events.d.ts.map +1 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/Events.js.map +1 -0
- package/lib/Types/GroupMetadata.d.ts +67 -0
- package/lib/Types/GroupMetadata.d.ts.map +1 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/GroupMetadata.js.map +1 -0
- package/lib/Types/Label.d.ts +47 -0
- package/lib/Types/Label.d.ts.map +1 -0
- package/lib/Types/Label.js +25 -0
- package/lib/Types/Label.js.map +1 -0
- package/lib/Types/LabelAssociation.d.ts +30 -0
- package/lib/Types/LabelAssociation.d.ts.map +1 -0
- package/lib/Types/LabelAssociation.js +7 -0
- package/lib/Types/LabelAssociation.js.map +1 -0
- package/lib/Types/Message.d.ts +342 -0
- package/lib/Types/Message.d.ts.map +1 -0
- package/lib/Types/Message.js +11 -0
- package/lib/Types/Message.js.map +1 -0
- package/lib/Types/Newsletter.d.ts +135 -0
- package/lib/Types/Newsletter.d.ts.map +1 -0
- package/lib/Types/Newsletter.js +31 -0
- package/lib/Types/Newsletter.js.map +1 -0
- package/lib/Types/Product.d.ts +79 -0
- package/lib/Types/Product.d.ts.map +1 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/Product.js.map +1 -0
- package/lib/Types/Signal.d.ts +76 -0
- package/lib/Types/Signal.d.ts.map +1 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Signal.js.map +1 -0
- package/lib/Types/Socket.d.ts +133 -0
- package/lib/Types/Socket.d.ts.map +1 -0
- package/lib/Types/Socket.js +3 -0
- package/lib/Types/Socket.js.map +1 -0
- package/lib/Types/State.d.ts +39 -0
- package/lib/Types/State.d.ts.map +1 -0
- package/lib/Types/State.js +13 -0
- package/lib/Types/State.js.map +1 -0
- package/lib/Types/USync.d.ts +26 -0
- package/lib/Types/USync.d.ts.map +1 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/USync.js.map +1 -0
- package/lib/Types/index.d.ts +65 -0
- package/lib/Types/index.d.ts.map +1 -0
- package/lib/Types/index.js +26 -0
- package/lib/Types/index.js.map +1 -0
- package/lib/Utils/auth-utils.d.ts +19 -0
- package/lib/Utils/auth-utils.d.ts.map +1 -0
- package/lib/Utils/auth-utils.js +257 -0
- package/lib/Utils/auth-utils.js.map +1 -0
- package/lib/Utils/browser-utils.d.ts +4 -0
- package/lib/Utils/browser-utils.d.ts.map +1 -0
- package/lib/Utils/browser-utils.js +28 -0
- package/lib/Utils/browser-utils.js.map +1 -0
- package/lib/Utils/business.d.ts +23 -0
- package/lib/Utils/business.d.ts.map +1 -0
- package/lib/Utils/business.js +231 -0
- package/lib/Utils/business.js.map +1 -0
- package/lib/Utils/chat-utils.d.ts +70 -0
- package/lib/Utils/chat-utils.d.ts.map +1 -0
- package/lib/Utils/chat-utils.js +763 -0
- package/lib/Utils/chat-utils.js.map +1 -0
- package/lib/Utils/crypto.d.ts +41 -0
- package/lib/Utils/crypto.d.ts.map +1 -0
- package/lib/Utils/crypto.js +142 -0
- package/lib/Utils/crypto.js.map +1 -0
- package/lib/Utils/decode-wa-message.d.ts +48 -0
- package/lib/Utils/decode-wa-message.d.ts.map +1 -0
- package/lib/Utils/decode-wa-message.js +283 -0
- package/lib/Utils/decode-wa-message.js.map +1 -0
- package/lib/Utils/event-buffer.d.ts +34 -0
- package/lib/Utils/event-buffer.d.ts.map +1 -0
- package/lib/Utils/event-buffer.js +548 -0
- package/lib/Utils/event-buffer.js.map +1 -0
- package/lib/Utils/generics.d.ts +90 -0
- package/lib/Utils/generics.d.ts.map +1 -0
- package/lib/Utils/generics.js +381 -0
- package/lib/Utils/generics.js.map +1 -0
- package/lib/Utils/history.d.ts +19 -0
- package/lib/Utils/history.d.ts.map +1 -0
- package/lib/Utils/history.js +90 -0
- package/lib/Utils/history.js.map +1 -0
- package/lib/Utils/index.d.ts +19 -0
- package/lib/Utils/index.d.ts.map +1 -0
- package/lib/Utils/index.js +19 -0
- package/lib/Utils/index.js.map +1 -0
- package/lib/Utils/link-preview.d.ts +21 -0
- package/lib/Utils/link-preview.d.ts.map +1 -0
- package/lib/Utils/link-preview.js +85 -0
- package/lib/Utils/link-preview.js.map +1 -0
- package/lib/Utils/logger.d.ts +12 -0
- package/lib/Utils/logger.d.ts.map +1 -0
- package/lib/Utils/logger.js +3 -0
- package/lib/Utils/logger.js.map +1 -0
- package/lib/Utils/lt-hash.d.ts +13 -0
- package/lib/Utils/lt-hash.d.ts.map +1 -0
- package/lib/Utils/lt-hash.js +48 -0
- package/lib/Utils/lt-hash.js.map +1 -0
- package/lib/Utils/make-mutex.d.ts +8 -0
- package/lib/Utils/make-mutex.d.ts.map +1 -0
- package/lib/Utils/make-mutex.js +40 -0
- package/lib/Utils/make-mutex.js.map +1 -0
- package/lib/Utils/message-retry-manager.d.ts +82 -0
- package/lib/Utils/message-retry-manager.d.ts.map +1 -0
- package/lib/Utils/message-retry-manager.js +172 -0
- package/lib/Utils/message-retry-manager.js.map +1 -0
- package/lib/Utils/messages-media.d.ts +114 -0
- package/lib/Utils/messages-media.d.ts.map +1 -0
- package/lib/Utils/messages-media.js +667 -0
- package/lib/Utils/messages-media.js.map +1 -0
- package/lib/Utils/messages.d.ts +89 -0
- package/lib/Utils/messages.d.ts.map +1 -0
- package/lib/Utils/messages.js +1132 -0
- package/lib/Utils/messages.js.map +1 -0
- package/lib/Utils/noise-handler.d.ts +20 -0
- package/lib/Utils/noise-handler.d.ts.map +1 -0
- package/lib/Utils/noise-handler.js +147 -0
- package/lib/Utils/noise-handler.js.map +1 -0
- package/lib/Utils/pre-key-manager.d.ts +28 -0
- package/lib/Utils/pre-key-manager.d.ts.map +1 -0
- package/lib/Utils/pre-key-manager.js +106 -0
- package/lib/Utils/pre-key-manager.js.map +1 -0
- package/lib/Utils/process-message.d.ts +60 -0
- package/lib/Utils/process-message.d.ts.map +1 -0
- package/lib/Utils/process-message.js +485 -0
- package/lib/Utils/process-message.js.map +1 -0
- package/lib/Utils/signal.d.ts +34 -0
- package/lib/Utils/signal.d.ts.map +1 -0
- package/lib/Utils/signal.js +159 -0
- package/lib/Utils/signal.js.map +1 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +13 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-multi-file-auth-state.js +121 -0
- package/lib/Utils/use-multi-file-auth-state.js.map +1 -0
- package/lib/Utils/validate-connection.d.ts +11 -0
- package/lib/Utils/validate-connection.d.ts.map +1 -0
- package/lib/Utils/validate-connection.js +200 -0
- package/lib/Utils/validate-connection.js.map +1 -0
- package/lib/WABinary/constants.d.ts +28 -0
- package/lib/WABinary/constants.d.ts.map +1 -0
- package/lib/WABinary/constants.js +1301 -0
- package/lib/WABinary/constants.js.map +1 -0
- package/lib/WABinary/decode.d.ts +7 -0
- package/lib/WABinary/decode.d.ts.map +1 -0
- package/lib/WABinary/decode.js +238 -0
- package/lib/WABinary/decode.js.map +1 -0
- package/lib/WABinary/encode.d.ts +3 -0
- package/lib/WABinary/encode.d.ts.map +1 -0
- package/lib/WABinary/encode.js +216 -0
- package/lib/WABinary/encode.js.map +1 -0
- package/lib/WABinary/generic-utils.d.ts +17 -0
- package/lib/WABinary/generic-utils.d.ts.map +1 -0
- package/lib/WABinary/generic-utils.js +233 -0
- package/lib/WABinary/generic-utils.js.map +1 -0
- package/lib/WABinary/index.d.ts +6 -0
- package/lib/WABinary/index.d.ts.map +1 -0
- package/lib/WABinary/index.js +6 -0
- package/lib/WABinary/index.js.map +1 -0
- package/lib/WABinary/jid-utils.d.ts +48 -0
- package/lib/WABinary/jid-utils.d.ts.map +1 -0
- package/lib/WABinary/jid-utils.js +96 -0
- package/lib/WABinary/jid-utils.js.map +1 -0
- package/lib/WABinary/types.d.ts +19 -0
- package/lib/WABinary/types.d.ts.map +1 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WABinary/types.js.map +1 -0
- package/lib/WAM/BinaryInfo.d.ts +9 -0
- package/lib/WAM/BinaryInfo.d.ts.map +1 -0
- package/lib/WAM/BinaryInfo.js +10 -0
- package/lib/WAM/BinaryInfo.js.map +1 -0
- package/lib/WAM/constants.d.ts +40 -0
- package/lib/WAM/constants.d.ts.map +1 -0
- package/lib/WAM/constants.js +22853 -0
- package/lib/WAM/constants.js.map +1 -0
- package/lib/WAM/encode.d.ts +3 -0
- package/lib/WAM/encode.d.ts.map +1 -0
- package/lib/WAM/encode.js +150 -0
- package/lib/WAM/encode.js.map +1 -0
- package/lib/WAM/index.d.ts +4 -0
- package/lib/WAM/index.d.ts.map +1 -0
- package/lib/WAM/index.js +4 -0
- package/lib/WAM/index.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +10 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +29 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +23 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +54 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +13 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +13 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +26 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +51 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +10 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/index.d.ts +5 -0
- package/lib/WAUSync/Protocols/index.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/index.js +5 -0
- package/lib/WAUSync/Protocols/index.js.map +1 -0
- package/lib/WAUSync/USyncQuery.d.ts +29 -0
- package/lib/WAUSync/USyncQuery.d.ts.map +1 -0
- package/lib/WAUSync/USyncQuery.js +94 -0
- package/lib/WAUSync/USyncQuery.js.map +1 -0
- package/lib/WAUSync/USyncUser.d.ts +13 -0
- package/lib/WAUSync/USyncUser.d.ts.map +1 -0
- package/lib/WAUSync/USyncUser.js +23 -0
- package/lib/WAUSync/USyncUser.js.map +1 -0
- package/lib/WAUSync/index.d.ts +4 -0
- package/lib/WAUSync/index.d.ts.map +1 -0
- package/lib/WAUSync/index.js +4 -0
- package/lib/WAUSync/index.js.map +1 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +11 -0
- package/lib/index.js.map +1 -0
- package/package.json +119 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Rajeh Taher/WhiskeySockets
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
# shura-baileys
|
|
2
|
+
|
|
3
|
+
`shura-baileys` is a maintained fork of `@whiskeysockets/baileys`, modified for the shurainc bot. The goal is stable production flows, practical copy-paste examples, and a few extra helper message types while staying close to the upstream API.
|
|
4
|
+
|
|
5
|
+
**Update channel (changelog and notices)**
|
|
6
|
+
- All updates, behavior changes, and breaking changes are posted here: https://whatsapp.com/channel/0029Vb8IWc3FSAsy4xaX991n
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
This repo is published as an NPM alias for `@whiskeysockets/baileys`.
|
|
12
|
+
|
|
13
|
+
# `package.json`
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
@whiskeysockets/baileys
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@whiskeysockets/baileys": "npm:shurainc/baileys"
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Custom pairing code
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
const code = await sock.requestPairingCode('628xxx', 'SHURAINC');
|
|
26
|
+
console.log('Your pairing code:', code);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Getting started
|
|
30
|
+
|
|
31
|
+
Below are practical `sock.sendMessage()` examples you can copy into your bot. this fork also includes a few extra helper message types (like `albumMessage`, `eventMessage`, `pollResultMessage`, and `groupStatusMessage`) to match shurainc production flows while keeping the upstream Baileys API familiar.
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Status group message V2
|
|
35
|
+
Send group status with version 2
|
|
36
|
+
|
|
37
|
+
```javascript
|
|
38
|
+
await sock.sendMessage(jid, {
|
|
39
|
+
groupStatusMessage: {
|
|
40
|
+
text: "shurainc baileys"
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Album message (multiple Images)
|
|
46
|
+
Send multiple images in a single album message:
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
await sock.sendMessage(jid, {
|
|
50
|
+
albumMessage: [
|
|
51
|
+
{ image: { url: "https://example.com/image1.jpg" }, caption: "image 1" },
|
|
52
|
+
{ image: { url: "https://example.com/image2.jpg" }, caption: "image 2" }
|
|
53
|
+
]
|
|
54
|
+
}, { quoted: m });
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Event message
|
|
58
|
+
Create and send WhatsApp event invitations:
|
|
59
|
+
|
|
60
|
+
```javascript
|
|
61
|
+
await sock.sendMessage(jid, {
|
|
62
|
+
eventMessage: {
|
|
63
|
+
isCanceled: false,
|
|
64
|
+
name: "hello",
|
|
65
|
+
description: "hello",
|
|
66
|
+
location: {
|
|
67
|
+
degreesLatitude: 0,
|
|
68
|
+
degreesLongitude: 0,
|
|
69
|
+
name: "shurainc baileys"
|
|
70
|
+
},
|
|
71
|
+
joinLink: "https://call.whatsapp.com/video/shurainc",
|
|
72
|
+
startTime: "1763019000",
|
|
73
|
+
endTime: "1763026200",
|
|
74
|
+
extraGuestsAllowed: false
|
|
75
|
+
}
|
|
76
|
+
}, { quoted: m });
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Poll result message
|
|
80
|
+
Display poll results with vote counts:
|
|
81
|
+
|
|
82
|
+
```javascript
|
|
83
|
+
await sock.sendMessage(jid, {
|
|
84
|
+
pollResultMessage: {
|
|
85
|
+
name: "Where are you from?",
|
|
86
|
+
pollVotes: [
|
|
87
|
+
{
|
|
88
|
+
optionName: "🇮🇩",
|
|
89
|
+
optionVoteCount: "25000"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
optionName: "🇷🇺",
|
|
93
|
+
optionVoteCount: "20000"
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
}, { quoted: m });
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Location message
|
|
101
|
+
Send a location message with an interactive quick reply button:
|
|
102
|
+
|
|
103
|
+
```javascript
|
|
104
|
+
await sock.sendMessage(jid, {
|
|
105
|
+
location: {
|
|
106
|
+
degreesLatitude: 0,
|
|
107
|
+
degreesLongitude: 0,
|
|
108
|
+
name: 'shurainc baileys',
|
|
109
|
+
},
|
|
110
|
+
caption: 'hello',
|
|
111
|
+
title: 'hello',
|
|
112
|
+
footer: 'shuraincbaileys',
|
|
113
|
+
interactiveButtons: [
|
|
114
|
+
{
|
|
115
|
+
name: 'quick_reply',
|
|
116
|
+
buttonParamsJson: JSON.stringify({
|
|
117
|
+
display_text: 'hello',
|
|
118
|
+
id: '.hello',
|
|
119
|
+
}),
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
hasMediaAttachment: false, // or true
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Buttons message
|
|
127
|
+
Send a basic buttons message (2 quick reply buttons):
|
|
128
|
+
|
|
129
|
+
```javascript
|
|
130
|
+
await sock.sendMessage(jid, {
|
|
131
|
+
text: 'hello',
|
|
132
|
+
footer: 'shuraincbaileys',
|
|
133
|
+
buttons: [
|
|
134
|
+
{ buttonId: '.btn1', buttonText: { displayText: 'button 1' } },
|
|
135
|
+
{ buttonId: '.btn2', buttonText: { displayText: 'button 2' } },
|
|
136
|
+
],
|
|
137
|
+
});
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Buttons message with media header
|
|
141
|
+
Send a buttons message with an image header:
|
|
142
|
+
|
|
143
|
+
```javascript
|
|
144
|
+
await sock.sendMessage(jid, {
|
|
145
|
+
image: { url: 'https://example.com/image.jpg' },
|
|
146
|
+
caption: 'hello',
|
|
147
|
+
footer: 'shuraincbaileys',
|
|
148
|
+
buttons: [
|
|
149
|
+
{ buttonId: '.btn1', buttonText: { displayText: 'button 1' } },
|
|
150
|
+
{ buttonId: '.btn2', buttonText: { displayText: 'button 2' } },
|
|
151
|
+
],
|
|
152
|
+
});
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### List message (sections)
|
|
156
|
+
Send a list message with sections and rows:
|
|
157
|
+
|
|
158
|
+
```javascript
|
|
159
|
+
await sock.sendMessage(jid, {
|
|
160
|
+
text: 'hello',
|
|
161
|
+
footer: 'shuraincbaileys',
|
|
162
|
+
buttonText: 'hello',
|
|
163
|
+
title: 'hello',
|
|
164
|
+
sections: [
|
|
165
|
+
{
|
|
166
|
+
title: 'shurainc baileys',
|
|
167
|
+
rows: [
|
|
168
|
+
{ title: 'hello', rowId: '.rowId1', description: 'shurainc baileys' },
|
|
169
|
+
{ title: 'hello', rowId: '.rowId2', description: 'shurainc baileys' },
|
|
170
|
+
],
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
});
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Simple interactive message
|
|
177
|
+
Send basic interactive messages with copy button functionality:
|
|
178
|
+
|
|
179
|
+
```javascript
|
|
180
|
+
await sock.sendMessage(jid, {
|
|
181
|
+
interactiveMessage: {
|
|
182
|
+
header: "hello",
|
|
183
|
+
title: "hello",
|
|
184
|
+
footer: "shuraincbaileys",
|
|
185
|
+
buttons: [
|
|
186
|
+
{
|
|
187
|
+
name: "cta_copy",
|
|
188
|
+
buttonParamsJson: JSON.stringify({
|
|
189
|
+
display_text: "copy code",
|
|
190
|
+
id: "123",
|
|
191
|
+
copy_code: "123"
|
|
192
|
+
})
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
}, { quoted: m });
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Interactive Message with Native Flow
|
|
200
|
+
Send interactive messages with buttons, copy actions, and native flow features:
|
|
201
|
+
|
|
202
|
+
```javascript
|
|
203
|
+
await sock.sendMessage(jid, {
|
|
204
|
+
interactiveMessage: {
|
|
205
|
+
header: "hello",
|
|
206
|
+
title: "hello",
|
|
207
|
+
footer: "shuraincbaileys",
|
|
208
|
+
image: { url: "https://example.com/image.jpg" },
|
|
209
|
+
nativeFlowMessage: {
|
|
210
|
+
messageParamsJson: JSON.stringify({
|
|
211
|
+
limited_time_offer: {
|
|
212
|
+
text: "hello",
|
|
213
|
+
url: "https://whatsapp.com/channel/0029Vb8IWc3FSAsy4xaX991n",
|
|
214
|
+
copy_code: "shuraincbaileys",
|
|
215
|
+
expiration_time: Date.now() * 999
|
|
216
|
+
},
|
|
217
|
+
bottom_sheet: {
|
|
218
|
+
in_thread_buttons_limit: 2,
|
|
219
|
+
divider_indices: [1, 2, 3, 4, 5, 999],
|
|
220
|
+
list_title: "hello",
|
|
221
|
+
button_title: "hello"
|
|
222
|
+
},
|
|
223
|
+
tap_target_configuration: {
|
|
224
|
+
title: "hello",
|
|
225
|
+
description: "shuraincbaileys",
|
|
226
|
+
canonical_url: "https://whatsapp.com/channel/0029Vb8IWc3FSAsy4xaX991n",
|
|
227
|
+
domain: "shop.example.com",
|
|
228
|
+
button_index: 0
|
|
229
|
+
}
|
|
230
|
+
}),
|
|
231
|
+
buttons: [
|
|
232
|
+
{
|
|
233
|
+
name: "single_select",
|
|
234
|
+
buttonParamsJson: JSON.stringify({
|
|
235
|
+
has_multiple_buttons: true
|
|
236
|
+
})
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: "call_permission_request",
|
|
240
|
+
buttonParamsJson: JSON.stringify({
|
|
241
|
+
has_multiple_buttons: true
|
|
242
|
+
})
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
name: "single_select",
|
|
246
|
+
buttonParamsJson: JSON.stringify({
|
|
247
|
+
title: "hello",
|
|
248
|
+
sections: [
|
|
249
|
+
{
|
|
250
|
+
title: "hello",
|
|
251
|
+
highlight_label: "shuraincbaileys",
|
|
252
|
+
rows: [
|
|
253
|
+
{
|
|
254
|
+
title: "shuraincbaileys",
|
|
255
|
+
description: "shurainc baileys",
|
|
256
|
+
id: "row_2"
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
],
|
|
261
|
+
has_multiple_buttons: true
|
|
262
|
+
})
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
name: "cta_copy",
|
|
266
|
+
buttonParamsJson: JSON.stringify({
|
|
267
|
+
display_text: "copy code",
|
|
268
|
+
id: "123",
|
|
269
|
+
copy_code: "123"
|
|
270
|
+
})
|
|
271
|
+
}
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}, { quoted: m });
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Interactive message with thumbnail
|
|
279
|
+
Send interactive messages with thumbnail image and copy button:
|
|
280
|
+
|
|
281
|
+
```javascript
|
|
282
|
+
await sock.sendMessage(jid, {
|
|
283
|
+
interactiveMessage: {
|
|
284
|
+
header: "hello",
|
|
285
|
+
title: "hello",
|
|
286
|
+
footer: "shuraincbaileys",
|
|
287
|
+
image: { url: "https://example.com/image.jpg" },
|
|
288
|
+
buttons: [
|
|
289
|
+
{
|
|
290
|
+
name: "cta_copy",
|
|
291
|
+
buttonParamsJson: JSON.stringify({
|
|
292
|
+
display_text: "copy code",
|
|
293
|
+
id: "123",
|
|
294
|
+
copy_code: "123"
|
|
295
|
+
})
|
|
296
|
+
}
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
}, { quoted: m });
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### Product message
|
|
303
|
+
Send product catalog messages with buttons and merchant information:
|
|
304
|
+
|
|
305
|
+
```javascript
|
|
306
|
+
await sock.sendMessage(jid, {
|
|
307
|
+
productMessage: {
|
|
308
|
+
title: "sample products",
|
|
309
|
+
description: "product description",
|
|
310
|
+
thumbnail: { url: "https://example.com/image.jpg" },
|
|
311
|
+
productId: "P12345",
|
|
312
|
+
retailerId: "R12345",
|
|
313
|
+
url: "https://example.com/product",
|
|
314
|
+
body: "product details",
|
|
315
|
+
footer: "special price",
|
|
316
|
+
priceAmount1000: 30000,
|
|
317
|
+
currencyCode: "USD",
|
|
318
|
+
buttons: [
|
|
319
|
+
{
|
|
320
|
+
name: "cta_url",
|
|
321
|
+
buttonParamsJson: JSON.stringify({
|
|
322
|
+
display_text: "buy now",
|
|
323
|
+
url: "https://example.com/buy"
|
|
324
|
+
})
|
|
325
|
+
}
|
|
326
|
+
]
|
|
327
|
+
}
|
|
328
|
+
}, { quoted: m });
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
## Groups (usage)
|
|
334
|
+
|
|
335
|
+
```js
|
|
336
|
+
// create group
|
|
337
|
+
const group = await sock.groupCreate('My Group', ['628xxx@s.whatsapp.net']);
|
|
338
|
+
|
|
339
|
+
// fetch metadata
|
|
340
|
+
const meta = await sock.groupMetadata(group.id);
|
|
341
|
+
|
|
342
|
+
// update subject/description
|
|
343
|
+
await sock.groupUpdateSubject(group.id, 'My Group v2');
|
|
344
|
+
await sock.groupUpdateDescription(group.id, 'group description');
|
|
345
|
+
|
|
346
|
+
// participants
|
|
347
|
+
await sock.groupParticipantsUpdate(group.id, ['628xxx@s.whatsapp.net'], 'add');
|
|
348
|
+
await sock.groupParticipantsUpdate(group.id, ['628xxx@s.whatsapp.net'], 'remove');
|
|
349
|
+
|
|
350
|
+
// join requests
|
|
351
|
+
const requests = await sock.groupRequestParticipantsList(group.id);
|
|
352
|
+
// approve/reject by jid from the list
|
|
353
|
+
// await sock.groupRequestParticipantsUpdate(group.id, [requests[0]?.jid], 'approve');
|
|
354
|
+
|
|
355
|
+
// invite links
|
|
356
|
+
const inviteCode = await sock.groupInviteCode(group.id);
|
|
357
|
+
const inviteInfo = await sock.groupGetInviteInfo(inviteCode);
|
|
358
|
+
await sock.groupRevokeInvite(group.id);
|
|
359
|
+
|
|
360
|
+
// settings
|
|
361
|
+
await sock.groupToggleEphemeral(group.id, 86400);
|
|
362
|
+
await sock.groupSettingUpdate(group.id, 'announcement');
|
|
363
|
+
await sock.groupMemberAddMode(group.id, 'all_member_add');
|
|
364
|
+
await sock.groupJoinApprovalMode(group.id, 'on');
|
|
365
|
+
|
|
366
|
+
// list & leave
|
|
367
|
+
const allGroups = await sock.groupFetchAllParticipating();
|
|
368
|
+
await sock.groupLeave(group.id);
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
## Newsletter (channel) usage
|
|
372
|
+
|
|
373
|
+
```js
|
|
374
|
+
// create newsletter
|
|
375
|
+
const created = await sock.newsletterCreate('shura updates', 'baileys updates');
|
|
376
|
+
|
|
377
|
+
// update metadata
|
|
378
|
+
await sock.newsletterUpdateName(channelJid, 'shura updates');
|
|
379
|
+
await sock.newsletterUpdateDescription(channelJid, 'baileys updates');
|
|
380
|
+
await sock.newsletterUpdatePicture(channelJid, fs.readFileSync('./image.png'));
|
|
381
|
+
await sock.newsletterRemovePicture(channelJid);
|
|
382
|
+
|
|
383
|
+
// metadata & subscribers
|
|
384
|
+
const metadata = await sock.newsletterMetadata('jid', channelJid);
|
|
385
|
+
const subs = await sock.newsletterSubscribers(channelJid);
|
|
386
|
+
|
|
387
|
+
// follow / mute
|
|
388
|
+
await sock.newsletterFollow(channelJid);
|
|
389
|
+
await sock.newsletterUnfollow(channelJid);
|
|
390
|
+
await sock.newsletterMute(channelJid);
|
|
391
|
+
await sock.newsletterUnmute(channelJid);
|
|
392
|
+
|
|
393
|
+
// react & fetch messages
|
|
394
|
+
await sock.newsletterReactMessage(channelJid, '300', '💙');
|
|
395
|
+
const messages = await sock.newsletterFetchMessages(channelJid, 20, 0, 0);
|
|
396
|
+
const live = await sock.subscribeNewsletterUpdates(channelJid);
|
|
397
|
+
|
|
398
|
+
// admin actions
|
|
399
|
+
const adminCount = await sock.newsletterAdminCount(channelJid);
|
|
400
|
+
await sock.newsletterChangeOwner(channelJid, '628xxx@s.whatsapp.net');
|
|
401
|
+
await sock.newsletterDemote(channelJid, '628xxx@s.whatsapp.net');
|
|
402
|
+
|
|
403
|
+
// delete
|
|
404
|
+
await sock.newsletterDelete(channelJid);
|
|
405
|
+
```
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
yarn pbjs -t static-module --no-beautify -w es6 --no-bundle --no-delimited --no-verify --no-comments -o ./index.js ./WAProto.proto;
|
|
2
|
+
yarn pbjs -t static-module --no-beautify -w es6 --no-bundle --no-delimited --no-verify ./WAProto.proto | yarn pbts --no-comments -o ./index.d.ts -;
|
|
3
|
+
node ./fix-imports.js
|