xspacesocket 0.0.0-stage → 1.3.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 +32 -0
- package/README.md +143 -2
- package/WAProto/GenerateStatics.sh +3 -0
- package/WAProto/WAProto.proto +5488 -0
- package/WAProto/fix-imports.js +85 -0
- package/WAProto/index.d.ts +14043 -0
- package/WAProto/index.js +107198 -0
- package/engine-requirements.js +10 -0
- package/lib/Defaults/index.d.ts +81 -0
- package/lib/Defaults/index.d.ts.map +1 -0
- package/lib/Defaults/index.js +146 -0
- package/lib/Defaults/index.js.map +1 -0
- package/lib/Signal/Group/ciphertext-message.d.ts +10 -0
- package/lib/Signal/Group/ciphertext-message.d.ts.map +1 -0
- package/lib/Signal/Group/ciphertext-message.js +12 -0
- package/lib/Signal/Group/ciphertext-message.js.map +1 -0
- package/lib/Signal/Group/group-session-builder.d.ts +15 -0
- package/lib/Signal/Group/group-session-builder.d.ts.map +1 -0
- package/lib/Signal/Group/group-session-builder.js +30 -0
- package/lib/Signal/Group/group-session-builder.js.map +1 -0
- package/lib/Signal/Group/group_cipher.d.ts +17 -0
- package/lib/Signal/Group/group_cipher.d.ts.map +1 -0
- package/lib/Signal/Group/group_cipher.js +82 -0
- package/lib/Signal/Group/group_cipher.js.map +1 -0
- package/lib/Signal/Group/index.d.ts +12 -0
- package/lib/Signal/Group/index.d.ts.map +1 -0
- package/lib/Signal/Group/index.js +12 -0
- package/lib/Signal/Group/index.js.map +1 -0
- package/lib/Signal/Group/keyhelper.d.ts +11 -0
- package/lib/Signal/Group/keyhelper.d.ts.map +1 -0
- package/lib/Signal/Group/keyhelper.js +18 -0
- package/lib/Signal/Group/keyhelper.js.map +1 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +14 -0
- package/lib/Signal/Group/sender-chain-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-chain-key.js +26 -0
- package/lib/Signal/Group/sender-chain-key.js.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +17 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +63 -0
- package/lib/Signal/Group/sender-key-distribution-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-message.d.ts +19 -0
- package/lib/Signal/Group/sender-key-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-message.js +66 -0
- package/lib/Signal/Group/sender-key-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-name.d.ts +18 -0
- package/lib/Signal/Group/sender-key-name.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-name.js +48 -0
- package/lib/Signal/Group/sender-key-name.js.map +1 -0
- package/lib/Signal/Group/sender-key-record.d.ts +31 -0
- package/lib/Signal/Group/sender-key-record.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-record.js +41 -0
- package/lib/Signal/Group/sender-key-record.js.map +1 -0
- package/lib/Signal/Group/sender-key-state.d.ts +39 -0
- package/lib/Signal/Group/sender-key-state.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-state.js +84 -0
- package/lib/Signal/Group/sender-key-state.js.map +1 -0
- package/lib/Signal/Group/sender-message-key.d.ts +12 -0
- package/lib/Signal/Group/sender-message-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-message-key.js +26 -0
- package/lib/Signal/Group/sender-message-key.js.map +1 -0
- package/lib/Signal/libsignal.d.ts +5 -0
- package/lib/Signal/libsignal.d.ts.map +1 -0
- package/lib/Signal/libsignal.js +431 -0
- package/lib/Signal/libsignal.js.map +1 -0
- package/lib/Signal/lid-mapping.d.ts +23 -0
- package/lib/Signal/lid-mapping.d.ts.map +1 -0
- package/lib/Signal/lid-mapping.js +277 -0
- package/lib/Signal/lid-mapping.js.map +1 -0
- package/lib/Socket/Client/index.d.ts +3 -0
- package/lib/Socket/Client/index.d.ts.map +1 -0
- package/lib/Socket/Client/index.js +3 -0
- package/lib/Socket/Client/index.js.map +1 -0
- package/lib/Socket/Client/types.d.ts +16 -0
- package/lib/Socket/Client/types.d.ts.map +1 -0
- package/lib/Socket/Client/types.js +11 -0
- package/lib/Socket/Client/types.js.map +1 -0
- package/lib/Socket/Client/websocket.d.ts +13 -0
- package/lib/Socket/Client/websocket.d.ts.map +1 -0
- package/lib/Socket/Client/websocket.js +54 -0
- package/lib/Socket/Client/websocket.js.map +1 -0
- package/lib/Socket/business.d.ts +387 -0
- package/lib/Socket/business.d.ts.map +1 -0
- package/lib/Socket/business.js +379 -0
- package/lib/Socket/business.js.map +1 -0
- package/lib/Socket/channelPollVote.d.ts +44 -0
- package/lib/Socket/channelPollVote.d.ts.map +1 -0
- package/lib/Socket/channelPollVote.js +65 -0
- package/lib/Socket/channelPollVote.js.map +1 -0
- package/lib/Socket/channelSchedule.d.ts +229 -0
- package/lib/Socket/channelSchedule.d.ts.map +1 -0
- package/lib/Socket/channelSchedule.js +465 -0
- package/lib/Socket/channelSchedule.js.map +1 -0
- package/lib/Socket/channelStatus.d.ts +317 -0
- package/lib/Socket/channelStatus.d.ts.map +1 -0
- package/lib/Socket/channelStatus.js +479 -0
- package/lib/Socket/channelStatus.js.map +1 -0
- package/lib/Socket/chats.d.ts +150 -0
- package/lib/Socket/chats.d.ts.map +1 -0
- package/lib/Socket/chats.js +1313 -0
- package/lib/Socket/chats.js.map +1 -0
- package/lib/Socket/communities.d.ts +444 -0
- package/lib/Socket/communities.d.ts.map +1 -0
- package/lib/Socket/communities.js +447 -0
- package/lib/Socket/communities.js.map +1 -0
- package/lib/Socket/groupHistory.d.ts +38 -0
- package/lib/Socket/groupHistory.d.ts.map +1 -0
- package/lib/Socket/groupHistory.js +88 -0
- package/lib/Socket/groupHistory.js.map +1 -0
- package/lib/Socket/groupStatus.d.ts +28 -0
- package/lib/Socket/groupStatus.d.ts.map +1 -0
- package/lib/Socket/groupStatus.js +47 -0
- package/lib/Socket/groupStatus.js.map +1 -0
- package/lib/Socket/groups.d.ts +167 -0
- package/lib/Socket/groups.d.ts.map +1 -0
- package/lib/Socket/groups.js +354 -0
- package/lib/Socket/groups.js.map +1 -0
- package/lib/Socket/index.d.ts +430 -0
- package/lib/Socket/index.d.ts.map +1 -0
- package/lib/Socket/index.js +12 -0
- package/lib/Socket/index.js.map +1 -0
- package/lib/Socket/messages-recv.d.ts +373 -0
- package/lib/Socket/messages-recv.d.ts.map +1 -0
- package/lib/Socket/messages-recv.js +1897 -0
- package/lib/Socket/messages-recv.js.map +1 -0
- package/lib/Socket/messages-send.d.ts +404 -0
- package/lib/Socket/messages-send.d.ts.map +1 -0
- package/lib/Socket/messages-send.js +1528 -0
- package/lib/Socket/messages-send.js.map +1 -0
- package/lib/Socket/mex.d.ts +3 -0
- package/lib/Socket/mex.d.ts.map +1 -0
- package/lib/Socket/mex.js +42 -0
- package/lib/Socket/mex.js.map +1 -0
- package/lib/Socket/newsletter.d.ts +176 -0
- package/lib/Socket/newsletter.d.ts.map +1 -0
- package/lib/Socket/newsletter.js +181 -0
- package/lib/Socket/newsletter.js.map +1 -0
- package/lib/Socket/newsletterDirectory.d.ts +201 -0
- package/lib/Socket/newsletterDirectory.d.ts.map +1 -0
- package/lib/Socket/newsletterDirectory.js +291 -0
- package/lib/Socket/newsletterDirectory.js.map +1 -0
- package/lib/Socket/payment.d.ts +37 -0
- package/lib/Socket/payment.d.ts.map +1 -0
- package/lib/Socket/payment.js +124 -0
- package/lib/Socket/payment.js.map +1 -0
- package/lib/Socket/report.d.ts +70 -0
- package/lib/Socket/report.d.ts.map +1 -0
- package/lib/Socket/report.js +265 -0
- package/lib/Socket/report.js.map +1 -0
- package/lib/Socket/socket.d.ts +59 -0
- package/lib/Socket/socket.d.ts.map +1 -0
- package/lib/Socket/socket.js +982 -0
- package/lib/Socket/socket.js.map +1 -0
- package/lib/Socket/stickerPack.d.ts +29 -0
- package/lib/Socket/stickerPack.d.ts.map +1 -0
- package/lib/Socket/stickerPack.js +130 -0
- package/lib/Socket/stickerPack.js.map +1 -0
- package/lib/Socket/username.d.ts +55 -0
- package/lib/Socket/username.d.ts.map +1 -0
- package/lib/Socket/username.js +114 -0
- package/lib/Socket/username.js.map +1 -0
- package/lib/Types/Auth.d.ts +117 -0
- package/lib/Types/Auth.d.ts.map +1 -0
- package/lib/Types/Auth.js +2 -0
- package/lib/Types/Auth.js.map +1 -0
- package/lib/Types/Bussines.d.ts +25 -0
- package/lib/Types/Bussines.d.ts.map +1 -0
- package/lib/Types/Bussines.js +2 -0
- package/lib/Types/Bussines.js.map +1 -0
- package/lib/Types/Call.d.ts +15 -0
- package/lib/Types/Call.d.ts.map +1 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Call.js.map +1 -0
- package/lib/Types/ChannelStatus.d.ts +34 -0
- package/lib/Types/ChannelStatus.d.ts.map +1 -0
- package/lib/Types/ChannelStatus.js +2 -0
- package/lib/Types/ChannelStatus.js.map +1 -0
- package/lib/Types/Chat.d.ts +141 -0
- package/lib/Types/Chat.d.ts.map +1 -0
- package/lib/Types/Chat.js +8 -0
- package/lib/Types/Chat.js.map +1 -0
- package/lib/Types/Contact.d.ts +26 -0
- package/lib/Types/Contact.d.ts.map +1 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Contact.js.map +1 -0
- package/lib/Types/Events.d.ts +260 -0
- package/lib/Types/Events.d.ts.map +1 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/Events.js.map +1 -0
- package/lib/Types/GroupMetadata.d.ts +73 -0
- package/lib/Types/GroupMetadata.d.ts.map +1 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/GroupMetadata.js.map +1 -0
- package/lib/Types/Label.d.ts +47 -0
- package/lib/Types/Label.d.ts.map +1 -0
- package/lib/Types/Label.js +25 -0
- package/lib/Types/Label.js.map +1 -0
- package/lib/Types/LabelAssociation.d.ts +30 -0
- package/lib/Types/LabelAssociation.d.ts.map +1 -0
- package/lib/Types/LabelAssociation.js +7 -0
- package/lib/Types/LabelAssociation.js.map +1 -0
- package/lib/Types/Message.d.ts +466 -0
- package/lib/Types/Message.d.ts.map +1 -0
- package/lib/Types/Message.js +11 -0
- package/lib/Types/Message.js.map +1 -0
- package/lib/Types/Mex.d.ts +141 -0
- package/lib/Types/Mex.d.ts.map +1 -0
- package/lib/Types/Mex.js +37 -0
- package/lib/Types/Mex.js.map +1 -0
- package/lib/Types/Payment.d.ts +47 -0
- package/lib/Types/Payment.d.ts.map +1 -0
- package/lib/Types/Payment.js +2 -0
- package/lib/Types/Payment.js.map +1 -0
- package/lib/Types/Product.d.ts +79 -0
- package/lib/Types/Product.d.ts.map +1 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/Product.js.map +1 -0
- package/lib/Types/Report.d.ts +219 -0
- package/lib/Types/Report.d.ts.map +1 -0
- package/lib/Types/Report.js +166 -0
- package/lib/Types/Report.js.map +1 -0
- package/lib/Types/Signal.d.ts +87 -0
- package/lib/Types/Signal.d.ts.map +1 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Signal.js.map +1 -0
- package/lib/Types/Socket.d.ts +136 -0
- package/lib/Types/Socket.d.ts.map +1 -0
- package/lib/Types/Socket.js +3 -0
- package/lib/Types/Socket.js.map +1 -0
- package/lib/Types/State.d.ts +97 -0
- package/lib/Types/State.d.ts.map +1 -0
- package/lib/Types/State.js +56 -0
- package/lib/Types/State.js.map +1 -0
- package/lib/Types/StickerPack.d.ts +52 -0
- package/lib/Types/StickerPack.d.ts.map +1 -0
- package/lib/Types/StickerPack.js +2 -0
- package/lib/Types/StickerPack.js.map +1 -0
- package/lib/Types/USync.d.ts +26 -0
- package/lib/Types/USync.d.ts.map +1 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/USync.js.map +1 -0
- package/lib/Types/Username.d.ts +19 -0
- package/lib/Types/Username.d.ts.map +1 -0
- package/lib/Types/Username.js +2 -0
- package/lib/Types/Username.js.map +1 -0
- package/lib/Types/index.d.ts +71 -0
- package/lib/Types/index.d.ts.map +1 -0
- package/lib/Types/index.js +31 -0
- package/lib/Types/index.js.map +1 -0
- package/lib/Utils/auth-utils.d.ts +24 -0
- package/lib/Utils/auth-utils.d.ts.map +1 -0
- package/lib/Utils/auth-utils.js +302 -0
- package/lib/Utils/auth-utils.js.map +1 -0
- package/lib/Utils/browser-utils.d.ts +4 -0
- package/lib/Utils/browser-utils.d.ts.map +1 -0
- package/lib/Utils/browser-utils.js +29 -0
- package/lib/Utils/browser-utils.js.map +1 -0
- package/lib/Utils/business.d.ts +23 -0
- package/lib/Utils/business.d.ts.map +1 -0
- package/lib/Utils/business.js +231 -0
- package/lib/Utils/business.js.map +1 -0
- package/lib/Utils/chat-utils.d.ts +100 -0
- package/lib/Utils/chat-utils.d.ts.map +1 -0
- package/lib/Utils/chat-utils.js +890 -0
- package/lib/Utils/chat-utils.js.map +1 -0
- package/lib/Utils/companion-reg-client-utils.d.ts +17 -0
- package/lib/Utils/companion-reg-client-utils.d.ts.map +1 -0
- package/lib/Utils/companion-reg-client-utils.js +35 -0
- package/lib/Utils/companion-reg-client-utils.js.map +1 -0
- package/lib/Utils/crypto.d.ts +37 -0
- package/lib/Utils/crypto.d.ts.map +1 -0
- package/lib/Utils/crypto.js +118 -0
- package/lib/Utils/crypto.js.map +1 -0
- package/lib/Utils/decode-wa-message.d.ts +66 -0
- package/lib/Utils/decode-wa-message.d.ts.map +1 -0
- package/lib/Utils/decode-wa-message.js +317 -0
- package/lib/Utils/decode-wa-message.js.map +1 -0
- package/lib/Utils/event-buffer.d.ts +36 -0
- package/lib/Utils/event-buffer.d.ts.map +1 -0
- package/lib/Utils/event-buffer.js +642 -0
- package/lib/Utils/event-buffer.js.map +1 -0
- package/lib/Utils/generics.d.ts +92 -0
- package/lib/Utils/generics.d.ts.map +1 -0
- package/lib/Utils/generics.js +393 -0
- package/lib/Utils/generics.js.map +1 -0
- package/lib/Utils/group-history.d.ts +37 -0
- package/lib/Utils/group-history.d.ts.map +1 -0
- package/lib/Utils/group-history.js +55 -0
- package/lib/Utils/group-history.js.map +1 -0
- package/lib/Utils/history.d.ts +24 -0
- package/lib/Utils/history.d.ts.map +1 -0
- package/lib/Utils/history.js +134 -0
- package/lib/Utils/history.js.map +1 -0
- package/lib/Utils/identity-change-handler.d.ts +44 -0
- package/lib/Utils/identity-change-handler.d.ts.map +1 -0
- package/lib/Utils/identity-change-handler.js +50 -0
- package/lib/Utils/identity-change-handler.js.map +1 -0
- package/lib/Utils/index.d.ts +26 -0
- package/lib/Utils/index.d.ts.map +1 -0
- package/lib/Utils/index.js +26 -0
- package/lib/Utils/index.js.map +1 -0
- package/lib/Utils/link-preview.d.ts +21 -0
- package/lib/Utils/link-preview.d.ts.map +1 -0
- package/lib/Utils/link-preview.js +99 -0
- package/lib/Utils/link-preview.js.map +1 -0
- package/lib/Utils/logger.d.ts +13 -0
- package/lib/Utils/logger.d.ts.map +1 -0
- package/lib/Utils/logger.js +3 -0
- package/lib/Utils/logger.js.map +1 -0
- package/lib/Utils/lt-hash.d.ts +8 -0
- package/lib/Utils/lt-hash.d.ts.map +1 -0
- package/lib/Utils/lt-hash.js +8 -0
- package/lib/Utils/lt-hash.js.map +1 -0
- package/lib/Utils/make-mutex.d.ts +9 -0
- package/lib/Utils/make-mutex.d.ts.map +1 -0
- package/lib/Utils/make-mutex.js +33 -0
- package/lib/Utils/make-mutex.js.map +1 -0
- package/lib/Utils/message-retry-manager.d.ts +119 -0
- package/lib/Utils/message-retry-manager.d.ts.map +1 -0
- package/lib/Utils/message-retry-manager.js +276 -0
- package/lib/Utils/message-retry-manager.js.map +1 -0
- package/lib/Utils/messages-media.d.ts +149 -0
- package/lib/Utils/messages-media.d.ts.map +1 -0
- package/lib/Utils/messages-media.js +875 -0
- package/lib/Utils/messages-media.js.map +1 -0
- package/lib/Utils/messages.d.ts +178 -0
- package/lib/Utils/messages.d.ts.map +1 -0
- package/lib/Utils/messages.js +1325 -0
- package/lib/Utils/messages.js.map +1 -0
- package/lib/Utils/noise-handler.d.ts +20 -0
- package/lib/Utils/noise-handler.d.ts.map +1 -0
- package/lib/Utils/noise-handler.js +201 -0
- package/lib/Utils/noise-handler.js.map +1 -0
- package/lib/Utils/offline-node-processor.d.ts +17 -0
- package/lib/Utils/offline-node-processor.d.ts.map +1 -0
- package/lib/Utils/offline-node-processor.js +40 -0
- package/lib/Utils/offline-node-processor.js.map +1 -0
- package/lib/Utils/pre-key-manager.d.ts +28 -0
- package/lib/Utils/pre-key-manager.d.ts.map +1 -0
- package/lib/Utils/pre-key-manager.js +106 -0
- package/lib/Utils/pre-key-manager.js.map +1 -0
- package/lib/Utils/process-message.d.ts +85 -0
- package/lib/Utils/process-message.d.ts.map +1 -0
- package/lib/Utils/process-message.js +688 -0
- package/lib/Utils/process-message.js.map +1 -0
- package/lib/Utils/reporting-utils.d.ts +18 -0
- package/lib/Utils/reporting-utils.d.ts.map +1 -0
- package/lib/Utils/reporting-utils.js +265 -0
- package/lib/Utils/reporting-utils.js.map +1 -0
- package/lib/Utils/rich-response.d.ts +12 -0
- package/lib/Utils/rich-response.d.ts.map +1 -0
- package/lib/Utils/rich-response.js +97 -0
- package/lib/Utils/rich-response.js.map +1 -0
- package/lib/Utils/signal.d.ts +47 -0
- package/lib/Utils/signal.d.ts.map +1 -0
- package/lib/Utils/signal.js +201 -0
- package/lib/Utils/signal.js.map +1 -0
- package/lib/Utils/stanza-ack.d.ts +11 -0
- package/lib/Utils/stanza-ack.d.ts.map +1 -0
- package/lib/Utils/stanza-ack.js +38 -0
- package/lib/Utils/stanza-ack.js.map +1 -0
- package/lib/Utils/sync-action-utils.d.ts +19 -0
- package/lib/Utils/sync-action-utils.d.ts.map +1 -0
- package/lib/Utils/sync-action-utils.js +49 -0
- package/lib/Utils/sync-action-utils.js.map +1 -0
- package/lib/Utils/sync-key-auto-resolve.d.ts +10 -0
- package/lib/Utils/sync-key-auto-resolve.d.ts.map +1 -0
- package/lib/Utils/sync-key-auto-resolve.js +33 -0
- package/lib/Utils/sync-key-auto-resolve.js.map +1 -0
- package/lib/Utils/tc-token-utils.d.ts +37 -0
- package/lib/Utils/tc-token-utils.d.ts.map +1 -0
- package/lib/Utils/tc-token-utils.js +164 -0
- package/lib/Utils/tc-token-utils.js.map +1 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +13 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-multi-file-auth-state.js +153 -0
- package/lib/Utils/use-multi-file-auth-state.js.map +1 -0
- package/lib/Utils/validate-connection.d.ts +11 -0
- package/lib/Utils/validate-connection.d.ts.map +1 -0
- package/lib/Utils/validate-connection.js +211 -0
- package/lib/Utils/validate-connection.js.map +1 -0
- package/lib/Utils/zip.d.ts +11 -0
- package/lib/Utils/zip.d.ts.map +1 -0
- package/lib/Utils/zip.js +88 -0
- package/lib/Utils/zip.js.map +1 -0
- package/lib/WABinary/constants.d.ts +28 -0
- package/lib/WABinary/constants.d.ts.map +1 -0
- package/lib/WABinary/constants.js +1301 -0
- package/lib/WABinary/constants.js.map +1 -0
- package/lib/WABinary/decode.d.ts +7 -0
- package/lib/WABinary/decode.d.ts.map +1 -0
- package/lib/WABinary/decode.js +262 -0
- package/lib/WABinary/decode.js.map +1 -0
- package/lib/WABinary/encode.d.ts +3 -0
- package/lib/WABinary/encode.d.ts.map +1 -0
- package/lib/WABinary/encode.js +220 -0
- package/lib/WABinary/encode.js.map +1 -0
- package/lib/WABinary/generic-utils.d.ts +22 -0
- package/lib/WABinary/generic-utils.d.ts.map +1 -0
- package/lib/WABinary/generic-utils.js +201 -0
- package/lib/WABinary/generic-utils.js.map +1 -0
- package/lib/WABinary/index.d.ts +6 -0
- package/lib/WABinary/index.d.ts.map +1 -0
- package/lib/WABinary/index.js +6 -0
- package/lib/WABinary/index.js.map +1 -0
- package/lib/WABinary/jid-utils.d.ts +48 -0
- package/lib/WABinary/jid-utils.d.ts.map +1 -0
- package/lib/WABinary/jid-utils.js +96 -0
- package/lib/WABinary/jid-utils.js.map +1 -0
- package/lib/WABinary/types.d.ts +19 -0
- package/lib/WABinary/types.d.ts.map +1 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WABinary/types.js.map +1 -0
- package/lib/WAM/BinaryInfo.d.ts +9 -0
- package/lib/WAM/BinaryInfo.d.ts.map +1 -0
- package/lib/WAM/BinaryInfo.js +10 -0
- package/lib/WAM/BinaryInfo.js.map +1 -0
- package/lib/WAM/constants.d.ts +40 -0
- package/lib/WAM/constants.d.ts.map +1 -0
- package/lib/WAM/constants.js +22853 -0
- package/lib/WAM/constants.js.map +1 -0
- package/lib/WAM/encode.d.ts +3 -0
- package/lib/WAM/encode.d.ts.map +1 -0
- package/lib/WAM/encode.js +150 -0
- package/lib/WAM/encode.js.map +1 -0
- package/lib/WAM/index.d.ts +4 -0
- package/lib/WAM/index.d.ts.map +1 -0
- package/lib/WAM/index.js +4 -0
- package/lib/WAM/index.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +10 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +52 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +23 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +54 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +13 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +13 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +10 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +26 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +51 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +10 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/index.d.ts +6 -0
- package/lib/WAUSync/Protocols/index.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/index.js +6 -0
- package/lib/WAUSync/Protocols/index.js.map +1 -0
- package/lib/WAUSync/USyncQuery.d.ts +30 -0
- package/lib/WAUSync/USyncQuery.d.ts.map +1 -0
- package/lib/WAUSync/USyncQuery.js +98 -0
- package/lib/WAUSync/USyncQuery.js.map +1 -0
- package/lib/WAUSync/USyncUser.d.ts +17 -0
- package/lib/WAUSync/USyncUser.d.ts.map +1 -0
- package/lib/WAUSync/USyncUser.js +31 -0
- package/lib/WAUSync/USyncUser.js.map +1 -0
- package/lib/WAUSync/index.d.ts +4 -0
- package/lib/WAUSync/index.d.ts.map +1 -0
- package/lib/WAUSync/index.js +4 -0
- package/lib/WAUSync/index.js.map +1 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +11 -0
- package/lib/index.js.map +1 -0
- package/package.json +139 -4
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import { Boom } from '@hapi/boom';
|
|
2
|
+
import { proto } from '../../WAProto/index.js';
|
|
3
|
+
import { generateMessageIDV2 } from '../Utils/generics.js';
|
|
4
|
+
import { generateWAMessageContent } from '../Utils/index.js';
|
|
5
|
+
import { getBinaryNodeChild, getBinaryNodeChildren } from '../WABinary/index.js';
|
|
6
|
+
/** How long newsletterSendStatus waits for the server echo carrying the posted status's server id. */
|
|
7
|
+
export const CHANNEL_STATUS_ECHO_TIMEOUT_MS = 10000;
|
|
8
|
+
/**
|
|
9
|
+
* Decode a channel status from its incoming `<status>` stanza.
|
|
10
|
+
*
|
|
11
|
+
* Wire shape, captured live 2026-11-09 from Techword 401
|
|
12
|
+
* (120363331321673219@newsletter):
|
|
13
|
+
*
|
|
14
|
+
* <status from="120363331321673219@newsletter" type="text"
|
|
15
|
+
* id="3EB079CA1FB41899DF027B" t="1794223368" server_id="136">
|
|
16
|
+
* <plaintext>proto.Message bytes</plaintext>
|
|
17
|
+
* </status>
|
|
18
|
+
*
|
|
19
|
+
* The plaintext payload is a standard proto.Message — a text status is an
|
|
20
|
+
* extendedTextMessage (field 6) whose field 1 is the text, field 8 the
|
|
21
|
+
* backgroundArgb and field 9 the font; field 35 is messageContextInfo.
|
|
22
|
+
* Non-newsletter `<status>` stanzas are ignored here: Baileys already
|
|
23
|
+
* handles personal statuses through the message stream.
|
|
24
|
+
*/
|
|
25
|
+
export const decodeChannelStatus = (node) => {
|
|
26
|
+
const from = node.attrs.from;
|
|
27
|
+
if (!from?.endsWith('@newsletter')) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
const plaintextNode = getBinaryNodeChild(node, 'plaintext');
|
|
31
|
+
if (!plaintextNode?.content) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
const contentBuf = typeof plaintextNode.content === 'string'
|
|
35
|
+
? Buffer.from(plaintextNode.content, 'binary')
|
|
36
|
+
: Buffer.from(plaintextNode.content);
|
|
37
|
+
let message;
|
|
38
|
+
try {
|
|
39
|
+
// no toJSON(): it turns the font enum into its name ('SYSTEM' for 0)
|
|
40
|
+
message = proto.Message.decode(contentBuf);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
const extendedText = message.extendedTextMessage;
|
|
46
|
+
return {
|
|
47
|
+
id: node.attrs.id || '',
|
|
48
|
+
channelJid: from,
|
|
49
|
+
type: node.attrs.type || 'text',
|
|
50
|
+
serverId: node.attrs.server_id,
|
|
51
|
+
messageTimestamp: +(node.attrs.t || 0),
|
|
52
|
+
offline: !!node.attrs.offline,
|
|
53
|
+
text: extendedText?.text || message.conversation || undefined,
|
|
54
|
+
backgroundArgb: extendedText?.backgroundArgb ?? undefined,
|
|
55
|
+
font: extendedText?.font ?? undefined,
|
|
56
|
+
message
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Set ContextInfo.isQuestion (proto field 63) on the inner message of a
|
|
61
|
+
* built status. The flag lives on the inner message's contextInfo — not
|
|
62
|
+
* on MessageContextInfo, which has no such field (an isQuestion set
|
|
63
|
+
* there is dropped on encode). A view-once envelope is unwrapped first
|
|
64
|
+
* so the flag lands on the real message, not the wrapper.
|
|
65
|
+
*/
|
|
66
|
+
const markQuestion = (message) => {
|
|
67
|
+
let target = message;
|
|
68
|
+
while (target && (target.viewOnceMessageV2 || target.viewOnceMessageV2Extension || target.viewOnceMessage)) {
|
|
69
|
+
const wrapped = target.viewOnceMessageV2 || target.viewOnceMessageV2Extension || target.viewOnceMessage;
|
|
70
|
+
target = wrapped?.message;
|
|
71
|
+
}
|
|
72
|
+
if (!target) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const type = Object.keys(target).find(key => key !== 'messageContextInfo' && key !== 'conversation');
|
|
76
|
+
if (!type) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
// The inner message is a plain object here (Message.create does not
|
|
80
|
+
// convert nested objects into instances), so there is no 'contextInfo'
|
|
81
|
+
// property to test for — set it directly. A type without a
|
|
82
|
+
// contextInfo field ignores it on encode.
|
|
83
|
+
const inner = target[type];
|
|
84
|
+
if (inner && typeof inner === 'object') {
|
|
85
|
+
inner.contextInfo = { ...inner.contextInfo, isQuestion: true };
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Post a channel status — the temporary (24h) update a channel admin posts
|
|
90
|
+
* from the channel, shown in followers' Status tray. It is NOT a channel
|
|
91
|
+
* message (that is sendMessage to the @newsletter JID) and NOT a personal
|
|
92
|
+
* status (that is sendMessage to status@broadcast).
|
|
93
|
+
*
|
|
94
|
+
* Wire shape, proven live 2026-11-09: a top-level `<status>` stanza to the
|
|
95
|
+
* channel JID, mirroring the ones received, with a `<plaintext>` child
|
|
96
|
+
* holding the plain proto.Message bytes (same encoding as a newsletter
|
|
97
|
+
* message). The server acks it (no error) when the sender is an admin or
|
|
98
|
+
* owner of the channel, and answers error 401 when they are not — that is
|
|
99
|
+
* what happened posting to Techword 401 from an account that is not its
|
|
100
|
+
* admin. Accepts the same content shapes as sendMessage: { text } for a
|
|
101
|
+
* text status, { image, caption } etc. for media. Options support
|
|
102
|
+
* backgroundColor for text statuses and font for text.
|
|
103
|
+
*
|
|
104
|
+
* Extras, same send path:
|
|
105
|
+
* - `question: true` on the content posts the status as a question
|
|
106
|
+
* (ContextInfo.isQuestion, proto field 63, on the inner message's
|
|
107
|
+
* contextInfo — not on MessageContextInfo).
|
|
108
|
+
* - `aiContent: true` marks image/video content as AI-generated
|
|
109
|
+
* (imageSourceType / videoSourceType); text and audio have no AI
|
|
110
|
+
* marker in the proto.
|
|
111
|
+
* - `interactionType: 'question_response'` with `parentServerId` posts
|
|
112
|
+
* a statusQuestionAnswerMessage (proto field 105) answering the
|
|
113
|
+
* question status with that server id; the content must be the answer
|
|
114
|
+
* text. The key points at the question by its server id, as channel
|
|
115
|
+
* statuses are addressed by server id everywhere else.
|
|
116
|
+
*/
|
|
117
|
+
export const sendChannelStatus = async (jid, content, deps, options = {}) => {
|
|
118
|
+
const { sendNode, waUploadToServer, userJid } = deps;
|
|
119
|
+
let inner;
|
|
120
|
+
if (options.interactionType === 'question_response') {
|
|
121
|
+
if (!options.parentServerId) {
|
|
122
|
+
throw new Boom('parentServerId is required to answer a status question', { statusCode: 400 });
|
|
123
|
+
}
|
|
124
|
+
const answerText = 'text' in content ? content.text : undefined;
|
|
125
|
+
if (!answerText) {
|
|
126
|
+
throw new Boom('a question_response status needs text content (the answer)', { statusCode: 400 });
|
|
127
|
+
}
|
|
128
|
+
inner = proto.Message.create({
|
|
129
|
+
statusQuestionAnswerMessage: {
|
|
130
|
+
key: { remoteJid: jid, id: options.parentServerId, fromMe: false },
|
|
131
|
+
text: answerText
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
// generateWAMessageContent builds/uploads the inner message (handles
|
|
137
|
+
// media upload, thumbnails, etc. same as a normal send)
|
|
138
|
+
inner = await generateWAMessageContent(content, { ...options, upload: waUploadToServer });
|
|
139
|
+
// A status posted as a question carries ContextInfo.isQuestion on
|
|
140
|
+
// the inner message (proto field 63). generateWAMessageContent
|
|
141
|
+
// does not set it, so it is merged in here — after the build, so
|
|
142
|
+
// a contextInfo already on the message (mentions, reporting
|
|
143
|
+
// token secret) is kept.
|
|
144
|
+
if (content.question) {
|
|
145
|
+
markQuestion(inner);
|
|
146
|
+
}
|
|
147
|
+
// AI-generated content is marked on the media itself. Text and audio
|
|
148
|
+
// have no AI marker in the proto, so aiContent is a no-op for them.
|
|
149
|
+
if (options.aiContent) {
|
|
150
|
+
if (inner.imageMessage) {
|
|
151
|
+
inner.imageMessage.imageSourceType = proto.Message.ImageMessage.ImageSourceType.AI_GENERATED;
|
|
152
|
+
}
|
|
153
|
+
else if (inner.videoMessage) {
|
|
154
|
+
inner.videoMessage.videoSourceType = proto.Message.VideoMessage.VideoSourceType.AI_GENERATED;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
const id = generateMessageIDV2(userJid);
|
|
159
|
+
const bytes = proto.Message.encode(inner).finish();
|
|
160
|
+
await sendNode({
|
|
161
|
+
tag: 'status',
|
|
162
|
+
attrs: {
|
|
163
|
+
to: jid,
|
|
164
|
+
id,
|
|
165
|
+
type: 'text'
|
|
166
|
+
},
|
|
167
|
+
content: [{ tag: 'plaintext', attrs: {}, content: bytes }]
|
|
168
|
+
});
|
|
169
|
+
return { id, channelJid: jid, message: inner };
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* React to a channel status, or remove the reaction with null.
|
|
173
|
+
* `serverId` is the status's server-assigned id (from the status echo
|
|
174
|
+
* after posting, or from newsletterFetchStatus).
|
|
175
|
+
*
|
|
176
|
+
* Same wire shape as reacting to a channel message — a `<message
|
|
177
|
+
* type="reaction">` stanza to the channel JID with the status's server
|
|
178
|
+
* id; the server routes by server_id within the newsletter. Removing a
|
|
179
|
+
* reaction sends edit='7' with an empty reaction, exactly like
|
|
180
|
+
* newsletterReactMessage does for messages.
|
|
181
|
+
*/
|
|
182
|
+
export const reactChannelStatus = async (jid, serverId, reaction, deps) => {
|
|
183
|
+
await deps.query({
|
|
184
|
+
tag: 'message',
|
|
185
|
+
attrs: {
|
|
186
|
+
to: jid,
|
|
187
|
+
...(reaction ? {} : { edit: '7' }),
|
|
188
|
+
type: 'reaction',
|
|
189
|
+
server_id: serverId,
|
|
190
|
+
id: deps.generateMessageTag()
|
|
191
|
+
},
|
|
192
|
+
content: [
|
|
193
|
+
{
|
|
194
|
+
tag: 'reaction',
|
|
195
|
+
attrs: reaction ? { code: reaction } : {}
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Revoke (delete) one of the channel's own statuses, by server id.
|
|
202
|
+
*
|
|
203
|
+
* Wire shape: a newsletter IQ with a `<revoke server_id>` child — the
|
|
204
|
+
* same IQ family as the status fetch (status_updates) and live_updates.
|
|
205
|
+
* This shape could not be confirmed from the decompiled app (stanza tag
|
|
206
|
+
* names are token-encoded there), so it needs a live check against a
|
|
207
|
+
* real channel before it is trusted.
|
|
208
|
+
*/
|
|
209
|
+
export const revokeChannelStatus = async (jid, statusId, deps) => {
|
|
210
|
+
return deps.query({
|
|
211
|
+
tag: 'iq',
|
|
212
|
+
attrs: {
|
|
213
|
+
id: deps.generateMessageTag(),
|
|
214
|
+
type: 'set',
|
|
215
|
+
xmlns: 'newsletter',
|
|
216
|
+
to: jid
|
|
217
|
+
},
|
|
218
|
+
content: [{ tag: 'revoke', attrs: { server_id: statusId } }]
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* Fetch the channel's published statuses, paginated by server id.
|
|
223
|
+
* `before` fetches statuses older than that server id, `after` newer
|
|
224
|
+
* ones.
|
|
225
|
+
*
|
|
226
|
+
* Wire shape, from the app: an IQ to the channel with a `<status_updates>`
|
|
227
|
+
* child carrying count and the before/after cursors (the app also sends
|
|
228
|
+
* a `since` timestamp there; this API pages by server id instead).
|
|
229
|
+
* The result carries the statuses as `<status>` children of
|
|
230
|
+
* `<status_updates>`, in the same shape as the live `<status>` stanzas
|
|
231
|
+
* decodeChannelStatus reads. A fetched status node may not carry a
|
|
232
|
+
* `from` attr (the IQ is already addressed to the channel), so the
|
|
233
|
+
* channel JID is filled in for the decoder.
|
|
234
|
+
*/
|
|
235
|
+
export const fetchChannelStatuses = async (jid, options, deps) => {
|
|
236
|
+
const attrs = { count: options.count.toString() };
|
|
237
|
+
if (options.before) {
|
|
238
|
+
attrs.before = options.before;
|
|
239
|
+
}
|
|
240
|
+
if (options.after) {
|
|
241
|
+
attrs.after = options.after;
|
|
242
|
+
}
|
|
243
|
+
const raw = await deps.query({
|
|
244
|
+
tag: 'iq',
|
|
245
|
+
attrs: {
|
|
246
|
+
id: deps.generateMessageTag(),
|
|
247
|
+
type: 'get',
|
|
248
|
+
xmlns: 'newsletter',
|
|
249
|
+
to: jid
|
|
250
|
+
},
|
|
251
|
+
content: [{ tag: 'status_updates', attrs }]
|
|
252
|
+
});
|
|
253
|
+
const updatesNode = getBinaryNodeChild(raw, 'status_updates') ?? raw;
|
|
254
|
+
const statuses = getBinaryNodeChildren(updatesNode, 'status')
|
|
255
|
+
.map(node => decodeChannelStatus({
|
|
256
|
+
...node,
|
|
257
|
+
attrs: { ...node.attrs, from: node.attrs.from || jid }
|
|
258
|
+
}))
|
|
259
|
+
.filter((status) => !!status);
|
|
260
|
+
return { statuses, raw };
|
|
261
|
+
};
|
|
262
|
+
/** The app's hardcoded count for the question-responses job. */
|
|
263
|
+
export const CHANNEL_STATUS_QUESTION_RESPONSES_DEFAULT_COUNT = 30;
|
|
264
|
+
/** Max count the app writes for question responses (J9G $t=8: 1..1000). */
|
|
265
|
+
export const CHANNEL_STATUS_QUESTION_RESPONSES_MAX_COUNT = 1000;
|
|
266
|
+
/** Max count the app writes for status responses (J9G.A02: 1..300). */
|
|
267
|
+
export const CHANNEL_STATUS_RESPONSES_MAX_COUNT = 300;
|
|
268
|
+
/** `server_id` is only written on the wire inside this range (IHO.A0S). */
|
|
269
|
+
export const CHANNEL_STATUS_MIN_SERVER_ID = 99;
|
|
270
|
+
export const CHANNEL_STATUS_MAX_SERVER_ID = 2147476647;
|
|
271
|
+
/**
|
|
272
|
+
* Decode one `<question_response>` node (KG6.A0R + A0Q + A0C + A0H).
|
|
273
|
+
* Returns undefined when the item has no `<message>` child or its
|
|
274
|
+
* `<plaintext>` payload is not a decodable proto.Message — the app's
|
|
275
|
+
* parser requires both, so such an item is not a usable answer.
|
|
276
|
+
*/
|
|
277
|
+
export const decodeChannelStatusResponse = (node) => {
|
|
278
|
+
const messageNode = getBinaryNodeChild(node, 'message');
|
|
279
|
+
if (!messageNode) {
|
|
280
|
+
return undefined;
|
|
281
|
+
}
|
|
282
|
+
let message;
|
|
283
|
+
let text;
|
|
284
|
+
const plaintextNode = getBinaryNodeChild(messageNode, 'plaintext');
|
|
285
|
+
if (plaintextNode?.content) {
|
|
286
|
+
const contentBuf = typeof plaintextNode.content === 'string'
|
|
287
|
+
? Buffer.from(plaintextNode.content, 'binary')
|
|
288
|
+
: Buffer.from(plaintextNode.content);
|
|
289
|
+
try {
|
|
290
|
+
message = proto.Message.decode(contentBuf);
|
|
291
|
+
}
|
|
292
|
+
catch {
|
|
293
|
+
return undefined;
|
|
294
|
+
}
|
|
295
|
+
const extendedText = message.extendedTextMessage;
|
|
296
|
+
text = extendedText?.text || message.conversation || undefined;
|
|
297
|
+
}
|
|
298
|
+
const senderNode = getBinaryNodeChild(node, 'sender');
|
|
299
|
+
const metaNode = getBinaryNodeChild(messageNode, 'meta');
|
|
300
|
+
const flagsNode = getBinaryNodeChild(node, 'flags');
|
|
301
|
+
const hasFlag = (name) => {
|
|
302
|
+
if (!flagsNode) {
|
|
303
|
+
return false;
|
|
304
|
+
}
|
|
305
|
+
// the decompiled parser checks for a `replied`/`starred` marker
|
|
306
|
+
// inside <flags> without saying whether it is a child or an
|
|
307
|
+
// attr, so both shapes are accepted
|
|
308
|
+
return !!getBinaryNodeChild(flagsNode, name) || flagsNode.attrs[name] !== undefined;
|
|
309
|
+
};
|
|
310
|
+
const reactionsNode = getBinaryNodeChild(node, 'reactions');
|
|
311
|
+
const reactionNode = reactionsNode ? getBinaryNodeChild(reactionsNode, 'reaction') : undefined;
|
|
312
|
+
const pictureNode = senderNode ? getBinaryNodeChild(senderNode, 'picture') : undefined;
|
|
313
|
+
return {
|
|
314
|
+
id: messageNode.attrs.id || '',
|
|
315
|
+
responseServerId: metaNode?.attrs.response_server_id,
|
|
316
|
+
senderLid: senderNode?.attrs.lid,
|
|
317
|
+
senderNotifyName: senderNode?.attrs.notify_name,
|
|
318
|
+
senderPictureDirectPath: pictureNode?.attrs.direct_path,
|
|
319
|
+
messageTimestamp: +(messageNode.attrs.t || 0),
|
|
320
|
+
fromMe: messageNode.attrs.is_sender === 'true',
|
|
321
|
+
questionType: metaNode?.attrs.questiontype,
|
|
322
|
+
text,
|
|
323
|
+
message,
|
|
324
|
+
replied: hasFlag('replied'),
|
|
325
|
+
starred: hasFlag('starred'),
|
|
326
|
+
reaction: reactionNode?.attrs.code,
|
|
327
|
+
raw: node
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* Fetch the answers to a channel status question (`kind: 'question'`,
|
|
332
|
+
* default), or the responses to a channel status (`kind: 'status'`).
|
|
333
|
+
* `serverId` is the server id of the question/status being asked about.
|
|
334
|
+
* Page with `before` set to the last response's `responseServerId`.
|
|
335
|
+
* The `searchQuery` option is only valid for the question kind — the
|
|
336
|
+
* status job in the app has no search parameter.
|
|
337
|
+
*/
|
|
338
|
+
export const fetchChannelStatusResponses = async (jid, serverId, options, deps) => {
|
|
339
|
+
const kind = options.kind ?? 'question';
|
|
340
|
+
const count = options.count ?? CHANNEL_STATUS_QUESTION_RESPONSES_DEFAULT_COUNT;
|
|
341
|
+
const serverIdNum = Number(serverId);
|
|
342
|
+
if (!Number.isInteger(serverIdNum)) {
|
|
343
|
+
throw new Boom('serverId must be an integer server id', { statusCode: 400 });
|
|
344
|
+
}
|
|
345
|
+
if (kind === 'question') {
|
|
346
|
+
if (serverIdNum < 0) {
|
|
347
|
+
throw new Boom('serverId must not be negative', { statusCode: 400 });
|
|
348
|
+
}
|
|
349
|
+
if (count < 1 || count > CHANNEL_STATUS_QUESTION_RESPONSES_MAX_COUNT) {
|
|
350
|
+
throw new Boom(`count must be between 1 and ${CHANNEL_STATUS_QUESTION_RESPONSES_MAX_COUNT} for question responses`, { statusCode: 400 });
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
if (serverIdNum < CHANNEL_STATUS_MIN_SERVER_ID || serverIdNum >= CHANNEL_STATUS_MAX_SERVER_ID + 1) {
|
|
355
|
+
throw new Boom(`serverId must be between ${CHANNEL_STATUS_MIN_SERVER_ID} and ${CHANNEL_STATUS_MAX_SERVER_ID} for status responses`, { statusCode: 400 });
|
|
356
|
+
}
|
|
357
|
+
if (count < 1 || count > CHANNEL_STATUS_RESPONSES_MAX_COUNT) {
|
|
358
|
+
throw new Boom(`count must be between 1 and ${CHANNEL_STATUS_RESPONSES_MAX_COUNT} for status responses`, { statusCode: 400 });
|
|
359
|
+
}
|
|
360
|
+
if (options.searchQuery !== undefined) {
|
|
361
|
+
throw new Boom('searchQuery is only supported for question responses', { statusCode: 400 });
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
if (options.before !== undefined && options.before.length === 0) {
|
|
365
|
+
throw new Boom('before must not be empty', { statusCode: 400 });
|
|
366
|
+
}
|
|
367
|
+
if (options.searchQuery !== undefined && options.searchQuery.length === 0) {
|
|
368
|
+
throw new Boom('searchQuery must not be empty', { statusCode: 400 });
|
|
369
|
+
}
|
|
370
|
+
const responsesAttrs = { count: count.toString() };
|
|
371
|
+
if (kind === 'status') {
|
|
372
|
+
responsesAttrs.type = 'status';
|
|
373
|
+
}
|
|
374
|
+
// the app only writes server_id inside 99..2147476647 (IHO.A0S)
|
|
375
|
+
if (serverIdNum >= CHANNEL_STATUS_MIN_SERVER_ID && serverIdNum <= CHANNEL_STATUS_MAX_SERVER_ID) {
|
|
376
|
+
responsesAttrs.server_id = String(serverIdNum);
|
|
377
|
+
}
|
|
378
|
+
// the optional children are <question_responses> nodes nested inside
|
|
379
|
+
// the outer <question_responses> — that nesting is what the app
|
|
380
|
+
// sends (C1941J8e / C1946J8j), in before, filter, search order
|
|
381
|
+
const children = [];
|
|
382
|
+
if (options.before) {
|
|
383
|
+
children.push({ tag: 'question_responses', attrs: { before: options.before } });
|
|
384
|
+
}
|
|
385
|
+
if (options.filter) {
|
|
386
|
+
children.push({
|
|
387
|
+
tag: 'question_responses',
|
|
388
|
+
attrs: {},
|
|
389
|
+
content: [
|
|
390
|
+
{
|
|
391
|
+
tag: 'filters',
|
|
392
|
+
attrs: {},
|
|
393
|
+
content: [{ tag: options.filter, attrs: {} }]
|
|
394
|
+
}
|
|
395
|
+
]
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
if (options.searchQuery) {
|
|
399
|
+
children.push({
|
|
400
|
+
tag: 'question_responses',
|
|
401
|
+
attrs: {},
|
|
402
|
+
content: [
|
|
403
|
+
{
|
|
404
|
+
tag: 'search',
|
|
405
|
+
attrs: { text: options.searchQuery }
|
|
406
|
+
}
|
|
407
|
+
]
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
const raw = await deps.query({
|
|
411
|
+
tag: 'iq',
|
|
412
|
+
attrs: {
|
|
413
|
+
id: deps.generateMessageTag(),
|
|
414
|
+
type: 'get',
|
|
415
|
+
xmlns: 'newsletter',
|
|
416
|
+
to: jid
|
|
417
|
+
},
|
|
418
|
+
content: [{ tag: 'question_responses', attrs: responsesAttrs, content: children }]
|
|
419
|
+
});
|
|
420
|
+
const responsesNode = getBinaryNodeChild(raw, 'question_responses') ?? raw;
|
|
421
|
+
const responses = getBinaryNodeChildren(responsesNode, 'question_response')
|
|
422
|
+
.map(node => decodeChannelStatusResponse(node))
|
|
423
|
+
.filter((response) => !!response);
|
|
424
|
+
return {
|
|
425
|
+
responses,
|
|
426
|
+
serverId: responsesNode.attrs.server_id,
|
|
427
|
+
type: responsesNode.attrs.type,
|
|
428
|
+
raw
|
|
429
|
+
};
|
|
430
|
+
};
|
|
431
|
+
/**
|
|
432
|
+
* Send a view receipt for a channel status — the receipt the app sends
|
|
433
|
+
* when a channel status is viewed (SendNewsletterStatusViewReceiptJob).
|
|
434
|
+
*
|
|
435
|
+
* What the APK pins down:
|
|
436
|
+
* - The job is enqueued from StatusManager.markStatusAsSeenInternal when
|
|
437
|
+
* a newsletter status is marked seen, carrying `newsletterRawJid`
|
|
438
|
+
* (the channel JID), `receiptStanzaId` (the status message's stanza
|
|
439
|
+
* id — the `<status id>`, e.g. '3EB079CA1FB41899DF027B', NOT the
|
|
440
|
+
* server_id) and `sortId` (the message's local sort_id), and only
|
|
441
|
+
* when sortId > 0. Its job id is `status-view-receipt-<rawJid>`.
|
|
442
|
+
* - The receiving side (StatusMessageStateUpdateReceiptHandler /
|
|
443
|
+
* processNewsletterStatusViewReceipt, C1U8) expects a receipt stanza
|
|
444
|
+
* with type "view" (or "read-self"), `from` the viewer, `id` the
|
|
445
|
+
* status stanza id, and a `t` (unix seconds) attr, and looks the
|
|
446
|
+
* status up by (newsletter JID, stanza id). It never reads a sort id
|
|
447
|
+
* off the stanza.
|
|
448
|
+
*
|
|
449
|
+
* What the APK does NOT show: the job class defines no onRun in the dex
|
|
450
|
+
* (verified by parsing classes10.dex — only <init>, A00 and Ct8 exist),
|
|
451
|
+
* so the stanza the app actually sends could not be read from it. The
|
|
452
|
+
* shape sent here is the generic receipt the fork already builds in
|
|
453
|
+
* sendReceipt (`<receipt to id [type] [t]>`, fire-and-forget via
|
|
454
|
+
* sendNode) with type "view", which is exactly the shape the receiving
|
|
455
|
+
* handler expects. This needs a live check against a real channel
|
|
456
|
+
* before it is trusted.
|
|
457
|
+
*
|
|
458
|
+
* `sortId` is accepted because the app's job carries it and only fires
|
|
459
|
+
* when it is positive; it is validated the same way but is NOT placed
|
|
460
|
+
* on the wire, because no APK evidence puts it there.
|
|
461
|
+
*/
|
|
462
|
+
export const sendChannelStatusViewReceipt = async (jid, receiptStanzaId, sortId, deps) => {
|
|
463
|
+
if (!receiptStanzaId) {
|
|
464
|
+
throw new Boom('receiptStanzaId is required to send a channel status view receipt', { statusCode: 400 });
|
|
465
|
+
}
|
|
466
|
+
if (!Number.isInteger(sortId) || sortId <= 0) {
|
|
467
|
+
throw new Boom('sortId must be a positive integer', { statusCode: 400 });
|
|
468
|
+
}
|
|
469
|
+
await deps.sendNode({
|
|
470
|
+
tag: 'receipt',
|
|
471
|
+
attrs: {
|
|
472
|
+
to: jid,
|
|
473
|
+
id: receiptStanzaId,
|
|
474
|
+
type: 'view',
|
|
475
|
+
t: Math.floor(Date.now() / 1000).toString()
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
};
|
|
479
|
+
//# sourceMappingURL=channelStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channelStatus.js","sourceRoot":"","sources":["../../src/Socket/channelStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAI9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAmB,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAgEjG,sGAAsG;AACtG,MAAM,CAAC,MAAM,8BAA8B,GAAG,KAAM,CAAA;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAgB,EAA6B,EAAE;IAClF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAA;IAC5B,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;QACpC,OAAO,SAAS,CAAA;IACjB,CAAC;IAED,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAA;IAC3D,IAAI,CAAC,aAAa,EAAE,OAAO,EAAE,CAAC;QAC7B,OAAO,SAAS,CAAA;IACjB,CAAC;IAED,MAAM,UAAU,GACf,OAAO,aAAa,CAAC,OAAO,KAAK,QAAQ;QACxC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC;QAC9C,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,OAAqB,CAAC,CAAA;IAEpD,IAAI,OAAuB,CAAA;IAC3B,IAAI,CAAC;QACJ,qEAAqE;QACrE,OAAO,GA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i/boom';
|
|
2
|
+
import { proto } from '../../WAProto/index.js';
|
|
3
|
+
import type { BotListInfo, CacheStore, ChatModification, LastMessageList, MessageUpsertType, PrivacySettingsUpdate, SocketConfig, WABusinessProfile, WAMediaUpload, WAMessage, WAMessageKey, WAPatchCreate, WAPresence, WAPrivacyCallValue, WAPrivacyGroupAddValue, WAPrivacyMessagesValue, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types/index.js';
|
|
4
|
+
import type { QuickReplyAction } from '../Types/Bussines.js';
|
|
5
|
+
import type { LabelActionBody } from '../Types/Label.js';
|
|
6
|
+
import { type ProfilePictureOptions } from '../Utils/index.js';
|
|
7
|
+
import { type BinaryNode } from '../WABinary/index.js';
|
|
8
|
+
import { USyncQuery } from '../WAUSync/index.js';
|
|
9
|
+
export declare const buildProfilePictureQueryContent: (type: "preview" | "image", tcTokenContent?: BinaryNode[]) => BinaryNode[];
|
|
10
|
+
/**
|
|
11
|
+
* Change several privacy settings at once, as a list of
|
|
12
|
+
* (category, value) pairs built from a PrivacySettingsUpdate.
|
|
13
|
+
* Exported for testing; the socket wrapper is updatePrivacySettings.
|
|
14
|
+
*/
|
|
15
|
+
export declare const privacySettingsToCategories: (settings: PrivacySettingsUpdate) => {
|
|
16
|
+
name: string;
|
|
17
|
+
value: string;
|
|
18
|
+
}[];
|
|
19
|
+
/**
|
|
20
|
+
* Build the patch that changes the default audience for new
|
|
21
|
+
* statuses. Mode 2 shares with contacts, mode 3 shares with
|
|
22
|
+
* close friends only. ALLOW_LIST (0) and DENY_LIST (1) take the
|
|
23
|
+
* JIDs the list applies to in `userJids`.
|
|
24
|
+
* Exported for testing; the socket wrapper is
|
|
25
|
+
* updateStatusDistributionMode.
|
|
26
|
+
*/
|
|
27
|
+
export declare const statusDistributionModePatch: (mode: proto.SyncActionValue.StatusPrivacyAction.StatusDistributionMode, userJids?: string[]) => WAPatchCreate;
|
|
28
|
+
export declare const makeChatsSocket: (config: SocketConfig) => {
|
|
29
|
+
serverProps: {
|
|
30
|
+
/** AB prop 10518: gate tctoken on 1:1 messages. Default true (safe: avoids 463). */
|
|
31
|
+
privacyTokenOn1to1: boolean;
|
|
32
|
+
/** AB prop 9666: gate tctoken on profile picture IQs. WA Web default: true. */
|
|
33
|
+
profilePicPrivacyToken: boolean;
|
|
34
|
+
/** AB prop 14303: issue tctokens to LID instead of PN. WA Web default: false. */
|
|
35
|
+
lidTrustedTokenIssueToLid: boolean;
|
|
36
|
+
};
|
|
37
|
+
createCallLink: (type: "audio" | "video", event?: {
|
|
38
|
+
startTime: number;
|
|
39
|
+
}, timeoutMs?: number) => Promise<string | undefined>;
|
|
40
|
+
getBotListV2: () => Promise<BotListInfo[]>;
|
|
41
|
+
messageMutex: {
|
|
42
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
43
|
+
};
|
|
44
|
+
receiptMutex: {
|
|
45
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
46
|
+
};
|
|
47
|
+
appStatePatchMutex: {
|
|
48
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
49
|
+
};
|
|
50
|
+
notificationMutex: {
|
|
51
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
52
|
+
};
|
|
53
|
+
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
54
|
+
[_: string]: string;
|
|
55
|
+
}>;
|
|
56
|
+
upsertMessage: (msg: WAMessage, type: MessageUpsertType) => Promise<void>;
|
|
57
|
+
appPatch: (patchCreate: WAPatchCreate) => Promise<void>;
|
|
58
|
+
sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>;
|
|
59
|
+
presenceSubscribe: (toJid: string) => Promise<void>;
|
|
60
|
+
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
|
61
|
+
fetchBlocklist: () => Promise<(string | undefined)[]>;
|
|
62
|
+
fetchStatus: (...jids: string[]) => Promise<import("../WAUSync/index.js").USyncQueryResultList[] | undefined>;
|
|
63
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<import("../WAUSync/index.js").USyncQueryResultList[] | undefined>;
|
|
64
|
+
updateProfilePicture: (jid: string, content: WAMediaUpload, options?: ProfilePictureOptions) => Promise<void>;
|
|
65
|
+
removeProfilePicture: (jid: string) => Promise<void>;
|
|
66
|
+
updateProfileStatus: (status: string) => Promise<void>;
|
|
67
|
+
updateProfileName: (name: string) => Promise<void>;
|
|
68
|
+
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
69
|
+
updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>;
|
|
70
|
+
updateCallPrivacy: (value: WAPrivacyCallValue) => Promise<void>;
|
|
71
|
+
updateMessagesPrivacy: (value: WAPrivacyMessagesValue) => Promise<void>;
|
|
72
|
+
updateLastSeenPrivacy: (value: WAPrivacyValue) => Promise<void>;
|
|
73
|
+
updateOnlinePrivacy: (value: WAPrivacyOnlineValue) => Promise<void>;
|
|
74
|
+
updateProfilePicturePrivacy: (value: WAPrivacyValue) => Promise<void>;
|
|
75
|
+
updateStatusPrivacy: (value: WAPrivacyValue) => Promise<void>;
|
|
76
|
+
updateReadReceiptsPrivacy: (value: WAReadReceiptsValue) => Promise<void>;
|
|
77
|
+
updateGroupsAddPrivacy: (value: WAPrivacyGroupAddValue) => Promise<void>;
|
|
78
|
+
updatePrivacySettings: (settings: PrivacySettingsUpdate) => Promise<void>;
|
|
79
|
+
updateStatusDistributionMode: (mode: proto.SyncActionValue.StatusPrivacyAction.StatusDistributionMode, userJids?: string[]) => Promise<void>;
|
|
80
|
+
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
81
|
+
getBusinessProfile: (jid: string) => Promise<WABusinessProfile | void>;
|
|
82
|
+
resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
83
|
+
chatModify: (mod: ChatModification, jid: string) => Promise<void>;
|
|
84
|
+
pinChat: (jid: string, pin?: boolean) => Promise<void>;
|
|
85
|
+
archiveChat: (jid: string, archive: boolean, lastMessages: LastMessageList) => Promise<void>;
|
|
86
|
+
clearChat: (jid: string, lastMessages: LastMessageList, options?: {
|
|
87
|
+
deleteStarred?: boolean;
|
|
88
|
+
}) => Promise<void>;
|
|
89
|
+
deleteChat: (jid: string, lastMessages: LastMessageList) => Promise<void>;
|
|
90
|
+
deleteMessageForMe: (jid: string, key: WAMessageKey, timestamp: number, deleteMedia?: boolean) => Promise<void>;
|
|
91
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
|
92
|
+
addOrEditContact: (jid: string, contact: proto.SyncActionValue.IContactAction) => Promise<void>;
|
|
93
|
+
removeContact: (jid: string) => Promise<void>;
|
|
94
|
+
placeholderResendCache: CacheStore;
|
|
95
|
+
addLabel: (jid: string, labels: LabelActionBody) => Promise<void>;
|
|
96
|
+
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
97
|
+
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
98
|
+
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
99
|
+
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
100
|
+
star: (jid: string, messages: {
|
|
101
|
+
id: string;
|
|
102
|
+
fromMe?: boolean;
|
|
103
|
+
}[], star: boolean) => Promise<void>;
|
|
104
|
+
addOrEditQuickReply: (quickReply: QuickReplyAction) => Promise<void>;
|
|
105
|
+
removeQuickReply: (timestamp: string) => Promise<void>;
|
|
106
|
+
type: "md";
|
|
107
|
+
ws: import("./Client/websocket.js").WebSocketClient;
|
|
108
|
+
ev: import("../Types/index.js").BaileysEventEmitter & {
|
|
109
|
+
process(handler: (events: Partial<import("../Types/index.js").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
110
|
+
buffer(): void;
|
|
111
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): (...args: A) => Promise<T>;
|
|
112
|
+
flush(): boolean;
|
|
113
|
+
isBuffering(): boolean;
|
|
114
|
+
destroy(): void;
|
|
115
|
+
};
|
|
116
|
+
authState: {
|
|
117
|
+
creds: import("../Types/index.js").AuthenticationCreds;
|
|
118
|
+
keys: import("../Types/index.js").SignalKeyStoreWithTransaction;
|
|
119
|
+
};
|
|
120
|
+
signalRepository: import("../Types/index.js").SignalRepositoryWithLIDStore;
|
|
121
|
+
user: import("../Types/index.js").Contact | undefined;
|
|
122
|
+
generateMessageTag: () => string;
|
|
123
|
+
query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
|
|
124
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T | undefined>;
|
|
125
|
+
waitForSocketOpen: () => Promise<void>;
|
|
126
|
+
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
127
|
+
sendNode: (frame: BinaryNode) => Promise<void>;
|
|
128
|
+
logout: (msg?: string) => Promise<void>;
|
|
129
|
+
end: (error: Error | undefined) => Promise<void>;
|
|
130
|
+
registerSocketEndHandler: (handler: (error: Error | undefined) => void | Promise<void>) => void;
|
|
131
|
+
onUnexpectedError: (err: Error | Boom, msg: string) => void;
|
|
132
|
+
uploadPreKeys: (count?: number) => Promise<void>;
|
|
133
|
+
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
134
|
+
digestKeyBundle: () => Promise<void>;
|
|
135
|
+
rotateSignedPreKey: () => Promise<void>;
|
|
136
|
+
requestPairingCode: (phoneNumber: string, customPairingCode?: string) => Promise<string>;
|
|
137
|
+
updateServerTimeOffset: ({ attrs }: BinaryNode) => void;
|
|
138
|
+
sendUnifiedSession: () => Promise<void>;
|
|
139
|
+
wamBuffer: import("../index.js").BinaryInfo;
|
|
140
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types/index.js").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
|
|
141
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
|
|
142
|
+
executeUSyncQuery: (usyncQuery: USyncQuery) => Promise<import("../WAUSync/index.js").USyncQueryResult | undefined>;
|
|
143
|
+
onWhatsApp: (...phoneNumber: string[]) => Promise<{
|
|
144
|
+
jid: string;
|
|
145
|
+
exists: boolean;
|
|
146
|
+
}[] | undefined>;
|
|
147
|
+
fetchAccountReachoutTimelock: () => Promise<import("../Types/index.js").ReachoutTimelockState>;
|
|
148
|
+
fetchNewChatMessageCap: () => Promise<import("../Types/index.js").NewChatMessageCapInfo>;
|
|
149
|
+
};
|
|
150
|
+
//# sourceMappingURL=chats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chats.d.ts","sourceRoot":"","sources":["../../src/Socket/chats.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE9C,OAAO,KAAK,EACX,WAAW,EACX,UAAU,EACV,gBAAgB,EAEhB,eAAe,EAEf,iBAAiB,EAEjB,qBAAqB,EACrB,YAAY,EAEZ,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,YAAY,EACZ,aAAa,EAEb,UAAU,EACV,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD,OAAO,EAeN,KAAK,qBAAqB,EAC1B,MAAM,UAAU,CAAA;AAIjB,OAAO,EACN,KAAK,UAAU,EAWf,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,UAAU,EAAa,MAAM,YAAY,CAAA;AAGlD,eAAO,MAAM,+BAA+B,GAC3C,MAAM,SAAS,GAAG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