@eduh_dev021/baileys 0.0.0-stage → 1.0.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 +495 -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/http-error.d.ts +18 -0
- package/cjs/lib/Addon/http-error.js +66 -0
- package/cjs/lib/Addon/index.d.ts +3 -0
- package/cjs/lib/Addon/index.js +50 -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/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/http-error.d.ts +18 -0
- package/lib/Addon/http-error.js +40 -0
- package/lib/Addon/index.d.ts +3 -0
- package/lib/Addon/index.js +4 -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/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 +1911 -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 +369 -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 +228 -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 +79 -5
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var Product_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(Product_exports);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var RichType_exports = {};
|
|
19
|
+
__export(RichType_exports, {
|
|
20
|
+
CodeHighlightType: () => CodeHighlightType,
|
|
21
|
+
RichSubMessageType: () => RichSubMessageType
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(RichType_exports);
|
|
24
|
+
var CodeHighlightType;
|
|
25
|
+
(function(CodeHighlightType2) {
|
|
26
|
+
CodeHighlightType2[CodeHighlightType2["DEFAULT"] = 0] = "DEFAULT";
|
|
27
|
+
CodeHighlightType2[CodeHighlightType2["KEYWORD"] = 1] = "KEYWORD";
|
|
28
|
+
CodeHighlightType2[CodeHighlightType2["METHOD"] = 2] = "METHOD";
|
|
29
|
+
CodeHighlightType2[CodeHighlightType2["STRING"] = 3] = "STRING";
|
|
30
|
+
CodeHighlightType2[CodeHighlightType2["NUMBER"] = 4] = "NUMBER";
|
|
31
|
+
CodeHighlightType2[CodeHighlightType2["COMMENT"] = 5] = "COMMENT";
|
|
32
|
+
})(CodeHighlightType || (CodeHighlightType = {}));
|
|
33
|
+
var RichSubMessageType;
|
|
34
|
+
(function(RichSubMessageType2) {
|
|
35
|
+
RichSubMessageType2[RichSubMessageType2["UNKNOWN"] = 0] = "UNKNOWN";
|
|
36
|
+
RichSubMessageType2[RichSubMessageType2["GRID_IMAGE"] = 1] = "GRID_IMAGE";
|
|
37
|
+
RichSubMessageType2[RichSubMessageType2["TEXT"] = 2] = "TEXT";
|
|
38
|
+
RichSubMessageType2[RichSubMessageType2["INLINE_IMAGE"] = 3] = "INLINE_IMAGE";
|
|
39
|
+
RichSubMessageType2[RichSubMessageType2["TABLE"] = 4] = "TABLE";
|
|
40
|
+
RichSubMessageType2[RichSubMessageType2["CODE"] = 5] = "CODE";
|
|
41
|
+
RichSubMessageType2[RichSubMessageType2["DYNAMIC"] = 6] = "DYNAMIC";
|
|
42
|
+
RichSubMessageType2[RichSubMessageType2["MAP"] = 7] = "MAP";
|
|
43
|
+
RichSubMessageType2[RichSubMessageType2["LATEX"] = 8] = "LATEX";
|
|
44
|
+
RichSubMessageType2[RichSubMessageType2["CONTENT_ITEMS"] = 9] = "CONTENT_ITEMS";
|
|
45
|
+
})(RichSubMessageType || (RichSubMessageType = {}));
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
CodeHighlightType,
|
|
49
|
+
RichSubMessageType
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var import_WAProto = require("../../WAProto/index.js");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var import_WAProto = require("../../WAProto/index.js");
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var State_exports = {};
|
|
19
|
+
__export(State_exports, {
|
|
20
|
+
NewChatMessageCappingMVStatusType: () => NewChatMessageCappingMVStatusType,
|
|
21
|
+
NewChatMessageCappingOTEStatusType: () => NewChatMessageCappingOTEStatusType,
|
|
22
|
+
NewChatMessageCappingStatusType: () => NewChatMessageCappingStatusType,
|
|
23
|
+
ReachoutTimelockEnforcementType: () => ReachoutTimelockEnforcementType,
|
|
24
|
+
SyncState: () => SyncState
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(State_exports);
|
|
27
|
+
var SyncState;
|
|
28
|
+
(function(SyncState2) {
|
|
29
|
+
SyncState2[SyncState2["Connecting"] = 0] = "Connecting";
|
|
30
|
+
SyncState2[SyncState2["AwaitingInitialSync"] = 1] = "AwaitingInitialSync";
|
|
31
|
+
SyncState2[SyncState2["Syncing"] = 2] = "Syncing";
|
|
32
|
+
SyncState2[SyncState2["Online"] = 3] = "Online";
|
|
33
|
+
})(SyncState || (SyncState = {}));
|
|
34
|
+
var ReachoutTimelockEnforcementType;
|
|
35
|
+
(function(ReachoutTimelockEnforcementType2) {
|
|
36
|
+
ReachoutTimelockEnforcementType2["BIZ_COMMERCE_VIOLATION_ALCOHOL"] = "BIZ_COMMERCE_VIOLATION_ALCOHOL";
|
|
37
|
+
ReachoutTimelockEnforcementType2["BIZ_COMMERCE_VIOLATION_ADULT"] = "BIZ_COMMERCE_VIOLATION_ADULT";
|
|
38
|
+
ReachoutTimelockEnforcementType2["BIZ_COMMERCE_VIOLATION_ANIMALS"] = "BIZ_COMMERCE_VIOLATION_ANIMALS";
|
|
39
|
+
ReachoutTimelockEnforcementType2["BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS"] = "BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS";
|
|
40
|
+
ReachoutTimelockEnforcementType2["BIZ_COMMERCE_VIOLATION_DATING"] = "BIZ_COMMERCE_VIOLATION_DATING";
|
|
41
|
+
ReachoutTimelockEnforcementType2["BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS"] = "BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS";
|
|
42
|
+
ReachoutTimelockEnforcementType2["BIZ_COMMERCE_VIOLATION_DRUGS"] = "BIZ_COMMERCE_VIOLATION_DRUGS";
|
|
43
|
+
ReachoutTimelockEnforcementType2["BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC"] = "BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC";
|
|
44
|
+
ReachoutTimelockEnforcementType2["BIZ_COMMERCE_VIOLATION_GAMBLING"] = "BIZ_COMMERCE_VIOLATION_GAMBLING";
|
|
45
|
+
ReachoutTimelockEnforcementType2["BIZ_COMMERCE_VIOLATION_HEALTHCARE"] = "BIZ_COMMERCE_VIOLATION_HEALTHCARE";
|
|
46
|
+
ReachoutTimelockEnforcementType2["BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY"] = "BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY";
|
|
47
|
+
ReachoutTimelockEnforcementType2["BIZ_COMMERCE_VIOLATION_SUPPLEMENTS"] = "BIZ_COMMERCE_VIOLATION_SUPPLEMENTS";
|
|
48
|
+
ReachoutTimelockEnforcementType2["BIZ_COMMERCE_VIOLATION_TOBACCO"] = "BIZ_COMMERCE_VIOLATION_TOBACCO";
|
|
49
|
+
ReachoutTimelockEnforcementType2["BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT"] = "BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT";
|
|
50
|
+
ReachoutTimelockEnforcementType2["BIZ_COMMERCE_VIOLATION_WEAPONS"] = "BIZ_COMMERCE_VIOLATION_WEAPONS";
|
|
51
|
+
ReachoutTimelockEnforcementType2["BIZ_QUALITY"] = "BIZ_QUALITY";
|
|
52
|
+
ReachoutTimelockEnforcementType2["DEFAULT"] = "DEFAULT";
|
|
53
|
+
ReachoutTimelockEnforcementType2["WEB_COMPANION_ONLY"] = "WEB_COMPANION_ONLY";
|
|
54
|
+
})(ReachoutTimelockEnforcementType || (ReachoutTimelockEnforcementType = {}));
|
|
55
|
+
var NewChatMessageCappingStatusType;
|
|
56
|
+
(function(NewChatMessageCappingStatusType2) {
|
|
57
|
+
NewChatMessageCappingStatusType2["NONE"] = "NONE";
|
|
58
|
+
NewChatMessageCappingStatusType2["FIRST_WARNING"] = "FIRST_WARNING";
|
|
59
|
+
NewChatMessageCappingStatusType2["SECOND_WARNING"] = "SECOND_WARNING";
|
|
60
|
+
NewChatMessageCappingStatusType2["CAPPED"] = "CAPPED";
|
|
61
|
+
})(NewChatMessageCappingStatusType || (NewChatMessageCappingStatusType = {}));
|
|
62
|
+
var NewChatMessageCappingMVStatusType;
|
|
63
|
+
(function(NewChatMessageCappingMVStatusType2) {
|
|
64
|
+
NewChatMessageCappingMVStatusType2["NOT_ELIGIBLE"] = "NOT_ELIGIBLE";
|
|
65
|
+
NewChatMessageCappingMVStatusType2["NOT_ACTIVE"] = "NOT_ACTIVE";
|
|
66
|
+
NewChatMessageCappingMVStatusType2["ACTIVE"] = "ACTIVE";
|
|
67
|
+
NewChatMessageCappingMVStatusType2["ACTIVE_UPGRADE_AVAILABLE"] = "ACTIVE_UPGRADE_AVAILABLE";
|
|
68
|
+
})(NewChatMessageCappingMVStatusType || (NewChatMessageCappingMVStatusType = {}));
|
|
69
|
+
var NewChatMessageCappingOTEStatusType;
|
|
70
|
+
(function(NewChatMessageCappingOTEStatusType2) {
|
|
71
|
+
NewChatMessageCappingOTEStatusType2["NOT_ELIGIBLE"] = "NOT_ELIGIBLE";
|
|
72
|
+
NewChatMessageCappingOTEStatusType2["ELIGIBLE"] = "ELIGIBLE";
|
|
73
|
+
NewChatMessageCappingOTEStatusType2["ACTIVE_IN_CURRENT_CYCLE"] = "ACTIVE_IN_CURRENT_CYCLE";
|
|
74
|
+
NewChatMessageCappingOTEStatusType2["EXHAUSTED"] = "EXHAUSTED";
|
|
75
|
+
})(NewChatMessageCappingOTEStatusType || (NewChatMessageCappingOTEStatusType = {}));
|
|
76
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
77
|
+
0 && (module.exports = {
|
|
78
|
+
NewChatMessageCappingMVStatusType,
|
|
79
|
+
NewChatMessageCappingOTEStatusType,
|
|
80
|
+
NewChatMessageCappingStatusType,
|
|
81
|
+
ReachoutTimelockEnforcementType,
|
|
82
|
+
SyncState
|
|
83
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var import_WAUSync = require("../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,64 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var index_exports = {};
|
|
20
|
+
__export(index_exports, {
|
|
21
|
+
DisconnectReason: () => DisconnectReason
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(index_exports);
|
|
24
|
+
__reExport(index_exports, require("./Auth.js"), module.exports);
|
|
25
|
+
__reExport(index_exports, require("./GroupMetadata.js"), module.exports);
|
|
26
|
+
__reExport(index_exports, require("./Chat.js"), module.exports);
|
|
27
|
+
__reExport(index_exports, require("./Contact.js"), module.exports);
|
|
28
|
+
__reExport(index_exports, require("./State.js"), module.exports);
|
|
29
|
+
__reExport(index_exports, require("./Message.js"), module.exports);
|
|
30
|
+
__reExport(index_exports, require("./Socket.js"), module.exports);
|
|
31
|
+
__reExport(index_exports, require("./Events.js"), module.exports);
|
|
32
|
+
__reExport(index_exports, require("./Product.js"), module.exports);
|
|
33
|
+
__reExport(index_exports, require("./Call.js"), module.exports);
|
|
34
|
+
__reExport(index_exports, require("./Signal.js"), module.exports);
|
|
35
|
+
__reExport(index_exports, require("./Mex.js"), module.exports);
|
|
36
|
+
var DisconnectReason;
|
|
37
|
+
(function(DisconnectReason2) {
|
|
38
|
+
DisconnectReason2[DisconnectReason2["connectionClosed"] = 428] = "connectionClosed";
|
|
39
|
+
DisconnectReason2[DisconnectReason2["connectionLost"] = 408] = "connectionLost";
|
|
40
|
+
DisconnectReason2[DisconnectReason2["connectionReplaced"] = 440] = "connectionReplaced";
|
|
41
|
+
DisconnectReason2[DisconnectReason2["timedOut"] = 408] = "timedOut";
|
|
42
|
+
DisconnectReason2[DisconnectReason2["loggedOut"] = 401] = "loggedOut";
|
|
43
|
+
DisconnectReason2[DisconnectReason2["badSession"] = 500] = "badSession";
|
|
44
|
+
DisconnectReason2[DisconnectReason2["restartRequired"] = 515] = "restartRequired";
|
|
45
|
+
DisconnectReason2[DisconnectReason2["multideviceMismatch"] = 411] = "multideviceMismatch";
|
|
46
|
+
DisconnectReason2[DisconnectReason2["forbidden"] = 403] = "forbidden";
|
|
47
|
+
DisconnectReason2[DisconnectReason2["unavailableService"] = 503] = "unavailableService";
|
|
48
|
+
})(DisconnectReason || (DisconnectReason = {}));
|
|
49
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
+
0 && (module.exports = {
|
|
51
|
+
DisconnectReason,
|
|
52
|
+
...require("./Auth.js"),
|
|
53
|
+
...require("./GroupMetadata.js"),
|
|
54
|
+
...require("./Chat.js"),
|
|
55
|
+
...require("./Contact.js"),
|
|
56
|
+
...require("./State.js"),
|
|
57
|
+
...require("./Message.js"),
|
|
58
|
+
...require("./Socket.js"),
|
|
59
|
+
...require("./Events.js"),
|
|
60
|
+
...require("./Product.js"),
|
|
61
|
+
...require("./Call.js"),
|
|
62
|
+
...require("./Signal.js"),
|
|
63
|
+
...require("./Mex.js")
|
|
64
|
+
});
|
|
@@ -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,275 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var auth_utils_exports = {};
|
|
19
|
+
__export(auth_utils_exports, {
|
|
20
|
+
addTransactionCapability: () => addTransactionCapability,
|
|
21
|
+
assertMeId: () => assertMeId,
|
|
22
|
+
initAuthCreds: () => initAuthCreds,
|
|
23
|
+
makeCacheableSignalKeyStore: () => makeCacheableSignalKeyStore
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(auth_utils_exports);
|
|
26
|
+
var import_node_async_hooks = require("node:async_hooks");
|
|
27
|
+
var import_node_crypto = require("node:crypto");
|
|
28
|
+
var import_Addon = require("../Addon/index.js");
|
|
29
|
+
var import_Defaults = require("../Defaults/index.js");
|
|
30
|
+
var import_crypto = require("./crypto.js");
|
|
31
|
+
var import_generics = require("./generics.js");
|
|
32
|
+
var import_pre_key_manager = require("./pre-key-manager.js");
|
|
33
|
+
const txStorage = new import_node_async_hooks.AsyncLocalStorage();
|
|
34
|
+
function makeCacheableSignalKeyStore(store, logger, _cache) {
|
|
35
|
+
const cache = _cache || (0, import_Addon.createCache)({
|
|
36
|
+
ttl: import_Defaults.DEFAULT_CACHE_TTLS.SIGNAL_STORE
|
|
37
|
+
// 5 minutes
|
|
38
|
+
});
|
|
39
|
+
const cacheMutex = (0, import_Addon.createMutex)();
|
|
40
|
+
function getUniqueId(type, id) {
|
|
41
|
+
return `${type}.${id}`;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
async get(type, ids) {
|
|
45
|
+
return cacheMutex.runExclusive(async () => {
|
|
46
|
+
const data = {};
|
|
47
|
+
const idsToFetch = [];
|
|
48
|
+
for (const id of ids) {
|
|
49
|
+
const item = await cache.get(getUniqueId(type, id));
|
|
50
|
+
if (typeof item !== "undefined") {
|
|
51
|
+
data[id] = item;
|
|
52
|
+
} else {
|
|
53
|
+
idsToFetch.push(id);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (idsToFetch.length) {
|
|
57
|
+
logger?.trace({ items: idsToFetch.length }, "loading from store");
|
|
58
|
+
const fetched = await store.get(type, idsToFetch);
|
|
59
|
+
for (const id of idsToFetch) {
|
|
60
|
+
const item = fetched[id];
|
|
61
|
+
if (item) {
|
|
62
|
+
data[id] = item;
|
|
63
|
+
await cache.set(getUniqueId(type, id), item);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return data;
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
async set(data) {
|
|
71
|
+
return cacheMutex.runExclusive(async () => {
|
|
72
|
+
let keys = 0;
|
|
73
|
+
for (const type in data) {
|
|
74
|
+
for (const id in data[type]) {
|
|
75
|
+
await cache.set(getUniqueId(type, id), data[type][id]);
|
|
76
|
+
keys += 1;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
logger?.trace({ keys }, "updated cache");
|
|
80
|
+
await store.set(data);
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
async clear() {
|
|
84
|
+
await cache.flushAll();
|
|
85
|
+
await store.clear?.();
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
const addTransactionCapability = (state, logger, { maxCommitRetries, delayBetweenTriesMs }) => {
|
|
90
|
+
const keyQueues = /* @__PURE__ */ new Map();
|
|
91
|
+
const txMutexes = /* @__PURE__ */ new Map();
|
|
92
|
+
const txMutexRefCounts = /* @__PURE__ */ new Map();
|
|
93
|
+
const preKeyManager = new import_pre_key_manager.PreKeyManager(state, logger);
|
|
94
|
+
function getQueue(key) {
|
|
95
|
+
if (!keyQueues.has(key)) {
|
|
96
|
+
keyQueues.set(key, (0, import_Addon.createQueue)(1));
|
|
97
|
+
}
|
|
98
|
+
return keyQueues.get(key);
|
|
99
|
+
}
|
|
100
|
+
function getTxMutex(key) {
|
|
101
|
+
if (!txMutexes.has(key)) {
|
|
102
|
+
txMutexes.set(key, (0, import_Addon.createMutex)());
|
|
103
|
+
txMutexRefCounts.set(key, 0);
|
|
104
|
+
}
|
|
105
|
+
return txMutexes.get(key);
|
|
106
|
+
}
|
|
107
|
+
function acquireTxMutexRef(key) {
|
|
108
|
+
const count = txMutexRefCounts.get(key) ?? 0;
|
|
109
|
+
txMutexRefCounts.set(key, count + 1);
|
|
110
|
+
}
|
|
111
|
+
function releaseTxMutexRef(key) {
|
|
112
|
+
const count = (txMutexRefCounts.get(key) ?? 1) - 1;
|
|
113
|
+
txMutexRefCounts.set(key, count);
|
|
114
|
+
if (count <= 0) {
|
|
115
|
+
const mutex = txMutexes.get(key);
|
|
116
|
+
if (mutex && !mutex.isLocked()) {
|
|
117
|
+
txMutexes.delete(key);
|
|
118
|
+
txMutexRefCounts.delete(key);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function isInTransaction() {
|
|
123
|
+
return !!txStorage.getStore();
|
|
124
|
+
}
|
|
125
|
+
async function commitWithRetry(mutations) {
|
|
126
|
+
if (Object.keys(mutations).length === 0) {
|
|
127
|
+
logger.trace("no mutations in transaction");
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
logger.trace("committing transaction");
|
|
131
|
+
for (let attempt = 0; attempt < maxCommitRetries; attempt++) {
|
|
132
|
+
try {
|
|
133
|
+
await state.set(mutations);
|
|
134
|
+
logger.trace({ mutationCount: Object.keys(mutations).length }, "committed transaction");
|
|
135
|
+
return;
|
|
136
|
+
} catch (error) {
|
|
137
|
+
const retriesLeft = maxCommitRetries - attempt - 1;
|
|
138
|
+
logger.warn(`failed to commit mutations, retries left=${retriesLeft}`);
|
|
139
|
+
if (retriesLeft === 0) {
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
142
|
+
await (0, import_generics.delay)(delayBetweenTriesMs);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
get: async (type, ids) => {
|
|
148
|
+
const ctx = txStorage.getStore();
|
|
149
|
+
if (!ctx) {
|
|
150
|
+
return state.get(type, ids);
|
|
151
|
+
}
|
|
152
|
+
const cached = ctx.cache[type] || {};
|
|
153
|
+
const missing = ids.filter((id) => !(id in cached));
|
|
154
|
+
if (missing.length > 0) {
|
|
155
|
+
ctx.dbQueries++;
|
|
156
|
+
logger.trace({ type, count: missing.length }, "fetching missing keys in transaction");
|
|
157
|
+
const fetched = await getTxMutex(type).runExclusive(() => state.get(type, missing));
|
|
158
|
+
ctx.cache[type] = ctx.cache[type] || {};
|
|
159
|
+
Object.assign(ctx.cache[type], fetched);
|
|
160
|
+
}
|
|
161
|
+
const result = {};
|
|
162
|
+
for (const id of ids) {
|
|
163
|
+
const value = ctx.cache[type]?.[id];
|
|
164
|
+
if (value !== void 0 && value !== null) {
|
|
165
|
+
result[id] = value;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return result;
|
|
169
|
+
},
|
|
170
|
+
set: async (data) => {
|
|
171
|
+
const ctx = txStorage.getStore();
|
|
172
|
+
if (!ctx) {
|
|
173
|
+
const types = Object.keys(data);
|
|
174
|
+
for (const type_ of types) {
|
|
175
|
+
const type = type_;
|
|
176
|
+
if (type === "pre-key") {
|
|
177
|
+
await preKeyManager.validateDeletions(data, type);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
await Promise.all(types.map((type) => getQueue(type).add(async () => {
|
|
181
|
+
const typeData = { [type]: data[type] };
|
|
182
|
+
await state.set(typeData);
|
|
183
|
+
})));
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
logger.trace({ types: Object.keys(data) }, "caching in transaction");
|
|
187
|
+
for (const key_ in data) {
|
|
188
|
+
const key = key_;
|
|
189
|
+
ctx.cache[key] = ctx.cache[key] || {};
|
|
190
|
+
ctx.mutations[key] = ctx.mutations[key] || {};
|
|
191
|
+
if (key === "pre-key") {
|
|
192
|
+
await preKeyManager.processOperations(data, key, ctx.cache, ctx.mutations, true);
|
|
193
|
+
} else {
|
|
194
|
+
Object.assign(ctx.cache[key], data[key]);
|
|
195
|
+
Object.assign(ctx.mutations[key], data[key]);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
isInTransaction,
|
|
200
|
+
transaction: async (work, key) => {
|
|
201
|
+
const existing = txStorage.getStore();
|
|
202
|
+
if (existing) {
|
|
203
|
+
logger.trace("reusing existing transaction context");
|
|
204
|
+
return work();
|
|
205
|
+
}
|
|
206
|
+
const mutex = getTxMutex(key);
|
|
207
|
+
acquireTxMutexRef(key);
|
|
208
|
+
try {
|
|
209
|
+
return await mutex.runExclusive(async () => {
|
|
210
|
+
const ctx = {
|
|
211
|
+
cache: {},
|
|
212
|
+
mutations: {},
|
|
213
|
+
dbQueries: 0
|
|
214
|
+
};
|
|
215
|
+
logger.trace("entering transaction");
|
|
216
|
+
try {
|
|
217
|
+
const result = await txStorage.run(ctx, work);
|
|
218
|
+
await commitWithRetry(ctx.mutations);
|
|
219
|
+
logger.trace({ dbQueries: ctx.dbQueries }, "transaction completed");
|
|
220
|
+
return result;
|
|
221
|
+
} catch (error) {
|
|
222
|
+
logger.error({ error }, "transaction failed, rolling back");
|
|
223
|
+
throw error;
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
} finally {
|
|
227
|
+
releaseTxMutexRef(key);
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
disposeTransactionStorage: () => {
|
|
231
|
+
try {
|
|
232
|
+
txStorage.disable();
|
|
233
|
+
} catch (err) {
|
|
234
|
+
logger.warn({ err }, "failed to disable transaction storage");
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
const assertMeId = (creds) => {
|
|
240
|
+
const id = creds.me?.id;
|
|
241
|
+
if (!id) {
|
|
242
|
+
throw new import_Addon.HttpError("Cannot proceed: socket is not authenticated yet (creds.me.id is missing)", { statusCode: 401 });
|
|
243
|
+
}
|
|
244
|
+
return id;
|
|
245
|
+
};
|
|
246
|
+
const initAuthCreds = () => {
|
|
247
|
+
const identityKey = import_crypto.Curve.generateKeyPair();
|
|
248
|
+
return {
|
|
249
|
+
noiseKey: import_crypto.Curve.generateKeyPair(),
|
|
250
|
+
pairingEphemeralKeyPair: import_crypto.Curve.generateKeyPair(),
|
|
251
|
+
signedIdentityKey: identityKey,
|
|
252
|
+
signedPreKey: (0, import_crypto.signedKeyPair)(identityKey, 1),
|
|
253
|
+
registrationId: (0, import_generics.generateRegistrationId)(),
|
|
254
|
+
advSecretKey: (0, import_node_crypto.randomBytes)(32).toString("base64"),
|
|
255
|
+
processedHistoryMessages: [],
|
|
256
|
+
nextPreKeyId: 1,
|
|
257
|
+
firstUnuploadedPreKeyId: 1,
|
|
258
|
+
accountSyncCounter: 0,
|
|
259
|
+
accountSettings: {
|
|
260
|
+
unarchiveChats: false
|
|
261
|
+
},
|
|
262
|
+
registered: false,
|
|
263
|
+
pairingCode: void 0,
|
|
264
|
+
lastPropHash: void 0,
|
|
265
|
+
routingInfo: void 0,
|
|
266
|
+
additionalData: void 0
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
270
|
+
0 && (module.exports = {
|
|
271
|
+
addTransactionCapability,
|
|
272
|
+
assertMeId,
|
|
273
|
+
initAuthCreds,
|
|
274
|
+
makeCacheableSignalKeyStore
|
|
275
|
+
});
|
|
@@ -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;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var browser_utils_exports = {};
|
|
19
|
+
__export(browser_utils_exports, {
|
|
20
|
+
Browsers: () => Browsers,
|
|
21
|
+
getPlatformId: () => getPlatformId
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(browser_utils_exports);
|
|
24
|
+
var import_node_os = require("node:os");
|
|
25
|
+
var import_WAProto = require("../../WAProto/index.js");
|
|
26
|
+
const PLATFORM_MAP = {
|
|
27
|
+
aix: "AIX",
|
|
28
|
+
darwin: "Mac OS",
|
|
29
|
+
win32: "Windows",
|
|
30
|
+
android: "Android",
|
|
31
|
+
freebsd: "FreeBSD",
|
|
32
|
+
openbsd: "OpenBSD",
|
|
33
|
+
sunos: "Solaris",
|
|
34
|
+
linux: void 0,
|
|
35
|
+
haiku: void 0,
|
|
36
|
+
cygwin: void 0,
|
|
37
|
+
netbsd: void 0
|
|
38
|
+
};
|
|
39
|
+
const Browsers = {
|
|
40
|
+
ubuntu: (browser) => ["Ubuntu", browser, "22.04.4"],
|
|
41
|
+
macOS: (browser) => ["Mac OS", browser, "14.4.1"],
|
|
42
|
+
baileys: (browser) => ["Baileys", browser, "6.5.0"],
|
|
43
|
+
windows: (browser) => ["Windows", browser, "10.0.22631"],
|
|
44
|
+
android: (browser) => [browser, "Android", ""],
|
|
45
|
+
/** The appropriate browser based on your OS & release */
|
|
46
|
+
appropriate: (browser) => [PLATFORM_MAP[(0, import_node_os.platform)()] || "Ubuntu", browser, (0, import_node_os.release)()]
|
|
47
|
+
};
|
|
48
|
+
const getPlatformId = (browser) => {
|
|
49
|
+
const platformType = import_WAProto.proto.DeviceProps.PlatformType[browser.toUpperCase()];
|
|
50
|
+
return platformType ? platformType.toString() : "1";
|
|
51
|
+
};
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
Browsers,
|
|
55
|
+
getPlatformId
|
|
56
|
+
});
|