@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
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# Web SQLite Store
|
|
2
|
+
|
|
3
|
+
`webSqliteStore` opens a `SignalProtocolLocalStore` on SQLite in the browser.
|
|
4
|
+
The engine is SQLite3 Multiple Ciphers, compiled to WebAssembly. It runs in
|
|
5
|
+
one dedicated module worker, and each database file lives in the origin
|
|
6
|
+
private file system (OPFS). The file is encrypted in the SQLCipher 4 format
|
|
7
|
+
with a 32-byte key that the store keeps in a secret vault.
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
Install the peer `idb` 8.0.3 or later. The default vault keeps the database
|
|
12
|
+
key in IndexedDB through it. The entry loads it also when the app passes its
|
|
13
|
+
own vault.
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
npm install idb
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
<!-- doc-snippet:skip requires-external-context -->
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { createSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
|
|
25
|
+
import { webSqliteStore } from "@open-e2ee/signal-protocol-sdk/local/store/web-sqlite";
|
|
26
|
+
|
|
27
|
+
const storage = await webSqliteStore();
|
|
28
|
+
|
|
29
|
+
const client = await createSignalProtocolClient({
|
|
30
|
+
identity: { userId },
|
|
31
|
+
adapters: { storage, relay },
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
On first use, `webSqliteStore` creates a 32-byte database key, writes it to
|
|
36
|
+
the vault, and then creates the database file. Each open applies the SDK
|
|
37
|
+
migrations before it returns the store. A file that a newer SDK wrote does not
|
|
38
|
+
open (`INVALID_STATE`).
|
|
39
|
+
|
|
40
|
+
Options:
|
|
41
|
+
|
|
42
|
+
- `name`: the database name in OPFS. A letter or digit, then up to 63
|
|
43
|
+
letters, digits, `.`, `_`, and `-`. It also names the vault slot of the key.
|
|
44
|
+
Default: `open-e2ee-signal-protocol.db`.
|
|
45
|
+
- `vault`: the `SignalProtocolLocalSecretVault` that holds the database key.
|
|
46
|
+
Default: the SDK's IndexedDB vault in the same origin.
|
|
47
|
+
- `encryptionAtRest`: pass `false` to store the database without encryption.
|
|
48
|
+
The store then does not use the vault, and it logs a warning at each open. A
|
|
49
|
+
database created with one setting does not open with the other. Default:
|
|
50
|
+
`true`.
|
|
51
|
+
- `logger`: receives the warning of each open without encryption.
|
|
52
|
+
- `workerUrl` and `wasmUrl`: see [Content Security Policy](#content-security-policy).
|
|
53
|
+
|
|
54
|
+
Each store runs its own worker. Close the store with `close()`: it closes the
|
|
55
|
+
database and stops the worker. A failed open also stops its worker. Keep
|
|
56
|
+
application tables in a separate
|
|
57
|
+
database. The SDK database holds only SDK tables.
|
|
58
|
+
|
|
59
|
+
## Lost key and reset
|
|
60
|
+
|
|
61
|
+
When the database file exists and the vault holds no key for it,
|
|
62
|
+
`webSqliteStore` fails with `LOCAL_STORE_KEY_LOST` and changes nothing. A new
|
|
63
|
+
key cannot read the old file. Restore the vault entry, or call
|
|
64
|
+
`resetWebSqliteStore()`. The reset deletes the file, creates a new key, and
|
|
65
|
+
returns the open, empty store.
|
|
66
|
+
|
|
67
|
+
## Tabs
|
|
68
|
+
|
|
69
|
+
Each tab opens its own store, and the tabs of an origin share the database.
|
|
70
|
+
One worker at a time holds the file. A tab that needs the file asks the
|
|
71
|
+
holder, and the holder hands it over after its current statement, never in a
|
|
72
|
+
transaction. Each tab reads the writes of the other tabs.
|
|
73
|
+
|
|
74
|
+
- The opens and resets of a name run one at a time in the origin, so two tabs
|
|
75
|
+
that open a new store at the same time write one key.
|
|
76
|
+
- A second open of a name in the same tab or worker, while its store is open,
|
|
77
|
+
fails with `INVALID_STATE`.
|
|
78
|
+
- A reset fails with `INVALID_STATE` while a store of the name is open in any
|
|
79
|
+
tab or worker of the origin. Close it everywhere first.
|
|
80
|
+
- A store fails with `INVALID_STATE` when another tab changed the schema
|
|
81
|
+
version of the file while it waited, for example a tab with a newer SDK.
|
|
82
|
+
Close the store and open it again.
|
|
83
|
+
- `OPFS_FILE_BUSY` means that another tab or worker of the origin still holds
|
|
84
|
+
the files, for example a tab that is closing. The file is unchanged. Retry
|
|
85
|
+
the open later.
|
|
86
|
+
|
|
87
|
+
## Full storage
|
|
88
|
+
|
|
89
|
+
When the origin storage quota is full, the open rejects with
|
|
90
|
+
`StorageQuotaExceededError` (`STORAGE_QUOTA_EXCEEDED`). An open that fails
|
|
91
|
+
this way on a new store writes no key and no database file. A write on an open
|
|
92
|
+
store rejects with the same error. SQLite rolls the write back, and the store
|
|
93
|
+
stays open. Free space, then open again or retry the write.
|
|
94
|
+
|
|
95
|
+
## Content Security Policy
|
|
96
|
+
|
|
97
|
+
The engine compiles WebAssembly in its worker. A Content Security Policy
|
|
98
|
+
that applies to the worker must allow it with `'wasm-unsafe-eval'` in
|
|
99
|
+
`script-src`. The store needs no other relaxation: no `'unsafe-eval'`, no
|
|
100
|
+
`blob:` worker, and no inline script.
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
Content-Security-Policy: default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; worker-src 'self'; connect-src 'self'
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
- Send the header on the worker script response. A module worker takes the
|
|
107
|
+
policy of its own response, not the policy of the page. A site that sends
|
|
108
|
+
one policy on every response adds `'wasm-unsafe-eval'` to that policy.
|
|
109
|
+
- `worker-src` must allow the worker script, and `connect-src` must allow
|
|
110
|
+
the Wasm file.
|
|
111
|
+
- Serve `sqlite3.wasm` as `application/wasm`.
|
|
112
|
+
- Emit the worker and `sqlite3mc/sqlite3.wasm` next to the module that
|
|
113
|
+
creates the driver, as the package lays them out. Most bundlers resolve
|
|
114
|
+
the default URLs. Otherwise pass `workerUrl` and `wasmUrl`.
|
|
115
|
+
|
|
116
|
+
Without `'wasm-unsafe-eval'`, the open rejects with
|
|
117
|
+
`SQLITE_ENGINE_UNAVAILABLE`.
|
|
118
|
+
|
|
119
|
+
## When OPFS is not available
|
|
120
|
+
|
|
121
|
+
Some browser contexts cannot keep a file in OPFS: some private or ephemeral
|
|
122
|
+
contexts, WebKit on Linux, and other runtimes without synchronous access
|
|
123
|
+
handles in a worker. The open then rejects with `OPFS_UNAVAILABLE` before it
|
|
124
|
+
loads the engine. Use the IndexedDB store in that runtime:
|
|
125
|
+
|
|
126
|
+
<!-- doc-snippet:skip requires-external-context -->
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
import { EncryptionError, EncryptionErrorCode } from "@open-e2ee/signal-protocol-sdk";
|
|
130
|
+
import { indexedDbStore } from "@open-e2ee/signal-protocol-sdk/local/store/web";
|
|
131
|
+
import { webSqliteStore } from "@open-e2ee/signal-protocol-sdk/local/store/web-sqlite";
|
|
132
|
+
|
|
133
|
+
async function openStorage() {
|
|
134
|
+
try {
|
|
135
|
+
return await webSqliteStore();
|
|
136
|
+
} catch (error) {
|
|
137
|
+
if (error instanceof EncryptionError && error.code === EncryptionErrorCode.OPFS_UNAVAILABLE) {
|
|
138
|
+
return indexedDbStore();
|
|
139
|
+
}
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
The two stores do not share data. Choose one for each runtime, and do not
|
|
146
|
+
move to the other after an error that is not `OPFS_UNAVAILABLE`.
|
|
147
|
+
|
|
148
|
+
## Tauri
|
|
149
|
+
|
|
150
|
+
A Tauri 2 app uses this entry in its webview. The entry runs unchanged in
|
|
151
|
+
WKWebView on macOS and iOS. A manual check ran it with Tauri 2.12 on macOS
|
|
152
|
+
15.7 and in the iOS 18.0 simulator. No CI job runs it in Tauri. It needs no
|
|
153
|
+
Tauri headers (`app.security.headers`) and no capability, because the store
|
|
154
|
+
makes no IPC call.
|
|
155
|
+
|
|
156
|
+
Put the policy from [Content Security Policy](#content-security-policy) in
|
|
157
|
+
`app.security.csp` of `tauri.conf.json`. When the app uses Tauri IPC, add the
|
|
158
|
+
IPC sources to `connect-src`:
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"app": {
|
|
163
|
+
"security": {
|
|
164
|
+
"csp": "default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; worker-src 'self'; connect-src 'self' ipc: http://ipc.localhost"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
- **Policy scope.** Tauri sends `app.security.csp` only with the HTML files
|
|
171
|
+
that it serves from `frontendDist`, and it adds the hashes of its scripts to
|
|
172
|
+
`script-src`. The worker script and `sqlite3.wasm` get no policy, and
|
|
173
|
+
`app.security.headers` cannot set one. The page policy must allow the worker
|
|
174
|
+
in `worker-src`. With a `devUrl`, `tauri dev` loads the page from the dev
|
|
175
|
+
server, and the policy does not apply. Test the policy on a build.
|
|
176
|
+
- **IPC on Windows and Android.** When `useHttpsScheme` is `true`, the IPC
|
|
177
|
+
source is `https://ipc.localhost`. Put it in `connect-src` in place of
|
|
178
|
+
`http://ipc.localhost`.
|
|
179
|
+
- **Origin.** The database and the vault belong to the origin of the webview.
|
|
180
|
+
On Windows and Android, `useHttpsScheme` of the window
|
|
181
|
+
(`app.windows[].useHttpsScheme`) sets that origin. `dataDirectory` (Windows
|
|
182
|
+
and Linux) and `dataStoreIdentifier` (macOS 14 and iOS 17 or later) set
|
|
183
|
+
where the webview keeps its data. Set these values before the first release,
|
|
184
|
+
and never change them. A change moves the data, and the app then cannot find
|
|
185
|
+
its database or its vault.
|
|
186
|
+
- **Linux.** WebKitGTK 2.54 has no OPFS synchronous access handles. On it,
|
|
187
|
+
the expected result of the open is a rejection with `OPFS_UNAVAILABLE`. See
|
|
188
|
+
[When OPFS is not available](#when-opfs-is-not-available).
|
|
189
|
+
- **Windows and Android.** WebView2 and the Android WebView are not yet
|
|
190
|
+
tested.
|
|
191
|
+
- **Key custody.** The default vault keeps the key in IndexedDB in the same
|
|
192
|
+
origin as the database. An app that needs OS keychain custody passes its own
|
|
193
|
+
vault. See [Security boundary](#security-boundary).
|
|
194
|
+
|
|
195
|
+
## Security boundary
|
|
196
|
+
|
|
197
|
+
The default vault keeps the database key as raw bytes in IndexedDB, in the
|
|
198
|
+
same origin as the database file. The key protects a copy of the database
|
|
199
|
+
file that does not also include that IndexedDB record. It does not protect
|
|
200
|
+
against script that runs in the origin (XSS), a browser extension with
|
|
201
|
+
access to the site, malware that reads the browser profile, or a copy of the
|
|
202
|
+
full profile. Encryption at rest is therefore not an XSS defense. See the
|
|
203
|
+
[IndexedDB store guide](../web/README.md#security-boundary) for the
|
|
204
|
+
origin-security controls that a deployment needs.
|
|
205
|
+
|
|
206
|
+
An application with a different key custody passes its own
|
|
207
|
+
`SignalProtocolLocalSecretVault` as `vault`.
|
|
208
|
+
|
|
209
|
+
See the parent [storage guide](../README.md), [adapter guide](../../../ADAPTERS.md),
|
|
210
|
+
and [security model](../../../docs/SECURITY.md).
|
package/local/vault/README.md
CHANGED
|
@@ -13,6 +13,12 @@ platform keychain.
|
|
|
13
13
|
|
|
14
14
|
## Expo usage
|
|
15
15
|
|
|
16
|
+
Install the optional peer `expo-secure-store` 55.0.15 or later.
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npx expo install expo-secure-store
|
|
20
|
+
```
|
|
21
|
+
|
|
16
22
|
<!-- doc-snippet:skip requires-external-context -->
|
|
17
23
|
```ts
|
|
18
24
|
import { ExpoSecureStoreSignalProtocolSecretVault } from "@open-e2ee/signal-protocol-sdk/local/vault/expo-secure-store";
|
|
@@ -23,10 +29,117 @@ await vault.setSecret("signal-store-wrapping-key", wrappingKey);
|
|
|
23
29
|
const restored = await vault.getSecret("signal-store-wrapping-key");
|
|
24
30
|
```
|
|
25
31
|
|
|
32
|
+
## Bare React Native usage
|
|
33
|
+
|
|
34
|
+
Install the optional peer `react-native-keychain` 10.0.0 or later.
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
npm install react-native-keychain
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
<!-- doc-snippet:skip requires-external-context -->
|
|
41
|
+
```ts
|
|
42
|
+
import { ReactNativeKeychainSignalProtocolSecretVault } from "@open-e2ee/signal-protocol-sdk/local/vault/react-native-keychain";
|
|
43
|
+
|
|
44
|
+
const vault = new ReactNativeKeychainSignalProtocolSecretVault();
|
|
45
|
+
|
|
46
|
+
await vault.setSecret("signal-store-wrapping-key", wrappingKey);
|
|
47
|
+
const restored = await vault.getSecret("signal-store-wrapping-key");
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The secret name is the keychain service, and the value is stored as lowercase
|
|
51
|
+
hex. The adapter rejects an empty name, an empty value, and a stored value that
|
|
52
|
+
is not lowercase hex with an `EncryptionError` that has the code
|
|
53
|
+
`KEY_STORAGE_ERROR`.
|
|
54
|
+
|
|
55
|
+
The adapter sets these options on every write. The application cannot change
|
|
56
|
+
them:
|
|
57
|
+
|
|
58
|
+
| Option | Value | Why |
|
|
59
|
+
| --- | --- | --- |
|
|
60
|
+
| `accessible` (iOS) | `AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY` | The item stays on this device. It is not in iCloud Keychain or in a backup that restores to another device. A background task can read it after the first unlock. |
|
|
61
|
+
| `storage` (Android) | `AES_GCM_NO_AUTH` | The value is encrypted with AES-GCM under a key in the Android Keystore. No biometric prompt. |
|
|
62
|
+
| `securityLevel` (Android) | `SECURE_SOFTWARE` | The key must be in the Android Keystore, apart from the data. `SECURE_HARDWARE` fails on emulators and on devices with a software keymaster, and the library checks it only when it makes a new key. `ANY` removes the Keystore check. |
|
|
63
|
+
| `cloudSync` (iOS) | not set | react-native-keychain 10.0.0 turns iCloud sync on when this key has any value, `false` included ([issue #800](https://github.com/oblador/react-native-keychain/issues/800)). |
|
|
64
|
+
|
|
65
|
+
With these options the key does not leave the device.
|
|
66
|
+
|
|
67
|
+
On iOS, a write deletes the existing item and then adds the new one, so a
|
|
68
|
+
write is not atomic. A crash between the two steps leaves no item.
|
|
69
|
+
|
|
70
|
+
## Electron usage
|
|
71
|
+
|
|
72
|
+
Use the vault in the main process, after the app is ready. The app passes its
|
|
73
|
+
own `safeStorage`, so the SDK does not import `electron`.
|
|
74
|
+
|
|
75
|
+
<!-- doc-snippet:skip requires-external-context -->
|
|
76
|
+
```ts
|
|
77
|
+
import { join } from "node:path";
|
|
78
|
+
import { app, safeStorage } from "electron";
|
|
79
|
+
import { ElectronSafeStorageSignalProtocolSecretVault } from "@open-e2ee/signal-protocol-sdk/local/vault/electron-safe-storage";
|
|
80
|
+
|
|
81
|
+
await app.whenReady();
|
|
82
|
+
const vault = new ElectronSafeStorageSignalProtocolSecretVault({
|
|
83
|
+
safeStorage,
|
|
84
|
+
file: join(app.getPath("userData"), "signal-protocol-secrets.json"),
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
await vault.setSecret("signal-store-wrapping-key", wrappingKey);
|
|
88
|
+
const restored = await vault.getSecret("signal-store-wrapping-key");
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
`safeStorage` encrypts each secret under a key that the OS holds: the macOS
|
|
92
|
+
Keychain, Windows DPAPI, or the Linux secret store. The vault keeps only the
|
|
93
|
+
ciphertexts, as base64 in a JSON file that the app names. The file's directory
|
|
94
|
+
must exist, and one vault owns the file. Each write replaces the file
|
|
95
|
+
atomically, and the file is readable only by the owner.
|
|
96
|
+
|
|
97
|
+
The protection is that of the OS key store
|
|
98
|
+
([safeStorage](https://www.electronjs.org/docs/latest/api/safe-storage)):
|
|
99
|
+
|
|
100
|
+
- **macOS.** The Keychain protects the key from other users and from other
|
|
101
|
+
apps of the same user.
|
|
102
|
+
- **Windows.** DPAPI protects the key from other users. It does not protect it
|
|
103
|
+
from other apps of the same user.
|
|
104
|
+
- **Linux.** A secret service, for example GNOME Keyring or KWallet, must run
|
|
105
|
+
and be reachable over D-Bus. When no secret service is reachable,
|
|
106
|
+
`safeStorage` encrypts with a fixed key, and
|
|
107
|
+
`getSelectedStorageBackend()` can still return `gnome_libsecret`. The vault
|
|
108
|
+
refuses that key: on Linux, it accepts only a ciphertext that starts with
|
|
109
|
+
`v11`, the prefix of a key from a secret service.
|
|
110
|
+
|
|
111
|
+
The vault fails with an `EncryptionError` that has the code
|
|
112
|
+
`KEY_STORAGE_ERROR`:
|
|
113
|
+
|
|
114
|
+
- when async encryption is not available, which is the case before the app is
|
|
115
|
+
ready;
|
|
116
|
+
- on Linux, when the backend is `basic_text`, which encrypts with a fixed
|
|
117
|
+
password, or `unknown`;
|
|
118
|
+
- on Linux, when a ciphertext does not start with `v11`, for example when no
|
|
119
|
+
secret service answered and `safeStorage` used its fixed key. The vault
|
|
120
|
+
file does not change;
|
|
121
|
+
- when `safeStorage` cannot encrypt or decrypt, for example when the OS key
|
|
122
|
+
is gone or the macOS signature of the app is not valid. The Electron error
|
|
123
|
+
is the `originalError`. It can say that `safeStorage` is temporarily
|
|
124
|
+
unavailable. The vault file does not change.
|
|
125
|
+
|
|
126
|
+
Use the vault only in the main process. `safeStorage` is not available in a
|
|
127
|
+
renderer, a preload script, or a `utilityProcess`. A store in a
|
|
128
|
+
`utilityProcess` reaches the vault over a message port (see the
|
|
129
|
+
[Node store guide](../store/node/README.md#utility-process)).
|
|
130
|
+
|
|
131
|
+
On macOS, sign every build with the same identity, and notarize the app
|
|
132
|
+
([code signing](https://www.electronjs.org/docs/latest/tutorial/code-signing#macos-apis-that-require-code-signing)).
|
|
133
|
+
A build with a different signature can make the Keychain ask the user again.
|
|
134
|
+
An ad-hoc signature changes with each build.
|
|
135
|
+
|
|
136
|
+
## Secret names
|
|
137
|
+
|
|
26
138
|
Secret names are application-wide storage keys. Namespace them to avoid
|
|
27
139
|
collisions and delete them during the same account-reset transaction as the
|
|
28
|
-
encrypted local store.
|
|
29
|
-
|
|
140
|
+
encrypted local store. Each adapter keeps the item on this device, so a new
|
|
141
|
+
device does not receive it. Biometric access and device migration remain
|
|
142
|
+
application decisions.
|
|
30
143
|
|
|
31
144
|
See the [local-store guide](../store/README.md) and
|
|
32
145
|
[adapter guide](../../ADAPTERS.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-e2ee/signal-protocol-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"description": "Pure TypeScript Signal Protocol SDK for encrypted chat in Expo, React Native, browsers, and Node. Post-quantum by default.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"open-e2ee",
|
|
@@ -123,6 +123,10 @@
|
|
|
123
123
|
"types": "./dist/device/provisioning.d.ts",
|
|
124
124
|
"default": "./dist/device/provisioning.js"
|
|
125
125
|
},
|
|
126
|
+
"./device/react-native": {
|
|
127
|
+
"types": "./dist/device/react-native/index.d.ts",
|
|
128
|
+
"default": "./dist/device/react-native/index.js"
|
|
129
|
+
},
|
|
126
130
|
"./encoding": {
|
|
127
131
|
"types": "./dist/encoding/index.d.ts",
|
|
128
132
|
"default": "./dist/encoding/index.js"
|
|
@@ -195,13 +199,13 @@
|
|
|
195
199
|
"types": "./dist/local/store/expo/index.d.ts",
|
|
196
200
|
"default": "./dist/local/store/expo/index.js"
|
|
197
201
|
},
|
|
198
|
-
"./local/store/
|
|
199
|
-
"types": "./dist/local/store/
|
|
200
|
-
"default": "./dist/local/store/
|
|
202
|
+
"./local/store/key-value": {
|
|
203
|
+
"types": "./dist/local/store/key-value/index.d.ts",
|
|
204
|
+
"default": "./dist/local/store/key-value/index.js"
|
|
201
205
|
},
|
|
202
|
-
"./local/store/
|
|
203
|
-
"types": "./dist/local/store/
|
|
204
|
-
"default": "./dist/local/store/
|
|
206
|
+
"./local/store/key-value/realm": {
|
|
207
|
+
"types": "./dist/local/store/key-value/realm/index.d.ts",
|
|
208
|
+
"default": "./dist/local/store/key-value/realm/index.js"
|
|
205
209
|
},
|
|
206
210
|
"./local/store/memory": {
|
|
207
211
|
"types": "./dist/local/store/memory/index.d.ts",
|
|
@@ -219,14 +223,26 @@
|
|
|
219
223
|
"types": "./dist/local/store/web/index.d.ts",
|
|
220
224
|
"default": "./dist/local/store/web/index.js"
|
|
221
225
|
},
|
|
226
|
+
"./local/store/web-sqlite": {
|
|
227
|
+
"types": "./dist/local/store/web-sqlite/index.d.ts",
|
|
228
|
+
"default": "./dist/local/store/web-sqlite/index.js"
|
|
229
|
+
},
|
|
222
230
|
"./local/vault": {
|
|
223
231
|
"types": "./dist/local/vault/index.d.ts",
|
|
224
232
|
"default": "./dist/local/vault/index.js"
|
|
225
233
|
},
|
|
234
|
+
"./local/vault/electron-safe-storage": {
|
|
235
|
+
"types": "./dist/local/vault/electron-safe-storage.d.ts",
|
|
236
|
+
"default": "./dist/local/vault/electron-safe-storage.js"
|
|
237
|
+
},
|
|
226
238
|
"./local/vault/expo-secure-store": {
|
|
227
239
|
"types": "./dist/local/vault/expo-secure-store.d.ts",
|
|
228
240
|
"default": "./dist/local/vault/expo-secure-store.js"
|
|
229
241
|
},
|
|
242
|
+
"./local/vault/react-native-keychain": {
|
|
243
|
+
"types": "./dist/local/vault/react-native-keychain.d.ts",
|
|
244
|
+
"default": "./dist/local/vault/react-native-keychain.js"
|
|
245
|
+
},
|
|
230
246
|
"./remote/object-store": {
|
|
231
247
|
"types": "./dist/remote/object-store/index.d.ts",
|
|
232
248
|
"default": "./dist/remote/object-store/index.js"
|
|
@@ -323,10 +339,12 @@
|
|
|
323
339
|
"keys/README.md",
|
|
324
340
|
"local/store/README.md",
|
|
325
341
|
"local/store/expo/README.md",
|
|
342
|
+
"local/store/key-value/README.md",
|
|
326
343
|
"local/store/memory/README.md",
|
|
327
344
|
"local/store/node/README.md",
|
|
328
345
|
"local/store/react-native/README.md",
|
|
329
346
|
"local/store/web/README.md",
|
|
347
|
+
"local/store/web-sqlite/README.md",
|
|
330
348
|
"local/vault/README.md",
|
|
331
349
|
"media/README.md",
|
|
332
350
|
"profile/README.md",
|
|
@@ -350,9 +368,10 @@
|
|
|
350
368
|
},
|
|
351
369
|
"scripts": {
|
|
352
370
|
"audit:dependencies": "npm audit --omit=dev --audit-level=moderate && npm audit --audit-level=moderate",
|
|
353
|
-
"build": "npm run clean && npm run build:dist && npm run build:fix-esm",
|
|
371
|
+
"build": "npm run clean && npm run build:dist && npm run build:fix-esm && npm run build:sqlite-engine",
|
|
354
372
|
"build:dist": "tsc -p tsconfig.build.json",
|
|
355
373
|
"build:fix-esm": "node ./scripts/fix-esm-specifiers.mjs ./dist",
|
|
374
|
+
"build:sqlite-engine": "node ./scripts/sqlite-engine.mjs copy ./dist",
|
|
356
375
|
"clean": "rm -rf dist",
|
|
357
376
|
"typecheck": "tsc --noEmit -p tsconfig.build.json",
|
|
358
377
|
"docs:api": "npx -y -p typedoc@0.28.20 -p typedoc-plugin-markdown@4.12.0 -p typescript@5.8.3 typedoc && node ./scripts/normalize-api-doc-paths.mjs",
|
|
@@ -362,37 +381,37 @@
|
|
|
362
381
|
},
|
|
363
382
|
"peerDependencies": {
|
|
364
383
|
"@convex-dev/r2": ">=0.10.2",
|
|
384
|
+
"@op-engineering/op-sqlite": ">=18.2.5",
|
|
385
|
+
"better-sqlite3-multiple-ciphers": ">=13.0.3",
|
|
365
386
|
"convex": ">=1.42.1",
|
|
366
|
-
"drizzle-orm": ">=0.45.1",
|
|
367
387
|
"expo": ">=55.0.27",
|
|
368
388
|
"expo-constants": ">=55.0.7",
|
|
369
|
-
"expo-crypto": ">=55.0.16",
|
|
370
389
|
"expo-device": ">=55.0.15",
|
|
371
390
|
"expo-secure-store": ">=55.0.15",
|
|
372
391
|
"expo-sqlite": ">=55.0.17",
|
|
373
|
-
"fs-native-extensions": ">=1.2.7",
|
|
374
392
|
"idb": ">=8.0.3",
|
|
375
393
|
"react": ">=19.0.0",
|
|
376
394
|
"react-native": ">=0.83.6",
|
|
377
|
-
"react-native-device-info": ">=15.0.1"
|
|
395
|
+
"react-native-device-info": ">=15.0.1",
|
|
396
|
+
"react-native-keychain": ">=10.0.0"
|
|
378
397
|
},
|
|
379
398
|
"peerDependenciesMeta": {
|
|
380
399
|
"@convex-dev/r2": {
|
|
381
400
|
"optional": true
|
|
382
401
|
},
|
|
383
|
-
"
|
|
402
|
+
"@op-engineering/op-sqlite": {
|
|
384
403
|
"optional": true
|
|
385
404
|
},
|
|
386
|
-
"
|
|
405
|
+
"better-sqlite3-multiple-ciphers": {
|
|
387
406
|
"optional": true
|
|
388
407
|
},
|
|
389
|
-
"
|
|
408
|
+
"convex": {
|
|
390
409
|
"optional": true
|
|
391
410
|
},
|
|
392
|
-
"expo
|
|
411
|
+
"expo": {
|
|
393
412
|
"optional": true
|
|
394
413
|
},
|
|
395
|
-
"expo-
|
|
414
|
+
"expo-constants": {
|
|
396
415
|
"optional": true
|
|
397
416
|
},
|
|
398
417
|
"expo-device": {
|
|
@@ -404,9 +423,6 @@
|
|
|
404
423
|
"expo-sqlite": {
|
|
405
424
|
"optional": true
|
|
406
425
|
},
|
|
407
|
-
"fs-native-extensions": {
|
|
408
|
-
"optional": true
|
|
409
|
-
},
|
|
410
426
|
"idb": {
|
|
411
427
|
"optional": true
|
|
412
428
|
},
|
|
@@ -418,6 +434,9 @@
|
|
|
418
434
|
},
|
|
419
435
|
"react-native-device-info": {
|
|
420
436
|
"optional": true
|
|
437
|
+
},
|
|
438
|
+
"react-native-keychain": {
|
|
439
|
+
"optional": true
|
|
421
440
|
}
|
|
422
441
|
},
|
|
423
442
|
"dependencies": {
|
|
@@ -437,24 +456,24 @@
|
|
|
437
456
|
},
|
|
438
457
|
"devDependencies": {
|
|
439
458
|
"@convex-dev/r2": "^0.10.2",
|
|
459
|
+
"@op-engineering/op-sqlite": "^18.2.5",
|
|
440
460
|
"@swc/core": "^1.15.43",
|
|
441
461
|
"@types/async-lock": "^1.4.0",
|
|
442
462
|
"@types/node": "^22.0.0",
|
|
443
463
|
"@types/react": "^19.2.0",
|
|
464
|
+
"better-sqlite3-multiple-ciphers": "^13.0.3",
|
|
444
465
|
"convex": "^1.46.0",
|
|
445
|
-
"drizzle-orm": "^0.45.3",
|
|
446
466
|
"esbuild": "^0.27.0",
|
|
447
467
|
"expo": "~57.0.25",
|
|
448
468
|
"expo-constants": "~57.0.19",
|
|
449
|
-
"expo-crypto": "~57.0.3",
|
|
450
469
|
"expo-device": "~57.0.2",
|
|
451
470
|
"expo-secure-store": "~57.0.4",
|
|
452
471
|
"expo-sqlite": "~57.0.3",
|
|
453
|
-
"fs-native-extensions": "^1.5.1",
|
|
454
472
|
"idb": "^8.0.3",
|
|
455
473
|
"react": "19.2.3",
|
|
456
474
|
"react-native": "0.86.3",
|
|
457
475
|
"react-native-device-info": "^15.0.1",
|
|
476
|
+
"react-native-keychain": "^10.0.0",
|
|
458
477
|
"typescript": "^7.0.2"
|
|
459
478
|
}
|
|
460
479
|
}
|
package/profile/README.md
CHANGED
|
@@ -18,12 +18,9 @@ import {
|
|
|
18
18
|
decryptProfileName,
|
|
19
19
|
encryptProfileName,
|
|
20
20
|
getOrCreateOwnProfileKey,
|
|
21
|
-
setProfileKeyStorage,
|
|
22
21
|
} from "@open-e2ee/signal-protocol-sdk/profile";
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const profileKey = await getOrCreateOwnProfileKey();
|
|
23
|
+
const profileKey = await getOrCreateOwnProfileKey(secretVault);
|
|
27
24
|
const encryptedName = await encryptProfileName(profileKey, "Alice");
|
|
28
25
|
const { name } = await decryptProfileName(profileKey, encryptedName);
|
|
29
26
|
```
|
|
@@ -33,13 +30,14 @@ an application-owned API. Profile-key rotation is a coordinated operation.
|
|
|
33
30
|
Persist the new encrypted snapshot, distribute the new key through encrypted
|
|
34
31
|
messages, and retain enough local state to recover from interruption.
|
|
35
32
|
|
|
36
|
-
`
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
`secretVault` is the `SignalProtocolLocalSecretVault` that the application
|
|
34
|
+
passes to every own-profile-key call. The key is kept only in that vault, as
|
|
35
|
+
its raw 32 bytes. On Expo, use `ExpoSecureStoreSignalProtocolSecretVault` from
|
|
36
|
+
`@open-e2ee/signal-protocol-sdk/local/vault/expo-secure-store`. Other runtimes
|
|
37
|
+
pass their own implementation. The SDK has no fallback store: it never writes
|
|
38
|
+
the key to `localStorage`, and a call with no vault throws an `EncryptionError`
|
|
39
|
+
with code `SECRET_VAULT_REQUIRED`. Storage confidentiality, backup, migration,
|
|
40
|
+
and account-reset behavior remain host-application responsibilities.
|
|
43
41
|
|
|
44
42
|
See the [security model](../docs/SECURITY.md) and
|
|
45
43
|
[API reference](../docs/api/README.md).
|
package/remote/README.md
CHANGED
|
@@ -34,11 +34,10 @@ replaceable and prevent them from owning private keys or plaintext.
|
|
|
34
34
|
import { createHostedSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
|
|
35
35
|
import { expoStore } from "@open-e2ee/signal-protocol-sdk/local/store/expo";
|
|
36
36
|
|
|
37
|
-
// Initialize the application-owned Expo/SQLCipher database bindings first.
|
|
38
37
|
const signal = await createHostedSignalProtocolClient({
|
|
39
38
|
adapters: {
|
|
40
39
|
// Expo storage owns this device's private keys and session state.
|
|
41
|
-
storage: expoStore(),
|
|
40
|
+
storage: await expoStore(),
|
|
42
41
|
},
|
|
43
42
|
hosted: {
|
|
44
43
|
// The environment-scoped connection URL from the OpenE2EE console.
|