zapo-js 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{types/appstate → appstate}/crypto/WaAppStateCrypto.d.ts +1 -1
- package/dist/appstate/crypto/WaAppStateCrypto.js +1 -1
- package/dist/appstate/parsers/encoding.js +1 -1
- package/dist/{types/appstate → appstate}/parsers/response-parser.d.ts +1 -1
- package/dist/appstate/parsers/response-parser.js +1 -1
- package/dist/{types/appstate → appstate}/sync/WaAppStateSyncClient.d.ts +1 -1
- package/dist/appstate/sync/WaAppStateSyncClient.js +2 -2
- package/dist/{types/appstate → appstate}/types.d.ts +1 -1
- package/dist/{types/appstate → appstate}/utils.d.ts +1 -1
- package/dist/{types/appstate-spec.d.ts → appstate-spec.d.ts} +1 -1
- package/dist/appstate-spec.js +1 -1
- package/dist/auth/credentials-flow.js +2 -2
- package/dist/auth/pairing/WaPairingFlow.js +2 -2
- package/dist/auth/pairing/pairing-code-crypto.js +1 -1
- package/dist/{types/auth → auth}/types.d.ts +1 -1
- package/dist/client/WaClient.js +2 -2
- package/dist/client/WaClientFactory.js +3 -1
- package/dist/{types/client → client}/coordinators/WaAppStateMutationCoordinator.d.ts +2 -2
- package/dist/client/coordinators/WaAppStateMutationCoordinator.js +2 -2
- package/dist/{types/client → client}/coordinators/WaBotCoordinator.d.ts +1 -1
- package/dist/client/coordinators/WaBotCoordinator.js +1 -1
- package/dist/{types/client → client}/coordinators/WaBroadcastListCoordinator.d.ts +1 -1
- package/dist/{types/client → client}/coordinators/WaMessageCoordinator.d.ts +1 -1
- package/dist/client/coordinators/WaMessageCoordinator.js +3 -19
- package/dist/{types/client → client}/coordinators/WaMessageDispatchCoordinator.d.ts +1 -1
- package/dist/client/coordinators/WaMessageDispatchCoordinator.js +5 -4
- package/dist/client/coordinators/WaRetryCoordinator.js +1 -1
- package/dist/{types/client → client}/coordinators/WaStatusCoordinator.d.ts +1 -1
- package/dist/client/coordinators/WaStatusCoordinator.js +1 -1
- package/dist/client/coordinators/WaStreamControlCoordinator.js +2 -3
- package/dist/client/events/appstate-mutation.js +1 -1
- package/dist/client/events/business.js +1 -1
- package/dist/client/events/incoming.js +3 -1
- package/dist/client/events/receipt.d.ts +30 -0
- package/dist/client/events/receipt.js +32 -0
- package/dist/{types/client → client}/media.d.ts +59 -2
- package/dist/client/media.js +62 -2
- package/dist/client/messaging/group-metadata.js +20 -9
- package/dist/{types/client → client}/messaging/key-protocol.d.ts +1 -1
- package/dist/client/messaging/key-protocol.js +1 -1
- package/dist/client/messaging/link-preview.js +1 -1
- package/dist/client/messaging/messages.js +2 -2
- package/dist/{types/client → client}/newsletter/admin.d.ts +1 -1
- package/dist/client/newsletter/content.js +1 -1
- package/dist/{types/client → client}/newsletter/mex.d.ts +1 -1
- package/dist/{types/client → client}/newsletter/parse.d.ts +1 -1
- package/dist/{types/client → client}/newsletter/types.d.ts +1 -1
- package/dist/{types/client → client}/persistence/history-sync.d.ts +1 -1
- package/dist/client/persistence/history-sync.js +1 -1
- package/dist/client/persistence/mailbox.js +1 -1
- package/dist/{types/client → client}/types.d.ts +9 -2
- package/dist/esm/appstate-spec.js +2 -2
- package/dist/esm/client/WaClient.js +1 -1
- package/dist/esm/client/WaClientFactory.js +3 -1
- package/dist/esm/client/coordinators/WaMessageCoordinator.js +2 -18
- package/dist/esm/client/coordinators/WaMessageDispatchCoordinator.js +2 -1
- package/dist/esm/client/coordinators/WaStreamControlCoordinator.js +2 -3
- package/dist/esm/client/events/incoming.js +3 -1
- package/dist/esm/client/events/receipt.js +31 -0
- package/dist/esm/client/media.js +61 -2
- package/dist/esm/client/messaging/group-metadata.js +20 -9
- package/dist/esm/index.js +2 -0
- package/dist/esm/message/context-info.js +16 -3
- package/dist/esm/message/encode/media-payload.js +18 -0
- package/dist/esm/mex.js +1 -1
- package/dist/esm/protocol/message.js +2 -1
- package/dist/esm/signal/api/SignalDeviceSyncApi.js +3 -1
- package/dist/esm/signal/registration/utils.js +3 -2
- package/dist/esm/store/locks/pre-key.lock.js +4 -1
- package/dist/esm/version-spec.js +1 -1
- package/dist/{types/index.d.ts → index.d.ts} +10 -7
- package/dist/index.js +10 -6
- package/dist/{types/message → message}/addons/link-preview/builder.d.ts +1 -1
- package/dist/message/addons/link-preview/fetcher.js +1 -1
- package/dist/{types/message → message}/addons/link-preview/types.d.ts +1 -1
- package/dist/{types/message → message}/context-info.d.ts +10 -1
- package/dist/message/context-info.js +15 -2
- package/dist/{types/message → message}/crypto/addon-crypto.d.ts +1 -1
- package/dist/message/crypto/addon-crypto.js +2 -2
- package/dist/{types/message → message}/crypto/icdc.d.ts +1 -1
- package/dist/message/crypto/icdc.js +1 -1
- package/dist/{types/message → message}/crypto/reporting-token.d.ts +1 -1
- package/dist/message/crypto/reporting-token.js +2 -2
- package/dist/{types/message → message}/crypto/use-case-secret.d.ts +1 -1
- package/dist/message/crypto/use-case-secret.js +1 -1
- package/dist/{types/message → message}/encode/content.d.ts +1 -1
- package/dist/message/encode/content.js +1 -1
- package/dist/{types/message → message}/encode/device-sent.d.ts +1 -1
- package/dist/message/encode/media-payload.d.ts +43 -0
- package/dist/message/encode/media-payload.js +18 -0
- package/dist/message/encode/padding.js +1 -1
- package/dist/{types/message → message}/kinds/bot.d.ts +1 -1
- package/dist/message/kinds/bot.js +2 -2
- package/dist/message/kinds/newsletter.js +1 -1
- package/dist/{types/message → message}/kinds/sticker-pack.d.ts +1 -1
- package/dist/{types/message → message}/primitives/incoming.d.ts +1 -1
- package/dist/message/primitives/incoming.js +1 -1
- package/dist/{types/message → message}/primitives/peer-data-operation.d.ts +1 -1
- package/dist/message/primitives/peer-data-operation.js +1 -1
- package/dist/{types/message → message}/types.d.ts +1 -1
- package/dist/{types/protocol → protocol}/bot.d.ts +1 -1
- package/dist/protocol/bot.js +1 -1
- package/dist/{types/protocol → protocol}/message.d.ts +1 -0
- package/dist/protocol/message.js +2 -1
- package/dist/retry/replay.js +1 -1
- package/dist/signal/api/SignalDeviceSyncApi.js +3 -1
- package/dist/signal/api/SignalDigestSyncApi.js +1 -1
- package/dist/signal/attestation/WaAdvSignature.js +1 -1
- package/dist/signal/group/SenderKeyChain.js +1 -1
- package/dist/signal/group/SenderKeyCodec.js +2 -2
- package/dist/{types/signal → signal}/group/SenderKeyManager.d.ts +1 -1
- package/dist/signal/group/SenderKeyManager.js +2 -2
- package/dist/signal/group/encoding.js +1 -1
- package/dist/signal/registration/keygen.js +1 -1
- package/dist/signal/registration/utils.js +3 -2
- package/dist/signal/session/SignalProtocol.js +1 -1
- package/dist/signal/session/SignalRatchet.js +2 -2
- package/dist/signal/session/SignalSerializer.js +2 -2
- package/dist/signal/session/SignalSession.js +1 -1
- package/dist/{types/signal → signal}/session/encoding.d.ts +1 -1
- package/dist/signal/session/encoding.js +1 -1
- package/dist/{types/signal → signal}/types.d.ts +1 -1
- package/dist/store/locks/pre-key.lock.js +4 -1
- package/dist/transport/node/builders/global.js +1 -1
- package/dist/transport/node/helpers.js +1 -1
- package/dist/{types/transport → transport}/node/mex/client.d.ts +1 -1
- package/dist/transport/node/mex/client.js +1 -1
- package/dist/transport/noise/WaClientPayload.js +2 -2
- package/dist/{types/transport → transport}/noise/WaMobileClientPayload.d.ts +1 -1
- package/dist/transport/noise/WaMobileClientPayload.js +1 -1
- package/dist/transport/noise/WaNoiseCert.js +2 -2
- package/dist/transport/noise/WaNoiseHandshake.js +1 -1
- package/dist/transport/noise/WaNoiseSession.js +2 -2
- package/dist/transport/noise/WaNoiseSocket.js +1 -1
- package/dist/{types/transport → transport}/noise/types.d.ts +1 -1
- package/package.json +20 -16
- package/dist/types/client/events/receipt.d.ts +0 -14
- package/dist/types/message/encode/media-payload.d.ts +0 -12
- /package/dist/{types/appstate → appstate}/constants.d.ts +0 -0
- /package/dist/{types/appstate → appstate}/index.d.ts +0 -0
- /package/dist/{types/appstate → appstate}/parsers/encoding.d.ts +0 -0
- /package/dist/{types/auth → auth}/WaAuthClient.d.ts +0 -0
- /package/dist/{types/auth → auth}/credentials-flow.d.ts +0 -0
- /package/dist/{types/auth → auth}/index.d.ts +0 -0
- /package/dist/{types/auth → auth}/pairing/WaPairingFlow.d.ts +0 -0
- /package/dist/{types/auth → auth}/pairing/WaQrFlow.d.ts +0 -0
- /package/dist/{types/auth → auth}/pairing/pairing-code-crypto.d.ts +0 -0
- /package/dist/{types/client → client}/WaClient.d.ts +0 -0
- /package/dist/{types/client → client}/WaClientFactory.d.ts +0 -0
- /package/dist/{types/client → client}/connection/WaConnectionManager.d.ts +0 -0
- /package/dist/{types/client → client}/connection/WaReceiptQueue.d.ts +0 -0
- /package/dist/{types/client → client}/coordinators/WaAbPropsCoordinator.d.ts +0 -0
- /package/dist/{types/client → client}/coordinators/WaBusinessCoordinator.d.ts +0 -0
- /package/dist/{types/client → client}/coordinators/WaEmailCoordinator.d.ts +0 -0
- /package/dist/{types/client → client}/coordinators/WaGroupCoordinator.d.ts +0 -0
- /package/dist/{types/client → client}/coordinators/WaIncomingNodeCoordinator.d.ts +0 -0
- /package/dist/{types/client → client}/coordinators/WaLowLevelCoordinator.d.ts +0 -0
- /package/dist/{types/client → client}/coordinators/WaNewsletterCoordinator.d.ts +0 -0
- /package/dist/{types/client → client}/coordinators/WaOfflineResumeCoordinator.d.ts +0 -0
- /package/dist/{types/client → client}/coordinators/WaPassiveTasksCoordinator.d.ts +0 -0
- /package/dist/{types/client → client}/coordinators/WaPresenceCoordinator.d.ts +0 -0
- /package/dist/{types/client → client}/coordinators/WaPrivacyCoordinator.d.ts +0 -0
- /package/dist/{types/client → client}/coordinators/WaProfileCoordinator.d.ts +0 -0
- /package/dist/{types/client → client}/coordinators/WaRetryCoordinator.d.ts +0 -0
- /package/dist/{types/client → client}/coordinators/WaStreamControlCoordinator.d.ts +0 -0
- /package/dist/{types/client → client}/coordinators/WaTrustedContactTokenCoordinator.d.ts +0 -0
- /package/dist/{types/client → client}/events/abprops.d.ts +0 -0
- /package/dist/{types/client → client}/events/appstate-mutation.d.ts +0 -0
- /package/dist/{types/client → client}/events/business.d.ts +0 -0
- /package/dist/{types/client → client}/events/call.d.ts +0 -0
- /package/dist/{types/client → client}/events/chatstate.d.ts +0 -0
- /package/dist/{types/client → client}/events/devices.d.ts +0 -0
- /package/dist/{types/client → client}/events/dirty.d.ts +0 -0
- /package/dist/{types/client → client}/events/group.d.ts +0 -0
- /package/dist/{types/client → client}/events/identity.d.ts +0 -0
- /package/dist/{types/client → client}/events/incoming.d.ts +0 -0
- /package/dist/{types/client → client}/events/mex-notification.d.ts +0 -0
- /package/dist/{types/client → client}/events/picture.d.ts +0 -0
- /package/dist/{types/client → client}/events/presence.d.ts +0 -0
- /package/dist/{types/client → client}/events/privacy-token.d.ts +0 -0
- /package/dist/{types/client → client}/events/registration.d.ts +0 -0
- /package/dist/{types/client → client}/index.d.ts +0 -0
- /package/dist/{types/client → client}/messaging/fanout.d.ts +0 -0
- /package/dist/{types/client → client}/messaging/group-metadata.d.ts +0 -0
- /package/dist/{types/client → client}/messaging/ignore-key.d.ts +0 -0
- /package/dist/{types/client → client}/messaging/link-preview.d.ts +0 -0
- /package/dist/{types/client → client}/messaging/messages.d.ts +0 -0
- /package/dist/{types/client → client}/newsletter/content.d.ts +0 -0
- /package/dist/{types/client → client}/newsletter/discovery.d.ts +0 -0
- /package/dist/{types/client → client}/newsletter/messaging.d.ts +0 -0
- /package/dist/{types/client → client}/persistence/WriteBehindPersistence.d.ts +0 -0
- /package/dist/{types/client → client}/persistence/mailbox.d.ts +0 -0
- /package/dist/{types/client → client}/tokens/cs-token.d.ts +0 -0
- /package/dist/{types/client → client}/tokens/tc-token.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/core/hkdf.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/core/index.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/core/keys.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/core/nonce.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/core/primitives.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/core/random.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/core/xeddsa.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/curves/Ed25519.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/curves/X25519.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/curves/constants.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/curves/types.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/index.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/math/constants.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/math/edwards.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/math/fe.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/math/le.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/math/mod.d.ts +0 -0
- /package/dist/{types/crypto → crypto}/math/types.d.ts +0 -0
- /package/dist/{types/infra → infra}/log/ConsoleLogger.d.ts +0 -0
- /package/dist/{types/infra → infra}/log/PinoLogger.d.ts +0 -0
- /package/dist/{types/infra → infra}/log/types.d.ts +0 -0
- /package/dist/{types/infra → infra}/perf/BackgroundQueue.d.ts +0 -0
- /package/dist/{types/infra → infra}/perf/BoundedTaskQueue.d.ts +0 -0
- /package/dist/{types/infra → infra}/perf/PromiseDedup.d.ts +0 -0
- /package/dist/{types/infra → infra}/perf/SharedExclusiveGate.d.ts +0 -0
- /package/dist/{types/infra → infra}/perf/StoreLock.d.ts +0 -0
- /package/dist/{types/media → media}/constants.d.ts +0 -0
- /package/dist/{types/media → media}/crypto/WaMediaCrypto.d.ts +0 -0
- /package/dist/{types/media → media}/index.d.ts +0 -0
- /package/dist/{types/media → media}/processor.d.ts +0 -0
- /package/dist/{types/media → media}/sticker/sticker-pack.d.ts +0 -0
- /package/dist/{types/media → media}/transfer/WaMediaTransferClient.d.ts +0 -0
- /package/dist/{types/media → media}/transfer/conn.d.ts +0 -0
- /package/dist/{types/media → media}/types.d.ts +0 -0
- /package/dist/{types/message → message}/WaMessageClient.d.ts +0 -0
- /package/dist/{types/message → message}/addons/link-preview/detect.d.ts +0 -0
- /package/dist/{types/message → message}/addons/link-preview/fetcher.d.ts +0 -0
- /package/dist/{types/message → message}/crypto/phash.d.ts +0 -0
- /package/dist/{types/message → message}/encode/padding.d.ts +0 -0
- /package/dist/{types/message → message}/index.d.ts +0 -0
- /package/dist/{types/message → message}/kinds/newsletter.d.ts +0 -0
- /package/dist/{types/message → message}/primitives/ack.d.ts +0 -0
- /package/dist/{types/mex.d.ts → mex.d.ts} +0 -0
- /package/dist/{types/proto.d.ts → proto.d.ts} +0 -0
- /package/dist/{types/protocol → protocol}/abprops.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/appstate.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/auth.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/browser.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/business.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/call.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/constants.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/defaults.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/dirty.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/email.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/group.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/index.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/jid.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/media.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/newsletter.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/nodes.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/notification.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/presence.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/privacy-token.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/privacy.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/status.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/stream.d.ts +0 -0
- /package/dist/{types/protocol → protocol}/usync.d.ts +0 -0
- /package/dist/{types/retry → retry}/codec.d.ts +0 -0
- /package/dist/{types/retry → retry}/constants.d.ts +0 -0
- /package/dist/{types/retry → retry}/index.d.ts +0 -0
- /package/dist/{types/retry → retry}/parse.d.ts +0 -0
- /package/dist/{types/retry → retry}/reason.d.ts +0 -0
- /package/dist/{types/retry → retry}/replay.d.ts +0 -0
- /package/dist/{types/retry → retry}/tracker.d.ts +0 -0
- /package/dist/{types/retry → retry}/types.d.ts +0 -0
- /package/dist/{types/signal → signal}/api/SignalDeviceSyncApi.d.ts +0 -0
- /package/dist/{types/signal → signal}/api/SignalDigestSyncApi.d.ts +0 -0
- /package/dist/{types/signal → signal}/api/SignalIdentitySyncApi.d.ts +0 -0
- /package/dist/{types/signal → signal}/api/SignalMissingPreKeysSyncApi.d.ts +0 -0
- /package/dist/{types/signal → signal}/api/SignalRotateKeyApi.d.ts +0 -0
- /package/dist/{types/signal → signal}/api/SignalSessionSyncApi.d.ts +0 -0
- /package/dist/{types/signal → signal}/api/codec.d.ts +0 -0
- /package/dist/{types/signal → signal}/api/constants.d.ts +0 -0
- /package/dist/{types/signal → signal}/api/prekeys.d.ts +0 -0
- /package/dist/{types/signal → signal}/api/result-map.d.ts +0 -0
- /package/dist/{types/signal → signal}/attestation/WaAdvSignature.d.ts +0 -0
- /package/dist/{types/signal → signal}/attestation/constants.d.ts +0 -0
- /package/dist/{types/signal → signal}/constants.d.ts +0 -0
- /package/dist/{types/signal → signal}/encoding.d.ts +0 -0
- /package/dist/{types/signal → signal}/group/SenderKeyChain.d.ts +0 -0
- /package/dist/{types/signal → signal}/group/SenderKeyCodec.d.ts +0 -0
- /package/dist/{types/signal → signal}/group/encoding.d.ts +0 -0
- /package/dist/{types/signal → signal}/index.d.ts +0 -0
- /package/dist/{types/signal → signal}/registration/encoding.d.ts +0 -0
- /package/dist/{types/signal → signal}/registration/keygen.d.ts +0 -0
- /package/dist/{types/signal → signal}/registration/utils.d.ts +0 -0
- /package/dist/{types/signal → signal}/session/SignalProtocol.d.ts +0 -0
- /package/dist/{types/signal → signal}/session/SignalRatchet.d.ts +0 -0
- /package/dist/{types/signal → signal}/session/SignalSerializer.d.ts +0 -0
- /package/dist/{types/signal → signal}/session/SignalSession.d.ts +0 -0
- /package/dist/{types/signal → signal}/session/resolver.d.ts +0 -0
- /package/dist/{types/store → store}/cache/identity.cache.d.ts +0 -0
- /package/dist/{types/store → store}/cache/privacy-token.cache.d.ts +0 -0
- /package/dist/{types/store → store}/cache/sender-key.cache.d.ts +0 -0
- /package/dist/{types/store → store}/cache/session.cache.d.ts +0 -0
- /package/dist/{types/store → store}/contracts/appstate.store.d.ts +0 -0
- /package/dist/{types/store → store}/contracts/auth.store.d.ts +0 -0
- /package/dist/{types/store → store}/contracts/contact.store.d.ts +0 -0
- /package/dist/{types/store → store}/contracts/device-list.store.d.ts +0 -0
- /package/dist/{types/store → store}/contracts/group-metadata.store.d.ts +0 -0
- /package/dist/{types/store → store}/contracts/identity.store.d.ts +0 -0
- /package/dist/{types/store → store}/contracts/message-secret.store.d.ts +0 -0
- /package/dist/{types/store → store}/contracts/message.store.d.ts +0 -0
- /package/dist/{types/store → store}/contracts/pre-key.store.d.ts +0 -0
- /package/dist/{types/store → store}/contracts/privacy-token.store.d.ts +0 -0
- /package/dist/{types/store → store}/contracts/retry.store.d.ts +0 -0
- /package/dist/{types/store → store}/contracts/sender-key.store.d.ts +0 -0
- /package/dist/{types/store → store}/contracts/session.store.d.ts +0 -0
- /package/dist/{types/store → store}/contracts/signal.store.d.ts +0 -0
- /package/dist/{types/store → store}/contracts/thread.store.d.ts +0 -0
- /package/dist/{types/store → store}/createStore.d.ts +0 -0
- /package/dist/{types/store → store}/index.d.ts +0 -0
- /package/dist/{types/store → store}/locks/appstate.lock.d.ts +0 -0
- /package/dist/{types/store → store}/locks/auth.lock.d.ts +0 -0
- /package/dist/{types/store → store}/locks/contact.lock.d.ts +0 -0
- /package/dist/{types/store → store}/locks/device-list.lock.d.ts +0 -0
- /package/dist/{types/store → store}/locks/group-metadata.lock.d.ts +0 -0
- /package/dist/{types/store → store}/locks/identity.lock.d.ts +0 -0
- /package/dist/{types/store → store}/locks/message-secret.lock.d.ts +0 -0
- /package/dist/{types/store → store}/locks/message.lock.d.ts +0 -0
- /package/dist/{types/store → store}/locks/pre-key.lock.d.ts +0 -0
- /package/dist/{types/store → store}/locks/privacy-token.lock.d.ts +0 -0
- /package/dist/{types/store → store}/locks/retry.lock.d.ts +0 -0
- /package/dist/{types/store → store}/locks/sender-key.lock.d.ts +0 -0
- /package/dist/{types/store → store}/locks/session.lock.d.ts +0 -0
- /package/dist/{types/store → store}/locks/signal.lock.d.ts +0 -0
- /package/dist/{types/store → store}/locks/thread.lock.d.ts +0 -0
- /package/dist/{types/store → store}/memory/appstate.store.d.ts +0 -0
- /package/dist/{types/store → store}/memory/auth.store.d.ts +0 -0
- /package/dist/{types/store → store}/memory/contact.store.d.ts +0 -0
- /package/dist/{types/store → store}/memory/device-list.store.d.ts +0 -0
- /package/dist/{types/store → store}/memory/group-metadata.store.d.ts +0 -0
- /package/dist/{types/store → store}/memory/identity.store.d.ts +0 -0
- /package/dist/{types/store → store}/memory/message-secret.store.d.ts +0 -0
- /package/dist/{types/store → store}/memory/message.store.d.ts +0 -0
- /package/dist/{types/store → store}/memory/pre-key.store.d.ts +0 -0
- /package/dist/{types/store → store}/memory/privacy-token.store.d.ts +0 -0
- /package/dist/{types/store → store}/memory/retry.store.d.ts +0 -0
- /package/dist/{types/store → store}/memory/sender-key.store.d.ts +0 -0
- /package/dist/{types/store → store}/memory/session.store.d.ts +0 -0
- /package/dist/{types/store → store}/memory/signal.store.d.ts +0 -0
- /package/dist/{types/store → store}/memory/thread.store.d.ts +0 -0
- /package/dist/{types/store → store}/noop.store.d.ts +0 -0
- /package/dist/{types/store → store}/types.d.ts +0 -0
- /package/dist/{types/transport → transport}/WaComms.d.ts +0 -0
- /package/dist/{types/transport → transport}/WaWebSocket.d.ts +0 -0
- /package/dist/{types/transport → transport}/binary/constants.d.ts +0 -0
- /package/dist/{types/transport → transport}/binary/decoder.d.ts +0 -0
- /package/dist/{types/transport → transport}/binary/encoder.d.ts +0 -0
- /package/dist/{types/transport → transport}/binary/index.d.ts +0 -0
- /package/dist/{types/transport → transport}/binary/tokens.d.ts +0 -0
- /package/dist/{types/transport → transport}/index.d.ts +0 -0
- /package/dist/{types/transport → transport}/keepalive/WaKeepAlive.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/WaMobileTcpSocket.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/WaNodeOrchestrator.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/WaNodeTransport.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/abprops.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/account-sync.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/bot.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/business.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/chatstate.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/community.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/device.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/email.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/global.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/group.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/media.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/message.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/newsletter.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/offline.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/pairing.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/passive.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/prekeys.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/presence.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/privacy-token.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/privacy.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/profile.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/retry.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/tos.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/builders/usync.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/helpers.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/mex/argo-decoder.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/query.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/usync.d.ts +0 -0
- /package/dist/{types/transport → transport}/node/xml.d.ts +0 -0
- /package/dist/{types/transport → transport}/noise/WaClientPayload.d.ts +0 -0
- /package/dist/{types/transport → transport}/noise/WaFrameCodec.d.ts +0 -0
- /package/dist/{types/transport → transport}/noise/WaNoiseCert.d.ts +0 -0
- /package/dist/{types/transport → transport}/noise/WaNoiseHandshake.d.ts +0 -0
- /package/dist/{types/transport → transport}/noise/WaNoiseSession.d.ts +0 -0
- /package/dist/{types/transport → transport}/noise/WaNoiseSocket.d.ts +0 -0
- /package/dist/{types/transport → transport}/noise/constants.d.ts +0 -0
- /package/dist/{types/transport → transport}/proxy.d.ts +0 -0
- /package/dist/{types/transport → transport}/stream/parse.d.ts +0 -0
- /package/dist/{types/transport → transport}/types.d.ts +0 -0
- /package/dist/{types/transport → transport}/wa-web-version-fetcher.d.ts +0 -0
- /package/dist/{types/util → util}/async.d.ts +0 -0
- /package/dist/{types/util → util}/bytes.d.ts +0 -0
- /package/dist/{types/util → util}/clock.d.ts +0 -0
- /package/dist/{types/util → util}/coercion.d.ts +0 -0
- /package/dist/{types/util → util}/collections.d.ts +0 -0
- /package/dist/{types/util → util}/index.d.ts +0 -0
- /package/dist/{types/util → util}/primitives.d.ts +0 -0
- /package/dist/{types/util → util}/runtime.d.ts +0 -0
- /package/dist/{types/version-spec.d.ts → version-spec.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ const constants_1 = require("../constants");
|
|
|
5
5
|
const hkdf_1 = require("../../crypto/core/hkdf");
|
|
6
6
|
const primitives_1 = require("../../crypto/core/primitives");
|
|
7
7
|
const random_1 = require("../../crypto/core/random");
|
|
8
|
-
const _proto_1 = require("../../proto
|
|
8
|
+
const _proto_1 = require("../../proto");
|
|
9
9
|
const constants_2 = require("../../protocol/constants");
|
|
10
10
|
const bytes_1 = require("../../util/bytes");
|
|
11
11
|
const collections_1 = require("../../util/collections");
|
|
@@ -4,7 +4,7 @@ exports.encodeAppStateFingerprint = encodeAppStateFingerprint;
|
|
|
4
4
|
exports.decodeAppStateFingerprint = decodeAppStateFingerprint;
|
|
5
5
|
exports.decodeAppStateSyncKeys = decodeAppStateSyncKeys;
|
|
6
6
|
exports.decodeAppStateCollections = decodeAppStateCollections;
|
|
7
|
-
const _proto_1 = require("../../proto
|
|
7
|
+
const _proto_1 = require("../../proto");
|
|
8
8
|
const coercion_1 = require("../../util/coercion");
|
|
9
9
|
const primitives_1 = require("../../util/primitives");
|
|
10
10
|
/** Serializes an app-state sync key fingerprint to its protobuf bytes, or `null` when absent. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AppStateCollectionName, AppStateCollectionState } from '../types';
|
|
2
|
-
import { type Proto } from '
|
|
2
|
+
import { type Proto } from '../../proto';
|
|
3
3
|
import type { BinaryNode } from '../../transport/types';
|
|
4
4
|
export interface CollectionResponsePayload {
|
|
5
5
|
readonly collection: AppStateCollectionName;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.parseSyncResponse = parseSyncResponse;
|
|
4
4
|
exports.parseCollectionState = parseCollectionState;
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
|
-
const _proto_1 = require("../../proto
|
|
6
|
+
const _proto_1 = require("../../proto");
|
|
7
7
|
const constants_1 = require("../../protocol/constants");
|
|
8
8
|
const helpers_1 = require("../../transport/node/helpers");
|
|
9
9
|
const primitives_1 = require("../../util/primitives");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WaAppStateMissingKeysEvent, WaAppStateSyncKey, WaAppStateSyncOptions, WaAppStateSyncResult } from '../types';
|
|
2
2
|
import type { Logger } from '../../infra/log/types';
|
|
3
|
-
import { type Proto } from '
|
|
3
|
+
import { type Proto } from '../../proto';
|
|
4
4
|
import type { WaAppStateStore } from '../../store/contracts/appstate.store';
|
|
5
5
|
import type { BinaryNode } from '../../transport/types';
|
|
6
6
|
import type { ServerClock } from '../../util/clock';
|
|
@@ -4,8 +4,8 @@ exports.WaAppStateSyncClient = void 0;
|
|
|
4
4
|
const constants_1 = require("../constants");
|
|
5
5
|
const WaAppStateCrypto_1 = require("../crypto/WaAppStateCrypto");
|
|
6
6
|
const response_parser_1 = require("../parsers/response-parser");
|
|
7
|
-
const _crypto_1 = require("../../crypto
|
|
8
|
-
const _proto_1 = require("../../proto
|
|
7
|
+
const _crypto_1 = require("../../crypto");
|
|
8
|
+
const _proto_1 = require("../../proto");
|
|
9
9
|
const constants_2 = require("../../protocol/constants");
|
|
10
10
|
const jid_1 = require("../../protocol/jid");
|
|
11
11
|
const query_1 = require("../../transport/node/query");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Proto } from '
|
|
1
|
+
import type { Proto } from '../proto';
|
|
2
2
|
import type { WA_APP_STATE_COLLECTION_STATES, WA_APP_STATE_COLLECTIONS } from '../protocol/constants';
|
|
3
3
|
export type AppStateCollectionName = (typeof WA_APP_STATE_COLLECTIONS)[keyof typeof WA_APP_STATE_COLLECTIONS];
|
|
4
4
|
export type AppStateCollectionState = (typeof WA_APP_STATE_COLLECTION_STATES)[keyof typeof WA_APP_STATE_COLLECTION_STATES];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AppStateCollectionName, WaAppStateSyncKey } from './types';
|
|
2
2
|
import type { WaMediaTransferClient } from '../media/transfer/WaMediaTransferClient';
|
|
3
|
-
import type { Proto } from '
|
|
3
|
+
import type { Proto } from '../proto';
|
|
4
4
|
/**
|
|
5
5
|
* Returns `value` typed as a known {@link AppStateCollectionName}, or `null`
|
|
6
6
|
* when the string is unrecognized.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { proto, type Proto } from '
|
|
1
|
+
import { proto, type Proto } from './proto';
|
|
2
2
|
import { WA_APPSTATE_SCHEMAS as RAW_WA_APPSTATE_SCHEMAS, type WaAppstateActionKey, type WaAppstateSchema, type WaAppstateValueEnumFields } from '../spec/appstate';
|
|
3
3
|
export { WA_APPSTATE_COLLECTIONS, WA_APPSTATE_SCHEMAS } from '../spec/appstate';
|
|
4
4
|
export type { WaAppstateActionKey, WaAppstateCollection, WaAppstateIndexArgs, WaAppstateIndexPart, WaAppstateIndexValueOf, WaAppstateSchema, WaAppstateScope, WaAppstateValueEnumFields } from '../spec/appstate';
|
package/dist/appstate-spec.js
CHANGED
|
@@ -6,7 +6,7 @@ exports.resolveEnumObject = resolveEnumObject;
|
|
|
6
6
|
exports.encodeEnumValue = encodeEnumValue;
|
|
7
7
|
exports.decodeEnumValue = decodeEnumValue;
|
|
8
8
|
exports.decodeIndexArgsFromSchema = decodeIndexArgsFromSchema;
|
|
9
|
-
const _proto_1 = require("./proto
|
|
9
|
+
const _proto_1 = require("./proto");
|
|
10
10
|
const appstate_1 = require("../spec/appstate");
|
|
11
11
|
var appstate_2 = require("../spec/appstate");
|
|
12
12
|
Object.defineProperty(exports, "WA_APPSTATE_COLLECTIONS", { enumerable: true, get: function () { return appstate_2.WA_APPSTATE_COLLECTIONS; } });
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.loadOrCreateCredentials = loadOrCreateCredentials;
|
|
4
4
|
exports.persistCredentials = persistCredentials;
|
|
5
5
|
exports.buildCommsConfig = buildCommsConfig;
|
|
6
|
-
const _crypto_1 = require("../crypto
|
|
6
|
+
const _crypto_1 = require("../crypto");
|
|
7
7
|
const keys_1 = require("../crypto/core/keys");
|
|
8
8
|
const X25519_1 = require("../crypto/curves/X25519");
|
|
9
9
|
const jid_1 = require("../protocol/jid");
|
|
10
|
-
const _signal_1 = require("../signal
|
|
10
|
+
const _signal_1 = require("../signal");
|
|
11
11
|
const WaMobileTcpSocket_1 = require("../transport/node/WaMobileTcpSocket");
|
|
12
12
|
const WaMobileClientPayload_1 = require("../transport/noise/WaMobileClientPayload");
|
|
13
13
|
const proxy_1 = require("../transport/proxy");
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WaPairingFlow = void 0;
|
|
4
4
|
const pairing_code_crypto_1 = require("../pairing/pairing-code-crypto");
|
|
5
|
-
const _crypto_1 = require("../../crypto
|
|
6
|
-
const _proto_1 = require("../../proto
|
|
5
|
+
const _crypto_1 = require("../../crypto");
|
|
6
|
+
const _proto_1 = require("../../proto");
|
|
7
7
|
const browser_1 = require("../../protocol/browser");
|
|
8
8
|
const constants_1 = require("../../protocol/constants");
|
|
9
9
|
const jid_1 = require("../../protocol/jid");
|
|
@@ -4,7 +4,7 @@ exports.PBKDF2_ITERATIONS = void 0;
|
|
|
4
4
|
exports.normalizeCustomPairingCode = normalizeCustomPairingCode;
|
|
5
5
|
exports.createCompanionHello = createCompanionHello;
|
|
6
6
|
exports.completeCompanionFinish = completeCompanionFinish;
|
|
7
|
-
const _crypto_1 = require("../../crypto
|
|
7
|
+
const _crypto_1 = require("../../crypto");
|
|
8
8
|
const X25519_1 = require("../../crypto/curves/X25519");
|
|
9
9
|
const constants_1 = require("../../protocol/constants");
|
|
10
10
|
const bytes_1 = require("../../util/bytes");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SignalKeyPair } from '../crypto/curves/types';
|
|
2
|
-
import type { Proto } from '
|
|
2
|
+
import type { Proto } from '../proto';
|
|
3
3
|
import type { RegistrationInfo, SignedPreKeyRecord } from '../signal/types';
|
|
4
4
|
import type { WaMobileTransportDeviceInfo } from '../transport/noise/WaMobileClientPayload';
|
|
5
5
|
import type { WaCommsConfig, WaProxyTransport } from '../transport/types';
|
package/dist/client/WaClient.js
CHANGED
|
@@ -8,7 +8,7 @@ const mailbox_1 = require("./persistence/mailbox");
|
|
|
8
8
|
const WriteBehindPersistence_1 = require("./persistence/WriteBehindPersistence");
|
|
9
9
|
const WaClientFactory_1 = require("./WaClientFactory");
|
|
10
10
|
const ConsoleLogger_1 = require("../infra/log/ConsoleLogger");
|
|
11
|
-
const _proto_1 = require("../proto
|
|
11
|
+
const _proto_1 = require("../proto");
|
|
12
12
|
const constants_1 = require("../protocol/constants");
|
|
13
13
|
const jid_1 = require("../protocol/jid");
|
|
14
14
|
const stream_1 = require("../protocol/stream");
|
|
@@ -35,7 +35,7 @@ const SYNC_RELATED_PROTOCOL_TYPES = new Set([
|
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
37
37
|
* ```ts
|
|
38
|
-
* import { createPinoLogger, createStore, WaClient } from '
|
|
38
|
+
* import { createPinoLogger, createStore, WaClient } from '..'
|
|
39
39
|
* import { createSqliteStore } from '@zapo-js/store-sqlite'
|
|
40
40
|
*
|
|
41
41
|
* const store = createStore({
|
|
@@ -153,7 +153,8 @@ function createIncomingNodeRuntime(input) {
|
|
|
153
153
|
emitRegistrationCode: (event) => emitEvent('mobile_registration_code', event),
|
|
154
154
|
emitAccountTakeoverNotice: (event) => emitEvent('mobile_account_takeover_notice', event),
|
|
155
155
|
emitGroupEvent: (event) => {
|
|
156
|
-
|
|
156
|
+
// Register the cache mutation before emitting so a handler that
|
|
157
|
+
// sends synchronously sees the fresh participants, not the stale ones.
|
|
157
158
|
void messageDispatch.mutateGroupMetadataCacheFromGroupEvent(event).catch((error) => {
|
|
158
159
|
logger.warn('failed to mutate group metadata cache from group event', {
|
|
159
160
|
action: event.action,
|
|
@@ -162,6 +163,7 @@ function createIncomingNodeRuntime(input) {
|
|
|
162
163
|
message: (0, primitives_1.toError)(error).message
|
|
163
164
|
});
|
|
164
165
|
});
|
|
166
|
+
emitEvent('group', event);
|
|
165
167
|
},
|
|
166
168
|
emitBusinessEvent: (event) => emitEvent('business', event),
|
|
167
169
|
emitPictureEvent: (event) => emitEvent('picture', event),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { WaAppStateSyncClient } from '../../appstate/sync/WaAppStateSyncClient';
|
|
2
2
|
import type { WaAppStateSyncOptions, WaAppStateSyncResult } from '../../appstate/types';
|
|
3
|
-
import { type DataForKey, type WaAppstateActionKey, type WaAppstateIndexArgs } from '
|
|
3
|
+
import { type DataForKey, type WaAppstateActionKey, type WaAppstateIndexArgs } from '../../appstate-spec';
|
|
4
4
|
import type { WaAppStateMessageKey, WaAppStateMutationEvent, WaClearChatOptions, WaDeleteChatOptions, WaDeleteMessageForMeOptions } from '../types';
|
|
5
5
|
import type { Logger } from '../../infra/log/types';
|
|
6
6
|
import type { WaMediaTransferClient } from '../../media/transfer/WaMediaTransferClient';
|
|
7
|
-
import { proto, type Proto } from '
|
|
7
|
+
import { proto, type Proto } from '../../proto';
|
|
8
8
|
import type { WaStoredContactRecord } from '../../store/contracts/contact.store';
|
|
9
9
|
import type { WaMessageStore } from '../../store/contracts/message.store';
|
|
10
10
|
import type { ServerClock } from '../../util/clock';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WaAppStateMutationCoordinator = void 0;
|
|
4
4
|
const utils_1 = require("../../appstate/utils");
|
|
5
|
-
const _appstate_spec_1 = require("../../appstate-spec
|
|
5
|
+
const _appstate_spec_1 = require("../../appstate-spec");
|
|
6
6
|
const appstate_mutation_1 = require("../events/appstate-mutation");
|
|
7
|
-
const _proto_1 = require("../../proto
|
|
7
|
+
const _proto_1 = require("../../proto");
|
|
8
8
|
const constants_1 = require("../../protocol/constants");
|
|
9
9
|
const jid_1 = require("../../protocol/jid");
|
|
10
10
|
const coercion_1 = require("../../util/coercion");
|
|
@@ -2,7 +2,7 @@ import type { WaAuthCredentials } from '../../auth/types';
|
|
|
2
2
|
import type { WaIncomingBotChunkEvent, WaIncomingMessageEvent, WaSendMessageOptions } from '../types';
|
|
3
3
|
import type { Logger } from '../../infra/log/types';
|
|
4
4
|
import type { WaMessageBuildResult, WaMessagePublishResult, WaSendMessageContent } from '../../message/types';
|
|
5
|
-
import { proto } from '
|
|
5
|
+
import { proto } from '../../proto';
|
|
6
6
|
import type { WaMessageSecretStore } from '../../store/contracts/message-secret.store';
|
|
7
7
|
import type { WaMessageStore } from '../../store/contracts/message.store';
|
|
8
8
|
import type { BinaryNode } from '../../transport/types';
|
|
@@ -6,7 +6,7 @@ const context_info_1 = require("../../message/context-info");
|
|
|
6
6
|
const addon_crypto_1 = require("../../message/crypto/addon-crypto");
|
|
7
7
|
const content_1 = require("../../message/encode/content");
|
|
8
8
|
const bot_1 = require("../../message/kinds/bot");
|
|
9
|
-
const _proto_1 = require("../../proto
|
|
9
|
+
const _proto_1 = require("../../proto");
|
|
10
10
|
const bot_2 = require("../../protocol/bot");
|
|
11
11
|
const constants_1 = require("../../protocol/constants");
|
|
12
12
|
const jid_1 = require("../../protocol/jid");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { WaAppStateMutationCoordinator, WaSetBroadcastListInput } from '../coordinators/WaAppStateMutationCoordinator';
|
|
2
2
|
import type { WaSendMessageOptions } from '../types';
|
|
3
3
|
import type { WaMessageBuildResult, WaMessagePublishResult, WaSendMessageContent } from '../../message/types';
|
|
4
|
-
import type { Proto } from '
|
|
4
|
+
import type { Proto } from '../../proto';
|
|
5
5
|
export interface WaBroadcastListCoordinatorOptions {
|
|
6
6
|
readonly appStateMutations: WaAppStateMutationCoordinator;
|
|
7
7
|
readonly buildMessageContent: (content: WaSendMessageContent) => Promise<WaMessageBuildResult>;
|
|
@@ -6,7 +6,7 @@ import type { Logger } from '../../infra/log/types';
|
|
|
6
6
|
import type { WaMediaTransferClient } from '../../media/transfer/WaMediaTransferClient';
|
|
7
7
|
import type { PeerDataOperationRequester } from '../../message/primitives/peer-data-operation';
|
|
8
8
|
import type { WaMessagePublishResult, WaSendMessageContent, WaSendReceiptEventOptions, WaSendReceiptOptions } from '../../message/types';
|
|
9
|
-
import { type Proto } from '
|
|
9
|
+
import { type Proto } from '../../proto';
|
|
10
10
|
import type { WaMessageSecretStore } from '../../store/contracts/message-secret.store';
|
|
11
11
|
import type { WaMessageStore } from '../../store/contracts/message.store';
|
|
12
12
|
import { type WaMexQuerySocket } from '../../transport/node/mex/client';
|
|
@@ -4,10 +4,10 @@ exports.WaMessageCoordinator = void 0;
|
|
|
4
4
|
const node_fs_1 = require("node:fs");
|
|
5
5
|
const promises_1 = require("node:stream/promises");
|
|
6
6
|
const receipt_1 = require("../events/receipt");
|
|
7
|
+
const media_1 = require("../media");
|
|
7
8
|
const addon_crypto_1 = require("../../message/crypto/addon-crypto");
|
|
8
9
|
const content_1 = require("../../message/encode/content");
|
|
9
|
-
const
|
|
10
|
-
const _proto_1 = require("../../proto.js");
|
|
10
|
+
const _proto_1 = require("../../proto");
|
|
11
11
|
const jid_1 = require("../../protocol/jid");
|
|
12
12
|
const client_1 = require("../../transport/node/mex/client");
|
|
13
13
|
const bytes_1 = require("../../util/bytes");
|
|
@@ -235,23 +235,7 @@ class WaMessageCoordinator {
|
|
|
235
235
|
* for one-shot verified downloads.
|
|
236
236
|
*/
|
|
237
237
|
async download(source, options = {}) {
|
|
238
|
-
|
|
239
|
-
const payload = (0, media_payload_1.resolveMediaPayload)(message);
|
|
240
|
-
if (!payload) {
|
|
241
|
-
throw new Error('message has no downloadable media');
|
|
242
|
-
}
|
|
243
|
-
const { plaintext, metadata } = await this.mediaTransfer.downloadAndDecryptStream({
|
|
244
|
-
directPath: payload.directPath,
|
|
245
|
-
mediaType: payload.mediaType,
|
|
246
|
-
mediaKey: payload.mediaKey,
|
|
247
|
-
fileSha256: payload.fileSha256,
|
|
248
|
-
fileEncSha256: payload.fileEncSha256,
|
|
249
|
-
timeoutMs: options.timeoutMs,
|
|
250
|
-
signal: options.signal,
|
|
251
|
-
maxBytes: options.maxBytes
|
|
252
|
-
});
|
|
253
|
-
metadata.catch(() => undefined);
|
|
254
|
-
return plaintext;
|
|
238
|
+
return (0, media_1.downloadMediaMessage)(source, { ...options, transfer: this.mediaTransfer });
|
|
255
239
|
}
|
|
256
240
|
/**
|
|
257
241
|
* Convenience wrapper around {@link download} that streams the decrypted
|
|
@@ -9,7 +9,7 @@ import { type WaSendContextInfo } from '../../message/context-info';
|
|
|
9
9
|
import { type IcdcMeta } from '../../message/crypto/icdc';
|
|
10
10
|
import type { WaEncryptedMessageInput, WaMessageBuildResult, WaMessagePublishOptions, WaMessagePublishResult, WaSendMessageContent, WaSendReceiptInput } from '../../message/types';
|
|
11
11
|
import type { WaMessageClient } from '../../message/WaMessageClient';
|
|
12
|
-
import { type Proto } from '
|
|
12
|
+
import { type Proto } from '../../proto';
|
|
13
13
|
import { type WaStatusDistributionSetting } from '../../protocol/constants';
|
|
14
14
|
import type { OutboundRetryTracker } from '../../retry/tracker';
|
|
15
15
|
import type { SignalDeviceSyncApi } from '../../signal/api/SignalDeviceSyncApi';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WaMessageDispatchCoordinator = void 0;
|
|
4
|
-
const _crypto_1 = require("../../crypto
|
|
4
|
+
const _crypto_1 = require("../../crypto");
|
|
5
5
|
const primitives_1 = require("../../crypto/core/primitives");
|
|
6
6
|
const PromiseDedup_1 = require("../../infra/perf/PromiseDedup");
|
|
7
|
-
const _message_1 = require("../../message
|
|
7
|
+
const _message_1 = require("../../message");
|
|
8
8
|
const context_info_1 = require("../../message/context-info");
|
|
9
9
|
const icdc_1 = require("../../message/crypto/icdc");
|
|
10
10
|
const phash_1 = require("../../message/crypto/phash");
|
|
@@ -13,7 +13,7 @@ const content_1 = require("../../message/encode/content");
|
|
|
13
13
|
const device_sent_1 = require("../../message/encode/device-sent");
|
|
14
14
|
const padding_1 = require("../../message/encode/padding");
|
|
15
15
|
const bot_1 = require("../../message/kinds/bot");
|
|
16
|
-
const _proto_1 = require("../../proto
|
|
16
|
+
const _proto_1 = require("../../proto");
|
|
17
17
|
const constants_1 = require("../../protocol/constants");
|
|
18
18
|
const jid_1 = require("../../protocol/jid");
|
|
19
19
|
const binary_1 = require("../../transport/binary");
|
|
@@ -164,7 +164,8 @@ class WaMessageDispatchCoordinator {
|
|
|
164
164
|
quote: options.quote,
|
|
165
165
|
forward: options.forward,
|
|
166
166
|
mentions: options.mentions,
|
|
167
|
-
meLid: this.deps.getCurrentCredentials()?.meLid
|
|
167
|
+
meLid: this.deps.getCurrentCredentials()?.meLid,
|
|
168
|
+
targetJid: recipientJid
|
|
168
169
|
});
|
|
169
170
|
const withCtx = ctx ? (0, context_info_1.applyContextInfo)(built.message, ctx) : built.message;
|
|
170
171
|
const withViewOnce = options.viewOnce ? (0, content_1.wrapAsViewOnce)(withCtx) : withCtx;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WaRetryCoordinator = void 0;
|
|
4
4
|
const incoming_1 = require("../../message/primitives/incoming");
|
|
5
|
-
const _proto_1 = require("../../proto
|
|
5
|
+
const _proto_1 = require("../../proto");
|
|
6
6
|
const constants_1 = require("../../protocol/constants");
|
|
7
7
|
const jid_1 = require("../../protocol/jid");
|
|
8
8
|
const constants_2 = require("../../retry/constants");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { WaAppStateMutationCoordinator, WaSetStatusPrivacyInput } from '../coordinators/WaAppStateMutationCoordinator';
|
|
2
2
|
import type { WaSendMessageOptions } from '../types';
|
|
3
3
|
import type { WaMessageBuildResult, WaMessagePublishResult, WaSendMessageContent } from '../../message/types';
|
|
4
|
-
import { type Proto } from '
|
|
4
|
+
import { type Proto } from '../../proto';
|
|
5
5
|
import type { WaStatusDistributionSetting } from '../../protocol/status';
|
|
6
6
|
export interface WaStatusCoordinatorOptions {
|
|
7
7
|
readonly appStateMutations: WaAppStateMutationCoordinator;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createStatusCoordinator = createStatusCoordinator;
|
|
4
|
-
const _proto_1 = require("../../proto
|
|
4
|
+
const _proto_1 = require("../../proto");
|
|
5
5
|
const defaults_1 = require("../../protocol/defaults");
|
|
6
6
|
/** Builds a {@link WaStatusCoordinator} from its dependencies. */
|
|
7
7
|
function createStatusCoordinator(options) {
|
|
@@ -53,11 +53,10 @@ function createStreamControlHandler(options) {
|
|
|
53
53
|
const reason = constants_1.WA_DISCONNECT_REASONS.STREAM_ERROR_FORCE_LOGIN;
|
|
54
54
|
stopCommsImmediately();
|
|
55
55
|
await runStreamControlLifecycle(reason, async () => {
|
|
56
|
-
logger.warn('received forced login stream error;
|
|
56
|
+
logger.warn('received forced login stream error; reconnecting, keeping credentials', {
|
|
57
57
|
code
|
|
58
58
|
});
|
|
59
|
-
await disconnect(reason,
|
|
60
|
-
await clearStoredCredentials();
|
|
59
|
+
await disconnect(reason, false, code);
|
|
61
60
|
await restartBackendAfterStreamControl(reason);
|
|
62
61
|
});
|
|
63
62
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseAppStateMutationEvent = parseAppStateMutationEvent;
|
|
4
|
-
const _appstate_spec_1 = require("../../appstate-spec
|
|
4
|
+
const _appstate_spec_1 = require("../../appstate-spec");
|
|
5
5
|
function parseAppStateMutationEvent(mutation) {
|
|
6
6
|
const parts = parseIndexParts(mutation.index);
|
|
7
7
|
if (!parts || parts.length === 0) {
|
|
@@ -4,7 +4,7 @@ exports.parseVerifiedNameNode = parseVerifiedNameNode;
|
|
|
4
4
|
exports.parseBusinessProfileNode = parseBusinessProfileNode;
|
|
5
5
|
exports.parseBusinessNotificationEvents = parseBusinessNotificationEvents;
|
|
6
6
|
const incoming_1 = require("../events/incoming");
|
|
7
|
-
const _proto_1 = require("../../proto
|
|
7
|
+
const _proto_1 = require("../../proto");
|
|
8
8
|
const constants_1 = require("../../protocol/constants");
|
|
9
9
|
const nodes_1 = require("../../protocol/nodes");
|
|
10
10
|
const helpers_1 = require("../../transport/node/helpers");
|
|
@@ -18,6 +18,7 @@ const call_1 = require("../events/call");
|
|
|
18
18
|
const group_1 = require("../events/group");
|
|
19
19
|
const mex_notification_1 = require("../events/mex-notification");
|
|
20
20
|
const picture_1 = require("../events/picture");
|
|
21
|
+
const receipt_1 = require("../events/receipt");
|
|
21
22
|
const registration_1 = require("../events/registration");
|
|
22
23
|
const constants_1 = require("../../protocol/constants");
|
|
23
24
|
const jid_1 = require("../../protocol/jid");
|
|
@@ -188,7 +189,8 @@ function createIncomingReceiptHandler(options) {
|
|
|
188
189
|
status: mapped.status,
|
|
189
190
|
fromSelfDevice: mapped.fromSelfDevice,
|
|
190
191
|
participantJid: node.attrs.participant,
|
|
191
|
-
recipientJid: node.attrs.recipient
|
|
192
|
+
recipientJid: node.attrs.recipient,
|
|
193
|
+
messageIds: (0, receipt_1.extractReceiptIds)(node)
|
|
192
194
|
});
|
|
193
195
|
}
|
|
194
196
|
else if (node.attrs.type && !INTERNAL_ONLY_RECEIPT_TYPES.has(node.attrs.type)) {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { BinaryNode } from '../../transport/types';
|
|
2
|
+
interface ReceiptTarget {
|
|
3
|
+
readonly chatJid: string;
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly senderJid?: string;
|
|
6
|
+
readonly isGroupChat?: boolean;
|
|
7
|
+
readonly isBroadcastChat?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface AggregatedReceiptGroup {
|
|
10
|
+
readonly jid: string;
|
|
11
|
+
readonly ids: readonly string[];
|
|
12
|
+
readonly participant?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function aggregateReceiptTargets(targets: readonly ReceiptTarget[]): readonly AggregatedReceiptGroup[];
|
|
15
|
+
/**
|
|
16
|
+
* Resolves every message id a `<receipt>` acknowledges, mirroring WhatsApp
|
|
17
|
+
* Web's `externalIds`. A batch receipt carries the extra ids in a
|
|
18
|
+
* `<list><item id=.../>` block; the top-level `attrs.id` is just one of them.
|
|
19
|
+
*
|
|
20
|
+
* - `<list><item>` ids come first. For `type="view"` receipts the item key is
|
|
21
|
+
* `server_id` (not `id`), and the top-level id is NOT appended.
|
|
22
|
+
* - Otherwise the top-level `attrs.id` is appended last.
|
|
23
|
+
* - Aggregated receipts (carrying a `<participants>` child) are out of scope:
|
|
24
|
+
* their ids live in `<user>` children, so this falls back to the single
|
|
25
|
+
* top-level id for them.
|
|
26
|
+
*
|
|
27
|
+
* No dedup: matches wa-web, which pushes the top id without checking the list.
|
|
28
|
+
*/
|
|
29
|
+
export declare function extractReceiptIds(node: BinaryNode): readonly string[];
|
|
30
|
+
export {};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.aggregateReceiptTargets = aggregateReceiptTargets;
|
|
4
|
+
exports.extractReceiptIds = extractReceiptIds;
|
|
5
|
+
const constants_1 = require("../../protocol/constants");
|
|
4
6
|
const jid_1 = require("../../protocol/jid");
|
|
7
|
+
const helpers_1 = require("../../transport/node/helpers");
|
|
5
8
|
function needsParticipant(target) {
|
|
6
9
|
if (target.isGroupChat !== undefined || target.isBroadcastChat !== undefined) {
|
|
7
10
|
return target.isGroupChat === true || target.isBroadcastChat === true;
|
|
@@ -24,3 +27,32 @@ function aggregateReceiptTargets(targets) {
|
|
|
24
27
|
}
|
|
25
28
|
return [...groups.values()];
|
|
26
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Resolves every message id a `<receipt>` acknowledges, mirroring WhatsApp
|
|
32
|
+
* Web's `externalIds`. A batch receipt carries the extra ids in a
|
|
33
|
+
* `<list><item id=.../>` block; the top-level `attrs.id` is just one of them.
|
|
34
|
+
*
|
|
35
|
+
* - `<list><item>` ids come first. For `type="view"` receipts the item key is
|
|
36
|
+
* `server_id` (not `id`), and the top-level id is NOT appended.
|
|
37
|
+
* - Otherwise the top-level `attrs.id` is appended last.
|
|
38
|
+
* - Aggregated receipts (carrying a `<participants>` child) are out of scope:
|
|
39
|
+
* their ids live in `<user>` children, so this falls back to the single
|
|
40
|
+
* top-level id for them.
|
|
41
|
+
*
|
|
42
|
+
* No dedup: matches wa-web, which pushes the top id without checking the list.
|
|
43
|
+
*/
|
|
44
|
+
function extractReceiptIds(node) {
|
|
45
|
+
const topId = node.attrs.id;
|
|
46
|
+
if ((0, helpers_1.hasNodeChild)(node, 'participants')) {
|
|
47
|
+
return topId ? [topId] : [];
|
|
48
|
+
}
|
|
49
|
+
const isView = node.attrs.type === constants_1.WA_MESSAGE_TYPES.RECEIPT_TYPE_VIEW;
|
|
50
|
+
const list = (0, helpers_1.findNodeChild)(node, 'list');
|
|
51
|
+
const ids = list
|
|
52
|
+
? [...(0, helpers_1.getNodeChildrenNonEmptyAttrValuesByTag)(list, 'item', isView ? 'server_id' : 'id')]
|
|
53
|
+
: [];
|
|
54
|
+
if (!isView && topId) {
|
|
55
|
+
ids.push(topId);
|
|
56
|
+
}
|
|
57
|
+
return ids;
|
|
58
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type Readable } from 'node:stream';
|
|
2
|
-
import type { WaMediaOptions } from './types';
|
|
2
|
+
import type { WaDownloadMediaOptions, WaIncomingMessageEvent, WaMediaOptions } from './types';
|
|
3
3
|
import type { Logger } from '../infra/log/types';
|
|
4
|
-
import
|
|
4
|
+
import { WaMediaTransferClient } from '../media/transfer/WaMediaTransferClient';
|
|
5
5
|
import type { WaMediaConn } from '../media/types';
|
|
6
6
|
import type { WaSendMediaMessage } from '../message/types';
|
|
7
|
+
import type { Proto } from '../proto';
|
|
8
|
+
import type { WaProxyTransport } from '../transport/types';
|
|
7
9
|
export interface ProcessedMediaFields {
|
|
8
10
|
readonly jpegThumbnail?: Uint8Array;
|
|
9
11
|
readonly pngThumbnail?: Uint8Array;
|
|
@@ -62,4 +64,59 @@ export declare function shouldNormalizeVoiceNote(media: WaMediaOptions | undefin
|
|
|
62
64
|
export declare function hasMediaProcessingTasks(media: WaMediaOptions | undefined, content: WaSendMediaMessage): boolean;
|
|
63
65
|
export declare function getScopedMediaLogger(parent: Logger): Logger;
|
|
64
66
|
export declare function runMediaProcessor(media: WaMediaOptions | undefined, input: Uint8Array | string | undefined, content: WaSendMediaMessage, logger: Logger): Promise<ProcessedMediaFields>;
|
|
67
|
+
export interface WaDownloadMediaMessageOptions extends WaDownloadMediaOptions {
|
|
68
|
+
/**
|
|
69
|
+
* Reuse an existing transfer client instead of creating a fresh one. Lets
|
|
70
|
+
* the download inherit proxy agents, timeouts, and the MAC-verification
|
|
71
|
+
* toggle, and avoids spinning up a new HTTP client per call in a loop. A
|
|
72
|
+
* stateless {@link WaMediaTransferClient} is created when omitted - fine
|
|
73
|
+
* for one-off downloads.
|
|
74
|
+
*/
|
|
75
|
+
readonly transfer?: WaMediaTransferClient;
|
|
76
|
+
/**
|
|
77
|
+
* Proxy for the CDN download leg, mirroring `proxy.mediaDownload` on the
|
|
78
|
+
* client. The fetch runs over `node:http`/`node:https`, so only the Node
|
|
79
|
+
* `http.Agent` form is used; an undici dispatcher is ignored (same as the
|
|
80
|
+
* client treats `mediaDownload`). Takes precedence over the default agent
|
|
81
|
+
* of a `transfer` you pass.
|
|
82
|
+
*/
|
|
83
|
+
readonly proxy?: WaProxyTransport;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Streams and decrypts the media attached to a message without a connected
|
|
87
|
+
* `WaClient`. Resolves the encrypted payload (directPath, mediaKey, file
|
|
88
|
+
* hashes) from `source`, fetches the ciphertext from the WhatsApp media CDN,
|
|
89
|
+
* and decrypts it on the fly.
|
|
90
|
+
*
|
|
91
|
+
* The media keys come from the (already decrypted) message itself, so this is
|
|
92
|
+
* for re-downloading media you have persisted - not for fetching media you
|
|
93
|
+
* never received. The CDN download needs no session or auth token; only the
|
|
94
|
+
* upload path does.
|
|
95
|
+
*
|
|
96
|
+
* **The caller owns the returned stream** - pipe it somewhere or call
|
|
97
|
+
* `.destroy()` to release the socket; an unconsumed stream leaks the
|
|
98
|
+
* connection. MAC + SHA-256 verification runs as bytes are consumed, so
|
|
99
|
+
* aborting mid-read leaves you with unverified bytes. Pass `options.signal`
|
|
100
|
+
* to cancel cleanly.
|
|
101
|
+
*
|
|
102
|
+
* @throws when `source` carries no downloadable media.
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* import { downloadMediaMessage } from '..'
|
|
106
|
+
* import { createWriteStream } from 'node:fs'
|
|
107
|
+
*
|
|
108
|
+
* const stream = await downloadMediaMessage(event)
|
|
109
|
+
* stream.pipe(createWriteStream('photo.jpg'))
|
|
110
|
+
* ```
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* // Route the CDN download through an http.Agent-style proxy
|
|
114
|
+
* import { HttpsProxyAgent } from 'https-proxy-agent'
|
|
115
|
+
*
|
|
116
|
+
* const stream = await downloadMediaMessage(event, {
|
|
117
|
+
* proxy: new HttpsProxyAgent('http://127.0.0.1:8080')
|
|
118
|
+
* })
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
export declare function downloadMediaMessage(source: Proto.IMessage | WaIncomingMessageEvent, options?: WaDownloadMediaMessageOptions): Promise<Readable>;
|
|
65
122
|
export {};
|