@open-e2ee/signal-protocol-sdk 7.2.0 → 8.0.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 +54 -7
- package/ARCHITECTURE.md +1 -0
- package/CHANGELOG.md +503 -0
- package/README.md +9 -5
- 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 +149 -90
- 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.map +1 -1
- package/dist/client/hosted-transport.js +10 -11
- 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/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 +10 -5
- package/dist/local/store/index.d.ts.map +1 -1
- package/dist/local/store/index.js +10 -5
- 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 +169 -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 +36 -0
- package/dist/local/store/sqlite/web/worker.d.ts.map +1 -0
- package/dist/local/store/sqlite/web/worker.js +616 -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 +98 -0
- package/dist/local/store/web-sqlite/adapter.d.ts.map +1 -0
- package/dist/local/store/web-sqlite/adapter.js +151 -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 +80 -8
- package/docs/CLIENT_COMPOSITION.md +1 -2
- package/docs/DEVIATIONS.md +1 -1
- package/docs/ERROR_HANDLING.md +6 -0
- package/docs/GETTING_STARTED.md +1 -2
- package/docs/PACKAGE_SURFACE.md +29 -11
- package/docs/RECIPES.md +1 -2
- package/examples/browser/index.html +1 -1
- package/local/store/README.md +117 -37
- 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 +9 -0
- package/local/store/web-sqlite/README.md +202 -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,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Driver seam for the shared SQLite core.
|
|
3
|
+
*
|
|
4
|
+
* Each platform entry supplies one `SqliteDriver` over its binding. The core
|
|
5
|
+
* owns everything above it: the schema, the migrations, the statement queue,
|
|
6
|
+
* the transactions, the cipher policy, and the key custody. A driver runs
|
|
7
|
+
* statements and nothing else, so each binding has one small code path.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* A value that SQLite binds or returns. Every SDK column is TEXT or INTEGER,
|
|
11
|
+
* and every SDK integer fits in a double. A driver converts a binding's
|
|
12
|
+
* bigint or boolean to `number`.
|
|
13
|
+
*/
|
|
14
|
+
export type SqliteValue = string | number | null;
|
|
15
|
+
/** One result row, keyed by column name or alias. */
|
|
16
|
+
export type SqliteRow = Readonly<Record<string, SqliteValue>>;
|
|
17
|
+
export interface SqliteStatementResult {
|
|
18
|
+
/** The rows the statement returned. Empty for a statement without rows. */
|
|
19
|
+
readonly rows: readonly SqliteRow[];
|
|
20
|
+
/**
|
|
21
|
+
* The rows that an INSERT, UPDATE, or DELETE changed. The core reads it only
|
|
22
|
+
* after one of those statements.
|
|
23
|
+
*/
|
|
24
|
+
readonly changes: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* One pinned connection to one database file.
|
|
28
|
+
*
|
|
29
|
+
* The core never starts a statement before the previous one settles, so a
|
|
30
|
+
* driver does not queue. A driver never moves a statement to another
|
|
31
|
+
* connection: BEGIN, the statements, and COMMIT must reach the same one.
|
|
32
|
+
*
|
|
33
|
+
* The web driver shares each file between the tabs of an origin. When another
|
|
34
|
+
* tab asks for the file, the driver closes the physical connection at an
|
|
35
|
+
* autocommit boundary, and it opens the file again at the next call. The
|
|
36
|
+
* reopen restores only `PRAGMA foreign_keys`, and it rejects with
|
|
37
|
+
* `INVALID_STATE` when another tab changed `PRAGMA user_version`. TEMP tables
|
|
38
|
+
* and other TEMP objects, every other PRAGMA, and `last_insert_rowid()` do not
|
|
39
|
+
* survive a reopen. The core must not keep any of them across statements.
|
|
40
|
+
*
|
|
41
|
+
* A failed statement rejects with an `Error` whose message contains the
|
|
42
|
+
* SQLite message text, for example `UNIQUE constraint failed`. The core
|
|
43
|
+
* classifies errors from that text in one place, because not every binding
|
|
44
|
+
* reports the SQLite result code.
|
|
45
|
+
*/
|
|
46
|
+
export interface SqliteConnection {
|
|
47
|
+
/** Run one statement with positional `?` parameters. */
|
|
48
|
+
execute(sql: string, params?: readonly SqliteValue[]): Promise<SqliteStatementResult>;
|
|
49
|
+
/**
|
|
50
|
+
* Return the cipher that protects this connection, or `null` when the
|
|
51
|
+
* connection has no codec. The probe reports a cipher only when a codec is
|
|
52
|
+
* attached, because a cipher build also answers its version pragma on a
|
|
53
|
+
* connection with no key. SQLCipher answers `PRAGMA cipher_version` on
|
|
54
|
+
* every connection, so `cipher_version` alone is not proof: the probe
|
|
55
|
+
* returns `null` when `PRAGMA cipher_provider` returns no row, and only
|
|
56
|
+
* then reads `cipher_version`. SQLite3 Multiple Ciphers reads
|
|
57
|
+
* `PRAGMA cipher` and returns it only when
|
|
58
|
+
* `sqlite3mc_codec_data('cipher_salt')` is not NULL, because
|
|
59
|
+
* `PRAGMA cipher` also answers on an unkeyed plaintext database.
|
|
60
|
+
*/
|
|
61
|
+
probeCipher(): Promise<string | null>;
|
|
62
|
+
close(): Promise<void>;
|
|
63
|
+
}
|
|
64
|
+
/** The binding for one platform. The driver owns the file location. */
|
|
65
|
+
export interface SqliteDriver {
|
|
66
|
+
/** A short binding name for errors and logs, for example `op-sqlite`. */
|
|
67
|
+
readonly name: string;
|
|
68
|
+
/**
|
|
69
|
+
* The identity of the database that `file` reaches: the same string for
|
|
70
|
+
* every file name and driver that reach the same database in this process,
|
|
71
|
+
* and a different string otherwise. The core keys its one-at-a-time open
|
|
72
|
+
* and the vault slot of the key on it.
|
|
73
|
+
*
|
|
74
|
+
* A driver whose directory is fixed for the app returns `file`. A driver
|
|
75
|
+
* whose directory the app chooses returns the canonical path of the file.
|
|
76
|
+
*/
|
|
77
|
+
identify(file: string): string;
|
|
78
|
+
/** Report whether the database file exists, without creating it. */
|
|
79
|
+
exists(file: string): Promise<boolean>;
|
|
80
|
+
/**
|
|
81
|
+
* Open or create the file on one dedicated connection.
|
|
82
|
+
*
|
|
83
|
+
* With a key, the driver applies the key before any other statement, in the
|
|
84
|
+
* raw-key encoding of its cipher, and never logs it. With `null`, the driver
|
|
85
|
+
* applies no key. The core decides between the two.
|
|
86
|
+
*
|
|
87
|
+
* Then the driver runs one read before journal mode or any other setting
|
|
88
|
+
* that touches the file. A driver that takes an owner lock through a lock
|
|
89
|
+
* mode, which does no I/O, sets it before the read, so that the read takes
|
|
90
|
+
* the lock.
|
|
91
|
+
*
|
|
92
|
+
* A cipher accepts any key and fails only at the first statement, so a wrong
|
|
93
|
+
* key, a missing key, or a key on a plaintext file rejects the open at the
|
|
94
|
+
* read, with the SQLite message text (`file is not a database`). The core
|
|
95
|
+
* runs no second read.
|
|
96
|
+
*/
|
|
97
|
+
open(file: string, key: Uint8Array | null): Promise<SqliteConnection>;
|
|
98
|
+
/** Delete the file and its journal, WAL, and shared-memory files. */
|
|
99
|
+
remove(file: string): Promise<void>;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The statement surface that the core gives to its models. The root executor
|
|
103
|
+
* and each transaction executor have this shape.
|
|
104
|
+
*
|
|
105
|
+
* Every call goes through the FIFO queue of its executor. A transaction holds
|
|
106
|
+
* the queue of its parent from begin to end, so a call on the parent from
|
|
107
|
+
* inside the callback waits for the transaction and never settles. A model
|
|
108
|
+
* takes the executor as a parameter and uses only that executor.
|
|
109
|
+
*/
|
|
110
|
+
export interface SqliteExecutor {
|
|
111
|
+
/** Run a write statement and return the changed row count. */
|
|
112
|
+
run(sql: string, params?: readonly SqliteValue[]): Promise<number>;
|
|
113
|
+
/** Run a query and return every row. */
|
|
114
|
+
all<Row extends SqliteRow = SqliteRow>(sql: string, params?: readonly SqliteValue[]): Promise<readonly Row[]>;
|
|
115
|
+
/** Run a query and return the first row, or `null`. */
|
|
116
|
+
first<Row extends SqliteRow = SqliteRow>(sql: string, params?: readonly SqliteValue[]): Promise<Row | null>;
|
|
117
|
+
/**
|
|
118
|
+
* Run `operation` in one transaction and return its result.
|
|
119
|
+
*
|
|
120
|
+
* On the root executor this is `BEGIN IMMEDIATE`, then `COMMIT`. On a
|
|
121
|
+
* transaction executor it is a `SAVEPOINT`, then `RELEASE`. When
|
|
122
|
+
* `operation` throws, the core rolls back that scope and rethrows the
|
|
123
|
+
* original error. After the scope ends, a call on its executor rejects.
|
|
124
|
+
*/
|
|
125
|
+
transaction<T>(operation: (tx: SqliteExecutor) => Promise<T>): Promise<T>;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* One schema step. The core applies the missing steps in version order in one
|
|
129
|
+
* `BEGIN IMMEDIATE` transaction, and sets `PRAGMA user_version` to the last
|
|
130
|
+
* version in the same transaction.
|
|
131
|
+
*/
|
|
132
|
+
export interface SqliteMigration {
|
|
133
|
+
/** Consecutive from 1. */
|
|
134
|
+
readonly version: number;
|
|
135
|
+
/** Statements without parameters, run in order. */
|
|
136
|
+
readonly statements: readonly string[];
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=driver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../../local/store/sqlite/driver.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAEjD,qDAAqD;AACrD,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AAE9D,MAAM,WAAW,qBAAqB;IACpC,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,OAAO,CACL,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,SAAS,WAAW,EAAE,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAElC;;;;;;;;;;;OAWG;IACH,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEtC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,uEAAuE;AACvE,MAAM,WAAW,YAAY;IAC3B,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;;;;OAQG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAE/B,oEAAoE;IACpE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEvC;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEtE,qEAAqE;IACrE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,WAAW,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnE,wCAAwC;IACxC,GAAG,CAAC,GAAG,SAAS,SAAS,GAAG,SAAS,EACnC,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,SAAS,WAAW,EAAE,GAC9B,OAAO,CAAC,SAAS,GAAG,EAAE,CAAC,CAAC;IAE3B,uDAAuD;IACvD,KAAK,CAAC,GAAG,SAAS,SAAS,GAAG,SAAS,EACrC,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,SAAS,WAAW,EAAE,GAC9B,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;IAEvB;;;;;;;OAOG;IACH,WAAW,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC3E;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,0BAA0B;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,mDAAmD;IACnD,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Driver seam for the shared SQLite core.
|
|
3
|
+
*
|
|
4
|
+
* Each platform entry supplies one `SqliteDriver` over its binding. The core
|
|
5
|
+
* owns everything above it: the schema, the migrations, the statement queue,
|
|
6
|
+
* the transactions, the cipher policy, and the key custody. A driver runs
|
|
7
|
+
* statements and nothing else, so each binding has one small code path.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=driver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"driver.js","sourceRoot":"","sources":["../../../../local/store/sqlite/driver.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The encryption policy of the shared SQLite core.
|
|
3
|
+
*
|
|
4
|
+
* Every SQLite entry opens an encrypted database unless the application
|
|
5
|
+
* passes `encryptionAtRest: false`. A binding without a cipher accepts
|
|
6
|
+
* `PRAGMA key` and writes plaintext with no error, so the core asks the
|
|
7
|
+
* driver's cipher probe after each keyed open and refuses a connection that
|
|
8
|
+
* reports no cipher.
|
|
9
|
+
*
|
|
10
|
+
* The core records the setting that created the database in
|
|
11
|
+
* `PRAGMA application_id`, so a later open with the other setting fails
|
|
12
|
+
* closed. The header field needs no table, so the account wipe and the
|
|
13
|
+
* migrations do not touch it.
|
|
14
|
+
*/
|
|
15
|
+
import { type Logger } from '../../../logger.js';
|
|
16
|
+
import type { SqliteConnection, SqliteDriver } from './driver.js';
|
|
17
|
+
/** The encryption option that every SQLite entry accepts. */
|
|
18
|
+
export interface SqliteEncryptionOptions {
|
|
19
|
+
/**
|
|
20
|
+
* Pass `false` to store the database without encryption. The store then
|
|
21
|
+
* opens on a binding without a cipher, such as expo-sqlite on the web, and
|
|
22
|
+
* logs a warning at every open. The setting is recorded in the database, so
|
|
23
|
+
* a database created with one setting does not open with the other.
|
|
24
|
+
*
|
|
25
|
+
* Default: `true`. The open fails when the binding has no cipher.
|
|
26
|
+
*/
|
|
27
|
+
readonly encryptionAtRest?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface SqliteOpenOptions extends SqliteEncryptionOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Receives the warning of each open without encryption. Default: the SDK
|
|
32
|
+
* logger, which writes warnings to the console outside tests.
|
|
33
|
+
*/
|
|
34
|
+
readonly logger?: Logger;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Check the key against the setting before the driver opens the file. An
|
|
38
|
+
* encrypted open without a key would create a plaintext file, and a key with
|
|
39
|
+
* the opt-out means that the entry read the vault for a database that does
|
|
40
|
+
* not use it.
|
|
41
|
+
*/
|
|
42
|
+
export declare function assertSqliteKeyMatchesSetting(key: Uint8Array | null, options: SqliteEncryptionOptions): void;
|
|
43
|
+
/**
|
|
44
|
+
* Enforce the encryption setting on a connection that the driver just opened.
|
|
45
|
+
* On a failure, it closes the connection before it throws. Nothing is written
|
|
46
|
+
* to the file until every check passes.
|
|
47
|
+
*/
|
|
48
|
+
export declare function enforceSqliteEncryption(connection: SqliteConnection, driverName: string, options: SqliteOpenOptions): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Report whether an existing file is a database that the core recorded as
|
|
51
|
+
* plaintext. An encrypted open with no key in the vault asks this before it
|
|
52
|
+
* reports a lost key, because a plaintext store opened with the default
|
|
53
|
+
* setting is a setting mismatch, and the remedy for a lost key deletes the
|
|
54
|
+
* store.
|
|
55
|
+
*
|
|
56
|
+
* The check opens the file with no key, reads `PRAGMA application_id`, and
|
|
57
|
+
* closes. It writes nothing. An encrypted file, a file that is not a
|
|
58
|
+
* database, and a file with another id are not plaintext stores.
|
|
59
|
+
*/
|
|
60
|
+
export declare function isPlaintextSqliteDatabase(driver: SqliteDriver, file: string): Promise<boolean>;
|
|
61
|
+
//# sourceMappingURL=encryption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["../../../../local/store/sqlite/encryption.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAA+B,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAQ/D,6DAA6D;AAC7D,MAAM,WAAW,uBAAuB;IACtC;;;;;;;OAOG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,iBAAkB,SAAQ,uBAAuB;IAChE;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAOD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE,UAAU,GAAG,IAAI,EACtB,OAAO,EAAE,uBAAuB,GAC/B,IAAI,CAUN;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,gBAAgB,EAC5B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CA0Bf;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC,CAgBlB"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The encryption policy of the shared SQLite core.
|
|
3
|
+
*
|
|
4
|
+
* Every SQLite entry opens an encrypted database unless the application
|
|
5
|
+
* passes `encryptionAtRest: false`. A binding without a cipher accepts
|
|
6
|
+
* `PRAGMA key` and writes plaintext with no error, so the core asks the
|
|
7
|
+
* driver's cipher probe after each keyed open and refuses a connection that
|
|
8
|
+
* reports no cipher.
|
|
9
|
+
*
|
|
10
|
+
* The core records the setting that created the database in
|
|
11
|
+
* `PRAGMA application_id`, so a later open with the other setting fails
|
|
12
|
+
* closed. The header field needs no table, so the account wipe and the
|
|
13
|
+
* migrations do not touch it.
|
|
14
|
+
*/
|
|
15
|
+
import { EncryptionError, EncryptionErrorCode } from '../../../types/errors.js';
|
|
16
|
+
import { resolveSignalProtocolLogger } from '../../../logger.js';
|
|
17
|
+
import { SqliteEncryptionUnavailableError, SqliteKeyMismatchError, SqliteStoreInUseError, classifySqliteError, } from './errors.js';
|
|
18
|
+
// The application id is a 32-bit header field that SQLite stores and never
|
|
19
|
+
// reads. 0 is a database that no core open has recorded yet.
|
|
20
|
+
const ENCRYPTED_DATABASE_ID = 0x4f453245; // "OE2E"
|
|
21
|
+
const PLAINTEXT_DATABASE_ID = 0x4f453250; // "OE2P"
|
|
22
|
+
/**
|
|
23
|
+
* Check the key against the setting before the driver opens the file. An
|
|
24
|
+
* encrypted open without a key would create a plaintext file, and a key with
|
|
25
|
+
* the opt-out means that the entry read the vault for a database that does
|
|
26
|
+
* not use it.
|
|
27
|
+
*/
|
|
28
|
+
export function assertSqliteKeyMatchesSetting(key, options) {
|
|
29
|
+
const encrypted = options.encryptionAtRest !== false;
|
|
30
|
+
if (encrypted === (key !== null))
|
|
31
|
+
return;
|
|
32
|
+
throw new EncryptionError(encrypted
|
|
33
|
+
? 'An encrypted SQLite open needs a database key.'
|
|
34
|
+
: 'A SQLite open with encryptionAtRest: false takes no database key.', EncryptionErrorCode.INVALID_STATE, { operation: 'open' });
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Enforce the encryption setting on a connection that the driver just opened.
|
|
38
|
+
* On a failure, it closes the connection before it throws. Nothing is written
|
|
39
|
+
* to the file until every check passes.
|
|
40
|
+
*/
|
|
41
|
+
export async function enforceSqliteEncryption(connection, driverName, options) {
|
|
42
|
+
const encrypted = options.encryptionAtRest !== false;
|
|
43
|
+
const expected = encrypted ? ENCRYPTED_DATABASE_ID : PLAINTEXT_DATABASE_ID;
|
|
44
|
+
try {
|
|
45
|
+
const { rows } = await connection.execute('PRAGMA application_id');
|
|
46
|
+
const recorded = rows[0]?.application_id ?? 0;
|
|
47
|
+
if (recorded !== 0 && recorded !== expected) {
|
|
48
|
+
throw new SqliteKeyMismatchError(driverName);
|
|
49
|
+
}
|
|
50
|
+
if (encrypted && (await connection.probeCipher()) === null) {
|
|
51
|
+
throw new SqliteEncryptionUnavailableError(driverName);
|
|
52
|
+
}
|
|
53
|
+
if (recorded === 0) {
|
|
54
|
+
await connection.execute(`PRAGMA application_id = ${expected}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
// The policy error is the one to report. A failed close adds nothing.
|
|
59
|
+
await connection.close().catch(() => undefined);
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
if (!encrypted) {
|
|
63
|
+
resolveSignalProtocolLogger(options.logger).warn(`The ${driverName} database is not encrypted at rest (encryptionAtRest: false).`, { driver: driverName });
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Report whether an existing file is a database that the core recorded as
|
|
68
|
+
* plaintext. An encrypted open with no key in the vault asks this before it
|
|
69
|
+
* reports a lost key, because a plaintext store opened with the default
|
|
70
|
+
* setting is a setting mismatch, and the remedy for a lost key deletes the
|
|
71
|
+
* store.
|
|
72
|
+
*
|
|
73
|
+
* The check opens the file with no key, reads `PRAGMA application_id`, and
|
|
74
|
+
* closes. It writes nothing. An encrypted file, a file that is not a
|
|
75
|
+
* database, and a file with another id are not plaintext stores.
|
|
76
|
+
*/
|
|
77
|
+
export async function isPlaintextSqliteDatabase(driver, file) {
|
|
78
|
+
let connection;
|
|
79
|
+
try {
|
|
80
|
+
connection = await driver.open(file, null);
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
const kind = classifySqliteError(error);
|
|
84
|
+
if (kind === 'not-a-database')
|
|
85
|
+
return false;
|
|
86
|
+
if (kind === 'busy')
|
|
87
|
+
throw new SqliteStoreInUseError(driver.name, error);
|
|
88
|
+
throw error;
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
const { rows } = await connection.execute('PRAGMA application_id');
|
|
92
|
+
return rows[0]?.application_id === PLAINTEXT_DATABASE_ID;
|
|
93
|
+
}
|
|
94
|
+
finally {
|
|
95
|
+
await connection.close().catch(() => undefined);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=encryption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encryption.js","sourceRoot":"","sources":["../../../../local/store/sqlite/encryption.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQLite error classification for the shared core.
|
|
3
|
+
*
|
|
4
|
+
* Not every binding reports the SQLite result code (op-sqlite does not), so
|
|
5
|
+
* the core classifies an error from the SQLite message text that every driver
|
|
6
|
+
* keeps in the error message. This module is the one place that reads it.
|
|
7
|
+
*/
|
|
8
|
+
import { EncryptionError } from '../../../types/errors.js';
|
|
9
|
+
export type SqliteErrorKind =
|
|
10
|
+
/** A UNIQUE or PRIMARY KEY constraint rejected the statement. */
|
|
11
|
+
'unique-constraint'
|
|
12
|
+
/** Another connection holds the lock: `SQLITE_BUSY`. */
|
|
13
|
+
| 'busy'
|
|
14
|
+
/** The file is not a database with this key and settings: `SQLITE_NOTADB`. */
|
|
15
|
+
| 'not-a-database'
|
|
16
|
+
/**
|
|
17
|
+
* The file cannot grow: the disk or the storage quota is full, or the file
|
|
18
|
+
* is at `PRAGMA max_page_count`. `SQLITE_FULL` has no extended codes.
|
|
19
|
+
*/
|
|
20
|
+
| 'full' | 'other';
|
|
21
|
+
export declare function classifySqliteError(error: unknown): SqliteErrorKind;
|
|
22
|
+
/**
|
|
23
|
+
* Return a full file as `StorageQuotaExceededError`, with the driver error as
|
|
24
|
+
* its original error. Return every other error unchanged. SQLite rolls back
|
|
25
|
+
* the statement that failed, and the executor rolls back its transaction.
|
|
26
|
+
*/
|
|
27
|
+
export declare function toStorageQuotaError(error: unknown): unknown;
|
|
28
|
+
/**
|
|
29
|
+
* A call on a store or a transaction scope that has ended. No statement ran.
|
|
30
|
+
*/
|
|
31
|
+
export declare class SqliteStoreClosedError extends EncryptionError {
|
|
32
|
+
constructor(message: string);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* An existing database file could not be read with the key and encryption
|
|
36
|
+
* setting of this open. The file is not reported as corrupt: a wrong key, a
|
|
37
|
+
* missing key, and a plaintext file opened with a key all fail the same way.
|
|
38
|
+
* A database that records the other `encryptionAtRest` setting also fails
|
|
39
|
+
* this way, with no original error.
|
|
40
|
+
*/
|
|
41
|
+
export declare class SqliteKeyMismatchError extends EncryptionError {
|
|
42
|
+
constructor(driver: string, originalError?: unknown);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A keyed open would store the database as plaintext. The driver refuses
|
|
46
|
+
* the key on a binding that has no cipher, or the binding reports no cipher
|
|
47
|
+
* after the open because its driver did not apply the key.
|
|
48
|
+
*/
|
|
49
|
+
export declare class SqliteEncryptionUnavailableError extends EncryptionError {
|
|
50
|
+
constructor(driver: string);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A new database file could not be read right after the driver created it.
|
|
54
|
+
* No key or setting from an earlier open applies, so the file is corrupt.
|
|
55
|
+
*/
|
|
56
|
+
export declare class SqliteStoreCorruptError extends EncryptionError {
|
|
57
|
+
constructor(driver: string, originalError: unknown);
|
|
58
|
+
}
|
|
59
|
+
/** Another connection or process holds the database file. */
|
|
60
|
+
export declare class SqliteStoreInUseError extends EncryptionError {
|
|
61
|
+
constructor(driver: string, originalError: unknown);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A newer SDK wrote the database file. Its schema version is above the last
|
|
65
|
+
* migration step that this SDK knows, so this SDK does not open it.
|
|
66
|
+
*/
|
|
67
|
+
export declare class SqliteSchemaTooNewError extends EncryptionError {
|
|
68
|
+
constructor(fileVersion: number, knownVersion: number);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../local/store/sqlite/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,eAAe,EAGhB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,eAAe;AACzB,iEAAiE;AAC/D,mBAAmB;AACrB,wDAAwD;GACtD,MAAM;AACR,8EAA8E;GAC5E,gBAAgB;AAClB;;;GAGG;GACD,MAAM,GACN,OAAO,CAAC;AAQZ,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CASnE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAG3D;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,eAAe;IACzD,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAED;;;;;;GAMG;AACH,qBAAa,sBAAuB,SAAQ,eAAe;IACzD,YAAY,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,OAAO,EAQlD;CACF;AAED;;;;GAIG;AACH,qBAAa,gCAAiC,SAAQ,eAAe;IACnE,YAAY,MAAM,EAAE,MAAM,EASzB;CACF;AAED;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,eAAe;IAC1D,YAAY,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAOjD;CACF;AAED,6DAA6D;AAC7D,qBAAa,qBAAsB,SAAQ,eAAe;IACxD,YAAY,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAOjD;CACF;AAED;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,eAAe;IAC1D,YAAY,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAQpD;CACF"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQLite error classification for the shared core.
|
|
3
|
+
*
|
|
4
|
+
* Not every binding reports the SQLite result code (op-sqlite does not), so
|
|
5
|
+
* the core classifies an error from the SQLite message text that every driver
|
|
6
|
+
* keeps in the error message. This module is the one place that reads it.
|
|
7
|
+
*/
|
|
8
|
+
import { EncryptionError, EncryptionErrorCode, StorageQuotaExceededError, } from '../../../types/errors.js';
|
|
9
|
+
// A binding error can come from another realm and fail `instanceof Error`.
|
|
10
|
+
function messageOf(error) {
|
|
11
|
+
const message = error?.message;
|
|
12
|
+
return typeof message === 'string' ? message : String(error);
|
|
13
|
+
}
|
|
14
|
+
export function classifySqliteError(error) {
|
|
15
|
+
const message = messageOf(error);
|
|
16
|
+
if (/UNIQUE constraint failed|PRIMARY KEY constraint failed/.test(message)) {
|
|
17
|
+
return 'unique-constraint';
|
|
18
|
+
}
|
|
19
|
+
if (/database is locked|SQLITE_BUSY/.test(message))
|
|
20
|
+
return 'busy';
|
|
21
|
+
if (/file is not a database|SQLITE_NOTADB/.test(message))
|
|
22
|
+
return 'not-a-database';
|
|
23
|
+
if (/database or disk is full|SQLITE_FULL/.test(message))
|
|
24
|
+
return 'full';
|
|
25
|
+
return 'other';
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Return a full file as `StorageQuotaExceededError`, with the driver error as
|
|
29
|
+
* its original error. Return every other error unchanged. SQLite rolls back
|
|
30
|
+
* the statement that failed, and the executor rolls back its transaction.
|
|
31
|
+
*/
|
|
32
|
+
export function toStorageQuotaError(error) {
|
|
33
|
+
if (classifySqliteError(error) !== 'full')
|
|
34
|
+
return error;
|
|
35
|
+
return new StorageQuotaExceededError('sqlite', error);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A call on a store or a transaction scope that has ended. No statement ran.
|
|
39
|
+
*/
|
|
40
|
+
export class SqliteStoreClosedError extends EncryptionError {
|
|
41
|
+
constructor(message) {
|
|
42
|
+
super(message, EncryptionErrorCode.INVALID_STATE, { operation: 'sqlite' });
|
|
43
|
+
this.name = 'SqliteStoreClosedError';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* An existing database file could not be read with the key and encryption
|
|
48
|
+
* setting of this open. The file is not reported as corrupt: a wrong key, a
|
|
49
|
+
* missing key, and a plaintext file opened with a key all fail the same way.
|
|
50
|
+
* A database that records the other `encryptionAtRest` setting also fails
|
|
51
|
+
* this way, with no original error.
|
|
52
|
+
*/
|
|
53
|
+
export class SqliteKeyMismatchError extends EncryptionError {
|
|
54
|
+
constructor(driver, originalError) {
|
|
55
|
+
super(`The ${driver} database exists but cannot be read with this key and encryption setting. ` +
|
|
56
|
+
'Open it with the key and setting that created it, or reset the store.', EncryptionErrorCode.KEY_STORAGE_ERROR, { operation: 'open', originalError: originalError });
|
|
57
|
+
this.name = 'SqliteKeyMismatchError';
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A keyed open would store the database as plaintext. The driver refuses
|
|
62
|
+
* the key on a binding that has no cipher, or the binding reports no cipher
|
|
63
|
+
* after the open because its driver did not apply the key.
|
|
64
|
+
*/
|
|
65
|
+
export class SqliteEncryptionUnavailableError extends EncryptionError {
|
|
66
|
+
constructor(driver) {
|
|
67
|
+
super(`The ${driver} database would not be encrypted, so the store did not ` +
|
|
68
|
+
'open. Use a SQLite build with a cipher, or pass ' +
|
|
69
|
+
'encryptionAtRest: false to store the database without encryption.', EncryptionErrorCode.KEY_STORAGE_ERROR, { operation: 'open' });
|
|
70
|
+
this.name = 'SqliteEncryptionUnavailableError';
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A new database file could not be read right after the driver created it.
|
|
75
|
+
* No key or setting from an earlier open applies, so the file is corrupt.
|
|
76
|
+
*/
|
|
77
|
+
export class SqliteStoreCorruptError extends EncryptionError {
|
|
78
|
+
constructor(driver, originalError) {
|
|
79
|
+
super(`The ${driver} database file is corrupt. It did not exist before this open.`, EncryptionErrorCode.KEY_STORAGE_ERROR, { operation: 'open', originalError: originalError });
|
|
80
|
+
this.name = 'SqliteStoreCorruptError';
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/** Another connection or process holds the database file. */
|
|
84
|
+
export class SqliteStoreInUseError extends EncryptionError {
|
|
85
|
+
constructor(driver, originalError) {
|
|
86
|
+
super(`The ${driver} database is open in another connection or process.`, EncryptionErrorCode.KEY_STORAGE_ERROR, { operation: 'open', originalError: originalError });
|
|
87
|
+
this.name = 'SqliteStoreInUseError';
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A newer SDK wrote the database file. Its schema version is above the last
|
|
92
|
+
* migration step that this SDK knows, so this SDK does not open it.
|
|
93
|
+
*/
|
|
94
|
+
export class SqliteSchemaTooNewError extends EncryptionError {
|
|
95
|
+
constructor(fileVersion, knownVersion) {
|
|
96
|
+
super(`The database schema is at version ${fileVersion}, but this SDK knows versions up to ` +
|
|
97
|
+
`${knownVersion}. Open the file with the SDK version that wrote it, or a newer one.`, EncryptionErrorCode.INVALID_STATE, { operation: 'open' });
|
|
98
|
+
this.name = 'SqliteSchemaTooNewError';
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../local/store/sqlite/errors.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Statement queue and transaction scopes for one pinned connection.
|
|
3
|
+
*
|
|
4
|
+
* The root executor runs every statement and transaction of one connection in
|
|
5
|
+
* one FIFO queue, reads included. A transaction holds the root queue from
|
|
6
|
+
* `BEGIN IMMEDIATE` to `COMMIT`, so no statement from outside can join it or
|
|
7
|
+
* be discarded by its rollback. Inside, the transaction executor has its own
|
|
8
|
+
* FIFO queue, and a nested scope is a savepoint.
|
|
9
|
+
*/
|
|
10
|
+
import type { SqliteConnection, SqliteExecutor } from './driver.js';
|
|
11
|
+
/** A root executor that also owns the end of its connection. */
|
|
12
|
+
export interface SqliteRootExecutor extends SqliteExecutor {
|
|
13
|
+
/**
|
|
14
|
+
* Wait for the queued work, then close the connection. Every later call
|
|
15
|
+
* rejects with `SqliteStoreClosedError`. A second call returns the first
|
|
16
|
+
* call's promise.
|
|
17
|
+
*/
|
|
18
|
+
close(): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
/** Create the root executor for one connection. The executor owns the connection. */
|
|
21
|
+
export declare function createSqliteExecutor(connection: SqliteConnection): SqliteRootExecutor;
|
|
22
|
+
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../../local/store/sqlite/executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EAIf,MAAM,UAAU,CAAC;AAGlB,gEAAgE;AAChE,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD;;;;OAIG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AA6HD,qFAAqF;AACrF,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,gBAAgB,GAAG,kBAAkB,CAgBrF"}
|