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
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
const SenderChainKey = require('./sender_chain_key');
|
|
2
|
+
const SenderMessageKey = require('./sender_message_key');
|
|
3
|
+
|
|
4
|
+
const protobufs = require('./protobufs');
|
|
5
|
+
|
|
6
|
+
class SenderKeyState {
|
|
7
|
+
MAX_MESSAGE_KEYS = 2000;
|
|
8
|
+
|
|
9
|
+
constructor(
|
|
10
|
+
id = null,
|
|
11
|
+
iteration = null,
|
|
12
|
+
chainKey = null,
|
|
13
|
+
signatureKeyPair = null,
|
|
14
|
+
signatureKeyPublic = null,
|
|
15
|
+
signatureKeyPrivate = null,
|
|
16
|
+
senderKeyStateStructure = null
|
|
17
|
+
) {
|
|
18
|
+
if (senderKeyStateStructure) {
|
|
19
|
+
this.senderKeyStateStructure = senderKeyStateStructure;
|
|
20
|
+
} else {
|
|
21
|
+
if (signatureKeyPair) {
|
|
22
|
+
signatureKeyPublic = signatureKeyPair.public;
|
|
23
|
+
signatureKeyPrivate = signatureKeyPair.private;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
chainKey = typeof chainKey === 'string' ? Buffer.from(chainKey, 'base64') : chainKey;
|
|
27
|
+
this.senderKeyStateStructure = protobufs.SenderKeyStateStructure.create();
|
|
28
|
+
const senderChainKeyStructure = protobufs.SenderChainKey.create();
|
|
29
|
+
senderChainKeyStructure.iteration = iteration;
|
|
30
|
+
senderChainKeyStructure.seed = chainKey;
|
|
31
|
+
this.senderKeyStateStructure.senderChainKey = senderChainKeyStructure;
|
|
32
|
+
|
|
33
|
+
const signingKeyStructure = protobufs.SenderSigningKey.create();
|
|
34
|
+
signingKeyStructure.public =
|
|
35
|
+
typeof signatureKeyPublic === 'string' ?
|
|
36
|
+
Buffer.from(signatureKeyPublic, 'base64') :
|
|
37
|
+
signatureKeyPublic;
|
|
38
|
+
if (signatureKeyPrivate) {
|
|
39
|
+
signingKeyStructure.private =
|
|
40
|
+
typeof signatureKeyPrivate === 'string' ?
|
|
41
|
+
Buffer.from(signatureKeyPrivate, 'base64') :
|
|
42
|
+
signatureKeyPrivate;
|
|
43
|
+
}
|
|
44
|
+
this.senderKeyStateStructure.senderKeyId = id;
|
|
45
|
+
this.senderChainKey = senderChainKeyStructure;
|
|
46
|
+
this.senderKeyStateStructure.senderSigningKey = signingKeyStructure;
|
|
47
|
+
}
|
|
48
|
+
this.senderKeyStateStructure.senderMessageKeys =
|
|
49
|
+
this.senderKeyStateStructure.senderMessageKeys || [];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
SenderKeyState(senderKeyStateStructure) {
|
|
53
|
+
this.senderKeyStateStructure = senderKeyStateStructure;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
getKeyId() {
|
|
57
|
+
return this.senderKeyStateStructure.senderKeyId;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
getSenderChainKey() {
|
|
61
|
+
return new SenderChainKey(
|
|
62
|
+
this.senderKeyStateStructure.senderChainKey.iteration,
|
|
63
|
+
this.senderKeyStateStructure.senderChainKey.seed
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
setSenderChainKey(chainKey) {
|
|
68
|
+
const senderChainKeyStructure = protobufs.SenderChainKey.create({
|
|
69
|
+
iteration: chainKey.getIteration(),
|
|
70
|
+
seed: chainKey.getSeed(),
|
|
71
|
+
});
|
|
72
|
+
this.senderKeyStateStructure.senderChainKey = senderChainKeyStructure;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
getSigningKeyPublic() {
|
|
76
|
+
return typeof this.senderKeyStateStructure.senderSigningKey.public === 'string' ?
|
|
77
|
+
Buffer.from(this.senderKeyStateStructure.senderSigningKey.public, 'base64') :
|
|
78
|
+
this.senderKeyStateStructure.senderSigningKey.public;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
getSigningKeyPrivate() {
|
|
82
|
+
return typeof this.senderKeyStateStructure.senderSigningKey.private === 'string' ?
|
|
83
|
+
Buffer.from(this.senderKeyStateStructure.senderSigningKey.private, 'base64') :
|
|
84
|
+
this.senderKeyStateStructure.senderSigningKey.private;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
hasSenderMessageKey(iteration) {
|
|
88
|
+
const list = this.senderKeyStateStructure.senderMessageKeys;
|
|
89
|
+
for (let o = 0; o < list.length; o++) {
|
|
90
|
+
const senderMessageKey = list[o];
|
|
91
|
+
if (senderMessageKey.iteration === iteration) return true;
|
|
92
|
+
}
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
addSenderMessageKey(senderMessageKey) {
|
|
97
|
+
const senderMessageKeyStructure = protobufs.SenderKeyStateStructure.create({
|
|
98
|
+
iteration: senderMessageKey.getIteration(),
|
|
99
|
+
seed: senderMessageKey.getSeed(),
|
|
100
|
+
});
|
|
101
|
+
this.senderKeyStateStructure.senderMessageKeys.push(senderMessageKeyStructure);
|
|
102
|
+
|
|
103
|
+
if (this.senderKeyStateStructure.senderMessageKeys.length > this.MAX_MESSAGE_KEYS) {
|
|
104
|
+
this.senderKeyStateStructure.senderMessageKeys.shift();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
removeSenderMessageKey(iteration) {
|
|
109
|
+
let result = null;
|
|
110
|
+
|
|
111
|
+
this.senderKeyStateStructure.senderMessageKeys = this.senderKeyStateStructure.senderMessageKeys.filter(
|
|
112
|
+
senderMessageKey => {
|
|
113
|
+
if (senderMessageKey.iteration === iteration) result = senderMessageKey;
|
|
114
|
+
return senderMessageKey.iteration !== iteration;
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
if (result != null) {
|
|
119
|
+
return new SenderMessageKey(result.iteration, result.seed);
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
getStructure() {
|
|
125
|
+
return this.senderKeyStateStructure;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
module.exports = SenderKeyState;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const { deriveSecrets } = require('libsignal/src/crypto');
|
|
2
|
+
class SenderMessageKey {
|
|
3
|
+
iteration = 0;
|
|
4
|
+
|
|
5
|
+
iv = Buffer.alloc(0);
|
|
6
|
+
|
|
7
|
+
cipherKey = Buffer.alloc(0);
|
|
8
|
+
|
|
9
|
+
seed = Buffer.alloc(0);
|
|
10
|
+
|
|
3
11
|
constructor(iteration, seed) {
|
|
4
12
|
const derivative = deriveSecrets(seed, Buffer.alloc(32), Buffer.from('WhisperGroup'));
|
|
5
13
|
const keys = new Uint8Array(32);
|
|
@@ -7,20 +15,25 @@ export class SenderMessageKey {
|
|
|
7
15
|
keys.set(new Uint8Array(derivative[1].slice(0, 16)), 16);
|
|
8
16
|
this.iv = Buffer.from(derivative[0].slice(0, 16));
|
|
9
17
|
this.cipherKey = Buffer.from(keys.buffer);
|
|
18
|
+
|
|
10
19
|
this.iteration = iteration;
|
|
11
20
|
this.seed = seed;
|
|
12
21
|
}
|
|
22
|
+
|
|
13
23
|
getIteration() {
|
|
14
24
|
return this.iteration;
|
|
15
25
|
}
|
|
26
|
+
|
|
16
27
|
getIv() {
|
|
17
28
|
return this.iv;
|
|
18
29
|
}
|
|
30
|
+
|
|
19
31
|
getCipherKey() {
|
|
20
32
|
return this.cipherKey;
|
|
21
33
|
}
|
|
34
|
+
|
|
22
35
|
getSeed() {
|
|
23
36
|
return this.seed;
|
|
24
37
|
}
|
|
25
38
|
}
|
|
26
|
-
|
|
39
|
+
module.exports = SenderMessageKey;
|
package/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const baileys = require('./lib/index.js');
|
|
2
|
+
const { c4ParseContent } = require('./lib/Utils/c4-compat');
|
|
3
|
+
const origMake = baileys.default || baileys.makeWASocket;
|
|
4
|
+
if (origMake) {
|
|
5
|
+
const makeWASocket = (...args) => {
|
|
6
|
+
const sock = (baileys.default || origMake)(...args);
|
|
7
|
+
const origSend = sock.sendMessage.bind(sock);
|
|
8
|
+
sock.sendMessage = async (jid, content, opts) => {
|
|
9
|
+
if (content) content = c4ParseContent(content);
|
|
10
|
+
return origSend(jid, content, opts);
|
|
11
|
+
};
|
|
12
|
+
return sock;
|
|
13
|
+
};
|
|
14
|
+
baileys.default = makeWASocket;
|
|
15
|
+
baileys.makeWASocket = makeWASocket;
|
|
16
|
+
}
|
|
17
|
+
module.exports = baileys;
|
package/lib/Defaults/index.d.ts
CHANGED
|
@@ -1,39 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { proto } from '../../WAProto';
|
|
4
|
+
import type { MediaType, SocketConfig } from '../Types';
|
|
3
5
|
export declare const UNAUTHORIZED_CODES: number[];
|
|
4
6
|
export declare const DEFAULT_ORIGIN = "https://web.whatsapp.com";
|
|
5
|
-
export declare const CALL_VIDEO_PREFIX = "https://call.whatsapp.com/video/";
|
|
6
|
-
export declare const CALL_AUDIO_PREFIX = "https://call.whatsapp.com/voice/";
|
|
7
7
|
export declare const DEF_CALLBACK_PREFIX = "CB:";
|
|
8
8
|
export declare const DEF_TAG_PREFIX = "TAG:";
|
|
9
9
|
export declare const PHONE_CONNECTION_CB = "CB:Pong";
|
|
10
|
-
export declare const WA_ADV_ACCOUNT_SIG_PREFIX: Buffer<ArrayBuffer>;
|
|
11
|
-
export declare const WA_ADV_DEVICE_SIG_PREFIX: Buffer<ArrayBuffer>;
|
|
12
|
-
export declare const WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX: Buffer<ArrayBuffer>;
|
|
13
|
-
export declare const WA_ADV_HOSTED_DEVICE_SIG_PREFIX: Buffer<ArrayBuffer>;
|
|
14
10
|
export declare const WA_DEFAULT_EPHEMERAL: number;
|
|
15
|
-
/** Status messages older than 24 hours are considered expired */
|
|
16
|
-
export declare const STATUS_EXPIRY_SECONDS: number;
|
|
17
|
-
/** WA Web enforces a 14-day maximum age for placeholder resend requests */
|
|
18
|
-
export declare const PLACEHOLDER_MAX_AGE_SECONDS: number;
|
|
19
11
|
export declare const NOISE_MODE = "Noise_XX_25519_AESGCM_SHA256\0\0\0\0";
|
|
20
|
-
export declare const DICT_VERSION =
|
|
21
|
-
export declare const KEY_BUNDLE_TYPE: Buffer
|
|
22
|
-
export declare const NOISE_WA_HEADER: Buffer
|
|
12
|
+
export declare const DICT_VERSION = 2;
|
|
13
|
+
export declare const KEY_BUNDLE_TYPE: Buffer;
|
|
14
|
+
export declare const NOISE_WA_HEADER: Buffer;
|
|
23
15
|
/** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
|
|
24
16
|
export declare const URL_REGEX: RegExp;
|
|
25
17
|
export declare const WA_CERT_DETAILS: {
|
|
26
18
|
SERIAL: number;
|
|
27
|
-
ISSUER: string;
|
|
28
|
-
PUBLIC_KEY: Buffer<ArrayBuffer>;
|
|
29
|
-
};
|
|
30
|
-
export declare const PROCESSABLE_HISTORY_TYPES: proto.HistorySync.HistorySyncType[];
|
|
31
|
-
export declare const DEFAULT_CACHE_TTLS: {
|
|
32
|
-
SIGNAL_STORE: number;
|
|
33
|
-
MSG_RETRY: number;
|
|
34
|
-
CALL_OFFER: number;
|
|
35
|
-
USER_DEVICES: number;
|
|
36
19
|
};
|
|
20
|
+
export declare const PROCESSABLE_HISTORY_TYPES: proto.Message.HistorySyncNotification.HistorySyncType[];
|
|
37
21
|
export declare const DEFAULT_CONNECTION_CONFIG: SocketConfig;
|
|
38
22
|
export declare const MEDIA_PATH_MAP: {
|
|
39
23
|
[T in MediaType]?: string;
|
|
@@ -57,19 +41,13 @@ export declare const MEDIA_HKDF_KEY_MAPPING: {
|
|
|
57
41
|
'product-catalog-image': string;
|
|
58
42
|
'payment-bg-image': string;
|
|
59
43
|
ptv: string;
|
|
60
|
-
'biz-cover-photo': string;
|
|
61
44
|
};
|
|
62
|
-
export
|
|
63
|
-
export declare const MEDIA_KEYS: MediaType[];
|
|
64
|
-
/** 120s timeout for history sync stall detection, same as WA Web's handleChunkProgress / restartPausedTimer (g = 120) */
|
|
65
|
-
export declare const HISTORY_SYNC_PAUSED_TIMEOUT_MS = 120000;
|
|
45
|
+
export declare const MEDIA_KEYS: ("ppic" | "product" | "image" | "video" | "sticker" | "audio" | "gif" | "ptt" | "thumbnail-document" | "thumbnail-image" | "thumbnail-link" | "thumbnail-video" | "md-app-state" | "md-msg-hist" | "document" | "product-catalog-image" | "payment-bg-image" | "ptv")[];
|
|
66
46
|
export declare const MIN_PREKEY_COUNT = 5;
|
|
67
|
-
export declare const INITIAL_PREKEY_COUNT =
|
|
68
|
-
export declare const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
Week: number;
|
|
47
|
+
export declare const INITIAL_PREKEY_COUNT = 30;
|
|
48
|
+
export declare const DEFAULT_CACHE_TTLS: {
|
|
49
|
+
SIGNAL_STORE: number;
|
|
50
|
+
MSG_RETRY: number;
|
|
51
|
+
CALL_OFFER: number;
|
|
52
|
+
USER_DEVICES: number;
|
|
74
53
|
};
|
|
75
|
-
//# sourceMappingURL=index.d.ts.map
|
package/lib/Defaults/index.js
CHANGED
|
@@ -1,57 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export const NOISE_MODE = 'Noise_XX_25519_AESGCM_SHA256\0\0\0\0';
|
|
23
|
-
export const DICT_VERSION = 3;
|
|
24
|
-
export const KEY_BUNDLE_TYPE = Buffer.from([5]);
|
|
25
|
-
export const NOISE_WA_HEADER = Buffer.from([87, 65, 6, DICT_VERSION]); // last is "DICT_VERSION"
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DEFAULT_CACHE_TTLS = exports.INITIAL_PREKEY_COUNT = exports.MIN_PREKEY_COUNT = exports.MEDIA_KEYS = exports.MEDIA_HKDF_KEY_MAPPING = exports.MEDIA_PATH_MAP = exports.DEFAULT_CONNECTION_CONFIG = exports.PROCESSABLE_HISTORY_TYPES = exports.WA_CERT_DETAILS = exports.URL_REGEX = exports.NOISE_WA_HEADER = exports.KEY_BUNDLE_TYPE = exports.DICT_VERSION = exports.NOISE_MODE = exports.WA_DEFAULT_EPHEMERAL = exports.PHONE_CONNECTION_CB = exports.DEF_TAG_PREFIX = exports.DEF_CALLBACK_PREFIX = exports.DEFAULT_ORIGIN = exports.UNAUTHORIZED_CODES = void 0;
|
|
7
|
+
const WAProto_1 = require("../../WAProto");
|
|
8
|
+
const libsignal_1 = require("../Signal/libsignal");
|
|
9
|
+
const Utils_1 = require("../Utils");
|
|
10
|
+
const logger_1 = __importDefault(require("../Utils/logger"));
|
|
11
|
+
const baileys_version_json_1 = require("./baileys-version.json");
|
|
12
|
+
exports.UNAUTHORIZED_CODES = [401, 403, 419];
|
|
13
|
+
exports.DEFAULT_ORIGIN = 'https://web.whatsapp.com';
|
|
14
|
+
exports.DEF_CALLBACK_PREFIX = 'CB:';
|
|
15
|
+
exports.DEF_TAG_PREFIX = 'TAG:';
|
|
16
|
+
exports.PHONE_CONNECTION_CB = 'CB:Pong';
|
|
17
|
+
exports.WA_DEFAULT_EPHEMERAL = 7 * 24 * 60 * 60;
|
|
18
|
+
exports.NOISE_MODE = 'Noise_XX_25519_AESGCM_SHA256\0\0\0\0';
|
|
19
|
+
exports.DICT_VERSION = 2;
|
|
20
|
+
exports.KEY_BUNDLE_TYPE = Buffer.from([5]);
|
|
21
|
+
exports.NOISE_WA_HEADER = Buffer.from([87, 65, 6, exports.DICT_VERSION]); // last is "DICT_VERSION"
|
|
26
22
|
/** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
exports.URL_REGEX = /https:\/\/(?![^:@\/\s]+:[^:@\/\s]+@)[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(:\d+)?(\/[^\s]*)?/g;
|
|
24
|
+
exports.WA_CERT_DETAILS = {
|
|
29
25
|
SERIAL: 0,
|
|
30
|
-
ISSUER: 'WhatsAppLongTerm1',
|
|
31
|
-
PUBLIC_KEY: Buffer.from('142375574d0a587166aae71ebe516437c4a28b73e3695c6ce1f7f9545da8ee6b', 'hex')
|
|
32
26
|
};
|
|
33
|
-
|
|
34
|
-
proto.
|
|
35
|
-
proto.
|
|
36
|
-
proto.
|
|
37
|
-
proto.
|
|
38
|
-
proto.
|
|
39
|
-
proto.HistorySync.HistorySyncType.NON_BLOCKING_DATA,
|
|
40
|
-
proto.HistorySync.HistorySyncType.INITIAL_STATUS_V3
|
|
27
|
+
exports.PROCESSABLE_HISTORY_TYPES = [
|
|
28
|
+
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.INITIAL_BOOTSTRAP,
|
|
29
|
+
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.PUSH_NAME,
|
|
30
|
+
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.RECENT,
|
|
31
|
+
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.FULL,
|
|
32
|
+
WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.ON_DEMAND,
|
|
41
33
|
];
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
CALL_OFFER: 5 * 60, // 5 minutes
|
|
46
|
-
USER_DEVICES: 5 * 60 // 5 minutes
|
|
47
|
-
};
|
|
48
|
-
export const DEFAULT_CONNECTION_CONFIG = {
|
|
49
|
-
version: version,
|
|
50
|
-
browser: Browsers.macOS('Chrome'),
|
|
34
|
+
exports.DEFAULT_CONNECTION_CONFIG = {
|
|
35
|
+
version: baileys_version_json_1.version,
|
|
36
|
+
browser: Utils_1.Browsers.ubuntu('Chrome'),
|
|
51
37
|
waWebSocketUrl: 'wss://web.whatsapp.com/ws/chat',
|
|
52
38
|
connectTimeoutMs: 20000,
|
|
53
39
|
keepAliveIntervalMs: 30000,
|
|
54
|
-
logger:
|
|
40
|
+
logger: logger_1.default.child({ class: 'baileys' }),
|
|
41
|
+
printQRInTerminal: false,
|
|
55
42
|
emitOwnEvents: true,
|
|
56
43
|
defaultQueryTimeoutMs: 60000,
|
|
57
44
|
customUploadHosts: [],
|
|
@@ -60,28 +47,26 @@ export const DEFAULT_CONNECTION_CONFIG = {
|
|
|
60
47
|
fireInitQueries: true,
|
|
61
48
|
auth: undefined,
|
|
62
49
|
markOnlineOnConnect: true,
|
|
63
|
-
syncFullHistory:
|
|
50
|
+
syncFullHistory: false,
|
|
64
51
|
patchMessageBeforeSending: msg => msg,
|
|
65
|
-
shouldSyncHistoryMessage: (
|
|
66
|
-
return syncType !== proto.HistorySync.HistorySyncType.FULL;
|
|
67
|
-
},
|
|
52
|
+
shouldSyncHistoryMessage: () => true,
|
|
68
53
|
shouldIgnoreJid: () => false,
|
|
69
54
|
linkPreviewImageThumbnailWidth: 192,
|
|
70
55
|
transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 3000 },
|
|
71
56
|
generateHighQualityLinkPreview: false,
|
|
72
|
-
enableAutoSessionRecreation: true,
|
|
73
|
-
enableRecentMessageCache: true,
|
|
74
57
|
options: {},
|
|
75
58
|
appStateMacVerification: {
|
|
76
59
|
patch: false,
|
|
77
|
-
snapshot: false
|
|
60
|
+
snapshot: false,
|
|
78
61
|
},
|
|
79
62
|
countryCode: 'US',
|
|
80
63
|
getMessage: async () => undefined,
|
|
81
64
|
cachedGroupMetadata: async () => undefined,
|
|
82
|
-
|
|
65
|
+
generateMessageID: () => undefined,
|
|
66
|
+
generateMessageIDV2: () => undefined,
|
|
67
|
+
makeSignalRepository: libsignal_1.makeLibSignalRepository
|
|
83
68
|
};
|
|
84
|
-
|
|
69
|
+
exports.MEDIA_PATH_MAP = {
|
|
85
70
|
image: '/mms/image',
|
|
86
71
|
video: '/mms/video',
|
|
87
72
|
document: '/mms/document',
|
|
@@ -91,18 +76,17 @@ export const MEDIA_PATH_MAP = {
|
|
|
91
76
|
'product-catalog-image': '/product/image',
|
|
92
77
|
'md-app-state': '',
|
|
93
78
|
'md-msg-hist': '/mms/md-app-state',
|
|
94
|
-
'biz-cover-photo': '/pps/biz-cover-photo'
|
|
95
79
|
};
|
|
96
|
-
|
|
97
|
-
audio: 'Audio',
|
|
98
|
-
document: 'Document',
|
|
99
|
-
gif: 'Video',
|
|
100
|
-
image: 'Image',
|
|
101
|
-
ppic: '',
|
|
102
|
-
product: 'Image',
|
|
103
|
-
ptt: 'Audio',
|
|
104
|
-
sticker: 'Image',
|
|
105
|
-
video: 'Video',
|
|
80
|
+
exports.MEDIA_HKDF_KEY_MAPPING = {
|
|
81
|
+
'audio': 'Audio',
|
|
82
|
+
'document': 'Document',
|
|
83
|
+
'gif': 'Video',
|
|
84
|
+
'image': 'Image',
|
|
85
|
+
'ppic': '',
|
|
86
|
+
'product': 'Image',
|
|
87
|
+
'ptt': 'Audio',
|
|
88
|
+
'sticker': 'Image',
|
|
89
|
+
'video': 'Video',
|
|
106
90
|
'thumbnail-document': 'Document Thumbnail',
|
|
107
91
|
'thumbnail-image': 'Image Thumbnail',
|
|
108
92
|
'thumbnail-video': 'Video Thumbnail',
|
|
@@ -111,19 +95,14 @@ export const MEDIA_HKDF_KEY_MAPPING = {
|
|
|
111
95
|
'md-app-state': 'App State',
|
|
112
96
|
'product-catalog-image': '',
|
|
113
97
|
'payment-bg-image': 'Payment Background',
|
|
114
|
-
ptv: 'Video'
|
|
115
|
-
'biz-cover-photo': 'Image'
|
|
98
|
+
'ptv': 'Video'
|
|
116
99
|
};
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
Hour: 60 * 60 * 1000,
|
|
126
|
-
Day: 24 * 60 * 60 * 1000,
|
|
127
|
-
Week: 7 * 24 * 60 * 60 * 1000
|
|
100
|
+
exports.MEDIA_KEYS = Object.keys(exports.MEDIA_PATH_MAP);
|
|
101
|
+
exports.MIN_PREKEY_COUNT = 5;
|
|
102
|
+
exports.INITIAL_PREKEY_COUNT = 30;
|
|
103
|
+
exports.DEFAULT_CACHE_TTLS = {
|
|
104
|
+
SIGNAL_STORE: 10 * 60,
|
|
105
|
+
MSG_RETRY: 60 * 60,
|
|
106
|
+
CALL_OFFER: 5 * 60,
|
|
107
|
+
USER_DEVICES: 5 * 60, // 5 minutes
|
|
128
108
|
};
|
|
129
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export declare function makeLibSignalRepository(auth: SignalAuthState, logger: ILogger, pnToLIDFunc?: (jids: string[]) => Promise<LIDMapping[] | undefined>): SignalRepositoryWithLIDStore;
|
|
5
|
-
//# sourceMappingURL=libsignal.d.ts.map
|
|
1
|
+
import { SignalAuthState } from '../Types';
|
|
2
|
+
import { SignalRepository } from '../Types/Signal';
|
|
3
|
+
export declare function makeLibSignalRepository(auth: SignalAuthState): SignalRepository;
|