zapo-js 0.1.2 → 0.2.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 +12 -4
- package/dist/appstate/WaAppStateCrypto.js +1 -1
- package/dist/appstate/WaAppStateSyncClient.js +138 -93
- package/dist/appstate/{store/sqlite.js → encoding.js} +13 -8
- package/dist/appstate/index.js +8 -6
- package/dist/appstate/utils.js +0 -5
- package/dist/auth/WaAuthClient.js +36 -47
- package/dist/auth/flow/WaAuthCredentialsFlow.js +7 -7
- package/dist/auth/index.js +1 -6
- package/dist/auth/pairing/WaPairingCodeCrypto.js +6 -4
- package/dist/auth/pairing/WaPairingFlow.js +13 -3
- package/dist/client/WaClient.js +225 -101
- package/dist/client/WaClientFactory.js +294 -44
- package/dist/client/connection/WaConnectionManager.js +19 -10
- package/dist/client/coordinators/WaBusinessCoordinator.js +241 -0
- package/dist/client/coordinators/WaGroupCoordinator.js +11 -7
- package/dist/client/coordinators/WaIncomingNodeCoordinator.js +1 -0
- package/dist/client/coordinators/WaMessageDispatchCoordinator.js +292 -99
- package/dist/client/coordinators/WaPassiveTasksCoordinator.js +74 -31
- package/dist/client/coordinators/WaPrivacyCoordinator.js +134 -0
- package/dist/client/coordinators/WaProfileCoordinator.js +212 -0
- package/dist/client/coordinators/WaRetryCoordinator.js +179 -27
- package/dist/client/coordinators/WaStreamControlCoordinator.js +18 -11
- package/dist/client/coordinators/WaTrustedContactTokenCoordinator.js +166 -0
- package/dist/client/dirty.js +40 -20
- package/dist/client/events/devices.js +72 -0
- package/dist/client/events/group.js +3 -11
- package/dist/client/events/identity.js +22 -0
- package/dist/client/events/privacy-token.js +39 -0
- package/dist/client/history-sync.js +50 -9
- package/dist/client/incoming.js +37 -7
- package/dist/client/mailbox.js +24 -23
- package/dist/client/messages.js +107 -31
- package/dist/client/messaging/fanout.js +21 -11
- package/dist/client/messaging/participants.js +6 -4
- package/dist/client/persistence/WriteBehindPersistence.js +129 -0
- package/dist/client/tokens/cs-token.js +50 -0
- package/dist/client/tokens/tc-token.js +25 -0
- package/dist/crypto/core/index.js +2 -2
- package/dist/crypto/core/keys.js +4 -4
- package/dist/crypto/core/nonce.js +2 -0
- package/dist/crypto/core/primitives.js +0 -8
- package/dist/crypto/core/random.js +22 -0
- package/dist/crypto/curves/X25519.js +25 -6
- package/dist/crypto/index.js +3 -0
- package/dist/crypto/math/constants.js +13 -36
- package/dist/crypto/math/edwards.js +171 -44
- package/dist/crypto/math/fe.js +706 -0
- package/dist/crypto/math/mod.js +10 -3
- package/dist/esm/appstate/WaAppStateCrypto.js +1 -1
- package/dist/esm/appstate/WaAppStateSyncClient.js +138 -93
- package/dist/esm/appstate/{store/sqlite.js → encoding.js} +13 -8
- package/dist/esm/appstate/index.js +2 -2
- package/dist/esm/appstate/utils.js +2 -5
- package/dist/esm/auth/WaAuthClient.js +36 -47
- package/dist/esm/auth/flow/WaAuthCredentialsFlow.js +7 -7
- package/dist/esm/auth/index.js +0 -2
- package/dist/esm/auth/pairing/WaPairingCodeCrypto.js +6 -4
- package/dist/esm/auth/pairing/WaPairingFlow.js +14 -4
- package/dist/esm/client/WaClient.js +225 -101
- package/dist/esm/client/WaClientFactory.js +295 -45
- package/dist/esm/client/connection/WaConnectionManager.js +19 -10
- package/dist/esm/client/coordinators/WaBusinessCoordinator.js +238 -0
- package/dist/esm/client/coordinators/WaGroupCoordinator.js +11 -7
- package/dist/esm/client/coordinators/WaIncomingNodeCoordinator.js +1 -0
- package/dist/esm/client/coordinators/WaMessageDispatchCoordinator.js +295 -102
- package/dist/esm/client/coordinators/WaPassiveTasksCoordinator.js +74 -31
- package/dist/esm/client/coordinators/WaPrivacyCoordinator.js +131 -0
- package/dist/esm/client/coordinators/WaProfileCoordinator.js +209 -0
- package/dist/esm/client/coordinators/WaRetryCoordinator.js +181 -29
- package/dist/esm/client/coordinators/WaStreamControlCoordinator.js +19 -12
- package/dist/esm/client/coordinators/WaTrustedContactTokenCoordinator.js +162 -0
- package/dist/esm/client/dirty.js +40 -20
- package/dist/esm/client/events/devices.js +68 -0
- package/dist/esm/client/events/group.js +3 -11
- package/dist/esm/client/events/identity.js +19 -0
- package/dist/esm/client/events/privacy-token.js +36 -0
- package/dist/esm/client/history-sync.js +50 -9
- package/dist/esm/client/incoming.js +38 -8
- package/dist/esm/client/mailbox.js +24 -23
- package/dist/esm/client/messages.js +108 -32
- package/dist/esm/client/messaging/fanout.js +22 -12
- package/dist/esm/client/messaging/participants.js +6 -4
- package/dist/esm/client/persistence/WriteBehindPersistence.js +125 -0
- package/dist/esm/client/tokens/cs-token.js +46 -0
- package/dist/esm/client/tokens/tc-token.js +18 -0
- package/dist/esm/crypto/core/index.js +2 -2
- package/dist/esm/crypto/core/keys.js +1 -1
- package/dist/esm/crypto/core/nonce.js +2 -0
- package/dist/esm/crypto/core/primitives.js +0 -7
- package/dist/esm/crypto/core/random.js +22 -1
- package/dist/esm/crypto/curves/X25519.js +25 -6
- package/dist/esm/crypto/index.js +1 -0
- package/dist/esm/crypto/math/constants.js +12 -35
- package/dist/esm/crypto/math/edwards.js +174 -47
- package/dist/esm/crypto/math/fe.js +691 -0
- package/dist/esm/crypto/math/mod.js +10 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/infra/perf/BackgroundQueue.js +478 -0
- package/dist/esm/infra/perf/BoundedTaskQueue.js +3 -1
- package/dist/esm/infra/perf/PromiseDedup.js +20 -0
- package/dist/esm/infra/perf/SharedExclusiveGate.js +109 -0
- package/dist/esm/infra/perf/StoreLock.js +77 -0
- package/dist/esm/media/WaMediaCrypto.js +95 -13
- package/dist/esm/media/WaMediaTransferClient.js +39 -47
- package/dist/esm/media/constants.js +2 -1
- package/dist/esm/message/WaMessageClient.js +26 -19
- package/dist/esm/message/content.js +195 -9
- package/dist/esm/message/icdc.js +76 -0
- package/dist/esm/message/incoming.js +24 -12
- package/dist/esm/message/phash.js +3 -1
- package/dist/esm/message/reporting-token.js +14 -27
- package/dist/esm/protocol/appstate.js +9 -40
- package/dist/esm/protocol/browser.js +10 -18
- package/dist/esm/protocol/constants.js +5 -3
- package/dist/esm/protocol/defaults.js +6 -0
- package/dist/esm/protocol/index.js +1 -2
- package/dist/esm/protocol/jid.js +105 -36
- package/dist/esm/protocol/message.js +61 -1
- package/dist/esm/protocol/nodes.js +2 -0
- package/dist/esm/protocol/notification.js +3 -1
- package/dist/esm/protocol/privacy-token.js +17 -0
- package/dist/esm/protocol/privacy.js +55 -0
- package/dist/esm/protocol/stream.js +26 -1
- package/dist/esm/retry/codec.js +216 -0
- package/dist/esm/retry/constants.js +1 -1
- package/dist/esm/retry/index.js +2 -2
- package/dist/esm/retry/parse.js +50 -30
- package/dist/esm/retry/replay.js +11 -7
- package/dist/esm/retry/tracker.js +50 -12
- package/dist/esm/signal/api/SignalDeviceSyncApi.js +49 -32
- package/dist/esm/signal/api/SignalDigestSyncApi.js +13 -9
- package/dist/esm/signal/api/SignalIdentitySyncApi.js +26 -11
- package/dist/esm/signal/api/SignalMissingPreKeysSyncApi.js +18 -7
- package/dist/esm/signal/api/SignalRotateKeyApi.js +4 -2
- package/dist/esm/signal/api/SignalSessionSyncApi.js +16 -7
- package/dist/esm/signal/api/result-map.js +10 -0
- package/dist/esm/signal/constants.js +0 -4
- package/dist/esm/signal/crypto/WaAdvSignature.js +12 -6
- package/dist/esm/signal/{store/sqlite.js → encoding.js} +78 -24
- package/dist/esm/signal/group/SenderKeyCodec.js +3 -2
- package/dist/esm/signal/group/SenderKeyManager.js +125 -106
- package/dist/esm/signal/index.js +1 -0
- package/dist/esm/signal/registration/keygen.js +6 -2
- package/dist/esm/signal/registration/utils.js +1 -0
- package/dist/esm/signal/session/SignalProtocol.js +150 -74
- package/dist/esm/signal/session/resolver.js +137 -102
- package/dist/esm/store/contracts/privacy-token.store.js +1 -0
- package/dist/esm/store/createStore.js +101 -187
- package/dist/esm/store/index.js +1 -10
- package/dist/esm/store/locks/appstate.lock.js +26 -0
- package/dist/esm/store/locks/auth.lock.js +15 -0
- package/dist/esm/store/locks/contact.lock.js +20 -0
- package/dist/esm/store/locks/device-list.lock.js +20 -0
- package/dist/esm/store/locks/message.lock.js +21 -0
- package/dist/esm/store/locks/participants.lock.js +20 -0
- package/dist/esm/store/locks/privacy-token.lock.js +18 -0
- package/dist/esm/store/locks/retry.lock.js +29 -0
- package/dist/esm/store/locks/sender-key.lock.js +52 -0
- package/dist/esm/store/locks/signal.lock.js +63 -0
- package/dist/esm/store/locks/thread.lock.js +21 -0
- package/dist/esm/store/noop.store.js +1 -1
- package/dist/esm/store/providers/memory/appstate.store.js +22 -24
- package/dist/esm/store/providers/memory/device-list.store.js +10 -5
- package/dist/esm/store/providers/memory/privacy-token.store.js +43 -0
- package/dist/esm/store/providers/memory/retry.store.js +77 -2
- package/dist/esm/store/providers/memory/sender-key.store.js +6 -1
- package/dist/esm/store/providers/memory/signal.store.js +36 -19
- package/dist/esm/transport/WaComms.js +3 -1
- package/dist/esm/transport/WaWebSocket.js +0 -6
- package/dist/esm/transport/binary/constants.js +0 -30
- package/dist/esm/transport/binary/decoder.js +4 -4
- package/dist/esm/transport/binary/encoder.js +8 -15
- package/dist/esm/transport/binary/index.js +0 -1
- package/dist/esm/transport/node/WaNodeOrchestrator.js +25 -19
- package/dist/esm/transport/node/builders/business.js +129 -0
- package/dist/esm/transport/node/builders/global.js +370 -0
- package/dist/esm/transport/node/builders/index.js +5 -2
- package/dist/esm/transport/node/builders/message.js +63 -239
- package/dist/esm/transport/node/builders/pairing.js +0 -24
- package/dist/esm/transport/node/builders/privacy-token.js +41 -0
- package/dist/esm/transport/node/builders/privacy.js +48 -0
- package/dist/esm/transport/node/builders/profile.js +70 -0
- package/dist/esm/transport/node/builders/retry.js +10 -22
- package/dist/esm/transport/node/builders/usync.js +6 -2
- package/dist/esm/transport/node/helpers.js +19 -1
- package/dist/esm/transport/node/usync.js +3 -33
- package/dist/esm/transport/node/xml.js +35 -14
- package/dist/esm/transport/noise/WaClientPayload.js +10 -10
- package/dist/esm/transport/noise/WaNoiseCert.js +3 -3
- package/dist/esm/transport/noise/WaNoiseSession.js +64 -23
- package/dist/esm/transport/noise/WaNoiseSocket.js +8 -4
- package/dist/esm/transport/stream/parse.js +8 -4
- package/dist/esm/util/bytes.js +22 -18
- package/dist/esm/util/index.js +5 -0
- package/dist/esm/util/primitives.js +3 -2
- package/dist/index.js +7 -1
- package/dist/infra/perf/BackgroundQueue.js +482 -0
- package/dist/infra/perf/BoundedTaskQueue.js +3 -1
- package/dist/infra/perf/PromiseDedup.js +24 -0
- package/dist/infra/perf/SharedExclusiveGate.js +113 -0
- package/dist/infra/perf/StoreLock.js +81 -0
- package/dist/media/WaMediaCrypto.js +94 -12
- package/dist/media/WaMediaTransferClient.js +39 -47
- package/dist/media/constants.js +2 -1
- package/dist/message/WaMessageClient.js +26 -19
- package/dist/message/content.js +198 -9
- package/dist/message/icdc.js +81 -0
- package/dist/message/incoming.js +24 -12
- package/dist/message/phash.js +3 -1
- package/dist/message/reporting-token.js +14 -28
- package/dist/protocol/appstate.js +10 -41
- package/dist/protocol/browser.js +10 -18
- package/dist/protocol/constants.js +21 -2
- package/dist/protocol/defaults.js +6 -0
- package/dist/protocol/index.js +8 -5
- package/dist/protocol/jid.js +111 -36
- package/dist/protocol/message.js +62 -2
- package/dist/protocol/nodes.js +2 -0
- package/dist/protocol/notification.js +3 -1
- package/dist/protocol/privacy-token.js +20 -0
- package/dist/protocol/privacy.js +58 -0
- package/dist/protocol/stream.js +27 -2
- package/dist/retry/codec.js +220 -0
- package/dist/retry/constants.js +1 -1
- package/dist/retry/index.js +5 -5
- package/dist/retry/parse.js +51 -30
- package/dist/retry/replay.js +10 -6
- package/dist/retry/tracker.js +50 -12
- package/dist/signal/api/SignalDeviceSyncApi.js +48 -31
- package/dist/signal/api/SignalDigestSyncApi.js +13 -9
- package/dist/signal/api/SignalIdentitySyncApi.js +25 -10
- package/dist/signal/api/SignalMissingPreKeysSyncApi.js +17 -6
- package/dist/signal/api/SignalRotateKeyApi.js +4 -2
- package/dist/signal/api/SignalSessionSyncApi.js +16 -7
- package/dist/signal/api/result-map.js +13 -0
- package/dist/signal/constants.js +1 -5
- package/dist/signal/crypto/WaAdvSignature.js +11 -5
- package/dist/signal/{store/sqlite.js → encoding.js} +79 -25
- package/dist/signal/group/SenderKeyCodec.js +4 -3
- package/dist/signal/group/SenderKeyManager.js +125 -106
- package/dist/signal/index.js +13 -1
- package/dist/signal/registration/keygen.js +6 -2
- package/dist/signal/registration/utils.js +1 -0
- package/dist/signal/session/SignalProtocol.js +150 -74
- package/dist/signal/session/resolver.js +135 -100
- package/dist/store/contracts/privacy-token.store.js +2 -0
- package/dist/store/createStore.js +101 -187
- package/dist/store/index.js +15 -33
- package/dist/store/locks/appstate.lock.js +29 -0
- package/dist/store/locks/auth.lock.js +18 -0
- package/dist/store/locks/contact.lock.js +23 -0
- package/dist/store/locks/device-list.lock.js +23 -0
- package/dist/store/locks/message.lock.js +24 -0
- package/dist/store/locks/participants.lock.js +23 -0
- package/dist/store/locks/privacy-token.lock.js +21 -0
- package/dist/store/locks/retry.lock.js +32 -0
- package/dist/store/locks/sender-key.lock.js +55 -0
- package/dist/store/locks/signal.lock.js +66 -0
- package/dist/store/locks/thread.lock.js +24 -0
- package/dist/store/noop.store.js +1 -1
- package/dist/store/providers/memory/appstate.store.js +22 -24
- package/dist/store/providers/memory/device-list.store.js +10 -5
- package/dist/store/providers/memory/privacy-token.store.js +47 -0
- package/dist/store/providers/memory/retry.store.js +77 -2
- package/dist/store/providers/memory/sender-key.store.js +6 -1
- package/dist/store/providers/memory/signal.store.js +36 -19
- package/dist/transport/WaComms.js +3 -1
- package/dist/transport/WaWebSocket.js +0 -6
- package/dist/transport/binary/constants.js +1 -31
- package/dist/transport/binary/decoder.js +4 -4
- package/dist/transport/binary/encoder.js +8 -15
- package/dist/transport/binary/index.js +0 -4
- package/dist/transport/node/WaNodeOrchestrator.js +24 -18
- package/dist/transport/node/builders/business.js +137 -0
- package/dist/transport/node/builders/global.js +375 -0
- package/dist/transport/node/builders/index.js +18 -9
- package/dist/transport/node/builders/message.js +64 -245
- package/dist/transport/node/builders/pairing.js +0 -26
- package/dist/transport/node/builders/privacy-token.js +46 -0
- package/dist/transport/node/builders/privacy.js +55 -0
- package/dist/transport/node/builders/profile.js +78 -0
- package/dist/transport/node/builders/retry.js +9 -21
- package/dist/transport/node/builders/usync.js +6 -2
- package/dist/transport/node/helpers.js +20 -1
- package/dist/transport/node/usync.js +2 -32
- package/dist/transport/node/xml.js +35 -14
- package/dist/transport/noise/WaClientPayload.js +13 -13
- package/dist/transport/noise/WaNoiseCert.js +2 -2
- package/dist/transport/noise/WaNoiseSession.js +64 -23
- package/dist/transport/noise/WaNoiseSocket.js +8 -4
- package/dist/transport/stream/parse.js +7 -3
- package/dist/types/appstate/encoding.d.ts +7 -0
- package/dist/types/appstate/index.d.ts +3 -3
- package/dist/types/appstate/utils.d.ts +0 -2
- package/dist/types/auth/flow/WaAuthCredentialsFlow.d.ts +1 -1
- package/dist/types/auth/index.d.ts +0 -2
- package/dist/types/auth/types.d.ts +1 -0
- package/dist/types/client/WaClient.d.ts +27 -12
- package/dist/types/client/WaClientFactory.d.ts +12 -4
- package/dist/types/client/connection/WaConnectionManager.d.ts +2 -0
- package/dist/types/client/coordinators/WaBusinessCoordinator.d.ts +57 -0
- package/dist/types/client/coordinators/WaIncomingNodeCoordinator.d.ts +3 -1
- package/dist/types/client/coordinators/WaMessageDispatchCoordinator.d.ts +14 -0
- package/dist/types/client/coordinators/WaPassiveTasksCoordinator.d.ts +4 -0
- package/dist/types/client/coordinators/WaPrivacyCoordinator.d.ts +26 -0
- package/dist/types/client/coordinators/WaProfileCoordinator.d.ts +36 -0
- package/dist/types/client/coordinators/WaRetryCoordinator.d.ts +6 -0
- package/dist/types/client/coordinators/WaStreamControlCoordinator.d.ts +3 -2
- package/dist/types/client/coordinators/WaTrustedContactTokenCoordinator.d.ts +45 -0
- package/dist/types/client/events/devices.d.ts +20 -0
- package/dist/types/client/events/identity.d.ts +9 -0
- package/dist/types/client/events/privacy-token.d.ts +7 -0
- package/dist/types/client/history-sync.d.ts +9 -6
- package/dist/types/client/incoming.d.ts +3 -1
- package/dist/types/client/index.d.ts +1 -1
- package/dist/types/client/mailbox.d.ts +3 -5
- package/dist/types/client/messages.d.ts +1 -2
- package/dist/types/client/persistence/WriteBehindPersistence.d.ts +34 -0
- package/dist/types/client/tokens/cs-token.d.ts +10 -0
- package/dist/types/client/tokens/tc-token.d.ts +5 -0
- package/dist/types/client/types.d.ts +51 -3
- package/dist/types/crypto/core/index.d.ts +2 -2
- package/dist/types/crypto/core/nonce.d.ts +2 -0
- package/dist/types/crypto/core/primitives.d.ts +0 -1
- package/dist/types/crypto/core/random.d.ts +1 -0
- package/dist/types/crypto/index.d.ts +1 -0
- package/dist/types/crypto/math/constants.d.ts +4 -2
- package/dist/types/crypto/math/fe.d.ts +30 -0
- package/dist/types/crypto/math/mod.d.ts +0 -2
- package/dist/types/crypto/math/types.d.ts +11 -4
- package/dist/types/index.d.ts +5 -3
- package/dist/types/infra/perf/BackgroundQueue.d.ts +58 -0
- package/dist/types/infra/perf/PromiseDedup.d.ts +4 -0
- package/dist/types/infra/perf/SharedExclusiveGate.d.ts +17 -0
- package/dist/types/infra/perf/StoreLock.d.ts +10 -0
- package/dist/types/media/WaMediaCrypto.d.ts +3 -2
- package/dist/types/media/WaMediaTransferClient.d.ts +3 -12
- package/dist/types/media/constants.d.ts +1 -1
- package/dist/types/media/index.d.ts +1 -1
- package/dist/types/media/types.d.ts +10 -2
- package/dist/types/message/content.d.ts +8 -0
- package/dist/types/message/icdc.d.ts +13 -0
- package/dist/types/message/reporting-token.d.ts +0 -1
- package/dist/types/message/types.d.ts +45 -6
- package/dist/types/protocol/appstate.d.ts +0 -11
- package/dist/types/protocol/constants.d.ts +7 -3
- package/dist/types/protocol/defaults.d.ts +6 -0
- package/dist/types/protocol/index.d.ts +1 -2
- package/dist/types/protocol/jid.d.ts +19 -2
- package/dist/types/protocol/message.d.ts +60 -0
- package/dist/types/protocol/nodes.d.ts +2 -0
- package/dist/types/protocol/notification.d.ts +2 -0
- package/dist/types/protocol/privacy-token.d.ts +17 -0
- package/dist/types/protocol/privacy.d.ts +75 -0
- package/dist/types/protocol/stream.d.ts +30 -0
- package/dist/types/retry/codec.d.ts +3 -0
- package/dist/types/retry/index.d.ts +3 -3
- package/dist/types/retry/parse.d.ts +5 -2
- package/dist/types/retry/tracker.d.ts +1 -0
- package/dist/types/retry/types.d.ts +6 -1
- package/dist/types/signal/api/SignalDeviceSyncApi.d.ts +2 -1
- package/dist/types/signal/api/SignalDigestSyncApi.d.ts +6 -0
- package/dist/types/signal/api/SignalIdentitySyncApi.d.ts +2 -0
- package/dist/types/signal/api/SignalRotateKeyApi.d.ts +4 -5
- package/dist/types/signal/api/SignalSessionSyncApi.d.ts +8 -6
- package/dist/types/signal/api/result-map.d.ts +1 -0
- package/dist/types/signal/constants.d.ts +0 -3
- package/dist/types/signal/{store/sqlite.d.ts → encoding.d.ts} +3 -3
- package/dist/types/signal/group/SenderKeyManager.d.ts +10 -5
- package/dist/types/signal/index.d.ts +2 -0
- package/dist/types/signal/session/SignalProtocol.d.ts +10 -4
- package/dist/types/signal/session/resolver.d.ts +7 -2
- package/dist/types/store/contracts/appstate.store.d.ts +1 -1
- package/dist/types/store/contracts/privacy-token.store.d.ts +16 -0
- package/dist/types/store/contracts/retry.store.d.ts +7 -0
- package/dist/types/store/contracts/signal.store.d.ts +7 -0
- package/dist/types/store/createStore.d.ts +1 -1
- package/dist/types/store/index.d.ts +5 -13
- package/dist/types/store/locks/appstate.lock.d.ts +3 -0
- package/dist/types/store/locks/auth.lock.d.ts +3 -0
- package/dist/types/store/locks/contact.lock.d.ts +3 -0
- package/dist/types/store/locks/device-list.lock.d.ts +2 -0
- package/dist/types/store/locks/message.lock.d.ts +3 -0
- package/dist/types/store/locks/participants.lock.d.ts +2 -0
- package/dist/types/store/locks/privacy-token.lock.d.ts +2 -0
- package/dist/types/store/locks/retry.lock.d.ts +2 -0
- package/dist/types/store/locks/sender-key.lock.d.ts +3 -0
- package/dist/types/store/locks/signal.lock.d.ts +3 -0
- package/dist/types/store/locks/thread.lock.d.ts +3 -0
- package/dist/types/store/providers/memory/appstate.store.d.ts +1 -1
- package/dist/types/store/providers/memory/privacy-token.store.d.ts +13 -0
- package/dist/types/store/providers/memory/retry.store.d.ts +8 -0
- package/dist/types/store/providers/memory/signal.store.d.ts +2 -1
- package/dist/types/store/types.d.ts +49 -61
- package/dist/types/transport/WaWebSocket.d.ts +0 -1
- package/dist/types/transport/binary/constants.d.ts +0 -30
- package/dist/types/transport/binary/index.d.ts +0 -1
- package/dist/types/transport/node/WaNodeOrchestrator.d.ts +3 -4
- package/dist/types/transport/node/builders/business.d.ts +29 -0
- package/dist/types/transport/node/builders/global.d.ts +102 -0
- package/dist/types/transport/node/builders/index.d.ts +5 -2
- package/dist/types/transport/node/builders/message.d.ts +8 -7
- package/dist/types/transport/node/builders/pairing.d.ts +0 -2
- package/dist/types/transport/node/builders/privacy-token.d.ts +9 -0
- package/dist/types/transport/node/builders/privacy.d.ts +7 -0
- package/dist/types/transport/node/builders/profile.d.ts +8 -0
- package/dist/types/transport/node/builders/retry.d.ts +0 -1
- package/dist/types/transport/node/helpers.d.ts +5 -0
- package/dist/types/transport/noise/WaNoiseSession.d.ts +3 -2
- package/dist/types/transport/noise/WaNoiseSocket.d.ts +4 -2
- package/dist/types/util/bytes.d.ts +1 -1
- package/dist/types/util/index.d.ts +5 -0
- package/dist/types/util/primitives.d.ts +0 -1
- package/dist/util/bytes.js +22 -18
- package/dist/util/index.js +23 -0
- package/dist/util/primitives.js +2 -2
- package/package.json +29 -7
- package/proto/index.js +1 -1
- package/dist/crypto/core/constants.js +0 -4
- package/dist/esm/crypto/core/constants.js +0 -1
- package/dist/esm/retry/outbound.js +0 -82
- package/dist/esm/store/providers/sqlite/BaseSqliteStore.js +0 -37
- package/dist/esm/store/providers/sqlite/appstate.store.js +0 -250
- package/dist/esm/store/providers/sqlite/auth.store.js +0 -176
- package/dist/esm/store/providers/sqlite/connection.js +0 -245
- package/dist/esm/store/providers/sqlite/contact.store.js +0 -74
- package/dist/esm/store/providers/sqlite/device-list.store.js +0 -127
- package/dist/esm/store/providers/sqlite/message.store.js +0 -132
- package/dist/esm/store/providers/sqlite/migrations.js +0 -347
- package/dist/esm/store/providers/sqlite/participants.store.js +0 -77
- package/dist/esm/store/providers/sqlite/retry.store.js +0 -141
- package/dist/esm/store/providers/sqlite/sender-key.store.js +0 -198
- package/dist/esm/store/providers/sqlite/signal.store.js +0 -435
- package/dist/esm/store/providers/sqlite/table-names.js +0 -107
- package/dist/esm/store/providers/sqlite/thread.store.js +0 -85
- package/dist/retry/outbound.js +0 -87
- package/dist/store/providers/sqlite/BaseSqliteStore.js +0 -41
- package/dist/store/providers/sqlite/appstate.store.js +0 -254
- package/dist/store/providers/sqlite/auth.store.js +0 -180
- package/dist/store/providers/sqlite/connection.js +0 -281
- package/dist/store/providers/sqlite/contact.store.js +0 -78
- package/dist/store/providers/sqlite/device-list.store.js +0 -131
- package/dist/store/providers/sqlite/message.store.js +0 -136
- package/dist/store/providers/sqlite/migrations.js +0 -350
- package/dist/store/providers/sqlite/participants.store.js +0 -81
- package/dist/store/providers/sqlite/retry.store.js +0 -145
- package/dist/store/providers/sqlite/sender-key.store.js +0 -202
- package/dist/store/providers/sqlite/signal.store.js +0 -439
- package/dist/store/providers/sqlite/table-names.js +0 -113
- package/dist/store/providers/sqlite/thread.store.js +0 -89
- package/dist/types/appstate/store/sqlite.d.ts +0 -7
- package/dist/types/crypto/core/constants.d.ts +0 -1
- package/dist/types/retry/outbound.d.ts +0 -4
- package/dist/types/store/providers/sqlite/BaseSqliteStore.d.ts +0 -12
- package/dist/types/store/providers/sqlite/appstate.store.d.ts +0 -17
- package/dist/types/store/providers/sqlite/auth.store.d.ts +0 -10
- package/dist/types/store/providers/sqlite/connection.d.ts +0 -10
- package/dist/types/store/providers/sqlite/contact.store.d.ts +0 -12
- package/dist/types/store/providers/sqlite/device-list.store.d.ts +0 -15
- package/dist/types/store/providers/sqlite/message.store.d.ts +0 -13
- package/dist/types/store/providers/sqlite/migrations.d.ts +0 -3
- package/dist/types/store/providers/sqlite/participants.store.d.ts +0 -12
- package/dist/types/store/providers/sqlite/retry.store.d.ts +0 -15
- package/dist/types/store/providers/sqlite/sender-key.store.d.ts +0 -24
- package/dist/types/store/providers/sqlite/signal.store.d.ts +0 -53
- package/dist/types/store/providers/sqlite/table-names.d.ts +0 -5
- package/dist/types/store/providers/sqlite/thread.store.d.ts +0 -13
package/dist/message/content.js
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isSendMediaMessage = isSendMediaMessage;
|
|
4
4
|
exports.resolveMessageTypeAttr = resolveMessageTypeAttr;
|
|
5
|
+
exports.resolveEditAttr = resolveEditAttr;
|
|
6
|
+
exports.resolveEncMediaType = resolveEncMediaType;
|
|
7
|
+
exports.resolveMetaAttrs = resolveMetaAttrs;
|
|
8
|
+
const _proto_1 = require("../proto.js");
|
|
9
|
+
const constants_1 = require("../protocol/constants");
|
|
5
10
|
function isSendMediaMessage(content) {
|
|
6
11
|
return (!!content &&
|
|
7
12
|
typeof content === 'object' &&
|
|
@@ -9,16 +14,200 @@ function isSendMediaMessage(content) {
|
|
|
9
14
|
'media' in content &&
|
|
10
15
|
'mimetype' in content);
|
|
11
16
|
}
|
|
17
|
+
function unwrapMessage(message) {
|
|
18
|
+
let msg = message;
|
|
19
|
+
for (;;) {
|
|
20
|
+
const inner = msg.ephemeralMessage?.message ??
|
|
21
|
+
msg.groupMentionedMessage?.message ??
|
|
22
|
+
msg.botInvokeMessage?.message ??
|
|
23
|
+
msg.deviceSentMessage?.message ??
|
|
24
|
+
msg.viewOnceMessage?.message ??
|
|
25
|
+
msg.viewOnceMessageV2?.message ??
|
|
26
|
+
msg.documentWithCaptionMessage?.message;
|
|
27
|
+
if (!inner)
|
|
28
|
+
return msg;
|
|
29
|
+
msg = inner;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
12
32
|
function resolveMessageTypeAttr(message) {
|
|
13
|
-
|
|
14
|
-
|
|
33
|
+
const msg = unwrapMessage(message);
|
|
34
|
+
if (msg.reactionMessage || msg.encReactionMessage) {
|
|
35
|
+
return constants_1.WA_STANZA_MSG_TYPES.REACTION;
|
|
36
|
+
}
|
|
37
|
+
if (msg.eventMessage ||
|
|
38
|
+
msg.encEventResponseMessage ||
|
|
39
|
+
msg.secretEncryptedMessage?.secretEncType ===
|
|
40
|
+
_proto_1.proto.Message.SecretEncryptedMessage.SecretEncType.EVENT_EDIT) {
|
|
41
|
+
return constants_1.WA_STANZA_MSG_TYPES.EVENT;
|
|
42
|
+
}
|
|
43
|
+
if (msg.pollCreationMessage ||
|
|
44
|
+
msg.pollCreationMessageV2 ||
|
|
45
|
+
msg.pollCreationMessageV3 ||
|
|
46
|
+
msg.pollCreationMessageV5 ||
|
|
47
|
+
msg.pollUpdateMessage ||
|
|
48
|
+
msg.secretEncryptedMessage?.secretEncType ===
|
|
49
|
+
_proto_1.proto.Message.SecretEncryptedMessage.SecretEncType.POLL_EDIT ||
|
|
50
|
+
msg.secretEncryptedMessage?.secretEncType ===
|
|
51
|
+
_proto_1.proto.Message.SecretEncryptedMessage.SecretEncType.POLL_ADD_OPTION) {
|
|
52
|
+
return constants_1.WA_STANZA_MSG_TYPES.POLL;
|
|
53
|
+
}
|
|
54
|
+
if (msg.extendedTextMessage?.matchedText && msg.extendedTextMessage.matchedText.trim() !== '') {
|
|
55
|
+
return constants_1.WA_STANZA_MSG_TYPES.MEDIA;
|
|
56
|
+
}
|
|
57
|
+
if ((msg.conversation !== undefined && msg.conversation !== null) ||
|
|
58
|
+
(msg.extendedTextMessage && !msg.extendedTextMessage.matchedText) ||
|
|
59
|
+
msg.protocolMessage ||
|
|
60
|
+
msg.interactiveMessage ||
|
|
61
|
+
msg.keepInChatMessage ||
|
|
62
|
+
msg.requestPhoneNumberMessage ||
|
|
63
|
+
msg.editedMessage ||
|
|
64
|
+
msg.pinInChatMessage ||
|
|
65
|
+
msg.encCommentMessage ||
|
|
66
|
+
msg.newsletterAdminInviteMessage ||
|
|
67
|
+
msg.pollResultSnapshotMessage ||
|
|
68
|
+
msg.pollResultSnapshotMessageV3 ||
|
|
69
|
+
msg.templateButtonReplyMessage ||
|
|
70
|
+
msg.messageHistoryNotice ||
|
|
71
|
+
msg.secretEncryptedMessage?.secretEncType ===
|
|
72
|
+
_proto_1.proto.Message.SecretEncryptedMessage.SecretEncType.MESSAGE_EDIT ||
|
|
73
|
+
msg.secretEncryptedMessage?.secretEncType ===
|
|
74
|
+
_proto_1.proto.Message.SecretEncryptedMessage.SecretEncType.MESSAGE_SCHEDULE) {
|
|
75
|
+
return constants_1.WA_STANZA_MSG_TYPES.TEXT;
|
|
76
|
+
}
|
|
77
|
+
return constants_1.WA_STANZA_MSG_TYPES.MEDIA;
|
|
78
|
+
}
|
|
79
|
+
const REVOKED_REACTION_TEXT = '';
|
|
80
|
+
function resolveEditAttr(message, subtype) {
|
|
81
|
+
const msg = unwrapMessage(message);
|
|
82
|
+
if (msg.protocolMessage) {
|
|
83
|
+
const protocolType = msg.protocolMessage.type;
|
|
84
|
+
if (protocolType === _proto_1.proto.Message.ProtocolMessage.Type.REVOKE) {
|
|
85
|
+
return subtype === 'admin_revoke'
|
|
86
|
+
? constants_1.WA_EDIT_ATTRS.ADMIN_REVOKE
|
|
87
|
+
: constants_1.WA_EDIT_ATTRS.SENDER_REVOKE;
|
|
88
|
+
}
|
|
89
|
+
if (protocolType === _proto_1.proto.Message.ProtocolMessage.Type.MESSAGE_EDIT) {
|
|
90
|
+
return constants_1.WA_EDIT_ATTRS.MESSAGE_EDIT;
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
if (msg.secretEncryptedMessage) {
|
|
95
|
+
const encType = msg.secretEncryptedMessage.secretEncType;
|
|
96
|
+
if (encType === _proto_1.proto.Message.SecretEncryptedMessage.SecretEncType.EVENT_EDIT ||
|
|
97
|
+
encType === _proto_1.proto.Message.SecretEncryptedMessage.SecretEncType.MESSAGE_EDIT) {
|
|
98
|
+
return constants_1.WA_EDIT_ATTRS.MESSAGE_EDIT;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (msg.editedMessage) {
|
|
102
|
+
return constants_1.WA_EDIT_ATTRS.MESSAGE_EDIT;
|
|
103
|
+
}
|
|
104
|
+
if (msg.reactionMessage) {
|
|
105
|
+
if (msg.reactionMessage.text === REVOKED_REACTION_TEXT) {
|
|
106
|
+
return constants_1.WA_EDIT_ATTRS.SENDER_REVOKE;
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
if (msg.keepInChatMessage) {
|
|
111
|
+
if (msg.keepInChatMessage.key?.fromMe === true &&
|
|
112
|
+
msg.keepInChatMessage.keepType === _proto_1.proto.KeepType.UNDO_KEEP_FOR_ALL) {
|
|
113
|
+
return constants_1.WA_EDIT_ATTRS.SENDER_REVOKE;
|
|
114
|
+
}
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
if (msg.pinInChatMessage) {
|
|
118
|
+
return constants_1.WA_EDIT_ATTRS.PIN_IN_CHAT;
|
|
119
|
+
}
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
function resolveEncMediaType(message) {
|
|
123
|
+
const msg = unwrapMessage(message);
|
|
124
|
+
if (msg.imageMessage)
|
|
125
|
+
return constants_1.WA_ENC_MEDIA_TYPES.IMAGE;
|
|
126
|
+
if (msg.stickerMessage)
|
|
127
|
+
return constants_1.WA_ENC_MEDIA_TYPES.STICKER;
|
|
128
|
+
if (msg.locationMessage) {
|
|
129
|
+
return msg.locationMessage.isLive
|
|
130
|
+
? constants_1.WA_ENC_MEDIA_TYPES.LIVE_LOCATION
|
|
131
|
+
: constants_1.WA_ENC_MEDIA_TYPES.LOCATION;
|
|
132
|
+
}
|
|
133
|
+
if (msg.contactMessage)
|
|
134
|
+
return constants_1.WA_ENC_MEDIA_TYPES.VCARD;
|
|
135
|
+
if (msg.contactsArrayMessage)
|
|
136
|
+
return constants_1.WA_ENC_MEDIA_TYPES.CONTACT_ARRAY;
|
|
137
|
+
if (msg.documentMessage)
|
|
138
|
+
return constants_1.WA_ENC_MEDIA_TYPES.DOCUMENT;
|
|
139
|
+
if (msg.audioMessage) {
|
|
140
|
+
return msg.audioMessage.ptt ? constants_1.WA_ENC_MEDIA_TYPES.PTT : constants_1.WA_ENC_MEDIA_TYPES.AUDIO;
|
|
141
|
+
}
|
|
142
|
+
if (msg.videoMessage) {
|
|
143
|
+
return msg.videoMessage.gifPlayback ? constants_1.WA_ENC_MEDIA_TYPES.GIF : constants_1.WA_ENC_MEDIA_TYPES.VIDEO;
|
|
144
|
+
}
|
|
145
|
+
if (msg.ptvMessage)
|
|
146
|
+
return constants_1.WA_ENC_MEDIA_TYPES.PTV;
|
|
147
|
+
if (msg.buttonsMessage)
|
|
148
|
+
return constants_1.WA_ENC_MEDIA_TYPES.BUTTON;
|
|
149
|
+
if (msg.buttonsResponseMessage)
|
|
150
|
+
return constants_1.WA_ENC_MEDIA_TYPES.BUTTON_RESPONSE;
|
|
151
|
+
if (msg.listMessage)
|
|
152
|
+
return constants_1.WA_ENC_MEDIA_TYPES.LIST;
|
|
153
|
+
if (msg.listResponseMessage)
|
|
154
|
+
return constants_1.WA_ENC_MEDIA_TYPES.LIST_RESPONSE;
|
|
155
|
+
if (msg.orderMessage)
|
|
156
|
+
return constants_1.WA_ENC_MEDIA_TYPES.ORDER;
|
|
157
|
+
if (msg.productMessage)
|
|
158
|
+
return constants_1.WA_ENC_MEDIA_TYPES.PRODUCT;
|
|
159
|
+
if (msg.groupInviteMessage)
|
|
160
|
+
return constants_1.WA_ENC_MEDIA_TYPES.URL;
|
|
161
|
+
if (msg.interactiveResponseMessage)
|
|
162
|
+
return constants_1.WA_ENC_MEDIA_TYPES.NATIVE_FLOW_RESPONSE;
|
|
163
|
+
if (msg.messageHistoryBundle)
|
|
164
|
+
return constants_1.WA_ENC_MEDIA_TYPES.GROUP_HISTORY;
|
|
165
|
+
if (msg.extendedTextMessage?.matchedText && msg.extendedTextMessage.matchedText.trim() !== '') {
|
|
166
|
+
return constants_1.WA_ENC_MEDIA_TYPES.URL;
|
|
167
|
+
}
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
function resolveMetaAttrs(message) {
|
|
171
|
+
const msg = unwrapMessage(message);
|
|
172
|
+
let polltype;
|
|
173
|
+
let eventType;
|
|
174
|
+
let viewOnce;
|
|
175
|
+
if (msg.pollCreationMessage || msg.pollCreationMessageV2 || msg.pollCreationMessageV3) {
|
|
176
|
+
polltype = constants_1.WA_POLL_META_TYPES.CREATION;
|
|
177
|
+
}
|
|
178
|
+
else if (msg.pollUpdateMessage) {
|
|
179
|
+
polltype = constants_1.WA_POLL_META_TYPES.VOTE;
|
|
180
|
+
}
|
|
181
|
+
else if (msg.secretEncryptedMessage?.secretEncType ===
|
|
182
|
+
_proto_1.proto.Message.SecretEncryptedMessage.SecretEncType.POLL_EDIT) {
|
|
183
|
+
polltype = constants_1.WA_POLL_META_TYPES.EDIT;
|
|
184
|
+
}
|
|
185
|
+
else if (msg.secretEncryptedMessage?.secretEncType ===
|
|
186
|
+
_proto_1.proto.Message.SecretEncryptedMessage.SecretEncType.POLL_ADD_OPTION) {
|
|
187
|
+
polltype = constants_1.WA_POLL_META_TYPES.EDIT;
|
|
188
|
+
}
|
|
189
|
+
if (msg.eventMessage) {
|
|
190
|
+
eventType = constants_1.WA_EVENT_META_TYPES.CREATION;
|
|
191
|
+
}
|
|
192
|
+
else if (msg.encEventResponseMessage) {
|
|
193
|
+
eventType = constants_1.WA_EVENT_META_TYPES.RESPONSE;
|
|
194
|
+
}
|
|
195
|
+
else if (msg.secretEncryptedMessage?.secretEncType ===
|
|
196
|
+
_proto_1.proto.Message.SecretEncryptedMessage.SecretEncType.EVENT_EDIT) {
|
|
197
|
+
eventType = constants_1.WA_EVENT_META_TYPES.EDIT;
|
|
198
|
+
}
|
|
199
|
+
if (message.viewOnceMessage || message.viewOnceMessageV2) {
|
|
200
|
+
viewOnce = 'true';
|
|
15
201
|
}
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
message.audioMessage ||
|
|
19
|
-
message.documentMessage ||
|
|
20
|
-
message.stickerMessage) {
|
|
21
|
-
return 'media';
|
|
202
|
+
if (!polltype && !eventType && !viewOnce) {
|
|
203
|
+
return null;
|
|
22
204
|
}
|
|
23
|
-
|
|
205
|
+
const attrs = {};
|
|
206
|
+
if (polltype)
|
|
207
|
+
attrs.polltype = polltype;
|
|
208
|
+
if (eventType)
|
|
209
|
+
attrs.event_type = eventType;
|
|
210
|
+
if (viewOnce)
|
|
211
|
+
attrs.view_once = viewOnce;
|
|
212
|
+
return attrs;
|
|
24
213
|
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.computeDeviceKeyHash = computeDeviceKeyHash;
|
|
4
|
+
exports.resolveIcdcMeta = resolveIcdcMeta;
|
|
5
|
+
exports.injectDeviceListMetadata = injectDeviceListMetadata;
|
|
6
|
+
const _crypto_1 = require("../crypto/index.js");
|
|
7
|
+
const jid_1 = require("../protocol/jid");
|
|
8
|
+
const bytes_1 = require("../util/bytes");
|
|
9
|
+
const ICDC_HASH_LENGTH = 8;
|
|
10
|
+
const ICDC_FRESHNESS_THRESHOLD_MS = 30 * 24 * 60 * 60 * 1000;
|
|
11
|
+
const DEVICE_LIST_METADATA_VERSION = 2;
|
|
12
|
+
const EMPTY_KEY_HASH = new Uint8Array(ICDC_HASH_LENGTH);
|
|
13
|
+
async function computeDeviceKeyHash(identityKeys) {
|
|
14
|
+
if (identityKeys.length === 0) {
|
|
15
|
+
return EMPTY_KEY_HASH;
|
|
16
|
+
}
|
|
17
|
+
const rawKeys = new Array(identityKeys.length);
|
|
18
|
+
for (let i = 0; i < identityKeys.length; i += 1) {
|
|
19
|
+
rawKeys[i] =
|
|
20
|
+
identityKeys[i].byteLength === 33 ? (0, _crypto_1.toRawPubKey)(identityKeys[i]) : identityKeys[i];
|
|
21
|
+
}
|
|
22
|
+
const combined = (0, bytes_1.concatBytes)(rawKeys);
|
|
23
|
+
const hash = await (0, _crypto_1.sha256)(combined);
|
|
24
|
+
return hash.subarray(0, ICDC_HASH_LENGTH);
|
|
25
|
+
}
|
|
26
|
+
async function resolveIcdcMeta(deviceJids, signalStore, updatedAtMs, localIdentity) {
|
|
27
|
+
if (deviceJids.length === 0) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const addresses = new Array(deviceJids.length);
|
|
31
|
+
for (let i = 0; i < deviceJids.length; i += 1) {
|
|
32
|
+
addresses[i] = (0, jid_1.parseSignalAddressFromJid)(deviceJids[i]);
|
|
33
|
+
}
|
|
34
|
+
const remoteKeys = await signalStore.getRemoteIdentities(addresses);
|
|
35
|
+
const keys = [];
|
|
36
|
+
for (let i = 0; i < addresses.length; i += 1) {
|
|
37
|
+
const key = remoteKeys[i];
|
|
38
|
+
if (key) {
|
|
39
|
+
keys.push(key);
|
|
40
|
+
}
|
|
41
|
+
else if (localIdentity &&
|
|
42
|
+
addresses[i].user === localIdentity.address.user &&
|
|
43
|
+
addresses[i].device === localIdentity.address.device) {
|
|
44
|
+
keys.push(localIdentity.pubKey);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (keys.length === 0) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
const keyHash = await computeDeviceKeyHash(keys);
|
|
51
|
+
const timestamp = updatedAtMs !== undefined && Date.now() - updatedAtMs < ICDC_FRESHNESS_THRESHOLD_MS
|
|
52
|
+
? Math.floor(updatedAtMs / 1000)
|
|
53
|
+
: undefined;
|
|
54
|
+
return { keyHash, timestamp };
|
|
55
|
+
}
|
|
56
|
+
function injectDeviceListMetadata(message, senderIcdc, recipientIcdc) {
|
|
57
|
+
if (!senderIcdc && !recipientIcdc) {
|
|
58
|
+
return message;
|
|
59
|
+
}
|
|
60
|
+
const deviceListMetadata = {};
|
|
61
|
+
if (senderIcdc) {
|
|
62
|
+
deviceListMetadata.senderKeyHash = senderIcdc.keyHash;
|
|
63
|
+
if (senderIcdc.timestamp !== undefined) {
|
|
64
|
+
deviceListMetadata.senderTimestamp = senderIcdc.timestamp;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (recipientIcdc) {
|
|
68
|
+
deviceListMetadata.recipientKeyHash = recipientIcdc.keyHash;
|
|
69
|
+
if (recipientIcdc.timestamp !== undefined) {
|
|
70
|
+
deviceListMetadata.recipientTimestamp = recipientIcdc.timestamp;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
...message,
|
|
75
|
+
messageContextInfo: {
|
|
76
|
+
...message.messageContextInfo,
|
|
77
|
+
deviceListMetadata,
|
|
78
|
+
deviceListMetadataVersion: DEVICE_LIST_METADATA_VERSION
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
package/dist/message/incoming.js
CHANGED
|
@@ -6,12 +6,9 @@ const padding_1 = require("./padding");
|
|
|
6
6
|
const _proto_1 = require("../proto.js");
|
|
7
7
|
const constants_1 = require("../protocol/constants");
|
|
8
8
|
const jid_1 = require("../protocol/jid");
|
|
9
|
-
const
|
|
9
|
+
const global_1 = require("../transport/node/builders/global");
|
|
10
10
|
const helpers_1 = require("../transport/node/helpers");
|
|
11
11
|
const primitives_1 = require("../util/primitives");
|
|
12
|
-
function parseMessageTimestamp(value) {
|
|
13
|
-
return (0, primitives_1.parseOptionalInt)(value);
|
|
14
|
-
}
|
|
15
12
|
function pickNextRetryCount(node) {
|
|
16
13
|
const retryNode = (0, helpers_1.findNodeChild)(node, 'retry');
|
|
17
14
|
const parsed = (0, primitives_1.parseOptionalInt)(retryNode?.attrs.count);
|
|
@@ -128,7 +125,13 @@ async function sendRetryReceiptForDecryptFailure(node, options, error, encType)
|
|
|
128
125
|
if (options.onDecryptFailure) {
|
|
129
126
|
return options.onDecryptFailure(retryContext, error);
|
|
130
127
|
}
|
|
131
|
-
const retryReceiptNode = (0,
|
|
128
|
+
const retryReceiptNode = (0, global_1.buildReceiptNode)({
|
|
129
|
+
kind: 'retry',
|
|
130
|
+
node,
|
|
131
|
+
id: stanzaId,
|
|
132
|
+
to: from,
|
|
133
|
+
retryCount: pickNextRetryCount(node)
|
|
134
|
+
});
|
|
132
135
|
try {
|
|
133
136
|
await options.sendNode(retryReceiptNode);
|
|
134
137
|
options.logger.debug('sent retry receipt for undecryptable incoming message', {
|
|
@@ -155,7 +158,8 @@ async function decryptAndProcessEncNode(node, encNode, encType, senderJid, optio
|
|
|
155
158
|
const senderAddress = (0, jid_1.parseSignalAddressFromJid)(senderJid);
|
|
156
159
|
const decryptedPayload = await decrypt((0, helpers_1.decodeNodeContentBase64OrBytes)(encNode.content, 'message.enc'), senderAddress);
|
|
157
160
|
const unpaddedPlaintext = (0, padding_1.unpadPkcs7)(decryptedPayload);
|
|
158
|
-
const
|
|
161
|
+
const decodedMessage = _proto_1.proto.Message.decode(unpaddedPlaintext);
|
|
162
|
+
const message = (0, device_sent_1.unwrapDeviceSentMessage)(decodedMessage) ?? decodedMessage;
|
|
159
163
|
const senderKeyDistribution = pickSenderKeyDistributionPayload(message);
|
|
160
164
|
if (senderKeyDistribution && options.senderKeyManager) {
|
|
161
165
|
try {
|
|
@@ -181,7 +185,7 @@ async function decryptAndProcessEncNode(node, encNode, encType, senderJid, optio
|
|
|
181
185
|
const chatJid = node.attrs.from;
|
|
182
186
|
options.emitIncomingMessage?.({
|
|
183
187
|
...buildBaseIncomingEvent(node),
|
|
184
|
-
timestampSeconds:
|
|
188
|
+
timestampSeconds: (0, primitives_1.parseOptionalInt)(node.attrs.t),
|
|
185
189
|
senderJid,
|
|
186
190
|
encryptionType: encType,
|
|
187
191
|
isGroupChat: chatJid ? (0, jid_1.isGroupJid)(chatJid) : false,
|
|
@@ -288,7 +292,13 @@ async function handleIncomingMessageAck(node, options) {
|
|
|
288
292
|
return true;
|
|
289
293
|
}
|
|
290
294
|
if (node.attrs.type === constants_1.WA_MESSAGE_TYPES.MEDIA_NOTIFY) {
|
|
291
|
-
const ackNode = (0,
|
|
295
|
+
const ackNode = (0, global_1.buildAckNode)({
|
|
296
|
+
kind: 'message',
|
|
297
|
+
node,
|
|
298
|
+
id,
|
|
299
|
+
to: from,
|
|
300
|
+
from: options.getMeJid?.()
|
|
301
|
+
});
|
|
292
302
|
options.logger.debug('sending inbound message ack', {
|
|
293
303
|
id,
|
|
294
304
|
to: from,
|
|
@@ -301,7 +311,12 @@ async function handleIncomingMessageAck(node, options) {
|
|
|
301
311
|
if (!shouldSendStandardReceipt) {
|
|
302
312
|
return true;
|
|
303
313
|
}
|
|
304
|
-
const receiptNode = (0,
|
|
314
|
+
const receiptNode = (0, global_1.buildReceiptNode)({
|
|
315
|
+
kind: 'delivery',
|
|
316
|
+
node,
|
|
317
|
+
id,
|
|
318
|
+
to: from
|
|
319
|
+
});
|
|
305
320
|
options.logger.debug('sending inbound message receipt', {
|
|
306
321
|
id,
|
|
307
322
|
to: from,
|
|
@@ -311,6 +326,3 @@ async function handleIncomingMessageAck(node, options) {
|
|
|
311
326
|
await options.sendNode(receiptNode);
|
|
312
327
|
return true;
|
|
313
328
|
}
|
|
314
|
-
function normalizeIncomingDecryptedMessage(message) {
|
|
315
|
-
return (0, device_sent_1.unwrapDeviceSentMessage)(message) ?? message;
|
|
316
|
-
}
|
package/dist/message/phash.js
CHANGED
|
@@ -8,7 +8,9 @@ async function computePhashV2(participants) {
|
|
|
8
8
|
if (participants.length === 0) {
|
|
9
9
|
return '2:';
|
|
10
10
|
}
|
|
11
|
-
const canonical = participants.
|
|
11
|
+
const canonical = new Array(participants.length);
|
|
12
|
+
for (let i = 0; i < participants.length; i += 1)
|
|
13
|
+
canonical[i] = toPhashCanonicalWid(participants[i]);
|
|
12
14
|
const joined = canonical.sort().join('');
|
|
13
15
|
const digest = await (0, core_1.sha256)(bytes_1.TEXT_ENCODER.encode(joined));
|
|
14
16
|
return `2:${(0, bytes_1.bytesToBase64)(digest.subarray(0, 6))}`;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WA_REPORTING_TOKEN_VERSION = void 0;
|
|
4
|
-
exports.buildReportingTokenNode = buildReportingTokenNode;
|
|
5
4
|
exports.buildReportingTokenArtifacts = buildReportingTokenArtifacts;
|
|
6
5
|
const _crypto_1 = require("../crypto/index.js");
|
|
7
6
|
const _proto_1 = require("../proto.js");
|
|
@@ -14,10 +13,6 @@ const WA_REPORTING_TOKEN_CONFIG_BYTES = (0, bytes_1.base64ToBytesChecked)(WA_REP
|
|
|
14
13
|
exports.WA_REPORTING_TOKEN_VERSION = 2;
|
|
15
14
|
let reportingTokenConfigSpec = null;
|
|
16
15
|
const reportingTokenConfigCache = new Map();
|
|
17
|
-
async function buildReportingTokenNode(input) {
|
|
18
|
-
const artifacts = await buildReportingTokenArtifacts(input);
|
|
19
|
-
return artifacts?.node ?? null;
|
|
20
|
-
}
|
|
21
16
|
async function buildReportingTokenArtifacts(input) {
|
|
22
17
|
const stanzaId = input.stanzaId.trim();
|
|
23
18
|
if (!stanzaId || !isMessageReportingTokenCompatible(input.message)) {
|
|
@@ -31,12 +26,7 @@ async function buildReportingTokenArtifacts(input) {
|
|
|
31
26
|
if (reportingTokenContent.byteLength === 0) {
|
|
32
27
|
return null;
|
|
33
28
|
}
|
|
34
|
-
const secretInfo = (
|
|
35
|
-
bytes_1.TEXT_ENCODER.encode(stanzaId),
|
|
36
|
-
bytes_1.TEXT_ENCODER.encode(input.senderUserJid),
|
|
37
|
-
bytes_1.TEXT_ENCODER.encode(input.remoteJid),
|
|
38
|
-
bytes_1.TEXT_ENCODER.encode(WA_REPORTING_TOKEN_USE_CASE)
|
|
39
|
-
]);
|
|
29
|
+
const secretInfo = bytes_1.TEXT_ENCODER.encode(stanzaId + input.senderUserJid + input.remoteJid + WA_REPORTING_TOKEN_USE_CASE);
|
|
40
30
|
const reportingTokenKey = await (0, _crypto_1.hkdf)((0, bytes_1.toBytesView)(messageSecret), null, secretInfo, WA_REPORTING_TOKEN_KEY_BYTES);
|
|
41
31
|
const hmacKey = await (0, _crypto_1.importHmacKey)(reportingTokenKey);
|
|
42
32
|
const reportingToken = (await (0, _crypto_1.hmacSign)(hmacKey, reportingTokenContent)).subarray(0, WA_REPORTING_TOKEN_BYTES);
|
|
@@ -73,13 +63,11 @@ function computeReportingTokenContent(messageBytes, version) {
|
|
|
73
63
|
if (extracted.totalSize === 0) {
|
|
74
64
|
return bytes_1.EMPTY_BYTES;
|
|
75
65
|
}
|
|
76
|
-
const
|
|
77
|
-
let
|
|
78
|
-
|
|
79
|
-
output.set(part.bytes, offset);
|
|
80
|
-
offset += part.bytes.length;
|
|
66
|
+
const parts = new Array(extracted.parts.length);
|
|
67
|
+
for (let index = 0; index < extracted.parts.length; index += 1) {
|
|
68
|
+
parts[index] = extracted.parts[index].bytes;
|
|
81
69
|
}
|
|
82
|
-
return
|
|
70
|
+
return (0, bytes_1.concatBytes)(parts);
|
|
83
71
|
}
|
|
84
72
|
function getReportingTokenConfig(version) {
|
|
85
73
|
const cached = reportingTokenConfigCache.get(version);
|
|
@@ -256,7 +244,8 @@ function extractProtobufFieldParts(bytes, start, end, config, rootConfig) {
|
|
|
256
244
|
if (!configuredField) {
|
|
257
245
|
continue;
|
|
258
246
|
}
|
|
259
|
-
if (!configuredField.isMessage &&
|
|
247
|
+
if (!configuredField.isMessage &&
|
|
248
|
+
(!configuredField.subfields || configuredField.subfields.fields.size === 0)) {
|
|
260
249
|
const fieldBytes = bytes.subarray(parsedField.start, parsedField.next);
|
|
261
250
|
parts.push({
|
|
262
251
|
fieldNumber: parsedField.fieldNumber,
|
|
@@ -298,9 +287,6 @@ function extractProtobufFieldParts(bytes, start, end, config, rootConfig) {
|
|
|
298
287
|
totalSize
|
|
299
288
|
};
|
|
300
289
|
}
|
|
301
|
-
function isExtractWholeField(field) {
|
|
302
|
-
return !field.subfields || field.subfields.fields.size === 0;
|
|
303
|
-
}
|
|
304
290
|
function parseProtobufField(bytes, start, end) {
|
|
305
291
|
const tag = readVarint(bytes, start, end);
|
|
306
292
|
const tagValue = tag.value;
|
|
@@ -429,15 +415,15 @@ function encodeVarint(value) {
|
|
|
429
415
|
if (!Number.isSafeInteger(value) || value < 0) {
|
|
430
416
|
throw new Error(`invalid varint value: ${value}`);
|
|
431
417
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
}
|
|
435
|
-
const bytes = [];
|
|
418
|
+
const bytes = new Uint8Array(10);
|
|
419
|
+
let length = 0;
|
|
436
420
|
let current = value;
|
|
437
421
|
while (current >= 128) {
|
|
438
|
-
bytes
|
|
422
|
+
bytes[length] = (current % 128) + 128;
|
|
423
|
+
length += 1;
|
|
439
424
|
current = Math.floor(current / 128);
|
|
440
425
|
}
|
|
441
|
-
bytes
|
|
442
|
-
|
|
426
|
+
bytes[length] = current;
|
|
427
|
+
length += 1;
|
|
428
|
+
return bytes.subarray(0, length);
|
|
443
429
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WA_APP_STATE_CHAT_MUTATION_SPECS = exports.
|
|
3
|
+
exports.WA_APP_STATE_CHAT_MUTATION_SPECS = exports.WA_APP_STATE_KDF_INFO = exports.WA_APP_STATE_KEY_TYPES = exports.WA_APP_STATE_SYNC_DATA_TYPE = exports.WA_APP_STATE_ERROR_CODES = exports.WA_APP_STATE_COLLECTION_STATES = exports.WA_APP_STATE_COLLECTIONS = void 0;
|
|
4
4
|
exports.WA_APP_STATE_COLLECTIONS = Object.freeze({
|
|
5
5
|
REGULAR: 'regular',
|
|
6
6
|
REGULAR_LOW: 'regular_low',
|
|
@@ -35,61 +35,30 @@ exports.WA_APP_STATE_KDF_INFO = Object.freeze({
|
|
|
35
35
|
MUTATION_KEYS: 'WhatsApp Mutation Keys',
|
|
36
36
|
PATCH_INTEGRITY: 'WhatsApp Patch Integrity'
|
|
37
37
|
});
|
|
38
|
-
exports.WA_APP_STATE_CHAT_MUTATION_ACTIONS = Object.freeze({
|
|
39
|
-
STAR: 'star',
|
|
40
|
-
MUTE: 'mute',
|
|
41
|
-
PIN: 'pin_v1',
|
|
42
|
-
ARCHIVE: 'archive',
|
|
43
|
-
DELETE_MESSAGE_FOR_ME: 'deleteMessageForMe',
|
|
44
|
-
MARK_CHAT_AS_READ: 'markChatAsRead',
|
|
45
|
-
CLEAR_CHAT: 'clearChat',
|
|
46
|
-
DELETE_CHAT: 'deleteChat',
|
|
47
|
-
LOCK_CHAT: 'lock'
|
|
48
|
-
});
|
|
49
38
|
exports.WA_APP_STATE_CHAT_MUTATION_SPECS = Object.freeze({
|
|
50
|
-
STAR: {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
MUTE: {
|
|
56
|
-
collection: exports.WA_APP_STATE_COLLECTIONS.REGULAR_HIGH,
|
|
57
|
-
action: exports.WA_APP_STATE_CHAT_MUTATION_ACTIONS.MUTE,
|
|
58
|
-
version: 2
|
|
59
|
-
},
|
|
60
|
-
PIN: {
|
|
61
|
-
collection: exports.WA_APP_STATE_COLLECTIONS.REGULAR_LOW,
|
|
62
|
-
action: exports.WA_APP_STATE_CHAT_MUTATION_ACTIONS.PIN,
|
|
63
|
-
version: 5
|
|
64
|
-
},
|
|
65
|
-
ARCHIVE: {
|
|
66
|
-
collection: exports.WA_APP_STATE_COLLECTIONS.REGULAR_LOW,
|
|
67
|
-
action: exports.WA_APP_STATE_CHAT_MUTATION_ACTIONS.ARCHIVE,
|
|
68
|
-
version: 3
|
|
69
|
-
},
|
|
39
|
+
STAR: { collection: exports.WA_APP_STATE_COLLECTIONS.REGULAR_HIGH, action: 'star', version: 2 },
|
|
40
|
+
MUTE: { collection: exports.WA_APP_STATE_COLLECTIONS.REGULAR_HIGH, action: 'mute', version: 2 },
|
|
41
|
+
PIN: { collection: exports.WA_APP_STATE_COLLECTIONS.REGULAR_LOW, action: 'pin_v1', version: 5 },
|
|
42
|
+
ARCHIVE: { collection: exports.WA_APP_STATE_COLLECTIONS.REGULAR_LOW, action: 'archive', version: 3 },
|
|
70
43
|
DELETE_MESSAGE_FOR_ME: {
|
|
71
44
|
collection: exports.WA_APP_STATE_COLLECTIONS.REGULAR_HIGH,
|
|
72
|
-
action:
|
|
45
|
+
action: 'deleteMessageForMe',
|
|
73
46
|
version: 3
|
|
74
47
|
},
|
|
75
48
|
MARK_CHAT_AS_READ: {
|
|
76
49
|
collection: exports.WA_APP_STATE_COLLECTIONS.REGULAR_LOW,
|
|
77
|
-
action:
|
|
50
|
+
action: 'markChatAsRead',
|
|
78
51
|
version: 3
|
|
79
52
|
},
|
|
80
53
|
CLEAR_CHAT: {
|
|
81
54
|
collection: exports.WA_APP_STATE_COLLECTIONS.REGULAR_HIGH,
|
|
82
|
-
action:
|
|
55
|
+
action: 'clearChat',
|
|
83
56
|
version: 6
|
|
84
57
|
},
|
|
85
58
|
DELETE_CHAT: {
|
|
86
59
|
collection: exports.WA_APP_STATE_COLLECTIONS.REGULAR_HIGH,
|
|
87
|
-
action:
|
|
60
|
+
action: 'deleteChat',
|
|
88
61
|
version: 6
|
|
89
62
|
},
|
|
90
|
-
LOCK_CHAT: {
|
|
91
|
-
collection: exports.WA_APP_STATE_COLLECTIONS.REGULAR_LOW,
|
|
92
|
-
action: exports.WA_APP_STATE_CHAT_MUTATION_ACTIONS.LOCK_CHAT,
|
|
93
|
-
version: 7
|
|
94
|
-
}
|
|
63
|
+
LOCK_CHAT: { collection: exports.WA_APP_STATE_COLLECTIONS.REGULAR_LOW, action: 'lock', version: 7 }
|
|
95
64
|
});
|
package/dist/protocol/browser.js
CHANGED
|
@@ -23,23 +23,15 @@ exports.WA_COMPANION_PLATFORM_IDS = Object.freeze({
|
|
|
23
23
|
UWP: '8',
|
|
24
24
|
OTHER_WEB_CLIENT: '9'
|
|
25
25
|
});
|
|
26
|
+
const BROWSER_TO_PLATFORM_ID = {
|
|
27
|
+
[exports.WA_BROWSERS.CHROME]: exports.WA_COMPANION_PLATFORM_IDS.CHROME,
|
|
28
|
+
[exports.WA_BROWSERS.FIREFOX]: exports.WA_COMPANION_PLATFORM_IDS.FIREFOX,
|
|
29
|
+
[exports.WA_BROWSERS.IE]: exports.WA_COMPANION_PLATFORM_IDS.IE,
|
|
30
|
+
[exports.WA_BROWSERS.OPERA]: exports.WA_COMPANION_PLATFORM_IDS.OPERA,
|
|
31
|
+
[exports.WA_BROWSERS.SAFARI]: exports.WA_COMPANION_PLATFORM_IDS.SAFARI,
|
|
32
|
+
[exports.WA_BROWSERS.EDGE]: exports.WA_COMPANION_PLATFORM_IDS.EDGE
|
|
33
|
+
};
|
|
26
34
|
function getWaCompanionPlatformId(browser) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
case exports.WA_BROWSERS.CHROME:
|
|
30
|
-
return exports.WA_COMPANION_PLATFORM_IDS.CHROME;
|
|
31
|
-
case exports.WA_BROWSERS.FIREFOX:
|
|
32
|
-
return exports.WA_COMPANION_PLATFORM_IDS.FIREFOX;
|
|
33
|
-
case exports.WA_BROWSERS.IE:
|
|
34
|
-
return exports.WA_COMPANION_PLATFORM_IDS.IE;
|
|
35
|
-
case exports.WA_BROWSERS.OPERA:
|
|
36
|
-
return exports.WA_COMPANION_PLATFORM_IDS.OPERA;
|
|
37
|
-
case exports.WA_BROWSERS.SAFARI:
|
|
38
|
-
return exports.WA_COMPANION_PLATFORM_IDS.SAFARI;
|
|
39
|
-
case exports.WA_BROWSERS.EDGE:
|
|
40
|
-
return exports.WA_COMPANION_PLATFORM_IDS.EDGE;
|
|
41
|
-
case exports.WA_BROWSERS.CHROMIUM:
|
|
42
|
-
default:
|
|
43
|
-
return exports.WA_COMPANION_PLATFORM_IDS.OTHER_WEB_CLIENT;
|
|
44
|
-
}
|
|
35
|
+
return (BROWSER_TO_PLATFORM_ID[browser.trim().toLowerCase()] ??
|
|
36
|
+
exports.WA_COMPANION_PLATFORM_IDS.OTHER_WEB_CLIENT);
|
|
45
37
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.WA_GROUP_PARTICIPANT_TYPES = exports.WA_DEFAULTS = exports.WA_PRIVACY_VALUES = exports.WA_PRIVACY_TAGS = exports.WA_PRIVACY_SETTING_TO_CATEGORY = exports.WA_PRIVACY_DISALLOWED_LIST_CATEGORIES = exports.WA_PRIVACY_CATEGORY_TO_SETTING = exports.WA_PRIVACY_CATEGORIES = exports.WA_TC_TOKEN_DEFAULTS = exports.WA_PRIVACY_TOKEN_TYPES = exports.WA_PRIVACY_TOKEN_TAGS = exports.WA_PRIVACY_TOKEN_NOTIFICATION_TYPE = exports.WA_NOTIFICATION_TYPES = exports.WA_GROUP_NOTIFICATION_TAGS = exports.WA_SUPPORTED_DIRTY_TYPES = exports.WA_DIRTY_TYPES = exports.WA_DIRTY_PROTOCOLS = exports.WA_ACCOUNT_SYNC_PROTOCOLS = exports.WA_PREVIEW_MEDIA_HKDF_INFO = exports.WA_MEDIA_HKDF_INFO = exports.getWaMediaHkdfInfo = exports.WA_APP_STATE_SYNC_DATA_TYPE = exports.WA_APP_STATE_KEY_TYPES = exports.WA_APP_STATE_KDF_INFO = exports.WA_APP_STATE_ERROR_CODES = exports.WA_APP_STATE_CHAT_MUTATION_SPECS = exports.WA_APP_STATE_COLLECTION_STATES = exports.WA_APP_STATE_COLLECTIONS = exports.WA_STANZA_MSG_TYPES = exports.WA_RETRYABLE_ACK_CODES = exports.WA_POLL_META_TYPES = exports.WA_MESSAGE_TYPES = exports.WA_MESSAGE_TAGS = exports.WA_EVENT_META_TYPES = exports.WA_ENC_MEDIA_TYPES = exports.WA_EDIT_ATTRS = exports.WA_XMLNS = exports.WA_NODE_TAGS = exports.WA_IQ_TYPES = exports.WA_STREAM_SIGNALING = exports.WA_READY_STATES = exports.WA_LOGOUT_REASONS = exports.WA_FAILURE_REASONS = exports.WA_DISCONNECT_REASONS = exports.WA_CONNECTION_REASONS = exports.WA_PAIRING_KDF_INFO = exports.WA_SIGNALING = exports.WA_COMPANION_PLATFORM_IDS = exports.WA_BROWSERS = exports.getWaCompanionPlatformId = void 0;
|
|
4
|
+
exports.WA_USYNC_MODES = exports.WA_USYNC_DEFAULTS = exports.WA_USYNC_CONTEXTS = void 0;
|
|
4
5
|
var browser_1 = require("./browser");
|
|
5
6
|
Object.defineProperty(exports, "getWaCompanionPlatformId", { enumerable: true, get: function () { return browser_1.getWaCompanionPlatformId; } });
|
|
6
7
|
Object.defineProperty(exports, "WA_BROWSERS", { enumerable: true, get: function () { return browser_1.WA_BROWSERS; } });
|
|
@@ -9,7 +10,9 @@ var auth_1 = require("./auth");
|
|
|
9
10
|
Object.defineProperty(exports, "WA_SIGNALING", { enumerable: true, get: function () { return auth_1.WA_SIGNALING; } });
|
|
10
11
|
Object.defineProperty(exports, "WA_PAIRING_KDF_INFO", { enumerable: true, get: function () { return auth_1.WA_PAIRING_KDF_INFO; } });
|
|
11
12
|
var stream_1 = require("./stream");
|
|
13
|
+
Object.defineProperty(exports, "WA_CONNECTION_REASONS", { enumerable: true, get: function () { return stream_1.WA_CONNECTION_REASONS; } });
|
|
12
14
|
Object.defineProperty(exports, "WA_DISCONNECT_REASONS", { enumerable: true, get: function () { return stream_1.WA_DISCONNECT_REASONS; } });
|
|
15
|
+
Object.defineProperty(exports, "WA_FAILURE_REASONS", { enumerable: true, get: function () { return stream_1.WA_FAILURE_REASONS; } });
|
|
13
16
|
Object.defineProperty(exports, "WA_LOGOUT_REASONS", { enumerable: true, get: function () { return stream_1.WA_LOGOUT_REASONS; } });
|
|
14
17
|
Object.defineProperty(exports, "WA_READY_STATES", { enumerable: true, get: function () { return stream_1.WA_READY_STATES; } });
|
|
15
18
|
Object.defineProperty(exports, "WA_STREAM_SIGNALING", { enumerable: true, get: function () { return stream_1.WA_STREAM_SIGNALING; } });
|
|
@@ -18,13 +21,17 @@ Object.defineProperty(exports, "WA_IQ_TYPES", { enumerable: true, get: function
|
|
|
18
21
|
Object.defineProperty(exports, "WA_NODE_TAGS", { enumerable: true, get: function () { return nodes_1.WA_NODE_TAGS; } });
|
|
19
22
|
Object.defineProperty(exports, "WA_XMLNS", { enumerable: true, get: function () { return nodes_1.WA_XMLNS; } });
|
|
20
23
|
var message_1 = require("./message");
|
|
24
|
+
Object.defineProperty(exports, "WA_EDIT_ATTRS", { enumerable: true, get: function () { return message_1.WA_EDIT_ATTRS; } });
|
|
25
|
+
Object.defineProperty(exports, "WA_ENC_MEDIA_TYPES", { enumerable: true, get: function () { return message_1.WA_ENC_MEDIA_TYPES; } });
|
|
26
|
+
Object.defineProperty(exports, "WA_EVENT_META_TYPES", { enumerable: true, get: function () { return message_1.WA_EVENT_META_TYPES; } });
|
|
21
27
|
Object.defineProperty(exports, "WA_MESSAGE_TAGS", { enumerable: true, get: function () { return message_1.WA_MESSAGE_TAGS; } });
|
|
22
28
|
Object.defineProperty(exports, "WA_MESSAGE_TYPES", { enumerable: true, get: function () { return message_1.WA_MESSAGE_TYPES; } });
|
|
29
|
+
Object.defineProperty(exports, "WA_POLL_META_TYPES", { enumerable: true, get: function () { return message_1.WA_POLL_META_TYPES; } });
|
|
23
30
|
Object.defineProperty(exports, "WA_RETRYABLE_ACK_CODES", { enumerable: true, get: function () { return message_1.WA_RETRYABLE_ACK_CODES; } });
|
|
31
|
+
Object.defineProperty(exports, "WA_STANZA_MSG_TYPES", { enumerable: true, get: function () { return message_1.WA_STANZA_MSG_TYPES; } });
|
|
24
32
|
var appstate_1 = require("./appstate");
|
|
25
33
|
Object.defineProperty(exports, "WA_APP_STATE_COLLECTIONS", { enumerable: true, get: function () { return appstate_1.WA_APP_STATE_COLLECTIONS; } });
|
|
26
34
|
Object.defineProperty(exports, "WA_APP_STATE_COLLECTION_STATES", { enumerable: true, get: function () { return appstate_1.WA_APP_STATE_COLLECTION_STATES; } });
|
|
27
|
-
Object.defineProperty(exports, "WA_APP_STATE_CHAT_MUTATION_ACTIONS", { enumerable: true, get: function () { return appstate_1.WA_APP_STATE_CHAT_MUTATION_ACTIONS; } });
|
|
28
35
|
Object.defineProperty(exports, "WA_APP_STATE_CHAT_MUTATION_SPECS", { enumerable: true, get: function () { return appstate_1.WA_APP_STATE_CHAT_MUTATION_SPECS; } });
|
|
29
36
|
Object.defineProperty(exports, "WA_APP_STATE_ERROR_CODES", { enumerable: true, get: function () { return appstate_1.WA_APP_STATE_ERROR_CODES; } });
|
|
30
37
|
Object.defineProperty(exports, "WA_APP_STATE_KDF_INFO", { enumerable: true, get: function () { return appstate_1.WA_APP_STATE_KDF_INFO; } });
|
|
@@ -42,6 +49,18 @@ Object.defineProperty(exports, "WA_SUPPORTED_DIRTY_TYPES", { enumerable: true, g
|
|
|
42
49
|
var notification_1 = require("./notification");
|
|
43
50
|
Object.defineProperty(exports, "WA_GROUP_NOTIFICATION_TAGS", { enumerable: true, get: function () { return notification_1.WA_GROUP_NOTIFICATION_TAGS; } });
|
|
44
51
|
Object.defineProperty(exports, "WA_NOTIFICATION_TYPES", { enumerable: true, get: function () { return notification_1.WA_NOTIFICATION_TYPES; } });
|
|
52
|
+
var privacy_token_1 = require("./privacy-token");
|
|
53
|
+
Object.defineProperty(exports, "WA_PRIVACY_TOKEN_NOTIFICATION_TYPE", { enumerable: true, get: function () { return privacy_token_1.WA_PRIVACY_TOKEN_NOTIFICATION_TYPE; } });
|
|
54
|
+
Object.defineProperty(exports, "WA_PRIVACY_TOKEN_TAGS", { enumerable: true, get: function () { return privacy_token_1.WA_PRIVACY_TOKEN_TAGS; } });
|
|
55
|
+
Object.defineProperty(exports, "WA_PRIVACY_TOKEN_TYPES", { enumerable: true, get: function () { return privacy_token_1.WA_PRIVACY_TOKEN_TYPES; } });
|
|
56
|
+
Object.defineProperty(exports, "WA_TC_TOKEN_DEFAULTS", { enumerable: true, get: function () { return privacy_token_1.WA_TC_TOKEN_DEFAULTS; } });
|
|
57
|
+
var privacy_1 = require("./privacy");
|
|
58
|
+
Object.defineProperty(exports, "WA_PRIVACY_CATEGORIES", { enumerable: true, get: function () { return privacy_1.WA_PRIVACY_CATEGORIES; } });
|
|
59
|
+
Object.defineProperty(exports, "WA_PRIVACY_CATEGORY_TO_SETTING", { enumerable: true, get: function () { return privacy_1.WA_PRIVACY_CATEGORY_TO_SETTING; } });
|
|
60
|
+
Object.defineProperty(exports, "WA_PRIVACY_DISALLOWED_LIST_CATEGORIES", { enumerable: true, get: function () { return privacy_1.WA_PRIVACY_DISALLOWED_LIST_CATEGORIES; } });
|
|
61
|
+
Object.defineProperty(exports, "WA_PRIVACY_SETTING_TO_CATEGORY", { enumerable: true, get: function () { return privacy_1.WA_PRIVACY_SETTING_TO_CATEGORY; } });
|
|
62
|
+
Object.defineProperty(exports, "WA_PRIVACY_TAGS", { enumerable: true, get: function () { return privacy_1.WA_PRIVACY_TAGS; } });
|
|
63
|
+
Object.defineProperty(exports, "WA_PRIVACY_VALUES", { enumerable: true, get: function () { return privacy_1.WA_PRIVACY_VALUES; } });
|
|
45
64
|
var defaults_1 = require("./defaults");
|
|
46
65
|
Object.defineProperty(exports, "WA_DEFAULTS", { enumerable: true, get: function () { return defaults_1.WA_DEFAULTS; } });
|
|
47
66
|
var group_1 = require("./group");
|