@open-e2ee/signal-protocol-sdk 2.0.2 → 3.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 +10 -17
- package/ARCHITECTURE.md +1 -2
- package/CHANGELOG.md +74 -0
- package/LICENSE +11 -655
- package/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +21 -0
- package/NOTICE +5 -7
- package/README.md +11 -11
- package/SECURITY.md +2 -2
- package/TROUBLESHOOTING.md +2 -6
- package/client/README.md +34 -16
- package/device/README.md +1 -1
- package/dist/client/client.d.ts +13 -2
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +136 -73
- package/dist/client/client.js.map +1 -1
- package/dist/client/config.d.ts +14 -18
- package/dist/client/config.d.ts.map +1 -1
- package/dist/client/config.js.map +1 -1
- package/dist/client/content-adapter.d.ts +2 -0
- package/dist/client/content-adapter.d.ts.map +1 -1
- package/dist/client/content-adapter.js +4 -0
- package/dist/client/content-adapter.js.map +1 -1
- package/dist/client/endorsement-manager.d.ts +4 -1
- package/dist/client/endorsement-manager.d.ts.map +1 -1
- package/dist/client/endorsement-manager.js +14 -6
- package/dist/client/endorsement-manager.js.map +1 -1
- package/dist/client/group-authority.d.ts +8 -0
- package/dist/client/group-authority.d.ts.map +1 -0
- package/dist/client/group-authority.js +2 -0
- package/dist/client/group-authority.js.map +1 -0
- package/dist/client/headless.d.ts +3 -8
- package/dist/client/headless.d.ts.map +1 -1
- package/dist/client/headless.js +3 -8
- package/dist/client/headless.js.map +1 -1
- package/dist/client/hosted-anonymous-delivery.d.ts +32 -0
- package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -0
- package/dist/client/hosted-anonymous-delivery.js +239 -0
- package/dist/client/hosted-anonymous-delivery.js.map +1 -0
- 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 +18 -51
- package/dist/client/hosted-connection.js.map +1 -1
- package/dist/client/hosted-group-authority.d.ts +11 -0
- package/dist/client/hosted-group-authority.d.ts.map +1 -0
- package/dist/client/hosted-group-authority.js +96 -0
- package/dist/client/hosted-group-authority.js.map +1 -0
- package/dist/client/hosted-groups.d.ts +31 -0
- package/dist/client/hosted-groups.d.ts.map +1 -0
- package/dist/client/hosted-groups.js +217 -0
- package/dist/client/hosted-groups.js.map +1 -0
- package/dist/client/hosted-mailbox-subscription.d.ts +34 -0
- package/dist/client/hosted-mailbox-subscription.d.ts.map +1 -0
- package/dist/client/hosted-mailbox-subscription.js +257 -0
- package/dist/client/hosted-mailbox-subscription.js.map +1 -0
- package/dist/client/hosted-prekey-publication.d.ts +51 -0
- package/dist/client/hosted-prekey-publication.d.ts.map +1 -0
- package/dist/client/hosted-prekey-publication.js +249 -0
- package/dist/client/hosted-prekey-publication.js.map +1 -0
- package/dist/client/hosted-push.d.ts +4 -5
- package/dist/client/hosted-push.d.ts.map +1 -1
- package/dist/client/hosted-push.js +22 -22
- package/dist/client/hosted-push.js.map +1 -1
- package/dist/client/hosted-transport.d.ts +57 -35
- package/dist/client/hosted-transport.d.ts.map +1 -1
- package/dist/client/hosted-transport.js +666 -341
- package/dist/client/hosted-transport.js.map +1 -1
- package/dist/client/hosted-trust.d.ts +29 -0
- package/dist/client/hosted-trust.d.ts.map +1 -0
- package/dist/client/hosted-trust.js +28 -0
- package/dist/client/hosted-trust.js.map +1 -0
- package/dist/client/hosted.d.ts +18 -13
- package/dist/client/hosted.d.ts.map +1 -1
- package/dist/client/hosted.js +78 -34
- package/dist/client/hosted.js.map +1 -1
- package/dist/client/index.d.ts +14 -14
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +7 -7
- package/dist/client/index.js.map +1 -1
- package/dist/client/key-rotation-core.d.ts +8 -0
- package/dist/client/key-rotation-core.d.ts.map +1 -1
- package/dist/client/key-rotation-core.js +12 -1
- package/dist/client/key-rotation-core.js.map +1 -1
- package/dist/client/key-rotation.d.ts +2 -1
- package/dist/client/key-rotation.d.ts.map +1 -1
- package/dist/client/key-rotation.js +4 -4
- package/dist/client/key-rotation.js.map +1 -1
- package/dist/client/media-queue-persistence.d.ts +14 -0
- package/dist/client/media-queue-persistence.d.ts.map +1 -0
- package/dist/client/media-queue-persistence.js +123 -0
- package/dist/client/media-queue-persistence.js.map +1 -0
- package/dist/client/media-upload-budget.d.ts +3 -0
- package/dist/client/media-upload-budget.d.ts.map +1 -0
- package/dist/client/media-upload-budget.js +27 -0
- package/dist/client/media-upload-budget.js.map +1 -0
- package/dist/client/media.d.ts +51 -15
- package/dist/client/media.d.ts.map +1 -1
- package/dist/client/media.js +541 -73
- package/dist/client/media.js.map +1 -1
- package/dist/client/messages.d.ts.map +1 -1
- package/dist/client/messages.js +13 -14
- package/dist/client/messages.js.map +1 -1
- package/dist/client/prekeys.d.ts.map +1 -1
- package/dist/client/prekeys.js +131 -43
- package/dist/client/prekeys.js.map +1 -1
- package/dist/client/relay-subscription.d.ts +4 -0
- package/dist/client/relay-subscription.d.ts.map +1 -1
- package/dist/client/relay-subscription.js +58 -25
- package/dist/client/relay-subscription.js.map +1 -1
- package/dist/client/sender-key-distribution.d.ts +8 -0
- package/dist/client/sender-key-distribution.d.ts.map +1 -0
- package/dist/client/sender-key-distribution.js +59 -0
- package/dist/client/sender-key-distribution.js.map +1 -0
- package/dist/client/signal-service-cipher.d.ts +7 -3
- package/dist/client/signal-service-cipher.d.ts.map +1 -1
- package/dist/client/signal-service-cipher.js +41 -16
- package/dist/client/signal-service-cipher.js.map +1 -1
- package/dist/device/{expo-metadata.d.ts → expo/index.d.ts} +3 -3
- package/dist/device/expo/index.d.ts.map +1 -0
- package/dist/device/{expo-metadata.js → expo/index.js} +2 -2
- package/dist/device/expo/index.js.map +1 -0
- package/dist/device/index.js +1 -1
- package/dist/device/index.js.map +1 -1
- package/dist/device/provisioning.d.ts +1 -1
- package/dist/device/provisioning.js +1 -1
- package/dist/device/types.d.ts +1 -1
- package/dist/groups/server.d.ts +10 -0
- package/dist/groups/server.d.ts.map +1 -0
- package/dist/groups/server.js +6 -0
- package/dist/groups/server.js.map +1 -0
- package/dist/hooks/use-connection-presence.d.ts +2 -4
- package/dist/hooks/use-connection-presence.d.ts.map +1 -1
- package/dist/hooks/use-connection-presence.js +2 -4
- package/dist/hooks/use-connection-presence.js.map +1 -1
- package/dist/index.d.ts +51 -49
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -24
- package/dist/index.js.map +1 -1
- package/dist/internal/groups/authority-certificate.d.ts +22 -0
- package/dist/internal/groups/authority-certificate.d.ts.map +1 -0
- package/dist/internal/groups/authority-certificate.js +99 -0
- package/dist/internal/groups/authority-certificate.js.map +1 -0
- package/dist/internal/groups/error-details.d.ts +9 -0
- package/dist/internal/groups/error-details.d.ts.map +1 -0
- package/dist/internal/groups/error-details.js +30 -0
- package/dist/internal/groups/error-details.js.map +1 -0
- package/dist/internal/groups/manager.d.ts +5 -0
- package/dist/internal/groups/manager.d.ts.map +1 -1
- package/dist/internal/groups/manager.js +3 -0
- package/dist/internal/groups/manager.js.map +1 -1
- package/dist/internal/groups/server-engine.d.ts +7 -0
- package/dist/internal/groups/server-engine.d.ts.map +1 -1
- package/dist/internal/groups/server-engine.js +51 -19
- 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 +10 -9
- package/dist/internal/groups/wire.js.map +1 -1
- package/dist/internal/manager/manager.d.ts +1 -1
- package/dist/internal/manager/manager.d.ts.map +1 -1
- package/dist/internal/manager/manager.js +22 -25
- package/dist/internal/manager/manager.js.map +1 -1
- package/dist/internal/protocol/sender-keys/manager.d.ts +1 -1
- package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
- package/dist/internal/protocol/sender-keys/manager.js +27 -14
- package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
- package/dist/internal/sesame/manager.d.ts +2 -2
- package/dist/internal/sesame/manager.d.ts.map +1 -1
- package/dist/internal/sesame/manager.js +6 -6
- package/dist/internal/sesame/manager.js.map +1 -1
- package/dist/internal/sesame/types.d.ts +1 -1
- package/dist/internal/sesame/types.d.ts.map +1 -1
- package/dist/internal/session/cipher.d.ts +1 -1
- package/dist/internal/session/cipher.d.ts.map +1 -1
- package/dist/internal/session/cipher.js +31 -28
- package/dist/internal/session/cipher.js.map +1 -1
- package/dist/layers.d.ts +1 -1
- package/dist/layers.d.ts.map +1 -1
- package/dist/layers.js +1 -1
- package/dist/layers.js.map +1 -1
- package/dist/local/store/expo/adapter.d.ts +8 -2
- package/dist/local/store/expo/adapter.d.ts.map +1 -1
- package/dist/local/store/expo/adapter.js +28 -9
- package/dist/local/store/expo/adapter.js.map +1 -1
- package/dist/local/store/expo/key-storage.d.ts +7 -1
- package/dist/local/store/expo/key-storage.d.ts.map +1 -1
- package/dist/local/store/expo/key-storage.js +82 -17
- package/dist/local/store/expo/key-storage.js.map +1 -1
- package/dist/local/store/expo/models/kyber-prekey-used.d.ts +1 -4
- package/dist/local/store/expo/models/kyber-prekey-used.d.ts.map +1 -1
- package/dist/local/store/expo/models/kyber-prekey-used.js +23 -9
- package/dist/local/store/expo/models/kyber-prekey-used.js.map +1 -1
- package/dist/local/store/expo/models/kyber-prekey.d.ts +4 -4
- package/dist/local/store/expo/models/kyber-prekey.d.ts.map +1 -1
- package/dist/local/store/expo/models/kyber-prekey.js +67 -26
- package/dist/local/store/expo/models/kyber-prekey.js.map +1 -1
- package/dist/local/store/expo/schema.d.ts +21 -2
- package/dist/local/store/expo/schema.d.ts.map +1 -1
- package/dist/local/store/expo/schema.js +10 -2
- package/dist/local/store/expo/schema.js.map +1 -1
- package/dist/local/store/kyber-prekey-lifecycle.d.ts +46 -0
- package/dist/local/store/kyber-prekey-lifecycle.d.ts.map +1 -0
- package/dist/local/store/kyber-prekey-lifecycle.js +88 -0
- package/dist/local/store/kyber-prekey-lifecycle.js.map +1 -0
- package/dist/local/store/memory/adapter.d.ts +11 -3
- package/dist/local/store/memory/adapter.d.ts.map +1 -1
- package/dist/local/store/memory/adapter.js +113 -28
- package/dist/local/store/memory/adapter.js.map +1 -1
- package/dist/local/store/node/adapter.d.ts +8 -2
- package/dist/local/store/node/adapter.d.ts.map +1 -1
- package/dist/local/store/node/adapter.js +31 -13
- package/dist/local/store/node/adapter.js.map +1 -1
- package/dist/local/store/node/database-file-commit.d.ts +8 -0
- package/dist/local/store/node/database-file-commit.d.ts.map +1 -0
- package/dist/local/store/node/database-file-commit.js +62 -0
- package/dist/local/store/node/database-file-commit.js.map +1 -0
- package/dist/local/store/node/database-key.d.ts +6 -1
- package/dist/local/store/node/database-key.d.ts.map +1 -1
- package/dist/local/store/node/database-key.js +79 -44
- package/dist/local/store/node/database-key.js.map +1 -1
- package/dist/local/store/node/database-lock.d.ts +8 -0
- package/dist/local/store/node/database-lock.d.ts.map +1 -0
- package/dist/local/store/node/database-lock.js +44 -0
- package/dist/local/store/node/database-lock.js.map +1 -0
- package/dist/local/store/node/database.d.ts +15 -14
- package/dist/local/store/node/database.d.ts.map +1 -1
- package/dist/local/store/node/database.js +197 -202
- package/dist/local/store/node/database.js.map +1 -1
- package/dist/local/store/react-native/adapter.d.ts +8 -2
- package/dist/local/store/react-native/adapter.d.ts.map +1 -1
- package/dist/local/store/react-native/adapter.js +151 -66
- package/dist/local/store/react-native/adapter.js.map +1 -1
- package/dist/local/store/received-content.d.ts +9 -0
- package/dist/local/store/received-content.d.ts.map +1 -0
- package/dist/local/store/received-content.js +46 -0
- package/dist/local/store/received-content.js.map +1 -0
- package/dist/local/store/reliability.d.ts +2 -2
- package/dist/local/store/reliability.d.ts.map +1 -1
- package/dist/local/store/reliability.js +7 -4
- package/dist/local/store/reliability.js.map +1 -1
- package/dist/local/store/web/adapter.d.ts +8 -2
- package/dist/local/store/web/adapter.d.ts.map +1 -1
- package/dist/local/store/web/adapter.js +206 -73
- package/dist/local/store/web/adapter.js.map +1 -1
- package/dist/media/index.d.ts +71 -61
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +550 -386
- package/dist/media/index.js.map +1 -1
- package/dist/media/prepared-upload.d.ts +37 -0
- package/dist/media/prepared-upload.d.ts.map +1 -0
- package/dist/media/prepared-upload.js +46 -0
- package/dist/media/prepared-upload.js.map +1 -0
- package/dist/remote/object-store/convex-r2/server.d.ts +2 -1
- package/dist/remote/object-store/convex-r2/server.d.ts.map +1 -1
- package/dist/remote/object-store/convex-r2/server.js +4 -0
- package/dist/remote/object-store/convex-r2/server.js.map +1 -1
- package/dist/remote/object-store/convex-r2/storage.d.ts.map +1 -1
- package/dist/remote/object-store/convex-r2/storage.js +1 -0
- package/dist/remote/object-store/convex-r2/storage.js.map +1 -1
- package/dist/remote/object-store/index.d.ts +3 -1
- package/dist/remote/object-store/index.d.ts.map +1 -1
- package/dist/remote/object-store/index.js +1 -1
- package/dist/remote/object-store/index.js.map +1 -1
- package/dist/remote/object-store/s3/storage.d.ts +3 -1
- package/dist/remote/object-store/s3/storage.d.ts.map +1 -1
- package/dist/remote/object-store/s3/storage.js +9 -2
- package/dist/remote/object-store/s3/storage.js.map +1 -1
- package/dist/remote/object-store/types.d.ts +33 -4
- package/dist/remote/object-store/types.d.ts.map +1 -1
- package/dist/remote/object-store/upload-error.d.ts +23 -0
- package/dist/remote/object-store/upload-error.d.ts.map +1 -0
- package/dist/remote/object-store/upload-error.js +33 -0
- package/dist/remote/object-store/upload-error.js.map +1 -0
- package/dist/remote/object-store/validation.d.ts +7 -1
- package/dist/remote/object-store/validation.d.ts.map +1 -1
- package/dist/remote/object-store/validation.js +39 -25
- package/dist/remote/object-store/validation.js.map +1 -1
- package/dist/remote/relay/index.d.ts +5 -12
- package/dist/remote/relay/index.d.ts.map +1 -1
- package/dist/remote/relay/index.js +4 -11
- package/dist/remote/relay/index.js.map +1 -1
- package/dist/remote/relay/memory/adapter.d.ts +2 -1
- package/dist/remote/relay/memory/adapter.d.ts.map +1 -1
- package/dist/remote/relay/memory/adapter.js +10 -0
- package/dist/remote/relay/memory/adapter.js.map +1 -1
- package/dist/remote/relay/types.d.ts +28 -17
- package/dist/remote/relay/types.d.ts.map +1 -1
- package/dist/types/api.d.ts +36 -1
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/session.d.ts +6 -0
- package/dist/types/session.d.ts.map +1 -1
- package/dist/types/session.js.map +1 -1
- package/docs/ASSURANCE.md +7 -7
- package/docs/CLIENT_COMPOSITION.md +12 -19
- package/docs/DEVIATIONS.md +1 -1
- package/docs/DOCUMENTATION_STANDARDS.md +4 -0
- package/docs/GETTING_STARTED.md +23 -38
- package/docs/INTERFACES.md +22 -13
- package/docs/PACKAGE_SURFACE.md +5 -12
- package/docs/RECIPES.md +10 -23
- package/examples/browser/index.html +2 -2
- package/local/store/README.md +16 -1
- package/local/store/expo/README.md +23 -19
- package/local/store/node/README.md +29 -0
- package/media/README.md +94 -0
- package/package.json +17 -27
- package/remote/README.md +16 -16
- package/remote/object-store/README.md +8 -0
- package/remote/object-store/s3/README.md +10 -1
- package/remote/relay/README.md +3 -2
- package/COMMERCIAL.md +0 -56
- package/dist/device/expo-metadata.d.ts.map +0 -1
- package/dist/device/expo-metadata.js.map +0 -1
- package/dist/remote/relay/convex/backend.d.ts +0 -394
- package/dist/remote/relay/convex/backend.d.ts.map +0 -1
- package/dist/remote/relay/convex/backend.js +0 -678
- package/dist/remote/relay/convex/backend.js.map +0 -1
- package/dist/remote/relay/convex/component/_generated/api.d.ts +0 -58
- package/dist/remote/relay/convex/component/_generated/api.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/_generated/api.js +0 -31
- package/dist/remote/relay/convex/component/_generated/api.js.map +0 -1
- package/dist/remote/relay/convex/component/_generated/component.d.ts +0 -475
- package/dist/remote/relay/convex/component/_generated/component.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/_generated/component.js +0 -11
- package/dist/remote/relay/convex/component/_generated/component.js.map +0 -1
- package/dist/remote/relay/convex/component/_generated/dataModel.d.ts +0 -46
- package/dist/remote/relay/convex/component/_generated/dataModel.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/_generated/dataModel.js +0 -11
- package/dist/remote/relay/convex/component/_generated/dataModel.js.map +0 -1
- package/dist/remote/relay/convex/component/_generated/server.d.ts +0 -129
- package/dist/remote/relay/convex/component/_generated/server.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/_generated/server.js +0 -79
- package/dist/remote/relay/convex/component/_generated/server.js.map +0 -1
- package/dist/remote/relay/convex/component/accounts.d.ts +0 -45
- package/dist/remote/relay/convex/component/accounts.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/accounts.js +0 -184
- package/dist/remote/relay/convex/component/accounts.js.map +0 -1
- package/dist/remote/relay/convex/component/certificates.d.ts +0 -10
- package/dist/remote/relay/convex/component/certificates.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/certificates.js +0 -126
- package/dist/remote/relay/convex/component/certificates.js.map +0 -1
- package/dist/remote/relay/convex/component/cleanup.d.ts +0 -32
- package/dist/remote/relay/convex/component/cleanup.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/cleanup.js +0 -146
- package/dist/remote/relay/convex/component/cleanup.js.map +0 -1
- package/dist/remote/relay/convex/component/convex.config.d.ts +0 -5
- package/dist/remote/relay/convex/component/convex.config.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/convex.config.js +0 -35
- package/dist/remote/relay/convex/component/convex.config.js.map +0 -1
- package/dist/remote/relay/convex/component/crons.d.ts +0 -3
- package/dist/remote/relay/convex/component/crons.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/crons.js +0 -10
- package/dist/remote/relay/convex/component/crons.js.map +0 -1
- package/dist/remote/relay/convex/component/devices.d.ts +0 -102
- package/dist/remote/relay/convex/component/devices.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/devices.js +0 -300
- package/dist/remote/relay/convex/component/devices.js.map +0 -1
- package/dist/remote/relay/convex/component/errors.d.ts +0 -22
- package/dist/remote/relay/convex/component/errors.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/errors.js +0 -17
- package/dist/remote/relay/convex/component/errors.js.map +0 -1
- package/dist/remote/relay/convex/component/groups.d.ts +0 -63
- package/dist/remote/relay/convex/component/groups.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/groups.js +0 -341
- package/dist/remote/relay/convex/component/groups.js.map +0 -1
- package/dist/remote/relay/convex/component/keys.d.ts +0 -130
- package/dist/remote/relay/convex/component/keys.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/keys.js +0 -578
- package/dist/remote/relay/convex/component/keys.js.map +0 -1
- package/dist/remote/relay/convex/component/messages.d.ts +0 -105
- package/dist/remote/relay/convex/component/messages.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/messages.js +0 -702
- package/dist/remote/relay/convex/component/messages.js.map +0 -1
- package/dist/remote/relay/convex/component/provisioning.d.ts +0 -92
- package/dist/remote/relay/convex/component/provisioning.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/provisioning.js +0 -360
- package/dist/remote/relay/convex/component/provisioning.js.map +0 -1
- package/dist/remote/relay/convex/component/runtime.d.ts +0 -18
- package/dist/remote/relay/convex/component/runtime.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/runtime.js +0 -144
- package/dist/remote/relay/convex/component/runtime.js.map +0 -1
- package/dist/remote/relay/convex/component/schema.d.ts +0 -358
- package/dist/remote/relay/convex/component/schema.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/schema.js +0 -288
- package/dist/remote/relay/convex/component/schema.js.map +0 -1
- package/dist/remote/relay/convex/component/zkAuth.d.ts +0 -18
- package/dist/remote/relay/convex/component/zkAuth.d.ts.map +0 -1
- package/dist/remote/relay/convex/component/zkAuth.js +0 -86
- package/dist/remote/relay/convex/component/zkAuth.js.map +0 -1
- package/dist/remote/relay/convex/constants.d.ts +0 -3
- package/dist/remote/relay/convex/constants.d.ts.map +0 -1
- package/dist/remote/relay/convex/constants.js +0 -3
- package/dist/remote/relay/convex/constants.js.map +0 -1
- package/dist/remote/relay/convex/group-server.d.ts +0 -123
- package/dist/remote/relay/convex/group-server.d.ts.map +0 -1
- package/dist/remote/relay/convex/group-server.js +0 -184
- package/dist/remote/relay/convex/group-server.js.map +0 -1
- package/dist/remote/relay/convex/index.d.ts +0 -42
- package/dist/remote/relay/convex/index.d.ts.map +0 -1
- package/dist/remote/relay/convex/index.js +0 -38
- package/dist/remote/relay/convex/index.js.map +0 -1
- package/dist/remote/relay/convex/relay.d.ts +0 -323
- package/dist/remote/relay/convex/relay.d.ts.map +0 -1
- package/dist/remote/relay/convex/relay.js +0 -1144
- package/dist/remote/relay/convex/relay.js.map +0 -1
- package/dist/remote/relay/convex/types.d.ts +0 -24
- package/dist/remote/relay/convex/types.d.ts.map +0 -1
- package/dist/remote/relay/convex/types.js +0 -14
- package/dist/remote/relay/convex/types.js.map +0 -1
- package/remote/relay/convex/README.md +0 -61
- package/remote/relay/convex/component/README.md +0 -462
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ConvexGroupServer
|
|
3
|
-
*
|
|
4
|
-
* Implementation of IGroupServer using Convex mutations/queries for
|
|
5
|
-
* server-side encrypted group state storage.
|
|
6
|
-
*
|
|
7
|
-
* This is a client transport adapter, not an enforcing group server. The
|
|
8
|
-
* application-supplied Convex functions must implement the enforcing-server
|
|
9
|
-
* obligations. This adapter bridges IGroupServer (Uint8Array) to Convex
|
|
10
|
-
* v.bytes() (ArrayBuffer).
|
|
11
|
-
*
|
|
12
|
-
* The application supplies its generated Convex function references. Those
|
|
13
|
-
* functions retain responsibility for authentication, authorization, and
|
|
14
|
-
* persistence policy.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* ConvexGroupServer - Implementation of IGroupServer
|
|
18
|
-
*
|
|
19
|
-
* Bridges IGroupServer (Uint8Array-based) to Convex group mutations/queries
|
|
20
|
-
* (ArrayBuffer-based). All binary conversion happens at this boundary.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```typescript
|
|
24
|
-
* import { ConvexReactClient } from 'convex/react';
|
|
25
|
-
* import {
|
|
26
|
-
* ConvexGroupServer,
|
|
27
|
-
* type ConvexGroupServerApi,
|
|
28
|
-
* } from '@open-e2ee/signal-protocol-sdk/remote/relay/convex';
|
|
29
|
-
* import { api } from '../convex/_generated/api';
|
|
30
|
-
*
|
|
31
|
-
* const convex = new ConvexReactClient(process.env.CONVEX_URL!);
|
|
32
|
-
* const groupApi = api.signal.groups satisfies ConvexGroupServerApi;
|
|
33
|
-
* const groupServer = new ConvexGroupServer(convex, groupApi);
|
|
34
|
-
*
|
|
35
|
-
* // Use with GroupManager
|
|
36
|
-
* const manager = new GroupManager({
|
|
37
|
-
* server: groupServer,
|
|
38
|
-
* store: localStore,
|
|
39
|
-
* ...
|
|
40
|
-
* });
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
export class ConvexGroupServer {
|
|
44
|
-
convex;
|
|
45
|
-
api;
|
|
46
|
-
constructor(convex, api) {
|
|
47
|
-
this.convex = convex;
|
|
48
|
-
this.api = api;
|
|
49
|
-
}
|
|
50
|
-
// ════════════════════════════════════════════════════════════════════════════
|
|
51
|
-
// GROUP CRUD
|
|
52
|
-
// ════════════════════════════════════════════════════════════════════════════
|
|
53
|
-
/**
|
|
54
|
-
* Create a new encrypted group on the server.
|
|
55
|
-
*
|
|
56
|
-
* @param groupId - 32-byte group identifier (derived from GroupSecretParams)
|
|
57
|
-
* @param encryptedState - Serialized EncryptedGroup (JSON with hex-encoded binary fields)
|
|
58
|
-
* @param authorization - ZK auth credential presentation + group public params
|
|
59
|
-
*/
|
|
60
|
-
async createGroup(groupId, encryptedState, authorization) {
|
|
61
|
-
await this.convex.mutation(this.api.createGroup, {
|
|
62
|
-
groupId: this.toBytes(groupId),
|
|
63
|
-
encryptedState: this.toBytes(encryptedState),
|
|
64
|
-
presentation: this.toBytes(authorization.presentation),
|
|
65
|
-
groupPublicParams: this.toBytes(authorization.groupPublicParams),
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Get encrypted group state from the server.
|
|
70
|
-
*
|
|
71
|
-
* @param groupId - 32-byte group identifier
|
|
72
|
-
* @param authorization - ZK auth credential presentation + group public params
|
|
73
|
-
* @param version - Optional exact historical version
|
|
74
|
-
* @returns Encrypted state and version, or null if group/version does not exist
|
|
75
|
-
*/
|
|
76
|
-
async getGroup(groupId, authorization, version) {
|
|
77
|
-
const result = await this.convex.query(this.api.getGroup, {
|
|
78
|
-
groupId: this.toBytes(groupId),
|
|
79
|
-
presentation: this.toBytes(authorization.presentation),
|
|
80
|
-
groupPublicParams: this.toBytes(authorization.groupPublicParams),
|
|
81
|
-
version,
|
|
82
|
-
});
|
|
83
|
-
if (!result)
|
|
84
|
-
return null;
|
|
85
|
-
return {
|
|
86
|
-
encryptedState: new Uint8Array(result.encryptedState),
|
|
87
|
-
version: result.version,
|
|
88
|
-
baselineSignature: new Uint8Array(result.baselineSignature),
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
async getGroupJoinInfo(groupId, inviteLinkPassword, authorization) {
|
|
92
|
-
const result = await this.convex.query(this.api.getGroupJoinInfo, {
|
|
93
|
-
groupId: this.toBytes(groupId),
|
|
94
|
-
inviteLinkPassword: this.toBytes(inviteLinkPassword),
|
|
95
|
-
presentation: this.toBytes(authorization.presentation),
|
|
96
|
-
groupPublicParams: this.toBytes(authorization.groupPublicParams),
|
|
97
|
-
});
|
|
98
|
-
if (!result)
|
|
99
|
-
return null;
|
|
100
|
-
return {
|
|
101
|
-
encryptedJoinInfo: new Uint8Array(result.encryptedJoinInfo),
|
|
102
|
-
version: result.version,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Get one page of change log entries from a given version.
|
|
107
|
-
*
|
|
108
|
-
* Used for incremental group state sync. The enforcing backend authorizes
|
|
109
|
-
* at the requested snapshot, requires the requester to be a member there.
|
|
110
|
-
* Pending principals catch up by snapshot instead (S10a). It returns
|
|
111
|
-
* changes through the first transition that revokes the requester,
|
|
112
|
-
* inclusive. A page cut for size sets `hasMore`. Resume from the last
|
|
113
|
-
* served version.
|
|
114
|
-
*
|
|
115
|
-
* @param groupId - 32-byte group identifier
|
|
116
|
-
* @param fromVersion - Version to start from (exclusive)
|
|
117
|
-
* @param authorization - ZK auth credential presentation + group public params
|
|
118
|
-
* @returns One change-log page with encrypted changes and server signatures
|
|
119
|
-
*/
|
|
120
|
-
async getGroupChanges(groupId, fromVersion, authorization) {
|
|
121
|
-
const result = await this.convex.query(this.api.getGroupChanges, {
|
|
122
|
-
groupId: this.toBytes(groupId),
|
|
123
|
-
fromVersion,
|
|
124
|
-
presentation: this.toBytes(authorization.presentation),
|
|
125
|
-
groupPublicParams: this.toBytes(authorization.groupPublicParams),
|
|
126
|
-
});
|
|
127
|
-
return {
|
|
128
|
-
entries: result.entries.map((entry) => ({
|
|
129
|
-
version: entry.version,
|
|
130
|
-
actions: new Uint8Array(entry.actions),
|
|
131
|
-
serverSignature: new Uint8Array(entry.serverSignature),
|
|
132
|
-
changeEpoch: entry.changeEpoch,
|
|
133
|
-
timestamp: entry.timestamp,
|
|
134
|
-
})),
|
|
135
|
-
hasMore: result.hasMore,
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Submit a group change with optimistic concurrency control.
|
|
140
|
-
*
|
|
141
|
-
* The application server validates and applies the ciphertext Actions,
|
|
142
|
-
* signs the exact accepted bytes, and stores the transition atomically.
|
|
143
|
-
*
|
|
144
|
-
* @param groupId - 32-byte group identifier
|
|
145
|
-
* @param expectedVersion - Current version for optimistic concurrency
|
|
146
|
-
* @param actions - Client-proposed serialized encrypted Actions
|
|
147
|
-
* @param inviteLinkPassword - Independently verified link-join credential
|
|
148
|
-
* @param authorization - ZK auth credential presentation + group public params
|
|
149
|
-
* @returns Exact accepted Actions and their server signature
|
|
150
|
-
*/
|
|
151
|
-
async submitGroupChange(groupId, expectedVersion, actions, inviteLinkPassword, authorization) {
|
|
152
|
-
if (arguments.length !== 5) {
|
|
153
|
-
throw new Error('INVALID_REQUEST: Group change submission must not carry an epoch');
|
|
154
|
-
}
|
|
155
|
-
const result = await this.convex.mutation(this.api.submitGroupChange, {
|
|
156
|
-
groupId: this.toBytes(groupId),
|
|
157
|
-
expectedVersion,
|
|
158
|
-
actions: this.toBytes(actions),
|
|
159
|
-
inviteLinkPassword: this.toBytes(inviteLinkPassword),
|
|
160
|
-
presentation: this.toBytes(authorization.presentation),
|
|
161
|
-
groupPublicParams: this.toBytes(authorization.groupPublicParams),
|
|
162
|
-
});
|
|
163
|
-
return {
|
|
164
|
-
version: result.version,
|
|
165
|
-
actions: new Uint8Array(result.actions),
|
|
166
|
-
serverSignature: new Uint8Array(result.serverSignature),
|
|
167
|
-
changeEpoch: result.changeEpoch,
|
|
168
|
-
timestamp: result.timestamp,
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
// ════════════════════════════════════════════════════════════════════════════
|
|
172
|
-
// UTILITY METHODS
|
|
173
|
-
// ════════════════════════════════════════════════════════════════════════════
|
|
174
|
-
/**
|
|
175
|
-
* Convert Uint8Array to ArrayBuffer for Convex v.bytes() args.
|
|
176
|
-
*
|
|
177
|
-
* Handles the case where the Uint8Array is a view into a larger buffer
|
|
178
|
-
* by slicing to the exact byte range.
|
|
179
|
-
*/
|
|
180
|
-
toBytes(data) {
|
|
181
|
-
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
//# sourceMappingURL=group-server.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"group-server.js","sourceRoot":"","sources":["../../../../remote/relay/convex/group-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA4BH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,OAAO,iBAAiB;IAElB,MAAM;IACN,GAAG;IAFb,YACU,MAAoB,EACpB,GAAyB;sBADzB,MA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,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAgB,CAAC;IAC9F,CAAC;CACF"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convex Relay Package
|
|
3
|
-
*
|
|
4
|
-
* Convex integration for Signal Protocol relay state, prekeys, devices, and encrypted
|
|
5
|
-
* envelope delivery.
|
|
6
|
-
*
|
|
7
|
-
* ```typescript
|
|
8
|
-
* import { createSignalProtocolClient } from '@open-e2ee/signal-protocol-sdk';
|
|
9
|
-
* import { expoStore } from '@open-e2ee/signal-protocol-sdk/local/store/expo';
|
|
10
|
-
* import { convexRelay, type ConvexSignalProtocolRelayApi } from '@open-e2ee/signal-protocol-sdk/remote/relay/convex';
|
|
11
|
-
* import { api } from '../convex/_generated/api';
|
|
12
|
-
*
|
|
13
|
-
* const signalApi = api.signal satisfies ConvexSignalProtocolRelayApi;
|
|
14
|
-
* const relay = convexRelay({ convex, api: signalApi, currentUserId: userId });
|
|
15
|
-
*
|
|
16
|
-
* const signal = await createSignalProtocolClient({
|
|
17
|
-
* identity: { userId },
|
|
18
|
-
* adapters: { storage: expoStore(), relay },
|
|
19
|
-
* onProgress: ({ stage, percent, message }) => console.log(`${stage}: ${percent}%`)
|
|
20
|
-
* });
|
|
21
|
-
*
|
|
22
|
-
* await signal.syncToServer();
|
|
23
|
-
* await signal.rotateEcSignedPreKey();
|
|
24
|
-
* await signal.rotateKyberPreKey();
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export {};
|
|
28
|
-
import { ConvexSignalProtocolRelayServer, type ConvexSignalProtocolRelayApi, type ConvexSignalProtocolRelayOptions } from './relay.js';
|
|
29
|
-
export { ConvexSignalProtocolRelayServer } from './relay.js';
|
|
30
|
-
export type { ConvexSignalProtocolRelayApi, ConvexSignalProtocolRelayOptions } from './relay.js';
|
|
31
|
-
export { ConvexGroupServer } from './group-server.js';
|
|
32
|
-
export type { ConvexGroupServerApi } from './group-server.js';
|
|
33
|
-
export { defineConvexSignalProtocolBackend } from './backend.js';
|
|
34
|
-
export type { ConvexSignalProtocolBackendIdentity, DefineConvexSignalProtocolBackendConfig, } from './backend.js';
|
|
35
|
-
export { CONVEX_GROUP_SERVER_SECRET_ENV_VAR } from './constants.js';
|
|
36
|
-
export * from './types.js';
|
|
37
|
-
export interface ConvexSignalProtocolRelayFactoryOptions extends ConvexSignalProtocolRelayOptions {
|
|
38
|
-
convex: ConstructorParameters<typeof ConvexSignalProtocolRelayServer>[0];
|
|
39
|
-
api: ConvexSignalProtocolRelayApi;
|
|
40
|
-
}
|
|
41
|
-
export declare function convexRelay(options: ConvexSignalProtocolRelayFactoryOptions): ConvexSignalProtocolRelayServer;
|
|
42
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../remote/relay/convex/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,CAAC;AACV,OAAO,EACL,+BAA+B,EAC/B,KAAK,4BAA4B,EACjC,KAAK,gCAAgC,EACtC,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAC1D,YAAY,EAAE,4BAA4B,EAAE,gCAAgC,EAAE,MAAM,SAAS,CAAC;AAC9F,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,iCAAiC,EAAE,MAAM,WAAW,CAAC;AAC9D,YAAY,EACV,mCAAmC,EACnC,uCAAuC,GACxC,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,kCAAkC,EAAE,MAAM,aAAa,CAAC;AAGjE,cAAc,SAAS,CAAC;AAExB,MAAM,WAAW,uCAAwC,SAAQ,gCAAgC;IAC/F,MAAM,EAAE,qBAAqB,CAAC,OAAO,+BAA+B,CAAC,CAAC,CAAC,CAAC,CAAC;IACzE,GAAG,EAAE,4BAA4B,CAAC;CACnC;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,uCAAuC,GAAG,+BAA+B,CAG7G"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convex Relay Package
|
|
3
|
-
*
|
|
4
|
-
* Convex integration for Signal Protocol relay state, prekeys, devices, and encrypted
|
|
5
|
-
* envelope delivery.
|
|
6
|
-
*
|
|
7
|
-
* ```typescript
|
|
8
|
-
* import { createSignalProtocolClient } from '@open-e2ee/signal-protocol-sdk';
|
|
9
|
-
* import { expoStore } from '@open-e2ee/signal-protocol-sdk/local/store/expo';
|
|
10
|
-
* import { convexRelay, type ConvexSignalProtocolRelayApi } from '@open-e2ee/signal-protocol-sdk/remote/relay/convex';
|
|
11
|
-
* import { api } from '../convex/_generated/api';
|
|
12
|
-
*
|
|
13
|
-
* const signalApi = api.signal satisfies ConvexSignalProtocolRelayApi;
|
|
14
|
-
* const relay = convexRelay({ convex, api: signalApi, currentUserId: userId });
|
|
15
|
-
*
|
|
16
|
-
* const signal = await createSignalProtocolClient({
|
|
17
|
-
* identity: { userId },
|
|
18
|
-
* adapters: { storage: expoStore(), relay },
|
|
19
|
-
* onProgress: ({ stage, percent, message }) => console.log(`${stage}: ${percent}%`)
|
|
20
|
-
* });
|
|
21
|
-
*
|
|
22
|
-
* await signal.syncToServer();
|
|
23
|
-
* await signal.rotateEcSignedPreKey();
|
|
24
|
-
* await signal.rotateKyberPreKey();
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
import { ConvexSignalProtocolRelayServer, } from './relay.js';
|
|
28
|
-
export { ConvexSignalProtocolRelayServer } from './relay.js';
|
|
29
|
-
export { ConvexGroupServer } from './group-server.js';
|
|
30
|
-
export { defineConvexSignalProtocolBackend } from './backend.js';
|
|
31
|
-
export { CONVEX_GROUP_SERVER_SECRET_ENV_VAR } from './constants.js';
|
|
32
|
-
// Type conversion utilities
|
|
33
|
-
export * from './types.js';
|
|
34
|
-
export function convexRelay(options) {
|
|
35
|
-
const { convex, api, ...relayOptions } = options;
|
|
36
|
-
return new ConvexSignalProtocolRelayServer(convex, api, relayOptions);
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../remote/relay/convex/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EACL,+BAA+B,GAGhC,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,iCAAiC,EAAE,MAAM,WAAW,CAAC;AAK9D,OAAO,EAAE,kCAAkC,EAAE,MAAM,aAAa,CAAC;AAEjE,4BAA4B;AAC5B,cAAc,SAAS,CAAC;AAOxB,MAAM,UAAU,WAAW,CAAC,OAAgD;IAC1E,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,GAAG,OAAO,CAAC;IACjD,OAAO,IAAI,+BAA+B,CAAC,MAAM,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ConvexSignalProtocolRelayServer
|
|
3
|
-
*
|
|
4
|
-
* Implementation of ISignalProtocolRelayServer using the Signal Protocol Convex component.
|
|
5
|
-
* Zero-knowledge server - all content is opaque ciphertext.
|
|
6
|
-
*
|
|
7
|
-
* Uses the signal component's 16-table schema.
|
|
8
|
-
*
|
|
9
|
-
* ## Component API Access Pattern
|
|
10
|
-
*
|
|
11
|
-
* This file consumes typed, app-injected API references for the Signal Protocol
|
|
12
|
-
* component's functions. The app-level wrappers are defined in:
|
|
13
|
-
* - convex/signal/keys.ts
|
|
14
|
-
* - convex/signal/devices.ts
|
|
15
|
-
* - convex/signal/messages.ts
|
|
16
|
-
* - convex/signal/provisioning.ts
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
import type { ConvexReactClient } from 'convex/react';
|
|
20
|
-
import type { ConvexHttpClient } from 'convex/browser';
|
|
21
|
-
import type { ApiFromModules } from 'convex/server';
|
|
22
|
-
import type { defineConvexSignalProtocolBackend } from './backend.js';
|
|
23
|
-
import type { ISignalProtocolRelayServer, Envelope, SealedSenderAuth, DeviceInfo, DeviceRegistration, PreKeyUpload, PreKeyBundle, EcSignedPreKeyUpload, KemLastResortPreKeyUpload, Unsubscribe, GroupMemberDevice, GroupChangeEntry, GroupChangePage, RetryRequest, AccountIdentityProvisioning, AccountIdentityRotation, IRelayGroupServer } from '../types.js';
|
|
24
|
-
import type { CompositeIdentityV1, IdentityType } from '../../../keys/types.js';
|
|
25
|
-
import type { GroupAuthorization } from '../../../internal/groups/manager.js';
|
|
26
|
-
import { type ILogger } from '../../../logger.js';
|
|
27
|
-
/**
|
|
28
|
-
* Polling interval for retry request subscription (in milliseconds).
|
|
29
|
-
* Used as fallback when SubscriptionFactory is not provided.
|
|
30
|
-
*/
|
|
31
|
-
export {};
|
|
32
|
-
/**
|
|
33
|
-
* Either ConvexReactClient or ConvexHttpClient can be used.
|
|
34
|
-
* This allows the relay to work in both React contexts and background tasks.
|
|
35
|
-
*/
|
|
36
|
-
type ConvexClient = ConvexReactClient | ConvexHttpClient;
|
|
37
|
-
type SignalProtocolBackend = ReturnType<typeof defineConvexSignalProtocolBackend>;
|
|
38
|
-
/**
|
|
39
|
-
* The `api.signal.*` shape Convex code-generates for an app whose
|
|
40
|
-
* `convex/signal/<namespace>.ts` modules re-export the matching namespace bag
|
|
41
|
-
* from {@link defineConvexSignalProtocolBackend}.
|
|
42
|
-
*/
|
|
43
|
-
type SignalProtocolBackendApi = ApiFromModules<{
|
|
44
|
-
messages: SignalProtocolBackend['messages'];
|
|
45
|
-
devices: SignalProtocolBackend['devices'];
|
|
46
|
-
keys: SignalProtocolBackend['keys'];
|
|
47
|
-
certificates: SignalProtocolBackend['certificates'];
|
|
48
|
-
provisioning: SignalProtocolBackend['provisioning'];
|
|
49
|
-
groups: SignalProtocolBackend['groups'];
|
|
50
|
-
zkAuth: SignalProtocolBackend['zkAuth'];
|
|
51
|
-
}>;
|
|
52
|
-
/**
|
|
53
|
-
* The app-side function references this adapter calls.
|
|
54
|
-
*
|
|
55
|
-
* Every reference carries the argument and return types Convex derives from
|
|
56
|
-
* the component's own validators. A call site that disagrees with the
|
|
57
|
-
* component fails to compile here, rather than at runtime in the deployment.
|
|
58
|
-
* The types are *derived* from {@link defineConvexSignalProtocolBackend}
|
|
59
|
-
* rather than restated, which is what makes the check meaningful. A
|
|
60
|
-
* hand-written contract can drift from the functions it describes, and this
|
|
61
|
-
* one previously had.
|
|
62
|
-
*
|
|
63
|
-
* `groups` and `zkAuth` are optional: a deployment that does not install the
|
|
64
|
-
* group namespaces still satisfies the rest of the relay surface.
|
|
65
|
-
*/
|
|
66
|
-
export interface ConvexSignalProtocolRelayApi {
|
|
67
|
-
messages: SignalProtocolBackendApi['messages'];
|
|
68
|
-
devices: SignalProtocolBackendApi['devices'];
|
|
69
|
-
keys: SignalProtocolBackendApi['keys'];
|
|
70
|
-
certificates: SignalProtocolBackendApi['certificates'];
|
|
71
|
-
provisioning: SignalProtocolBackendApi['provisioning'];
|
|
72
|
-
groups?: SignalProtocolBackendApi['groups'];
|
|
73
|
-
zkAuth?: SignalProtocolBackendApi['zkAuth'];
|
|
74
|
-
}
|
|
75
|
-
export interface ConvexSignalProtocolRelayOptions {
|
|
76
|
-
currentUserId?: string;
|
|
77
|
-
getAuthToken?: () => Promise<string | null>;
|
|
78
|
-
logger?: ILogger;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* ConvexSignalProtocolRelayServer - Implementation of ISignalProtocolRelayServer
|
|
82
|
-
*
|
|
83
|
-
* Uses the Convex Signal Protocol component for the 16-table relay schema.
|
|
84
|
-
*
|
|
85
|
-
* @example
|
|
86
|
-
* ```typescript
|
|
87
|
-
* import { ConvexReactClient } from 'convex/react';
|
|
88
|
-
* import { ConvexSignalProtocolRelayServer } from './relay.js';
|
|
89
|
-
*
|
|
90
|
-
* const convex = new ConvexReactClient(process.env.CONVEX_URL!);
|
|
91
|
-
* const relay = new ConvexSignalProtocolRelayServer(convex, convexSignalProtocolRelayApi, {
|
|
92
|
-
* currentUserId: 'current-user-id',
|
|
93
|
-
* });
|
|
94
|
-
*
|
|
95
|
-
* // Subscribe to incoming envelopes
|
|
96
|
-
* const unsubscribe = relay.subscribe(userId, deviceId, (envelope) => {
|
|
97
|
-
* // Decrypt and process
|
|
98
|
-
* });
|
|
99
|
-
*
|
|
100
|
-
* // Send encrypted envelope
|
|
101
|
-
* await relay.send({
|
|
102
|
-
* targetUserId: 'bob',
|
|
103
|
-
* targetDeviceId: 1,
|
|
104
|
-
* senderUserId: 'alice',
|
|
105
|
-
* senderDeviceId: 1,
|
|
106
|
-
* ciphertext: encryptedBytes,
|
|
107
|
-
* messageType: 'ciphertext',
|
|
108
|
-
* });
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
111
|
-
export declare class ConvexSignalProtocolRelayServer implements ISignalProtocolRelayServer {
|
|
112
|
-
private convex;
|
|
113
|
-
private api;
|
|
114
|
-
private subscriptions;
|
|
115
|
-
private subscriptionClient;
|
|
116
|
-
private currentUserId?;
|
|
117
|
-
private getAuthToken?;
|
|
118
|
-
private readonly logger;
|
|
119
|
-
readonly groupServer?: IRelayGroupServer;
|
|
120
|
-
/**
|
|
121
|
-
* Create a new ConvexSignalProtocolRelayServer.
|
|
122
|
-
*
|
|
123
|
-
* @param convex - Convex client (React or HTTP)
|
|
124
|
-
* @param api - Generated Convex Signal Protocol API map for queries and mutations
|
|
125
|
-
* @param options.currentUserId - Current user's ID for ownership-scoped relay operations
|
|
126
|
-
* @param options.getAuthToken - Optional auth token getter for push-based subscriptions.
|
|
127
|
-
* When provided, creates an internal ConvexClient with WebSocket push.
|
|
128
|
-
* @param options.logger - Optional logger for relay operations
|
|
129
|
-
*/
|
|
130
|
-
constructor(convex: ConvexClient, api: ConvexSignalProtocolRelayApi, options?: ConvexSignalProtocolRelayOptions);
|
|
131
|
-
/**
|
|
132
|
-
* Get or create the internal subscription client for push-based updates.
|
|
133
|
-
* Created lazily on first use to avoid unnecessary connections.
|
|
134
|
-
*/
|
|
135
|
-
private getSubscriptionClient;
|
|
136
|
-
send(envelope: Envelope): Promise<{
|
|
137
|
-
messageId: string;
|
|
138
|
-
serverTimestamp: number;
|
|
139
|
-
}>;
|
|
140
|
-
/**
|
|
141
|
-
* Subscribe to incoming envelopes for this device.
|
|
142
|
-
*
|
|
143
|
-
* When getAuthToken is provided (via constructor), uses WebSocket push
|
|
144
|
-
* for instant delivery (~50ms). Otherwise, falls back to polling every 2 seconds.
|
|
145
|
-
*
|
|
146
|
-
* Supports optional batching callbacks for notification coalescing.
|
|
147
|
-
* When messages arrive rapidly, onBatchStart is called once at the start,
|
|
148
|
-
* and onBatchEnd is called after an idle period (no new messages for 500ms).
|
|
149
|
-
*
|
|
150
|
-
* @param userId - Current user ID
|
|
151
|
-
* @param deviceId - This device's ID (1-5)
|
|
152
|
-
* @param onEnvelope - Callback for each incoming envelope
|
|
153
|
-
* @param options - Optional batching callbacks
|
|
154
|
-
* @returns Unsubscribe function
|
|
155
|
-
*
|
|
156
|
-
*/
|
|
157
|
-
subscribe(userId: string, deviceId: number, onEnvelope: (envelope: Envelope) => void, options?: {
|
|
158
|
-
onBatchStart?: () => void;
|
|
159
|
-
onBatchEnd?: () => void;
|
|
160
|
-
}): Unsubscribe;
|
|
161
|
-
/**
|
|
162
|
-
* Push-based message subscription using internal ConvexClient.
|
|
163
|
-
* Provides instant delivery via WebSocket with idle-detection batching.
|
|
164
|
-
*
|
|
165
|
-
* Batching behavior:
|
|
166
|
-
* - Messages are queued until idle (no new messages for MESSAGE_IDLE_THRESHOLD_MS)
|
|
167
|
-
* - onBatchStart called when first message arrives
|
|
168
|
-
* - onBatchEnd called when batch is flushed
|
|
169
|
-
* - Forced flush after MAX_BATCH_WINDOW_MS to prevent indefinite batching
|
|
170
|
-
*/
|
|
171
|
-
private subscribeMessagesPush;
|
|
172
|
-
/**
|
|
173
|
-
* Polling-based message subscription fallback.
|
|
174
|
-
* Used when no getAuthToken is available or subscription client creation fails.
|
|
175
|
-
*
|
|
176
|
-
* NOTE: This has ~2 second latency. Use push-based subscription for production.
|
|
177
|
-
*/
|
|
178
|
-
private subscribeMessagesPolling;
|
|
179
|
-
markDelivered(messageId: string): Promise<void>;
|
|
180
|
-
getDevices(userId: string): Promise<DeviceInfo[]>;
|
|
181
|
-
registerDevice(_userId: string, device: DeviceRegistration): Promise<number>;
|
|
182
|
-
removeDevice(_userId: string, deviceId: number): Promise<void>;
|
|
183
|
-
markDeviceConnected(deviceId: number): Promise<void>;
|
|
184
|
-
markDeviceDisconnected(deviceId: number): Promise<void>;
|
|
185
|
-
heartbeat(deviceId: number): Promise<void>;
|
|
186
|
-
provisionIdentityKey(request: AccountIdentityProvisioning): Promise<void>;
|
|
187
|
-
rotateIdentityKey(request: AccountIdentityRotation): Promise<void>;
|
|
188
|
-
getIdentityKey(userId: string, identityType?: IdentityType): Promise<CompositeIdentityV1 | null>;
|
|
189
|
-
uploadPreKeys(userId: string, deviceId: number, keys: PreKeyUpload[], identityType?: IdentityType): Promise<void>;
|
|
190
|
-
/**
|
|
191
|
-
* Fetch prekey bundle for session establishment.
|
|
192
|
-
*
|
|
193
|
-
* Rate limited to 10 fetches per minute per fetcher-target pair.
|
|
194
|
-
* Fetcher identity is always derived from auth on the server side
|
|
195
|
-
* (matches the relay application format).
|
|
196
|
-
*
|
|
197
|
-
* @param userId - Target user ID
|
|
198
|
-
* @param deviceId - Target device ID
|
|
199
|
-
* @param _fetcherUserId - Deprecated, ignored. Fetcher derived from auth server-side.
|
|
200
|
-
*/
|
|
201
|
-
fetchPreKeyBundle(userId: string, deviceId: number, _fetcherUserId?: string, identityType?: IdentityType): Promise<PreKeyBundle | null>;
|
|
202
|
-
getPreKeyCount(userId: string, deviceId: number, type: 'ec' | 'kem', identityType?: IdentityType): Promise<number>;
|
|
203
|
-
clearStaleKemPreKeys(userId: string, deviceId: number, identityType?: IdentityType): Promise<{
|
|
204
|
-
cleared: number;
|
|
205
|
-
}>;
|
|
206
|
-
uploadEcSignedPreKey(userId: string, ecSignedPreKey: EcSignedPreKeyUpload, identityType?: IdentityType): Promise<void>;
|
|
207
|
-
uploadKemLastResortPreKey(userId: string, kemLastResortPreKey: KemLastResortPreKeyUpload, identityType?: IdentityType): Promise<void>;
|
|
208
|
-
getActiveDevices(userId: string): Promise<GroupMemberDevice[]>;
|
|
209
|
-
fetchSenderCertificate(deviceId: number): Promise<string>;
|
|
210
|
-
/**
|
|
211
|
-
* Send a V2 multi-recipient sealed sender message.
|
|
212
|
-
*
|
|
213
|
-
* Parses the V2 binary blob client-side, then sends structured
|
|
214
|
-
* per-recipient data to the Convex mutation for server-side fan-out.
|
|
215
|
-
*
|
|
216
|
-
* @param sentMessageBase64 - Base64-encoded V2 multi-recipient binary blob
|
|
217
|
-
* @param auth - Sealed sender authentication (access key or group send token)
|
|
218
|
-
* @param timestamp - Client timestamp for message identification
|
|
219
|
-
* @param recipientUserIds - Original user IDs in same order as binary recipients
|
|
220
|
-
*/
|
|
221
|
-
sendMultiRecipientUnidentified(sentMessageBase64: string, auth: SealedSenderAuth, timestamp: number, deliveryClass: import('../types.js').DeliveryClass, recipientUserIds?: string[], clientMessageId?: string): Promise<{
|
|
222
|
-
messageId: string;
|
|
223
|
-
serverTimestamp: number;
|
|
224
|
-
uuids404: string[];
|
|
225
|
-
}>;
|
|
226
|
-
/**
|
|
227
|
-
* Send retry request to the original sender.
|
|
228
|
-
*
|
|
229
|
-
* Called by recipient when decryption fails. The request is stored
|
|
230
|
-
* in the sender's retry request queue for them to process.
|
|
231
|
-
*/
|
|
232
|
-
sendRetryRequest(request: RetryRequest): Promise<void>;
|
|
233
|
-
/**
|
|
234
|
-
* Subscribe to incoming retry requests for this device.
|
|
235
|
-
*
|
|
236
|
-
* When getAuthToken is provided (via constructor), uses WebSocket push
|
|
237
|
-
* for instant delivery (<100ms). Otherwise, falls back to polling every 2 seconds.
|
|
238
|
-
*
|
|
239
|
-
* @param userId - User ID (original sender)
|
|
240
|
-
* @param deviceId - Device ID
|
|
241
|
-
* @param handler - Callback for each retry request
|
|
242
|
-
* @returns Unsubscribe function
|
|
243
|
-
*/
|
|
244
|
-
subscribeRetryRequests(userId: string, deviceId: number, handler: (request: RetryRequest) => Promise<void>): Unsubscribe;
|
|
245
|
-
/**
|
|
246
|
-
* Push-based subscription using internal ConvexClient.
|
|
247
|
-
* Provides instant delivery via WebSocket.
|
|
248
|
-
*/
|
|
249
|
-
private subscribeRetryRequestsPush;
|
|
250
|
-
/**
|
|
251
|
-
* Polling-based subscription fallback.
|
|
252
|
-
* Used when no getAuthToken is available or subscription client creation fails.
|
|
253
|
-
*
|
|
254
|
-
* NOTE: This has ~2 second latency. Use push-based subscription for production.
|
|
255
|
-
*/
|
|
256
|
-
private subscribeRetryRequestsPolling;
|
|
257
|
-
createProvisioningSession(userId: string, ephemeralPublicKey: string): Promise<{
|
|
258
|
-
sessionId: string;
|
|
259
|
-
}>;
|
|
260
|
-
connectNewDevice(sessionId: string, ephemeralPublicKey: string, deviceMetadata: {
|
|
261
|
-
platform?: string;
|
|
262
|
-
appVersion?: string;
|
|
263
|
-
osVersion?: string;
|
|
264
|
-
}): Promise<void>;
|
|
265
|
-
sendProvisioningMessage(sessionId: string, encryptedMessage: string, userId?: string): Promise<void>;
|
|
266
|
-
getProvisioningMessage(sessionId: string): Promise<{
|
|
267
|
-
status: 'waiting' | 'connected' | 'ready' | 'linked_pending_ack' | 'completed' | 'rolled_back' | 'expired';
|
|
268
|
-
message: string | null;
|
|
269
|
-
expiresAt: number | null;
|
|
270
|
-
}>;
|
|
271
|
-
completeProvisioning(sessionId: string, deviceMetadata: {
|
|
272
|
-
encryptedDeviceName: ArrayBuffer;
|
|
273
|
-
platform?: string;
|
|
274
|
-
appVersion?: string;
|
|
275
|
-
osVersion?: string;
|
|
276
|
-
}): Promise<{
|
|
277
|
-
deviceId: number;
|
|
278
|
-
}>;
|
|
279
|
-
acknowledgeProvisioning(sessionId: string): Promise<void>;
|
|
280
|
-
rollbackProvisioning(sessionId: string): Promise<void>;
|
|
281
|
-
deleteProvisioningSession(sessionId: string, userId?: string): Promise<void>;
|
|
282
|
-
getEcSignedPreKeyMetadata(userId: string, deviceId: number, identityType?: IdentityType): Promise<{
|
|
283
|
-
keyId: number;
|
|
284
|
-
createdAt: number;
|
|
285
|
-
expiresAt: number;
|
|
286
|
-
publicKey: string;
|
|
287
|
-
} | null>;
|
|
288
|
-
getKemLastResortPreKeyMetadata(userId: string, deviceId: number, identityType?: IdentityType): Promise<{
|
|
289
|
-
keyId: number;
|
|
290
|
-
createdAt: number;
|
|
291
|
-
expiresAt: number;
|
|
292
|
-
publicKey: string;
|
|
293
|
-
} | null>;
|
|
294
|
-
createGroupState(groupId: Uint8Array, encryptedState: Uint8Array, authorization: GroupAuthorization): Promise<void>;
|
|
295
|
-
getGroupState(groupId: Uint8Array, authorization: GroupAuthorization, version?: number): Promise<{
|
|
296
|
-
encryptedState: Uint8Array;
|
|
297
|
-
version: number;
|
|
298
|
-
baselineSignature: Uint8Array;
|
|
299
|
-
} | null>;
|
|
300
|
-
getGroupJoinInfo(groupId: Uint8Array, inviteLinkPassword: Uint8Array, authorization: GroupAuthorization): Promise<{
|
|
301
|
-
encryptedJoinInfo: Uint8Array;
|
|
302
|
-
version: number;
|
|
303
|
-
} | null>;
|
|
304
|
-
getGroupChanges(groupId: Uint8Array, fromVersion: number, authorization: GroupAuthorization): Promise<GroupChangePage>;
|
|
305
|
-
submitGroupChange(groupId: Uint8Array, expectedVersion: number, actions: Uint8Array, inviteLinkPassword: Uint8Array, authorization: GroupAuthorization): Promise<GroupChangeEntry>;
|
|
306
|
-
issueAuthCredential(_userId: string): Promise<Uint8Array>;
|
|
307
|
-
setUnidentifiedAccessKey(accessKey: Uint8Array): Promise<void>;
|
|
308
|
-
issueProfileKeyCredential(request: Uint8Array): Promise<Uint8Array>;
|
|
309
|
-
refreshGroupSendEndorsements(groupId: Uint8Array, authorization: GroupAuthorization): Promise<{
|
|
310
|
-
endorsements: Uint8Array;
|
|
311
|
-
expiration: number;
|
|
312
|
-
}>;
|
|
313
|
-
private requireGroupServerApi;
|
|
314
|
-
/** Convert Uint8Array to ArrayBuffer for Convex v.bytes() args. */
|
|
315
|
-
private toBytes;
|
|
316
|
-
private uint8ArrayToBase64;
|
|
317
|
-
private base64ToUint8Array;
|
|
318
|
-
/**
|
|
319
|
-
* Clean up all subscriptions and close the internal subscription client.
|
|
320
|
-
*/
|
|
321
|
-
destroy(): Promise<void>;
|
|
322
|
-
}
|
|
323
|
-
//# sourceMappingURL=relay.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"relay.d.ts","sourceRoot":"","sources":["../../../../remote/relay/convex/relay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,KAAK,EACV,0BAA0B,EAC1B,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,yBAAyB,EACzB,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,YAAY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