@pontalabs/baileys 1.0.5 → 1.0.6
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 +1 -1
- package/README.md +267 -839
- package/WAProto/GenerateStatics.sh +3 -4
- package/WAProto/WAProto.proto +1215 -511
- package/WAProto/fix-imports.js +85 -0
- package/WAProto/index.d.ts +14017 -55
- package/WAProto/index.js +97689 -29
- package/engine-requirements.js +10 -0
- package/lib/Defaults/index.d.ts +72 -74
- package/lib/Defaults/index.d.ts.map +1 -0
- package/lib/Defaults/index.js +94 -108
- package/lib/Defaults/index.js.map +1 -0
- package/lib/Signal/Group/ciphertext-message.d.ts +8 -7
- package/lib/Signal/Group/ciphertext-message.d.ts.map +1 -0
- package/lib/Signal/Group/ciphertext-message.js +9 -16
- package/lib/Signal/Group/ciphertext-message.js.map +1 -0
- package/lib/Signal/Group/group-session-builder.d.ts +11 -13
- package/lib/Signal/Group/group-session-builder.d.ts.map +1 -0
- package/lib/Signal/Group/group-session-builder.js +19 -61
- package/lib/Signal/Group/group-session-builder.js.map +1 -0
- package/lib/Signal/Group/group_cipher.d.ts +14 -16
- package/lib/Signal/Group/group_cipher.d.ts.map +1 -0
- package/lib/Signal/Group/group_cipher.js +41 -70
- package/lib/Signal/Group/group_cipher.js.map +1 -0
- package/lib/Signal/Group/index.d.ts +12 -11
- package/lib/Signal/Group/index.d.ts.map +1 -0
- package/lib/Signal/Group/index.js +12 -61
- package/lib/Signal/Group/index.js.map +1 -0
- package/lib/Signal/Group/keyhelper.d.ts +9 -14
- package/lib/Signal/Group/keyhelper.d.ts.map +1 -0
- package/lib/Signal/Group/keyhelper.js +10 -58
- package/lib/Signal/Group/keyhelper.js.map +1 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +13 -13
- package/lib/Signal/Group/sender-chain-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-chain-key.js +13 -34
- package/lib/Signal/Group/sender-chain-key.js.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -16
- package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +28 -36
- package/lib/Signal/Group/sender-key-distribution-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-message.d.ts +18 -18
- package/lib/Signal/Group/sender-key-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-message.js +38 -45
- package/lib/Signal/Group/sender-key-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-name.d.ts +14 -15
- package/lib/Signal/Group/sender-key-name.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-name.js +20 -31
- package/lib/Signal/Group/sender-key-name.js.map +1 -0
- package/lib/Signal/Group/sender-key-record.d.ts +24 -25
- package/lib/Signal/Group/sender-key-record.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-record.js +18 -35
- package/lib/Signal/Group/sender-key-record.js.map +1 -0
- package/lib/Signal/Group/sender-key-state.d.ts +29 -34
- package/lib/Signal/Group/sender-key-state.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-state.js +37 -100
- package/lib/Signal/Group/sender-key-state.js.map +1 -0
- package/lib/Signal/Group/sender-message-key.d.ts +11 -10
- package/lib/Signal/Group/sender-message-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-message-key.js +15 -22
- package/lib/Signal/Group/sender-message-key.js.map +1 -0
- package/lib/Signal/libsignal.d.ts +5 -8
- package/lib/Signal/libsignal.d.ts.map +1 -0
- package/lib/Signal/libsignal.js +288 -142
- package/lib/Signal/libsignal.js.map +1 -0
- package/lib/Signal/lid-mapping.d.ts +23 -28
- package/lib/Signal/lid-mapping.d.ts.map +1 -0
- package/lib/Signal/lid-mapping.js +277 -184
- package/lib/Signal/lid-mapping.js.map +1 -0
- package/lib/Socket/Client/index.d.ts +3 -2
- package/lib/Socket/Client/index.d.ts.map +1 -0
- package/lib/Socket/Client/index.js +3 -22
- package/lib/Socket/Client/index.js.map +1 -0
- package/lib/Socket/Client/types.d.ts +15 -15
- package/lib/Socket/Client/types.d.ts.map +1 -0
- package/lib/Socket/Client/types.js +8 -15
- package/lib/Socket/Client/types.js.map +1 -0
- package/lib/Socket/Client/websocket.d.ts +12 -12
- package/lib/Socket/Client/websocket.d.ts.map +1 -0
- package/lib/Socket/Client/websocket.js +29 -37
- package/lib/Socket/Client/websocket.js.map +1 -0
- package/lib/Socket/business.d.ts +208 -178
- package/lib/Socket/business.d.ts.map +1 -0
- package/lib/Socket/business.js +91 -127
- package/lib/Socket/business.js.map +1 -0
- package/lib/Socket/chats.d.ts +120 -93
- package/lib/Socket/chats.d.ts.map +1 -0
- package/lib/Socket/chats.js +727 -652
- package/lib/Socket/chats.js.map +1 -0
- package/lib/Socket/communities.d.ts +273 -0
- package/lib/Socket/communities.d.ts.map +1 -0
- package/lib/Socket/communities.js +431 -0
- package/lib/Socket/communities.js.map +1 -0
- package/lib/Socket/dugong.js +261 -0
- package/lib/Socket/dugong.js.bak +204 -0
- package/lib/Socket/groups.d.ts +143 -111
- package/lib/Socket/groups.d.ts.map +1 -0
- package/lib/Socket/groups.js +165 -177
- package/lib/Socket/groups.js.map +1 -0
- package/lib/Socket/index.d.ts +252 -183
- package/lib/Socket/index.d.ts.map +1 -0
- package/lib/Socket/index.js +38 -18
- package/lib/Socket/index.js.bak +44 -0
- package/lib/Socket/index.js.map +1 -0
- package/lib/Socket/messages-recv.d.ts +196 -167
- package/lib/Socket/messages-recv.d.ts.map +1 -0
- package/lib/Socket/messages-recv.js +1443 -1563
- package/lib/Socket/messages-recv.js.map +1 -0
- package/lib/Socket/messages-send.d.ts +192 -158
- package/lib/Socket/messages-send.d.ts.map +1 -0
- package/lib/Socket/messages-send.js +1102 -1208
- package/lib/Socket/messages-send.js.bak +1400 -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 +163 -138
- package/lib/Socket/newsletter.d.ts.map +1 -0
- package/lib/Socket/newsletter.js +153 -249
- package/lib/Socket/newsletter.js.map +1 -0
- package/lib/Socket/socket.d.ts +50 -36
- package/lib/Socket/socket.d.ts.map +1 -0
- package/lib/Socket/socket.js +749 -820
- package/lib/Socket/socket.js.map +1 -0
- package/lib/Store/index.d.ts +4 -4
- package/lib/Store/index.d.ts.map +1 -0
- package/lib/Store/index.js +4 -24
- package/lib/Store/index.js.map +1 -0
- package/lib/Store/make-in-memory-store.d.ts +44 -104
- package/lib/Store/make-in-memory-store.d.ts.map +1 -0
- package/lib/Store/make-in-memory-store.js +199 -213
- package/lib/Store/make-in-memory-store.js.map +1 -0
- package/lib/Store/make-ordered-dictionary.d.ts +13 -12
- package/lib/Store/make-ordered-dictionary.d.ts.map +1 -0
- package/lib/Store/make-ordered-dictionary.js +38 -45
- package/lib/Store/make-ordered-dictionary.js.map +1 -0
- package/lib/Store/object-repository.d.ts +11 -10
- package/lib/Store/object-repository.d.ts.map +1 -0
- package/lib/Store/object-repository.js +9 -16
- package/lib/Store/object-repository.js.map +1 -0
- package/lib/Types/Auth.d.ts +93 -97
- package/lib/Types/Auth.d.ts.map +1 -0
- package/lib/Types/Auth.js +2 -3
- 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 -3
- package/lib/Types/Bussines.js.map +1 -0
- package/lib/Types/Call.d.ts +14 -13
- package/lib/Types/Call.d.ts.map +1 -0
- package/lib/Types/Call.js +2 -3
- package/lib/Types/Call.js.map +1 -0
- package/lib/Types/Chat.d.ts +78 -97
- package/lib/Types/Chat.d.ts.map +1 -0
- package/lib/Types/Chat.js +8 -9
- package/lib/Types/Chat.js.map +1 -0
- package/lib/Types/Contact.d.ts +12 -9
- package/lib/Types/Contact.d.ts.map +1 -0
- package/lib/Types/Contact.js +2 -3
- package/lib/Types/Contact.js.map +1 -0
- package/lib/Types/Events.d.ts +206 -176
- package/lib/Types/Events.d.ts.map +1 -0
- package/lib/Types/Events.js +2 -3
- package/lib/Types/Events.js.map +1 -0
- package/lib/Types/GroupMetadata.d.ts +53 -48
- package/lib/Types/GroupMetadata.d.ts.map +1 -0
- package/lib/Types/GroupMetadata.js +2 -3
- package/lib/Types/GroupMetadata.js.map +1 -0
- package/lib/Types/Label.d.ts +13 -14
- package/lib/Types/Label.d.ts.map +1 -0
- package/lib/Types/Label.js +24 -30
- package/lib/Types/Label.js.map +1 -0
- package/lib/Types/LabelAssociation.d.ts +15 -20
- package/lib/Types/LabelAssociation.d.ts.map +1 -0
- package/lib/Types/LabelAssociation.js +6 -12
- package/lib/Types/LabelAssociation.js.map +1 -0
- package/lib/Types/Message.d.ts +248 -412
- package/lib/Types/Message.d.ts.map +1 -0
- package/lib/Types/Message.js +17 -19
- 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/Product.d.ts +58 -71
- package/lib/Types/Product.d.ts.map +1 -0
- package/lib/Types/Product.js +2 -3
- package/lib/Types/Product.js.map +1 -0
- package/lib/Types/RichType.d.ts +3 -0
- package/lib/Types/RichType.d.ts.map +1 -0
- package/lib/Types/RichType.js +23 -0
- package/lib/Types/RichType.js.bak +23 -0
- package/lib/Types/RichType.js.map +1 -0
- package/lib/Types/Signal.d.ts +71 -82
- package/lib/Types/Signal.d.ts.map +1 -0
- package/lib/Types/Signal.js +2 -3
- package/lib/Types/Signal.js.map +1 -0
- package/lib/Types/Socket.d.ts +76 -81
- package/lib/Types/Socket.d.ts.map +1 -0
- package/lib/Types/Socket.js +3 -3
- package/lib/Types/Socket.js.map +1 -0
- package/lib/Types/State.d.ts +75 -19
- package/lib/Types/State.d.ts.map +1 -0
- package/lib/Types/State.js +56 -14
- package/lib/Types/State.js.map +1 -0
- package/lib/Types/USync.d.ts +8 -8
- package/lib/Types/USync.d.ts.map +1 -0
- package/lib/Types/USync.js +2 -3
- package/lib/Types/USync.js.map +1 -0
- package/lib/Types/index.d.ts +47 -62
- package/lib/Types/index.d.ts.map +1 -0
- package/lib/Types/index.js +26 -50
- package/lib/Types/index.js.map +1 -0
- package/lib/Utils/auth-utils.d.ts +13 -10
- package/lib/Utils/auth-utils.d.ts.map +1 -0
- package/lib/Utils/auth-utils.js +213 -472
- 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 +28 -0
- package/lib/Utils/browser-utils.js.map +1 -0
- package/lib/Utils/business.d.ts +14 -20
- package/lib/Utils/business.d.ts.map +1 -0
- package/lib/Utils/business.js +110 -134
- package/lib/Utils/business.js.map +1 -0
- package/lib/Utils/chat-utils.d.ts +88 -70
- package/lib/Utils/chat-utils.d.ts.map +1 -0
- package/lib/Utils/chat-utils.js +466 -403
- 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 +27 -46
- package/lib/Utils/crypto.d.ts.map +1 -0
- package/lib/Utils/crypto.js +117 -188
- package/lib/Utils/crypto.js.map +1 -0
- package/lib/Utils/decode-wa-message.d.ts +58 -45
- package/lib/Utils/decode-wa-message.d.ts.map +1 -0
- package/lib/Utils/decode-wa-message.js +213 -303
- package/lib/Utils/decode-wa-message.js.map +1 -0
- package/lib/Utils/event-buffer.d.ts +14 -17
- package/lib/Utils/event-buffer.d.ts.map +1 -0
- package/lib/Utils/event-buffer.js +321 -296
- package/lib/Utils/event-buffer.js.map +1 -0
- package/lib/Utils/generics.d.ts +66 -92
- package/lib/Utils/generics.d.ts.map +1 -0
- package/lib/Utils/generics.js +270 -436
- package/lib/Utils/generics.js.map +1 -0
- package/lib/Utils/history.d.ts +24 -23
- package/lib/Utils/history.d.ts.map +1 -0
- package/lib/Utils/history.js +106 -76
- 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 +24 -21
- package/lib/Utils/index.d.ts.map +1 -0
- package/lib/Utils/index.js +24 -41
- package/lib/Utils/index.js.map +1 -0
- package/lib/Utils/link-preview.d.ts +12 -14
- package/lib/Utils/link-preview.d.ts.map +1 -0
- package/lib/Utils/link-preview.js +40 -75
- package/lib/Utils/link-preview.js.map +1 -0
- package/lib/Utils/logger.d.ts +10 -11
- package/lib/Utils/logger.d.ts.map +1 -0
- package/lib/Utils/logger.js +3 -7
- package/lib/Utils/logger.js.map +1 -0
- package/lib/Utils/lt-hash.d.ts +8 -14
- package/lib/Utils/lt-hash.d.ts.map +1 -0
- package/lib/Utils/lt-hash.js +3 -53
- package/lib/Utils/lt-hash.js.map +1 -0
- package/lib/Utils/make-mutex.d.ts +7 -7
- package/lib/Utils/make-mutex.d.ts.map +1 -0
- package/lib/Utils/make-mutex.js +28 -44
- package/lib/Utils/make-mutex.js.map +1 -0
- package/lib/Utils/message-retry-manager.d.ts +115 -88
- package/lib/Utils/message-retry-manager.d.ts.map +1 -0
- package/lib/Utils/message-retry-manager.js +265 -160
- package/lib/Utils/message-retry-manager.js.map +1 -0
- package/lib/Utils/messages-media.d.ts +105 -107
- package/lib/Utils/messages-media.d.ts.map +1 -0
- package/lib/Utils/messages-media.js +548 -619
- package/lib/Utils/messages-media.js.bak +786 -0
- package/lib/Utils/messages-media.js.map +1 -0
- package/lib/Utils/messages.d.ts +52 -66
- package/lib/Utils/messages.d.ts.map +1 -0
- package/lib/Utils/messages.js +1730 -1558
- package/lib/Utils/messages.js.backup +1768 -0
- package/lib/Utils/messages.js.bak +1809 -0
- package/lib/Utils/messages.js.bak2 +893 -0
- package/lib/Utils/messages.js.bak3 +1183 -0
- package/lib/Utils/messages.js.map +1 -0
- package/lib/Utils/noise-handler.d.ts +18 -18
- package/lib/Utils/noise-handler.d.ts.map +1 -0
- package/lib/Utils/noise-handler.js +176 -130
- 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 +43 -32
- package/lib/Utils/process-message.d.ts.map +1 -0
- package/lib/Utils/process-message.js +484 -282
- package/lib/Utils/process-message.js.map +1 -0
- package/lib/Utils/reporting-utils.d.ts +11 -0
- package/lib/Utils/reporting-utils.d.ts.map +1 -0
- package/lib/Utils/reporting-utils.js +258 -0
- package/lib/Utils/reporting-utils.js.map +1 -0
- package/lib/Utils/rich-message-utils.d.ts +49 -0
- package/lib/Utils/rich-message-utils.d.ts.map +1 -0
- package/lib/Utils/rich-message-utils.js +1220 -724
- package/lib/Utils/rich-message-utils.js.backup +706 -0
- package/lib/Utils/rich-message-utils.js.bak +246 -0
- package/lib/Utils/rich-message-utils.js.map +1 -0
- package/lib/Utils/rich-message-utils.js.original +1332 -0
- package/lib/Utils/signal.d.ts +37 -32
- package/lib/Utils/signal.d.ts.map +1 -0
- package/lib/Utils/signal.js +140 -105
- 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/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 +163 -0
- package/lib/Utils/tc-token-utils.js.map +1 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +5 -5
- package/lib/Utils/use-multi-file-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-multi-file-auth-state.js +70 -120
- package/lib/Utils/use-multi-file-auth-state.js.map +1 -0
- package/lib/Utils/use-single-file-auth-state.d.ts +11 -13
- package/lib/Utils/use-single-file-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-single-file-auth-state.js +92 -66
- package/lib/Utils/use-single-file-auth-state.js.map +1 -0
- package/lib/Utils/use-sqlite-auth-state.d.ts +11 -0
- package/lib/Utils/use-sqlite-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-sqlite-auth-state.js +109 -0
- package/lib/Utils/use-sqlite-auth-state.js.map +1 -0
- package/lib/Utils/validate-connection.d.ts +11 -13
- package/lib/Utils/validate-connection.d.ts.map +1 -0
- package/lib/Utils/validate-connection.js +128 -113
- package/lib/Utils/validate-connection.js.map +1 -0
- package/lib/WABinary/constants.d.ts +25 -27
- package/lib/WABinary/constants.d.ts.map +1 -0
- package/lib/WABinary/constants.js +1451 -1292
- package/lib/WABinary/constants.js.bak +1373 -0
- package/lib/WABinary/constants.js.map +1 -0
- package/lib/WABinary/decode.d.ts +7 -9
- package/lib/WABinary/decode.d.ts.map +1 -0
- package/lib/WABinary/decode.js +163 -189
- package/lib/WABinary/decode.js.map +1 -0
- package/lib/WABinary/encode.d.ts +3 -3
- package/lib/WABinary/encode.d.ts.map +1 -0
- package/lib/WABinary/encode.js +110 -155
- package/lib/WABinary/encode.js.map +1 -0
- package/lib/WABinary/generic-utils.d.ts +14 -27
- package/lib/WABinary/generic-utils.d.ts.map +1 -0
- package/lib/WABinary/generic-utils.js +177 -105
- package/lib/WABinary/generic-utils.js.map +1 -0
- package/lib/WABinary/index.d.ts +6 -5
- package/lib/WABinary/index.d.ts.map +1 -0
- package/lib/WABinary/index.js +6 -25
- package/lib/WABinary/index.js.map +1 -0
- package/lib/WABinary/jid-utils.d.ts +41 -51
- package/lib/WABinary/jid-utils.d.ts.map +1 -0
- package/lib/WABinary/jid-utils.js +83 -120
- package/lib/WABinary/jid-utils.js.map +1 -0
- package/lib/WABinary/types.d.ts +10 -13
- package/lib/WABinary/types.d.ts.map +1 -0
- package/lib/WABinary/types.js +2 -3
- package/lib/WABinary/types.js.map +1 -0
- package/lib/WAM/BinaryInfo.d.ts +8 -15
- package/lib/WAM/BinaryInfo.d.ts.map +1 -0
- package/lib/WAM/BinaryInfo.js +7 -14
- package/lib/WAM/BinaryInfo.js.map +1 -0
- package/lib/WAM/constants.d.ts +30 -37
- package/lib/WAM/constants.d.ts.map +1 -0
- package/lib/WAM/constants.js +19193 -11711
- package/lib/WAM/constants.js.map +1 -0
- package/lib/WAM/encode.d.ts +3 -3
- package/lib/WAM/encode.d.ts.map +1 -0
- package/lib/WAM/encode.js +95 -109
- package/lib/WAM/encode.js.map +1 -0
- package/lib/WAM/index.d.ts +4 -3
- package/lib/WAM/index.d.ts.map +1 -0
- package/lib/WAM/index.js +4 -23
- package/lib/WAM/index.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -9
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +37 -21
- package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +19 -22
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +18 -26
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +11 -12
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +12 -20
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +11 -12
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +16 -24
- 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 -6
- package/lib/WAUSync/Protocols/index.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/index.js +6 -26
- package/lib/WAUSync/Protocols/index.js.map +1 -0
- package/lib/WAUSync/USyncQuery.d.ts +27 -28
- package/lib/WAUSync/USyncQuery.d.ts.map +1 -0
- package/lib/WAUSync/USyncQuery.js +68 -62
- package/lib/WAUSync/USyncQuery.js.map +1 -0
- package/lib/WAUSync/USyncUser.d.ts +15 -10
- package/lib/WAUSync/USyncUser.d.ts.map +1 -0
- package/lib/WAUSync/USyncUser.js +20 -19
- package/lib/WAUSync/USyncUser.js.map +1 -0
- package/lib/WAUSync/index.d.ts +4 -3
- package/lib/WAUSync/index.d.ts.map +1 -0
- package/lib/WAUSync/index.js +4 -23
- package/lib/WAUSync/index.js.map +1 -0
- package/lib/index.d.ts +11 -12
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +12 -39
- package/lib/index.js.map +1 -0
- package/package.json +86 -42
package/lib/Types/Message.d.ts
CHANGED
|
@@ -1,484 +1,320 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import type {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export type WAMessageContent = proto.IMessage
|
|
16
|
-
|
|
17
|
-
export type
|
|
18
|
-
|
|
19
|
-
export type WAContactsArrayMessage = proto.Message.IContactsArrayMessage
|
|
20
|
-
|
|
1
|
+
import type { Readable } from 'stream';
|
|
2
|
+
import type { URL } from 'url';
|
|
3
|
+
import { proto } from '../../WAProto/index.js';
|
|
4
|
+
import type { MediaType } from '../Defaults/index.js';
|
|
5
|
+
import type { BinaryNode } from '../WABinary/index.js';
|
|
6
|
+
import type { GroupMetadata } from './GroupMetadata.js';
|
|
7
|
+
import type { CacheStore } from './Socket.js';
|
|
8
|
+
export { proto as WAProto };
|
|
9
|
+
export type WAMessage = proto.IWebMessageInfo & {
|
|
10
|
+
key: WAMessageKey;
|
|
11
|
+
messageStubParameters?: any;
|
|
12
|
+
category?: string;
|
|
13
|
+
retryCount?: number;
|
|
14
|
+
};
|
|
15
|
+
export type WAMessageContent = proto.IMessage;
|
|
16
|
+
export type WAContactMessage = proto.Message.IContactMessage;
|
|
17
|
+
export type WAContactsArrayMessage = proto.Message.IContactsArrayMessage;
|
|
21
18
|
export type WAMessageKey = proto.IMessageKey & {
|
|
22
|
-
remoteJidAlt?: string
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
remoteJidAlt?: string;
|
|
20
|
+
remoteJidUsername?: string;
|
|
21
|
+
participantAlt?: string;
|
|
22
|
+
participantUsername?: string;
|
|
23
|
+
server_id?: string;
|
|
24
|
+
addressingMode?: string;
|
|
25
|
+
isViewOnce?: boolean;
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
export type
|
|
29
|
-
|
|
30
|
-
export type
|
|
31
|
-
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
export type
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export
|
|
41
|
-
|
|
42
|
-
export declare const WAMessageStatus = proto.WebMessageInfo.Status
|
|
43
|
-
|
|
44
|
-
export type WAMediaUpload = Buffer | {
|
|
45
|
-
url: URL | string
|
|
46
|
-
} | {
|
|
47
|
-
stream: Readable
|
|
48
|
-
}
|
|
49
|
-
|
|
27
|
+
export type WATextMessage = proto.Message.IExtendedTextMessage;
|
|
28
|
+
export type WAContextInfo = proto.IContextInfo;
|
|
29
|
+
export type WALocationMessage = proto.Message.ILocationMessage;
|
|
30
|
+
export type WAGenericMediaMessage = proto.Message.IVideoMessage | proto.Message.IImageMessage | proto.Message.IAudioMessage | proto.Message.IDocumentMessage | proto.Message.IStickerMessage;
|
|
31
|
+
export declare const WAMessageStubType: typeof proto.WebMessageInfo.StubType;
|
|
32
|
+
export declare const WAMessageStatus: typeof proto.WebMessageInfo.Status;
|
|
33
|
+
import type { ILogger } from '../Utils/logger.js';
|
|
34
|
+
export type WAMediaPayloadURL = {
|
|
35
|
+
url: URL | string;
|
|
36
|
+
};
|
|
37
|
+
export type WAMediaPayloadStream = {
|
|
38
|
+
stream: Readable;
|
|
39
|
+
};
|
|
40
|
+
export type WAMediaUpload = Buffer | WAMediaPayloadStream | WAMediaPayloadURL;
|
|
50
41
|
/** Set of message types that are supported by the library */
|
|
51
|
-
export type MessageType = keyof proto.Message
|
|
52
|
-
|
|
42
|
+
export type MessageType = keyof proto.Message;
|
|
53
43
|
export declare enum WAMessageAddressingMode {
|
|
54
|
-
|
|
55
|
-
|
|
44
|
+
PN = "pn",
|
|
45
|
+
LID = "lid"
|
|
56
46
|
}
|
|
57
|
-
|
|
47
|
+
export type MessageWithContextInfo = 'imageMessage' | 'contactMessage' | 'locationMessage' | 'extendedTextMessage' | 'documentMessage' | 'audioMessage' | 'videoMessage' | 'call' | 'contactsArrayMessage' | 'liveLocationMessage' | 'templateMessage' | 'stickerMessage' | 'groupInviteMessage' | 'templateButtonReplyMessage' | 'productMessage' | 'listMessage' | 'orderMessage' | 'listResponseMessage' | 'buttonsMessage' | 'buttonsResponseMessage' | 'interactiveMessage' | 'interactiveResponseMessage' | 'pollCreationMessage' | 'requestPhoneNumberMessage' | 'messageHistoryBundle' | 'eventMessage' | 'newsletterAdminInviteMessage' | 'albumMessage' | 'stickerPackMessage' | 'pollResultSnapshotMessage' | 'messageHistoryNotice';
|
|
58
48
|
export type DownloadableMessage = {
|
|
59
|
-
mediaKey?: Uint8Array | null
|
|
60
|
-
directPath?: string | null
|
|
61
|
-
url?: string | null
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export type MessageReceiptType = 'read' | 'read-self' | 'hist_sync' | 'peer_msg' | 'sender' | 'inactive' | 'played' | undefined
|
|
65
|
-
|
|
49
|
+
mediaKey?: Uint8Array | null;
|
|
50
|
+
directPath?: string | null;
|
|
51
|
+
url?: string | null;
|
|
52
|
+
};
|
|
53
|
+
export type MessageReceiptType = 'read' | 'read-self' | 'hist_sync' | 'peer_msg' | 'sender' | 'inactive' | 'played' | undefined;
|
|
66
54
|
export type MediaConnInfo = {
|
|
67
|
-
auth: string
|
|
68
|
-
ttl: number
|
|
55
|
+
auth: string;
|
|
56
|
+
ttl: number;
|
|
69
57
|
hosts: {
|
|
70
|
-
hostname: string
|
|
71
|
-
maxContentLengthBytes: number
|
|
72
|
-
}[]
|
|
73
|
-
fetchDate: Date
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export interface StickerPack {
|
|
77
|
-
stickers: Sticker[]
|
|
78
|
-
cover: WAMediaUpload
|
|
79
|
-
name: string
|
|
80
|
-
publisher: string
|
|
81
|
-
description?: string
|
|
82
|
-
packId?: string
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export interface Carousel {
|
|
86
|
-
image?: WAMediaUpload
|
|
87
|
-
video?: WAMediaUpload
|
|
88
|
-
product?: WASendableProduct
|
|
89
|
-
title?: string
|
|
90
|
-
body?: string
|
|
91
|
-
footer?: string
|
|
92
|
-
buttons?: proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton[]
|
|
93
|
-
}
|
|
94
|
-
|
|
58
|
+
hostname: string;
|
|
59
|
+
maxContentLengthBytes: number;
|
|
60
|
+
}[];
|
|
61
|
+
fetchDate: Date;
|
|
62
|
+
};
|
|
95
63
|
export interface WAUrlInfo {
|
|
96
|
-
'canonical-url': string
|
|
97
|
-
'matched-text': string
|
|
98
|
-
title: string
|
|
99
|
-
description?: string
|
|
100
|
-
jpegThumbnail?: Buffer
|
|
101
|
-
highQualityThumbnail?: proto.Message.IImageMessage
|
|
102
|
-
originalThumbnailUrl?: string
|
|
64
|
+
'canonical-url': string;
|
|
65
|
+
'matched-text': string;
|
|
66
|
+
title: string;
|
|
67
|
+
description?: string;
|
|
68
|
+
jpegThumbnail?: Buffer;
|
|
69
|
+
highQualityThumbnail?: proto.Message.IImageMessage;
|
|
70
|
+
originalThumbnailUrl?: string;
|
|
103
71
|
}
|
|
104
|
-
|
|
105
72
|
type Mentionable = {
|
|
106
73
|
/** list of jids that are mentioned in the accompanying text */
|
|
107
|
-
mentions?: string[]
|
|
108
|
-
|
|
109
|
-
|
|
74
|
+
mentions?: string[];
|
|
75
|
+
/** mention all */
|
|
76
|
+
mentionAll?: boolean;
|
|
77
|
+
};
|
|
110
78
|
type Contextable = {
|
|
111
79
|
/** add contextInfo to the message */
|
|
112
|
-
contextInfo?: proto.IContextInfo
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
type Ephemeral = {
|
|
116
|
-
ephemeral?: boolean
|
|
117
|
-
}
|
|
118
|
-
|
|
80
|
+
contextInfo?: proto.IContextInfo;
|
|
81
|
+
};
|
|
119
82
|
type ViewOnce = {
|
|
120
|
-
viewOnce?: boolean
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
type ViewOnceExt = {
|
|
124
|
-
viewOnceExt?: boolean
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
type Buttonable = {
|
|
128
|
-
/** add buttons to the message */
|
|
129
|
-
buttons?: proto.Message.ButtonsMessage.IButton[]
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
type Templatable = {
|
|
133
|
-
/** add buttons to the message (conflicts with normal buttons)*/
|
|
134
|
-
templateButtons?: proto.IHydratedTemplateButton[]
|
|
135
|
-
footer?: string
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
type Interactiveable = {
|
|
139
|
-
/** add buttons to the message (conflicts with normal buttons)*/
|
|
140
|
-
interactiveButtons?: proto.Message.InteractiveMessage.NativeFlowMessage.INativeFlowButton[]
|
|
141
|
-
title?: string
|
|
142
|
-
subtitle?: string
|
|
143
|
-
footer?: string
|
|
144
|
-
hasMediaAttachment?: boolean
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
type Shopable = {
|
|
148
|
-
shop?: proto.Message.InteractiveMessage.ShopMessage
|
|
149
|
-
title?: string
|
|
150
|
-
subtitle?: string
|
|
151
|
-
footer?: string
|
|
152
|
-
hasMediaAttachment?: boolean
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
type Collectionable = {
|
|
156
|
-
collection?: proto.Message.InteractiveMessage.CollectionMessage
|
|
157
|
-
title?: string
|
|
158
|
-
subtitle?: string
|
|
159
|
-
footer?: string
|
|
160
|
-
hasMediaAttachment?: boolean
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
type Listable = {
|
|
164
|
-
/** Sections of the List */
|
|
165
|
-
sections?: proto.Message.ListMessage.ISection[]
|
|
166
|
-
/** Title of a List Message only */
|
|
167
|
-
title?: string
|
|
168
|
-
/** Text of the button on the list (required) */
|
|
169
|
-
buttonText?: string
|
|
170
|
-
/** ListType of a List Message only */
|
|
171
|
-
listType?: proto.Message.ListMessage.ListType
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
type Cardsable = {
|
|
175
|
-
cards?: Carousel[]
|
|
176
|
-
title?: string
|
|
177
|
-
subtitle?: string
|
|
178
|
-
footer?: string
|
|
179
|
-
}
|
|
180
|
-
|
|
83
|
+
viewOnce?: boolean;
|
|
84
|
+
};
|
|
181
85
|
type Editable = {
|
|
182
|
-
edit?: WAMessageKey
|
|
183
|
-
}
|
|
184
|
-
|
|
86
|
+
edit?: WAMessageKey;
|
|
87
|
+
};
|
|
185
88
|
type WithDimensions = {
|
|
186
|
-
width?: number
|
|
187
|
-
height?: number
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export type Sticker = {
|
|
191
|
-
data: WAMediaUpload
|
|
192
|
-
emojis?: string[]
|
|
193
|
-
accessibilityLabel?: string
|
|
194
|
-
}
|
|
195
|
-
|
|
89
|
+
width?: number;
|
|
90
|
+
height?: number;
|
|
91
|
+
};
|
|
196
92
|
export type PollMessageOptions = {
|
|
197
|
-
name: string
|
|
198
|
-
selectableCount?: number
|
|
199
|
-
values: string[]
|
|
93
|
+
name: string;
|
|
94
|
+
selectableCount?: number;
|
|
95
|
+
values: string[];
|
|
200
96
|
/** 32 byte message secret to encrypt poll selections */
|
|
201
|
-
messageSecret?: Uint8Array
|
|
202
|
-
toAnnouncementGroup?: boolean
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
97
|
+
messageSecret?: Uint8Array;
|
|
98
|
+
toAnnouncementGroup?: boolean;
|
|
99
|
+
};
|
|
100
|
+
export type EventMessageOptions = {
|
|
101
|
+
name: string;
|
|
102
|
+
description?: string;
|
|
103
|
+
startDate: Date;
|
|
104
|
+
endDate?: Date;
|
|
105
|
+
location?: WALocationMessage;
|
|
106
|
+
call?: 'audio' | 'video';
|
|
107
|
+
isCancelled?: boolean;
|
|
108
|
+
isScheduleCall?: boolean;
|
|
109
|
+
extraGuestsAllowed?: boolean;
|
|
110
|
+
messageSecret?: Uint8Array<ArrayBufferLike>;
|
|
111
|
+
};
|
|
112
|
+
export type AlbumMessageOptions = {
|
|
113
|
+
/** Number of images expected in the album */
|
|
114
|
+
expectedImageCount?: number;
|
|
115
|
+
/** Number of videos expected in the album */
|
|
116
|
+
expectedVideoCount?: number;
|
|
117
|
+
};
|
|
210
118
|
type SharePhoneNumber = {
|
|
211
|
-
sharePhoneNumber: boolean
|
|
212
|
-
}
|
|
213
|
-
|
|
119
|
+
sharePhoneNumber: boolean;
|
|
120
|
+
};
|
|
214
121
|
type RequestPhoneNumber = {
|
|
215
|
-
requestPhoneNumber: boolean
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
export type MediaType = keyof typeof MEDIA_HKDF_KEY_MAPPING
|
|
219
|
-
|
|
122
|
+
requestPhoneNumber: boolean;
|
|
123
|
+
};
|
|
220
124
|
export type AnyMediaMessageContent = (({
|
|
221
|
-
image: WAMediaUpload
|
|
222
|
-
caption?: string
|
|
223
|
-
jpegThumbnail?: string
|
|
224
|
-
} & Mentionable & Contextable &
|
|
225
|
-
video: WAMediaUpload
|
|
226
|
-
caption?: string
|
|
227
|
-
gifPlayback?: boolean
|
|
228
|
-
jpegThumbnail?: string
|
|
229
|
-
|
|
230
|
-
|
|
125
|
+
image: WAMediaUpload;
|
|
126
|
+
caption?: string;
|
|
127
|
+
jpegThumbnail?: string;
|
|
128
|
+
} & Mentionable & Contextable & WithDimensions) | ({
|
|
129
|
+
video: WAMediaUpload;
|
|
130
|
+
caption?: string;
|
|
131
|
+
gifPlayback?: boolean;
|
|
132
|
+
jpegThumbnail?: string;
|
|
133
|
+
/** if set to true, will send as a `video note` */
|
|
134
|
+
ptv?: boolean;
|
|
135
|
+
} & Mentionable & Contextable & WithDimensions) | {
|
|
136
|
+
audio: WAMediaUpload;
|
|
231
137
|
/** if set to true, will send as a `voice note` */
|
|
232
|
-
ptt?: boolean
|
|
138
|
+
ptt?: boolean;
|
|
233
139
|
/** optionally tell the duration of the audio */
|
|
234
|
-
seconds?: number
|
|
140
|
+
seconds?: number;
|
|
235
141
|
} | ({
|
|
236
|
-
sticker: WAMediaUpload
|
|
237
|
-
isAnimated?: boolean
|
|
142
|
+
sticker: WAMediaUpload;
|
|
143
|
+
isAnimated?: boolean;
|
|
238
144
|
} & WithDimensions) | ({
|
|
239
|
-
document: WAMediaUpload
|
|
240
|
-
mimetype: string
|
|
241
|
-
fileName?: string
|
|
242
|
-
caption?: string
|
|
243
|
-
} & Contextable
|
|
244
|
-
mimetype?: string
|
|
245
|
-
} & Editable
|
|
246
|
-
|
|
145
|
+
document: WAMediaUpload;
|
|
146
|
+
mimetype: string;
|
|
147
|
+
fileName?: string;
|
|
148
|
+
caption?: string;
|
|
149
|
+
} & Contextable)) & {
|
|
150
|
+
mimetype?: string;
|
|
151
|
+
} & Editable & {
|
|
152
|
+
/** key of the parent albumMessage to associate this media with */
|
|
153
|
+
albumParentKey?: WAMessageKey;
|
|
154
|
+
};
|
|
247
155
|
export type ButtonReplyInfo = {
|
|
248
|
-
displayText: string
|
|
249
|
-
id: string
|
|
250
|
-
index: number
|
|
251
|
-
}
|
|
252
|
-
|
|
156
|
+
displayText: string;
|
|
157
|
+
id: string;
|
|
158
|
+
index: number;
|
|
159
|
+
};
|
|
253
160
|
export type GroupInviteInfo = {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
jid: string
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
export type CallCreationInfo = {
|
|
263
|
-
time?: number
|
|
264
|
-
type?: number
|
|
265
|
-
name: string
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
export type AdminInviteInfo = {
|
|
269
|
-
jid: string
|
|
270
|
-
name: string
|
|
271
|
-
caption: string
|
|
272
|
-
expiration: number
|
|
273
|
-
jpegThumbnail: string
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
export type PinInfo = {
|
|
277
|
-
key: WAMessageKey
|
|
278
|
-
type?: number
|
|
279
|
-
time?: number
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
export type KeepInfo = {
|
|
283
|
-
key: WAMessageKey
|
|
284
|
-
type: number
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
export type PaymentInfo = {
|
|
288
|
-
note: string
|
|
289
|
-
currency?: string
|
|
290
|
-
offset?: number
|
|
291
|
-
amount?: number
|
|
292
|
-
expiry?: number
|
|
293
|
-
from?: string
|
|
294
|
-
image?: {
|
|
295
|
-
placeholderArgb: number
|
|
296
|
-
textArgb: number
|
|
297
|
-
subtextArgb: number
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
161
|
+
inviteCode: string;
|
|
162
|
+
inviteExpiration: number;
|
|
163
|
+
text: string;
|
|
164
|
+
jid: string;
|
|
165
|
+
subject: string;
|
|
166
|
+
};
|
|
301
167
|
export type WASendableProduct = Omit<proto.Message.ProductMessage.IProductSnapshot, 'productImage'> & {
|
|
302
|
-
productImage: WAMediaUpload
|
|
303
|
-
}
|
|
304
|
-
|
|
168
|
+
productImage: WAMediaUpload;
|
|
169
|
+
};
|
|
305
170
|
export type AnyRegularMessageContent = (({
|
|
306
|
-
text: string
|
|
307
|
-
linkPreview?: WAUrlInfo | null
|
|
308
|
-
} & Mentionable & Contextable &
|
|
309
|
-
|
|
310
|
-
}
|
|
171
|
+
text: string;
|
|
172
|
+
linkPreview?: WAUrlInfo | null;
|
|
173
|
+
} & Mentionable & Contextable & Editable) | AnyMediaMessageContent | {
|
|
174
|
+
event: EventMessageOptions;
|
|
175
|
+
} | ({
|
|
176
|
+
poll: PollMessageOptions;
|
|
177
|
+
} & Mentionable & Contextable & Editable) | ({
|
|
178
|
+
album: AlbumMessageOptions;
|
|
179
|
+
} & Contextable & Mentionable) | {
|
|
311
180
|
contacts: {
|
|
312
|
-
displayName?: string
|
|
313
|
-
contacts: proto.Message.IContactMessage[]
|
|
314
|
-
}
|
|
315
|
-
} | {
|
|
316
|
-
location: WALocationMessage
|
|
181
|
+
displayName?: string;
|
|
182
|
+
contacts: proto.Message.IContactMessage[];
|
|
183
|
+
};
|
|
317
184
|
} | {
|
|
318
|
-
|
|
185
|
+
location: WALocationMessage;
|
|
319
186
|
} | {
|
|
320
|
-
|
|
321
|
-
type: 'template' | 'plain' | 'list' | 'interactive'
|
|
187
|
+
react: proto.Message.IReactionMessage;
|
|
322
188
|
} | {
|
|
323
|
-
|
|
189
|
+
buttonReply: ButtonReplyInfo;
|
|
190
|
+
type: 'template' | 'plain';
|
|
324
191
|
} | {
|
|
325
|
-
|
|
192
|
+
groupInvite: GroupInviteInfo;
|
|
326
193
|
} | {
|
|
327
|
-
|
|
194
|
+
listReply: Omit<proto.Message.IListResponseMessage, 'contextInfo'>;
|
|
328
195
|
} | {
|
|
329
|
-
|
|
196
|
+
pin: WAMessageKey;
|
|
197
|
+
type: proto.PinInChat.Type;
|
|
198
|
+
/**
|
|
199
|
+
* 24 hours, 7 days, 30 days
|
|
200
|
+
*/
|
|
201
|
+
time?: 86400 | 604800 | 2592000;
|
|
330
202
|
} | {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
} | {
|
|
337
|
-
paymentInvite: {
|
|
338
|
-
type: number
|
|
339
|
-
expiry: number
|
|
340
|
-
}
|
|
341
|
-
} | {
|
|
342
|
-
pollResult: PollResultOptions
|
|
343
|
-
} | {
|
|
344
|
-
order: WAOrderMessage
|
|
345
|
-
} | {
|
|
346
|
-
product: WASendableProduct
|
|
347
|
-
businessOwnerJid?: string
|
|
348
|
-
body?: string
|
|
349
|
-
footer?: string
|
|
350
|
-
} | {
|
|
351
|
-
stickerPack: StickerPack
|
|
352
|
-
} | SharePhoneNumber | RequestPhoneNumber) & ViewOnce & ViewOnceExt
|
|
353
|
-
|
|
203
|
+
product: WASendableProduct;
|
|
204
|
+
businessOwnerJid?: string;
|
|
205
|
+
body?: string;
|
|
206
|
+
footer?: string;
|
|
207
|
+
} | SharePhoneNumber | RequestPhoneNumber) & ViewOnce;
|
|
354
208
|
export type AnyMessageContent = AnyRegularMessageContent | {
|
|
355
|
-
forward: WAMessage
|
|
356
|
-
force?: boolean
|
|
209
|
+
forward: WAMessage;
|
|
210
|
+
force?: boolean;
|
|
357
211
|
} | {
|
|
358
212
|
/** Delete your message or anyone's message in a group (admin required) */
|
|
359
|
-
delete: WAMessageKey
|
|
213
|
+
delete: WAMessageKey;
|
|
360
214
|
} | {
|
|
361
|
-
disappearingMessagesInChat: boolean | number
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
215
|
+
disappearingMessagesInChat: boolean | number;
|
|
216
|
+
} | {
|
|
217
|
+
limitSharing: boolean;
|
|
218
|
+
};
|
|
219
|
+
export type GroupMetadataParticipants = Pick<GroupMetadata, 'participants'>;
|
|
366
220
|
type MinimalRelayOptions = {
|
|
367
221
|
/** override the message ID with a custom provided string */
|
|
368
|
-
messageId?: string
|
|
369
|
-
/** should we use group metadata cache, or fetch afresh from the server default assumed to be "true" */
|
|
370
|
-
useCachedGroupMetadata?: boolean
|
|
371
|
-
}
|
|
372
|
-
|
|
222
|
+
messageId?: string;
|
|
223
|
+
/** should we use group metadata cache, or fetch afresh from the server; default assumed to be "true" */
|
|
224
|
+
useCachedGroupMetadata?: boolean;
|
|
225
|
+
};
|
|
373
226
|
export type MessageRelayOptions = MinimalRelayOptions & {
|
|
374
|
-
/** only send to a specific participant used when a message decryption fails for a single user */
|
|
227
|
+
/** only send to a specific participant; used when a message decryption fails for a single user */
|
|
375
228
|
participant?: {
|
|
376
|
-
jid: string
|
|
377
|
-
count: number
|
|
378
|
-
}
|
|
229
|
+
jid: string;
|
|
230
|
+
count: number;
|
|
231
|
+
};
|
|
379
232
|
/** additional attributes to add to the WA binary node */
|
|
380
233
|
additionalAttributes?: {
|
|
381
|
-
[_: string]: string
|
|
382
|
-
}
|
|
383
|
-
additionalNodes?: BinaryNode[]
|
|
384
|
-
/** should we use the devices cache, or fetch afresh from the server default assumed to be "true" */
|
|
385
|
-
useUserDevicesCache?: boolean
|
|
234
|
+
[_: string]: string;
|
|
235
|
+
};
|
|
236
|
+
additionalNodes?: BinaryNode[];
|
|
237
|
+
/** should we use the devices cache, or fetch afresh from the server; default assumed to be "true" */
|
|
238
|
+
useUserDevicesCache?: boolean;
|
|
386
239
|
/** jid list of participants for status@broadcast */
|
|
387
|
-
statusJidList?: string[]
|
|
388
|
-
|
|
389
|
-
}
|
|
390
|
-
|
|
240
|
+
statusJidList?: string[];
|
|
241
|
+
};
|
|
391
242
|
export type MiscMessageGenerationOptions = MinimalRelayOptions & {
|
|
392
243
|
/** optional, if you want to manually set the timestamp of the message */
|
|
393
|
-
timestamp?: Date
|
|
244
|
+
timestamp?: Date;
|
|
394
245
|
/** the message you want to quote */
|
|
395
|
-
quoted?: WAMessage
|
|
246
|
+
quoted?: WAMessage;
|
|
396
247
|
/** disappearing messages settings */
|
|
397
|
-
ephemeralExpiration?: number | string
|
|
248
|
+
ephemeralExpiration?: number | string;
|
|
398
249
|
/** timeout for media upload to WA server */
|
|
399
|
-
mediaUploadTimeoutMs?: number
|
|
250
|
+
mediaUploadTimeoutMs?: number;
|
|
400
251
|
/** jid list of participants for status@broadcast */
|
|
401
|
-
statusJidList?: string[]
|
|
252
|
+
statusJidList?: string[];
|
|
402
253
|
/** backgroundcolor for status */
|
|
403
|
-
backgroundColor?: string
|
|
254
|
+
backgroundColor?: string;
|
|
404
255
|
/** font type for status */
|
|
405
|
-
font?: number
|
|
256
|
+
font?: number;
|
|
406
257
|
/** if it is broadcast */
|
|
407
|
-
broadcast?: boolean
|
|
408
|
-
|
|
409
|
-
additionalNodes?: BinaryNode[]
|
|
410
|
-
}
|
|
411
|
-
|
|
258
|
+
broadcast?: boolean;
|
|
259
|
+
};
|
|
412
260
|
export type MessageGenerationOptionsFromContent = MiscMessageGenerationOptions & {
|
|
413
|
-
userJid: string
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
handle?: string
|
|
427
|
-
meta_hmac?: string
|
|
428
|
-
ts?: number
|
|
429
|
-
fbid?: number
|
|
430
|
-
}>
|
|
431
|
-
|
|
261
|
+
userJid: string;
|
|
262
|
+
};
|
|
263
|
+
export type WAMediaUploadFunction = (encFilePath: string, opts: {
|
|
264
|
+
fileEncSha256B64: string;
|
|
265
|
+
mediaType: MediaType;
|
|
266
|
+
timeoutMs?: number;
|
|
267
|
+
}) => Promise<{
|
|
268
|
+
mediaUrl: string;
|
|
269
|
+
directPath: string;
|
|
270
|
+
meta_hmac?: string;
|
|
271
|
+
ts?: number;
|
|
272
|
+
fbid?: number;
|
|
273
|
+
}>;
|
|
432
274
|
export type MediaGenerationOptions = {
|
|
433
|
-
logger?: ILogger
|
|
434
|
-
mediaTypeOverride?: MediaType
|
|
435
|
-
upload: WAMediaUploadFunction
|
|
275
|
+
logger?: ILogger;
|
|
276
|
+
mediaTypeOverride?: MediaType;
|
|
277
|
+
upload: WAMediaUploadFunction;
|
|
436
278
|
/** cache media so it does not have to be uploaded again */
|
|
437
|
-
mediaCache?: CacheStore
|
|
438
|
-
mediaUploadTimeoutMs?: number
|
|
439
|
-
options?:
|
|
440
|
-
backgroundColor?: string
|
|
441
|
-
font?: number
|
|
442
|
-
|
|
443
|
-
newsletter?: boolean
|
|
444
|
-
}
|
|
445
|
-
|
|
279
|
+
mediaCache?: CacheStore;
|
|
280
|
+
mediaUploadTimeoutMs?: number;
|
|
281
|
+
options?: RequestInit;
|
|
282
|
+
backgroundColor?: string;
|
|
283
|
+
font?: number;
|
|
284
|
+
};
|
|
446
285
|
export type MessageContentGenerationOptions = MediaGenerationOptions & {
|
|
447
|
-
getUrlInfo?: (text: string) => Promise<WAUrlInfo | undefined
|
|
448
|
-
getProfilePicUrl?: (jid: string) => Promise<string | undefined
|
|
449
|
-
getCallLink?: (type: 'audio' | 'video', event?:
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
286
|
+
getUrlInfo?: (text: string) => Promise<WAUrlInfo | undefined>;
|
|
287
|
+
getProfilePicUrl?: (jid: string, type: 'image' | 'preview') => Promise<string | undefined>;
|
|
288
|
+
getCallLink?: (type: 'audio' | 'video', event?: {
|
|
289
|
+
startTime: number;
|
|
290
|
+
}) => Promise<string | undefined>;
|
|
291
|
+
jid?: string;
|
|
292
|
+
};
|
|
293
|
+
export type MessageGenerationOptions = MessageContentGenerationOptions & MessageGenerationOptionsFromContent;
|
|
453
294
|
/**
|
|
454
295
|
* Type of message upsert
|
|
455
296
|
* 1. notify => notify the user, this message was just received
|
|
456
297
|
* 2. append => append the message to the chat history, no notification required
|
|
457
298
|
*/
|
|
458
|
-
export type MessageUpsertType = 'append' | 'notify'
|
|
459
|
-
|
|
460
|
-
export type MessageUserReceipt = proto.IUserReceipt
|
|
461
|
-
|
|
299
|
+
export type MessageUpsertType = 'append' | 'notify';
|
|
300
|
+
export type MessageUserReceipt = proto.IUserReceipt;
|
|
462
301
|
export type WAMessageUpdate = {
|
|
463
|
-
update: Partial<WAMessage
|
|
464
|
-
key:
|
|
465
|
-
}
|
|
466
|
-
|
|
302
|
+
update: Partial<WAMessage>;
|
|
303
|
+
key: WAMessageKey;
|
|
304
|
+
};
|
|
467
305
|
export type WAMessageCursor = {
|
|
468
|
-
before: WAMessageKey | undefined
|
|
306
|
+
before: WAMessageKey | undefined;
|
|
469
307
|
} | {
|
|
470
|
-
after: WAMessageKey | undefined
|
|
471
|
-
}
|
|
472
|
-
|
|
308
|
+
after: WAMessageKey | undefined;
|
|
309
|
+
};
|
|
473
310
|
export type MessageUserReceiptUpdate = {
|
|
474
|
-
key:
|
|
475
|
-
receipt: MessageUserReceipt
|
|
476
|
-
}
|
|
477
|
-
|
|
311
|
+
key: WAMessageKey;
|
|
312
|
+
receipt: MessageUserReceipt;
|
|
313
|
+
};
|
|
478
314
|
export type MediaDecryptionKeyInfo = {
|
|
479
|
-
iv:
|
|
480
|
-
cipherKey:
|
|
481
|
-
macKey?:
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
|
|
315
|
+
iv: Uint8Array;
|
|
316
|
+
cipherKey: Uint8Array;
|
|
317
|
+
macKey?: Uint8Array;
|
|
318
|
+
};
|
|
319
|
+
export type MinimalMessage = Pick<WAMessage, 'key' | 'messageTimestamp'>;
|
|
320
|
+
//# sourceMappingURL=Message.d.ts.map
|