lordceaser-baileys 2.0.0 → 2.0.2
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/WAProto/index.js +136901 -78899
- package/WASignalGroup/GroupProtocol.js +1697 -0
- package/WASignalGroup/ciphertext_message.js +16 -0
- package/WASignalGroup/group_cipher.js +120 -0
- package/WASignalGroup/group_session_builder.js +46 -0
- package/WASignalGroup/index.js +5 -0
- package/WASignalGroup/keyhelper.js +21 -0
- package/WASignalGroup/protobufs.js +3 -0
- package/WASignalGroup/queue_job.js +69 -0
- package/WASignalGroup/sender_chain_key.js +50 -0
- package/WASignalGroup/sender_key_distribution_message.js +78 -0
- package/WASignalGroup/sender_key_message.js +92 -0
- package/WASignalGroup/sender_key_name.js +70 -0
- package/WASignalGroup/sender_key_record.js +56 -0
- package/WASignalGroup/sender_key_state.js +129 -0
- package/{lib/Signal/Group/sender-message-key.js → WASignalGroup/sender_message_key.js} +16 -3
- package/index.js +17 -0
- package/lib/Defaults/baileys-version.json +3 -0
- package/lib/Defaults/index.d.ts +15 -37
- package/lib/Defaults/index.js +60 -81
- package/lib/Signal/libsignal.d.ts +3 -5
- package/lib/Signal/libsignal.js +80 -359
- package/lib/Socket/Client/{types.d.ts → abstract-socket-client.d.ts} +5 -4
- package/lib/Socket/Client/abstract-socket-client.js +13 -0
- package/lib/Socket/Client/index.d.ts +3 -3
- package/lib/Socket/Client/index.js +19 -3
- package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
- package/lib/Socket/Client/mobile-socket-client.js +65 -0
- package/lib/Socket/Client/{websocket.d.ts → web-socket-client.d.ts} +2 -3
- package/lib/Socket/Client/web-socket-client.js +62 -0
- package/lib/Socket/business.d.ts +100 -147
- package/lib/Socket/business.js +43 -162
- package/lib/Socket/chats.d.ts +41 -85
- package/lib/Socket/chats.js +321 -569
- package/lib/Socket/groups.d.ts +57 -103
- package/lib/Socket/groups.js +84 -116
- package/lib/Socket/index.d.ts +106 -194
- package/lib/Socket/index.js +9 -11
- package/lib/Socket/messages-recv.d.ts +89 -134
- package/lib/Socket/messages-recv.js +475 -1275
- package/lib/Socket/messages-send.d.ts +97 -141
- package/lib/Socket/messages-send.js +633 -691
- package/lib/Socket/newsletter.d.ts +74 -112
- package/lib/Socket/newsletter.js +202 -147
- package/lib/Socket/registration.d.ts +264 -0
- package/lib/Socket/registration.js +166 -0
- package/lib/Socket/socket.d.ts +19 -34
- package/lib/Socket/socket.js +219 -547
- package/lib/Socket/usync.d.ts +37 -0
- package/lib/Socket/usync.js +70 -0
- package/lib/Store/index.d.ts +3 -0
- package/lib/Store/index.js +10 -0
- package/lib/Store/make-cache-manager-store.d.ts +14 -0
- package/lib/Store/make-cache-manager-store.js +83 -0
- package/lib/Store/make-in-memory-store.d.ts +118 -0
- package/lib/Store/make-in-memory-store.js +431 -0
- package/lib/Store/make-ordered-dictionary.d.ts +13 -0
- package/lib/Store/make-ordered-dictionary.js +81 -0
- package/lib/Store/object-repository.d.ts +10 -0
- package/lib/Store/object-repository.js +27 -0
- package/lib/Types/Auth.d.ts +11 -19
- package/lib/Types/Auth.js +2 -2
- package/lib/Types/Call.d.ts +1 -3
- package/lib/Types/Call.js +2 -2
- package/lib/Types/Chat.d.ts +8 -25
- package/lib/Types/Chat.js +4 -8
- package/lib/Types/Contact.d.ts +1 -8
- package/lib/Types/Contact.js +2 -2
- package/lib/Types/Events.d.ts +17 -101
- package/lib/Types/Events.js +2 -2
- package/lib/Types/GroupMetadata.d.ts +3 -18
- package/lib/Types/GroupMetadata.js +2 -2
- package/lib/Types/Label.d.ts +0 -1
- package/lib/Types/Label.js +5 -3
- package/lib/Types/LabelAssociation.d.ts +0 -1
- package/lib/Types/LabelAssociation.js +5 -3
- package/lib/Types/Message.d.ts +204 -91
- package/lib/Types/Message.js +9 -11
- package/lib/Types/Newsletter.d.ts +92 -0
- package/lib/Types/Newsletter.js +32 -0
- package/lib/Types/Product.d.ts +1 -2
- package/lib/Types/Product.js +2 -2
- package/lib/Types/Signal.d.ts +2 -32
- package/lib/Types/Signal.js +2 -2
- package/lib/Types/Socket.d.ts +24 -44
- package/lib/Types/Socket.js +2 -3
- package/lib/Types/State.d.ts +2 -72
- package/lib/Types/State.js +2 -56
- package/lib/Types/USync.d.ts +2 -3
- package/lib/Types/USync.js +2 -2
- package/lib/Types/index.d.ts +16 -16
- package/lib/Types/index.js +31 -15
- package/lib/Utils/auth-utils.d.ts +6 -12
- package/lib/Utils/auth-utils.js +143 -239
- package/lib/Utils/baileys-event-stream.d.ts +16 -0
- package/lib/Utils/baileys-event-stream.js +63 -0
- package/lib/Utils/business.d.ts +3 -4
- package/lib/Utils/business.js +69 -66
- package/lib/Utils/c4-compat.js +0 -8
- package/lib/Utils/chat-utils.d.ts +17 -47
- package/lib/Utils/chat-utils.js +237 -364
- package/lib/Utils/crypto.d.ts +21 -18
- package/lib/Utils/crypto.js +125 -44
- package/lib/Utils/decode-wa-message.d.ts +8 -38
- package/lib/Utils/decode-wa-message.js +90 -173
- package/lib/Utils/event-buffer.d.ts +8 -9
- package/lib/Utils/event-buffer.js +71 -176
- package/lib/Utils/generics.d.ts +22 -26
- package/lib/Utils/generics.js +175 -166
- package/lib/Utils/history.d.ts +11 -16
- package/lib/Utils/history.js +53 -93
- package/lib/Utils/index.d.ts +17 -22
- package/lib/Utils/index.js +34 -22
- package/lib/Utils/link-preview.d.ts +5 -5
- package/lib/Utils/link-preview.js +24 -16
- package/lib/Utils/logger.d.ts +1 -11
- package/lib/Utils/logger.js +7 -3
- package/lib/Utils/lt-hash.d.ts +12 -8
- package/lib/Utils/lt-hash.js +46 -3
- package/lib/Utils/make-mutex.d.ts +0 -2
- package/lib/Utils/make-mutex.js +34 -24
- package/lib/Utils/messages-media.d.ts +45 -65
- package/lib/Utils/messages-media.js +358 -425
- package/lib/Utils/messages.d.ts +18 -32
- package/lib/Utils/messages.js +720 -392
- package/lib/Utils/noise-handler.d.ts +13 -13
- package/lib/Utils/noise-handler.js +108 -149
- package/lib/Utils/process-message.d.ts +11 -30
- package/lib/Utils/process-message.js +166 -423
- package/lib/Utils/signal.d.ts +6 -20
- package/lib/Utils/signal.js +65 -107
- package/lib/Utils/use-multi-file-auth-state.d.ts +1 -2
- package/lib/Utils/use-multi-file-auth-state.js +103 -57
- package/lib/Utils/use-single-file-auth-state.d.ts +12 -0
- package/lib/Utils/use-single-file-auth-state.js +76 -0
- package/lib/Utils/validate-connection.d.ts +6 -6
- package/lib/Utils/validate-connection.js +114 -119
- package/lib/WABinary/constants.d.ts +4 -5
- package/lib/WABinary/constants.js +20 -1281
- package/lib/WABinary/decode.d.ts +3 -4
- package/lib/WABinary/decode.js +53 -51
- package/lib/WABinary/encode.d.ts +1 -2
- package/lib/WABinary/encode.js +44 -12
- package/lib/WABinary/generic-utils.d.ts +6 -7
- package/lib/WABinary/generic-utils.js +43 -46
- package/lib/WABinary/index.d.ts +5 -6
- package/lib/WABinary/index.js +21 -6
- package/lib/WABinary/jid-utils.d.ts +7 -24
- package/lib/WABinary/jid-utils.js +40 -74
- package/lib/WABinary/types.d.ts +1 -2
- package/lib/WABinary/types.js +2 -2
- package/lib/WAM/BinaryInfo.d.ts +1 -2
- package/lib/WAM/BinaryInfo.js +5 -2
- package/lib/WAM/constants.d.ts +3 -5
- package/lib/WAM/constants.js +11958 -19461
- package/lib/WAM/encode.d.ts +2 -3
- package/lib/WAM/encode.js +22 -17
- package/lib/WAM/index.d.ts +3 -4
- package/lib/WAM/index.js +19 -4
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +3 -4
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +13 -33
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +2 -3
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +14 -11
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +2 -3
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +12 -9
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +2 -3
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +13 -9
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +3 -4
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +22 -20
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +3 -5
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +8 -13
- package/lib/WAUSync/Protocols/index.d.ts +4 -6
- package/lib/WAUSync/Protocols/index.js +20 -6
- package/lib/WAUSync/USyncQuery.d.ts +4 -6
- package/lib/WAUSync/USyncQuery.js +35 -44
- package/lib/WAUSync/USyncUser.d.ts +4 -11
- package/lib/WAUSync/USyncUser.js +5 -10
- package/lib/WAUSync/index.d.ts +3 -4
- package/lib/WAUSync/index.js +19 -4
- package/lib/index.js +31 -13
- package/package.json +19 -10
- package/WAProto/GenerateStatics.sh +0 -3
- package/WAProto/WAProto.proto +0 -5479
- package/WAProto/fix-imports.js +0 -85
- package/WAProto/index.d.ts +0 -14017
- 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 -277
- 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 +0 -11
- 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 +0 -54
- 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 +0 -273
- package/lib/Socket/communities.d.ts.map +0 -1
- package/lib/Socket/communities.js +0 -431
- 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 +0 -3
- package/lib/Socket/mex.d.ts.map +0 -1
- package/lib/Socket/mex.js +0 -42
- 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/Mex.d.ts +0 -141
- package/lib/Types/Mex.d.ts.map +0 -1
- package/lib/Types/Mex.js +0 -37
- package/lib/Types/Mex.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/browser-utils.d.ts +0 -4
- package/lib/Utils/browser-utils.d.ts.map +0 -1
- package/lib/Utils/browser-utils.js +0 -29
- 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/companion-reg-client-utils.d.ts +0 -17
- package/lib/Utils/companion-reg-client-utils.d.ts.map +0 -1
- package/lib/Utils/companion-reg-client-utils.js +0 -35
- package/lib/Utils/companion-reg-client-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/identity-change-handler.d.ts +0 -44
- package/lib/Utils/identity-change-handler.d.ts.map +0 -1
- package/lib/Utils/identity-change-handler.js +0 -50
- package/lib/Utils/identity-change-handler.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 +0 -115
- package/lib/Utils/message-retry-manager.d.ts.map +0 -1
- package/lib/Utils/message-retry-manager.js +0 -265
- 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/offline-node-processor.d.ts +0 -17
- package/lib/Utils/offline-node-processor.d.ts.map +0 -1
- package/lib/Utils/offline-node-processor.js +0 -40
- package/lib/Utils/offline-node-processor.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/reporting-utils.d.ts +0 -11
- package/lib/Utils/reporting-utils.d.ts.map +0 -1
- package/lib/Utils/reporting-utils.js +0 -258
- package/lib/Utils/reporting-utils.js.map +0 -1
- package/lib/Utils/signal.d.ts.map +0 -1
- package/lib/Utils/signal.js.map +0 -1
- package/lib/Utils/stanza-ack.d.ts +0 -11
- package/lib/Utils/stanza-ack.d.ts.map +0 -1
- package/lib/Utils/stanza-ack.js +0 -38
- package/lib/Utils/stanza-ack.js.map +0 -1
- package/lib/Utils/sync-action-utils.d.ts +0 -19
- package/lib/Utils/sync-action-utils.d.ts.map +0 -1
- package/lib/Utils/sync-action-utils.js +0 -49
- package/lib/Utils/sync-action-utils.js.map +0 -1
- package/lib/Utils/tc-token-utils.d.ts +0 -37
- package/lib/Utils/tc-token-utils.d.ts.map +0 -1
- package/lib/Utils/tc-token-utils.js +0 -164
- package/lib/Utils/tc-token-utils.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/USyncUsernameProtocol.d.ts +0 -10
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts.map +0 -1
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +0 -25
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js.map +0 -1
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +0 -1
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +0 -1
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +0 -1
- 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 +0 -12
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
package/lib/Types/Message.d.ts
CHANGED
|
@@ -1,50 +1,36 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
import { AxiosRequestConfig } from 'axios';
|
|
5
|
+
import type { Logger } from 'pino';
|
|
1
6
|
import type { Readable } from 'stream';
|
|
2
7
|
import type { URL } from 'url';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import type { GroupMetadata } from './GroupMetadata
|
|
7
|
-
import
|
|
8
|
+
import { BinaryNode } from '../WABinary';
|
|
9
|
+
import { proto } from '../../WAProto';
|
|
10
|
+
import { MEDIA_HKDF_KEY_MAPPING } from '../Defaults';
|
|
11
|
+
import type { GroupMetadata } from './GroupMetadata';
|
|
12
|
+
import { CacheStore } from './Socket';
|
|
8
13
|
export { proto as WAProto };
|
|
9
|
-
export type WAMessage = proto.IWebMessageInfo
|
|
10
|
-
key: WAMessageKey;
|
|
11
|
-
messageStubParameters?: any;
|
|
12
|
-
category?: string;
|
|
13
|
-
retryCount?: number;
|
|
14
|
-
};
|
|
14
|
+
export type WAMessage = proto.IWebMessageInfo;
|
|
15
15
|
export type WAMessageContent = proto.IMessage;
|
|
16
16
|
export type WAContactMessage = proto.Message.IContactMessage;
|
|
17
17
|
export type WAContactsArrayMessage = proto.Message.IContactsArrayMessage;
|
|
18
|
-
export type WAMessageKey = proto.IMessageKey
|
|
19
|
-
remoteJidAlt?: string;
|
|
20
|
-
remoteJidUsername?: string;
|
|
21
|
-
participantAlt?: string;
|
|
22
|
-
participantUsername?: string;
|
|
23
|
-
server_id?: string;
|
|
24
|
-
addressingMode?: string;
|
|
25
|
-
isViewOnce?: boolean;
|
|
26
|
-
};
|
|
18
|
+
export type WAMessageKey = proto.IMessageKey;
|
|
27
19
|
export type WATextMessage = proto.Message.IExtendedTextMessage;
|
|
28
20
|
export type WAContextInfo = proto.IContextInfo;
|
|
29
21
|
export type WALocationMessage = proto.Message.ILocationMessage;
|
|
22
|
+
export type WALiveLocationMessage = proto.Message.ILiveLocationMessage;
|
|
30
23
|
export type WAGenericMediaMessage = proto.Message.IVideoMessage | proto.Message.IImageMessage | proto.Message.IAudioMessage | proto.Message.IDocumentMessage | proto.Message.IStickerMessage;
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
export type WAMediaPayloadURL = {
|
|
24
|
+
export import WAMessageStubType = proto.WebMessageInfo.StubType;
|
|
25
|
+
export import WAMessageStatus = proto.WebMessageInfo.Status;
|
|
26
|
+
export type WAMediaUpload = Buffer | {
|
|
35
27
|
url: URL | string;
|
|
36
|
-
}
|
|
37
|
-
export type WAMediaPayloadStream = {
|
|
28
|
+
} | {
|
|
38
29
|
stream: Readable;
|
|
39
30
|
};
|
|
40
|
-
export
|
|
31
|
+
export import Annotations = proto.IInteractiveAnnotation;
|
|
41
32
|
/** Set of message types that are supported by the library */
|
|
42
33
|
export type MessageType = keyof proto.Message;
|
|
43
|
-
export declare enum WAMessageAddressingMode {
|
|
44
|
-
PN = "pn",
|
|
45
|
-
LID = "lid"
|
|
46
|
-
}
|
|
47
|
-
export type MessageWithContextInfo = 'imageMessage' | 'contactMessage' | 'locationMessage' | 'extendedTextMessage' | 'documentMessage' | 'audioMessage' | 'videoMessage' | 'call' | 'contactsArrayMessage' | 'liveLocationMessage' | 'templateMessage' | 'stickerMessage' | 'groupInviteMessage' | 'templateButtonReplyMessage' | 'productMessage' | 'listMessage' | 'orderMessage' | 'listResponseMessage' | 'buttonsMessage' | 'buttonsResponseMessage' | 'interactiveMessage' | 'interactiveResponseMessage' | 'pollCreationMessage' | 'requestPhoneNumberMessage' | 'messageHistoryBundle' | 'eventMessage' | 'newsletterAdminInviteMessage' | 'albumMessage' | 'stickerPackMessage' | 'pollResultSnapshotMessage' | 'messageHistoryNotice';
|
|
48
34
|
export type DownloadableMessage = {
|
|
49
35
|
mediaKey?: Uint8Array | null;
|
|
50
36
|
directPath?: string | null;
|
|
@@ -69,11 +55,22 @@ export interface WAUrlInfo {
|
|
|
69
55
|
highQualityThumbnail?: proto.Message.IImageMessage;
|
|
70
56
|
originalThumbnailUrl?: string;
|
|
71
57
|
}
|
|
58
|
+
export interface Media {
|
|
59
|
+
image?: WAMediaUpload;
|
|
60
|
+
video?: WAMediaUpload;
|
|
61
|
+
}
|
|
62
|
+
export interface Carousel {
|
|
63
|
+
image?: WAMediaUpload;
|
|
64
|
+
video?: WAMediaUpload;
|
|
65
|
+
product?: WASendableProduct;
|
|
66
|
+
title?: string;
|
|
67
|
+
caption?: string;
|
|
68
|
+
footer?: string;
|
|
69
|
+
buttons?: proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton[];
|
|
70
|
+
}
|
|
72
71
|
type Mentionable = {
|
|
73
72
|
/** list of jids that are mentioned in the accompanying text */
|
|
74
73
|
mentions?: string[];
|
|
75
|
-
/** mention all */
|
|
76
|
-
mentionAll?: boolean;
|
|
77
74
|
};
|
|
78
75
|
type Contextable = {
|
|
79
76
|
/** add contextInfo to the message */
|
|
@@ -82,9 +79,55 @@ type Contextable = {
|
|
|
82
79
|
type ViewOnce = {
|
|
83
80
|
viewOnce?: boolean;
|
|
84
81
|
};
|
|
82
|
+
type Buttonable = {
|
|
83
|
+
/** add buttons to the message */
|
|
84
|
+
buttons?: proto.Message.ButtonsMessage.IButton[];
|
|
85
|
+
};
|
|
86
|
+
type Templatable = {
|
|
87
|
+
/** add buttons to the message (conflicts with normal buttons)*/
|
|
88
|
+
templateButtons?: proto.IHydratedTemplateButton[];
|
|
89
|
+
footer?: string;
|
|
90
|
+
};
|
|
91
|
+
type Interactiveable = {
|
|
92
|
+
/** add buttons to the message (conflicts with normal buttons)*/
|
|
93
|
+
interactiveButtons?: proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton[];
|
|
94
|
+
title?: string;
|
|
95
|
+
subtitle?: string;
|
|
96
|
+
media?: boolean;
|
|
97
|
+
};
|
|
98
|
+
type Shopable = {
|
|
99
|
+
shop?: proto.Message.InteractiveMessage.ShopMessage.Surface;
|
|
100
|
+
id?: string;
|
|
101
|
+
title?: string;
|
|
102
|
+
subtitle?: string;
|
|
103
|
+
media?: boolean;
|
|
104
|
+
};
|
|
105
|
+
type Collectionable = {
|
|
106
|
+
collection?: {
|
|
107
|
+
bizJid?: string;
|
|
108
|
+
id?: string;
|
|
109
|
+
version?: number;
|
|
110
|
+
};
|
|
111
|
+
title?: string;
|
|
112
|
+
subtitle?: string;
|
|
113
|
+
media?: boolean;
|
|
114
|
+
};
|
|
115
|
+
type Cardsable = {
|
|
116
|
+
cards?: Carousel[];
|
|
117
|
+
title?: string;
|
|
118
|
+
subtitle?: string;
|
|
119
|
+
};
|
|
85
120
|
type Editable = {
|
|
86
121
|
edit?: WAMessageKey;
|
|
87
122
|
};
|
|
123
|
+
type Listable = {
|
|
124
|
+
/** Sections of the List */
|
|
125
|
+
sections?: proto.Message.ListMessage.ISection[];
|
|
126
|
+
/** Title of a List Message only */
|
|
127
|
+
title?: string;
|
|
128
|
+
/** Text of the button on the list (required) */
|
|
129
|
+
buttonText?: string;
|
|
130
|
+
};
|
|
88
131
|
type WithDimensions = {
|
|
89
132
|
width?: number;
|
|
90
133
|
height?: number;
|
|
@@ -97,23 +140,10 @@ export type PollMessageOptions = {
|
|
|
97
140
|
messageSecret?: Uint8Array;
|
|
98
141
|
toAnnouncementGroup?: boolean;
|
|
99
142
|
};
|
|
100
|
-
export type
|
|
143
|
+
export type PollResultMessage = {
|
|
101
144
|
name: string;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
endDate?: Date;
|
|
105
|
-
location?: WALocationMessage;
|
|
106
|
-
call?: 'audio' | 'video';
|
|
107
|
-
isCancelled?: boolean;
|
|
108
|
-
isScheduleCall?: boolean;
|
|
109
|
-
extraGuestsAllowed?: boolean;
|
|
110
|
-
messageSecret?: Uint8Array<ArrayBufferLike>;
|
|
111
|
-
};
|
|
112
|
-
export type AlbumMessageOptions = {
|
|
113
|
-
/** Number of images expected in the album */
|
|
114
|
-
expectedImageCount?: number;
|
|
115
|
-
/** Number of videos expected in the album */
|
|
116
|
-
expectedVideoCount?: number;
|
|
145
|
+
votes: proto.Message.PollResultSnapshotMessage.PollVote[];
|
|
146
|
+
messageSecret?: Uint8Array;
|
|
117
147
|
};
|
|
118
148
|
type SharePhoneNumber = {
|
|
119
149
|
sharePhoneNumber: boolean;
|
|
@@ -121,41 +151,49 @@ type SharePhoneNumber = {
|
|
|
121
151
|
type RequestPhoneNumber = {
|
|
122
152
|
requestPhoneNumber: boolean;
|
|
123
153
|
};
|
|
154
|
+
export type WASendableProduct = Omit<proto.Message.ProductMessage.IProductSnapshot, 'productImage'> & {
|
|
155
|
+
productImage: WAMediaUpload;
|
|
156
|
+
};
|
|
157
|
+
export type MediaType = keyof typeof MEDIA_HKDF_KEY_MAPPING;
|
|
124
158
|
export type AnyMediaMessageContent = (({
|
|
125
159
|
image: WAMediaUpload;
|
|
126
160
|
caption?: string;
|
|
127
161
|
jpegThumbnail?: string;
|
|
128
|
-
|
|
162
|
+
annotations?: Annotations;
|
|
163
|
+
} & Mentionable & Contextable & Buttonable & Templatable & Interactiveable & Shopable & Collectionable & Cardsable & WithDimensions) | ({
|
|
129
164
|
video: WAMediaUpload;
|
|
130
165
|
caption?: string;
|
|
131
166
|
gifPlayback?: boolean;
|
|
132
167
|
jpegThumbnail?: string;
|
|
133
168
|
/** if set to true, will send as a `video note` */
|
|
134
169
|
ptv?: boolean;
|
|
135
|
-
|
|
170
|
+
annotations?: Annotations;
|
|
171
|
+
} & Mentionable & Contextable & Buttonable & Templatable & Interactiveable & Shopable & Collectionable & Cardsable & WithDimensions) | {
|
|
136
172
|
audio: WAMediaUpload;
|
|
137
173
|
/** if set to true, will send as a `voice note` */
|
|
138
174
|
ptt?: boolean;
|
|
139
175
|
/** optionally tell the duration of the audio */
|
|
140
176
|
seconds?: number;
|
|
177
|
+
annotations?: Annotations;
|
|
141
178
|
} | ({
|
|
142
179
|
sticker: WAMediaUpload;
|
|
143
180
|
isAnimated?: boolean;
|
|
181
|
+
annotations?: Annotations;
|
|
144
182
|
} & WithDimensions) | ({
|
|
145
183
|
document: WAMediaUpload;
|
|
146
184
|
mimetype: string;
|
|
147
185
|
fileName?: string;
|
|
148
186
|
caption?: string;
|
|
149
|
-
|
|
187
|
+
annotations?: Annotations;
|
|
188
|
+
} & Contextable & Buttonable & Templatable & Interactiveable & Shopable & Collectionable & Cardsable)) & {
|
|
150
189
|
mimetype?: string;
|
|
151
|
-
} & Editable
|
|
152
|
-
/** key of the parent albumMessage to associate this media with */
|
|
153
|
-
albumParentKey?: WAMessageKey;
|
|
154
|
-
};
|
|
190
|
+
} & Editable;
|
|
155
191
|
export type ButtonReplyInfo = {
|
|
156
192
|
displayText: string;
|
|
157
193
|
id: string;
|
|
158
194
|
index: number;
|
|
195
|
+
text: string;
|
|
196
|
+
nativeFlow: proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage;
|
|
159
197
|
};
|
|
160
198
|
export type GroupInviteInfo = {
|
|
161
199
|
inviteCode: string;
|
|
@@ -163,35 +201,89 @@ export type GroupInviteInfo = {
|
|
|
163
201
|
text: string;
|
|
164
202
|
jid: string;
|
|
165
203
|
subject: string;
|
|
204
|
+
thumbnail: Buffer;
|
|
166
205
|
};
|
|
167
|
-
export type
|
|
168
|
-
|
|
206
|
+
export type PinInChatInfo = {
|
|
207
|
+
key: WAMessageKey;
|
|
208
|
+
type?: number;
|
|
209
|
+
time?: number;
|
|
210
|
+
};
|
|
211
|
+
export type KeepInChatInfo = {
|
|
212
|
+
key: WAMessageKey;
|
|
213
|
+
type?: number;
|
|
214
|
+
time?: number;
|
|
215
|
+
};
|
|
216
|
+
export type CallCreationInfo = {
|
|
217
|
+
time?: number;
|
|
218
|
+
title?: string;
|
|
219
|
+
type?: number;
|
|
220
|
+
};
|
|
221
|
+
export type PaymentInviteInfo = {
|
|
222
|
+
type?: number;
|
|
223
|
+
expiry?: number;
|
|
224
|
+
};
|
|
225
|
+
export type RequestPaymentInfo = {
|
|
226
|
+
expiry: number;
|
|
227
|
+
amount: number;
|
|
228
|
+
currency: string;
|
|
229
|
+
from: string;
|
|
230
|
+
note?: string;
|
|
231
|
+
sticker?: WAMediaUpload;
|
|
232
|
+
background: string;
|
|
233
|
+
/** add contextInfo to the message */
|
|
234
|
+
contextInfo?: proto.IContextInfo;
|
|
235
|
+
};
|
|
236
|
+
export type EventsInfo = {
|
|
237
|
+
isCanceled?: boolean;
|
|
238
|
+
name: string;
|
|
239
|
+
description: string;
|
|
240
|
+
joinLink?: string;
|
|
241
|
+
startTime?: number;
|
|
242
|
+
messageSecret?: Uint8Array;
|
|
243
|
+
};
|
|
244
|
+
export type AdminInviteInfo = {
|
|
245
|
+
inviteExpiration: number;
|
|
246
|
+
text: string;
|
|
247
|
+
jid: string;
|
|
248
|
+
subject: string;
|
|
249
|
+
thumbnail: Buffer;
|
|
250
|
+
};
|
|
251
|
+
export type OrderInfo = {
|
|
252
|
+
id: number;
|
|
253
|
+
thumbnail: string;
|
|
254
|
+
itemCount: number;
|
|
255
|
+
status: number;
|
|
256
|
+
surface: number;
|
|
257
|
+
title: string;
|
|
258
|
+
text: string;
|
|
259
|
+
seller: string;
|
|
260
|
+
token: string;
|
|
261
|
+
amount: number;
|
|
262
|
+
currency: string;
|
|
169
263
|
};
|
|
170
264
|
export type AnyRegularMessageContent = (({
|
|
171
265
|
text: string;
|
|
172
266
|
linkPreview?: WAUrlInfo | null;
|
|
173
|
-
} & Mentionable & Contextable & Editable) | AnyMediaMessageContent | {
|
|
174
|
-
event: EventMessageOptions;
|
|
175
|
-
} | ({
|
|
267
|
+
} & Mentionable & Contextable & Buttonable & Templatable & Interactiveable & Shopable & Collectionable & Cardsable & Listable & Editable) | AnyMediaMessageContent | ({
|
|
176
268
|
poll: PollMessageOptions;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
} & Contextable &
|
|
269
|
+
} | {
|
|
270
|
+
pollResult: PollResultMessage;
|
|
271
|
+
} & Mentionable & Contextable & Buttonable & Templatable & Editable) | {
|
|
180
272
|
contacts: {
|
|
181
273
|
displayName?: string;
|
|
182
274
|
contacts: proto.Message.IContactMessage[];
|
|
183
275
|
};
|
|
184
276
|
} | {
|
|
185
277
|
location: WALocationMessage;
|
|
278
|
+
} | {
|
|
279
|
+
liveLocation: WALiveLocationMessage;
|
|
186
280
|
} | {
|
|
187
281
|
react: proto.Message.IReactionMessage;
|
|
188
282
|
} | {
|
|
189
283
|
buttonReply: ButtonReplyInfo;
|
|
190
|
-
type: 'template' | 'plain';
|
|
284
|
+
type: 'template' | 'plain' | 'interactive';
|
|
191
285
|
} | {
|
|
192
286
|
groupInvite: GroupInviteInfo;
|
|
193
|
-
} | {
|
|
194
|
-
listReply: Omit<proto.Message.IListResponseMessage, 'contextInfo'>;
|
|
195
287
|
} | {
|
|
196
288
|
pin: WAMessageKey;
|
|
197
289
|
type: proto.PinInChat.Type;
|
|
@@ -200,11 +292,32 @@ export type AnyRegularMessageContent = (({
|
|
|
200
292
|
*/
|
|
201
293
|
time?: 86400 | 604800 | 2592000;
|
|
202
294
|
} | {
|
|
295
|
+
keep: WAMessageKey;
|
|
296
|
+
type: number;
|
|
297
|
+
/**
|
|
298
|
+
* 24 hours, 7 days, 90 days
|
|
299
|
+
*/
|
|
300
|
+
time?: 86400 | 604800 | 7776000;
|
|
301
|
+
} | {
|
|
302
|
+
paymentInvite: PaymentInviteInfo;
|
|
303
|
+
} | {
|
|
304
|
+
requestPayment: RequestPaymentInfo;
|
|
305
|
+
} | {
|
|
306
|
+
event: EventsInfo;
|
|
307
|
+
} | {
|
|
308
|
+
order: OrderInfo;
|
|
309
|
+
} | {
|
|
310
|
+
call: CallCreationInfo;
|
|
311
|
+
} | {
|
|
312
|
+
inviteAdmin: AdminInviteInfo;
|
|
313
|
+
} | {
|
|
314
|
+
listReply: Omit<proto.Message.IListResponseMessage, 'contextInfo'>;
|
|
315
|
+
} | ({
|
|
203
316
|
product: WASendableProduct;
|
|
204
317
|
businessOwnerJid?: string;
|
|
205
318
|
body?: string;
|
|
206
319
|
footer?: string;
|
|
207
|
-
} | SharePhoneNumber | RequestPhoneNumber) & ViewOnce;
|
|
320
|
+
} & Mentionable & Contextable & Interactiveable & Shopable & Collectionable & Cardsable & WithDimensions) | SharePhoneNumber | RequestPhoneNumber) & ViewOnce;
|
|
208
321
|
export type AnyMessageContent = AnyRegularMessageContent | {
|
|
209
322
|
forward: WAMessage;
|
|
210
323
|
force?: boolean;
|
|
@@ -213,15 +326,13 @@ export type AnyMessageContent = AnyRegularMessageContent | {
|
|
|
213
326
|
delete: WAMessageKey;
|
|
214
327
|
} | {
|
|
215
328
|
disappearingMessagesInChat: boolean | number;
|
|
216
|
-
} | {
|
|
217
|
-
limitSharing: boolean;
|
|
218
329
|
};
|
|
219
330
|
export type GroupMetadataParticipants = Pick<GroupMetadata, 'participants'>;
|
|
220
331
|
type MinimalRelayOptions = {
|
|
221
332
|
/** override the message ID with a custom provided string */
|
|
222
333
|
messageId?: string;
|
|
223
|
-
/**
|
|
224
|
-
|
|
334
|
+
/** cached group metadata, use to prevent redundant requests to WA & speed up msg sending */
|
|
335
|
+
cachedGroupMetadata?: (jid: string) => Promise<GroupMetadataParticipants | undefined>;
|
|
225
336
|
};
|
|
226
337
|
export type MessageRelayOptions = MinimalRelayOptions & {
|
|
227
338
|
/** only send to a specific participant; used when a message decryption fails for a single user */
|
|
@@ -244,6 +355,7 @@ export type MiscMessageGenerationOptions = MinimalRelayOptions & {
|
|
|
244
355
|
timestamp?: Date;
|
|
245
356
|
/** the message you want to quote */
|
|
246
357
|
quoted?: WAMessage;
|
|
358
|
+
additionalNodes?: BinaryNode[];
|
|
247
359
|
/** disappearing messages settings */
|
|
248
360
|
ephemeralExpiration?: number | string;
|
|
249
361
|
/** timeout for media upload to WA server */
|
|
@@ -256,39 +368,41 @@ export type MiscMessageGenerationOptions = MinimalRelayOptions & {
|
|
|
256
368
|
font?: number;
|
|
257
369
|
/** if it is broadcast */
|
|
258
370
|
broadcast?: boolean;
|
|
371
|
+
/** delay of message time */
|
|
372
|
+
delay?: number;
|
|
259
373
|
};
|
|
260
374
|
export type MessageGenerationOptionsFromContent = MiscMessageGenerationOptions & {
|
|
261
375
|
userJid: string;
|
|
262
376
|
};
|
|
263
|
-
export type
|
|
377
|
+
export type WAMediaUploadFunctionOpts = {
|
|
264
378
|
fileEncSha256B64: string;
|
|
265
379
|
mediaType: MediaType;
|
|
380
|
+
newsletter?: boolean;
|
|
266
381
|
timeoutMs?: number;
|
|
267
|
-
}
|
|
382
|
+
};
|
|
383
|
+
export type WAMediaUploadFunction = (readStream: Readable | Buffer, opts: WAMediaUploadFunctionOpts) => Promise<{
|
|
268
384
|
mediaUrl: string;
|
|
269
385
|
directPath: string;
|
|
270
|
-
|
|
271
|
-
ts?: number;
|
|
272
|
-
fbid?: number;
|
|
386
|
+
handle?: string;
|
|
273
387
|
}>;
|
|
274
388
|
export type MediaGenerationOptions = {
|
|
275
|
-
logger?:
|
|
389
|
+
logger?: Logger;
|
|
276
390
|
mediaTypeOverride?: MediaType;
|
|
277
391
|
upload: WAMediaUploadFunction;
|
|
278
392
|
/** cache media so it does not have to be uploaded again */
|
|
279
393
|
mediaCache?: CacheStore;
|
|
280
394
|
mediaUploadTimeoutMs?: number;
|
|
281
|
-
options?:
|
|
395
|
+
options?: AxiosRequestConfig;
|
|
396
|
+
/** the message you want to quote */
|
|
397
|
+
quoted?: WAMessage;
|
|
282
398
|
backgroundColor?: string;
|
|
283
399
|
font?: number;
|
|
400
|
+
/** The message is for newsletter? */
|
|
401
|
+
newsletter?: boolean;
|
|
284
402
|
};
|
|
285
403
|
export type MessageContentGenerationOptions = MediaGenerationOptions & {
|
|
286
404
|
getUrlInfo?: (text: string) => Promise<WAUrlInfo | undefined>;
|
|
287
405
|
getProfilePicUrl?: (jid: string, type: 'image' | 'preview') => Promise<string | undefined>;
|
|
288
|
-
getCallLink?: (type: 'audio' | 'video', event?: {
|
|
289
|
-
startTime: number;
|
|
290
|
-
}) => Promise<string | undefined>;
|
|
291
|
-
jid?: string;
|
|
292
406
|
};
|
|
293
407
|
export type MessageGenerationOptions = MessageContentGenerationOptions & MessageGenerationOptionsFromContent;
|
|
294
408
|
/**
|
|
@@ -300,7 +414,7 @@ export type MessageUpsertType = 'append' | 'notify';
|
|
|
300
414
|
export type MessageUserReceipt = proto.IUserReceipt;
|
|
301
415
|
export type WAMessageUpdate = {
|
|
302
416
|
update: Partial<WAMessage>;
|
|
303
|
-
key:
|
|
417
|
+
key: proto.IMessageKey;
|
|
304
418
|
};
|
|
305
419
|
export type WAMessageCursor = {
|
|
306
420
|
before: WAMessageKey | undefined;
|
|
@@ -308,13 +422,12 @@ export type WAMessageCursor = {
|
|
|
308
422
|
after: WAMessageKey | undefined;
|
|
309
423
|
};
|
|
310
424
|
export type MessageUserReceiptUpdate = {
|
|
311
|
-
key:
|
|
425
|
+
key: proto.IMessageKey;
|
|
312
426
|
receipt: MessageUserReceipt;
|
|
313
427
|
};
|
|
314
428
|
export type MediaDecryptionKeyInfo = {
|
|
315
|
-
iv:
|
|
316
|
-
cipherKey:
|
|
317
|
-
macKey?:
|
|
429
|
+
iv: Buffer;
|
|
430
|
+
cipherKey: Buffer;
|
|
431
|
+
macKey?: Buffer;
|
|
318
432
|
};
|
|
319
|
-
export type MinimalMessage = Pick<
|
|
320
|
-
//# sourceMappingURL=Message.d.ts.map
|
|
433
|
+
export type MinimalMessage = Pick<proto.IWebMessageInfo, 'key' | 'messageTimestamp'>;
|
package/lib/Types/Message.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
})(WAMessageAddressingMode || (WAMessageAddressingMode = {}));
|
|
11
|
-
//# sourceMappingURL=Message.js.map
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WAMessageStatus = exports.WAMessageStubType = exports.WAProto = void 0;
|
|
4
|
+
const WAProto_1 = require("../../WAProto");
|
|
5
|
+
Object.defineProperty(exports, "WAProto", { enumerable: true, get: function () { return WAProto_1.proto; } });
|
|
6
|
+
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
7
|
+
exports.WAMessageStubType = WAProto_1.proto.WebMessageInfo.StubType;
|
|
8
|
+
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
9
|
+
exports.WAMessageStatus = WAProto_1.proto.WebMessageInfo.Status;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { proto } from '../../WAProto';
|
|
2
|
+
export type NewsletterReactionMode = 'ALL' | 'BASIC' | 'NONE';
|
|
3
|
+
export type NewsletterState = 'ACTIVE' | 'GEOSUSPENDED' | 'SUSPENDED';
|
|
4
|
+
export type NewsletterVerification = 'VERIFIED' | 'UNVERIFIED';
|
|
5
|
+
export type NewsletterMute = 'ON' | 'OFF' | 'UNDEFINED';
|
|
6
|
+
export type NewsletterViewRole = 'ADMIN' | 'GUEST' | 'OWNER' | 'SUBSCRIBER';
|
|
7
|
+
export type NewsletterViewerMetadata = {
|
|
8
|
+
mute: NewsletterMute;
|
|
9
|
+
view_role: NewsletterViewRole;
|
|
10
|
+
};
|
|
11
|
+
export type NewsletterMetadata = {
|
|
12
|
+
/**jid of newsletter */
|
|
13
|
+
id: string;
|
|
14
|
+
/**state of newsletter */
|
|
15
|
+
state: NewsletterState;
|
|
16
|
+
/**creation timestamp of newsletter */
|
|
17
|
+
creation_time: number;
|
|
18
|
+
/**name of newsletter */
|
|
19
|
+
name: string;
|
|
20
|
+
/**timestamp of last name modification of newsletter */
|
|
21
|
+
nameTime: number;
|
|
22
|
+
/**description of newsletter */
|
|
23
|
+
description: string;
|
|
24
|
+
/**timestamp of last description modification of newsletter */
|
|
25
|
+
descriptionTime: number;
|
|
26
|
+
/**invite code of newsletter */
|
|
27
|
+
invite: string;
|
|
28
|
+
/**i dont know */
|
|
29
|
+
handle: null;
|
|
30
|
+
/**direct path of picture */
|
|
31
|
+
picture: string | null;
|
|
32
|
+
/**direct path of picture preview (lower quality) */
|
|
33
|
+
preview: string | null;
|
|
34
|
+
/**reaction mode of newsletter */
|
|
35
|
+
reaction_codes?: NewsletterReactionMode;
|
|
36
|
+
/**subscribers count of newsletter */
|
|
37
|
+
subscribers: number;
|
|
38
|
+
/**verification state of newsletter */
|
|
39
|
+
verification: NewsletterVerification;
|
|
40
|
+
/**viewer metadata */
|
|
41
|
+
viewer_metadata: NewsletterViewerMetadata;
|
|
42
|
+
};
|
|
43
|
+
export type SubscriberAction = 'promote' | 'demote';
|
|
44
|
+
export type ReactionModeUpdate = {
|
|
45
|
+
reaction_codes: {
|
|
46
|
+
blocked_codes: null;
|
|
47
|
+
enabled_ts_sec: null;
|
|
48
|
+
value: NewsletterReactionMode;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
/**only exists reaction mode update */
|
|
52
|
+
export type NewsletterSettingsUpdate = ReactionModeUpdate;
|
|
53
|
+
export type NewsletterReaction = {
|
|
54
|
+
count: number;
|
|
55
|
+
code: string;
|
|
56
|
+
};
|
|
57
|
+
export type NewsletterFetchedUpdate = {
|
|
58
|
+
/**id of message in newsletter, starts from 100 */
|
|
59
|
+
server_id: string;
|
|
60
|
+
/**count of views in this message */
|
|
61
|
+
views?: number;
|
|
62
|
+
/**reactions in this message */
|
|
63
|
+
reactions: NewsletterReaction[];
|
|
64
|
+
/**the message, if you requested only updates, you will not receive message */
|
|
65
|
+
message?: proto.IWebMessageInfo;
|
|
66
|
+
};
|
|
67
|
+
export declare enum MexOperations {
|
|
68
|
+
PROMOTE = "NotificationNewsletterAdminPromote",
|
|
69
|
+
DEMOTE = "NotificationNewsletterAdminDemote",
|
|
70
|
+
UPDATE = "NotificationNewsletterUpdate"
|
|
71
|
+
}
|
|
72
|
+
export declare enum XWAPaths {
|
|
73
|
+
PROMOTE = "xwa2_notify_newsletter_admin_promote",
|
|
74
|
+
DEMOTE = "xwa2_notify_newsletter_admin_demote",
|
|
75
|
+
ADMIN_COUNT = "xwa2_newsletter_admin",
|
|
76
|
+
CREATE = "xwa2_newsletter_create",
|
|
77
|
+
NEWSLETTER = "xwa2_newsletter",
|
|
78
|
+
METADATA_UPDATE = "xwa2_notify_newsletter_on_metadata_update"
|
|
79
|
+
}
|
|
80
|
+
export declare enum QueryIds {
|
|
81
|
+
JOB_MUTATION = "7150902998257522",
|
|
82
|
+
METADATA = "6620195908089573",
|
|
83
|
+
UNFOLLOW = "7238632346214362",
|
|
84
|
+
FOLLOW = "7871414976211147",
|
|
85
|
+
UNMUTE = "7337137176362961",
|
|
86
|
+
MUTE = "25151904754424642",
|
|
87
|
+
CREATE = "6996806640408138",
|
|
88
|
+
ADMIN_COUNT = "7130823597031706",
|
|
89
|
+
CHANGE_OWNER = "7341777602580933",
|
|
90
|
+
DELETE = "8316537688363079",
|
|
91
|
+
DEMOTE = "6551828931592903"
|
|
92
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueryIds = exports.XWAPaths = exports.MexOperations = void 0;
|
|
4
|
+
var MexOperations;
|
|
5
|
+
(function (MexOperations) {
|
|
6
|
+
MexOperations["PROMOTE"] = "NotificationNewsletterAdminPromote";
|
|
7
|
+
MexOperations["DEMOTE"] = "NotificationNewsletterAdminDemote";
|
|
8
|
+
MexOperations["UPDATE"] = "NotificationNewsletterUpdate";
|
|
9
|
+
})(MexOperations || (exports.MexOperations = MexOperations = {}));
|
|
10
|
+
var XWAPaths;
|
|
11
|
+
(function (XWAPaths) {
|
|
12
|
+
XWAPaths["PROMOTE"] = "xwa2_notify_newsletter_admin_promote";
|
|
13
|
+
XWAPaths["DEMOTE"] = "xwa2_notify_newsletter_admin_demote";
|
|
14
|
+
XWAPaths["ADMIN_COUNT"] = "xwa2_newsletter_admin";
|
|
15
|
+
XWAPaths["CREATE"] = "xwa2_newsletter_create";
|
|
16
|
+
XWAPaths["NEWSLETTER"] = "xwa2_newsletter";
|
|
17
|
+
XWAPaths["METADATA_UPDATE"] = "xwa2_notify_newsletter_on_metadata_update";
|
|
18
|
+
})(XWAPaths || (exports.XWAPaths = XWAPaths = {}));
|
|
19
|
+
var QueryIds;
|
|
20
|
+
(function (QueryIds) {
|
|
21
|
+
QueryIds["JOB_MUTATION"] = "7150902998257522";
|
|
22
|
+
QueryIds["METADATA"] = "6620195908089573";
|
|
23
|
+
QueryIds["UNFOLLOW"] = "7238632346214362";
|
|
24
|
+
QueryIds["FOLLOW"] = "7871414976211147";
|
|
25
|
+
QueryIds["UNMUTE"] = "7337137176362961";
|
|
26
|
+
QueryIds["MUTE"] = "25151904754424642";
|
|
27
|
+
QueryIds["CREATE"] = "6996806640408138";
|
|
28
|
+
QueryIds["ADMIN_COUNT"] = "7130823597031706";
|
|
29
|
+
QueryIds["CHANGE_OWNER"] = "7341777602580933";
|
|
30
|
+
QueryIds["DELETE"] = "8316537688363079";
|
|
31
|
+
QueryIds["DEMOTE"] = "6551828931592903";
|
|
32
|
+
})(QueryIds || (exports.QueryIds = QueryIds = {}));
|
package/lib/Types/Product.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { WAMediaUpload } from './Message';
|
|
2
2
|
export type CatalogResult = {
|
|
3
3
|
data: {
|
|
4
4
|
paging: {
|
|
@@ -76,4 +76,3 @@ export type GetCatalogOptions = {
|
|
|
76
76
|
limit?: number;
|
|
77
77
|
jid?: string;
|
|
78
78
|
};
|
|
79
|
-
//# sourceMappingURL=Product.d.ts.map
|
package/lib/Types/Product.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|