@eduh_dev021/baileys 0.0.0-stage → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +23 -0
- package/README.md +1843 -2
- package/WAProto/index.d.ts +22220 -0
- package/WAProto/index.js +5 -0
- package/cjs/WAProto/index.d.ts +22220 -0
- package/cjs/WAProto/index.js +60125 -0
- package/cjs/engine-requirements.js +12 -0
- package/cjs/lib/Addon/cache.js +179 -0
- package/cjs/lib/Addon/crc32.js +41 -0
- package/cjs/lib/Addon/file-type.js +217 -0
- package/cjs/lib/Addon/get-file.js +99 -0
- package/cjs/lib/Addon/http-error.d.ts +18 -0
- package/cjs/lib/Addon/http-error.js +66 -0
- package/cjs/lib/Addon/index.d.ts +96 -0
- package/cjs/lib/Addon/index.js +58 -0
- package/cjs/lib/Addon/keyed-db.d.ts +14 -0
- package/cjs/lib/Addon/keyed-db.js +264 -0
- package/cjs/lib/Addon/link-preview.d.ts +15 -0
- package/cjs/lib/Addon/link-preview.js +104 -0
- package/cjs/lib/Addon/media-info.js +98 -0
- package/cjs/lib/Addon/mutex.js +78 -0
- package/cjs/lib/Addon/qr.js +464 -0
- package/cjs/lib/Addon/queue.js +54 -0
- package/cjs/lib/Addon/waveform.js +130 -0
- package/cjs/lib/Addon/zip.js +136 -0
- package/cjs/lib/Defaults/index.d.ts +184 -0
- package/cjs/lib/Defaults/index.js +292 -0
- package/cjs/lib/Signal/Group/ciphertext-message.d.ts +9 -0
- package/cjs/lib/Signal/Group/ciphertext-message.js +37 -0
- package/cjs/lib/Signal/Group/group-cipher.d.ts +10 -0
- package/cjs/lib/Signal/Group/group-cipher.js +105 -0
- package/cjs/lib/Signal/Group/group-session-builder.d.ts +7 -0
- package/cjs/lib/Signal/Group/group-session-builder.js +65 -0
- package/cjs/lib/Signal/Group/index.d.ts +11 -0
- package/cjs/lib/Signal/Group/index.js +67 -0
- package/cjs/lib/Signal/Group/keyhelper.d.ts +6 -0
- package/cjs/lib/Signal/Group/keyhelper.js +47 -0
- package/cjs/lib/Signal/Group/sender-chain-key.d.ts +13 -0
- package/cjs/lib/Signal/Group/sender-chain-key.js +51 -0
- package/cjs/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
- package/cjs/lib/Signal/Group/sender-key-distribution-message.js +80 -0
- package/cjs/lib/Signal/Group/sender-key-message.d.ts +18 -0
- package/cjs/lib/Signal/Group/sender-key-message.js +87 -0
- package/cjs/lib/Signal/Group/sender-key-name.d.ts +11 -0
- package/cjs/lib/Signal/Group/sender-key-name.js +73 -0
- package/cjs/lib/Signal/Group/sender-key-record.d.ts +12 -0
- package/cjs/lib/Signal/Group/sender-key-record.js +66 -0
- package/cjs/lib/Signal/Group/sender-key-state.d.ts +16 -0
- package/cjs/lib/Signal/Group/sender-key-state.js +106 -0
- package/cjs/lib/Signal/Group/sender-message-key.d.ts +11 -0
- package/cjs/lib/Signal/Group/sender-message-key.js +51 -0
- package/cjs/lib/Signal/libsignal.d.ts +54 -0
- package/cjs/lib/Signal/libsignal.js +421 -0
- package/cjs/lib/Signal/lid-mapping.d.ts +20 -0
- package/cjs/lib/Signal/lid-mapping.js +292 -0
- package/cjs/lib/Socket/Client/index.d.ts +2 -0
- package/cjs/lib/Socket/Client/index.js +23 -0
- package/cjs/lib/Socket/Client/types.d.ts +5 -0
- package/cjs/lib/Socket/Client/types.js +36 -0
- package/cjs/lib/Socket/Client/websocket.d.ts +12 -0
- package/cjs/lib/Socket/Client/websocket.js +143 -0
- package/cjs/lib/Socket/business.d.ts +387 -0
- package/cjs/lib/Socket/business.js +402 -0
- package/cjs/lib/Socket/chats.d.ts +144 -0
- package/cjs/lib/Socket/chats.js +1118 -0
- package/cjs/lib/Socket/communities.d.ts +554 -0
- package/cjs/lib/Socket/communities.js +456 -0
- package/cjs/lib/Socket/groups.d.ts +286 -0
- package/cjs/lib/Socket/groups.js +366 -0
- package/cjs/lib/Socket/index.d.ts +522 -0
- package/cjs/lib/Socket/index.js +32 -0
- package/cjs/lib/Socket/messages-recv.d.ts +326 -0
- package/cjs/lib/Socket/messages-recv.js +1670 -0
- package/cjs/lib/Socket/messages-send.d.ts +321 -0
- package/cjs/lib/Socket/messages-send.js +1252 -0
- package/cjs/lib/Socket/mex.d.ts +1 -0
- package/cjs/lib/Socket/mex.js +65 -0
- package/cjs/lib/Socket/newsletter.d.ts +283 -0
- package/cjs/lib/Socket/newsletter.js +243 -0
- package/cjs/lib/Socket/socket.d.ts +61 -0
- package/cjs/lib/Socket/socket.js +908 -0
- package/cjs/lib/Store/index.d.ts +3 -0
- package/cjs/lib/Store/index.js +25 -0
- package/cjs/lib/Store/make-in-memory-store.d.ts +63 -0
- package/cjs/lib/Store/make-in-memory-store.js +431 -0
- package/cjs/lib/Store/make-ordered-dictionary.d.ts +12 -0
- package/cjs/lib/Store/make-ordered-dictionary.js +101 -0
- package/cjs/lib/Store/object-repository.d.ts +10 -0
- package/cjs/lib/Store/object-repository.js +49 -0
- package/cjs/lib/Transport/crypto.d.ts +6 -0
- package/cjs/lib/Transport/crypto.js +107 -0
- package/cjs/lib/Transport/curve.d.ts +8 -0
- package/cjs/lib/Transport/curve.js +94 -0
- package/cjs/lib/Transport/index.d.ts +16 -0
- package/cjs/lib/Transport/index.js +67 -0
- package/cjs/lib/Transport/internals.d.ts +57 -0
- package/cjs/lib/Transport/internals.js +203 -0
- package/cjs/lib/Transport/session-builder.d.ts +40 -0
- package/cjs/lib/Transport/session-builder.js +169 -0
- package/cjs/lib/Transport/session-cipher.d.ts +26 -0
- package/cjs/lib/Transport/session-cipher.js +328 -0
- package/cjs/lib/Transport/session-record.d.ts +55 -0
- package/cjs/lib/Transport/session-record.js +289 -0
- package/cjs/lib/Types/Auth.d.ts +1 -0
- package/cjs/lib/Types/Auth.js +15 -0
- package/cjs/lib/Types/Bussines.d.ts +1 -0
- package/cjs/lib/Types/Bussines.js +15 -0
- package/cjs/lib/Types/Call.d.ts +1 -0
- package/cjs/lib/Types/Call.js +15 -0
- package/cjs/lib/Types/Chat.d.ts +1 -0
- package/cjs/lib/Types/Chat.js +33 -0
- package/cjs/lib/Types/Contact.d.ts +1 -0
- package/cjs/lib/Types/Contact.js +15 -0
- package/cjs/lib/Types/Events.d.ts +1 -0
- package/cjs/lib/Types/Events.js +1 -0
- package/cjs/lib/Types/GroupMetadata.d.ts +1 -0
- package/cjs/lib/Types/GroupMetadata.js +15 -0
- package/cjs/lib/Types/Label.d.ts +2 -0
- package/cjs/lib/Types/Label.js +49 -0
- package/cjs/lib/Types/LabelAssociation.d.ts +2 -0
- package/cjs/lib/Types/LabelAssociation.js +31 -0
- package/cjs/lib/Types/Message.d.ts +11 -0
- package/cjs/lib/Types/Message.js +58 -0
- package/cjs/lib/Types/Mex.d.ts +2 -0
- package/cjs/lib/Types/Mex.js +66 -0
- package/cjs/lib/Types/Product.d.ts +1 -0
- package/cjs/lib/Types/Product.js +15 -0
- package/cjs/lib/Types/RichType.d.ts +2 -0
- package/cjs/lib/Types/RichType.js +50 -0
- package/cjs/lib/Types/Signal.d.ts +1 -0
- package/cjs/lib/Types/Signal.js +1 -0
- package/cjs/lib/Types/Socket.d.ts +1 -0
- package/cjs/lib/Types/Socket.js +1 -0
- package/cjs/lib/Types/State.d.ts +5 -0
- package/cjs/lib/Types/State.js +83 -0
- package/cjs/lib/Types/USync.d.ts +1 -0
- package/cjs/lib/Types/USync.js +1 -0
- package/cjs/lib/Types/index.d.ts +13 -0
- package/cjs/lib/Types/index.js +64 -0
- package/cjs/lib/Utils/auth-utils.d.ts +58 -0
- package/cjs/lib/Utils/auth-utils.js +275 -0
- package/cjs/lib/Utils/browser-utils.d.ts +9 -0
- package/cjs/lib/Utils/browser-utils.js +56 -0
- package/cjs/lib/Utils/business.d.ts +49 -0
- package/cjs/lib/Utils/business.js +259 -0
- package/cjs/lib/Utils/chat-utils.d.ts +408 -0
- package/cjs/lib/Utils/chat-utils.js +821 -0
- package/cjs/lib/Utils/companion-reg-client-utils.d.ts +4 -0
- package/cjs/lib/Utils/companion-reg-client-utils.js +71 -0
- package/cjs/lib/Utils/crypto.d.ts +39 -0
- package/cjs/lib/Utils/crypto.js +155 -0
- package/cjs/lib/Utils/decode-wa-message.d.ts +83 -0
- package/cjs/lib/Utils/decode-wa-message.js +316 -0
- package/cjs/lib/Utils/event-buffer.d.ts +12 -0
- package/cjs/lib/Utils/event-buffer.js +605 -0
- package/cjs/lib/Utils/generics.d.ts +63 -0
- package/cjs/lib/Utils/generics.js +440 -0
- package/cjs/lib/Utils/history.d.ts +75 -0
- package/cjs/lib/Utils/history.js +153 -0
- package/cjs/lib/Utils/identity-change-handler.d.ts +13 -0
- package/cjs/lib/Utils/identity-change-handler.js +73 -0
- package/cjs/lib/Utils/index.d.ts +24 -0
- package/cjs/lib/Utils/index.js +67 -0
- package/cjs/lib/Utils/link-preview.d.ts +13 -0
- package/cjs/lib/Utils/link-preview.js +87 -0
- package/cjs/lib/Utils/logger.d.ts +12 -0
- package/cjs/lib/Utils/logger.js +40 -0
- package/cjs/lib/Utils/lt-hash.d.ts +6 -0
- package/cjs/lib/Utils/lt-hash.js +28 -0
- package/cjs/lib/Utils/make-mutex.d.ts +6 -0
- package/cjs/lib/Utils/make-mutex.js +58 -0
- package/cjs/lib/Utils/message-retry-manager.d.ts +79 -0
- package/cjs/lib/Utils/message-retry-manager.js +274 -0
- package/cjs/lib/Utils/messages-media.d.ts +134 -0
- package/cjs/lib/Utils/messages-media.js +799 -0
- package/cjs/lib/Utils/messages.d.ts +47 -0
- package/cjs/lib/Utils/messages.js +1667 -0
- package/cjs/lib/Utils/noise-handler.d.ts +20 -0
- package/cjs/lib/Utils/noise-handler.js +223 -0
- package/cjs/lib/Utils/offline-node-processor.d.ts +10 -0
- package/cjs/lib/Utils/offline-node-processor.js +60 -0
- package/cjs/lib/Utils/pre-key-manager.d.ts +25 -0
- package/cjs/lib/Utils/pre-key-manager.js +116 -0
- package/cjs/lib/Utils/process-message.d.ts +83 -0
- package/cjs/lib/Utils/process-message.js +607 -0
- package/cjs/lib/Utils/reporting-utils.d.ts +12 -0
- package/cjs/lib/Utils/reporting-utils.js +282 -0
- package/cjs/lib/Utils/rich-message-utils.d.ts +48 -0
- package/cjs/lib/Utils/rich-message-utils.js +381 -0
- package/cjs/lib/Utils/signal.d.ts +82 -0
- package/cjs/lib/Utils/signal.js +232 -0
- package/cjs/lib/Utils/stanza-ack.d.ts +16 -0
- package/cjs/lib/Utils/stanza-ack.js +53 -0
- package/cjs/lib/Utils/sync-action-utils.d.ts +2 -0
- package/cjs/lib/Utils/sync-action-utils.js +68 -0
- package/cjs/lib/Utils/tc-token-utils.d.ts +29 -0
- package/cjs/lib/Utils/tc-token-utils.js +182 -0
- package/cjs/lib/Utils/use-multi-file-auth-state.d.ts +10 -0
- package/cjs/lib/Utils/use-multi-file-auth-state.js +135 -0
- package/cjs/lib/Utils/use-single-file-auth-state.d.ts +11 -0
- package/cjs/lib/Utils/use-single-file-auth-state.js +115 -0
- package/cjs/lib/Utils/use-sqlite-auth-state.d.ts +11 -0
- package/cjs/lib/Utils/use-sqlite-auth-state.js +140 -0
- package/cjs/lib/Utils/validate-connection.d.ts +44 -0
- package/cjs/lib/Utils/validate-connection.js +229 -0
- package/cjs/lib/WABinary/constants.d.ts +61 -0
- package/cjs/lib/WABinary/constants.js +1992 -0
- package/cjs/lib/WABinary/decode.d.ts +9 -0
- package/cjs/lib/WABinary/decode.js +292 -0
- package/cjs/lib/WABinary/encode.d.ts +2 -0
- package/cjs/lib/WABinary/encode.js +240 -0
- package/cjs/lib/WABinary/generic-utils.d.ts +79 -0
- package/cjs/lib/WABinary/generic-utils.js +252 -0
- package/cjs/lib/WABinary/index.d.ts +5 -0
- package/cjs/lib/WABinary/index.js +29 -0
- package/cjs/lib/WABinary/jid-utils.d.ts +28 -0
- package/cjs/lib/WABinary/jid-utils.js +151 -0
- package/cjs/lib/WABinary/types.d.ts +1 -0
- package/cjs/lib/WABinary/types.js +23 -0
- package/cjs/lib/WACrypto/appstate-keys.js +39 -0
- package/cjs/lib/WACrypto/curves/constants.js +37 -0
- package/cjs/lib/WACrypto/hkdf.js +38 -0
- package/cjs/lib/WACrypto/index.js +51 -0
- package/cjs/lib/WACrypto/lthash.js +59 -0
- package/cjs/lib/WACrypto/math/constants.js +53 -0
- package/cjs/lib/WACrypto/math/edwards.js +206 -0
- package/cjs/lib/WACrypto/math/fe.js +449 -0
- package/cjs/lib/WACrypto/math/le.js +44 -0
- package/cjs/lib/WACrypto/math/mod.js +36 -0
- package/cjs/lib/WACrypto/util/bytes.js +348 -0
- package/cjs/lib/WACrypto/x25519.js +157 -0
- package/cjs/lib/WACrypto/xeddsa.js +134 -0
- package/cjs/lib/WAM/BinaryInfo.d.ts +7 -0
- package/cjs/lib/WAM/BinaryInfo.js +35 -0
- package/cjs/lib/WAM/constants.d.ts +34926 -0
- package/cjs/lib/WAM/constants.js +22890 -0
- package/cjs/lib/WAM/encode.d.ts +1 -0
- package/cjs/lib/WAM/encode.js +162 -0
- package/cjs/lib/WAM/index.d.ts +3 -0
- package/cjs/lib/WAM/index.js +25 -0
- package/cjs/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +36 -0
- package/cjs/lib/WAUSync/Protocols/USyncContactProtocol.js +77 -0
- package/cjs/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
- package/cjs/lib/WAUSync/Protocols/USyncDeviceProtocol.js +76 -0
- package/cjs/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
- package/cjs/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +52 -0
- package/cjs/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
- package/cjs/lib/WAUSync/Protocols/USyncStatusProtocol.js +61 -0
- package/cjs/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +9 -0
- package/cjs/lib/WAUSync/Protocols/USyncUsernameProtocol.js +50 -0
- package/cjs/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +38 -0
- package/cjs/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +76 -0
- package/cjs/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +14 -0
- package/cjs/lib/WAUSync/Protocols/UsyncLIDProtocol.js +53 -0
- package/cjs/lib/WAUSync/Protocols/index.d.ts +5 -0
- package/cjs/lib/WAUSync/Protocols/index.js +29 -0
- package/cjs/lib/WAUSync/USyncQuery.d.ts +20 -0
- package/cjs/lib/WAUSync/USyncQuery.js +113 -0
- package/cjs/lib/WAUSync/USyncUser.d.ts +16 -0
- package/cjs/lib/WAUSync/USyncUser.js +56 -0
- package/cjs/lib/WAUSync/index.d.ts +3 -0
- package/cjs/lib/WAUSync/index.js +25 -0
- package/cjs/lib/index.d.ts +11 -0
- package/cjs/lib/index.js +56 -0
- package/cjs/package.json +3 -0
- package/engine-requirements.js +12 -0
- package/lib/Addon/cache.js +201 -0
- package/lib/Addon/crc32.js +21 -0
- package/lib/Addon/file-type.js +198 -0
- package/lib/Addon/get-file.js +98 -0
- package/lib/Addon/http-error.d.ts +18 -0
- package/lib/Addon/http-error.js +40 -0
- package/lib/Addon/index.d.ts +96 -0
- package/lib/Addon/index.js +26 -0
- package/lib/Addon/keyed-db.d.ts +14 -0
- package/lib/Addon/keyed-db.js +241 -0
- package/lib/Addon/link-preview.d.ts +15 -0
- package/lib/Addon/link-preview.js +79 -0
- package/lib/Addon/media-info.js +96 -0
- package/lib/Addon/mutex.js +76 -0
- package/lib/Addon/qr.js +531 -0
- package/lib/Addon/queue.js +44 -0
- package/lib/Addon/waveform.js +135 -0
- package/lib/Addon/zip.js +144 -0
- package/lib/Defaults/index.d.ts +184 -0
- package/lib/Defaults/index.js +181 -0
- package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
- package/lib/Signal/Group/ciphertext-message.js +11 -0
- package/lib/Signal/Group/group-cipher.d.ts +10 -0
- package/lib/Signal/Group/group-cipher.js +81 -0
- package/lib/Signal/Group/group-session-builder.d.ts +7 -0
- package/lib/Signal/Group/group-session-builder.js +29 -0
- package/lib/Signal/Group/index.d.ts +11 -0
- package/lib/Signal/Group/index.js +11 -0
- package/lib/Signal/Group/keyhelper.d.ts +6 -0
- package/lib/Signal/Group/keyhelper.js +17 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +13 -0
- package/lib/Signal/Group/sender-chain-key.js +25 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +62 -0
- package/lib/Signal/Group/sender-key-message.d.ts +18 -0
- package/lib/Signal/Group/sender-key-message.js +65 -0
- package/lib/Signal/Group/sender-key-name.d.ts +11 -0
- package/lib/Signal/Group/sender-key-name.js +47 -0
- package/lib/Signal/Group/sender-key-record.d.ts +12 -0
- package/lib/Signal/Group/sender-key-record.js +40 -0
- package/lib/Signal/Group/sender-key-state.d.ts +16 -0
- package/lib/Signal/Group/sender-key-state.js +83 -0
- package/lib/Signal/Group/sender-message-key.d.ts +11 -0
- package/lib/Signal/Group/sender-message-key.js +25 -0
- package/lib/Signal/libsignal.d.ts +54 -0
- package/lib/Signal/libsignal.js +426 -0
- package/lib/Signal/lid-mapping.d.ts +20 -0
- package/lib/Signal/lid-mapping.js +274 -0
- package/lib/Socket/Client/index.d.ts +2 -0
- package/lib/Socket/Client/index.js +2 -0
- package/lib/Socket/Client/types.d.ts +5 -0
- package/lib/Socket/Client/types.js +10 -0
- package/lib/Socket/Client/websocket.d.ts +12 -0
- package/lib/Socket/Client/websocket.js +119 -0
- package/lib/Socket/business.d.ts +387 -0
- package/lib/Socket/business.js +379 -0
- package/lib/Socket/chats.d.ts +144 -0
- package/lib/Socket/chats.js +1216 -0
- package/lib/Socket/communities.d.ts +554 -0
- package/lib/Socket/communities.js +431 -0
- package/lib/Socket/groups.d.ts +286 -0
- package/lib/Socket/groups.js +347 -0
- package/lib/Socket/index.d.ts +522 -0
- package/lib/Socket/index.js +11 -0
- package/lib/Socket/messages-recv.d.ts +326 -0
- package/lib/Socket/messages-recv.js +1822 -0
- package/lib/Socket/messages-send.d.ts +321 -0
- package/lib/Socket/messages-send.js +1378 -0
- package/lib/Socket/mex.d.ts +1 -0
- package/lib/Socket/mex.js +41 -0
- package/lib/Socket/newsletter.d.ts +283 -0
- package/lib/Socket/newsletter.js +225 -0
- package/lib/Socket/socket.d.ts +61 -0
- package/lib/Socket/socket.js +992 -0
- package/lib/Store/index.d.ts +3 -0
- package/lib/Store/index.js +3 -0
- package/lib/Store/make-in-memory-store.d.ts +63 -0
- package/lib/Store/make-in-memory-store.js +419 -0
- package/lib/Store/make-ordered-dictionary.d.ts +12 -0
- package/lib/Store/make-ordered-dictionary.js +78 -0
- package/lib/Store/object-repository.d.ts +10 -0
- package/lib/Store/object-repository.js +23 -0
- package/lib/Transport/crypto.d.ts +6 -0
- package/lib/Transport/crypto.js +61 -0
- package/lib/Transport/curve.d.ts +8 -0
- package/lib/Transport/curve.js +66 -0
- package/lib/Transport/index.d.ts +16 -0
- package/lib/Transport/index.js +9 -0
- package/lib/Transport/internals.d.ts +57 -0
- package/lib/Transport/internals.js +155 -0
- package/lib/Transport/session-builder.d.ts +40 -0
- package/lib/Transport/session-builder.js +143 -0
- package/lib/Transport/session-cipher.d.ts +26 -0
- package/lib/Transport/session-cipher.js +301 -0
- package/lib/Transport/session-record.d.ts +55 -0
- package/lib/Transport/session-record.js +272 -0
- package/lib/Types/Auth.d.ts +1 -0
- package/lib/Types/Auth.js +1 -0
- package/lib/Types/Bussines.d.ts +1 -0
- package/lib/Types/Bussines.js +1 -0
- package/lib/Types/Call.d.ts +1 -0
- package/lib/Types/Call.js +1 -0
- package/lib/Types/Chat.d.ts +1 -0
- package/lib/Types/Chat.js +7 -0
- package/lib/Types/Contact.d.ts +1 -0
- package/lib/Types/Contact.js +1 -0
- package/lib/Types/Events.d.ts +1 -0
- package/lib/Types/Events.js +1 -0
- package/lib/Types/GroupMetadata.d.ts +1 -0
- package/lib/Types/GroupMetadata.js +1 -0
- package/lib/Types/Label.d.ts +2 -0
- package/lib/Types/Label.js +24 -0
- package/lib/Types/LabelAssociation.d.ts +2 -0
- package/lib/Types/LabelAssociation.js +6 -0
- package/lib/Types/Message.d.ts +11 -0
- package/lib/Types/Message.js +17 -0
- package/lib/Types/Mex.d.ts +2 -0
- package/lib/Types/Mex.js +38 -0
- package/lib/Types/Product.d.ts +1 -0
- package/lib/Types/Product.js +1 -0
- package/lib/Types/RichType.d.ts +2 -0
- package/lib/Types/RichType.js +22 -0
- package/lib/Types/Signal.d.ts +1 -0
- package/lib/Types/Signal.js +1 -0
- package/lib/Types/Socket.d.ts +1 -0
- package/lib/Types/Socket.js +1 -0
- package/lib/Types/State.d.ts +5 -0
- package/lib/Types/State.js +54 -0
- package/lib/Types/USync.d.ts +1 -0
- package/lib/Types/USync.js +1 -0
- package/lib/Types/index.d.ts +13 -0
- package/lib/Types/index.js +25 -0
- package/lib/Utils/auth-utils.d.ts +58 -0
- package/lib/Utils/auth-utils.js +316 -0
- package/lib/Utils/browser-utils.d.ts +9 -0
- package/lib/Utils/browser-utils.js +28 -0
- package/lib/Utils/business.d.ts +49 -0
- package/lib/Utils/business.js +230 -0
- package/lib/Utils/chat-utils.d.ts +408 -0
- package/lib/Utils/chat-utils.js +871 -0
- package/lib/Utils/companion-reg-client-utils.d.ts +4 -0
- package/lib/Utils/companion-reg-client-utils.js +39 -0
- package/lib/Utils/crypto.d.ts +39 -0
- package/lib/Utils/crypto.js +117 -0
- package/lib/Utils/decode-wa-message.d.ts +83 -0
- package/lib/Utils/decode-wa-message.js +316 -0
- package/lib/Utils/event-buffer.d.ts +12 -0
- package/lib/Utils/event-buffer.js +621 -0
- package/lib/Utils/generics.d.ts +63 -0
- package/lib/Utils/generics.js +394 -0
- package/lib/Utils/history.d.ts +75 -0
- package/lib/Utils/history.js +133 -0
- package/lib/Utils/identity-change-handler.d.ts +13 -0
- package/lib/Utils/identity-change-handler.js +48 -0
- package/lib/Utils/index.d.ts +24 -0
- package/lib/Utils/index.js +24 -0
- package/lib/Utils/link-preview.d.ts +13 -0
- package/lib/Utils/link-preview.js +73 -0
- package/lib/Utils/logger.d.ts +12 -0
- package/lib/Utils/logger.js +12 -0
- package/lib/Utils/lt-hash.d.ts +6 -0
- package/lib/Utils/lt-hash.js +7 -0
- package/lib/Utils/make-mutex.d.ts +6 -0
- package/lib/Utils/make-mutex.js +32 -0
- package/lib/Utils/message-retry-manager.d.ts +79 -0
- package/lib/Utils/message-retry-manager.js +259 -0
- package/lib/Utils/messages-media.d.ts +134 -0
- package/lib/Utils/messages-media.js +802 -0
- package/lib/Utils/messages.d.ts +47 -0
- package/lib/Utils/messages.js +1907 -0
- package/lib/Utils/noise-handler.d.ts +20 -0
- package/lib/Utils/noise-handler.js +200 -0
- package/lib/Utils/offline-node-processor.d.ts +10 -0
- package/lib/Utils/offline-node-processor.js +40 -0
- package/lib/Utils/pre-key-manager.d.ts +25 -0
- package/lib/Utils/pre-key-manager.js +105 -0
- package/lib/Utils/process-message.d.ts +83 -0
- package/lib/Utils/process-message.js +748 -0
- package/lib/Utils/reporting-utils.d.ts +12 -0
- package/lib/Utils/reporting-utils.js +257 -0
- package/lib/Utils/rich-message-utils.d.ts +48 -0
- package/lib/Utils/rich-message-utils.js +366 -0
- package/lib/Utils/signal.d.ts +82 -0
- package/lib/Utils/signal.js +200 -0
- package/lib/Utils/stanza-ack.d.ts +16 -0
- package/lib/Utils/stanza-ack.js +37 -0
- package/lib/Utils/sync-action-utils.d.ts +2 -0
- package/lib/Utils/sync-action-utils.js +48 -0
- package/lib/Utils/tc-token-utils.d.ts +29 -0
- package/lib/Utils/tc-token-utils.js +163 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +10 -0
- package/lib/Utils/use-multi-file-auth-state.js +116 -0
- package/lib/Utils/use-single-file-auth-state.d.ts +11 -0
- package/lib/Utils/use-single-file-auth-state.js +94 -0
- package/lib/Utils/use-sqlite-auth-state.d.ts +11 -0
- package/lib/Utils/use-sqlite-auth-state.js +109 -0
- package/lib/Utils/validate-connection.d.ts +44 -0
- package/lib/Utils/validate-connection.js +210 -0
- package/lib/WABinary/constants.d.ts +61 -0
- package/lib/WABinary/constants.js +1466 -0
- package/lib/WABinary/decode.d.ts +9 -0
- package/lib/WABinary/decode.js +261 -0
- package/lib/WABinary/encode.d.ts +2 -0
- package/lib/WABinary/encode.js +219 -0
- package/lib/WABinary/generic-utils.d.ts +79 -0
- package/lib/WABinary/generic-utils.js +226 -0
- package/lib/WABinary/index.d.ts +5 -0
- package/lib/WABinary/index.js +5 -0
- package/lib/WABinary/jid-utils.d.ts +28 -0
- package/lib/WABinary/jid-utils.js +95 -0
- package/lib/WABinary/types.d.ts +1 -0
- package/lib/WABinary/types.js +1 -0
- package/lib/WACrypto/appstate-keys.js +26 -0
- package/lib/WACrypto/curves/constants.js +12 -0
- package/lib/WACrypto/hkdf.js +27 -0
- package/lib/WACrypto/index.js +20 -0
- package/lib/WACrypto/lthash.js +54 -0
- package/lib/WACrypto/math/constants.js +24 -0
- package/lib/WACrypto/math/edwards.js +194 -0
- package/lib/WACrypto/math/fe.js +698 -0
- package/lib/WACrypto/math/le.js +23 -0
- package/lib/WACrypto/math/mod.js +15 -0
- package/lib/WACrypto/util/bytes.js +339 -0
- package/lib/WACrypto/x25519.js +145 -0
- package/lib/WACrypto/xeddsa.js +92 -0
- package/lib/WAM/BinaryInfo.d.ts +7 -0
- package/lib/WAM/BinaryInfo.js +9 -0
- package/lib/WAM/constants.d.ts +34926 -0
- package/lib/WAM/constants.js +22852 -0
- package/lib/WAM/encode.d.ts +1 -0
- package/lib/WAM/encode.js +149 -0
- package/lib/WAM/index.d.ts +3 -0
- package/lib/WAM/index.js +3 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +36 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +51 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +53 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +26 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +37 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +9 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +24 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +38 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +50 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +14 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +28 -0
- package/lib/WAUSync/Protocols/index.d.ts +5 -0
- package/lib/WAUSync/Protocols/index.js +5 -0
- package/lib/WAUSync/USyncQuery.d.ts +20 -0
- package/lib/WAUSync/USyncQuery.js +97 -0
- package/lib/WAUSync/USyncUser.d.ts +16 -0
- package/lib/WAUSync/USyncUser.js +30 -0
- package/lib/WAUSync/index.d.ts +3 -0
- package/lib/WAUSync/index.js +3 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.js +11 -0
- package/package.json +74 -5
- package/tests/addon-test.mjs +162 -0
- package/tests/differential-test.mjs +90 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** WhatsApp has 20 predefined colors */
|
|
2
|
+
export var LabelColor;
|
|
3
|
+
(function (LabelColor) {
|
|
4
|
+
LabelColor[LabelColor["Color1"] = 0] = "Color1";
|
|
5
|
+
LabelColor[LabelColor["Color2"] = 1] = "Color2";
|
|
6
|
+
LabelColor[LabelColor["Color3"] = 2] = "Color3";
|
|
7
|
+
LabelColor[LabelColor["Color4"] = 3] = "Color4";
|
|
8
|
+
LabelColor[LabelColor["Color5"] = 4] = "Color5";
|
|
9
|
+
LabelColor[LabelColor["Color6"] = 5] = "Color6";
|
|
10
|
+
LabelColor[LabelColor["Color7"] = 6] = "Color7";
|
|
11
|
+
LabelColor[LabelColor["Color8"] = 7] = "Color8";
|
|
12
|
+
LabelColor[LabelColor["Color9"] = 8] = "Color9";
|
|
13
|
+
LabelColor[LabelColor["Color10"] = 9] = "Color10";
|
|
14
|
+
LabelColor[LabelColor["Color11"] = 10] = "Color11";
|
|
15
|
+
LabelColor[LabelColor["Color12"] = 11] = "Color12";
|
|
16
|
+
LabelColor[LabelColor["Color13"] = 12] = "Color13";
|
|
17
|
+
LabelColor[LabelColor["Color14"] = 13] = "Color14";
|
|
18
|
+
LabelColor[LabelColor["Color15"] = 14] = "Color15";
|
|
19
|
+
LabelColor[LabelColor["Color16"] = 15] = "Color16";
|
|
20
|
+
LabelColor[LabelColor["Color17"] = 16] = "Color17";
|
|
21
|
+
LabelColor[LabelColor["Color18"] = 17] = "Color18";
|
|
22
|
+
LabelColor[LabelColor["Color19"] = 18] = "Color19";
|
|
23
|
+
LabelColor[LabelColor["Color20"] = 19] = "Color20";
|
|
24
|
+
})(LabelColor || (LabelColor = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { proto as WAProto };
|
|
2
|
+
export const AssociationType: typeof proto.MessageAssociation.AssociationType;
|
|
3
|
+
export const ButtonHeaderType: typeof proto.Message.ButtonsMessage.HeaderType;
|
|
4
|
+
export const ButtonType: typeof proto.Message.ButtonsMessage.Button.Type;
|
|
5
|
+
export const CarouselCardType: typeof proto.Message.InteractiveMessage.CarouselMessage.CarouselCardType;
|
|
6
|
+
export const ListType: typeof proto.Message.ListMessage.ListType;
|
|
7
|
+
export const ProtocolType: typeof proto.Message.ProtocolMessage.Type;
|
|
8
|
+
export const WAMessageStubType: typeof proto.WebMessageInfo.StubType;
|
|
9
|
+
export const WAMessageStatus: typeof proto.WebMessageInfo.Status;
|
|
10
|
+
export const WAMessageAddressingMode: any;
|
|
11
|
+
import { proto } from '../../WAProto/index.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { proto } from '../../WAProto/index.js';
|
|
2
|
+
// export the WAMessage Prototypes
|
|
3
|
+
export { proto as WAProto };
|
|
4
|
+
// Add exported message-related enum types from proto.Message
|
|
5
|
+
export const AssociationType = proto.MessageAssociation.AssociationType;
|
|
6
|
+
export const ButtonHeaderType = proto.Message.ButtonsMessage.HeaderType;
|
|
7
|
+
export const ButtonType = proto.Message.ButtonsMessage.Button.Type;
|
|
8
|
+
export const CarouselCardType = proto.Message.InteractiveMessage.CarouselMessage.CarouselCardType;
|
|
9
|
+
export const ListType = proto.Message.ListMessage.ListType;
|
|
10
|
+
export const ProtocolType = proto.Message.ProtocolMessage.Type;
|
|
11
|
+
export const WAMessageStubType = proto.WebMessageInfo.StubType;
|
|
12
|
+
export const WAMessageStatus = proto.WebMessageInfo.Status;
|
|
13
|
+
export var WAMessageAddressingMode;
|
|
14
|
+
(function (WAMessageAddressingMode) {
|
|
15
|
+
WAMessageAddressingMode["PN"] = "pn";
|
|
16
|
+
WAMessageAddressingMode["LID"] = "lid";
|
|
17
|
+
})(WAMessageAddressingMode || (WAMessageAddressingMode = {}));
|
package/lib/Types/Mex.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export var XWAPaths;
|
|
2
|
+
(function (XWAPaths) {
|
|
3
|
+
XWAPaths["xwa2_newsletter_create"] = "xwa2_newsletter_create";
|
|
4
|
+
XWAPaths["xwa2_newsletter_subscribers"] = "xwa2_newsletter_subscribers";
|
|
5
|
+
XWAPaths["xwa2_newsletter_subscribed"] = "xwa2_newsletter_subscribed";
|
|
6
|
+
XWAPaths["xwa2_newsletter_view"] = "xwa2_newsletter_view";
|
|
7
|
+
XWAPaths["xwa2_newsletter_metadata"] = "xwa2_newsletter";
|
|
8
|
+
XWAPaths["xwa2_newsletter_admin_count"] = "xwa2_newsletter_admin";
|
|
9
|
+
XWAPaths["xwa2_newsletter_mute_v2"] = "xwa2_newsletter_mute_v2";
|
|
10
|
+
XWAPaths["xwa2_newsletter_unmute_v2"] = "xwa2_newsletter_unmute_v2";
|
|
11
|
+
XWAPaths["xwa2_newsletter_follow"] = "xwa2_newsletter_follow";
|
|
12
|
+
XWAPaths["xwa2_newsletter_unfollow"] = "xwa2_newsletter_unfollow";
|
|
13
|
+
XWAPaths["xwa2_newsletter_join_v2"] = "xwa2_newsletter_join_v2";
|
|
14
|
+
XWAPaths["xwa2_newsletter_leave_v2"] = "xwa2_newsletter_leave_v2";
|
|
15
|
+
XWAPaths["xwa2_newsletter_change_owner"] = "xwa2_newsletter_change_owner";
|
|
16
|
+
XWAPaths["xwa2_newsletter_demote"] = "xwa2_newsletter_demote";
|
|
17
|
+
XWAPaths["xwa2_newsletter_delete_v2"] = "xwa2_newsletter_delete_v2";
|
|
18
|
+
XWAPaths["xwa2_fetch_account_reachout_timelock"] = "xwa2_fetch_account_reachout_timelock";
|
|
19
|
+
XWAPaths["xwa2_message_capping_info"] = "xwa2_message_capping_info";
|
|
20
|
+
})(XWAPaths || (XWAPaths = {}));
|
|
21
|
+
export var QueryIds;
|
|
22
|
+
(function (QueryIds) {
|
|
23
|
+
QueryIds["CREATE"] = "8823471724422422";
|
|
24
|
+
QueryIds["UPDATE_METADATA"] = "24250201037901610";
|
|
25
|
+
QueryIds["METADATA"] = "6563316087068696";
|
|
26
|
+
QueryIds["SUBSCRIBERS"] = "9783111038412085";
|
|
27
|
+
QueryIds["SUBSCRIBED"] = "6388546374527196";
|
|
28
|
+
QueryIds["FOLLOW"] = "24404358912487870";
|
|
29
|
+
QueryIds["UNFOLLOW"] = "9767147403369991";
|
|
30
|
+
QueryIds["MUTE"] = "29766401636284406";
|
|
31
|
+
QueryIds["UNMUTE"] = "9864994326891137";
|
|
32
|
+
QueryIds["ADMIN_COUNT"] = "7130823597031706";
|
|
33
|
+
QueryIds["CHANGE_OWNER"] = "7341777602580933";
|
|
34
|
+
QueryIds["DEMOTE"] = "6551828931592903";
|
|
35
|
+
QueryIds["DELETE"] = "30062808666639665";
|
|
36
|
+
QueryIds["REACHOUT_TIMELOCK"] = "23983697327930364";
|
|
37
|
+
QueryIds["MESSAGE_CAPPING_INFO"] = "24503548349331633";
|
|
38
|
+
})(QueryIds || (QueryIds = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export var CodeHighlightType;
|
|
2
|
+
(function (CodeHighlightType) {
|
|
3
|
+
CodeHighlightType[CodeHighlightType["DEFAULT"] = 0] = "DEFAULT";
|
|
4
|
+
CodeHighlightType[CodeHighlightType["KEYWORD"] = 1] = "KEYWORD";
|
|
5
|
+
CodeHighlightType[CodeHighlightType["METHOD"] = 2] = "METHOD";
|
|
6
|
+
CodeHighlightType[CodeHighlightType["STRING"] = 3] = "STRING";
|
|
7
|
+
CodeHighlightType[CodeHighlightType["NUMBER"] = 4] = "NUMBER";
|
|
8
|
+
CodeHighlightType[CodeHighlightType["COMMENT"] = 5] = "COMMENT";
|
|
9
|
+
})(CodeHighlightType || (CodeHighlightType = {}));
|
|
10
|
+
export var RichSubMessageType;
|
|
11
|
+
(function (RichSubMessageType) {
|
|
12
|
+
RichSubMessageType[RichSubMessageType["UNKNOWN"] = 0] = "UNKNOWN";
|
|
13
|
+
RichSubMessageType[RichSubMessageType["GRID_IMAGE"] = 1] = "GRID_IMAGE";
|
|
14
|
+
RichSubMessageType[RichSubMessageType["TEXT"] = 2] = "TEXT";
|
|
15
|
+
RichSubMessageType[RichSubMessageType["INLINE_IMAGE"] = 3] = "INLINE_IMAGE";
|
|
16
|
+
RichSubMessageType[RichSubMessageType["TABLE"] = 4] = "TABLE";
|
|
17
|
+
RichSubMessageType[RichSubMessageType["CODE"] = 5] = "CODE";
|
|
18
|
+
RichSubMessageType[RichSubMessageType["DYNAMIC"] = 6] = "DYNAMIC";
|
|
19
|
+
RichSubMessageType[RichSubMessageType["MAP"] = 7] = "MAP";
|
|
20
|
+
RichSubMessageType[RichSubMessageType["LATEX"] = 8] = "LATEX";
|
|
21
|
+
RichSubMessageType[RichSubMessageType["CONTENT_ITEMS"] = 9] = "CONTENT_ITEMS";
|
|
22
|
+
})(RichSubMessageType || (RichSubMessageType = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { proto } from '../../WAProto/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { proto } from '../../WAProto/index.js';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export var SyncState;
|
|
2
|
+
(function (SyncState) {
|
|
3
|
+
/** The socket is connecting, but we haven't received pending notifications yet. */
|
|
4
|
+
SyncState[SyncState["Connecting"] = 0] = "Connecting";
|
|
5
|
+
/** Pending notifications received. Buffering events until we decide whether to sync or not. */
|
|
6
|
+
SyncState[SyncState["AwaitingInitialSync"] = 1] = "AwaitingInitialSync";
|
|
7
|
+
/** The initial app state sync (history, etc.) is in progress. Buffering continues. */
|
|
8
|
+
SyncState[SyncState["Syncing"] = 2] = "Syncing";
|
|
9
|
+
/** Initial sync is complete, or was skipped. The socket is fully operational and events are processed in real-time. */
|
|
10
|
+
SyncState[SyncState["Online"] = 3] = "Online";
|
|
11
|
+
})(SyncState || (SyncState = {}));
|
|
12
|
+
export var ReachoutTimelockEnforcementType;
|
|
13
|
+
(function (ReachoutTimelockEnforcementType) {
|
|
14
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ALCOHOL"] = "BIZ_COMMERCE_VIOLATION_ALCOHOL";
|
|
15
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ADULT"] = "BIZ_COMMERCE_VIOLATION_ADULT";
|
|
16
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ANIMALS"] = "BIZ_COMMERCE_VIOLATION_ANIMALS";
|
|
17
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS"] = "BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS";
|
|
18
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DATING"] = "BIZ_COMMERCE_VIOLATION_DATING";
|
|
19
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS"] = "BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS";
|
|
20
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DRUGS"] = "BIZ_COMMERCE_VIOLATION_DRUGS";
|
|
21
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC"] = "BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC";
|
|
22
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_GAMBLING"] = "BIZ_COMMERCE_VIOLATION_GAMBLING";
|
|
23
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_HEALTHCARE"] = "BIZ_COMMERCE_VIOLATION_HEALTHCARE";
|
|
24
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY"] = "BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY";
|
|
25
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_SUPPLEMENTS"] = "BIZ_COMMERCE_VIOLATION_SUPPLEMENTS";
|
|
26
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_TOBACCO"] = "BIZ_COMMERCE_VIOLATION_TOBACCO";
|
|
27
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT"] = "BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT";
|
|
28
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_WEAPONS"] = "BIZ_COMMERCE_VIOLATION_WEAPONS";
|
|
29
|
+
ReachoutTimelockEnforcementType["BIZ_QUALITY"] = "BIZ_QUALITY";
|
|
30
|
+
/** This means there is no restriction */
|
|
31
|
+
ReachoutTimelockEnforcementType["DEFAULT"] = "DEFAULT";
|
|
32
|
+
ReachoutTimelockEnforcementType["WEB_COMPANION_ONLY"] = "WEB_COMPANION_ONLY";
|
|
33
|
+
})(ReachoutTimelockEnforcementType || (ReachoutTimelockEnforcementType = {}));
|
|
34
|
+
export var NewChatMessageCappingStatusType;
|
|
35
|
+
(function (NewChatMessageCappingStatusType) {
|
|
36
|
+
NewChatMessageCappingStatusType["NONE"] = "NONE";
|
|
37
|
+
NewChatMessageCappingStatusType["FIRST_WARNING"] = "FIRST_WARNING";
|
|
38
|
+
NewChatMessageCappingStatusType["SECOND_WARNING"] = "SECOND_WARNING";
|
|
39
|
+
NewChatMessageCappingStatusType["CAPPED"] = "CAPPED";
|
|
40
|
+
})(NewChatMessageCappingStatusType || (NewChatMessageCappingStatusType = {}));
|
|
41
|
+
export var NewChatMessageCappingMVStatusType;
|
|
42
|
+
(function (NewChatMessageCappingMVStatusType) {
|
|
43
|
+
NewChatMessageCappingMVStatusType["NOT_ELIGIBLE"] = "NOT_ELIGIBLE";
|
|
44
|
+
NewChatMessageCappingMVStatusType["NOT_ACTIVE"] = "NOT_ACTIVE";
|
|
45
|
+
NewChatMessageCappingMVStatusType["ACTIVE"] = "ACTIVE";
|
|
46
|
+
NewChatMessageCappingMVStatusType["ACTIVE_UPGRADE_AVAILABLE"] = "ACTIVE_UPGRADE_AVAILABLE";
|
|
47
|
+
})(NewChatMessageCappingMVStatusType || (NewChatMessageCappingMVStatusType = {}));
|
|
48
|
+
export var NewChatMessageCappingOTEStatusType;
|
|
49
|
+
(function (NewChatMessageCappingOTEStatusType) {
|
|
50
|
+
NewChatMessageCappingOTEStatusType["NOT_ELIGIBLE"] = "NOT_ELIGIBLE";
|
|
51
|
+
NewChatMessageCappingOTEStatusType["ELIGIBLE"] = "ELIGIBLE";
|
|
52
|
+
NewChatMessageCappingOTEStatusType["ACTIVE_IN_CURRENT_CYCLE"] = "ACTIVE_IN_CURRENT_CYCLE";
|
|
53
|
+
NewChatMessageCappingOTEStatusType["EXHAUSTED"] = "EXHAUSTED";
|
|
54
|
+
})(NewChatMessageCappingOTEStatusType || (NewChatMessageCappingOTEStatusType = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { USyncUser } from '../WAUSync/index.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./Auth.js";
|
|
2
|
+
export * from "./GroupMetadata.js";
|
|
3
|
+
export * from "./Chat.js";
|
|
4
|
+
export * from "./Contact.js";
|
|
5
|
+
export * from "./State.js";
|
|
6
|
+
export * from "./Message.js";
|
|
7
|
+
export * from "./Socket.js";
|
|
8
|
+
export * from "./Events.js";
|
|
9
|
+
export * from "./Product.js";
|
|
10
|
+
export * from "./Call.js";
|
|
11
|
+
export * from "./Signal.js";
|
|
12
|
+
export * from "./Mex.js";
|
|
13
|
+
export const DisconnectReason: any;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * from './Auth.js';
|
|
2
|
+
export * from './GroupMetadata.js';
|
|
3
|
+
export * from './Chat.js';
|
|
4
|
+
export * from './Contact.js';
|
|
5
|
+
export * from './State.js';
|
|
6
|
+
export * from './Message.js';
|
|
7
|
+
export * from './Socket.js';
|
|
8
|
+
export * from './Events.js';
|
|
9
|
+
export * from './Product.js';
|
|
10
|
+
export * from './Call.js';
|
|
11
|
+
export * from './Signal.js';
|
|
12
|
+
export * from './Mex.js';
|
|
13
|
+
export var DisconnectReason;
|
|
14
|
+
(function (DisconnectReason) {
|
|
15
|
+
DisconnectReason[DisconnectReason["connectionClosed"] = 428] = "connectionClosed";
|
|
16
|
+
DisconnectReason[DisconnectReason["connectionLost"] = 408] = "connectionLost";
|
|
17
|
+
DisconnectReason[DisconnectReason["connectionReplaced"] = 440] = "connectionReplaced";
|
|
18
|
+
DisconnectReason[DisconnectReason["timedOut"] = 408] = "timedOut";
|
|
19
|
+
DisconnectReason[DisconnectReason["loggedOut"] = 401] = "loggedOut";
|
|
20
|
+
DisconnectReason[DisconnectReason["badSession"] = 500] = "badSession";
|
|
21
|
+
DisconnectReason[DisconnectReason["restartRequired"] = 515] = "restartRequired";
|
|
22
|
+
DisconnectReason[DisconnectReason["multideviceMismatch"] = 411] = "multideviceMismatch";
|
|
23
|
+
DisconnectReason[DisconnectReason["forbidden"] = 403] = "forbidden";
|
|
24
|
+
DisconnectReason[DisconnectReason["unavailableService"] = 503] = "unavailableService";
|
|
25
|
+
})(DisconnectReason || (DisconnectReason = {}));
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adds caching capability to a SignalKeyStore
|
|
3
|
+
* @param store the store to add caching to
|
|
4
|
+
* @param logger to log trace events
|
|
5
|
+
* @param _cache cache store to use
|
|
6
|
+
*/
|
|
7
|
+
export function makeCacheableSignalKeyStore(store: any, logger: any, _cache: any): {
|
|
8
|
+
get(type: any, ids: any): Promise<any>;
|
|
9
|
+
set(data: any): Promise<any>;
|
|
10
|
+
clear(): Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
export function addTransactionCapability(state: any, logger: any, { maxCommitRetries, delayBetweenTriesMs }: {
|
|
13
|
+
maxCommitRetries: any;
|
|
14
|
+
delayBetweenTriesMs: any;
|
|
15
|
+
}): {
|
|
16
|
+
get: (type: any, ids: any) => Promise<any>;
|
|
17
|
+
set: (data: any) => Promise<void>;
|
|
18
|
+
isInTransaction: () => boolean;
|
|
19
|
+
transaction: (work: any, key: any) => Promise<any>;
|
|
20
|
+
disposeTransactionStorage: () => void;
|
|
21
|
+
};
|
|
22
|
+
export function assertMeId(creds: any): any;
|
|
23
|
+
export function initAuthCreds(): {
|
|
24
|
+
noiseKey: {
|
|
25
|
+
private: any;
|
|
26
|
+
public: any;
|
|
27
|
+
};
|
|
28
|
+
pairingEphemeralKeyPair: {
|
|
29
|
+
private: any;
|
|
30
|
+
public: any;
|
|
31
|
+
};
|
|
32
|
+
signedIdentityKey: {
|
|
33
|
+
private: any;
|
|
34
|
+
public: any;
|
|
35
|
+
};
|
|
36
|
+
signedPreKey: {
|
|
37
|
+
keyPair: {
|
|
38
|
+
private: any;
|
|
39
|
+
public: any;
|
|
40
|
+
};
|
|
41
|
+
signature: any;
|
|
42
|
+
keyId: any;
|
|
43
|
+
};
|
|
44
|
+
registrationId: number;
|
|
45
|
+
advSecretKey: any;
|
|
46
|
+
processedHistoryMessages: never[];
|
|
47
|
+
nextPreKeyId: number;
|
|
48
|
+
firstUnuploadedPreKeyId: number;
|
|
49
|
+
accountSyncCounter: number;
|
|
50
|
+
accountSettings: {
|
|
51
|
+
unarchiveChats: boolean;
|
|
52
|
+
};
|
|
53
|
+
registered: boolean;
|
|
54
|
+
pairingCode: undefined;
|
|
55
|
+
lastPropHash: undefined;
|
|
56
|
+
routingInfo: undefined;
|
|
57
|
+
additionalData: undefined;
|
|
58
|
+
};
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
import { randomBytes } from 'node:crypto';
|
|
3
|
+
import { HttpError, createCache, createMutex, createQueue } from '../Addon/index.js';
|
|
4
|
+
import { DEFAULT_CACHE_TTLS } from '../Defaults/index.js';
|
|
5
|
+
import { Curve, signedKeyPair } from './crypto.js';
|
|
6
|
+
import { delay, generateRegistrationId } from './generics.js';
|
|
7
|
+
import { PreKeyManager } from './pre-key-manager.js';
|
|
8
|
+
// One instance per process: a per-socket AsyncLocalStorage leaks the heap under Node's legacy
|
|
9
|
+
// async-context propagation, where every live instance tags every pending async resource. The
|
|
10
|
+
// value is keyed by store token so a store only ever sees its own context, even when another
|
|
11
|
+
// wrapped store runs inside its transaction.
|
|
12
|
+
const txStorage = new AsyncLocalStorage();
|
|
13
|
+
/**
|
|
14
|
+
* Adds caching capability to a SignalKeyStore
|
|
15
|
+
* @param store the store to add caching to
|
|
16
|
+
* @param logger to log trace events
|
|
17
|
+
* @param _cache cache store to use
|
|
18
|
+
*/
|
|
19
|
+
export function makeCacheableSignalKeyStore(store, logger, _cache) {
|
|
20
|
+
const cache = _cache ||
|
|
21
|
+
createCache({
|
|
22
|
+
ttl: DEFAULT_CACHE_TTLS.SIGNAL_STORE // 5 minutes
|
|
23
|
+
});
|
|
24
|
+
// Mutex for protecting cache operations
|
|
25
|
+
const cacheMutex = createMutex();
|
|
26
|
+
function getUniqueId(type, id) {
|
|
27
|
+
return `${type}.${id}`;
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
async get(type, ids) {
|
|
31
|
+
return cacheMutex.runExclusive(async () => {
|
|
32
|
+
const data = {};
|
|
33
|
+
const idsToFetch = [];
|
|
34
|
+
for (const id of ids) {
|
|
35
|
+
const item = (await cache.get(getUniqueId(type, id)));
|
|
36
|
+
if (typeof item !== 'undefined') {
|
|
37
|
+
data[id] = item;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
idsToFetch.push(id);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (idsToFetch.length) {
|
|
44
|
+
logger?.trace({ items: idsToFetch.length }, 'loading from store');
|
|
45
|
+
const fetched = await store.get(type, idsToFetch);
|
|
46
|
+
for (const id of idsToFetch) {
|
|
47
|
+
const item = fetched[id];
|
|
48
|
+
if (item) {
|
|
49
|
+
data[id] = item;
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
51
|
+
await cache.set(getUniqueId(type, id), item);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return data;
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
async set(data) {
|
|
59
|
+
return cacheMutex.runExclusive(async () => {
|
|
60
|
+
let keys = 0;
|
|
61
|
+
for (const type in data) {
|
|
62
|
+
for (const id in data[type]) {
|
|
63
|
+
await cache.set(getUniqueId(type, id), data[type][id]);
|
|
64
|
+
keys += 1;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
logger?.trace({ keys }, 'updated cache');
|
|
68
|
+
await store.set(data);
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
async clear() {
|
|
72
|
+
await cache.flushAll();
|
|
73
|
+
await store.clear?.();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Adds DB-like transaction capability to the SignalKeyStore
|
|
79
|
+
* Uses AsyncLocalStorage for automatic context management
|
|
80
|
+
* @param state the key store to apply this capability to
|
|
81
|
+
* @param logger logger to log events
|
|
82
|
+
* @returns SignalKeyStore with transaction capability
|
|
83
|
+
*/
|
|
84
|
+
export const addTransactionCapability = (state, logger, { maxCommitRetries, delayBetweenTriesMs }) => {
|
|
85
|
+
// Queues for concurrency control (keyed by signal data type - bounded set)
|
|
86
|
+
const keyQueues = new Map();
|
|
87
|
+
// Transaction mutexes with reference counting for cleanup
|
|
88
|
+
const txMutexes = new Map();
|
|
89
|
+
const txMutexRefCounts = new Map();
|
|
90
|
+
// Pre-key manager for specialized operations
|
|
91
|
+
const preKeyManager = new PreKeyManager(state, logger);
|
|
92
|
+
/**
|
|
93
|
+
* Get or create a queue for a specific key type
|
|
94
|
+
*/
|
|
95
|
+
function getQueue(key) {
|
|
96
|
+
if (!keyQueues.has(key)) {
|
|
97
|
+
keyQueues.set(key, createQueue(1));
|
|
98
|
+
}
|
|
99
|
+
return keyQueues.get(key);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Get or create a transaction mutex
|
|
103
|
+
*/
|
|
104
|
+
function getTxMutex(key) {
|
|
105
|
+
if (!txMutexes.has(key)) {
|
|
106
|
+
txMutexes.set(key, createMutex());
|
|
107
|
+
txMutexRefCounts.set(key, 0);
|
|
108
|
+
}
|
|
109
|
+
return txMutexes.get(key);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Acquire a reference to a transaction mutex
|
|
113
|
+
*/
|
|
114
|
+
function acquireTxMutexRef(key) {
|
|
115
|
+
const count = txMutexRefCounts.get(key) ?? 0;
|
|
116
|
+
txMutexRefCounts.set(key, count + 1);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Release a reference to a transaction mutex and cleanup if no longer needed
|
|
120
|
+
*/
|
|
121
|
+
function releaseTxMutexRef(key) {
|
|
122
|
+
const count = (txMutexRefCounts.get(key) ?? 1) - 1;
|
|
123
|
+
txMutexRefCounts.set(key, count);
|
|
124
|
+
// Cleanup if no more references and mutex is not locked
|
|
125
|
+
if (count <= 0) {
|
|
126
|
+
const mutex = txMutexes.get(key);
|
|
127
|
+
if (mutex && !mutex.isLocked()) {
|
|
128
|
+
txMutexes.delete(key);
|
|
129
|
+
txMutexRefCounts.delete(key);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Check if currently in a transaction
|
|
135
|
+
*/
|
|
136
|
+
function isInTransaction() {
|
|
137
|
+
return !!txStorage.getStore();
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Commit transaction with retries
|
|
141
|
+
*/
|
|
142
|
+
async function commitWithRetry(mutations) {
|
|
143
|
+
if (Object.keys(mutations).length === 0) {
|
|
144
|
+
logger.trace('no mutations in transaction');
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
logger.trace('committing transaction');
|
|
148
|
+
for (let attempt = 0; attempt < maxCommitRetries; attempt++) {
|
|
149
|
+
try {
|
|
150
|
+
await state.set(mutations);
|
|
151
|
+
logger.trace({ mutationCount: Object.keys(mutations).length }, 'committed transaction');
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
const retriesLeft = maxCommitRetries - attempt - 1;
|
|
156
|
+
logger.warn(`failed to commit mutations, retries left=${retriesLeft}`);
|
|
157
|
+
if (retriesLeft === 0) {
|
|
158
|
+
throw error;
|
|
159
|
+
}
|
|
160
|
+
await delay(delayBetweenTriesMs);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
get: async (type, ids) => {
|
|
166
|
+
const ctx = txStorage.getStore();
|
|
167
|
+
if (!ctx) {
|
|
168
|
+
// No transaction - direct read without exclusive lock for concurrency
|
|
169
|
+
return state.get(type, ids);
|
|
170
|
+
}
|
|
171
|
+
// In transaction - check cache first
|
|
172
|
+
const cached = ctx.cache[type] || {};
|
|
173
|
+
const missing = ids.filter(id => !(id in cached));
|
|
174
|
+
if (missing.length > 0) {
|
|
175
|
+
ctx.dbQueries++;
|
|
176
|
+
logger.trace({ type, count: missing.length }, 'fetching missing keys in transaction');
|
|
177
|
+
const fetched = await getTxMutex(type).runExclusive(() => state.get(type, missing));
|
|
178
|
+
// Update cache
|
|
179
|
+
ctx.cache[type] = ctx.cache[type] || {};
|
|
180
|
+
Object.assign(ctx.cache[type], fetched);
|
|
181
|
+
}
|
|
182
|
+
// Return requested ids from cache
|
|
183
|
+
const result = {};
|
|
184
|
+
for (const id of ids) {
|
|
185
|
+
const value = ctx.cache[type]?.[id];
|
|
186
|
+
if (value !== undefined && value !== null) {
|
|
187
|
+
result[id] = value;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return result;
|
|
191
|
+
},
|
|
192
|
+
set: async (data) => {
|
|
193
|
+
const ctx = txStorage.getStore();
|
|
194
|
+
if (!ctx) {
|
|
195
|
+
// No transaction - direct write with queue protection
|
|
196
|
+
const types = Object.keys(data);
|
|
197
|
+
// Process pre-keys with validation
|
|
198
|
+
for (const type_ of types) {
|
|
199
|
+
const type = type_;
|
|
200
|
+
if (type === 'pre-key') {
|
|
201
|
+
await preKeyManager.validateDeletions(data, type);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
// Write all data in parallel
|
|
205
|
+
await Promise.all(types.map(type => getQueue(type).add(async () => {
|
|
206
|
+
const typeData = { [type]: data[type] };
|
|
207
|
+
await state.set(typeData);
|
|
208
|
+
})));
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
// In transaction - update cache and mutations
|
|
212
|
+
logger.trace({ types: Object.keys(data) }, 'caching in transaction');
|
|
213
|
+
for (const key_ in data) {
|
|
214
|
+
const key = key_;
|
|
215
|
+
// Ensure structures exist
|
|
216
|
+
ctx.cache[key] = ctx.cache[key] || {};
|
|
217
|
+
ctx.mutations[key] = ctx.mutations[key] || {};
|
|
218
|
+
// Special handling for pre-keys
|
|
219
|
+
if (key === 'pre-key') {
|
|
220
|
+
await preKeyManager.processOperations(data, key, ctx.cache, ctx.mutations, true);
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
// Normal key types
|
|
224
|
+
Object.assign(ctx.cache[key], data[key]);
|
|
225
|
+
Object.assign(ctx.mutations[key], data[key]);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
isInTransaction,
|
|
230
|
+
transaction: async (work, key) => {
|
|
231
|
+
const existing = txStorage.getStore();
|
|
232
|
+
// Nested transaction - reuse existing context
|
|
233
|
+
if (existing) {
|
|
234
|
+
logger.trace('reusing existing transaction context');
|
|
235
|
+
return work();
|
|
236
|
+
}
|
|
237
|
+
// New transaction - acquire mutex and create context
|
|
238
|
+
const mutex = getTxMutex(key);
|
|
239
|
+
acquireTxMutexRef(key);
|
|
240
|
+
try {
|
|
241
|
+
return await mutex.runExclusive(async () => {
|
|
242
|
+
const ctx = {
|
|
243
|
+
cache: {},
|
|
244
|
+
mutations: {},
|
|
245
|
+
dbQueries: 0
|
|
246
|
+
};
|
|
247
|
+
logger.trace('entering transaction');
|
|
248
|
+
try {
|
|
249
|
+
const result = await txStorage.run(ctx, work);
|
|
250
|
+
// Commit mutations
|
|
251
|
+
await commitWithRetry(ctx.mutations);
|
|
252
|
+
logger.trace({ dbQueries: ctx.dbQueries }, 'transaction completed');
|
|
253
|
+
return result;
|
|
254
|
+
}
|
|
255
|
+
catch (error) {
|
|
256
|
+
logger.error({ error }, 'transaction failed, rolling back');
|
|
257
|
+
throw error;
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
finally {
|
|
262
|
+
releaseTxMutexRef(key);
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
disposeTransactionStorage: () => {
|
|
266
|
+
// The first txStorage.run() enables the storage, which registers it in a
|
|
267
|
+
// module-global list inside node:async_hooks holding a STRONG reference.
|
|
268
|
+
// On Node < 24 every enabled storage also stamps one symbol-keyed property
|
|
269
|
+
// onto every async resource created anywhere in the process, so the cost of
|
|
270
|
+
// never disabling grows with sockets-ever-created x live async resources
|
|
271
|
+
// (observed: 1.9GB of a 2.1GB heap after 25h at ~250 concurrent sockets).
|
|
272
|
+
// Only .disable() releases it - GC alone never collects an enabled storage,
|
|
273
|
+
// on any Node version.
|
|
274
|
+
try {
|
|
275
|
+
txStorage.disable();
|
|
276
|
+
}
|
|
277
|
+
catch (err) {
|
|
278
|
+
logger.warn({ err }, 'failed to disable transaction storage');
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* Returns the authenticated user's JID, or throws a Boom-401 if creds are not yet authenticated.
|
|
285
|
+
* Use this anywhere we'd otherwise reach for `creds.me!.id` to fail fast with a descriptive error.
|
|
286
|
+
*/
|
|
287
|
+
export const assertMeId = (creds) => {
|
|
288
|
+
const id = creds.me?.id;
|
|
289
|
+
if (!id) {
|
|
290
|
+
throw new HttpError('Cannot proceed: socket is not authenticated yet (creds.me.id is missing)', { statusCode: 401 });
|
|
291
|
+
}
|
|
292
|
+
return id;
|
|
293
|
+
};
|
|
294
|
+
export const initAuthCreds = () => {
|
|
295
|
+
const identityKey = Curve.generateKeyPair();
|
|
296
|
+
return {
|
|
297
|
+
noiseKey: Curve.generateKeyPair(),
|
|
298
|
+
pairingEphemeralKeyPair: Curve.generateKeyPair(),
|
|
299
|
+
signedIdentityKey: identityKey,
|
|
300
|
+
signedPreKey: signedKeyPair(identityKey, 1),
|
|
301
|
+
registrationId: generateRegistrationId(),
|
|
302
|
+
advSecretKey: randomBytes(32).toString('base64'),
|
|
303
|
+
processedHistoryMessages: [],
|
|
304
|
+
nextPreKeyId: 1,
|
|
305
|
+
firstUnuploadedPreKeyId: 1,
|
|
306
|
+
accountSyncCounter: 0,
|
|
307
|
+
accountSettings: {
|
|
308
|
+
unarchiveChats: false
|
|
309
|
+
},
|
|
310
|
+
registered: false,
|
|
311
|
+
pairingCode: undefined,
|
|
312
|
+
lastPropHash: undefined,
|
|
313
|
+
routingInfo: undefined,
|
|
314
|
+
additionalData: undefined
|
|
315
|
+
};
|
|
316
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export namespace Browsers {
|
|
2
|
+
function ubuntu(browser: any): any[];
|
|
3
|
+
function macOS(browser: any): any[];
|
|
4
|
+
function baileys(browser: any): any[];
|
|
5
|
+
function windows(browser: any): any[];
|
|
6
|
+
function android(browser: any): any[];
|
|
7
|
+
function appropriate(browser: any): any[];
|
|
8
|
+
}
|
|
9
|
+
export function getPlatformId(browser: any): string;
|