@open-e2ee/signal-protocol-sdk 7.2.0 → 8.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/ADAPTERS.md +55 -8
- package/ARCHITECTURE.md +1 -0
- package/CHANGELOG.md +538 -0
- package/README.md +10 -6
- package/SECURITY.md +2 -2
- package/THIRD_PARTY_NOTICES.md +429 -0
- package/client/README.md +1 -2
- package/device/README.md +50 -19
- package/dist/client/client.d.ts +31 -5
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +151 -91
- package/dist/client/client.js.map +1 -1
- package/dist/client/event-hooks.d.ts.map +1 -1
- package/dist/client/event-hooks.js +2 -0
- package/dist/client/event-hooks.js.map +1 -1
- package/dist/client/files.d.ts.map +1 -1
- package/dist/client/files.js +19 -2
- package/dist/client/files.js.map +1 -1
- package/dist/client/headless.d.ts +1 -1
- package/dist/client/headless.js +1 -1
- package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -1
- package/dist/client/hosted-anonymous-delivery.js +2 -1
- package/dist/client/hosted-anonymous-delivery.js.map +1 -1
- package/dist/client/hosted-connection.d.ts +1 -1
- package/dist/client/hosted-connection.d.ts.map +1 -1
- package/dist/client/hosted-connection.js +8 -12
- package/dist/client/hosted-connection.js.map +1 -1
- package/dist/client/hosted-group-authority.d.ts.map +1 -1
- package/dist/client/hosted-group-authority.js +2 -1
- package/dist/client/hosted-group-authority.js.map +1 -1
- package/dist/client/hosted-groups.d.ts.map +1 -1
- package/dist/client/hosted-groups.js +2 -1
- package/dist/client/hosted-groups.js.map +1 -1
- package/dist/client/hosted-push.d.ts.map +1 -1
- package/dist/client/hosted-push.js +2 -1
- package/dist/client/hosted-push.js.map +1 -1
- package/dist/client/hosted-transport.d.ts +9 -0
- package/dist/client/hosted-transport.d.ts.map +1 -1
- package/dist/client/hosted-transport.js +59 -24
- package/dist/client/hosted-transport.js.map +1 -1
- package/dist/client/hosted-trust.d.ts +11 -11
- package/dist/client/hosted-trust.d.ts.map +1 -1
- package/dist/client/hosted-trust.js +12 -12
- package/dist/client/hosted-trust.js.map +1 -1
- package/dist/client/messages.d.ts.map +1 -1
- package/dist/client/messages.js +6 -1
- package/dist/client/messages.js.map +1 -1
- package/dist/client/multi-device.d.ts.map +1 -1
- package/dist/client/multi-device.js +2 -1
- package/dist/client/multi-device.js.map +1 -1
- package/dist/client/relay-work.d.ts +30 -0
- package/dist/client/relay-work.d.ts.map +1 -0
- package/dist/client/relay-work.js +189 -0
- package/dist/client/relay-work.js.map +1 -0
- package/dist/client/retry.d.ts.map +1 -1
- package/dist/client/retry.js +2 -0
- package/dist/client/retry.js.map +1 -1
- package/dist/client/sessions.d.ts.map +1 -1
- package/dist/client/sessions.js +3 -0
- package/dist/client/sessions.js.map +1 -1
- package/dist/client/signal-service-cipher.d.ts +19 -11
- package/dist/client/signal-service-cipher.d.ts.map +1 -1
- package/dist/client/signal-service-cipher.js +48 -46
- package/dist/client/signal-service-cipher.js.map +1 -1
- package/dist/client/state.d.ts +8 -0
- package/dist/client/state.d.ts.map +1 -1
- package/dist/client/state.js +11 -0
- package/dist/client/state.js.map +1 -1
- package/dist/device/connection.d.ts +1 -1
- package/dist/device/connection.d.ts.map +1 -1
- package/dist/device/connection.js +4 -11
- package/dist/device/connection.js.map +1 -1
- package/dist/device/device-id.d.ts +10 -4
- package/dist/device/device-id.d.ts.map +1 -1
- package/dist/device/device-id.js +15 -9
- package/dist/device/device-id.js.map +1 -1
- package/dist/device/device-name-crypto.d.ts.map +1 -1
- package/dist/device/device-name-crypto.js +2 -2
- package/dist/device/device-name-crypto.js.map +1 -1
- package/dist/device/expo/index.d.ts +25 -8
- package/dist/device/expo/index.d.ts.map +1 -1
- package/dist/device/expo/index.js +58 -8
- package/dist/device/expo/index.js.map +1 -1
- package/dist/device/index.d.ts +2 -2
- package/dist/device/index.d.ts.map +1 -1
- package/dist/device/index.js +3 -2
- package/dist/device/index.js.map +1 -1
- package/dist/device/lifecycle/index.d.ts +4 -2
- package/dist/device/lifecycle/index.d.ts.map +1 -1
- package/dist/device/lifecycle/index.js.map +1 -1
- package/dist/device/lifecycle/manager.d.ts +12 -14
- package/dist/device/lifecycle/manager.d.ts.map +1 -1
- package/dist/device/lifecycle/manager.js +52 -97
- package/dist/device/lifecycle/manager.js.map +1 -1
- package/dist/device/lifecycle/types.d.ts +26 -16
- package/dist/device/lifecycle/types.d.ts.map +1 -1
- package/dist/device/lifecycle/utils.d.ts +8 -4
- package/dist/device/lifecycle/utils.d.ts.map +1 -1
- package/dist/device/lifecycle/utils.js +12 -16
- package/dist/device/lifecycle/utils.js.map +1 -1
- package/dist/device/provisioning.d.ts.map +1 -1
- package/dist/device/provisioning.js +6 -8
- package/dist/device/provisioning.js.map +1 -1
- package/dist/device/react-native/index.d.ts +40 -0
- package/dist/device/react-native/index.d.ts.map +1 -0
- package/dist/device/react-native/index.js +74 -0
- package/dist/device/react-native/index.js.map +1 -0
- package/dist/device/transfer.d.ts +15 -7
- package/dist/device/transfer.d.ts.map +1 -1
- package/dist/device/transfer.js +30 -22
- package/dist/device/transfer.js.map +1 -1
- package/dist/device/types.d.ts +15 -7
- package/dist/device/types.d.ts.map +1 -1
- package/dist/device/types.js.map +1 -1
- package/dist/device/vault-text.d.ts +13 -0
- package/dist/device/vault-text.d.ts.map +1 -0
- package/dist/device/vault-text.js +17 -0
- package/dist/device/vault-text.js.map +1 -0
- package/dist/index.d.ts +9 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/internal/crypto/index.d.ts +3 -3
- package/dist/internal/crypto/index.d.ts.map +1 -1
- package/dist/internal/crypto/index.js +3 -3
- package/dist/internal/crypto/index.js.map +1 -1
- package/dist/internal/crypto/random-host.d.ts +1 -1
- package/dist/internal/crypto/random-host.d.ts.map +1 -1
- package/dist/internal/crypto/random-host.js +3 -2
- package/dist/internal/crypto/random-host.js.map +1 -1
- package/dist/internal/crypto/random-host.native.d.ts +6 -1
- package/dist/internal/crypto/random-host.native.d.ts.map +1 -1
- package/dist/internal/crypto/random-host.native.js +14 -10
- package/dist/internal/crypto/random-host.native.js.map +1 -1
- package/dist/internal/crypto/random-host.node.d.ts +1 -1
- package/dist/internal/crypto/random-host.node.d.ts.map +1 -1
- package/dist/internal/crypto/random-host.node.js +1 -1
- package/dist/internal/crypto/random-host.node.js.map +1 -1
- package/dist/internal/crypto/random.d.ts +12 -3
- package/dist/internal/crypto/random.d.ts.map +1 -1
- package/dist/internal/crypto/random.js +14 -3
- package/dist/internal/crypto/random.js.map +1 -1
- package/dist/internal/crypto/utils.d.ts.map +1 -1
- package/dist/internal/crypto/utils.js +10 -6
- package/dist/internal/crypto/utils.js.map +1 -1
- package/dist/internal/encoding/proto/primitives.d.ts +2 -0
- package/dist/internal/encoding/proto/primitives.d.ts.map +1 -1
- package/dist/internal/encoding/proto/primitives.js +2 -1
- package/dist/internal/encoding/proto/primitives.js.map +1 -1
- package/dist/internal/encoding/proto/signal-message.d.ts +1 -0
- package/dist/internal/encoding/proto/signal-message.d.ts.map +1 -1
- package/dist/internal/encoding/proto/signal-message.js +2 -1
- package/dist/internal/encoding/proto/signal-message.js.map +1 -1
- package/dist/internal/groups/authority-certificate.d.ts.map +1 -1
- package/dist/internal/groups/authority-certificate.js +2 -1
- package/dist/internal/groups/authority-certificate.js.map +1 -1
- package/dist/internal/groups/encrypted-state.d.ts.map +1 -1
- package/dist/internal/groups/encrypted-state.js +9 -7
- package/dist/internal/groups/encrypted-state.js.map +1 -1
- package/dist/internal/groups/invite-link.d.ts.map +1 -1
- package/dist/internal/groups/invite-link.js +2 -1
- package/dist/internal/groups/invite-link.js.map +1 -1
- package/dist/internal/groups/manager.d.ts.map +1 -1
- package/dist/internal/groups/manager.js +5 -5
- package/dist/internal/groups/manager.js.map +1 -1
- package/dist/internal/groups/sdk-store.d.ts.map +1 -1
- package/dist/internal/groups/sdk-store.js +4 -3
- package/dist/internal/groups/sdk-store.js.map +1 -1
- package/dist/internal/groups/server-engine.d.ts +6 -1
- package/dist/internal/groups/server-engine.d.ts.map +1 -1
- package/dist/internal/groups/server-engine.js +11 -15
- package/dist/internal/groups/server-engine.js.map +1 -1
- package/dist/internal/groups/wire.d.ts.map +1 -1
- package/dist/internal/groups/wire.js +2 -1
- package/dist/internal/groups/wire.js.map +1 -1
- package/dist/internal/platform/blob.d.ts +10 -0
- package/dist/internal/platform/blob.d.ts.map +1 -0
- package/dist/internal/platform/blob.js +30 -0
- package/dist/internal/platform/blob.js.map +1 -0
- package/dist/internal/platform/env.d.ts +13 -0
- package/dist/internal/platform/env.d.ts.map +1 -0
- package/dist/internal/platform/env.js +17 -0
- package/dist/internal/platform/env.js.map +1 -0
- package/dist/internal/platform/index.d.ts +5 -0
- package/dist/internal/platform/index.d.ts.map +1 -0
- package/dist/internal/platform/index.js +5 -0
- package/dist/internal/platform/index.js.map +1 -0
- package/dist/internal/platform/url.d.ts +72 -0
- package/dist/internal/platform/url.d.ts.map +1 -0
- package/dist/internal/platform/url.js +275 -0
- package/dist/internal/platform/url.js.map +1 -0
- package/dist/internal/platform/utf8.d.ts +28 -0
- package/dist/internal/platform/utf8.d.ts.map +1 -0
- package/dist/internal/platform/utf8.js +167 -0
- package/dist/internal/platform/utf8.js.map +1 -0
- package/dist/internal/protocol/sealed-sender/delivery-token.d.ts +1 -1
- package/dist/internal/protocol/sealed-sender/delivery-token.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/delivery-token.js +5 -10
- package/dist/internal/protocol/sealed-sender/delivery-token.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/proto/index.js +2 -4
- package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
- package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
- package/dist/internal/protocol/sender-keys/manager.js +4 -3
- package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.d.ts +4 -4
- package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.js +8 -10
- package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.js.map +1 -1
- package/dist/internal/protocol/username/hash.d.ts.map +1 -1
- package/dist/internal/protocol/username/hash.js +18 -3
- package/dist/internal/protocol/username/hash.js.map +1 -1
- package/dist/internal/protocol/username/link.d.ts.map +1 -1
- package/dist/internal/protocol/username/link.js +2 -1
- package/dist/internal/protocol/username/link.js.map +1 -1
- package/dist/internal/protocol/username/proof.d.ts.map +1 -1
- package/dist/internal/protocol/username/proof.js +2 -1
- package/dist/internal/protocol/username/proof.js.map +1 -1
- package/dist/internal/protocol/zk/credentials/attributes.d.ts.map +1 -1
- package/dist/internal/protocol/zk/credentials/attributes.js +2 -1
- package/dist/internal/protocol/zk/credentials/attributes.js.map +1 -1
- package/dist/internal/protocol/zk/credentials/credentials.d.ts.map +1 -1
- package/dist/internal/protocol/zk/credentials/credentials.js +8 -6
- package/dist/internal/protocol/zk/credentials/credentials.js.map +1 -1
- package/dist/internal/protocol/zk/credentials/presentation.d.ts.map +1 -1
- package/dist/internal/protocol/zk/credentials/presentation.js +19 -13
- package/dist/internal/protocol/zk/credentials/presentation.js.map +1 -1
- package/dist/internal/protocol/zk/groups/lizard.d.ts +8 -0
- package/dist/internal/protocol/zk/groups/lizard.d.ts.map +1 -1
- package/dist/internal/protocol/zk/groups/lizard.js +18 -5
- package/dist/internal/protocol/zk/groups/lizard.js.map +1 -1
- package/dist/internal/protocol/zk/groups/profile-key-commitment.d.ts.map +1 -1
- package/dist/internal/protocol/zk/groups/profile-key-commitment.js +7 -6
- package/dist/internal/protocol/zk/groups/profile-key-commitment.js.map +1 -1
- package/dist/internal/protocol/zk/groups/profile-key-encryption.d.ts.map +1 -1
- package/dist/internal/protocol/zk/groups/profile-key-encryption.js +3 -2
- package/dist/internal/protocol/zk/groups/profile-key-encryption.js.map +1 -1
- package/dist/internal/protocol/zk/groups/uid-encryption.d.ts.map +1 -1
- package/dist/internal/protocol/zk/groups/uid-encryption.js +3 -2
- package/dist/internal/protocol/zk/groups/uid-encryption.js.map +1 -1
- package/dist/internal/protocol/zk/proofs/point-multiplication.d.ts +53 -0
- package/dist/internal/protocol/zk/proofs/point-multiplication.d.ts.map +1 -0
- package/dist/internal/protocol/zk/proofs/point-multiplication.js +164 -0
- package/dist/internal/protocol/zk/proofs/point-multiplication.js.map +1 -0
- package/dist/internal/protocol/zk/proofs/sho.d.ts +1 -0
- package/dist/internal/protocol/zk/proofs/sho.d.ts.map +1 -1
- package/dist/internal/protocol/zk/proofs/sho.js.map +1 -1
- package/dist/internal/protocol/zk/proofs/statement.d.ts.map +1 -1
- package/dist/internal/protocol/zk/proofs/statement.js +11 -11
- package/dist/internal/protocol/zk/proofs/statement.js.map +1 -1
- package/dist/internal/sesame/device-registry.d.ts +16 -3
- package/dist/internal/sesame/device-registry.d.ts.map +1 -1
- package/dist/internal/sesame/device-registry.js +10 -7
- package/dist/internal/sesame/device-registry.js.map +1 -1
- package/dist/internal/sesame/index.d.ts +1 -1
- package/dist/internal/sesame/index.d.ts.map +1 -1
- package/dist/internal/sesame/manager.d.ts.map +1 -1
- package/dist/internal/sesame/manager.js +3 -2
- package/dist/internal/sesame/manager.js.map +1 -1
- package/dist/internal/session/index.d.ts +1 -2
- package/dist/internal/session/index.d.ts.map +1 -1
- package/dist/internal/session/index.js +1 -1
- package/dist/internal/session/index.js.map +1 -1
- package/dist/internal/session/validation.d.ts +0 -80
- package/dist/internal/session/validation.d.ts.map +1 -1
- package/dist/internal/session/validation.js +0 -134
- package/dist/internal/session/validation.js.map +1 -1
- package/dist/local/store/device-record.d.ts +18 -0
- package/dist/local/store/device-record.d.ts.map +1 -0
- package/dist/local/store/device-record.js +34 -0
- package/dist/local/store/device-record.js.map +1 -0
- package/dist/local/store/expo/adapter.d.ts +59 -238
- package/dist/local/store/expo/adapter.d.ts.map +1 -1
- package/dist/local/store/expo/adapter.js +83 -640
- package/dist/local/store/expo/adapter.js.map +1 -1
- package/dist/local/store/expo/driver.d.ts +16 -0
- package/dist/local/store/expo/driver.d.ts.map +1 -0
- package/dist/local/store/expo/driver.js +141 -0
- package/dist/local/store/expo/driver.js.map +1 -0
- package/dist/local/store/expo/index.d.ts +3 -12
- package/dist/local/store/expo/index.d.ts.map +1 -1
- package/dist/local/store/expo/index.js +1 -8
- package/dist/local/store/expo/index.js.map +1 -1
- package/dist/local/store/expo/maintenance.d.ts +3 -2
- package/dist/local/store/expo/maintenance.d.ts.map +1 -1
- package/dist/local/store/expo/maintenance.js +5 -34
- package/dist/local/store/expo/maintenance.js.map +1 -1
- package/dist/local/store/index.d.ts +11 -6
- package/dist/local/store/index.d.ts.map +1 -1
- package/dist/local/store/index.js +11 -6
- package/dist/local/store/index.js.map +1 -1
- package/dist/local/store/key-value/adapter.d.ts +326 -0
- package/dist/local/store/key-value/adapter.d.ts.map +1 -0
- package/dist/local/store/key-value/adapter.js +1472 -0
- package/dist/local/store/key-value/adapter.js.map +1 -0
- package/dist/local/store/{react-native → key-value}/backend-conformance.d.ts +6 -6
- package/dist/local/store/key-value/backend-conformance.d.ts.map +1 -0
- package/dist/local/store/{react-native → key-value}/backend-conformance.js +3 -3
- package/dist/local/store/key-value/backend-conformance.js.map +1 -0
- package/dist/local/store/key-value/batch.d.ts +41 -0
- package/dist/local/store/key-value/batch.d.ts.map +1 -0
- package/dist/local/store/key-value/batch.js +77 -0
- package/dist/local/store/key-value/batch.js.map +1 -0
- package/dist/local/store/key-value/device-record.d.ts +23 -0
- package/dist/local/store/key-value/device-record.d.ts.map +1 -0
- package/dist/local/store/key-value/device-record.js +33 -0
- package/dist/local/store/key-value/device-record.js.map +1 -0
- package/dist/local/store/key-value/index.d.ts +24 -0
- package/dist/local/store/key-value/index.d.ts.map +1 -0
- package/dist/local/store/key-value/index.js +8 -0
- package/dist/local/store/key-value/index.js.map +1 -0
- package/dist/local/store/key-value/realm/index.d.ts +83 -0
- package/dist/local/store/key-value/realm/index.d.ts.map +1 -0
- package/dist/local/store/key-value/realm/index.js +102 -0
- package/dist/local/store/key-value/realm/index.js.map +1 -0
- package/dist/local/store/{react-native → key-value}/storage.d.ts +6 -6
- package/dist/local/store/key-value/storage.d.ts.map +1 -0
- package/dist/local/store/key-value/storage.js.map +1 -0
- package/dist/local/store/key-value/transactional-backend.d.ts +50 -0
- package/dist/local/store/key-value/transactional-backend.d.ts.map +1 -0
- package/dist/local/store/key-value/transactional-backend.js +90 -0
- package/dist/local/store/key-value/transactional-backend.js.map +1 -0
- package/dist/local/store/key-value/value-key.d.ts +34 -0
- package/dist/local/store/key-value/value-key.d.ts.map +1 -0
- package/dist/local/store/key-value/value-key.js +83 -0
- package/dist/local/store/key-value/value-key.js.map +1 -0
- package/dist/local/store/memory/adapter.d.ts +8 -0
- package/dist/local/store/memory/adapter.d.ts.map +1 -1
- package/dist/local/store/memory/adapter.js +60 -75
- package/dist/local/store/memory/adapter.js.map +1 -1
- package/dist/local/store/node/adapter.d.ts +74 -130
- package/dist/local/store/node/adapter.d.ts.map +1 -1
- package/dist/local/store/node/adapter.js +83 -727
- package/dist/local/store/node/adapter.js.map +1 -1
- package/dist/local/store/node/index.d.ts +8 -6
- package/dist/local/store/node/index.d.ts.map +1 -1
- package/dist/local/store/node/index.js +3 -7
- package/dist/local/store/node/index.js.map +1 -1
- package/dist/local/store/node/maintenance.d.ts +5 -0
- package/dist/local/store/node/maintenance.d.ts.map +1 -0
- package/dist/local/store/node/maintenance.js +7 -0
- package/dist/local/store/node/maintenance.js.map +1 -0
- package/dist/local/store/node/owner-lock.d.ts +26 -0
- package/dist/local/store/node/owner-lock.d.ts.map +1 -0
- package/dist/local/store/node/owner-lock.js +88 -0
- package/dist/local/store/node/owner-lock.js.map +1 -0
- package/dist/local/store/react-native/adapter.d.ts +63 -274
- package/dist/local/store/react-native/adapter.d.ts.map +1 -1
- package/dist/local/store/react-native/adapter.js +80 -1406
- package/dist/local/store/react-native/adapter.js.map +1 -1
- package/dist/local/store/react-native/index.d.ts +7 -19
- package/dist/local/store/react-native/index.d.ts.map +1 -1
- package/dist/local/store/react-native/index.js +2 -7
- package/dist/local/store/react-native/index.js.map +1 -1
- package/dist/local/store/react-native/maintenance.d.ts +5 -0
- package/dist/local/store/react-native/maintenance.d.ts.map +1 -0
- package/dist/local/store/react-native/maintenance.js +7 -0
- package/dist/local/store/react-native/maintenance.js.map +1 -0
- package/dist/local/store/sqlite/better-sqlite3-multiple-ciphers-driver.d.ts +38 -0
- package/dist/local/store/sqlite/better-sqlite3-multiple-ciphers-driver.d.ts.map +1 -0
- package/dist/local/store/sqlite/better-sqlite3-multiple-ciphers-driver.js +196 -0
- package/dist/local/store/sqlite/better-sqlite3-multiple-ciphers-driver.js.map +1 -0
- package/dist/local/store/sqlite/database.d.ts +20 -0
- package/dist/local/store/sqlite/database.d.ts.map +1 -0
- package/dist/local/store/sqlite/database.js +41 -0
- package/dist/local/store/sqlite/database.js.map +1 -0
- package/dist/local/store/sqlite/driver.d.ts +138 -0
- package/dist/local/store/sqlite/driver.d.ts.map +1 -0
- package/dist/local/store/sqlite/driver.js +10 -0
- package/dist/local/store/sqlite/driver.js.map +1 -0
- package/dist/local/store/sqlite/encryption.d.ts +61 -0
- package/dist/local/store/sqlite/encryption.d.ts.map +1 -0
- package/dist/local/store/sqlite/encryption.js +98 -0
- package/dist/local/store/sqlite/encryption.js.map +1 -0
- package/dist/local/store/sqlite/errors.d.ts +70 -0
- package/dist/local/store/sqlite/errors.d.ts.map +1 -0
- package/dist/local/store/sqlite/errors.js +101 -0
- package/dist/local/store/sqlite/errors.js.map +1 -0
- package/dist/local/store/sqlite/executor.d.ts +22 -0
- package/dist/local/store/sqlite/executor.d.ts.map +1 -0
- package/dist/local/store/sqlite/executor.js +129 -0
- package/dist/local/store/sqlite/executor.js.map +1 -0
- package/dist/local/store/sqlite/index.d.ts +20 -0
- package/dist/local/store/sqlite/index.d.ts.map +1 -0
- package/dist/local/store/sqlite/index.js +18 -0
- package/dist/local/store/sqlite/index.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/account.d.ts +45 -0
- package/dist/local/store/sqlite/key-storage/account.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/account.js +125 -0
- package/dist/local/store/sqlite/key-storage/account.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/contact-identities.d.ts +19 -0
- package/dist/local/store/sqlite/key-storage/contact-identities.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/contact-identities.js +85 -0
- package/dist/local/store/sqlite/key-storage/contact-identities.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/context.d.ts +19 -0
- package/dist/local/store/sqlite/key-storage/context.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/context.js +18 -0
- package/dist/local/store/sqlite/key-storage/context.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/identity-keys.d.ts +18 -0
- package/dist/local/store/sqlite/key-storage/identity-keys.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/identity-keys.js +88 -0
- package/dist/local/store/sqlite/key-storage/identity-keys.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/index.d.ts +108 -0
- package/dist/local/store/sqlite/key-storage/index.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/index.js +241 -0
- package/dist/local/store/sqlite/key-storage/index.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/message-records.d.ts +41 -0
- package/dist/local/store/sqlite/key-storage/message-records.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/message-records.js +133 -0
- package/dist/local/store/sqlite/key-storage/message-records.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/metadata.d.ts +16 -0
- package/dist/local/store/sqlite/key-storage/metadata.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/metadata.js +53 -0
- package/dist/local/store/sqlite/key-storage/metadata.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/one-time-prekeys.d.ts +36 -0
- package/dist/local/store/sqlite/key-storage/one-time-prekeys.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/one-time-prekeys.js +129 -0
- package/dist/local/store/sqlite/key-storage/one-time-prekeys.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/session-trust.d.ts +10 -0
- package/dist/local/store/sqlite/key-storage/session-trust.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/session-trust.js +88 -0
- package/dist/local/store/sqlite/key-storage/session-trust.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/sessions.d.ts +50 -0
- package/dist/local/store/sqlite/key-storage/sessions.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/sessions.js +209 -0
- package/dist/local/store/sqlite/key-storage/sessions.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/signed-prekeys.d.ts +69 -0
- package/dist/local/store/sqlite/key-storage/signed-prekeys.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/signed-prekeys.js +219 -0
- package/dist/local/store/sqlite/key-storage/signed-prekeys.js.map +1 -0
- package/dist/local/store/sqlite/maintenance.d.ts +7 -0
- package/dist/local/store/sqlite/maintenance.d.ts.map +1 -0
- package/dist/local/store/sqlite/maintenance.js +32 -0
- package/dist/local/store/sqlite/maintenance.js.map +1 -0
- package/dist/local/store/sqlite/migrations.d.ts +31 -0
- package/dist/local/store/sqlite/migrations.d.ts.map +1 -0
- package/dist/local/store/sqlite/migrations.js +232 -0
- package/dist/local/store/sqlite/migrations.js.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/ec-one-time-prekey.d.ts +17 -22
- package/dist/local/store/sqlite/models/ec-one-time-prekey.d.ts.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/ec-one-time-prekey.js +61 -99
- package/dist/local/store/sqlite/models/ec-one-time-prekey.js.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/ec-signed-prekey.d.ts +22 -25
- package/dist/local/store/sqlite/models/ec-signed-prekey.d.ts.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/ec-signed-prekey.js +82 -128
- package/dist/local/store/sqlite/models/ec-signed-prekey.js.map +1 -0
- package/dist/local/store/sqlite/models/identity-key-id.d.ts.map +1 -0
- package/dist/local/store/sqlite/models/identity-key-id.js.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/index.d.ts +5 -5
- package/dist/local/store/sqlite/models/index.d.ts.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/index.js +12 -5
- package/dist/local/store/sqlite/models/index.js.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/kyber-one-time-prekey.d.ts +17 -20
- package/dist/local/store/sqlite/models/kyber-one-time-prekey.d.ts.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/kyber-one-time-prekey.js +65 -105
- package/dist/local/store/sqlite/models/kyber-one-time-prekey.js.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/kyber-prekey-used.d.ts +3 -3
- package/dist/local/store/sqlite/models/kyber-prekey-used.d.ts.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/kyber-prekey-used.js +13 -25
- package/dist/local/store/sqlite/models/kyber-prekey-used.js.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/kyber-prekey.d.ts +16 -19
- package/dist/local/store/sqlite/models/kyber-prekey.d.ts.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/kyber-prekey.js +67 -111
- package/dist/local/store/sqlite/models/kyber-prekey.js.map +1 -0
- package/dist/local/store/sqlite/models/local-identity.d.ts +51 -0
- package/dist/local/store/sqlite/models/local-identity.d.ts.map +1 -0
- package/dist/local/store/sqlite/models/local-identity.js +150 -0
- package/dist/local/store/sqlite/models/local-identity.js.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/message-record.d.ts +15 -44
- package/dist/local/store/sqlite/models/message-record.d.ts.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/message-record.js +43 -109
- package/dist/local/store/sqlite/models/message-record.js.map +1 -0
- package/dist/local/store/sqlite/models/recipient-identity.d.ts +21 -0
- package/dist/local/store/sqlite/models/recipient-identity.d.ts.map +1 -0
- package/dist/local/store/sqlite/models/recipient-identity.js +59 -0
- package/dist/local/store/sqlite/models/recipient-identity.js.map +1 -0
- package/dist/local/store/sqlite/models/replaced-prekeys.d.ts +23 -0
- package/dist/local/store/sqlite/models/replaced-prekeys.d.ts.map +1 -0
- package/dist/local/store/sqlite/models/replaced-prekeys.js +42 -0
- package/dist/local/store/sqlite/models/replaced-prekeys.js.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/sender-key.d.ts +22 -23
- package/dist/local/store/sqlite/models/sender-key.d.ts.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/sender-key.js +66 -94
- package/dist/local/store/sqlite/models/sender-key.js.map +1 -0
- package/dist/local/store/sqlite/models/sesame-user-record.d.ts +32 -0
- package/dist/local/store/sqlite/models/sesame-user-record.d.ts.map +1 -0
- package/dist/local/store/sqlite/models/sesame-user-record.js +78 -0
- package/dist/local/store/sqlite/models/sesame-user-record.js.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/session.d.ts +24 -20
- package/dist/local/store/sqlite/models/session.d.ts.map +1 -0
- package/dist/local/store/{expo → sqlite}/models/session.js +54 -72
- package/dist/local/store/sqlite/models/session.js.map +1 -0
- package/dist/local/store/sqlite/models/skipped-sender-key.d.ts +24 -0
- package/dist/local/store/sqlite/models/skipped-sender-key.d.ts.map +1 -0
- package/dist/local/store/sqlite/models/skipped-sender-key.js +62 -0
- package/dist/local/store/sqlite/models/skipped-sender-key.js.map +1 -0
- package/dist/local/store/sqlite/op-sqlite-driver.d.ts +14 -0
- package/dist/local/store/sqlite/op-sqlite-driver.d.ts.map +1 -0
- package/dist/local/store/sqlite/op-sqlite-driver.js +180 -0
- package/dist/local/store/sqlite/op-sqlite-driver.js.map +1 -0
- package/dist/local/store/sqlite/open-store.d.ts +83 -0
- package/dist/local/store/sqlite/open-store.d.ts.map +1 -0
- package/dist/local/store/sqlite/open-store.js +177 -0
- package/dist/local/store/sqlite/open-store.js.map +1 -0
- package/dist/local/store/sqlite/schema.d.ts +102 -0
- package/dist/local/store/sqlite/schema.d.ts.map +1 -0
- package/dist/local/store/sqlite/schema.js +61 -0
- package/dist/local/store/sqlite/schema.js.map +1 -0
- package/dist/local/store/sqlite/store.d.ts +199 -0
- package/dist/local/store/sqlite/store.d.ts.map +1 -0
- package/dist/local/store/sqlite/store.js +494 -0
- package/dist/local/store/sqlite/store.js.map +1 -0
- package/dist/local/store/sqlite/web/driver.d.ts +50 -0
- package/dist/local/store/sqlite/web/driver.d.ts.map +1 -0
- package/dist/local/store/sqlite/web/driver.js +171 -0
- package/dist/local/store/sqlite/web/driver.js.map +1 -0
- package/dist/local/store/sqlite/web/protocol.d.ts +80 -0
- package/dist/local/store/sqlite/web/protocol.d.ts.map +1 -0
- package/dist/local/store/sqlite/web/protocol.js +13 -0
- package/dist/local/store/sqlite/web/protocol.js.map +1 -0
- package/dist/local/store/sqlite/web/sqlite3mc/sqlite3.mjs +14526 -0
- package/dist/local/store/sqlite/web/sqlite3mc/sqlite3.wasm +0 -0
- package/dist/local/store/sqlite/web/worker.d.ts +39 -0
- package/dist/local/store/sqlite/web/worker.d.ts.map +1 -0
- package/dist/local/store/sqlite/web/worker.js +646 -0
- package/dist/local/store/sqlite/web/worker.js.map +1 -0
- package/dist/local/store/web/adapter.d.ts +5 -14
- package/dist/local/store/web/adapter.d.ts.map +1 -1
- package/dist/local/store/web/adapter.js +119 -106
- package/dist/local/store/web/adapter.js.map +1 -1
- package/dist/local/store/web/device-record.d.ts +23 -0
- package/dist/local/store/web/device-record.d.ts.map +1 -0
- package/dist/local/store/web/device-record.js +31 -0
- package/dist/local/store/web/device-record.js.map +1 -0
- package/dist/local/store/web-sqlite/adapter.d.ts +101 -0
- package/dist/local/store/web-sqlite/adapter.d.ts.map +1 -0
- package/dist/local/store/web-sqlite/adapter.js +154 -0
- package/dist/local/store/web-sqlite/adapter.js.map +1 -0
- package/dist/local/store/web-sqlite/index.d.ts +14 -0
- package/dist/local/store/web-sqlite/index.d.ts.map +1 -0
- package/dist/local/store/web-sqlite/index.js +3 -0
- package/dist/local/store/web-sqlite/index.js.map +1 -0
- package/dist/local/store/web-sqlite/maintenance.d.ts +5 -0
- package/dist/local/store/web-sqlite/maintenance.d.ts.map +1 -0
- package/dist/local/store/web-sqlite/maintenance.js +7 -0
- package/dist/local/store/web-sqlite/maintenance.js.map +1 -0
- package/dist/local/store/web-sqlite/store-locks.d.ts +33 -0
- package/dist/local/store/web-sqlite/store-locks.d.ts.map +1 -0
- package/dist/local/store/web-sqlite/store-locks.js +60 -0
- package/dist/local/store/web-sqlite/store-locks.js.map +1 -0
- package/dist/local/vault/electron-safe-storage.d.ts +45 -0
- package/dist/local/vault/electron-safe-storage.d.ts.map +1 -0
- package/dist/local/vault/electron-safe-storage.js +212 -0
- package/dist/local/vault/electron-safe-storage.js.map +1 -0
- package/dist/local/vault/index.d.ts +4 -2
- package/dist/local/vault/index.d.ts.map +1 -1
- package/dist/local/vault/indexed-db.d.ts +37 -0
- package/dist/local/vault/indexed-db.d.ts.map +1 -0
- package/dist/local/vault/indexed-db.js +102 -0
- package/dist/local/vault/indexed-db.js.map +1 -0
- package/dist/local/vault/react-native-keychain.d.ts +12 -0
- package/dist/local/vault/react-native-keychain.d.ts.map +1 -0
- package/dist/local/vault/react-native-keychain.js +71 -0
- package/dist/local/vault/react-native-keychain.js.map +1 -0
- package/dist/local/vault/require.d.ts +10 -0
- package/dist/local/vault/require.d.ts.map +1 -0
- package/dist/local/vault/require.js +16 -0
- package/dist/local/vault/require.js.map +1 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +2 -1
- package/dist/logger.js.map +1 -1
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +2 -1
- package/dist/media/index.js.map +1 -1
- package/dist/profile/contact-state.d.ts.map +1 -1
- package/dist/profile/contact-state.js +2 -4
- package/dist/profile/contact-state.js.map +1 -1
- package/dist/profile/index.d.ts +0 -1
- package/dist/profile/index.d.ts.map +1 -1
- package/dist/profile/index.js +0 -2
- package/dist/profile/index.js.map +1 -1
- package/dist/profile/profile-key.d.ts +16 -11
- package/dist/profile/profile-key.d.ts.map +1 -1
- package/dist/profile/profile-key.js +29 -29
- package/dist/profile/profile-key.js.map +1 -1
- package/dist/profile/update-service.d.ts +6 -0
- package/dist/profile/update-service.d.ts.map +1 -1
- package/dist/profile/update-service.js +3 -1
- package/dist/profile/update-service.js.map +1 -1
- package/dist/remote/object-store/validation.d.ts.map +1 -1
- package/dist/remote/object-store/validation.js +2 -1
- package/dist/remote/object-store/validation.js.map +1 -1
- package/dist/remote/relay/memory/adapter.d.ts +2 -3
- package/dist/remote/relay/memory/adapter.d.ts.map +1 -1
- package/dist/remote/relay/memory/adapter.js +22 -30
- package/dist/remote/relay/memory/adapter.js.map +1 -1
- package/dist/remote/relay/memory/failures.d.ts.map +1 -1
- package/dist/remote/relay/memory/failures.js +2 -1
- package/dist/remote/relay/memory/failures.js.map +1 -1
- package/dist/remote/relay/memory/group-server.d.ts +5 -1
- package/dist/remote/relay/memory/group-server.d.ts.map +1 -1
- package/dist/remote/relay/memory/group-server.js +11 -1
- package/dist/remote/relay/memory/group-server.js.map +1 -1
- package/dist/safety/url.d.ts.map +1 -1
- package/dist/safety/url.js +21 -26
- package/dist/safety/url.js.map +1 -1
- package/dist/types/api.d.ts +15 -2
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/errors.d.ts +97 -1
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +105 -1
- package/dist/types/errors.js.map +1 -1
- package/dist/types/session.d.ts.map +1 -1
- package/dist/types/session.js +2 -1
- package/dist/types/session.js.map +1 -1
- package/dist/utils/retry.d.ts +2 -0
- package/dist/utils/retry.d.ts.map +1 -1
- package/dist/utils/retry.js +4 -2
- package/dist/utils/retry.js.map +1 -1
- package/docs/ASSURANCE.md +84 -11
- package/docs/CLIENT_COMPOSITION.md +1 -2
- package/docs/DEVIATIONS.md +1 -1
- package/docs/ERROR_HANDLING.md +7 -1
- package/docs/GETTING_STARTED.md +1 -2
- package/docs/PACKAGE_SURFACE.md +32 -12
- package/docs/RECIPES.md +1 -2
- package/examples/browser/index.html +1 -1
- package/local/store/README.md +142 -42
- package/local/store/expo/README.md +67 -47
- package/local/store/key-value/README.md +278 -0
- package/local/store/node/README.md +206 -46
- package/local/store/react-native/README.md +120 -61
- package/local/store/web/README.md +14 -0
- package/local/store/web-sqlite/README.md +210 -0
- package/local/vault/README.md +115 -2
- package/package.json +42 -23
- package/profile/README.md +9 -11
- package/remote/README.md +1 -2
- package/dist/local/store/expo/database-key.d.ts +0 -142
- package/dist/local/store/expo/database-key.d.ts.map +0 -1
- package/dist/local/store/expo/database-key.js +0 -312
- package/dist/local/store/expo/database-key.js.map +0 -1
- package/dist/local/store/expo/db.d.ts +0 -95
- package/dist/local/store/expo/db.d.ts.map +0 -1
- package/dist/local/store/expo/db.js +0 -147
- package/dist/local/store/expo/db.js.map +0 -1
- package/dist/local/store/expo/key-storage.d.ts +0 -429
- package/dist/local/store/expo/key-storage.d.ts.map +0 -1
- package/dist/local/store/expo/key-storage.js +0 -1361
- package/dist/local/store/expo/key-storage.js.map +0 -1
- package/dist/local/store/expo/models/ec-one-time-prekey.d.ts.map +0 -1
- package/dist/local/store/expo/models/ec-one-time-prekey.js.map +0 -1
- package/dist/local/store/expo/models/ec-signed-prekey.d.ts.map +0 -1
- package/dist/local/store/expo/models/ec-signed-prekey.js.map +0 -1
- package/dist/local/store/expo/models/identity-key-id.d.ts.map +0 -1
- package/dist/local/store/expo/models/identity-key-id.js.map +0 -1
- package/dist/local/store/expo/models/index.d.ts.map +0 -1
- package/dist/local/store/expo/models/index.js.map +0 -1
- package/dist/local/store/expo/models/kyber-one-time-prekey.d.ts.map +0 -1
- package/dist/local/store/expo/models/kyber-one-time-prekey.js.map +0 -1
- package/dist/local/store/expo/models/kyber-prekey-used.d.ts.map +0 -1
- package/dist/local/store/expo/models/kyber-prekey-used.js.map +0 -1
- package/dist/local/store/expo/models/kyber-prekey.d.ts.map +0 -1
- package/dist/local/store/expo/models/kyber-prekey.js.map +0 -1
- package/dist/local/store/expo/models/local-identity.d.ts +0 -52
- package/dist/local/store/expo/models/local-identity.d.ts.map +0 -1
- package/dist/local/store/expo/models/local-identity.js +0 -166
- package/dist/local/store/expo/models/local-identity.js.map +0 -1
- package/dist/local/store/expo/models/message-record.d.ts.map +0 -1
- package/dist/local/store/expo/models/message-record.js.map +0 -1
- package/dist/local/store/expo/models/recipient-identity.d.ts +0 -21
- package/dist/local/store/expo/models/recipient-identity.d.ts.map +0 -1
- package/dist/local/store/expo/models/recipient-identity.js +0 -66
- package/dist/local/store/expo/models/recipient-identity.js.map +0 -1
- package/dist/local/store/expo/models/replaced-prekey-utils.d.ts +0 -33
- package/dist/local/store/expo/models/replaced-prekey-utils.d.ts.map +0 -1
- package/dist/local/store/expo/models/replaced-prekey-utils.js +0 -54
- package/dist/local/store/expo/models/replaced-prekey-utils.js.map +0 -1
- package/dist/local/store/expo/models/sender-key.d.ts.map +0 -1
- package/dist/local/store/expo/models/sender-key.js.map +0 -1
- package/dist/local/store/expo/models/session.d.ts.map +0 -1
- package/dist/local/store/expo/models/session.js.map +0 -1
- package/dist/local/store/expo/schema.d.ts +0 -1917
- package/dist/local/store/expo/schema.d.ts.map +0 -1
- package/dist/local/store/expo/schema.js +0 -197
- package/dist/local/store/expo/schema.js.map +0 -1
- package/dist/local/store/node/database-encryption.d.ts +0 -109
- package/dist/local/store/node/database-encryption.d.ts.map +0 -1
- package/dist/local/store/node/database-encryption.js +0 -202
- package/dist/local/store/node/database-encryption.js.map +0 -1
- package/dist/local/store/node/database-file-commit.d.ts +0 -8
- package/dist/local/store/node/database-file-commit.d.ts.map +0 -1
- package/dist/local/store/node/database-file-commit.js +0 -62
- package/dist/local/store/node/database-file-commit.js.map +0 -1
- package/dist/local/store/node/database-key.d.ts +0 -129
- package/dist/local/store/node/database-key.d.ts.map +0 -1
- package/dist/local/store/node/database-key.js +0 -293
- package/dist/local/store/node/database-key.js.map +0 -1
- package/dist/local/store/node/database-lock.d.ts +0 -8
- package/dist/local/store/node/database-lock.d.ts.map +0 -1
- package/dist/local/store/node/database-lock.js +0 -44
- package/dist/local/store/node/database-lock.js.map +0 -1
- package/dist/local/store/node/database.d.ts +0 -226
- package/dist/local/store/node/database.d.ts.map +0 -1
- package/dist/local/store/node/database.js +0 -813
- package/dist/local/store/node/database.js.map +0 -1
- package/dist/local/store/react-native/backend-conformance.d.ts.map +0 -1
- package/dist/local/store/react-native/backend-conformance.js.map +0 -1
- package/dist/local/store/react-native/reference-backend.d.ts +0 -43
- package/dist/local/store/react-native/reference-backend.d.ts.map +0 -1
- package/dist/local/store/react-native/reference-backend.js +0 -178
- package/dist/local/store/react-native/reference-backend.js.map +0 -1
- package/dist/local/store/react-native/storage.d.ts.map +0 -1
- package/dist/local/store/react-native/storage.js.map +0 -1
- package/dist/profile/storage.d.ts +0 -61
- package/dist/profile/storage.d.ts.map +0 -1
- package/dist/profile/storage.js +0 -145
- package/dist/profile/storage.js.map +0 -1
- /package/dist/local/store/{react-native → key-value}/storage.js +0 -0
- /package/dist/local/store/{expo → sqlite}/models/identity-key-id.d.ts +0 -0
- /package/dist/local/store/{expo → sqlite}/models/identity-key-id.js +0 -0
|
@@ -1,75 +1,235 @@
|
|
|
1
1
|
# Node Store
|
|
2
2
|
|
|
3
|
-
`NodeSignalProtocolStore`
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
prekeys, sessions, Kyber prekeys, Sesame device records, sender keys, and
|
|
8
|
-
message records. Multi-device and group flows therefore work in Node without a
|
|
9
|
-
custom adapter.
|
|
10
|
-
|
|
11
|
-
The class declares `implements SignalProtocolLocalStore`, so the compiler
|
|
12
|
-
rejects any build that omits a member or changes its signature. That check is
|
|
13
|
-
the guarantee behind this paragraph, not a manual audit.
|
|
3
|
+
`NodeSignalProtocolStore` implements `SignalProtocolLocalStore` for Node and
|
|
4
|
+
the Electron main process in an SDK-owned SQLCipher database. The database key
|
|
5
|
+
is held through the local secret-vault boundary, in the vault that the app
|
|
6
|
+
passes.
|
|
14
7
|
|
|
15
8
|
## Why it exists
|
|
16
9
|
|
|
17
|
-
Servers, command-line tools, and desktop
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
Servers, command-line tools, and desktop apps need persistent protocol state
|
|
11
|
+
without browser or mobile dependencies. The store keeps a small database key in
|
|
12
|
+
the vault and stores protocol records in an encrypted SQLite database. The SDK
|
|
13
|
+
owns that database: its file, its key, and its migrations.
|
|
20
14
|
|
|
21
|
-
##
|
|
15
|
+
## Setup
|
|
22
16
|
|
|
23
|
-
Install the
|
|
17
|
+
Install the peer `better-sqlite3-multiple-ciphers` 13.0.3 or later. The SDK
|
|
18
|
+
uses its SQLCipher cipher. Other entries do not load it.
|
|
24
19
|
|
|
25
20
|
```sh
|
|
26
|
-
npm install
|
|
21
|
+
npm install better-sqlite3-multiple-ciphers
|
|
27
22
|
```
|
|
28
23
|
|
|
29
|
-
|
|
30
|
-
supported-runtime checks on Node.js 22 and 26. Dependency upgrades must pass the
|
|
31
|
-
supported-runtime checks. Other adapters do not load this dependency.
|
|
32
|
-
If the native module or file locking is unavailable, the Node store refuses to open.
|
|
24
|
+
Open the store with one call:
|
|
33
25
|
|
|
34
26
|
<!-- doc-snippet:skip requires-external-context -->
|
|
27
|
+
|
|
35
28
|
```ts
|
|
36
|
-
import {
|
|
37
|
-
import { nodeStore } from "@open-e2ee/signal-protocol-sdk/local/store/node";
|
|
29
|
+
import { nodeStore } from '@open-e2ee/signal-protocol-sdk/local/store/node';
|
|
38
30
|
|
|
39
31
|
const storage = await nodeStore({
|
|
40
|
-
|
|
32
|
+
directory: '/var/lib/my-app/signal-protocol',
|
|
33
|
+
vault,
|
|
41
34
|
});
|
|
35
|
+
```
|
|
42
36
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
On first use, `nodeStore` creates the directory, readable only by the owner.
|
|
38
|
+
Then it creates a 32-byte database key, writes it to the vault, and creates the
|
|
39
|
+
database file. Each open applies the SDK migrations before it returns the
|
|
40
|
+
store. A file that a newer SDK wrote does not open (`INVALID_STATE`).
|
|
41
|
+
|
|
42
|
+
Options:
|
|
43
|
+
|
|
44
|
+
- `directory`: the directory of the database file. Use a private directory on
|
|
45
|
+
a local file system. Do not use a network file system.
|
|
46
|
+
- `vault`: the `SignalProtocolLocalSecretVault` that holds the database key.
|
|
47
|
+
Required. In Electron, use the safeStorage vault (see below).
|
|
48
|
+
- `name`: the database file name in `directory`. Letters, digits, `.`, `_`,
|
|
49
|
+
and `-` only, and no `.lock`, `-wal`, `-shm`, or `-journal` ending.
|
|
50
|
+
Default: `open-e2ee-signal-protocol.db`.
|
|
51
|
+
- `encryptionAtRest`: pass `false` to store the database without encryption.
|
|
52
|
+
The store then does not use the vault, and it logs a warning at each open. A
|
|
53
|
+
database created with one setting does not open with the other. Default:
|
|
54
|
+
`true`.
|
|
55
|
+
- `logger`: receives the warning of each open without encryption.
|
|
56
|
+
|
|
57
|
+
Keep application tables in a separate database file. The SDK database holds
|
|
58
|
+
only SDK tables.
|
|
59
|
+
|
|
60
|
+
## Electron
|
|
61
|
+
|
|
62
|
+
Use a supported Electron major: the Electron team supports the latest three
|
|
63
|
+
stable majors ([release timelines](https://www.electronjs.org/docs/latest/tutorial/electron-timelines)).
|
|
64
|
+
CI tests Electron 44 on Linux, macOS, and Windows. The binding uses Node-API,
|
|
65
|
+
so its prebuild loads in each supported major without a rebuild.
|
|
66
|
+
|
|
67
|
+
Open the store in the main process, with the vault over Electron's
|
|
68
|
+
`safeStorage`:
|
|
69
|
+
|
|
70
|
+
<!-- doc-snippet:skip requires-external-context -->
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
import { join } from 'node:path';
|
|
74
|
+
import { app, safeStorage } from 'electron';
|
|
75
|
+
import { nodeStore } from '@open-e2ee/signal-protocol-sdk/local/store/node';
|
|
76
|
+
import { ElectronSafeStorageSignalProtocolSecretVault } from '@open-e2ee/signal-protocol-sdk/local/vault/electron-safe-storage';
|
|
77
|
+
|
|
78
|
+
await app.whenReady();
|
|
79
|
+
const directory = join(app.getPath('userData'), 'signal-protocol');
|
|
80
|
+
const vault = new ElectronSafeStorageSignalProtocolSecretVault({
|
|
81
|
+
safeStorage,
|
|
82
|
+
file: join(app.getPath('userData'), 'signal-protocol-secrets.json'),
|
|
46
83
|
});
|
|
84
|
+
const storage = await nodeStore({ directory, vault });
|
|
47
85
|
```
|
|
48
86
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
87
|
+
The [vault guide](../../vault/README.md#electron-usage) covers the safeStorage
|
|
88
|
+
backends.
|
|
89
|
+
|
|
90
|
+
### Renderer
|
|
91
|
+
|
|
92
|
+
Do not open the store or the vault in a renderer or a preload script. Keep
|
|
93
|
+
the renderer defaults `contextIsolation: true`, `sandbox: true`, and
|
|
94
|
+
`nodeIntegration: false`. A renderer reaches the client through IPC:
|
|
95
|
+
|
|
96
|
+
- In the preload script, expose one function for each operation with
|
|
97
|
+
`contextBridge`. Do not expose `ipcRenderer`.
|
|
98
|
+
- In the main process, check the `senderFrame` of each IPC message before it
|
|
99
|
+
reaches the client.
|
|
100
|
+
|
|
101
|
+
See items 2, 3, 4, 17, and 20 of the
|
|
102
|
+
[security checklist](https://www.electronjs.org/docs/latest/tutorial/security).
|
|
103
|
+
|
|
104
|
+
### Utility process
|
|
105
|
+
|
|
106
|
+
The store can also run in a
|
|
107
|
+
[`utilityProcess`](https://www.electronjs.org/docs/latest/api/utility-process)
|
|
108
|
+
child. `safeStorage` is a main-process API, so the vault stays in the main
|
|
109
|
+
process:
|
|
110
|
+
|
|
111
|
+
1. In the main process, create a `MessageChannelMain`. Answer each
|
|
112
|
+
`getSecret`, `setSecret`, and `deleteSecret` request on one port with the
|
|
113
|
+
safeStorage vault.
|
|
114
|
+
2. Send the other port to the child with `child.postMessage(message, [port])`.
|
|
115
|
+
3. In the child, pass `nodeStore` a vault that sends each call over the port.
|
|
116
|
+
|
|
117
|
+
Only one process opens a database file (see [One owner](#one-owner)).
|
|
118
|
+
|
|
119
|
+
### Packaging
|
|
120
|
+
|
|
121
|
+
- **Unpack the binding.** The binding is a `.node` file. Electron loads a
|
|
122
|
+
`.node` file from an ASAR archive through a temporary copy, and the copy
|
|
123
|
+
stays after the app exits. With Electron Forge, add
|
|
124
|
+
`@electron-forge/plugin-auto-unpack-natives`. Without Forge, pack with
|
|
125
|
+
`asar pack app app.asar --unpack *.node`
|
|
126
|
+
([ASAR archives](https://www.electronjs.org/docs/latest/tutorial/asar-archives#adding-unpacked-files-to-asar-archives)).
|
|
127
|
+
- **Rebuild.** Electron Forge runs `@electron/rebuild`, which runs `node-gyp`
|
|
128
|
+
for each native module. That needs Python and a C++ toolchain. The Node-API
|
|
129
|
+
prebuild needs no rebuild. To package without a toolchain, set
|
|
130
|
+
`rebuildConfig: { ignoreModules: ['better-sqlite3-multiple-ciphers'] }` in
|
|
131
|
+
the Forge config.
|
|
132
|
+
- **Fuses.** Turn off the `RunAsNode`, `EnableNodeOptionsEnvironmentVariable`,
|
|
133
|
+
and `EnableNodeCliInspectArguments` fuses. When they are on, a process of
|
|
134
|
+
the same user can run code as the app, with `ELECTRON_RUN_AS_NODE` or
|
|
135
|
+
`--inspect`. Through `--inspect`, that code can decrypt the vault with
|
|
136
|
+
`safeStorage`. The Electron Forge templates turn them off
|
|
137
|
+
([fuses](https://www.electronjs.org/docs/latest/tutorial/fuses)).
|
|
138
|
+
- **macOS signature.** Sign the app after the fuses are flipped and the
|
|
139
|
+
package is complete. In an app whose signature is not valid, `safeStorage`
|
|
140
|
+
fails, and the store then fails with `KEY_STORAGE_ERROR`. Check the app with
|
|
141
|
+
`codesign --verify --deep --strict`. The
|
|
142
|
+
[vault guide](../../vault/README.md#electron-usage) covers the signing
|
|
143
|
+
identity.
|
|
144
|
+
|
|
145
|
+
## One owner
|
|
146
|
+
|
|
147
|
+
A store holds its database file until `close()`. Only one open store of a file
|
|
148
|
+
exists at a time:
|
|
149
|
+
|
|
150
|
+
- In the process that holds the file, an open or a reset of the same file
|
|
151
|
+
fails with `INVALID_STATE`. The opens and resets of a file run one at a time,
|
|
152
|
+
so two parallel first opens write one key, and the second open fails.
|
|
153
|
+
- Another process fails at once with `SqliteStoreInUseError`
|
|
154
|
+
(`KEY_STORAGE_ERROR`). It does not read the vault or touch the file.
|
|
155
|
+
|
|
156
|
+
The owner lock is the file `<name>.lock` beside the database. The operating
|
|
157
|
+
system releases it when the process exits, also after a crash. Do not delete
|
|
158
|
+
the lock file while a process can use the store. A reset keeps it.
|
|
159
|
+
|
|
160
|
+
## Lost key and reset
|
|
161
|
+
|
|
162
|
+
The vault slot of the key is `sqliteDatabaseKeySlot(path)`, where `path` is
|
|
163
|
+
the real path of the database file. It is `join(realpathSync.native(directory),
|
|
164
|
+
name)`, so a symbolic link to the directory opens the same store with the same
|
|
165
|
+
key.
|
|
166
|
+
|
|
167
|
+
When the database file exists and the vault holds no key for it, `nodeStore`
|
|
168
|
+
fails with `LOCAL_STORE_KEY_LOST` and changes nothing. A new key cannot read
|
|
169
|
+
the old file. Restore the vault entry, or call `resetNodeStore()`.
|
|
170
|
+
|
|
171
|
+
A move or a rename of the directory changes the path, and with it the slot. The
|
|
172
|
+
next open fails with `LOCAL_STORE_KEY_LOST`, and the file does not change. To
|
|
173
|
+
keep the store, move the secret to the slot of the new path before the open:
|
|
54
174
|
|
|
55
|
-
|
|
175
|
+
<!-- doc-snippet:skip requires-external-context -->
|
|
56
176
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
177
|
+
```ts
|
|
178
|
+
import { realpathSync } from 'node:fs';
|
|
179
|
+
import { join } from 'node:path';
|
|
180
|
+
import { sqliteDatabaseKeySlot } from '@open-e2ee/signal-protocol-sdk/local/store/node';
|
|
181
|
+
|
|
182
|
+
const name = 'open-e2ee-signal-protocol.db';
|
|
183
|
+
const from = sqliteDatabaseKeySlot(join(oldRealDirectory, name));
|
|
184
|
+
const to = sqliteDatabaseKeySlot(join(realpathSync.native(newDirectory), name));
|
|
185
|
+
const key = await vault.getSecret(from);
|
|
186
|
+
if (key) {
|
|
187
|
+
await vault.setSecret(to, key);
|
|
188
|
+
await vault.deleteSecret(from);
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
A file created with `encryptionAtRest: false` fails an open without that
|
|
193
|
+
option with `SqliteKeyMismatchError` (`KEY_STORAGE_ERROR`), not
|
|
194
|
+
`LOCAL_STORE_KEY_LOST`. Open it with the setting that created it.
|
|
195
|
+
|
|
196
|
+
`resetNodeStore()` deletes the database file, then writes a new key, then
|
|
197
|
+
returns the open, empty store. It takes the same options as `nodeStore`. Close
|
|
198
|
+
the open store of the file first.
|
|
199
|
+
|
|
200
|
+
`clearAllKeys()` on an open store empties every SDK table and keeps the file
|
|
201
|
+
and its key. `resetNodeStore()` is the full teardown.
|
|
202
|
+
|
|
203
|
+
## Data protection
|
|
204
|
+
|
|
205
|
+
Every table in this store holds material that must not leave the device.
|
|
206
|
+
That includes the group `sender_keys` and `skipped_sender_keys` tables. Their
|
|
207
|
+
rows contain the sender chain key, the sender's private signature key, and
|
|
208
|
+
individual message keys. That material is enough to read and to forge a
|
|
209
|
+
sender's group messages. The store writes those rows unencrypted at the row
|
|
210
|
+
level, because SQLCipher encrypts the database file itself. The database key is
|
|
211
|
+
therefore the only thing that protects them.
|
|
212
|
+
|
|
213
|
+
The app still owns OS account isolation, backups, volume security, and process
|
|
214
|
+
access. Do not back up the database file to a server or sync it between
|
|
215
|
+
devices.
|
|
61
216
|
|
|
62
|
-
|
|
63
|
-
remove the lock or continue without exclusion. Process termination releases
|
|
64
|
-
the kernel lock. The next initialization removes interrupted temporary writes.
|
|
217
|
+
## Client usage
|
|
65
218
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
219
|
+
<!-- doc-snippet:skip requires-external-context -->
|
|
220
|
+
|
|
221
|
+
```ts
|
|
222
|
+
import { createSignalProtocolClient } from '@open-e2ee/signal-protocol-sdk';
|
|
223
|
+
import { nodeStore } from '@open-e2ee/signal-protocol-sdk/local/store/node';
|
|
224
|
+
|
|
225
|
+
const client = await createSignalProtocolClient({
|
|
226
|
+
identity: { userId },
|
|
227
|
+
adapters: { storage: await nodeStore({ directory, vault }), relay },
|
|
228
|
+
});
|
|
229
|
+
```
|
|
70
230
|
|
|
71
|
-
|
|
72
|
-
|
|
231
|
+
For replaced-prekey maintenance, pass the open store to
|
|
232
|
+
`createPreKeyMaintenanceStore(store)`.
|
|
73
233
|
|
|
74
234
|
See the parent [storage guide](../README.md), [adapter guide](../../../ADAPTERS.md),
|
|
75
235
|
and [security model](../../../docs/SECURITY.md).
|
|
@@ -1,85 +1,144 @@
|
|
|
1
|
-
#
|
|
1
|
+
# React Native SQLite Store
|
|
2
2
|
|
|
3
|
-
`ReactNativeSignalProtocolStore` implements `SignalProtocolLocalStore`
|
|
4
|
-
|
|
3
|
+
`ReactNativeSignalProtocolStore` implements `SignalProtocolLocalStore`
|
|
4
|
+
for bare React Native in an SDK-owned SQLCipher database on
|
|
5
|
+
[op-sqlite](https://github.com/OP-Engineering/op-sqlite). The database key is
|
|
6
|
+
held through the local secret-vault boundary, by default in the
|
|
7
|
+
react-native-keychain vault.
|
|
5
8
|
|
|
6
9
|
## Why it exists
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
Signal Protocol state is larger and more transactional than the values
|
|
12
|
+
platform keychains hold. The store keeps a small database key in the keychain
|
|
13
|
+
and stores protocol records in an encrypted SQLite database. The SDK owns that
|
|
14
|
+
database: its file, its key, and its migrations.
|
|
11
15
|
|
|
12
|
-
##
|
|
16
|
+
## Setup
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
bare application with `npx install-expo-modules@latest`, and then install
|
|
16
|
-
`expo-crypto`. The store needs no Web Crypto polyfill. AES-256-GCM uses Web
|
|
17
|
-
Crypto when `crypto.subtle` exists and the bundled Noble implementation
|
|
18
|
-
otherwise. The [README](../../../README.md#use-your-apps-storage-and-relay)
|
|
19
|
-
lists the supported React Native versions.
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
18
|
+
Install the two optional peers:
|
|
22
19
|
|
|
23
20
|
<!-- doc-snippet:skip requires-external-context -->
|
|
24
|
-
```ts
|
|
25
|
-
import { createSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
|
|
26
|
-
import {
|
|
27
|
-
reactNativeStore,
|
|
28
|
-
type ReactNativeKeyValueStorage,
|
|
29
|
-
} from "@open-e2ee/signal-protocol-sdk/local/store/react-native";
|
|
30
21
|
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
```sh
|
|
23
|
+
npm install @op-engineering/op-sqlite react-native-keychain
|
|
24
|
+
```
|
|
33
25
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
Turn on the op-sqlite SQLCipher build in the `package.json` of the app, then
|
|
27
|
+
run `pod install` and rebuild the app:
|
|
28
|
+
|
|
29
|
+
<!-- doc-snippet:skip requires-external-context -->
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"op-sqlite": {
|
|
34
|
+
"sqlcipher": true
|
|
35
|
+
}
|
|
36
|
+
}
|
|
38
37
|
```
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
Without that flag, op-sqlite cannot apply the database key, and the open fails
|
|
40
|
+
before it creates a file.
|
|
41
|
+
|
|
42
|
+
With SQLCipher on, op-sqlite conflicts on iOS with:
|
|
43
|
+
|
|
44
|
+
- `expo-sqlite`, which also links SQLite. Do not install both in one app.
|
|
45
|
+
- `expo-updates`, which also links SQLite. When it is the only conflict, add
|
|
46
|
+
`"expo.updates.useThirdPartySQLitePod": "true"` to
|
|
47
|
+
`ios/Podfile.properties.json`.
|
|
48
|
+
- `use_frameworks!` in the Podfile, which breaks the build or makes it use
|
|
49
|
+
the embedded SQLite of iOS, which has no cipher.
|
|
44
50
|
|
|
45
|
-
|
|
51
|
+
op-sqlite works in an Expo prebuild (development or release build), not in
|
|
52
|
+
Expo Go. An Expo app can use the [Expo store](../expo/README.md) instead.
|
|
46
53
|
|
|
47
|
-
|
|
48
|
-
`ReactNativeKeyValueStorage` contract, and the SDK cannot test the backend
|
|
49
|
-
your application supplies. The package therefore exports a
|
|
50
|
-
backend-conformance kit. Run it against your backend from your application's
|
|
51
|
-
own tests:
|
|
54
|
+
Open the store with one call:
|
|
52
55
|
|
|
53
56
|
<!-- doc-snippet:skip requires-external-context -->
|
|
57
|
+
|
|
54
58
|
```ts
|
|
55
|
-
import {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
} from "@open-e2ee/signal-protocol-sdk/local/store/react-native";
|
|
59
|
-
|
|
60
|
-
await assertBackendConformance({
|
|
61
|
-
createBackend: () => createMyBackend(),
|
|
62
|
-
// Optional: return a new instance over the same persistence medium to
|
|
63
|
-
// verify committed writes survive reopen. Reported as skipped when absent.
|
|
64
|
-
reopen: (previous) => reopenMyBackend(previous),
|
|
65
|
-
});
|
|
59
|
+
import { reactNativeStore } from '@open-e2ee/signal-protocol-sdk/local/store/react-native';
|
|
60
|
+
|
|
61
|
+
const storage = await reactNativeStore();
|
|
66
62
|
```
|
|
67
63
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
64
|
+
On first use, `reactNativeStore` creates a 32-byte database key, writes
|
|
65
|
+
it to the vault, and then creates the database file. Each open applies the SDK
|
|
66
|
+
migrations before it returns the store. A file that a newer SDK wrote does not
|
|
67
|
+
open (`INVALID_STATE`).
|
|
68
|
+
|
|
69
|
+
Options:
|
|
70
|
+
|
|
71
|
+
- `name`: the database file name in the op-sqlite default location (the
|
|
72
|
+
Library directory on iOS, the databases directory on Android). Letters,
|
|
73
|
+
digits, `.`, `_`, and `-` only. Default: `open-e2ee-signal-protocol.db`.
|
|
74
|
+
- `vault`: the `SignalProtocolLocalSecretVault` that holds the database key.
|
|
75
|
+
Default: `ReactNativeKeychainSignalProtocolSecretVault`, which keeps the key
|
|
76
|
+
on this device only (see the [vault guide](../../vault/README.md)).
|
|
77
|
+
- `encryptionAtRest`: pass `false` to store the database without encryption.
|
|
78
|
+
The store then does not use the vault, and it logs a warning at each open. A
|
|
79
|
+
database created with one setting does not open with the other. Default:
|
|
80
|
+
`true`, and the open fails when op-sqlite is not built with SQLCipher.
|
|
81
|
+
- `logger`: receives the warning of each open without encryption.
|
|
82
|
+
|
|
83
|
+
A store holds its name until `close()`. In one process, the opens and resets
|
|
84
|
+
of a name run one at a time. An open or a reset of a name that an open store
|
|
85
|
+
holds fails with `INVALID_STATE`, so two parallel first opens write one key
|
|
86
|
+
and the second open fails.
|
|
87
|
+
|
|
88
|
+
Keep application tables in a separate database file. The SDK database holds
|
|
89
|
+
only SDK tables.
|
|
90
|
+
|
|
91
|
+
## Lost key and reset
|
|
92
|
+
|
|
93
|
+
When the database file exists and the vault holds no key for it,
|
|
94
|
+
`reactNativeStore` fails with `LOCAL_STORE_KEY_LOST` and changes nothing.
|
|
95
|
+
A new key cannot read the old file. Restore the vault entry, or call
|
|
96
|
+
`resetReactNativeStore()`.
|
|
97
|
+
|
|
98
|
+
A file created with `encryptionAtRest: false` fails an open without that
|
|
99
|
+
option with `SqliteKeyMismatchError` (`KEY_STORAGE_ERROR`), not
|
|
100
|
+
`LOCAL_STORE_KEY_LOST`. Open it with the setting that created it.
|
|
101
|
+
|
|
102
|
+
`resetReactNativeStore()` deletes the database file, then writes a new
|
|
103
|
+
key, then returns the open, empty store. It takes the same options as
|
|
104
|
+
`reactNativeStore`. Close the open store of the name first.
|
|
105
|
+
|
|
106
|
+
`clearAllKeys()` on an open store empties every SDK table and keeps the file
|
|
107
|
+
and its key. `resetReactNativeStore()` is the full teardown.
|
|
108
|
+
|
|
109
|
+
## Data protection
|
|
110
|
+
|
|
111
|
+
Every table in this store holds material that must not leave the device.
|
|
112
|
+
That includes the group `sender_keys` and `skipped_sender_keys` tables. Their
|
|
113
|
+
rows contain the sender chain key, the sender's private signature key, and
|
|
114
|
+
individual message keys. That material is enough to read and to forge a
|
|
115
|
+
sender's group messages. The store writes those rows unencrypted at the row
|
|
116
|
+
level, because SQLCipher encrypts the database file itself. The database key is
|
|
117
|
+
therefore the only thing that protects them.
|
|
118
|
+
|
|
119
|
+
Do not back up the database file to a server or sync it between devices. The
|
|
120
|
+
default vault keeps the key out of device backups. iOS backs up the Library
|
|
121
|
+
directory, and Android Auto Backup includes the databases directory unless the
|
|
122
|
+
app excludes it. A file restored from a backup to a new device therefore has no
|
|
123
|
+
key there, and the open fails with `LOCAL_STORE_KEY_LOST`.
|
|
124
|
+
|
|
125
|
+
## Client usage
|
|
73
126
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
127
|
+
<!-- doc-snippet:skip requires-external-context -->
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
import { createSignalProtocolClient } from '@open-e2ee/signal-protocol-sdk';
|
|
131
|
+
import { reactNativeStore } from '@open-e2ee/signal-protocol-sdk/local/store/react-native';
|
|
132
|
+
|
|
133
|
+
const client = await createSignalProtocolClient({
|
|
134
|
+
identity: { userId },
|
|
135
|
+
adapters: { storage: await reactNativeStore(), relay },
|
|
136
|
+
});
|
|
137
|
+
```
|
|
79
138
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
deployment review must still cover the engine itself.
|
|
139
|
+
For replaced-prekey maintenance, pass the open store to
|
|
140
|
+
`createPreKeyMaintenanceStore(store)`.
|
|
83
141
|
|
|
84
142
|
See the parent [storage guide](../README.md), [adapter guide](../../../ADAPTERS.md),
|
|
143
|
+
the [op-sqlite installation guide](https://op-engineering.github.io/op-sqlite/docs/installation),
|
|
85
144
|
and [security model](../../../docs/SECURITY.md).
|
|
@@ -9,6 +9,15 @@ Browser applications need durable protocol state without importing mobile or
|
|
|
9
9
|
Node filesystem dependencies. The adapter provides that boundary while making
|
|
10
10
|
the browser-origin threat model explicit.
|
|
11
11
|
|
|
12
|
+
## Setup
|
|
13
|
+
|
|
14
|
+
Install the peer `idb` 8.0.3 or later. The store opens its IndexedDB database
|
|
15
|
+
through it.
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
npm install idb
|
|
19
|
+
```
|
|
20
|
+
|
|
12
21
|
## Usage
|
|
13
22
|
|
|
14
23
|
<!-- doc-snippet:skip requires-external-context -->
|
|
@@ -57,6 +66,11 @@ and [MDN Content Security Policy guide](https://developer.mozilla.org/docs/Web/H
|
|
|
57
66
|
|
|
58
67
|
## Operational status
|
|
59
68
|
|
|
69
|
+
In a browser where the origin private file system works, use the
|
|
70
|
+
[web SQLite store](../web-sqlite/README.md). Use this adapter where the origin
|
|
71
|
+
private file system is not available, and `webSqliteStore` fails with
|
|
72
|
+
`OPFS_UNAVAILABLE`.
|
|
73
|
+
|
|
60
74
|
The adapter covers the core store contract, including atomic security commits,
|
|
61
75
|
SESAME state, sender-key state, and retry records. Every gate on its
|
|
62
76
|
graduation checklist in the parent [storage guide](../README.md) runs
|