@neelegirl/baileys 1.5.6 → 1.5.7
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 +21 -27
- package/WAProto/WAProto.proto +665 -291
- package/WAProto/index.d.ts +48037 -2294
- package/WAProto/index.js +139804 -45203
- package/lib/Defaults/baileys-version.json +3 -0
- package/lib/Defaults/index.d.ts +64 -58
- package/lib/Defaults/index.js +96 -74
- package/lib/Defaults/phonenumber-mcc.json +223 -0
- package/lib/Signal/WASignalGroup/GroupProtocol.js +1909 -0
- package/lib/Signal/WASignalGroup/ciphertext_message.js +16 -0
- package/lib/Signal/WASignalGroup/generate-proto.sh +1 -0
- package/lib/Signal/WASignalGroup/group.proto +42 -0
- package/lib/Signal/WASignalGroup/group_cipher.js +120 -0
- package/lib/Signal/WASignalGroup/group_session_builder.js +46 -0
- package/lib/Signal/WASignalGroup/index.js +6 -0
- package/lib/Signal/WASignalGroup/keyhelper.js +21 -0
- package/lib/Signal/WASignalGroup/protobufs.js +3 -0
- package/lib/Signal/WASignalGroup/queue_job.js +69 -0
- package/lib/Signal/WASignalGroup/readme.md +6 -0
- package/lib/Signal/WASignalGroup/sender_chain_key.js +50 -0
- package/lib/Signal/WASignalGroup/sender_key_distribution_message.js +78 -0
- package/lib/Signal/WASignalGroup/sender_key_message.js +92 -0
- package/lib/Signal/WASignalGroup/sender_key_name.js +70 -0
- package/lib/Signal/WASignalGroup/sender_key_record.js +56 -0
- package/lib/Signal/WASignalGroup/sender_key_state.js +129 -0
- package/lib/Signal/{Group/sender-message-key.js → WASignalGroup/sender_message_key.js} +16 -3
- package/lib/Signal/libsignal.d.ts +4 -5
- package/lib/Signal/libsignal.js +112 -292
- package/lib/Socket/Client/abstract-socket-client.d.ts +15 -0
- package/lib/Socket/Client/abstract-socket-client.js +13 -0
- package/lib/Socket/Client/index.d.ts +2 -3
- package/lib/Socket/Client/index.js +22 -3
- package/lib/Socket/Client/mobile-socket-client.d.ts +12 -0
- package/lib/Socket/Client/mobile-socket-client.js +65 -0
- package/lib/Socket/Client/types.d.ts +15 -15
- package/lib/Socket/Client/types.js +15 -8
- package/lib/Socket/Client/websocket.d.ts +12 -12
- package/lib/Socket/Client/websocket.js +36 -24
- package/lib/Socket/business.d.ts +177 -178
- package/lib/Socket/business.js +71 -179
- package/lib/Socket/chats.d.ts +93 -93
- package/lib/Socket/chats.js +625 -474
- package/lib/Socket/communities.d.ts +62 -83
- package/lib/Socket/communities.js +414 -412
- package/lib/Socket/groups.d.ts +112 -118
- package/lib/Socket/groups.js +171 -146
- package/lib/Socket/index.d.ts +182 -222
- package/lib/Socket/index.js +17 -12
- package/lib/Socket/messages-recv.d.ts +169 -165
- package/lib/Socket/messages-recv.js +1721 -1185
- package/lib/Socket/messages-send.d.ts +160 -161
- package/lib/Socket/messages-send.js +992 -642
- package/lib/Socket/mex.d.ts +0 -1
- package/lib/Socket/mex.js +9 -4
- package/lib/Socket/newsletter.d.ts +139 -139
- package/lib/Socket/newsletter.js +258 -153
- package/lib/Socket/registration.d.ts +266 -0
- package/lib/Socket/registration.js +166 -0
- package/lib/Socket/socket.d.ts +36 -42
- package/lib/Socket/socket.js +525 -623
- package/lib/Socket/usync.d.ts +37 -0
- package/lib/Socket/usync.js +83 -0
- package/lib/Store/index.d.ts +4 -0
- package/lib/Store/index.js +24 -0
- package/lib/Store/make-cache-manager-store.d.ts +14 -0
- package/lib/Store/make-cache-manager-store.js +90 -0
- package/lib/Store/make-in-memory-store.d.ts +123 -0
- package/lib/Store/make-in-memory-store.js +429 -0
- package/lib/Store/make-ordered-dictionary.d.ts +12 -0
- package/lib/Store/make-ordered-dictionary.js +86 -0
- package/lib/Store/object-repository.d.ts +10 -0
- package/lib/Store/object-repository.js +31 -0
- package/lib/Types/Auth.d.ts +96 -87
- package/lib/Types/Auth.js +3 -2
- package/lib/Types/Call.d.ts +13 -13
- package/lib/Types/Call.js +3 -2
- package/lib/Types/Chat.d.ts +94 -79
- package/lib/Types/Chat.js +9 -8
- package/lib/Types/Contact.d.ts +9 -13
- package/lib/Types/Contact.js +3 -2
- package/lib/Types/Events.d.ts +179 -152
- package/lib/Types/Events.js +3 -2
- package/lib/Types/GroupMetadata.d.ts +48 -49
- package/lib/Types/GroupMetadata.js +3 -2
- package/lib/Types/Label.d.ts +14 -13
- package/lib/Types/Label.js +30 -24
- package/lib/Types/LabelAssociation.d.ts +20 -15
- package/lib/Types/LabelAssociation.js +12 -6
- package/lib/Types/Message.d.ts +404 -234
- package/lib/Types/Message.js +13 -11
- package/lib/Types/MexUpdates.d.ts +9 -0
- package/lib/Types/MexUpdates.js +18 -0
- package/lib/Types/Newsletter.d.ts +104 -130
- package/lib/Types/Newsletter.js +40 -31
- package/lib/Types/Product.d.ts +71 -58
- package/lib/Types/Product.js +3 -2
- package/lib/Types/Signal.d.ts +55 -63
- package/lib/Types/Signal.js +3 -2
- package/lib/Types/Socket.d.ts +66 -77
- package/lib/Types/Socket.js +3 -3
- package/lib/Types/State.d.ts +19 -17
- package/lib/Types/State.js +14 -13
- package/lib/Types/USync.d.ts +8 -8
- package/lib/Types/USync.js +3 -2
- package/lib/Types/index.d.ts +61 -47
- package/lib/Types/index.js +48 -26
- package/lib/Utils/auth-utils.d.ts +10 -8
- package/lib/Utils/auth-utils.js +154 -206
- package/lib/Utils/baileys-event-stream.d.ts +7 -6
- package/lib/Utils/baileys-event-stream.js +43 -29
- package/lib/Utils/business.d.ts +20 -14
- package/lib/Utils/business.js +134 -110
- package/lib/Utils/chat-utils.d.ts +69 -57
- package/lib/Utils/chat-utils.js +380 -362
- package/lib/Utils/check-npm-version.d.ts +15 -0
- package/lib/Utils/check-npm-version.js +52 -0
- package/lib/Utils/crypto.d.ts +45 -30
- package/lib/Utils/crypto.js +178 -141
- package/lib/Utils/decode-wa-message.d.ts +35 -42
- package/lib/Utils/decode-wa-message.js +150 -176
- package/lib/Utils/event-buffer.d.ts +17 -12
- package/lib/Utils/event-buffer.js +286 -269
- package/lib/Utils/generics.d.ts +99 -60
- package/lib/Utils/generics.js +481 -244
- package/lib/Utils/history.d.ts +22 -18
- package/lib/Utils/history.js +80 -54
- package/lib/Utils/index.d.ts +19 -20
- package/lib/Utils/index.js +41 -19
- package/lib/Utils/link-preview.d.ts +14 -12
- package/lib/Utils/link-preview.js +75 -40
- package/lib/Utils/logger.d.ts +11 -10
- package/lib/Utils/logger.js +7 -3
- package/lib/Utils/lt-hash.d.ts +13 -12
- package/lib/Utils/lt-hash.js +37 -27
- package/lib/Utils/make-mutex.d.ts +7 -6
- package/lib/Utils/make-mutex.js +29 -20
- package/lib/Utils/message-retry-manager.d.ts +6 -6
- package/lib/Utils/message-retry-manager.js +36 -8
- package/lib/Utils/messages-media.d.ts +102 -87
- package/lib/Utils/messages-media.js +570 -427
- package/lib/Utils/messages.d.ts +64 -37
- package/lib/Utils/messages.js +1270 -511
- package/lib/Utils/noise-handler.d.ts +18 -18
- package/lib/Utils/noise-handler.js +109 -101
- package/lib/Utils/process-message.d.ts +32 -25
- package/lib/Utils/process-message.js +281 -266
- package/lib/Utils/signal.d.ts +32 -24
- package/lib/Utils/signal.js +105 -98
- package/lib/Utils/use-mongo-file-auth-state.d.ts +6 -0
- package/lib/Utils/use-mongo-file-auth-state.js +84 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +10 -5
- package/lib/Utils/use-multi-file-auth-state.js +186 -69
- package/lib/Utils/use-single-file-auth-state.d.ts +13 -0
- package/lib/Utils/use-single-file-auth-state.js +80 -0
- package/lib/Utils/validate-connection.d.ts +13 -11
- package/lib/Utils/validate-connection.js +116 -124
- package/lib/WABinary/constants.d.ts +27 -25
- package/lib/WABinary/constants.js +1292 -1277
- package/lib/WABinary/decode.d.ts +9 -7
- package/lib/WABinary/decode.js +189 -139
- package/lib/WABinary/encode.d.ts +3 -3
- package/lib/WABinary/encode.js +154 -105
- package/lib/WABinary/generic-utils.d.ts +27 -14
- package/lib/WABinary/generic-utils.js +102 -62
- package/lib/WABinary/index.d.ts +5 -6
- package/lib/WABinary/index.js +25 -6
- package/lib/WABinary/jid-utils.d.ts +46 -41
- package/lib/WABinary/jid-utils.js +80 -84
- package/lib/WABinary/types.d.ts +13 -10
- package/lib/WABinary/types.js +3 -2
- package/lib/WAM/BinaryInfo.d.ts +15 -8
- package/lib/WAM/BinaryInfo.js +14 -7
- package/lib/WAM/constants.d.ts +37 -30
- package/lib/WAM/constants.js +11983 -19465
- package/lib/WAM/encode.d.ts +3 -3
- package/lib/WAM/encode.js +110 -95
- package/lib/WAM/index.d.ts +3 -4
- package/lib/WAM/index.js +23 -4
- package/lib/WAUSync/Protocols/USyncBotProfileProtocol.d.ts +28 -0
- package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +69 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -9
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +19 -12
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -19
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +26 -18
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -11
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +20 -12
- package/lib/WAUSync/Protocols/USyncLIDProtocol.d.ts +9 -0
- package/lib/WAUSync/Protocols/USyncLIDProtocol.js +30 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -11
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +24 -16
- package/lib/WAUSync/Protocols/index.d.ts +6 -5
- package/lib/WAUSync/Protocols/index.js +26 -5
- package/lib/WAUSync/USyncQuery.d.ts +28 -26
- package/lib/WAUSync/USyncQuery.js +62 -64
- package/lib/WAUSync/USyncUser.d.ts +10 -11
- package/lib/WAUSync/USyncUser.js +19 -12
- package/lib/WAUSync/index.d.ts +3 -4
- package/lib/WAUSync/index.js +23 -4
- package/lib/index.d.ts +11 -10
- package/lib/index.js +33 -11
- package/package.json +43 -48
- package/WAProto/GenerateStatics.sh +0 -3
- package/WAProto/fix-imports.js +0 -29
- package/engine-requirements.js +0 -10
- package/lib/Defaults/index.d.ts.map +0 -1
- package/lib/Defaults/index.js.map +0 -1
- package/lib/Signal/Group/ciphertext-message.d.ts +0 -10
- package/lib/Signal/Group/ciphertext-message.d.ts.map +0 -1
- package/lib/Signal/Group/ciphertext-message.js +0 -12
- package/lib/Signal/Group/ciphertext-message.js.map +0 -1
- package/lib/Signal/Group/group-session-builder.d.ts +0 -15
- package/lib/Signal/Group/group-session-builder.d.ts.map +0 -1
- package/lib/Signal/Group/group-session-builder.js +0 -30
- package/lib/Signal/Group/group-session-builder.js.map +0 -1
- package/lib/Signal/Group/group_cipher.d.ts +0 -17
- package/lib/Signal/Group/group_cipher.d.ts.map +0 -1
- package/lib/Signal/Group/group_cipher.js +0 -82
- package/lib/Signal/Group/group_cipher.js.map +0 -1
- package/lib/Signal/Group/index.d.ts +0 -12
- package/lib/Signal/Group/index.d.ts.map +0 -1
- package/lib/Signal/Group/index.js +0 -12
- package/lib/Signal/Group/index.js.map +0 -1
- package/lib/Signal/Group/keyhelper.d.ts +0 -11
- package/lib/Signal/Group/keyhelper.d.ts.map +0 -1
- package/lib/Signal/Group/keyhelper.js +0 -18
- package/lib/Signal/Group/keyhelper.js.map +0 -1
- package/lib/Signal/Group/sender-chain-key.d.ts +0 -14
- package/lib/Signal/Group/sender-chain-key.d.ts.map +0 -1
- package/lib/Signal/Group/sender-chain-key.js +0 -26
- package/lib/Signal/Group/sender-chain-key.js.map +0 -1
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -17
- package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +0 -1
- package/lib/Signal/Group/sender-key-distribution-message.js +0 -63
- package/lib/Signal/Group/sender-key-distribution-message.js.map +0 -1
- package/lib/Signal/Group/sender-key-message.d.ts +0 -19
- package/lib/Signal/Group/sender-key-message.d.ts.map +0 -1
- package/lib/Signal/Group/sender-key-message.js +0 -66
- package/lib/Signal/Group/sender-key-message.js.map +0 -1
- package/lib/Signal/Group/sender-key-name.d.ts +0 -18
- package/lib/Signal/Group/sender-key-name.d.ts.map +0 -1
- package/lib/Signal/Group/sender-key-name.js +0 -48
- package/lib/Signal/Group/sender-key-name.js.map +0 -1
- package/lib/Signal/Group/sender-key-record.d.ts +0 -31
- package/lib/Signal/Group/sender-key-record.d.ts.map +0 -1
- package/lib/Signal/Group/sender-key-record.js +0 -41
- package/lib/Signal/Group/sender-key-record.js.map +0 -1
- package/lib/Signal/Group/sender-key-state.d.ts +0 -39
- package/lib/Signal/Group/sender-key-state.d.ts.map +0 -1
- package/lib/Signal/Group/sender-key-state.js +0 -84
- package/lib/Signal/Group/sender-key-state.js.map +0 -1
- package/lib/Signal/Group/sender-message-key.d.ts +0 -12
- package/lib/Signal/Group/sender-message-key.d.ts.map +0 -1
- package/lib/Signal/Group/sender-message-key.js.map +0 -1
- package/lib/Signal/libsignal.d.ts.map +0 -1
- package/lib/Signal/libsignal.js.map +0 -1
- package/lib/Signal/lid-mapping.d.ts +0 -23
- package/lib/Signal/lid-mapping.d.ts.map +0 -1
- package/lib/Signal/lid-mapping.js +0 -171
- package/lib/Signal/lid-mapping.js.map +0 -1
- package/lib/Socket/Client/index.d.ts.map +0 -1
- package/lib/Socket/Client/index.js.map +0 -1
- package/lib/Socket/Client/types.d.ts.map +0 -1
- package/lib/Socket/Client/types.js.map +0 -1
- package/lib/Socket/Client/websocket.d.ts.map +0 -1
- package/lib/Socket/Client/websocket.js.map +0 -1
- package/lib/Socket/business.d.ts.map +0 -1
- package/lib/Socket/business.js.map +0 -1
- package/lib/Socket/chats.d.ts.map +0 -1
- package/lib/Socket/chats.js.map +0 -1
- package/lib/Socket/communities.d.ts.map +0 -1
- package/lib/Socket/communities.js.map +0 -1
- package/lib/Socket/groups.d.ts.map +0 -1
- package/lib/Socket/groups.js.map +0 -1
- package/lib/Socket/index.d.ts.map +0 -1
- package/lib/Socket/index.js.map +0 -1
- package/lib/Socket/messages-recv.d.ts.map +0 -1
- package/lib/Socket/messages-recv.js.map +0 -1
- package/lib/Socket/messages-send.d.ts.map +0 -1
- package/lib/Socket/messages-send.js.map +0 -1
- package/lib/Socket/mex.d.ts.map +0 -1
- package/lib/Socket/mex.js.map +0 -1
- package/lib/Socket/newsletter.d.ts.map +0 -1
- package/lib/Socket/newsletter.js.map +0 -1
- package/lib/Socket/socket.d.ts.map +0 -1
- package/lib/Socket/socket.js.map +0 -1
- package/lib/Types/Auth.d.ts.map +0 -1
- package/lib/Types/Auth.js.map +0 -1
- package/lib/Types/Bussines.d.ts +0 -25
- package/lib/Types/Bussines.d.ts.map +0 -1
- package/lib/Types/Bussines.js +0 -2
- package/lib/Types/Bussines.js.map +0 -1
- package/lib/Types/Call.d.ts.map +0 -1
- package/lib/Types/Call.js.map +0 -1
- package/lib/Types/Chat.d.ts.map +0 -1
- package/lib/Types/Chat.js.map +0 -1
- package/lib/Types/Contact.d.ts.map +0 -1
- package/lib/Types/Contact.js.map +0 -1
- package/lib/Types/Events.d.ts.map +0 -1
- package/lib/Types/Events.js.map +0 -1
- package/lib/Types/GroupMetadata.d.ts.map +0 -1
- package/lib/Types/GroupMetadata.js.map +0 -1
- package/lib/Types/Label.d.ts.map +0 -1
- package/lib/Types/Label.js.map +0 -1
- package/lib/Types/LabelAssociation.d.ts.map +0 -1
- package/lib/Types/LabelAssociation.js.map +0 -1
- package/lib/Types/Message.d.ts.map +0 -1
- package/lib/Types/Message.js.map +0 -1
- package/lib/Types/Newsletter.d.ts.map +0 -1
- package/lib/Types/Newsletter.js.map +0 -1
- package/lib/Types/Product.d.ts.map +0 -1
- package/lib/Types/Product.js.map +0 -1
- package/lib/Types/Signal.d.ts.map +0 -1
- package/lib/Types/Signal.js.map +0 -1
- package/lib/Types/Socket.d.ts.map +0 -1
- package/lib/Types/Socket.js.map +0 -1
- package/lib/Types/State.d.ts.map +0 -1
- package/lib/Types/State.js.map +0 -1
- package/lib/Types/USync.d.ts.map +0 -1
- package/lib/Types/USync.js.map +0 -1
- package/lib/Types/index.d.ts.map +0 -1
- package/lib/Types/index.js.map +0 -1
- package/lib/Utils/auth-utils.d.ts.map +0 -1
- package/lib/Utils/auth-utils.js.map +0 -1
- package/lib/Utils/baileys-event-stream.d.ts.map +0 -1
- package/lib/Utils/baileys-event-stream.js.map +0 -1
- package/lib/Utils/browser-utils.d.ts +0 -4
- package/lib/Utils/browser-utils.d.ts.map +0 -1
- package/lib/Utils/browser-utils.js +0 -28
- package/lib/Utils/browser-utils.js.map +0 -1
- package/lib/Utils/business.d.ts.map +0 -1
- package/lib/Utils/business.js.map +0 -1
- package/lib/Utils/chat-utils.d.ts.map +0 -1
- package/lib/Utils/chat-utils.js.map +0 -1
- package/lib/Utils/crypto.d.ts.map +0 -1
- package/lib/Utils/crypto.js.map +0 -1
- package/lib/Utils/decode-wa-message.d.ts.map +0 -1
- package/lib/Utils/decode-wa-message.js.map +0 -1
- package/lib/Utils/event-buffer.d.ts.map +0 -1
- package/lib/Utils/event-buffer.js.map +0 -1
- package/lib/Utils/generics.d.ts.map +0 -1
- package/lib/Utils/generics.js.map +0 -1
- package/lib/Utils/history.d.ts.map +0 -1
- package/lib/Utils/history.js.map +0 -1
- package/lib/Utils/index.d.ts.map +0 -1
- package/lib/Utils/index.js.map +0 -1
- package/lib/Utils/link-preview.d.ts.map +0 -1
- package/lib/Utils/link-preview.js.map +0 -1
- package/lib/Utils/logger.d.ts.map +0 -1
- package/lib/Utils/logger.js.map +0 -1
- package/lib/Utils/lt-hash.d.ts.map +0 -1
- package/lib/Utils/lt-hash.js.map +0 -1
- package/lib/Utils/make-mutex.d.ts.map +0 -1
- package/lib/Utils/make-mutex.js.map +0 -1
- package/lib/Utils/message-retry-manager.d.ts.map +0 -1
- package/lib/Utils/message-retry-manager.js.map +0 -1
- package/lib/Utils/messages-media.d.ts.map +0 -1
- package/lib/Utils/messages-media.js.map +0 -1
- package/lib/Utils/messages.d.ts.map +0 -1
- package/lib/Utils/messages.js.map +0 -1
- package/lib/Utils/noise-handler.d.ts.map +0 -1
- package/lib/Utils/noise-handler.js.map +0 -1
- package/lib/Utils/pre-key-manager.d.ts +0 -28
- package/lib/Utils/pre-key-manager.d.ts.map +0 -1
- package/lib/Utils/pre-key-manager.js +0 -106
- package/lib/Utils/pre-key-manager.js.map +0 -1
- package/lib/Utils/process-message.d.ts.map +0 -1
- package/lib/Utils/process-message.js.map +0 -1
- package/lib/Utils/signal.d.ts.map +0 -1
- package/lib/Utils/signal.js.map +0 -1
- package/lib/Utils/use-multi-file-auth-state.d.ts.map +0 -1
- package/lib/Utils/use-multi-file-auth-state.js.map +0 -1
- package/lib/Utils/validate-connection.d.ts.map +0 -1
- package/lib/Utils/validate-connection.js.map +0 -1
- package/lib/WABinary/constants.d.ts.map +0 -1
- package/lib/WABinary/constants.js.map +0 -1
- package/lib/WABinary/decode.d.ts.map +0 -1
- package/lib/WABinary/decode.js.map +0 -1
- package/lib/WABinary/encode.d.ts.map +0 -1
- package/lib/WABinary/encode.js.map +0 -1
- package/lib/WABinary/generic-utils.d.ts.map +0 -1
- package/lib/WABinary/generic-utils.js.map +0 -1
- package/lib/WABinary/index.d.ts.map +0 -1
- package/lib/WABinary/index.js.map +0 -1
- package/lib/WABinary/jid-utils.d.ts.map +0 -1
- package/lib/WABinary/jid-utils.js.map +0 -1
- package/lib/WABinary/types.d.ts.map +0 -1
- package/lib/WABinary/types.js.map +0 -1
- package/lib/WAM/BinaryInfo.d.ts.map +0 -1
- package/lib/WAM/BinaryInfo.js.map +0 -1
- package/lib/WAM/constants.d.ts.map +0 -1
- package/lib/WAM/constants.js.map +0 -1
- package/lib/WAM/encode.d.ts.map +0 -1
- package/lib/WAM/encode.js.map +0 -1
- package/lib/WAM/index.d.ts.map +0 -1
- package/lib/WAM/index.js.map +0 -1
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +0 -1
- package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +0 -1
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +0 -1
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +0 -1
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +0 -1
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +0 -1
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +0 -1
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +0 -1
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -26
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +0 -1
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +0 -51
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +0 -1
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -10
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +0 -1
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +0 -29
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +0 -1
- package/lib/WAUSync/Protocols/index.d.ts.map +0 -1
- package/lib/WAUSync/Protocols/index.js.map +0 -1
- package/lib/WAUSync/USyncQuery.d.ts.map +0 -1
- package/lib/WAUSync/USyncQuery.js.map +0 -1
- package/lib/WAUSync/USyncUser.d.ts.map +0 -1
- package/lib/WAUSync/USyncUser.js.map +0 -1
- package/lib/WAUSync/index.d.ts.map +0 -1
- package/lib/WAUSync/index.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
package/lib/Utils/lt-hash.js
CHANGED
|
@@ -1,48 +1,58 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict"
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true })
|
|
4
|
+
|
|
5
|
+
const crypto_1 = require("./crypto")
|
|
6
|
+
|
|
2
7
|
/**
|
|
3
8
|
* LT Hash is a summation based hash algorithm that maintains the integrity of a piece of data
|
|
4
9
|
* over a series of mutations. You can add/remove mutations and it'll return a hash equal to
|
|
5
10
|
* if the same series of mutations was made sequentially.
|
|
6
11
|
*/
|
|
7
|
-
const o = 128
|
|
8
|
-
class
|
|
12
|
+
const o = 128
|
|
13
|
+
class d {
|
|
9
14
|
constructor(e) {
|
|
10
|
-
this.salt = e
|
|
15
|
+
this.salt = e
|
|
11
16
|
}
|
|
12
|
-
|
|
17
|
+
add(e, t) {
|
|
18
|
+
var r = this
|
|
13
19
|
for (const item of t) {
|
|
14
|
-
e =
|
|
20
|
+
e = r._addSingle(e, item)
|
|
15
21
|
}
|
|
16
|
-
return e
|
|
22
|
+
return e
|
|
17
23
|
}
|
|
18
|
-
|
|
24
|
+
subtract(e, t) {
|
|
25
|
+
var r = this
|
|
19
26
|
for (const item of t) {
|
|
20
|
-
e =
|
|
27
|
+
e = r._subtractSingle(e, item)
|
|
21
28
|
}
|
|
22
|
-
return e
|
|
29
|
+
return e
|
|
23
30
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return
|
|
31
|
+
subtractThenAdd(e, t, r) {
|
|
32
|
+
var n = this
|
|
33
|
+
return n.add(n.subtract(e, r), t)
|
|
27
34
|
}
|
|
28
35
|
async _addSingle(e, t) {
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
var r = this
|
|
37
|
+
const n = new Uint8Array(await crypto_1.hkdf(Buffer.from(t), o, { info: r.salt })).buffer
|
|
38
|
+
return r.performPointwiseWithOverflow(await e, n, ((e, t) => e + t))
|
|
31
39
|
}
|
|
32
40
|
async _subtractSingle(e, t) {
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
var r = this
|
|
42
|
+
const n = new Uint8Array(await crypto_1.hkdf(Buffer.from(t), o, { info: r.salt })).buffer
|
|
43
|
+
return r.performPointwiseWithOverflow(await e, n, ((e, t) => e - t))
|
|
35
44
|
}
|
|
36
|
-
performPointwiseWithOverflow(e, t,
|
|
37
|
-
const n = new DataView(e)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const s = new DataView(out);
|
|
41
|
-
for (let offset = 0; offset < n.byteLength; offset += 2) {
|
|
42
|
-
s.setUint16(offset, op(n.getUint16(offset, true), i.getUint16(offset, true)), true);
|
|
45
|
+
performPointwiseWithOverflow(e, t, r) {
|
|
46
|
+
const n = new DataView(e), i = new DataView(t), a = new ArrayBuffer(n.byteLength), s = new DataView(a)
|
|
47
|
+
for (let e = 0; e < n.byteLength; e += 2) {
|
|
48
|
+
s.setUint16(e, r(n.getUint16(e, !0), i.getUint16(e, !0)), !0)
|
|
43
49
|
}
|
|
44
|
-
return
|
|
50
|
+
return a
|
|
45
51
|
}
|
|
46
52
|
}
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
|
|
54
|
+
const LT_HASH_ANTI_TAMPERING = new d('WhatsApp Patch Integrity')
|
|
55
|
+
|
|
56
|
+
module.exports = {
|
|
57
|
+
LT_HASH_ANTI_TAMPERING
|
|
58
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export declare const makeMutex: () => {
|
|
2
|
-
mutex<T>(code: () =>
|
|
3
|
-
}
|
|
4
|
-
|
|
2
|
+
mutex<T>(code: () => T | Promise<T>): Promise<T>
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export type Mutex = ReturnType<typeof makeMutex>
|
|
6
|
+
|
|
5
7
|
export declare const makeKeyedMutex: () => {
|
|
6
|
-
mutex<T>(key: string, task: () =>
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=make-mutex.d.ts.map
|
|
8
|
+
mutex<T>(key: string, task: () => T | Promise<T>): Promise<T>
|
|
9
|
+
}
|
package/lib/Utils/make-mutex.js
CHANGED
|
@@ -1,40 +1,49 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict"
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true })
|
|
4
|
+
|
|
5
|
+
const makeMutex = () => {
|
|
2
6
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3
|
-
let task = Promise.resolve()
|
|
4
|
-
let taskTimeout
|
|
7
|
+
let task = Promise.resolve()
|
|
8
|
+
let taskTimeout
|
|
5
9
|
return {
|
|
6
10
|
mutex(code) {
|
|
7
11
|
task = (async () => {
|
|
8
12
|
// wait for the previous task to complete
|
|
9
13
|
// if there is an error, we swallow so as to not block the queue
|
|
10
14
|
try {
|
|
11
|
-
await task
|
|
15
|
+
await task
|
|
12
16
|
}
|
|
13
|
-
catch { }
|
|
17
|
+
catch (_a) { }
|
|
14
18
|
try {
|
|
15
19
|
// execute the current task
|
|
16
|
-
const result = await code()
|
|
17
|
-
return result
|
|
20
|
+
const result = await code()
|
|
21
|
+
return result
|
|
18
22
|
}
|
|
19
23
|
finally {
|
|
20
|
-
clearTimeout(taskTimeout)
|
|
24
|
+
clearTimeout(taskTimeout)
|
|
21
25
|
}
|
|
22
|
-
})()
|
|
26
|
+
})()
|
|
23
27
|
// we replace the existing task, appending the new piece of execution to it
|
|
24
28
|
// so the next task will have to wait for this one to finish
|
|
25
|
-
return task
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
return task
|
|
30
|
+
},
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const makeKeyedMutex = () => {
|
|
35
|
+
const map = {}
|
|
31
36
|
return {
|
|
32
37
|
mutex(key, task) {
|
|
33
38
|
if (!map[key]) {
|
|
34
|
-
map[key] = makeMutex()
|
|
39
|
+
map[key] = makeMutex()
|
|
35
40
|
}
|
|
36
|
-
return map[key].mutex(task)
|
|
41
|
+
return map[key].mutex(task)
|
|
37
42
|
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = {
|
|
47
|
+
makeMutex,
|
|
48
|
+
makeKeyedMutex
|
|
49
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { proto } from '../../WAProto
|
|
2
|
-
import type { ILogger } from './logger
|
|
1
|
+
import type { proto } from '../../WAProto';
|
|
2
|
+
import type { ILogger } from './logger';
|
|
3
3
|
export interface RecentMessageKey {
|
|
4
4
|
to: string;
|
|
5
5
|
id: string;
|
|
@@ -14,9 +14,7 @@ export interface SessionRecreateHistory {
|
|
|
14
14
|
export interface RetryCounter {
|
|
15
15
|
[messageId: string]: number;
|
|
16
16
|
}
|
|
17
|
-
export
|
|
18
|
-
[messageId: string]: NodeJS.Timeout;
|
|
19
|
-
}
|
|
17
|
+
export type PendingPhoneRequest = Record<string, ReturnType<typeof setTimeout>>;
|
|
20
18
|
export interface RetryStatistics {
|
|
21
19
|
totalRetries: number;
|
|
22
20
|
successfulRetries: number;
|
|
@@ -28,6 +26,7 @@ export interface RetryStatistics {
|
|
|
28
26
|
export declare class MessageRetryManager {
|
|
29
27
|
private logger;
|
|
30
28
|
private recentMessagesMap;
|
|
29
|
+
private messageKeyIndex;
|
|
31
30
|
private sessionRecreateHistory;
|
|
32
31
|
private retryCounters;
|
|
33
32
|
private pendingPhoneRequests;
|
|
@@ -78,5 +77,6 @@ export declare class MessageRetryManager {
|
|
|
78
77
|
*/
|
|
79
78
|
cancelPendingPhoneRequest(messageId: string): void;
|
|
80
79
|
private keyToString;
|
|
80
|
+
private removeRecentMessage;
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
|
|
@@ -1,20 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageRetryManager = void 0;
|
|
4
|
+
const lru_cache_1 = require("lru-cache");
|
|
2
5
|
/** Number of sent messages to cache in memory for handling retry receipts */
|
|
3
6
|
const RECENT_MESSAGES_SIZE = 512;
|
|
7
|
+
const MESSAGE_KEY_SEPARATOR = '\u0000';
|
|
4
8
|
/** Timeout for session recreation - 1 hour */
|
|
5
9
|
const RECREATE_SESSION_TIMEOUT = 60 * 60 * 1000; // 1 hour in milliseconds
|
|
6
10
|
const PHONE_REQUEST_DELAY = 3000;
|
|
7
|
-
|
|
11
|
+
class MessageRetryManager {
|
|
8
12
|
constructor(logger, maxMsgRetryCount) {
|
|
9
13
|
this.logger = logger;
|
|
10
|
-
this.recentMessagesMap = new LRUCache({
|
|
11
|
-
max: RECENT_MESSAGES_SIZE
|
|
14
|
+
this.recentMessagesMap = new lru_cache_1.LRUCache({
|
|
15
|
+
max: RECENT_MESSAGES_SIZE,
|
|
16
|
+
ttl: 5 * 60 * 1000,
|
|
17
|
+
ttlAutopurge: true,
|
|
18
|
+
dispose: (_value, key) => {
|
|
19
|
+
const separatorIndex = key.lastIndexOf(MESSAGE_KEY_SEPARATOR);
|
|
20
|
+
if (separatorIndex > -1) {
|
|
21
|
+
const messageId = key.slice(separatorIndex + MESSAGE_KEY_SEPARATOR.length);
|
|
22
|
+
this.messageKeyIndex.delete(messageId);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
12
25
|
});
|
|
13
|
-
this.
|
|
26
|
+
this.messageKeyIndex = new Map();
|
|
27
|
+
this.sessionRecreateHistory = new lru_cache_1.LRUCache({
|
|
14
28
|
ttl: RECREATE_SESSION_TIMEOUT * 2,
|
|
15
29
|
ttlAutopurge: true
|
|
16
30
|
});
|
|
17
|
-
this.retryCounters = new LRUCache({
|
|
31
|
+
this.retryCounters = new lru_cache_1.LRUCache({
|
|
18
32
|
ttl: 15 * 60 * 1000,
|
|
19
33
|
ttlAutopurge: true,
|
|
20
34
|
updateAgeOnGet: true
|
|
@@ -42,6 +56,7 @@ export class MessageRetryManager {
|
|
|
42
56
|
message,
|
|
43
57
|
timestamp: Date.now()
|
|
44
58
|
});
|
|
59
|
+
this.messageKeyIndex.set(id, keyStr);
|
|
45
60
|
this.logger.debug(`Added message to retry cache: ${to}/${id}`);
|
|
46
61
|
}
|
|
47
62
|
/**
|
|
@@ -110,6 +125,7 @@ export class MessageRetryManager {
|
|
|
110
125
|
// Clean up retry counter for successful message
|
|
111
126
|
this.retryCounters.delete(messageId);
|
|
112
127
|
this.cancelPendingPhoneRequest(messageId);
|
|
128
|
+
this.removeRecentMessage(messageId);
|
|
113
129
|
}
|
|
114
130
|
/**
|
|
115
131
|
* Mark retry as failed
|
|
@@ -117,6 +133,8 @@ export class MessageRetryManager {
|
|
|
117
133
|
markRetryFailed(messageId) {
|
|
118
134
|
this.statistics.failedRetries++;
|
|
119
135
|
this.retryCounters.delete(messageId);
|
|
136
|
+
this.cancelPendingPhoneRequest(messageId);
|
|
137
|
+
this.removeRecentMessage(messageId);
|
|
120
138
|
}
|
|
121
139
|
/**
|
|
122
140
|
* Schedule a phone request with delay
|
|
@@ -143,7 +161,17 @@ export class MessageRetryManager {
|
|
|
143
161
|
}
|
|
144
162
|
}
|
|
145
163
|
keyToString(key) {
|
|
146
|
-
return `${key.to}
|
|
164
|
+
return `${key.to}${MESSAGE_KEY_SEPARATOR}${key.id}`;
|
|
165
|
+
}
|
|
166
|
+
removeRecentMessage(messageId) {
|
|
167
|
+
const keyStr = this.messageKeyIndex.get(messageId);
|
|
168
|
+
if (!keyStr) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
this.recentMessagesMap.delete(keyStr);
|
|
172
|
+
this.messageKeyIndex.delete(messageId);
|
|
147
173
|
}
|
|
148
174
|
}
|
|
149
|
-
|
|
175
|
+
exports.MessageRetryManager = MessageRetryManager;
|
|
176
|
+
//# sourceMappingURL=message-retry-manager.js.map
|
|
177
|
+
|
|
@@ -1,114 +1,129 @@
|
|
|
1
|
-
import { Boom } from '@hapi/boom'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
12
|
-
fileSha256: Buffer<ArrayBufferLike>;
|
|
13
|
-
fileLength: number;
|
|
14
|
-
}>;
|
|
1
|
+
import { Boom } from '@hapi/boom'
|
|
2
|
+
import { AxiosRequestConfig } from 'axios'
|
|
3
|
+
import { Readable, Transform } from 'stream'
|
|
4
|
+
import { URL } from 'url'
|
|
5
|
+
import { proto } from '../../WAProto'
|
|
6
|
+
import { DownloadableMessage, MediaConnInfo, MediaDecryptionKeyInfo, MediaType, SocketConfig, WAMediaUpload, WAMediaUploadFunction, WAMessageContent } from '../Types'
|
|
7
|
+
import { BinaryNode } from '../WABinary'
|
|
8
|
+
import { ILogger } from './logger'
|
|
9
|
+
|
|
10
|
+
export declare const hkdfInfoKey: (type: MediaType) => string
|
|
11
|
+
|
|
15
12
|
/** generates all the keys required to encrypt/decrypt & sign a media message */
|
|
16
|
-
export declare function getMediaKeys(buffer: Uint8Array | string | null | undefined, mediaType: MediaType):
|
|
13
|
+
export declare function getMediaKeys(buffer: Uint8Array | string | null | undefined, mediaType: MediaType): MediaDecryptionKeyInfo
|
|
14
|
+
|
|
17
15
|
export declare const extractImageThumb: (bufferOrFilePath: Readable | Buffer | string, width?: number) => Promise<{
|
|
18
|
-
buffer:
|
|
16
|
+
buffer: Buffer
|
|
19
17
|
original: {
|
|
20
|
-
width:
|
|
21
|
-
height:
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export declare const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
width: number | undefined
|
|
19
|
+
height: number | undefined
|
|
20
|
+
}
|
|
21
|
+
}>
|
|
22
|
+
|
|
23
|
+
export declare const encodeBase64EncodedStringForUpload: (b64: string) => string
|
|
24
|
+
|
|
25
|
+
export declare const generateProfilePicture: (mediaUpload: WAMediaUpload) => Promise<{
|
|
26
|
+
img: Buffer
|
|
27
|
+
}>
|
|
28
|
+
|
|
31
29
|
/** gets the SHA256 of the given media message */
|
|
32
|
-
export declare const mediaMessageSHA256B64: (message: WAMessageContent) => string | null | undefined
|
|
33
|
-
|
|
30
|
+
export declare const mediaMessageSHA256B64: (message: WAMessageContent) => string | null | undefined
|
|
31
|
+
|
|
32
|
+
export declare function getAudioDuration(buffer: Buffer | string | Readable): Promise<number | undefined>
|
|
33
|
+
|
|
34
34
|
/**
|
|
35
35
|
referenced from and modifying https://github.com/wppconnect-team/wa-js/blob/main/src/chat/functions/prepareAudioWaveform.ts
|
|
36
36
|
*/
|
|
37
|
-
export declare function getAudioWaveform(buffer: Buffer | string | Readable, logger?: ILogger): Promise<Uint8Array
|
|
38
|
-
|
|
39
|
-
export declare const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
readonly
|
|
37
|
+
export declare function getAudioWaveform(buffer: Buffer | string | Readable, logger?: ILogger): Promise<Uint8Array | undefined>
|
|
38
|
+
|
|
39
|
+
export declare const toReadable: (buffer: Buffer) => Readable
|
|
40
|
+
|
|
41
|
+
export declare const toBuffer: (stream: Readable) => Promise<Buffer>
|
|
42
|
+
|
|
43
|
+
export declare const getStream: (item: WAMediaUpload, opts?: AxiosRequestConfig) => Promise<{
|
|
44
|
+
readonly stream: Readable
|
|
45
|
+
readonly type: "buffer"
|
|
45
46
|
} | {
|
|
46
|
-
readonly stream: Readable
|
|
47
|
-
readonly type: "readable"
|
|
47
|
+
readonly stream: Readable
|
|
48
|
+
readonly type: "readable"
|
|
48
49
|
} | {
|
|
49
|
-
readonly stream: Readable
|
|
50
|
-
readonly type: "remote"
|
|
50
|
+
readonly stream: Readable
|
|
51
|
+
readonly type: "remote"
|
|
51
52
|
} | {
|
|
52
|
-
readonly stream: import("fs").ReadStream
|
|
53
|
-
readonly type: "file"
|
|
54
|
-
}
|
|
53
|
+
readonly stream: import("fs").ReadStream
|
|
54
|
+
readonly type: "file"
|
|
55
|
+
}>
|
|
56
|
+
|
|
55
57
|
/** generates a thumbnail for a given media, if required */
|
|
56
58
|
export declare function generateThumbnail(file: string, mediaType: 'video' | 'image', options: {
|
|
57
|
-
logger?:
|
|
59
|
+
logger?: Logger
|
|
58
60
|
}): Promise<{
|
|
59
|
-
thumbnail: string | undefined
|
|
61
|
+
thumbnail: string | undefined
|
|
60
62
|
originalImageDimensions: {
|
|
61
|
-
width: number
|
|
62
|
-
height: number
|
|
63
|
-
} | undefined
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
width: number
|
|
64
|
+
height: number
|
|
65
|
+
} | undefined
|
|
66
|
+
}>
|
|
67
|
+
|
|
68
|
+
export declare const getHttpStream: (url: string | URL, options?: AxiosRequestConfig & {
|
|
69
|
+
isStream?: true
|
|
70
|
+
}) => Promise<Readable>
|
|
71
|
+
|
|
68
72
|
type EncryptedStreamOptions = {
|
|
69
|
-
saveOriginalFileIfRequired?: boolean
|
|
70
|
-
logger?:
|
|
71
|
-
opts?:
|
|
72
|
-
}
|
|
73
|
+
saveOriginalFileIfRequired?: boolean
|
|
74
|
+
logger?: Logger
|
|
75
|
+
opts?: AxiosRequestConfig
|
|
76
|
+
}
|
|
77
|
+
|
|
73
78
|
export declare const encryptedStream: (media: WAMediaUpload, mediaType: MediaType, { logger, saveOriginalFileIfRequired, opts }?: EncryptedStreamOptions) => Promise<{
|
|
74
|
-
mediaKey: Buffer
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
mac: Buffer
|
|
78
|
-
fileEncSha256: Buffer
|
|
79
|
-
fileSha256: Buffer
|
|
80
|
-
fileLength: number
|
|
81
|
-
|
|
79
|
+
mediaKey: Buffer
|
|
80
|
+
encWriteStream: Readable
|
|
81
|
+
bodyPath: string | undefined
|
|
82
|
+
mac: Buffer
|
|
83
|
+
fileEncSha256: Buffer
|
|
84
|
+
fileSha256: Buffer
|
|
85
|
+
fileLength: number
|
|
86
|
+
didSaveToTmpPath: boolean
|
|
87
|
+
}>
|
|
88
|
+
|
|
82
89
|
export type MediaDownloadOptions = {
|
|
83
|
-
startByte?: number
|
|
84
|
-
endByte?: number
|
|
85
|
-
options?:
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export declare const
|
|
90
|
+
startByte?: number
|
|
91
|
+
endByte?: number
|
|
92
|
+
options?: AxiosRequestConfig<{}>
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export declare const getUrlFromDirectPath: (directPath: string) => string
|
|
96
|
+
|
|
97
|
+
export declare const downloadContentFromMessage: ({ mediaKey, directPath, url }: DownloadableMessage, type: MediaType, opts?: MediaDownloadOptions) => Promise<Transform>
|
|
98
|
+
|
|
89
99
|
/**
|
|
90
100
|
* Decrypts and downloads an AES256-CBC encrypted file given the keys.
|
|
91
101
|
* Assumes the SHA256 of the plaintext is appended to the end of the ciphertext
|
|
92
102
|
* */
|
|
93
|
-
export declare const downloadEncryptedContent: (downloadUrl: string, { cipherKey, iv }: MediaDecryptionKeyInfo, { startByte, endByte, options }?: MediaDownloadOptions) => Promise<Transform
|
|
94
|
-
|
|
95
|
-
export declare
|
|
103
|
+
export declare const downloadEncryptedContent: (downloadUrl: string, { cipherKey, iv }: MediaDecryptionKeyInfo, { startByte, endByte, options }?: MediaDownloadOptions) => Promise<Transform>
|
|
104
|
+
|
|
105
|
+
export declare function extensionForMediaMessage(message: WAMessageContent): string
|
|
106
|
+
|
|
107
|
+
export declare const getWAUploadToServer: ({ customUploadHosts, fetchAgent, logger, options }: SocketConfig, refreshMediaConn: (force: boolean) => Promise<MediaConnInfo>) => WAMediaUploadFunction
|
|
96
108
|
/**
|
|
97
109
|
* Generate a binary node that will request the phone to re-upload the media & return the newly uploaded URL
|
|
98
110
|
*/
|
|
99
|
-
export declare const encryptMediaRetryRequest: (key:
|
|
111
|
+
export declare const encryptMediaRetryRequest: (key: proto.IMessageKey, mediaKey: Buffer | Uint8Array, meId: string) => BinaryNode
|
|
112
|
+
|
|
100
113
|
export declare const decodeMediaRetryNode: (node: BinaryNode) => {
|
|
101
|
-
key:
|
|
114
|
+
key: proto.IMessageKey
|
|
102
115
|
media?: {
|
|
103
|
-
ciphertext: Uint8Array
|
|
104
|
-
iv: Uint8Array
|
|
105
|
-
}
|
|
106
|
-
error?: Boom
|
|
107
|
-
}
|
|
116
|
+
ciphertext: Uint8Array
|
|
117
|
+
iv: Uint8Array
|
|
118
|
+
} | undefined
|
|
119
|
+
error?: Boom<any> | undefined
|
|
120
|
+
}
|
|
121
|
+
|
|
108
122
|
export declare const decryptMediaRetryData: ({ ciphertext, iv }: {
|
|
109
|
-
ciphertext: Uint8Array
|
|
110
|
-
iv: Uint8Array
|
|
111
|
-
}, mediaKey: Uint8Array, msgId: string) => Promise<proto.MediaRetryNotification
|
|
112
|
-
|
|
113
|
-
export
|
|
114
|
-
|
|
123
|
+
ciphertext: Uint8Array
|
|
124
|
+
iv: Uint8Array
|
|
125
|
+
}, mediaKey: Uint8Array, msgId: string) => Promise<proto.MediaRetryNotification>
|
|
126
|
+
|
|
127
|
+
export declare const getStatusCodeForMediaRetry: (code: number) => any
|
|
128
|
+
|
|
129
|
+
export {}
|