phantom-baileys 0.0.9 → 0.1.3
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 +592 -0
- package/WAProto/GenerateStatics.sh +3 -0
- package/WAProto/WAProto.proto +5479 -0
- package/WAProto/fix-imports.js +81 -0
- package/WAProto/index.d.ts +5147 -41513
- package/WAProto/index.js +84008 -142014
- package/lib/Defaults/index.d.ts +29 -8
- package/lib/Defaults/index.d.ts.map +1 -0
- package/lib/Defaults/index.js +80 -60
- 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/{WASignalGroup/sender_message_key.js → lib/Signal/Group/sender-message-key.js} +3 -16
- package/lib/Signal/Group/sender-message-key.js.map +1 -0
- package/lib/Signal/libsignal.d.ts +5 -3
- package/lib/Signal/libsignal.d.ts.map +1 -0
- package/lib/Signal/libsignal.js +331 -80
- package/lib/Signal/libsignal.js.map +1 -0
- package/lib/Signal/lid-mapping.d.ts +19 -0
- package/lib/Signal/lid-mapping.d.ts.map +1 -0
- package/lib/Signal/lid-mapping.js +271 -0
- package/lib/Signal/lid-mapping.js.map +1 -0
- package/lib/Socket/Client/index.d.ts +3 -3
- package/lib/Socket/Client/index.d.ts.map +1 -0
- package/lib/Socket/Client/index.js +3 -19
- package/lib/Socket/Client/index.js.map +1 -0
- package/lib/Socket/Client/{abstract-socket-client.d.ts → types.d.ts} +4 -5
- 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/{web-socket-client.d.ts → websocket.d.ts} +3 -2
- package/lib/Socket/Client/websocket.d.ts.map +1 -0
- package/lib/Socket/Client/websocket.js +54 -0
- package/lib/Socket/Client/websocket.js.map +1 -0
- package/lib/Socket/business.d.ts +184 -101
- package/lib/Socket/business.d.ts.map +1 -0
- package/lib/Socket/business.js +162 -43
- package/lib/Socket/business.js.map +1 -0
- package/lib/Socket/chats.d.ts +72 -42
- package/lib/Socket/chats.d.ts.map +1 -0
- package/lib/Socket/chats.js +340 -299
- package/lib/Socket/chats.js.map +1 -0
- package/lib/Socket/communities.d.ts +309 -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/dugong.d.ts +79 -0
- package/lib/Socket/dugong.d.ts.map +1 -0
- package/lib/Socket/dugong.js +527 -0
- package/lib/Socket/dugong.js.map +1 -0
- package/lib/Socket/groups.d.ts +93 -58
- package/lib/Socket/groups.d.ts.map +1 -0
- package/lib/Socket/groups.js +96 -84
- package/lib/Socket/groups.js.map +1 -0
- package/lib/Socket/index.d.ts +232 -107
- package/lib/Socket/index.d.ts.map +1 -0
- package/lib/Socket/index.js +13 -10
- package/lib/Socket/index.js.map +1 -0
- package/lib/Socket/messages-recv.d.ts +170 -90
- package/lib/Socket/messages-recv.d.ts.map +1 -0
- package/lib/Socket/messages-recv.js +798 -462
- package/lib/Socket/messages-recv.js.map +1 -0
- package/lib/Socket/messages-send.d.ts +180 -99
- package/lib/Socket/messages-send.d.ts.map +1 -0
- package/lib/Socket/messages-send.js +833 -709
- 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 +120 -75
- package/lib/Socket/newsletter.d.ts.map +1 -0
- package/lib/Socket/newsletter.js +227 -198
- package/lib/Socket/newsletter.js.map +1 -0
- package/lib/Socket/socket.d.ts +31 -20
- package/lib/Socket/socket.d.ts.map +1 -0
- package/lib/Socket/socket.js +508 -215
- package/lib/Socket/socket.js.map +1 -0
- package/lib/Types/Auth.d.ts +18 -11
- package/lib/Types/Auth.d.ts.map +1 -0
- package/lib/Types/Auth.js +2 -2
- 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 +2 -0
- package/lib/Types/Call.d.ts.map +1 -0
- package/lib/Types/Call.js +2 -2
- package/lib/Types/Call.js.map +1 -0
- package/lib/Types/Chat.d.ts +24 -8
- package/lib/Types/Chat.d.ts.map +1 -0
- package/lib/Types/Chat.js +8 -4
- package/lib/Types/Chat.js.map +1 -0
- package/lib/Types/Contact.d.ts +6 -1
- package/lib/Types/Contact.d.ts.map +1 -0
- package/lib/Types/Contact.js +2 -2
- package/lib/Types/Contact.js.map +1 -0
- package/lib/Types/Events.d.ts +82 -17
- package/lib/Types/Events.d.ts.map +1 -0
- package/lib/Types/Events.js +2 -2
- package/lib/Types/Events.js.map +1 -0
- package/lib/Types/GroupMetadata.d.ts +15 -3
- package/lib/Types/GroupMetadata.d.ts.map +1 -0
- package/lib/Types/GroupMetadata.js +2 -2
- package/lib/Types/GroupMetadata.js.map +1 -0
- package/lib/Types/Label.d.ts +1 -0
- package/lib/Types/Label.d.ts.map +1 -0
- package/lib/Types/Label.js +3 -5
- package/lib/Types/Label.js.map +1 -0
- package/lib/Types/LabelAssociation.d.ts +1 -0
- package/lib/Types/LabelAssociation.d.ts.map +1 -0
- package/lib/Types/LabelAssociation.js +3 -5
- package/lib/Types/LabelAssociation.js.map +1 -0
- package/lib/Types/Message.d.ts +77 -202
- package/lib/Types/Message.d.ts.map +1 -0
- package/lib/Types/Message.js +11 -9
- package/lib/Types/Message.js.map +1 -0
- package/lib/Types/Newsletter.d.ts +128 -85
- package/lib/Types/Newsletter.d.ts.map +1 -0
- package/lib/Types/Newsletter.js +25 -26
- package/lib/Types/Newsletter.js.map +1 -0
- package/lib/Types/Product.d.ts +2 -1
- package/lib/Types/Product.d.ts.map +1 -0
- package/lib/Types/Product.js +2 -2
- package/lib/Types/Product.js.map +1 -0
- package/lib/Types/Signal.d.ts +20 -1
- package/lib/Types/Signal.d.ts.map +1 -0
- package/lib/Types/Signal.js +2 -2
- package/lib/Types/Signal.js.map +1 -0
- package/lib/Types/Socket.d.ts +41 -24
- package/lib/Types/Socket.d.ts.map +1 -0
- package/lib/Types/Socket.js +3 -2
- package/lib/Types/Socket.js.map +1 -0
- package/lib/Types/State.d.ts +14 -2
- package/lib/Types/State.d.ts.map +1 -0
- package/lib/Types/State.js +13 -2
- package/lib/Types/State.js.map +1 -0
- package/lib/Types/USync.d.ts +3 -2
- package/lib/Types/USync.d.ts.map +1 -0
- package/lib/Types/USync.js +2 -2
- package/lib/Types/USync.js.map +1 -0
- package/lib/Types/index.d.ts +15 -16
- package/lib/Types/index.d.ts.map +1 -0
- package/lib/Types/index.js +15 -31
- package/lib/Types/index.js.map +1 -0
- package/lib/Utils/auth-utils.d.ts +7 -6
- package/lib/Utils/auth-utils.d.ts.map +1 -0
- package/lib/Utils/auth-utils.js +228 -165
- 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 +4 -3
- package/lib/Utils/business.d.ts.map +1 -0
- package/lib/Utils/business.js +66 -69
- package/lib/Utils/business.js.map +1 -0
- package/lib/Utils/chat-utils.d.ts +16 -16
- package/lib/Utils/chat-utils.d.ts.map +1 -0
- package/lib/Utils/chat-utils.js +299 -232
- package/lib/Utils/chat-utils.js.map +1 -0
- package/lib/Utils/crypto.d.ts +18 -21
- package/lib/Utils/crypto.d.ts.map +1 -0
- package/lib/Utils/crypto.js +44 -125
- package/lib/Utils/crypto.js.map +1 -0
- package/lib/Utils/decode-wa-message.d.ts +20 -8
- package/lib/Utils/decode-wa-message.d.ts.map +1 -0
- package/lib/Utils/decode-wa-message.js +139 -90
- package/lib/Utils/decode-wa-message.js.map +1 -0
- package/lib/Utils/event-buffer.d.ts +7 -8
- package/lib/Utils/event-buffer.d.ts.map +1 -0
- package/lib/Utils/event-buffer.js +129 -72
- package/lib/Utils/event-buffer.js.map +1 -0
- package/lib/Utils/generics.d.ts +25 -22
- package/lib/Utils/generics.d.ts.map +1 -0
- package/lib/Utils/generics.js +157 -175
- package/lib/Utils/generics.js.map +1 -0
- package/lib/Utils/history.d.ts +14 -11
- package/lib/Utils/history.d.ts.map +1 -0
- package/lib/Utils/history.js +83 -46
- package/lib/Utils/history.js.map +1 -0
- package/lib/Utils/identity-change-handler.d.ts +37 -0
- package/lib/Utils/identity-change-handler.d.ts.map +1 -0
- package/lib/Utils/identity-change-handler.js +49 -0
- package/lib/Utils/identity-change-handler.js.map +1 -0
- package/lib/Utils/index.d.ts +22 -17
- package/lib/Utils/index.d.ts.map +1 -0
- package/lib/Utils/index.js +22 -33
- package/lib/Utils/index.js.map +1 -0
- package/lib/Utils/link-preview.d.ts +5 -5
- package/lib/Utils/link-preview.d.ts.map +1 -0
- package/lib/Utils/link-preview.js +14 -22
- package/lib/Utils/link-preview.js.map +1 -0
- package/lib/Utils/logger.d.ts +12 -1
- package/lib/Utils/logger.d.ts.map +1 -0
- package/lib/Utils/logger.js +3 -7
- package/lib/Utils/logger.js.map +1 -0
- package/lib/Utils/lt-hash.d.ts +8 -12
- package/lib/Utils/lt-hash.d.ts.map +1 -0
- package/lib/Utils/lt-hash.js +3 -46
- package/lib/Utils/lt-hash.js.map +1 -0
- package/lib/Utils/make-mutex.d.ts +2 -0
- package/lib/Utils/make-mutex.d.ts.map +1 -0
- package/lib/Utils/make-mutex.js +24 -34
- package/lib/Utils/make-mutex.js.map +1 -0
- package/lib/Utils/message-retry-manager.d.ts +110 -0
- package/lib/Utils/message-retry-manager.d.ts.map +1 -0
- package/lib/Utils/message-retry-manager.js +225 -0
- package/lib/Utils/message-retry-manager.js.map +1 -0
- package/lib/Utils/messages-media.d.ts +59 -42
- package/lib/Utils/messages-media.d.ts.map +1 -0
- package/lib/Utils/messages-media.js +411 -356
- package/lib/Utils/messages-media.js.map +1 -0
- package/lib/Utils/messages.d.ts +32 -18
- package/lib/Utils/messages.d.ts.map +1 -0
- package/lib/Utils/messages.js +412 -723
- package/lib/Utils/messages.js.map +1 -0
- package/lib/Utils/noise-handler.d.ts +13 -13
- package/lib/Utils/noise-handler.d.ts.map +1 -0
- package/lib/Utils/noise-handler.js +149 -108
- package/lib/Utils/noise-handler.js.map +1 -0
- package/lib/Utils/offline-node-processor.d.ts +17 -0
- package/lib/Utils/offline-node-processor.d.ts.map +1 -0
- package/lib/Utils/offline-node-processor.js +40 -0
- package/lib/Utils/offline-node-processor.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 +30 -11
- package/lib/Utils/process-message.d.ts.map +1 -0
- package/lib/Utils/process-message.js +321 -166
- package/lib/Utils/process-message.js.map +1 -0
- package/lib/Utils/reporting-utils.d.ts +11 -0
- package/lib/Utils/reporting-utils.d.ts.map +1 -0
- package/lib/Utils/reporting-utils.js +258 -0
- package/lib/Utils/reporting-utils.js.map +1 -0
- package/lib/Utils/rich-messages.d.ts +129 -0
- package/lib/Utils/rich-messages.d.ts.map +1 -0
- package/lib/Utils/rich-messages.js +455 -0
- package/lib/Utils/rich-messages.js.map +1 -0
- package/lib/Utils/signal.d.ts +7 -6
- package/lib/Utils/signal.d.ts.map +1 -0
- package/lib/Utils/signal.js +65 -65
- package/lib/Utils/signal.js.map +1 -0
- package/lib/Utils/stanza-ack.d.ts +11 -0
- package/lib/Utils/stanza-ack.d.ts.map +1 -0
- package/lib/Utils/stanza-ack.js +38 -0
- package/lib/Utils/stanza-ack.js.map +1 -0
- package/lib/Utils/sync-action-utils.d.ts +19 -0
- package/lib/Utils/sync-action-utils.d.ts.map +1 -0
- package/lib/Utils/sync-action-utils.js +48 -0
- package/lib/Utils/sync-action-utils.js.map +1 -0
- package/lib/Utils/tc-token-utils.d.ts +12 -0
- package/lib/Utils/tc-token-utils.d.ts.map +1 -0
- package/lib/Utils/tc-token-utils.js +18 -0
- package/lib/Utils/tc-token-utils.js.map +1 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +2 -1
- package/lib/Utils/use-multi-file-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-multi-file-auth-state.js +79 -253
- package/lib/Utils/use-multi-file-auth-state.js.map +1 -0
- package/lib/Utils/validate-connection.d.ts +6 -6
- package/lib/Utils/validate-connection.d.ts.map +1 -0
- package/lib/Utils/validate-connection.js +111 -116
- package/lib/Utils/validate-connection.js.map +1 -0
- package/lib/WABinary/constants.d.ts +5 -4
- package/lib/WABinary/constants.d.ts.map +1 -0
- package/lib/WABinary/constants.js +1281 -20
- package/lib/WABinary/constants.js.map +1 -0
- package/lib/WABinary/decode.d.ts +4 -3
- package/lib/WABinary/decode.d.ts.map +1 -0
- package/lib/WABinary/decode.js +51 -53
- package/lib/WABinary/decode.js.map +1 -0
- package/lib/WABinary/encode.d.ts +2 -1
- package/lib/WABinary/encode.d.ts.map +1 -0
- package/lib/WABinary/encode.js +12 -44
- package/lib/WABinary/encode.js.map +1 -0
- package/lib/WABinary/generic-utils.d.ts +9 -6
- package/lib/WABinary/generic-utils.d.ts.map +1 -0
- package/lib/WABinary/generic-utils.js +124 -43
- package/lib/WABinary/generic-utils.js.map +1 -0
- package/lib/WABinary/index.d.ts +6 -5
- package/lib/WABinary/index.d.ts.map +1 -0
- package/lib/WABinary/index.js +6 -21
- package/lib/WABinary/index.js.map +1 -0
- package/lib/WABinary/jid-utils.d.ts +24 -7
- package/lib/WABinary/jid-utils.d.ts.map +1 -0
- package/lib/WABinary/jid-utils.js +74 -40
- package/lib/WABinary/jid-utils.js.map +1 -0
- package/lib/WABinary/types.d.ts +2 -1
- package/lib/WABinary/types.d.ts.map +1 -0
- package/lib/WABinary/types.js +2 -2
- package/lib/WABinary/types.js.map +1 -0
- package/lib/WAM/BinaryInfo.d.ts +2 -1
- package/lib/WAM/BinaryInfo.d.ts.map +1 -0
- package/lib/WAM/BinaryInfo.js +2 -5
- package/lib/WAM/BinaryInfo.js.map +1 -0
- package/lib/WAM/constants.d.ts +5 -3
- package/lib/WAM/constants.d.ts.map +1 -0
- package/lib/WAM/constants.js +19071 -11568
- package/lib/WAM/constants.js.map +1 -0
- package/lib/WAM/encode.d.ts +3 -2
- package/lib/WAM/encode.d.ts.map +1 -0
- package/lib/WAM/encode.js +17 -22
- package/lib/WAM/encode.js.map +1 -0
- package/lib/WAM/index.d.ts +4 -3
- package/lib/WAM/index.d.ts.map +1 -0
- package/lib/WAM/index.js +4 -19
- package/lib/WAM/index.js.map +1 -0
- package/lib/WAProto/fix-imports.d.ts +1 -0
- package/lib/WAProto/fix-imports.js +71 -0
- package/lib/WAProto/index.js +89345 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +4 -3
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +8 -11
- package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +3 -2
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +11 -14
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +3 -2
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +9 -12
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +3 -2
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +9 -13
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +4 -3
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +20 -22
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +5 -3
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +13 -8
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/index.d.ts +5 -4
- package/lib/WAUSync/Protocols/index.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/index.js +5 -20
- package/lib/WAUSync/Protocols/index.js.map +1 -0
- package/lib/WAUSync/USyncQuery.d.ts +5 -4
- package/lib/WAUSync/USyncQuery.d.ts.map +1 -0
- package/lib/WAUSync/USyncQuery.js +40 -35
- package/lib/WAUSync/USyncQuery.js.map +1 -0
- package/lib/WAUSync/USyncUser.d.ts +7 -4
- package/lib/WAUSync/USyncUser.d.ts.map +1 -0
- package/lib/WAUSync/USyncUser.js +2 -5
- package/lib/WAUSync/USyncUser.js.map +1 -0
- package/lib/WAUSync/index.d.ts +4 -3
- package/lib/WAUSync/index.d.ts.map +1 -0
- package/lib/WAUSync/index.js +4 -19
- package/lib/WAUSync/index.js.map +1 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +16 -31
- package/lib/index.js.map +1 -0
- package/package.json +35 -75
- package/Readme.md +0 -1
- 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/Socket/Client/abstract-socket-client.js +0 -13
- package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
- package/lib/Socket/Client/mobile-socket-client.js +0 -65
- package/lib/Socket/Client/web-socket-client.js +0 -62
- package/lib/Socket/registration.d.ts +0 -264
- package/lib/Socket/registration.js +0 -166
- package/lib/Socket/usync.d.ts +0 -37
- package/lib/Socket/usync.js +0 -70
- package/lib/Store/index.d.ts +0 -3
- package/lib/Store/index.js +0 -10
- package/lib/Store/make-cache-manager-store.d.ts +0 -14
- package/lib/Store/make-cache-manager-store.js +0 -83
- package/lib/Store/make-in-memory-store.d.ts +0 -118
- package/lib/Store/make-in-memory-store.js +0 -431
- package/lib/Store/make-ordered-dictionary.d.ts +0 -13
- package/lib/Store/make-ordered-dictionary.js +0 -81
- package/lib/Store/object-repository.d.ts +0 -10
- package/lib/Store/object-repository.js +0 -27
- package/lib/Utils/baileys-event-stream.d.ts +0 -16
- package/lib/Utils/baileys-event-stream.js +0 -63
- package/lib/Utils/use-single-file-auth-state.d.ts +0 -12
- package/lib/Utils/use-single-file-auth-state.js +0 -75
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
const SenderChainKey = require('./sender_chain_key');
|
|
2
|
-
const SenderMessageKey = require('./sender_message_key');
|
|
3
|
-
|
|
4
|
-
const protobufs = require('./protobufs');
|
|
5
|
-
|
|
6
|
-
class SenderKeyState {
|
|
7
|
-
MAX_MESSAGE_KEYS = 2000;
|
|
8
|
-
|
|
9
|
-
constructor(
|
|
10
|
-
id = null,
|
|
11
|
-
iteration = null,
|
|
12
|
-
chainKey = null,
|
|
13
|
-
signatureKeyPair = null,
|
|
14
|
-
signatureKeyPublic = null,
|
|
15
|
-
signatureKeyPrivate = null,
|
|
16
|
-
senderKeyStateStructure = null
|
|
17
|
-
) {
|
|
18
|
-
if (senderKeyStateStructure) {
|
|
19
|
-
this.senderKeyStateStructure = senderKeyStateStructure;
|
|
20
|
-
} else {
|
|
21
|
-
if (signatureKeyPair) {
|
|
22
|
-
signatureKeyPublic = signatureKeyPair.public;
|
|
23
|
-
signatureKeyPrivate = signatureKeyPair.private;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
chainKey = typeof chainKey === 'string' ? Buffer.from(chainKey, 'base64') : chainKey;
|
|
27
|
-
this.senderKeyStateStructure = protobufs.SenderKeyStateStructure.create();
|
|
28
|
-
const senderChainKeyStructure = protobufs.SenderChainKey.create();
|
|
29
|
-
senderChainKeyStructure.iteration = iteration;
|
|
30
|
-
senderChainKeyStructure.seed = chainKey;
|
|
31
|
-
this.senderKeyStateStructure.senderChainKey = senderChainKeyStructure;
|
|
32
|
-
|
|
33
|
-
const signingKeyStructure = protobufs.SenderSigningKey.create();
|
|
34
|
-
signingKeyStructure.public =
|
|
35
|
-
typeof signatureKeyPublic === 'string' ?
|
|
36
|
-
Buffer.from(signatureKeyPublic, 'base64') :
|
|
37
|
-
signatureKeyPublic;
|
|
38
|
-
if (signatureKeyPrivate) {
|
|
39
|
-
signingKeyStructure.private =
|
|
40
|
-
typeof signatureKeyPrivate === 'string' ?
|
|
41
|
-
Buffer.from(signatureKeyPrivate, 'base64') :
|
|
42
|
-
signatureKeyPrivate;
|
|
43
|
-
}
|
|
44
|
-
this.senderKeyStateStructure.senderKeyId = id;
|
|
45
|
-
this.senderChainKey = senderChainKeyStructure;
|
|
46
|
-
this.senderKeyStateStructure.senderSigningKey = signingKeyStructure;
|
|
47
|
-
}
|
|
48
|
-
this.senderKeyStateStructure.senderMessageKeys =
|
|
49
|
-
this.senderKeyStateStructure.senderMessageKeys || [];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
SenderKeyState(senderKeyStateStructure) {
|
|
53
|
-
this.senderKeyStateStructure = senderKeyStateStructure;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
getKeyId() {
|
|
57
|
-
return this.senderKeyStateStructure.senderKeyId;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
getSenderChainKey() {
|
|
61
|
-
return new SenderChainKey(
|
|
62
|
-
this.senderKeyStateStructure.senderChainKey.iteration,
|
|
63
|
-
this.senderKeyStateStructure.senderChainKey.seed
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
setSenderChainKey(chainKey) {
|
|
68
|
-
const senderChainKeyStructure = protobufs.SenderChainKey.create({
|
|
69
|
-
iteration: chainKey.getIteration(),
|
|
70
|
-
seed: chainKey.getSeed(),
|
|
71
|
-
});
|
|
72
|
-
this.senderKeyStateStructure.senderChainKey = senderChainKeyStructure;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
getSigningKeyPublic() {
|
|
76
|
-
return typeof this.senderKeyStateStructure.senderSigningKey.public === 'string' ?
|
|
77
|
-
Buffer.from(this.senderKeyStateStructure.senderSigningKey.public, 'base64') :
|
|
78
|
-
this.senderKeyStateStructure.senderSigningKey.public;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
getSigningKeyPrivate() {
|
|
82
|
-
return typeof this.senderKeyStateStructure.senderSigningKey.private === 'string' ?
|
|
83
|
-
Buffer.from(this.senderKeyStateStructure.senderSigningKey.private, 'base64') :
|
|
84
|
-
this.senderKeyStateStructure.senderSigningKey.private;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
hasSenderMessageKey(iteration) {
|
|
88
|
-
const list = this.senderKeyStateStructure.senderMessageKeys;
|
|
89
|
-
for (let o = 0; o < list.length; o++) {
|
|
90
|
-
const senderMessageKey = list[o];
|
|
91
|
-
if (senderMessageKey.iteration === iteration) return true;
|
|
92
|
-
}
|
|
93
|
-
return false;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
addSenderMessageKey(senderMessageKey) {
|
|
97
|
-
const senderMessageKeyStructure = protobufs.SenderKeyStateStructure.create({
|
|
98
|
-
iteration: senderMessageKey.getIteration(),
|
|
99
|
-
seed: senderMessageKey.getSeed(),
|
|
100
|
-
});
|
|
101
|
-
this.senderKeyStateStructure.senderMessageKeys.push(senderMessageKeyStructure);
|
|
102
|
-
|
|
103
|
-
if (this.senderKeyStateStructure.senderMessageKeys.length > this.MAX_MESSAGE_KEYS) {
|
|
104
|
-
this.senderKeyStateStructure.senderMessageKeys.shift();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
removeSenderMessageKey(iteration) {
|
|
109
|
-
let result = null;
|
|
110
|
-
|
|
111
|
-
this.senderKeyStateStructure.senderMessageKeys = this.senderKeyStateStructure.senderMessageKeys.filter(
|
|
112
|
-
senderMessageKey => {
|
|
113
|
-
if (senderMessageKey.iteration === iteration) result = senderMessageKey;
|
|
114
|
-
return senderMessageKey.iteration !== iteration;
|
|
115
|
-
}
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
if (result != null) {
|
|
119
|
-
return new SenderMessageKey(result.iteration, result.seed);
|
|
120
|
-
}
|
|
121
|
-
return null;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
getStructure() {
|
|
125
|
-
return this.senderKeyStateStructure;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
module.exports = SenderKeyState;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AbstractSocketClient = void 0;
|
|
4
|
-
const events_1 = require("events");
|
|
5
|
-
class AbstractSocketClient extends events_1.EventEmitter {
|
|
6
|
-
constructor(url, config) {
|
|
7
|
-
super();
|
|
8
|
-
this.url = url;
|
|
9
|
-
this.config = config;
|
|
10
|
-
this.setMaxListeners(0);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.AbstractSocketClient = AbstractSocketClient;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Socket } from 'net';
|
|
3
|
-
import { AbstractSocketClient } from './abstract-socket-client';
|
|
4
|
-
export declare class MobileSocketClient extends AbstractSocketClient {
|
|
5
|
-
protected socket: Socket | null;
|
|
6
|
-
get isOpen(): boolean;
|
|
7
|
-
get isClosed(): boolean;
|
|
8
|
-
get isClosing(): boolean;
|
|
9
|
-
get isConnecting(): boolean;
|
|
10
|
-
connect(): Promise<void>;
|
|
11
|
-
close(): Promise<void>;
|
|
12
|
-
send(str: string | Uint8Array, cb?: (err?: Error) => void): boolean;
|
|
13
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MobileSocketClient = void 0;
|
|
4
|
-
const net_1 = require("net");
|
|
5
|
-
const abstract_socket_client_1 = require("./abstract-socket-client");
|
|
6
|
-
class MobileSocketClient extends abstract_socket_client_1.AbstractSocketClient {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this.socket = null;
|
|
10
|
-
}
|
|
11
|
-
get isOpen() {
|
|
12
|
-
var _a;
|
|
13
|
-
return ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.readyState) === 'open';
|
|
14
|
-
}
|
|
15
|
-
get isClosed() {
|
|
16
|
-
var _a;
|
|
17
|
-
return this.socket === null || ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.readyState) === 'closed';
|
|
18
|
-
}
|
|
19
|
-
get isClosing() {
|
|
20
|
-
var _a;
|
|
21
|
-
return this.socket === null || ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.readyState) === 'closed';
|
|
22
|
-
}
|
|
23
|
-
get isConnecting() {
|
|
24
|
-
var _a;
|
|
25
|
-
return ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.readyState) === 'opening';
|
|
26
|
-
}
|
|
27
|
-
async connect() {
|
|
28
|
-
var _a;
|
|
29
|
-
if (this.socket) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (this.config.agent) {
|
|
33
|
-
throw new Error('There are not support for proxy agent for mobile connection');
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
this.socket = (0, net_1.connect)({
|
|
37
|
-
host: this.url.hostname,
|
|
38
|
-
port: Number(this.url.port) || 443
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
this.socket.setMaxListeners(0);
|
|
42
|
-
const events = ['close', 'connect', 'data', 'drain', 'end', 'error', 'lookup', 'ready', 'timeout'];
|
|
43
|
-
for (const event of events) {
|
|
44
|
-
(_a = this.socket) === null || _a === void 0 ? void 0 : _a.on(event, (...args) => this.emit(event, ...args));
|
|
45
|
-
}
|
|
46
|
-
this.socket.on('data', (...args) => this.emit('message', ...args));
|
|
47
|
-
this.socket.on('ready', (...args) => this.emit('open', ...args));
|
|
48
|
-
}
|
|
49
|
-
async close() {
|
|
50
|
-
if (!this.socket) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
return new Promise(resolve => {
|
|
54
|
-
this.socket.end(resolve);
|
|
55
|
-
this.socket = null;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
send(str, cb) {
|
|
59
|
-
if (this.socket === null) {
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
return this.socket.write(str, undefined, cb);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.MobileSocketClient = MobileSocketClient;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.WebSocketClient = void 0;
|
|
7
|
-
const ws_1 = __importDefault(require("ws"));
|
|
8
|
-
const Defaults_1 = require("../../Defaults");
|
|
9
|
-
const abstract_socket_client_1 = require("./abstract-socket-client");
|
|
10
|
-
class WebSocketClient extends abstract_socket_client_1.AbstractSocketClient {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.socket = null;
|
|
14
|
-
}
|
|
15
|
-
get isOpen() {
|
|
16
|
-
var _a;
|
|
17
|
-
return ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.readyState) === ws_1.default.OPEN;
|
|
18
|
-
}
|
|
19
|
-
get isClosed() {
|
|
20
|
-
var _a;
|
|
21
|
-
return this.socket === null || ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.readyState) === ws_1.default.CLOSED;
|
|
22
|
-
}
|
|
23
|
-
get isClosing() {
|
|
24
|
-
var _a;
|
|
25
|
-
return this.socket === null || ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.readyState) === ws_1.default.CLOSING;
|
|
26
|
-
}
|
|
27
|
-
get isConnecting() {
|
|
28
|
-
var _a;
|
|
29
|
-
return ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.readyState) === ws_1.default.CONNECTING;
|
|
30
|
-
}
|
|
31
|
-
async connect() {
|
|
32
|
-
var _a, _b;
|
|
33
|
-
if (this.socket) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
this.socket = new ws_1.default(this.url, {
|
|
37
|
-
origin: Defaults_1.DEFAULT_ORIGIN,
|
|
38
|
-
headers: (_a = this.config.options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
39
|
-
handshakeTimeout: this.config.connectTimeoutMs,
|
|
40
|
-
timeout: this.config.connectTimeoutMs,
|
|
41
|
-
agent: this.config.agent,
|
|
42
|
-
});
|
|
43
|
-
this.socket.setMaxListeners(0);
|
|
44
|
-
const events = ['close', 'error', 'upgrade', 'message', 'open', 'ping', 'pong', 'unexpected-response'];
|
|
45
|
-
for (const event of events) {
|
|
46
|
-
(_b = this.socket) === null || _b === void 0 ? void 0 : _b.on(event, (...args) => this.emit(event, ...args));
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
async close() {
|
|
50
|
-
if (!this.socket) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
this.socket.close();
|
|
54
|
-
this.socket = null;
|
|
55
|
-
}
|
|
56
|
-
send(str, cb) {
|
|
57
|
-
var _a;
|
|
58
|
-
(_a = this.socket) === null || _a === void 0 ? void 0 : _a.send(str, cb);
|
|
59
|
-
return Boolean(this.socket);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
exports.WebSocketClient = WebSocketClient;
|
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
import axios, { AxiosRequestConfig } from 'axios';
|
|
2
|
-
import { KeyPair, SignedKeyPair, SocketConfig } from '../Types';
|
|
3
|
-
export declare const makeRegistrationSocket: (config: SocketConfig) => {
|
|
4
|
-
register: (code: string) => Promise<ExistsResponse>;
|
|
5
|
-
requestRegistrationCode: (registrationOptions?: RegistrationOptions) => Promise<ExistsResponse>;
|
|
6
|
-
logger: Logger;
|
|
7
|
-
getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
|
|
8
|
-
getCatalog: ({ jid, limit, cursor }: import("../Types").GetCatalogOptions) => Promise<{
|
|
9
|
-
products: import("../Types").Product[];
|
|
10
|
-
nextPageCursor: any;
|
|
11
|
-
}>;
|
|
12
|
-
getCollections: (jid?: string, limit?: number) => Promise<{
|
|
13
|
-
collections: import("../Types").CatalogCollection[];
|
|
14
|
-
}>;
|
|
15
|
-
productCreate: (create: import("../Types").ProductCreate) => Promise<import("../Types").Product>;
|
|
16
|
-
productDelete: (productIds: string[]) => Promise<{
|
|
17
|
-
deleted: number;
|
|
18
|
-
}>;
|
|
19
|
-
productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>;
|
|
20
|
-
sendMessageAck: ({ tag, attrs, content }: import("../WABinary").BinaryNode, errorCode?: number) => Promise<void>;
|
|
21
|
-
sendRetryRequest: (node: import("../WABinary").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
|
22
|
-
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
|
23
|
-
id: any;
|
|
24
|
-
to: string;
|
|
25
|
-
}>;
|
|
26
|
-
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
|
27
|
-
fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number) => Promise<string>;
|
|
28
|
-
requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
|
|
29
|
-
getPrivacyTokens: (jids: string[]) => Promise<import("../WABinary").BinaryNode>;
|
|
30
|
-
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
|
31
|
-
relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
|
|
32
|
-
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
33
|
-
sendReceipts: (keys: import("../Types").WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
|
|
34
|
-
getButtonArgs: (message: import("../Types").WAProto.IMessage) => import("../WABinary").BinaryNode["attrs"];
|
|
35
|
-
readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
|
|
36
|
-
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
|
37
|
-
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
|
|
38
|
-
sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
39
|
-
createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: import("../WABinary").BinaryNode["attrs"]) => Promise<{
|
|
40
|
-
nodes: import("../WABinary").BinaryNode[];
|
|
41
|
-
shouldIncludeDeviceIdentity: boolean;
|
|
42
|
-
}>;
|
|
43
|
-
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
44
|
-
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
45
|
-
[_: string]: string;
|
|
46
|
-
}>;
|
|
47
|
-
updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
|
|
48
|
-
sendStatusMentions: (content: import("../Types").AnyMessageContent, jids?: string[]) => Promise<import("../Types").WAProto.WebMessageInfo>;
|
|
49
|
-
sendAlbumMessage: (jid: string, medias: import("../Types").Media[], options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
|
|
50
|
-
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
|
|
51
|
-
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
52
|
-
duration: string;
|
|
53
|
-
}>;
|
|
54
|
-
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
|
|
55
|
-
newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
56
|
-
newsletterUpdateName: (jid: string, name: string) => Promise<void>;
|
|
57
|
-
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
58
|
-
newsletterRemovePicture: (jid: string) => Promise<void>;
|
|
59
|
-
newsletterUnfollow: (jid: string) => Promise<void>;
|
|
60
|
-
newsletterFollow: (jid: string) => Promise<void>;
|
|
61
|
-
newsletterUnmute: (jid: string) => Promise<void>;
|
|
62
|
-
newsletterMute: (jid: string) => Promise<void>;
|
|
63
|
-
newsletterAction: (jid: string, type: "follow" | "unfollow" | "mute" | "unmute") => Promise<void>;
|
|
64
|
-
newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
|
|
65
|
-
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
|
|
66
|
-
newsletterAdminCount: (jid: string) => Promise<number>;
|
|
67
|
-
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
|
68
|
-
newsletterDemote: (jid: string, user: string) => Promise<void>;
|
|
69
|
-
newsletterDelete: (jid: string) => Promise<void>;
|
|
70
|
-
newsletterReactMessage: (jid: string, serverId: string, code?: string) => Promise<void>;
|
|
71
|
-
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
72
|
-
newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
73
|
-
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
74
|
-
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
|
|
75
|
-
groupLeave: (id: string) => Promise<void>;
|
|
76
|
-
groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
|
|
77
|
-
groupRequestParticipantsList: (jid: string) => Promise<{
|
|
78
|
-
[key: string]: string;
|
|
79
|
-
}[]>;
|
|
80
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
|
|
81
|
-
status: string;
|
|
82
|
-
jid: string;
|
|
83
|
-
}[]>;
|
|
84
|
-
groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
|
|
85
|
-
status: string;
|
|
86
|
-
jid: string;
|
|
87
|
-
content: import("../WABinary").BinaryNode;
|
|
88
|
-
}[]>;
|
|
89
|
-
groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
90
|
-
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
91
|
-
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
92
|
-
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
93
|
-
groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
|
|
94
|
-
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
|
|
95
|
-
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
96
|
-
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
97
|
-
groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
|
|
98
|
-
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
|
99
|
-
groupFetchAllParticipating: () => Promise<{
|
|
100
|
-
[_: string]: import("../Types").GroupMetadata;
|
|
101
|
-
}>;
|
|
102
|
-
processingMutex: {
|
|
103
|
-
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
104
|
-
};
|
|
105
|
-
upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
|
|
106
|
-
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
|
|
107
|
-
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
|
|
108
|
-
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
|
|
109
|
-
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
|
110
|
-
onWhatsApp: (...jids: string[]) => Promise<{
|
|
111
|
-
exists: boolean;
|
|
112
|
-
jid: string;
|
|
113
|
-
}[]>;
|
|
114
|
-
fetchBlocklist: () => Promise<string[]>;
|
|
115
|
-
fetchStatus: (jid: string) => Promise<{
|
|
116
|
-
status: string | undefined;
|
|
117
|
-
setAt: Date;
|
|
118
|
-
} | undefined>;
|
|
119
|
-
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
120
|
-
removeProfilePicture: (jid: string) => Promise<void>;
|
|
121
|
-
updateProfileStatus: (status: string) => Promise<void>;
|
|
122
|
-
updateProfileName: (name: string) => Promise<void>;
|
|
123
|
-
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
124
|
-
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
125
|
-
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
|
|
126
|
-
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
127
|
-
updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
128
|
-
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
|
|
129
|
-
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
|
|
130
|
-
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
131
|
-
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
|
|
132
|
-
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
133
|
-
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
|
|
134
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
|
135
|
-
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
136
|
-
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
137
|
-
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
138
|
-
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
139
|
-
star: (jid: string, messages: {
|
|
140
|
-
id: string;
|
|
141
|
-
fromMe?: boolean;
|
|
142
|
-
}[], star: boolean) => Promise<void>;
|
|
143
|
-
type: "md";
|
|
144
|
-
ws: any;
|
|
145
|
-
ev: import("../Types").BaileysEventEmitter & {
|
|
146
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
|
|
147
|
-
buffer(): void;
|
|
148
|
-
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
|
|
149
|
-
flush(force?: boolean): boolean;
|
|
150
|
-
isBuffering(): boolean;
|
|
151
|
-
};
|
|
152
|
-
authState: {
|
|
153
|
-
creds: import("../Types").AuthenticationCreds;
|
|
154
|
-
keys: import("../Types").SignalKeyStoreWithTransaction;
|
|
155
|
-
};
|
|
156
|
-
signalRepository: import("../Types").SignalRepository;
|
|
157
|
-
user: import("../Types").Contact | undefined;
|
|
158
|
-
generateMessageTag: () => string;
|
|
159
|
-
query: (node: import("../WABinary").BinaryNode, timeoutMs?: number) => Promise<import("../WABinary").BinaryNode>;
|
|
160
|
-
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
|
|
161
|
-
waitForSocketOpen: () => Promise<void>;
|
|
162
|
-
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
163
|
-
sendNode: (frame: import("../WABinary").BinaryNode) => Promise<void>;
|
|
164
|
-
logout: (msg?: string) => Promise<void>;
|
|
165
|
-
end: (error: Error | undefined) => void;
|
|
166
|
-
onUnexpectedError: (err: Error | axios, msg: string) => void;
|
|
167
|
-
uploadPreKeys: (count?: number) => Promise<void>;
|
|
168
|
-
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
169
|
-
requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
|
|
170
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
|
|
171
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("../WABinary").BinaryNode>;
|
|
172
|
-
};
|
|
173
|
-
export interface RegistrationData {
|
|
174
|
-
registrationId: number;
|
|
175
|
-
signedPreKey: SignedKeyPair;
|
|
176
|
-
noiseKey: KeyPair;
|
|
177
|
-
signedIdentityKey: KeyPair;
|
|
178
|
-
identityId: Buffer;
|
|
179
|
-
phoneId: string;
|
|
180
|
-
deviceId: string;
|
|
181
|
-
backupToken: Buffer;
|
|
182
|
-
}
|
|
183
|
-
export interface RegistrationOptions {
|
|
184
|
-
/** your phone number */
|
|
185
|
-
phoneNumber?: string;
|
|
186
|
-
/** the country code of your phone number */
|
|
187
|
-
phoneNumberCountryCode: string;
|
|
188
|
-
/** your phone number without country code */
|
|
189
|
-
phoneNumberNationalNumber: string;
|
|
190
|
-
/** the country code of your mobile network
|
|
191
|
-
* @see {@link https://de.wikipedia.org/wiki/Mobile_Country_Code}
|
|
192
|
-
*/
|
|
193
|
-
phoneNumberMobileCountryCode: string;
|
|
194
|
-
/** the network code of your mobile network
|
|
195
|
-
* @see {@link https://de.wikipedia.org/wiki/Mobile_Network_Code}
|
|
196
|
-
*/
|
|
197
|
-
phoneNumberMobileNetworkCode: string;
|
|
198
|
-
/**
|
|
199
|
-
* How to send the one time code
|
|
200
|
-
*/
|
|
201
|
-
method?: 'sms' | 'voice' | 'captcha';
|
|
202
|
-
/**
|
|
203
|
-
* The captcha code if it was requested
|
|
204
|
-
*/
|
|
205
|
-
captcha?: string;
|
|
206
|
-
}
|
|
207
|
-
export type RegistrationParams = RegistrationData & RegistrationOptions;
|
|
208
|
-
export declare function registrationParams(params: RegistrationParams): {
|
|
209
|
-
cc: string;
|
|
210
|
-
in: string;
|
|
211
|
-
Rc: string;
|
|
212
|
-
lg: string;
|
|
213
|
-
lc: string;
|
|
214
|
-
mistyped: string;
|
|
215
|
-
authkey: any;
|
|
216
|
-
e_regid: any;
|
|
217
|
-
e_keytype: string;
|
|
218
|
-
e_ident: any;
|
|
219
|
-
e_skey_id: string;
|
|
220
|
-
e_skey_val: any;
|
|
221
|
-
e_skey_sig: any;
|
|
222
|
-
fdid: string;
|
|
223
|
-
network_ratio_type: string;
|
|
224
|
-
expid: string;
|
|
225
|
-
simnum: string;
|
|
226
|
-
hasinrc: string;
|
|
227
|
-
pid: string;
|
|
228
|
-
id: string;
|
|
229
|
-
backup_token: string;
|
|
230
|
-
token: any;
|
|
231
|
-
fraud_checkpoint_code: string | undefined;
|
|
232
|
-
};
|
|
233
|
-
/**
|
|
234
|
-
* Requests a registration code for the given phone number.
|
|
235
|
-
*/
|
|
236
|
-
export declare function mobileRegisterCode(params: RegistrationParams, fetchOptions?: AxiosRequestConfig): Promise<ExistsResponse>;
|
|
237
|
-
export declare function mobileRegisterExists(params: RegistrationParams, fetchOptions?: AxiosRequestConfig): Promise<ExistsResponse>;
|
|
238
|
-
/**
|
|
239
|
-
* Registers the phone number on whatsapp with the received OTP code.
|
|
240
|
-
*/
|
|
241
|
-
export declare function mobileRegister(params: RegistrationParams & {
|
|
242
|
-
code: string;
|
|
243
|
-
}, fetchOptions?: AxiosRequestConfig): Promise<ExistsResponse>;
|
|
244
|
-
/**
|
|
245
|
-
* Encrypts the given string as AEAD aes-256-gcm with the public whatsapp key and a random keypair.
|
|
246
|
-
*/
|
|
247
|
-
export declare function mobileRegisterEncrypt(data: string): any;
|
|
248
|
-
export declare function mobileRegisterFetch(path: string, opts?: AxiosRequestConfig): Promise<ExistsResponse>;
|
|
249
|
-
export interface ExistsResponse {
|
|
250
|
-
status: 'fail' | 'sent';
|
|
251
|
-
voice_length?: number;
|
|
252
|
-
voice_wait?: number;
|
|
253
|
-
sms_length?: number;
|
|
254
|
-
sms_wait?: number;
|
|
255
|
-
reason?: 'incorrect' | 'missing_param' | 'code_checkpoint';
|
|
256
|
-
login?: string;
|
|
257
|
-
flash_type?: number;
|
|
258
|
-
ab_hash?: string;
|
|
259
|
-
ab_key?: string;
|
|
260
|
-
exp_cfg?: string;
|
|
261
|
-
lid?: string;
|
|
262
|
-
image_blob?: string;
|
|
263
|
-
audio_blob?: string;
|
|
264
|
-
}
|