@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/Types/Message.d.ts
CHANGED
|
@@ -1,303 +1,473 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export type
|
|
14
|
-
|
|
15
|
-
export type
|
|
1
|
+
import { AxiosRequestConfig } from 'axios'
|
|
2
|
+
import { ILogger } from '../Utils/logger'
|
|
3
|
+
import type { Readable } from 'stream'
|
|
4
|
+
import type { URL } from 'url'
|
|
5
|
+
import { proto } from '../../WAProto'
|
|
6
|
+
import { MEDIA_HKDF_KEY_MAPPING } from '../Defaults'
|
|
7
|
+
import { BinaryNode } from '../WABinary'
|
|
8
|
+
import type { GroupMetadata } from './GroupMetadata'
|
|
9
|
+
import { CacheStore } from './Socket'
|
|
10
|
+
|
|
11
|
+
export { proto as WAProto }
|
|
12
|
+
|
|
13
|
+
export type WAMessage = proto.IWebMessageInfo
|
|
14
|
+
|
|
15
|
+
export type WAMessageContent = proto.IMessage
|
|
16
|
+
|
|
17
|
+
export type WAContactMessage = proto.Message.IContactMessage
|
|
18
|
+
|
|
19
|
+
export type WAContactsArrayMessage = proto.Message.IContactsArrayMessage
|
|
20
|
+
|
|
16
21
|
export type WAMessageKey = proto.IMessageKey & {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export type
|
|
25
|
-
|
|
26
|
-
export type
|
|
27
|
-
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
-
export type
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export type WAMediaUpload = Buffer |
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
PN = "pn",
|
|
41
|
-
LID = "lid"
|
|
22
|
+
newsletter_server_id?: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type WATextMessage = proto.Message.IExtendedTextMessage
|
|
26
|
+
|
|
27
|
+
export type WAContextInfo = proto.IContextInfo
|
|
28
|
+
|
|
29
|
+
export type WALocationMessage = proto.Message.ILocationMessage
|
|
30
|
+
|
|
31
|
+
export type WAOrderMessage = proto.Message.IOrderMessage
|
|
32
|
+
|
|
33
|
+
export type WAEventMessage = proto.Message.IEventMessage
|
|
34
|
+
|
|
35
|
+
export type WAGenericMediaMessage = proto.Message.IVideoMessage | proto.Message.IImageMessage | proto.Message.IAudioMessage | proto.Message.IDocumentMessage | proto.Message.IStickerMessage
|
|
36
|
+
|
|
37
|
+
export declare const WAMessageStubType = proto.WebMessageInfo.StubType
|
|
38
|
+
|
|
39
|
+
export declare const WAMessageStatus = proto.WebMessageInfo.Status
|
|
40
|
+
|
|
41
|
+
export type WAMediaUpload = Buffer | {
|
|
42
|
+
url: URL | string
|
|
43
|
+
} | {
|
|
44
|
+
stream: Readable
|
|
42
45
|
}
|
|
43
|
-
|
|
46
|
+
|
|
47
|
+
/** Set of message types that are supported by the library */
|
|
48
|
+
export type MessageType = keyof proto.Message
|
|
49
|
+
|
|
44
50
|
export type DownloadableMessage = {
|
|
45
|
-
mediaKey?: Uint8Array | null
|
|
46
|
-
directPath?: string | null
|
|
47
|
-
url?: string | null
|
|
48
|
-
}
|
|
49
|
-
|
|
51
|
+
mediaKey?: Uint8Array | null
|
|
52
|
+
directPath?: string | null
|
|
53
|
+
url?: string | null
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export type MessageReceiptType = 'read' | 'read-self' | 'hist_sync' | 'peer_msg' | 'sender' | 'inactive' | 'played' | undefined
|
|
57
|
+
|
|
50
58
|
export type MediaConnInfo = {
|
|
51
|
-
auth: string
|
|
52
|
-
ttl: number
|
|
59
|
+
auth: string
|
|
60
|
+
ttl: number
|
|
53
61
|
hosts: {
|
|
54
|
-
hostname: string
|
|
55
|
-
maxContentLengthBytes: number
|
|
56
|
-
}[]
|
|
57
|
-
fetchDate: Date
|
|
58
|
-
}
|
|
62
|
+
hostname: string
|
|
63
|
+
maxContentLengthBytes: number
|
|
64
|
+
}[]
|
|
65
|
+
fetchDate: Date
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface StickerPack {
|
|
69
|
+
stickers: Sticker[]
|
|
70
|
+
cover: WAMediaUpload
|
|
71
|
+
name: string
|
|
72
|
+
publisher: string
|
|
73
|
+
description?: string
|
|
74
|
+
packId?: string
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface Carousel {
|
|
78
|
+
image?: WAMediaUpload
|
|
79
|
+
video?: WAMediaUpload
|
|
80
|
+
product?: WASendableProduct
|
|
81
|
+
title?: string
|
|
82
|
+
body?: string
|
|
83
|
+
footer?: string
|
|
84
|
+
buttons?: proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton[]
|
|
85
|
+
}
|
|
86
|
+
|
|
59
87
|
export interface WAUrlInfo {
|
|
60
|
-
'canonical-url': string
|
|
61
|
-
'matched-text': string
|
|
62
|
-
title: string
|
|
63
|
-
description?: string
|
|
64
|
-
jpegThumbnail?: Buffer
|
|
65
|
-
highQualityThumbnail?: proto.Message.IImageMessage
|
|
66
|
-
originalThumbnailUrl?: string
|
|
88
|
+
'canonical-url': string
|
|
89
|
+
'matched-text': string
|
|
90
|
+
title: string
|
|
91
|
+
description?: string
|
|
92
|
+
jpegThumbnail?: Buffer
|
|
93
|
+
highQualityThumbnail?: proto.Message.IImageMessage
|
|
94
|
+
originalThumbnailUrl?: string
|
|
67
95
|
}
|
|
96
|
+
|
|
68
97
|
type Mentionable = {
|
|
69
98
|
/** list of jids that are mentioned in the accompanying text */
|
|
70
|
-
mentions?: string[]
|
|
71
|
-
}
|
|
99
|
+
mentions?: string[]
|
|
100
|
+
}
|
|
101
|
+
|
|
72
102
|
type Contextable = {
|
|
73
103
|
/** add contextInfo to the message */
|
|
74
|
-
contextInfo?: proto.IContextInfo
|
|
75
|
-
}
|
|
104
|
+
contextInfo?: proto.IContextInfo
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
type Ephemeral = {
|
|
108
|
+
ephemeral?: boolean
|
|
109
|
+
}
|
|
110
|
+
|
|
76
111
|
type ViewOnce = {
|
|
77
|
-
viewOnce?: boolean
|
|
78
|
-
}
|
|
112
|
+
viewOnce?: boolean
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
type ViewOnceExt = {
|
|
116
|
+
viewOnceExt?: boolean
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
type Buttonable = {
|
|
120
|
+
/** add buttons to the message */
|
|
121
|
+
buttons?: proto.Message.ButtonsMessage.IButton[]
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
type Templatable = {
|
|
125
|
+
/** add buttons to the message (conflicts with normal buttons)*/
|
|
126
|
+
templateButtons?: proto.IHydratedTemplateButton[]
|
|
127
|
+
footer?: string
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
type Interactiveable = {
|
|
131
|
+
/** add buttons to the message (conflicts with normal buttons)*/
|
|
132
|
+
interactiveButtons?: proto.Message.InteractiveMessage.NativeFlowMessage.INativeFlowButton[]
|
|
133
|
+
title?: string
|
|
134
|
+
subtitle?: string
|
|
135
|
+
footer?: string
|
|
136
|
+
hasMediaAttachment?: boolean
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
type Shopable = {
|
|
140
|
+
shop?: proto.Message.InteractiveMessage.ShopMessage
|
|
141
|
+
title?: string
|
|
142
|
+
subtitle?: string
|
|
143
|
+
footer?: string
|
|
144
|
+
hasMediaAttachment?: boolean
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
type Collectionable = {
|
|
148
|
+
collection?: proto.Message.InteractiveMessage.CollectionMessage
|
|
149
|
+
title?: string
|
|
150
|
+
subtitle?: string
|
|
151
|
+
footer?: string
|
|
152
|
+
hasMediaAttachment?: boolean
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
type Listable = {
|
|
156
|
+
/** Sections of the List */
|
|
157
|
+
sections?: proto.Message.ListMessage.ISection[]
|
|
158
|
+
/** Title of a List Message only */
|
|
159
|
+
title?: string
|
|
160
|
+
/** Text of the button on the list (required) */
|
|
161
|
+
buttonText?: string
|
|
162
|
+
/** ListType of a List Message only */
|
|
163
|
+
listType?: proto.Message.ListMessage.ListType
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
type Cardsable = {
|
|
167
|
+
cards?: Carousel[]
|
|
168
|
+
title?: string
|
|
169
|
+
subtitle?: string
|
|
170
|
+
footer?: string
|
|
171
|
+
}
|
|
172
|
+
|
|
79
173
|
type Editable = {
|
|
80
|
-
edit?: WAMessageKey
|
|
81
|
-
}
|
|
174
|
+
edit?: WAMessageKey
|
|
175
|
+
}
|
|
176
|
+
|
|
82
177
|
type WithDimensions = {
|
|
83
|
-
width?: number
|
|
84
|
-
height?: number
|
|
85
|
-
}
|
|
178
|
+
width?: number
|
|
179
|
+
height?: number
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export type Sticker = {
|
|
183
|
+
data: WAMediaUpload
|
|
184
|
+
emojis?: string[]
|
|
185
|
+
accessibilityLabel?: string
|
|
186
|
+
}
|
|
187
|
+
|
|
86
188
|
export type PollMessageOptions = {
|
|
87
|
-
name: string
|
|
88
|
-
selectableCount?: number
|
|
89
|
-
values: string[]
|
|
189
|
+
name: string
|
|
190
|
+
selectableCount?: number
|
|
191
|
+
values: string[]
|
|
90
192
|
/** 32 byte message secret to encrypt poll selections */
|
|
91
|
-
messageSecret?: Uint8Array
|
|
92
|
-
toAnnouncementGroup?: boolean
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
call?: 'audio' | 'video';
|
|
101
|
-
isCancelled?: boolean;
|
|
102
|
-
isScheduleCall?: boolean;
|
|
103
|
-
extraGuestsAllowed?: boolean;
|
|
104
|
-
messageSecret?: Uint8Array<ArrayBufferLike>;
|
|
105
|
-
};
|
|
193
|
+
messageSecret?: Uint8Array
|
|
194
|
+
toAnnouncementGroup?: boolean
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export type PollResultOptions = {
|
|
198
|
+
name: string
|
|
199
|
+
values: string[]
|
|
200
|
+
}
|
|
201
|
+
|
|
106
202
|
type SharePhoneNumber = {
|
|
107
|
-
sharePhoneNumber: boolean
|
|
108
|
-
}
|
|
203
|
+
sharePhoneNumber: boolean
|
|
204
|
+
}
|
|
205
|
+
|
|
109
206
|
type RequestPhoneNumber = {
|
|
110
|
-
requestPhoneNumber: boolean
|
|
111
|
-
}
|
|
207
|
+
requestPhoneNumber: boolean
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export type MediaType = keyof typeof MEDIA_HKDF_KEY_MAPPING
|
|
211
|
+
|
|
112
212
|
export type AnyMediaMessageContent = (({
|
|
113
|
-
image: WAMediaUpload
|
|
114
|
-
caption?: string
|
|
115
|
-
jpegThumbnail?: string
|
|
116
|
-
} & Mentionable & Contextable & WithDimensions) | ({
|
|
117
|
-
video: WAMediaUpload
|
|
118
|
-
caption?: string
|
|
119
|
-
gifPlayback?: boolean
|
|
120
|
-
jpegThumbnail?: string
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
} & Mentionable & Contextable & WithDimensions) | {
|
|
124
|
-
audio: WAMediaUpload;
|
|
213
|
+
image: WAMediaUpload
|
|
214
|
+
caption?: string
|
|
215
|
+
jpegThumbnail?: string
|
|
216
|
+
} & Mentionable & Contextable & Buttonable & Templatable & Interactiveable & WithDimensions) | ({
|
|
217
|
+
video: WAMediaUpload
|
|
218
|
+
caption?: string
|
|
219
|
+
gifPlayback?: boolean
|
|
220
|
+
jpegThumbnail?: string
|
|
221
|
+
} & Mentionable & Contextable & Buttonable & Templatable & Interactiveable & WithDimensions) | {
|
|
222
|
+
audio: WAMediaUpload
|
|
125
223
|
/** if set to true, will send as a `voice note` */
|
|
126
|
-
ptt?: boolean
|
|
224
|
+
ptt?: boolean
|
|
127
225
|
/** optionally tell the duration of the audio */
|
|
128
|
-
seconds?: number
|
|
226
|
+
seconds?: number
|
|
129
227
|
} | ({
|
|
130
|
-
sticker: WAMediaUpload
|
|
131
|
-
isAnimated?: boolean
|
|
228
|
+
sticker: WAMediaUpload
|
|
229
|
+
isAnimated?: boolean
|
|
132
230
|
} & WithDimensions) | ({
|
|
133
|
-
document: WAMediaUpload
|
|
134
|
-
mimetype: string
|
|
135
|
-
fileName?: string
|
|
136
|
-
caption?: string
|
|
137
|
-
} & Contextable)) & {
|
|
138
|
-
mimetype?: string
|
|
139
|
-
} & Editable
|
|
231
|
+
document: WAMediaUpload
|
|
232
|
+
mimetype: string
|
|
233
|
+
fileName?: string
|
|
234
|
+
caption?: string
|
|
235
|
+
} & Contextable & Buttonable & Templatable & Interactiveable )) & {
|
|
236
|
+
mimetype?: string
|
|
237
|
+
} & Editable
|
|
238
|
+
|
|
140
239
|
export type ButtonReplyInfo = {
|
|
141
|
-
displayText: string
|
|
142
|
-
id: string
|
|
143
|
-
index: number
|
|
144
|
-
}
|
|
240
|
+
displayText: string
|
|
241
|
+
id: string
|
|
242
|
+
index: number
|
|
243
|
+
}
|
|
244
|
+
|
|
145
245
|
export type GroupInviteInfo = {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
jid: string
|
|
150
|
-
|
|
151
|
-
|
|
246
|
+
code: string
|
|
247
|
+
expiration: number
|
|
248
|
+
caption: string
|
|
249
|
+
jid: string
|
|
250
|
+
name: string
|
|
251
|
+
jpegThumbnail?: string
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export type CallCreationInfo = {
|
|
255
|
+
time?: number
|
|
256
|
+
type?: number
|
|
257
|
+
name: string
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export type AdminInviteInfo = {
|
|
261
|
+
jid: string
|
|
262
|
+
name: string
|
|
263
|
+
caption: string
|
|
264
|
+
expiration: number
|
|
265
|
+
jpegThumbnail: string
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export type PinInfo = {
|
|
269
|
+
key: WAMessageKey
|
|
270
|
+
type?: number
|
|
271
|
+
time?: number
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export type KeepInfo = {
|
|
275
|
+
key: WAMessageKey
|
|
276
|
+
type: number
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export type PaymentInfo = {
|
|
280
|
+
note: string
|
|
281
|
+
currency?: string
|
|
282
|
+
offset?: number
|
|
283
|
+
amount?: number
|
|
284
|
+
expiry?: number
|
|
285
|
+
from?: string
|
|
286
|
+
image?: {
|
|
287
|
+
placeholderArgb: number
|
|
288
|
+
textArgb: number
|
|
289
|
+
subtextArgb: number
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
152
293
|
export type WASendableProduct = Omit<proto.Message.ProductMessage.IProductSnapshot, 'productImage'> & {
|
|
153
|
-
productImage: WAMediaUpload
|
|
154
|
-
}
|
|
294
|
+
productImage: WAMediaUpload
|
|
295
|
+
}
|
|
296
|
+
|
|
155
297
|
export type AnyRegularMessageContent = (({
|
|
156
|
-
text: string
|
|
157
|
-
linkPreview?: WAUrlInfo | null
|
|
158
|
-
} & Mentionable & Contextable & Editable) | AnyMediaMessageContent | {
|
|
159
|
-
|
|
160
|
-
} |
|
|
161
|
-
poll: PollMessageOptions;
|
|
162
|
-
} & Mentionable & Contextable & Editable) | {
|
|
298
|
+
text: string
|
|
299
|
+
linkPreview?: WAUrlInfo | null
|
|
300
|
+
} & Mentionable & Contextable & Buttonable & Templatable & Interactiveable & Shopable & Collectionable & Cardsable & Listable & Editable & WithDimensions) | AnyMediaMessageContent | ({
|
|
301
|
+
poll: PollMessageOptions
|
|
302
|
+
} & Mentionable & Contextable & Buttonable & Templatable & Interactiveable & Shopable & Collectionable & Cardsable & Listable & Editable & WithDimensions) | {
|
|
163
303
|
contacts: {
|
|
164
|
-
displayName?: string
|
|
165
|
-
contacts: proto.Message.IContactMessage[]
|
|
166
|
-
}
|
|
304
|
+
displayName?: string
|
|
305
|
+
contacts: proto.Message.IContactMessage[]
|
|
306
|
+
}
|
|
307
|
+
} | {
|
|
308
|
+
location: WALocationMessage
|
|
309
|
+
} | {
|
|
310
|
+
react: proto.Message.IReactionMessage
|
|
311
|
+
} | {
|
|
312
|
+
buttonReply: ButtonReplyInfo
|
|
313
|
+
type: 'template' | 'plain' | 'list' | 'interactive'
|
|
314
|
+
} | {
|
|
315
|
+
groupInvite: GroupInviteInfo
|
|
316
|
+
} | {
|
|
317
|
+
pin: PinInfo
|
|
318
|
+
} | {
|
|
319
|
+
keep: KeepInfo
|
|
320
|
+
} | {
|
|
321
|
+
call: CallCreationInfo
|
|
167
322
|
} | {
|
|
168
|
-
|
|
323
|
+
event: WAEventMessage
|
|
169
324
|
} | {
|
|
170
|
-
|
|
325
|
+
adminInvite: AdminInviteInfo
|
|
171
326
|
} | {
|
|
172
|
-
|
|
173
|
-
type: 'template' | 'plain';
|
|
327
|
+
payment: PaymentInfo
|
|
174
328
|
} | {
|
|
175
|
-
|
|
329
|
+
paymentInvite: {
|
|
330
|
+
type: number
|
|
331
|
+
expiry: number
|
|
332
|
+
}
|
|
176
333
|
} | {
|
|
177
|
-
|
|
334
|
+
pollResult: PollResultOptions
|
|
178
335
|
} | {
|
|
179
|
-
|
|
180
|
-
type: proto.PinInChat.Type;
|
|
181
|
-
/**
|
|
182
|
-
* 24 hours, 7 days, 30 days
|
|
183
|
-
*/
|
|
184
|
-
time?: 86400 | 604800 | 2592000;
|
|
336
|
+
order: WAOrderMessage
|
|
185
337
|
} | {
|
|
186
|
-
product: WASendableProduct
|
|
187
|
-
businessOwnerJid?: string
|
|
188
|
-
body?: string
|
|
189
|
-
footer?: string
|
|
190
|
-
} |
|
|
338
|
+
product: WASendableProduct
|
|
339
|
+
businessOwnerJid?: string
|
|
340
|
+
body?: string
|
|
341
|
+
footer?: string
|
|
342
|
+
} | {
|
|
343
|
+
stickerPack: StickerPack
|
|
344
|
+
} | SharePhoneNumber | RequestPhoneNumber) & ViewOnce & ViewOnceExt
|
|
345
|
+
|
|
191
346
|
export type AnyMessageContent = AnyRegularMessageContent | {
|
|
192
|
-
forward: WAMessage
|
|
193
|
-
force?: boolean
|
|
347
|
+
forward: WAMessage
|
|
348
|
+
force?: boolean
|
|
194
349
|
} | {
|
|
195
350
|
/** Delete your message or anyone's message in a group (admin required) */
|
|
196
|
-
delete: WAMessageKey
|
|
197
|
-
} | {
|
|
198
|
-
disappearingMessagesInChat: boolean | number;
|
|
351
|
+
delete: WAMessageKey
|
|
199
352
|
} | {
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
|
|
353
|
+
disappearingMessagesInChat: boolean | number
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export type GroupMetadataParticipants = Pick<GroupMetadata, 'participants'>
|
|
357
|
+
|
|
203
358
|
type MinimalRelayOptions = {
|
|
204
359
|
/** override the message ID with a custom provided string */
|
|
205
|
-
messageId?: string
|
|
206
|
-
/** should we use group metadata cache, or fetch afresh from the server
|
|
207
|
-
useCachedGroupMetadata?: boolean
|
|
208
|
-
}
|
|
360
|
+
messageId?: string
|
|
361
|
+
/** should we use group metadata cache, or fetch afresh from the server default assumed to be "true" */
|
|
362
|
+
useCachedGroupMetadata?: boolean
|
|
363
|
+
}
|
|
364
|
+
|
|
209
365
|
export type MessageRelayOptions = MinimalRelayOptions & {
|
|
210
|
-
/** only send to a specific participant
|
|
366
|
+
/** only send to a specific participant used when a message decryption fails for a single user */
|
|
211
367
|
participant?: {
|
|
212
|
-
jid: string
|
|
213
|
-
count: number
|
|
214
|
-
}
|
|
368
|
+
jid: string
|
|
369
|
+
count: number
|
|
370
|
+
}
|
|
215
371
|
/** additional attributes to add to the WA binary node */
|
|
216
372
|
additionalAttributes?: {
|
|
217
|
-
[_: string]: string
|
|
218
|
-
}
|
|
219
|
-
additionalNodes?: BinaryNode[]
|
|
220
|
-
/** should we use the devices cache, or fetch afresh from the server
|
|
221
|
-
useUserDevicesCache?: boolean
|
|
373
|
+
[_: string]: string
|
|
374
|
+
}
|
|
375
|
+
additionalNodes?: BinaryNode[]
|
|
376
|
+
/** should we use the devices cache, or fetch afresh from the server default assumed to be "true" */
|
|
377
|
+
useUserDevicesCache?: boolean
|
|
222
378
|
/** jid list of participants for status@broadcast */
|
|
223
|
-
statusJidList?: string[]
|
|
224
|
-
|
|
379
|
+
statusJidList?: string[]
|
|
380
|
+
newsletter?: boolean
|
|
381
|
+
}
|
|
382
|
+
|
|
225
383
|
export type MiscMessageGenerationOptions = MinimalRelayOptions & {
|
|
226
384
|
/** optional, if you want to manually set the timestamp of the message */
|
|
227
|
-
timestamp?: Date
|
|
385
|
+
timestamp?: Date
|
|
228
386
|
/** the message you want to quote */
|
|
229
|
-
quoted?: WAMessage
|
|
387
|
+
quoted?: WAMessage
|
|
230
388
|
/** disappearing messages settings */
|
|
231
|
-
ephemeralExpiration?: number | string
|
|
389
|
+
ephemeralExpiration?: number | string
|
|
232
390
|
/** timeout for media upload to WA server */
|
|
233
|
-
mediaUploadTimeoutMs?: number
|
|
391
|
+
mediaUploadTimeoutMs?: number
|
|
234
392
|
/** jid list of participants for status@broadcast */
|
|
235
|
-
statusJidList?: string[]
|
|
393
|
+
statusJidList?: string[]
|
|
236
394
|
/** backgroundcolor for status */
|
|
237
|
-
backgroundColor?: string
|
|
395
|
+
backgroundColor?: string
|
|
238
396
|
/** font type for status */
|
|
239
|
-
font?: number
|
|
397
|
+
font?: number
|
|
240
398
|
/** if it is broadcast */
|
|
241
|
-
broadcast?: boolean
|
|
242
|
-
|
|
399
|
+
broadcast?: boolean
|
|
400
|
+
newsletter?: boolean
|
|
401
|
+
additionalNodes?: BinaryNode[]
|
|
402
|
+
}
|
|
403
|
+
|
|
243
404
|
export type MessageGenerationOptionsFromContent = MiscMessageGenerationOptions & {
|
|
244
|
-
userJid: string
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
405
|
+
userJid: string
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export type WAMediaUploadFunctionOpts = {
|
|
409
|
+
fileEncSha256B64: string
|
|
410
|
+
mediaType: MediaType
|
|
411
|
+
newsletter?: boolean
|
|
412
|
+
timeoutMs?: number
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export type WAMediaUploadFunction = (encFilePath: string | Buffer, opts: WAMediaUploadFunctionOpts) => Promise<{
|
|
416
|
+
mediaUrl: string
|
|
417
|
+
directPath: string
|
|
418
|
+
handle?: string
|
|
419
|
+
}>
|
|
420
|
+
|
|
257
421
|
export type MediaGenerationOptions = {
|
|
258
|
-
logger?: ILogger
|
|
259
|
-
mediaTypeOverride?: MediaType
|
|
260
|
-
upload: WAMediaUploadFunction
|
|
422
|
+
logger?: ILogger
|
|
423
|
+
mediaTypeOverride?: MediaType
|
|
424
|
+
upload: WAMediaUploadFunction
|
|
261
425
|
/** cache media so it does not have to be uploaded again */
|
|
262
|
-
mediaCache?: CacheStore
|
|
263
|
-
mediaUploadTimeoutMs?: number
|
|
264
|
-
options?:
|
|
265
|
-
backgroundColor?: string
|
|
266
|
-
font?: number
|
|
267
|
-
|
|
426
|
+
mediaCache?: CacheStore
|
|
427
|
+
mediaUploadTimeoutMs?: number
|
|
428
|
+
options?: AxiosRequestConfig
|
|
429
|
+
backgroundColor?: string
|
|
430
|
+
font?: number
|
|
431
|
+
/** The message is for newsletter? */
|
|
432
|
+
newsletter?: boolean
|
|
433
|
+
}
|
|
434
|
+
|
|
268
435
|
export type MessageContentGenerationOptions = MediaGenerationOptions & {
|
|
269
|
-
getUrlInfo?: (text: string) => Promise<WAUrlInfo | undefined
|
|
270
|
-
getProfilePicUrl?: (jid: string
|
|
271
|
-
getCallLink?: (type: 'audio' | 'video', event?:
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
};
|
|
276
|
-
export type MessageGenerationOptions = MessageContentGenerationOptions & MessageGenerationOptionsFromContent;
|
|
436
|
+
getUrlInfo?: (text: string) => Promise<WAUrlInfo | undefined>
|
|
437
|
+
getProfilePicUrl?: (jid: string) => Promise<string | undefined>
|
|
438
|
+
getCallLink?: (type: 'audio' | 'video', event?: number) => Promise<string | undefined>
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export type MessageGenerationOptions = MessageContentGenerationOptions & MessageGenerationOptionsFromContent
|
|
277
442
|
/**
|
|
278
443
|
* Type of message upsert
|
|
279
444
|
* 1. notify => notify the user, this message was just received
|
|
280
445
|
* 2. append => append the message to the chat history, no notification required
|
|
281
446
|
*/
|
|
282
|
-
export type MessageUpsertType = 'append' | 'notify'
|
|
283
|
-
|
|
447
|
+
export type MessageUpsertType = 'append' | 'notify'
|
|
448
|
+
|
|
449
|
+
export type MessageUserReceipt = proto.IUserReceipt
|
|
450
|
+
|
|
284
451
|
export type WAMessageUpdate = {
|
|
285
|
-
update: Partial<WAMessage
|
|
286
|
-
key:
|
|
287
|
-
}
|
|
452
|
+
update: Partial<WAMessage>
|
|
453
|
+
key: proto.IMessageKey
|
|
454
|
+
}
|
|
455
|
+
|
|
288
456
|
export type WAMessageCursor = {
|
|
289
|
-
before: WAMessageKey | undefined
|
|
457
|
+
before: WAMessageKey | undefined
|
|
290
458
|
} | {
|
|
291
|
-
after: WAMessageKey | undefined
|
|
292
|
-
}
|
|
459
|
+
after: WAMessageKey | undefined
|
|
460
|
+
}
|
|
461
|
+
|
|
293
462
|
export type MessageUserReceiptUpdate = {
|
|
294
|
-
key:
|
|
295
|
-
receipt: MessageUserReceipt
|
|
296
|
-
}
|
|
463
|
+
key: proto.IMessageKey
|
|
464
|
+
receipt: MessageUserReceipt
|
|
465
|
+
}
|
|
466
|
+
|
|
297
467
|
export type MediaDecryptionKeyInfo = {
|
|
298
|
-
iv: Buffer
|
|
299
|
-
cipherKey: Buffer
|
|
300
|
-
macKey?: Buffer
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
|
|
468
|
+
iv: Buffer
|
|
469
|
+
cipherKey: Buffer
|
|
470
|
+
macKey?: Buffer
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
export type MinimalMessage = Pick<proto.IWebMessageInfo, 'key' | 'messageTimestamp'>
|