@eduh_dev021/baileys 1.0.0 → 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 +0 -0
- package/README.md +1526 -178
- package/WAProto/index.d.ts +1 -1
- package/WAProto/index.js +1 -1
- package/cjs/WAProto/index.d.ts +1 -1
- package/cjs/WAProto/index.js +0 -0
- package/cjs/engine-requirements.js +0 -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 +0 -0
- package/cjs/lib/Addon/http-error.js +0 -0
- package/cjs/lib/Addon/index.d.ts +93 -0
- package/cjs/lib/Addon/index.js +18 -10
- package/cjs/lib/Addon/keyed-db.d.ts +0 -0
- package/cjs/lib/Addon/keyed-db.js +0 -0
- package/cjs/lib/Addon/link-preview.d.ts +0 -0
- package/cjs/lib/Addon/link-preview.js +0 -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 +2 -2
- package/cjs/lib/Defaults/index.js +2 -2
- package/cjs/lib/Signal/Group/ciphertext-message.d.ts +0 -0
- package/cjs/lib/Signal/Group/ciphertext-message.js +0 -0
- package/cjs/lib/Signal/Group/group-cipher.d.ts +0 -0
- package/cjs/lib/Signal/Group/group-cipher.js +0 -0
- package/cjs/lib/Signal/Group/group-session-builder.d.ts +0 -0
- package/cjs/lib/Signal/Group/group-session-builder.js +0 -0
- package/cjs/lib/Signal/Group/index.d.ts +0 -0
- package/cjs/lib/Signal/Group/index.js +0 -0
- package/cjs/lib/Signal/Group/keyhelper.d.ts +0 -0
- package/cjs/lib/Signal/Group/keyhelper.js +0 -0
- package/cjs/lib/Signal/Group/sender-chain-key.d.ts +0 -0
- package/cjs/lib/Signal/Group/sender-chain-key.js +0 -0
- package/cjs/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -0
- package/cjs/lib/Signal/Group/sender-key-distribution-message.js +0 -0
- package/cjs/lib/Signal/Group/sender-key-message.d.ts +0 -0
- package/cjs/lib/Signal/Group/sender-key-message.js +0 -0
- package/cjs/lib/Signal/Group/sender-key-name.d.ts +0 -0
- package/cjs/lib/Signal/Group/sender-key-name.js +0 -0
- package/cjs/lib/Signal/Group/sender-key-record.d.ts +0 -0
- package/cjs/lib/Signal/Group/sender-key-record.js +0 -0
- package/cjs/lib/Signal/Group/sender-key-state.d.ts +0 -0
- package/cjs/lib/Signal/Group/sender-key-state.js +0 -0
- package/cjs/lib/Signal/Group/sender-message-key.d.ts +0 -0
- package/cjs/lib/Signal/Group/sender-message-key.js +0 -0
- package/cjs/lib/Signal/libsignal.d.ts +0 -0
- package/cjs/lib/Signal/libsignal.js +0 -0
- package/cjs/lib/Signal/lid-mapping.d.ts +0 -0
- package/cjs/lib/Signal/lid-mapping.js +0 -0
- package/cjs/lib/Socket/Client/index.d.ts +0 -0
- package/cjs/lib/Socket/Client/index.js +0 -0
- package/cjs/lib/Socket/Client/types.d.ts +0 -0
- package/cjs/lib/Socket/Client/types.js +0 -0
- package/cjs/lib/Socket/Client/websocket.d.ts +0 -0
- package/cjs/lib/Socket/Client/websocket.js +0 -0
- package/cjs/lib/Socket/business.d.ts +0 -0
- package/cjs/lib/Socket/business.js +0 -0
- package/cjs/lib/Socket/chats.d.ts +0 -0
- package/cjs/lib/Socket/chats.js +0 -0
- package/cjs/lib/Socket/communities.d.ts +0 -0
- package/cjs/lib/Socket/communities.js +0 -0
- package/cjs/lib/Socket/groups.d.ts +0 -0
- package/cjs/lib/Socket/groups.js +0 -0
- package/cjs/lib/Socket/index.d.ts +0 -0
- package/cjs/lib/Socket/index.js +0 -0
- package/cjs/lib/Socket/messages-recv.d.ts +0 -0
- package/cjs/lib/Socket/messages-recv.js +0 -0
- package/cjs/lib/Socket/messages-send.d.ts +0 -0
- package/cjs/lib/Socket/messages-send.js +7 -7
- package/cjs/lib/Socket/mex.d.ts +0 -0
- package/cjs/lib/Socket/mex.js +0 -0
- package/cjs/lib/Socket/newsletter.d.ts +0 -0
- package/cjs/lib/Socket/newsletter.js +1 -1
- package/cjs/lib/Socket/socket.d.ts +0 -0
- package/cjs/lib/Socket/socket.js +0 -0
- package/cjs/lib/Store/index.d.ts +0 -0
- package/cjs/lib/Store/index.js +0 -0
- package/cjs/lib/Store/make-in-memory-store.d.ts +0 -0
- package/cjs/lib/Store/make-in-memory-store.js +0 -0
- package/cjs/lib/Store/make-ordered-dictionary.d.ts +0 -0
- package/cjs/lib/Store/make-ordered-dictionary.js +0 -0
- package/cjs/lib/Store/object-repository.d.ts +0 -0
- package/cjs/lib/Store/object-repository.js +0 -0
- package/cjs/lib/Transport/crypto.d.ts +0 -0
- package/cjs/lib/Transport/crypto.js +0 -0
- package/cjs/lib/Transport/curve.d.ts +0 -0
- package/cjs/lib/Transport/curve.js +0 -0
- package/cjs/lib/Transport/index.d.ts +0 -0
- package/cjs/lib/Transport/index.js +0 -0
- package/cjs/lib/Transport/internals.d.ts +0 -0
- package/cjs/lib/Transport/internals.js +0 -0
- package/cjs/lib/Transport/session-builder.d.ts +0 -0
- package/cjs/lib/Transport/session-builder.js +0 -0
- package/cjs/lib/Transport/session-cipher.d.ts +0 -0
- package/cjs/lib/Transport/session-cipher.js +0 -0
- package/cjs/lib/Transport/session-record.d.ts +0 -0
- package/cjs/lib/Transport/session-record.js +0 -0
- package/cjs/lib/Types/Auth.d.ts +0 -0
- package/cjs/lib/Types/Auth.js +0 -0
- package/cjs/lib/Types/Bussines.d.ts +0 -0
- package/cjs/lib/Types/Bussines.js +0 -0
- package/cjs/lib/Types/Call.d.ts +0 -0
- package/cjs/lib/Types/Call.js +0 -0
- package/cjs/lib/Types/Chat.d.ts +0 -0
- package/cjs/lib/Types/Chat.js +0 -0
- package/cjs/lib/Types/Contact.d.ts +0 -0
- package/cjs/lib/Types/Contact.js +0 -0
- package/cjs/lib/Types/Events.d.ts +0 -0
- package/cjs/lib/Types/Events.js +0 -0
- package/cjs/lib/Types/GroupMetadata.d.ts +0 -0
- package/cjs/lib/Types/GroupMetadata.js +0 -0
- package/cjs/lib/Types/Label.d.ts +0 -0
- package/cjs/lib/Types/Label.js +0 -0
- package/cjs/lib/Types/LabelAssociation.d.ts +0 -0
- package/cjs/lib/Types/LabelAssociation.js +0 -0
- package/cjs/lib/Types/Message.d.ts +0 -0
- package/cjs/lib/Types/Message.js +0 -0
- package/cjs/lib/Types/Mex.d.ts +0 -0
- package/cjs/lib/Types/Mex.js +0 -0
- package/cjs/lib/Types/Product.d.ts +0 -0
- package/cjs/lib/Types/Product.js +0 -0
- package/cjs/lib/Types/RichType.d.ts +0 -0
- package/cjs/lib/Types/RichType.js +0 -0
- package/cjs/lib/Types/Signal.d.ts +0 -0
- package/cjs/lib/Types/Signal.js +0 -0
- package/cjs/lib/Types/Socket.d.ts +0 -0
- package/cjs/lib/Types/Socket.js +0 -0
- package/cjs/lib/Types/State.d.ts +0 -0
- package/cjs/lib/Types/State.js +0 -0
- package/cjs/lib/Types/USync.d.ts +0 -0
- package/cjs/lib/Types/USync.js +0 -0
- package/cjs/lib/Types/index.d.ts +0 -0
- package/cjs/lib/Types/index.js +0 -0
- package/cjs/lib/Utils/auth-utils.d.ts +0 -0
- package/cjs/lib/Utils/auth-utils.js +0 -0
- package/cjs/lib/Utils/browser-utils.d.ts +0 -0
- package/cjs/lib/Utils/browser-utils.js +0 -0
- package/cjs/lib/Utils/business.d.ts +0 -0
- package/cjs/lib/Utils/business.js +0 -0
- package/cjs/lib/Utils/chat-utils.d.ts +0 -0
- package/cjs/lib/Utils/chat-utils.js +0 -0
- package/cjs/lib/Utils/companion-reg-client-utils.d.ts +0 -0
- package/cjs/lib/Utils/companion-reg-client-utils.js +0 -0
- package/cjs/lib/Utils/crypto.d.ts +0 -0
- package/cjs/lib/Utils/crypto.js +0 -0
- package/cjs/lib/Utils/decode-wa-message.d.ts +0 -0
- package/cjs/lib/Utils/decode-wa-message.js +0 -0
- package/cjs/lib/Utils/event-buffer.d.ts +0 -0
- package/cjs/lib/Utils/event-buffer.js +0 -0
- package/cjs/lib/Utils/generics.d.ts +0 -0
- package/cjs/lib/Utils/generics.js +1 -1
- package/cjs/lib/Utils/history.d.ts +0 -0
- package/cjs/lib/Utils/history.js +0 -0
- package/cjs/lib/Utils/identity-change-handler.d.ts +0 -0
- package/cjs/lib/Utils/identity-change-handler.js +0 -0
- package/cjs/lib/Utils/index.d.ts +0 -0
- package/cjs/lib/Utils/index.js +0 -0
- package/cjs/lib/Utils/link-preview.d.ts +0 -0
- package/cjs/lib/Utils/link-preview.js +0 -0
- package/cjs/lib/Utils/logger.d.ts +0 -0
- package/cjs/lib/Utils/logger.js +0 -0
- package/cjs/lib/Utils/lt-hash.d.ts +0 -0
- package/cjs/lib/Utils/lt-hash.js +0 -0
- package/cjs/lib/Utils/make-mutex.d.ts +0 -0
- package/cjs/lib/Utils/make-mutex.js +0 -0
- package/cjs/lib/Utils/message-retry-manager.d.ts +0 -0
- package/cjs/lib/Utils/message-retry-manager.js +0 -0
- package/cjs/lib/Utils/messages-media.d.ts +0 -0
- package/cjs/lib/Utils/messages-media.js +0 -0
- package/cjs/lib/Utils/messages.d.ts +0 -0
- package/cjs/lib/Utils/messages.js +11 -11
- package/cjs/lib/Utils/noise-handler.d.ts +0 -0
- package/cjs/lib/Utils/noise-handler.js +0 -0
- package/cjs/lib/Utils/offline-node-processor.d.ts +0 -0
- package/cjs/lib/Utils/offline-node-processor.js +0 -0
- package/cjs/lib/Utils/pre-key-manager.d.ts +0 -0
- package/cjs/lib/Utils/pre-key-manager.js +0 -0
- package/cjs/lib/Utils/process-message.d.ts +0 -0
- package/cjs/lib/Utils/process-message.js +0 -0
- package/cjs/lib/Utils/reporting-utils.d.ts +0 -0
- package/cjs/lib/Utils/reporting-utils.js +0 -0
- package/cjs/lib/Utils/rich-message-utils.d.ts +0 -0
- package/cjs/lib/Utils/rich-message-utils.js +6 -6
- package/cjs/lib/Utils/signal.d.ts +0 -0
- package/cjs/lib/Utils/signal.js +0 -0
- package/cjs/lib/Utils/stanza-ack.d.ts +0 -0
- package/cjs/lib/Utils/stanza-ack.js +0 -0
- package/cjs/lib/Utils/sync-action-utils.d.ts +0 -0
- package/cjs/lib/Utils/sync-action-utils.js +0 -0
- package/cjs/lib/Utils/tc-token-utils.d.ts +0 -0
- package/cjs/lib/Utils/tc-token-utils.js +0 -0
- package/cjs/lib/Utils/use-multi-file-auth-state.d.ts +0 -0
- package/cjs/lib/Utils/use-multi-file-auth-state.js +0 -0
- package/cjs/lib/Utils/use-single-file-auth-state.d.ts +0 -0
- package/cjs/lib/Utils/use-single-file-auth-state.js +0 -0
- package/cjs/lib/Utils/use-sqlite-auth-state.d.ts +0 -0
- package/cjs/lib/Utils/use-sqlite-auth-state.js +0 -0
- package/cjs/lib/Utils/validate-connection.d.ts +0 -0
- package/cjs/lib/Utils/validate-connection.js +0 -0
- package/cjs/lib/WABinary/constants.d.ts +0 -0
- package/cjs/lib/WABinary/constants.js +0 -0
- package/cjs/lib/WABinary/decode.d.ts +0 -0
- package/cjs/lib/WABinary/decode.js +0 -0
- package/cjs/lib/WABinary/encode.d.ts +0 -0
- package/cjs/lib/WABinary/encode.js +0 -0
- package/cjs/lib/WABinary/generic-utils.d.ts +0 -0
- package/cjs/lib/WABinary/generic-utils.js +0 -0
- package/cjs/lib/WABinary/index.d.ts +0 -0
- package/cjs/lib/WABinary/index.js +0 -0
- package/cjs/lib/WABinary/jid-utils.d.ts +0 -0
- package/cjs/lib/WABinary/jid-utils.js +0 -0
- package/cjs/lib/WABinary/types.d.ts +0 -0
- package/cjs/lib/WABinary/types.js +0 -0
- package/cjs/lib/WACrypto/appstate-keys.js +0 -0
- package/cjs/lib/WACrypto/curves/constants.js +0 -0
- package/cjs/lib/WACrypto/hkdf.js +0 -0
- package/cjs/lib/WACrypto/index.js +0 -0
- package/cjs/lib/WACrypto/lthash.js +0 -0
- package/cjs/lib/WACrypto/math/constants.js +0 -0
- package/cjs/lib/WACrypto/math/edwards.js +0 -0
- package/cjs/lib/WACrypto/math/fe.js +0 -0
- package/cjs/lib/WACrypto/math/le.js +0 -0
- package/cjs/lib/WACrypto/math/mod.js +0 -0
- package/cjs/lib/WACrypto/util/bytes.js +0 -0
- package/cjs/lib/WACrypto/x25519.js +0 -0
- package/cjs/lib/WACrypto/xeddsa.js +0 -0
- package/cjs/lib/WAM/BinaryInfo.d.ts +0 -0
- package/cjs/lib/WAM/BinaryInfo.js +0 -0
- package/cjs/lib/WAM/constants.d.ts +0 -0
- package/cjs/lib/WAM/constants.js +0 -0
- package/cjs/lib/WAM/encode.d.ts +0 -0
- package/cjs/lib/WAM/encode.js +0 -0
- package/cjs/lib/WAM/index.d.ts +0 -0
- package/cjs/lib/WAM/index.js +0 -0
- package/cjs/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -0
- package/cjs/lib/WAUSync/Protocols/USyncContactProtocol.js +0 -0
- package/cjs/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -0
- package/cjs/lib/WAUSync/Protocols/USyncDeviceProtocol.js +0 -0
- package/cjs/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -0
- package/cjs/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +0 -0
- package/cjs/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -0
- package/cjs/lib/WAUSync/Protocols/USyncStatusProtocol.js +0 -0
- package/cjs/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +0 -0
- package/cjs/lib/WAUSync/Protocols/USyncUsernameProtocol.js +0 -0
- package/cjs/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -0
- package/cjs/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +0 -0
- package/cjs/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -0
- package/cjs/lib/WAUSync/Protocols/UsyncLIDProtocol.js +0 -0
- package/cjs/lib/WAUSync/Protocols/index.d.ts +0 -0
- package/cjs/lib/WAUSync/Protocols/index.js +0 -0
- package/cjs/lib/WAUSync/USyncQuery.d.ts +0 -0
- package/cjs/lib/WAUSync/USyncQuery.js +0 -0
- package/cjs/lib/WAUSync/USyncUser.d.ts +0 -0
- package/cjs/lib/WAUSync/USyncUser.js +0 -0
- package/cjs/lib/WAUSync/index.d.ts +0 -0
- package/cjs/lib/WAUSync/index.js +0 -0
- package/cjs/lib/index.d.ts +0 -0
- package/cjs/lib/index.js +0 -0
- package/cjs/package.json +0 -0
- package/engine-requirements.js +0 -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 +0 -0
- package/lib/Addon/http-error.js +0 -0
- package/lib/Addon/index.d.ts +93 -0
- package/lib/Addon/index.js +23 -1
- package/lib/Addon/keyed-db.d.ts +0 -0
- package/lib/Addon/keyed-db.js +0 -0
- package/lib/Addon/link-preview.d.ts +0 -0
- package/lib/Addon/link-preview.js +0 -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 +2 -2
- package/lib/Defaults/index.js +3 -3
- package/lib/Signal/Group/ciphertext-message.d.ts +0 -0
- package/lib/Signal/Group/ciphertext-message.js +0 -0
- package/lib/Signal/Group/group-cipher.d.ts +0 -0
- package/lib/Signal/Group/group-cipher.js +0 -0
- package/lib/Signal/Group/group-session-builder.d.ts +0 -0
- package/lib/Signal/Group/group-session-builder.js +0 -0
- package/lib/Signal/Group/index.d.ts +0 -0
- package/lib/Signal/Group/index.js +0 -0
- package/lib/Signal/Group/keyhelper.d.ts +0 -0
- package/lib/Signal/Group/keyhelper.js +0 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +0 -0
- package/lib/Signal/Group/sender-chain-key.js +0 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +0 -0
- package/lib/Signal/Group/sender-key-message.d.ts +0 -0
- package/lib/Signal/Group/sender-key-message.js +0 -0
- package/lib/Signal/Group/sender-key-name.d.ts +0 -0
- package/lib/Signal/Group/sender-key-name.js +0 -0
- package/lib/Signal/Group/sender-key-record.d.ts +0 -0
- package/lib/Signal/Group/sender-key-record.js +0 -0
- package/lib/Signal/Group/sender-key-state.d.ts +0 -0
- package/lib/Signal/Group/sender-key-state.js +0 -0
- package/lib/Signal/Group/sender-message-key.d.ts +0 -0
- package/lib/Signal/Group/sender-message-key.js +0 -0
- package/lib/Signal/libsignal.d.ts +0 -0
- package/lib/Signal/libsignal.js +0 -0
- package/lib/Signal/lid-mapping.d.ts +0 -0
- package/lib/Signal/lid-mapping.js +0 -0
- package/lib/Socket/Client/index.d.ts +0 -0
- package/lib/Socket/Client/index.js +0 -0
- package/lib/Socket/Client/types.d.ts +0 -0
- package/lib/Socket/Client/types.js +0 -0
- package/lib/Socket/Client/websocket.d.ts +0 -0
- package/lib/Socket/Client/websocket.js +0 -0
- package/lib/Socket/business.d.ts +0 -0
- package/lib/Socket/business.js +0 -0
- package/lib/Socket/chats.d.ts +0 -0
- package/lib/Socket/chats.js +1 -1
- package/lib/Socket/communities.d.ts +0 -0
- package/lib/Socket/communities.js +0 -0
- package/lib/Socket/groups.d.ts +0 -0
- package/lib/Socket/groups.js +0 -0
- package/lib/Socket/index.d.ts +0 -0
- package/lib/Socket/index.js +0 -0
- package/lib/Socket/messages-recv.d.ts +0 -0
- package/lib/Socket/messages-recv.js +2 -2
- package/lib/Socket/messages-send.d.ts +0 -0
- package/lib/Socket/messages-send.js +19 -19
- package/lib/Socket/mex.d.ts +0 -0
- package/lib/Socket/mex.js +0 -0
- package/lib/Socket/newsletter.d.ts +0 -0
- package/lib/Socket/newsletter.js +1 -1
- package/lib/Socket/socket.d.ts +0 -0
- package/lib/Socket/socket.js +0 -0
- package/lib/Store/index.d.ts +0 -0
- package/lib/Store/index.js +0 -0
- package/lib/Store/make-in-memory-store.d.ts +0 -0
- package/lib/Store/make-in-memory-store.js +1 -1
- package/lib/Store/make-ordered-dictionary.d.ts +0 -0
- package/lib/Store/make-ordered-dictionary.js +0 -0
- package/lib/Store/object-repository.d.ts +0 -0
- package/lib/Store/object-repository.js +0 -0
- package/lib/Transport/crypto.d.ts +0 -0
- package/lib/Transport/crypto.js +0 -0
- package/lib/Transport/curve.d.ts +0 -0
- package/lib/Transport/curve.js +0 -0
- package/lib/Transport/index.d.ts +0 -0
- package/lib/Transport/index.js +0 -0
- package/lib/Transport/internals.d.ts +0 -0
- package/lib/Transport/internals.js +0 -0
- package/lib/Transport/session-builder.d.ts +0 -0
- package/lib/Transport/session-builder.js +0 -0
- package/lib/Transport/session-cipher.d.ts +0 -0
- package/lib/Transport/session-cipher.js +0 -0
- package/lib/Transport/session-record.d.ts +0 -0
- package/lib/Transport/session-record.js +0 -0
- package/lib/Types/Auth.d.ts +0 -0
- package/lib/Types/Auth.js +0 -0
- package/lib/Types/Bussines.d.ts +0 -0
- package/lib/Types/Bussines.js +0 -0
- package/lib/Types/Call.d.ts +0 -0
- package/lib/Types/Call.js +0 -0
- package/lib/Types/Chat.d.ts +0 -0
- package/lib/Types/Chat.js +0 -0
- package/lib/Types/Contact.d.ts +0 -0
- package/lib/Types/Contact.js +0 -0
- package/lib/Types/Events.d.ts +0 -0
- package/lib/Types/Events.js +0 -0
- package/lib/Types/GroupMetadata.d.ts +0 -0
- package/lib/Types/GroupMetadata.js +0 -0
- package/lib/Types/Label.d.ts +0 -0
- package/lib/Types/Label.js +0 -0
- package/lib/Types/LabelAssociation.d.ts +0 -0
- package/lib/Types/LabelAssociation.js +0 -0
- package/lib/Types/Message.d.ts +0 -0
- package/lib/Types/Message.js +1 -1
- package/lib/Types/Mex.d.ts +0 -0
- package/lib/Types/Mex.js +0 -0
- package/lib/Types/Product.d.ts +0 -0
- package/lib/Types/Product.js +0 -0
- package/lib/Types/RichType.d.ts +0 -0
- package/lib/Types/RichType.js +0 -0
- package/lib/Types/Signal.d.ts +0 -0
- package/lib/Types/Signal.js +0 -0
- package/lib/Types/Socket.d.ts +0 -0
- package/lib/Types/Socket.js +0 -0
- package/lib/Types/State.d.ts +0 -0
- package/lib/Types/State.js +0 -0
- package/lib/Types/USync.d.ts +0 -0
- package/lib/Types/USync.js +0 -0
- package/lib/Types/index.d.ts +0 -0
- package/lib/Types/index.js +0 -0
- package/lib/Utils/auth-utils.d.ts +0 -0
- package/lib/Utils/auth-utils.js +0 -0
- package/lib/Utils/browser-utils.d.ts +0 -0
- package/lib/Utils/browser-utils.js +0 -0
- package/lib/Utils/business.d.ts +0 -0
- package/lib/Utils/business.js +0 -0
- package/lib/Utils/chat-utils.d.ts +0 -0
- package/lib/Utils/chat-utils.js +0 -0
- package/lib/Utils/companion-reg-client-utils.d.ts +0 -0
- package/lib/Utils/companion-reg-client-utils.js +0 -0
- package/lib/Utils/crypto.d.ts +0 -0
- package/lib/Utils/crypto.js +0 -0
- package/lib/Utils/decode-wa-message.d.ts +0 -0
- package/lib/Utils/decode-wa-message.js +0 -0
- package/lib/Utils/event-buffer.d.ts +0 -0
- package/lib/Utils/event-buffer.js +0 -0
- package/lib/Utils/generics.d.ts +0 -0
- package/lib/Utils/generics.js +1 -1
- package/lib/Utils/history.d.ts +0 -0
- package/lib/Utils/history.js +0 -0
- package/lib/Utils/identity-change-handler.d.ts +0 -0
- package/lib/Utils/identity-change-handler.js +0 -0
- package/lib/Utils/index.d.ts +0 -0
- package/lib/Utils/index.js +0 -0
- package/lib/Utils/link-preview.d.ts +0 -0
- package/lib/Utils/link-preview.js +0 -0
- package/lib/Utils/logger.d.ts +0 -0
- package/lib/Utils/logger.js +0 -0
- package/lib/Utils/lt-hash.d.ts +0 -0
- package/lib/Utils/lt-hash.js +0 -0
- package/lib/Utils/make-mutex.d.ts +0 -0
- package/lib/Utils/make-mutex.js +0 -0
- package/lib/Utils/message-retry-manager.d.ts +0 -0
- package/lib/Utils/message-retry-manager.js +0 -0
- package/lib/Utils/messages-media.d.ts +0 -0
- package/lib/Utils/messages-media.js +2 -2
- package/lib/Utils/messages.d.ts +0 -0
- package/lib/Utils/messages.js +46 -50
- package/lib/Utils/noise-handler.d.ts +0 -0
- package/lib/Utils/noise-handler.js +0 -0
- package/lib/Utils/offline-node-processor.d.ts +0 -0
- package/lib/Utils/offline-node-processor.js +0 -0
- package/lib/Utils/pre-key-manager.d.ts +0 -0
- package/lib/Utils/pre-key-manager.js +0 -0
- package/lib/Utils/process-message.d.ts +0 -0
- package/lib/Utils/process-message.js +0 -0
- package/lib/Utils/reporting-utils.d.ts +0 -0
- package/lib/Utils/reporting-utils.js +0 -0
- package/lib/Utils/rich-message-utils.d.ts +0 -0
- package/lib/Utils/rich-message-utils.js +10 -13
- package/lib/Utils/signal.d.ts +0 -0
- package/lib/Utils/signal.js +0 -0
- package/lib/Utils/stanza-ack.d.ts +0 -0
- package/lib/Utils/stanza-ack.js +0 -0
- package/lib/Utils/sync-action-utils.d.ts +0 -0
- package/lib/Utils/sync-action-utils.js +0 -0
- package/lib/Utils/tc-token-utils.d.ts +0 -0
- package/lib/Utils/tc-token-utils.js +0 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +0 -0
- package/lib/Utils/use-multi-file-auth-state.js +1 -1
- package/lib/Utils/use-single-file-auth-state.d.ts +0 -0
- package/lib/Utils/use-single-file-auth-state.js +1 -1
- package/lib/Utils/use-sqlite-auth-state.d.ts +0 -0
- package/lib/Utils/use-sqlite-auth-state.js +1 -1
- package/lib/Utils/validate-connection.d.ts +0 -0
- package/lib/Utils/validate-connection.js +0 -0
- package/lib/WABinary/constants.d.ts +0 -0
- package/lib/WABinary/constants.js +0 -0
- package/lib/WABinary/decode.d.ts +0 -0
- package/lib/WABinary/decode.js +0 -0
- package/lib/WABinary/encode.d.ts +0 -0
- package/lib/WABinary/encode.js +0 -0
- package/lib/WABinary/generic-utils.d.ts +0 -0
- package/lib/WABinary/generic-utils.js +0 -2
- package/lib/WABinary/index.d.ts +0 -0
- package/lib/WABinary/index.js +0 -0
- package/lib/WABinary/jid-utils.d.ts +0 -0
- package/lib/WABinary/jid-utils.js +0 -0
- package/lib/WABinary/types.d.ts +0 -0
- package/lib/WABinary/types.js +0 -0
- package/lib/WACrypto/appstate-keys.js +0 -0
- package/lib/WACrypto/curves/constants.js +0 -0
- package/lib/WACrypto/hkdf.js +0 -0
- package/lib/WACrypto/index.js +0 -0
- package/lib/WACrypto/lthash.js +1 -1
- package/lib/WACrypto/math/constants.js +0 -0
- package/lib/WACrypto/math/edwards.js +0 -0
- package/lib/WACrypto/math/fe.js +0 -0
- package/lib/WACrypto/math/le.js +0 -0
- package/lib/WACrypto/math/mod.js +0 -0
- package/lib/WACrypto/util/bytes.js +0 -0
- package/lib/WACrypto/x25519.js +3 -3
- package/lib/WACrypto/xeddsa.js +0 -0
- package/lib/WAM/BinaryInfo.d.ts +0 -0
- package/lib/WAM/BinaryInfo.js +0 -0
- package/lib/WAM/constants.d.ts +0 -0
- package/lib/WAM/constants.js +0 -0
- package/lib/WAM/encode.d.ts +0 -0
- package/lib/WAM/encode.js +0 -0
- package/lib/WAM/index.d.ts +0 -0
- package/lib/WAM/index.js +0 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +0 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +0 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +0 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +0 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +0 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +0 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +0 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +0 -0
- package/lib/WAUSync/Protocols/index.d.ts +0 -0
- package/lib/WAUSync/Protocols/index.js +0 -0
- package/lib/WAUSync/USyncQuery.d.ts +0 -0
- package/lib/WAUSync/USyncQuery.js +0 -0
- package/lib/WAUSync/USyncUser.d.ts +0 -0
- package/lib/WAUSync/USyncUser.js +0 -0
- package/lib/WAUSync/index.d.ts +0 -0
- package/lib/WAUSync/index.js +0 -0
- package/lib/index.d.ts +0 -0
- package/lib/index.js +0 -0
- package/package.json +4 -9
- package/tests/addon-test.mjs +162 -0
- package/tests/differential-test.mjs +90 -0
|
@@ -0,0 +1,54 @@
|
|
|
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 queue_exports = {};
|
|
19
|
+
__export(queue_exports, {
|
|
20
|
+
createQueue: () => createQueue
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(queue_exports);
|
|
23
|
+
function createQueue(concurrency = 1) {
|
|
24
|
+
const limit = Number.isFinite(concurrency) && concurrency > 0 ? Math.floor(concurrency) : 1;
|
|
25
|
+
const pending = [];
|
|
26
|
+
let active = 0;
|
|
27
|
+
function pump() {
|
|
28
|
+
while (active < limit && pending.length > 0) {
|
|
29
|
+
const { task, resolve, reject } = pending.shift();
|
|
30
|
+
active++;
|
|
31
|
+
Promise.resolve().then(task).then(resolve, reject).finally(() => {
|
|
32
|
+
active--;
|
|
33
|
+
pump();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function add(task) {
|
|
38
|
+
if (typeof task !== "function") {
|
|
39
|
+
return Promise.reject(new TypeError("queue.add() expects a function"));
|
|
40
|
+
}
|
|
41
|
+
return new Promise((resolve, reject) => {
|
|
42
|
+
pending.push({ task, resolve, reject });
|
|
43
|
+
pump();
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
add,
|
|
48
|
+
push: add
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
+
0 && (module.exports = {
|
|
53
|
+
createQueue
|
|
54
|
+
});
|
|
@@ -0,0 +1,130 @@
|
|
|
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 waveform_exports = {};
|
|
19
|
+
__export(waveform_exports, {
|
|
20
|
+
getAudioWaveform: () => getAudioWaveform
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(waveform_exports);
|
|
23
|
+
var import_node_child_process = require("node:child_process");
|
|
24
|
+
const SAMPLE_RATE = 16e3;
|
|
25
|
+
const BAR_COUNT = 64;
|
|
26
|
+
const TIMEOUT_MS = 3e4;
|
|
27
|
+
function decodePcm(input) {
|
|
28
|
+
let args;
|
|
29
|
+
let stdinData;
|
|
30
|
+
if (typeof input === "string") {
|
|
31
|
+
args = ["-i", input];
|
|
32
|
+
} else if (Buffer.isBuffer(input) || input instanceof Uint8Array) {
|
|
33
|
+
args = ["-i", "pipe:0"];
|
|
34
|
+
stdinData = Buffer.from(input.buffer, input.byteOffset, input.byteLength);
|
|
35
|
+
} else if (input && typeof input.pipe === "function") {
|
|
36
|
+
args = ["-i", "pipe:0"];
|
|
37
|
+
stdinData = input;
|
|
38
|
+
} else {
|
|
39
|
+
return Promise.reject(new TypeError("getAudioWaveform: expects a path, Buffer/Uint8Array or Readable"));
|
|
40
|
+
}
|
|
41
|
+
return new Promise((resolve, reject) => {
|
|
42
|
+
const child = (0, import_node_child_process.spawn)("ffmpeg", [
|
|
43
|
+
"-v",
|
|
44
|
+
"error",
|
|
45
|
+
...args,
|
|
46
|
+
"-vn",
|
|
47
|
+
// ignore cover art video streams
|
|
48
|
+
"-map",
|
|
49
|
+
"a:0?",
|
|
50
|
+
// first audio stream, when present
|
|
51
|
+
"-f",
|
|
52
|
+
"s16le",
|
|
53
|
+
"-acodec",
|
|
54
|
+
"pcm_s16le",
|
|
55
|
+
"-ac",
|
|
56
|
+
"1",
|
|
57
|
+
"-ar",
|
|
58
|
+
String(SAMPLE_RATE),
|
|
59
|
+
"pipe:1"
|
|
60
|
+
], { stdio: ["pipe", "pipe", "pipe"] });
|
|
61
|
+
const chunks = [];
|
|
62
|
+
let stderr = "";
|
|
63
|
+
let settled = false;
|
|
64
|
+
const timer = setTimeout(() => {
|
|
65
|
+
child.kill("SIGKILL");
|
|
66
|
+
settleReject("ffmpeg timed out");
|
|
67
|
+
}, TIMEOUT_MS);
|
|
68
|
+
function settleReject(message) {
|
|
69
|
+
if (settled) return;
|
|
70
|
+
settled = true;
|
|
71
|
+
clearTimeout(timer);
|
|
72
|
+
reject(new Error(message || "ffmpeg failed"));
|
|
73
|
+
}
|
|
74
|
+
function settleResolve(value) {
|
|
75
|
+
if (settled) return;
|
|
76
|
+
settled = true;
|
|
77
|
+
clearTimeout(timer);
|
|
78
|
+
resolve(value);
|
|
79
|
+
}
|
|
80
|
+
child.stdout.on("data", (c) => chunks.push(c));
|
|
81
|
+
child.stderr.on("data", (c) => stderr += c);
|
|
82
|
+
child.on("error", (err) => settleReject(err.message));
|
|
83
|
+
child.on("close", (code) => {
|
|
84
|
+
const pcm = Buffer.concat(chunks);
|
|
85
|
+
if (code !== 0 || pcm.length === 0) {
|
|
86
|
+
settleReject(stderr.trim() || "no audio stream found in the input");
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
settleResolve({ samples: pcm });
|
|
90
|
+
});
|
|
91
|
+
if (stdinData) {
|
|
92
|
+
child.stdin.on("error", () => {
|
|
93
|
+
});
|
|
94
|
+
if (typeof stdinData.pipe === "function") stdinData.pipe(child.stdin);
|
|
95
|
+
else child.stdin.end(stdinData);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function computeWaveform(samples) {
|
|
100
|
+
const frameCount = Math.floor(samples.length / 2);
|
|
101
|
+
if (frameCount === 0) return { durationSeconds: 0, waveform: new Array(BAR_COUNT).fill(0) };
|
|
102
|
+
const barFrames = frameCount / BAR_COUNT;
|
|
103
|
+
const peaks = new Array(BAR_COUNT).fill(0);
|
|
104
|
+
let globalPeak = 0;
|
|
105
|
+
for (let bar = 0; bar < BAR_COUNT; bar++) {
|
|
106
|
+
const start = Math.floor(bar * barFrames);
|
|
107
|
+
const end = Math.min(frameCount, Math.floor((bar + 1) * barFrames));
|
|
108
|
+
let peak = 0;
|
|
109
|
+
for (let i = start; i < end; i++) {
|
|
110
|
+
const s = Math.abs(samples.readInt16LE(i * 2));
|
|
111
|
+
if (s > peak) peak = s;
|
|
112
|
+
}
|
|
113
|
+
peaks[bar] = peak;
|
|
114
|
+
if (peak > globalPeak) globalPeak = peak;
|
|
115
|
+
}
|
|
116
|
+
const waveform = peaks.map((peak) => {
|
|
117
|
+
if (globalPeak === 0) return 0;
|
|
118
|
+
return Math.max(0, Math.min(100, Math.round(peak / globalPeak * 100)));
|
|
119
|
+
});
|
|
120
|
+
const durationSeconds = Math.round(frameCount / SAMPLE_RATE);
|
|
121
|
+
return { durationSeconds, waveform };
|
|
122
|
+
}
|
|
123
|
+
async function getAudioWaveform(input) {
|
|
124
|
+
const { samples } = await decodePcm(input);
|
|
125
|
+
return computeWaveform(samples);
|
|
126
|
+
}
|
|
127
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
128
|
+
0 && (module.exports = {
|
|
129
|
+
getAudioWaveform
|
|
130
|
+
});
|
|
@@ -0,0 +1,136 @@
|
|
|
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 zip_exports = {};
|
|
19
|
+
__export(zip_exports, {
|
|
20
|
+
createZip: () => createZip
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(zip_exports);
|
|
23
|
+
var import_node_zlib = require("node:zlib");
|
|
24
|
+
var import_crc32 = require("./crc32.js");
|
|
25
|
+
const SIG_LOCAL = 67324752;
|
|
26
|
+
const SIG_CENTRAL = 33639248;
|
|
27
|
+
const SIG_EOCD = 101010256;
|
|
28
|
+
const FLAG_UTF8 = 2048;
|
|
29
|
+
function dosDateTime(date) {
|
|
30
|
+
const d = date instanceof Date && !isNaN(date) ? date : /* @__PURE__ */ new Date();
|
|
31
|
+
const time = (d.getHours() & 31) << 11 | (d.getMinutes() & 63) << 5 | Math.floor(d.getSeconds() / 2) & 31;
|
|
32
|
+
const day = (d.getFullYear() - 1980 & 127) << 9 | (d.getMonth() + 1 & 15) << 5 | d.getDate() & 31;
|
|
33
|
+
return { time, day };
|
|
34
|
+
}
|
|
35
|
+
async function normalizeEntry(entry) {
|
|
36
|
+
if (entry === null || entry === void 0) return null;
|
|
37
|
+
let { name, data } = entry;
|
|
38
|
+
if (typeof name !== "string" || name.length === 0) {
|
|
39
|
+
throw new TypeError('createZip: every entry needs a non-empty "name"');
|
|
40
|
+
}
|
|
41
|
+
let date = entry.date instanceof Date ? entry.date : void 0;
|
|
42
|
+
if (data && typeof data.pipe === "function") {
|
|
43
|
+
const chunks = [];
|
|
44
|
+
for await (const chunk of data) chunks.push(chunk);
|
|
45
|
+
data = Buffer.concat(chunks.map((c) => Buffer.isBuffer(c) ? c : Buffer.from(c)));
|
|
46
|
+
} else if (data && typeof data[Symbol.asyncIterator] === "function") {
|
|
47
|
+
const chunks = [];
|
|
48
|
+
for await (const chunk of data) chunks.push(chunk);
|
|
49
|
+
data = Buffer.concat(chunks.map((c) => Buffer.isBuffer(c) ? c : Buffer.from(c)));
|
|
50
|
+
}
|
|
51
|
+
if (data === void 0 || data === null) return null;
|
|
52
|
+
if (typeof data === "string") data = Buffer.from(data, "utf8");
|
|
53
|
+
else if (ArrayBuffer.isView(data)) data = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
|
|
54
|
+
else if (data instanceof ArrayBuffer) data = Buffer.from(data);
|
|
55
|
+
else if (!Buffer.isBuffer(data)) throw new TypeError(`createZip: entry "${name}" data must be Buffer/Uint8Array/string/stream`);
|
|
56
|
+
return { name, data, date };
|
|
57
|
+
}
|
|
58
|
+
async function createZip(entries) {
|
|
59
|
+
if (entries === null || entries === void 0) {
|
|
60
|
+
throw new TypeError("createZip: expected an array of { name, data } entries");
|
|
61
|
+
}
|
|
62
|
+
const list = [];
|
|
63
|
+
if (Array.isArray(entries) || typeof entries[Symbol.iterator] === "function") {
|
|
64
|
+
for (const entry of entries) {
|
|
65
|
+
const normalized = await normalizeEntry(entry);
|
|
66
|
+
if (normalized) list.push(normalized);
|
|
67
|
+
}
|
|
68
|
+
} else if (typeof entries === "object") {
|
|
69
|
+
for (const [name, data] of Object.entries(entries)) {
|
|
70
|
+
const normalized = await normalizeEntry({ name, data });
|
|
71
|
+
if (normalized) list.push(normalized);
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
throw new TypeError("createZip: expected an array of { name, data } entries");
|
|
75
|
+
}
|
|
76
|
+
const now = dosDateTime(/* @__PURE__ */ new Date());
|
|
77
|
+
const localParts = [];
|
|
78
|
+
const centralParts = [];
|
|
79
|
+
let offset = 0;
|
|
80
|
+
for (const entry of list) {
|
|
81
|
+
const nameBuf = Buffer.from(entry.name, "utf8");
|
|
82
|
+
const raw = entry.data;
|
|
83
|
+
const crc = (0, import_crc32.crc32)(raw);
|
|
84
|
+
let method = 0;
|
|
85
|
+
let payload = raw;
|
|
86
|
+
if (raw.length > 32) {
|
|
87
|
+
const deflated = (0, import_node_zlib.deflateRawSync)(raw, { level: 6 });
|
|
88
|
+
if (deflated.length < raw.length) {
|
|
89
|
+
method = 8;
|
|
90
|
+
payload = deflated;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const { time, day } = entry.date ? dosDateTime(entry.date) : now;
|
|
94
|
+
const local = Buffer.alloc(30);
|
|
95
|
+
local.writeUInt32LE(SIG_LOCAL, 0);
|
|
96
|
+
local.writeUInt16LE(20, 4);
|
|
97
|
+
local.writeUInt16LE(FLAG_UTF8, 6);
|
|
98
|
+
local.writeUInt16LE(method, 8);
|
|
99
|
+
local.writeUInt16LE(time, 10);
|
|
100
|
+
local.writeUInt16LE(day, 12);
|
|
101
|
+
local.writeUInt32LE(crc, 14);
|
|
102
|
+
local.writeUInt32LE(payload.length, 18);
|
|
103
|
+
local.writeUInt32LE(raw.length, 22);
|
|
104
|
+
local.writeUInt16LE(nameBuf.length, 26);
|
|
105
|
+
local.writeUInt16LE(0, 28);
|
|
106
|
+
const central = Buffer.alloc(46);
|
|
107
|
+
central.writeUInt32LE(SIG_CENTRAL, 0);
|
|
108
|
+
central.writeUInt16LE(798, 4);
|
|
109
|
+
central.writeUInt16LE(20, 6);
|
|
110
|
+
central.writeUInt16LE(FLAG_UTF8, 8);
|
|
111
|
+
central.writeUInt16LE(method, 10);
|
|
112
|
+
central.writeUInt16LE(time, 12);
|
|
113
|
+
central.writeUInt16LE(day, 14);
|
|
114
|
+
central.writeUInt32LE(crc, 16);
|
|
115
|
+
central.writeUInt32LE(payload.length, 20);
|
|
116
|
+
central.writeUInt32LE(raw.length, 24);
|
|
117
|
+
central.writeUInt16LE(nameBuf.length, 28);
|
|
118
|
+
central.writeUInt32LE(384 << 16, 38);
|
|
119
|
+
central.writeUInt32LE(offset, 42);
|
|
120
|
+
localParts.push(local, nameBuf, payload);
|
|
121
|
+
centralParts.push(central, nameBuf);
|
|
122
|
+
offset += local.length + nameBuf.length + payload.length;
|
|
123
|
+
}
|
|
124
|
+
const centralDir = Buffer.concat(centralParts);
|
|
125
|
+
const eocd = Buffer.alloc(22);
|
|
126
|
+
eocd.writeUInt32LE(SIG_EOCD, 0);
|
|
127
|
+
eocd.writeUInt16LE(list.length, 8);
|
|
128
|
+
eocd.writeUInt16LE(list.length, 10);
|
|
129
|
+
eocd.writeUInt32LE(centralDir.length, 12);
|
|
130
|
+
eocd.writeUInt32LE(offset, 16);
|
|
131
|
+
return Buffer.concat([...localParts, centralDir, eocd]);
|
|
132
|
+
}
|
|
133
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
134
|
+
0 && (module.exports = {
|
|
135
|
+
createZip
|
|
136
|
+
});
|
|
@@ -3,8 +3,8 @@ export const BIZ_BOT_SUPPORT_PAYLOAD: "{\"version\":1,\"is_ai_message\":true,\"s
|
|
|
3
3
|
export const DEFAULT_ORIGIN: "https://web.whatsapp.com";
|
|
4
4
|
export const CALL_VIDEO_PREFIX: "https://call.whatsapp.com/video/";
|
|
5
5
|
export const CALL_AUDIO_PREFIX: "https://call.whatsapp.com/voice/";
|
|
6
|
-
export const DONATE_URL: "https://
|
|
7
|
-
export const LIBRARY_NAME: "
|
|
6
|
+
export const DONATE_URL: "https://github.com/eduh_dev021/baileys";
|
|
7
|
+
export const LIBRARY_NAME: "eduh_dev021/baileys";
|
|
8
8
|
export const TEXT_ENCODER: TextEncoder;
|
|
9
9
|
export const TEXT_DECODER: TextDecoder;
|
|
10
10
|
export const DEF_CALLBACK_PREFIX: "CB:";
|
|
@@ -78,8 +78,8 @@ const BIZ_BOT_SUPPORT_PAYLOAD = '{"version":1,"is_ai_message":true,"should_uploa
|
|
|
78
78
|
const DEFAULT_ORIGIN = "https://web.whatsapp.com";
|
|
79
79
|
const CALL_VIDEO_PREFIX = "https://call.whatsapp.com/video/";
|
|
80
80
|
const CALL_AUDIO_PREFIX = "https://call.whatsapp.com/voice/";
|
|
81
|
-
const DONATE_URL = "https://
|
|
82
|
-
const LIBRARY_NAME = "
|
|
81
|
+
const DONATE_URL = "https://github.com/eduh_dev021/baileys";
|
|
82
|
+
const LIBRARY_NAME = "eduh_dev021/baileys";
|
|
83
83
|
const TEXT_ENCODER = new TextEncoder();
|
|
84
84
|
const TEXT_DECODER = new TextDecoder();
|
|
85
85
|
const DEF_CALLBACK_PREFIX = "CB:";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/cjs/lib/Socket/chats.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/cjs/lib/Socket/groups.js
CHANGED
|
File without changes
|
|
File without changes
|
package/cjs/lib/Socket/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -265,7 +265,7 @@ const makeMessagesSocket = (config) => {
|
|
|
265
265
|
type: import_WAProto.proto.Message.ProtocolMessage.Type.GROUP_MEMBER_LABEL_CHANGE,
|
|
266
266
|
memberLabel: {
|
|
267
267
|
label: memberLabel?.slice(0, 30),
|
|
268
|
-
labelTimestamp:
|
|
268
|
+
labelTimestamp: import_Utils.unixTimestampSeconds
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
}, {
|
|
@@ -458,7 +458,7 @@ const makeMessagesSocket = (config) => {
|
|
|
458
458
|
binaryNodeContent.push({
|
|
459
459
|
tag: "plaintext",
|
|
460
460
|
attrs: extraAttrs,
|
|
461
|
-
//
|
|
461
|
+
// Add extraAttrs to fix media being rejected when sending to newsletter (◠‿◕)
|
|
462
462
|
content: bytes
|
|
463
463
|
});
|
|
464
464
|
const stanza2 = {
|
|
@@ -522,13 +522,13 @@ const makeMessagesSocket = (config) => {
|
|
|
522
522
|
return result[jid] || {};
|
|
523
523
|
}
|
|
524
524
|
return {};
|
|
525
|
-
})
|
|
525
|
+
})
|
|
526
526
|
]);
|
|
527
527
|
const participantsList = groupData ? groupData.participants.map((p) => p.id) : [];
|
|
528
528
|
if (groupData?.ephemeralDuration && groupData.ephemeralDuration > 0) {
|
|
529
529
|
additionalAttributes = {
|
|
530
530
|
...additionalAttributes,
|
|
531
|
-
expiration: groupData.ephemeralDuration.toString
|
|
531
|
+
expiration: groupData.ephemeralDuration.toString
|
|
532
532
|
};
|
|
533
533
|
}
|
|
534
534
|
if (isStatus && statusJidList) {
|
|
@@ -706,7 +706,7 @@ const makeMessagesSocket = (config) => {
|
|
|
706
706
|
attrs: {
|
|
707
707
|
v: "2",
|
|
708
708
|
type,
|
|
709
|
-
count: (participant.count || 0).toString
|
|
709
|
+
count: (participant.count || 0).toString
|
|
710
710
|
},
|
|
711
711
|
content: encryptedContent
|
|
712
712
|
});
|
|
@@ -1013,7 +1013,7 @@ const makeMessagesSocket = (config) => {
|
|
|
1013
1013
|
ev.emit("messages.update", [{ key: message.key, update: { message: message.message } }]);
|
|
1014
1014
|
return message;
|
|
1015
1015
|
},
|
|
1016
|
-
//
|
|
1016
|
+
// Add support for modifying additionalNodes and additionalAttributes using "options" in sendMessage
|
|
1017
1017
|
sendMessage: async (jid, content, options = {}) => {
|
|
1018
1018
|
var _a;
|
|
1019
1019
|
const userJid = authState.creds.me.id;
|
|
@@ -1161,7 +1161,7 @@ const makeMessagesSocket = (config) => {
|
|
|
1161
1161
|
additionalNodes.push({
|
|
1162
1162
|
tag: "meta",
|
|
1163
1163
|
attrs: {
|
|
1164
|
-
//
|
|
1164
|
+
// Still a hypothesis regarding PollResult ༎ຶ‿༎ຶ
|
|
1165
1165
|
polltype: isQuizMsg ? "quiz_creation" : "creation",
|
|
1166
1166
|
contenttype: isPollMsg && isNewsletter ? "text" : void 0
|
|
1167
1167
|
},
|
package/cjs/lib/Socket/mex.d.ts
CHANGED
|
File without changes
|
package/cjs/lib/Socket/mex.js
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -89,7 +89,7 @@ const makeNewsletterSocket = (config) => {
|
|
|
89
89
|
newsletterSubscribers: async (jid) => {
|
|
90
90
|
return executeWMexQuery({ newsletter_id: jid }, import_Types.QueryIds.SUBSCRIBERS, import_Types.XWAPaths.xwa2_newsletter_subscribers);
|
|
91
91
|
},
|
|
92
|
-
//
|
|
92
|
+
// Add newsletterSubscribed to fetch all subscribed newsletters (similar to groupFetchAllParticipating ( ╹▽╹ ))
|
|
93
93
|
newsletterSubscribed: async () => {
|
|
94
94
|
return executeWMexQuery({}, import_Types.QueryIds.SUBSCRIBED, import_Types.XWAPaths.xwa2_newsletter_subscribed);
|
|
95
95
|
},
|
|
File without changes
|
package/cjs/lib/Socket/socket.js
CHANGED
|
File without changes
|
package/cjs/lib/Store/index.d.ts
CHANGED
|
File without changes
|
package/cjs/lib/Store/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/cjs/lib/Types/Auth.d.ts
CHANGED
|
File without changes
|
package/cjs/lib/Types/Auth.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/cjs/lib/Types/Call.d.ts
CHANGED
|
File without changes
|
package/cjs/lib/Types/Call.js
CHANGED
|
File without changes
|
package/cjs/lib/Types/Chat.d.ts
CHANGED
|
File without changes
|
package/cjs/lib/Types/Chat.js
CHANGED
|
File without changes
|
|
File without changes
|
package/cjs/lib/Types/Contact.js
CHANGED
|
File without changes
|
|
File without changes
|
package/cjs/lib/Types/Events.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/cjs/lib/Types/Label.d.ts
CHANGED
|
File without changes
|
package/cjs/lib/Types/Label.js
CHANGED
|
File without changes
|