@open-e2ee/signal-protocol-sdk 2.0.2 → 4.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 +14 -21
- package/ARCHITECTURE.md +1 -2
- package/CHANGELOG.md +90 -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 +6 -10
- package/client/README.md +36 -18
- package/device/README.md +1 -1
- package/dist/blocking/manager.d.ts +2 -2
- package/dist/blocking/manager.d.ts.map +1 -1
- package/dist/blocking/manager.js.map +1 -1
- package/dist/client/client.d.ts +45 -34
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +178 -115
- package/dist/client/client.js.map +1 -1
- package/dist/client/compose.d.ts +7 -7
- package/dist/client/compose.d.ts.map +1 -1
- package/dist/client/compose.js +2 -2
- package/dist/client/compose.js.map +1 -1
- package/dist/client/config.d.ts +24 -28
- 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/dual-store.d.ts +5 -5
- package/dist/client/dual-store.d.ts.map +1 -1
- package/dist/client/dual-store.js.map +1 -1
- package/dist/client/endorsement-manager.d.ts +6 -3
- 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/files.d.ts +1 -1
- package/dist/client/files.js +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/group-outbox.d.ts +4 -4
- package/dist/client/group-outbox.d.ts.map +1 -1
- package/dist/client/group-sealed-sender.d.ts +2 -2
- package/dist/client/group-sealed-sender.d.ts.map +1 -1
- package/dist/client/groups.d.ts +1 -1
- package/dist/client/groups.js +1 -1
- package/dist/client/headless.d.ts +11 -16
- package/dist/client/headless.d.ts.map +1 -1
- package/dist/client/headless.js +4 -9
- 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 +5 -6
- 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 +62 -40
- 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 +26 -21
- package/dist/client/hosted.d.ts.map +1 -1
- package/dist/client/hosted.js +80 -36
- package/dist/client/hosted.js.map +1 -1
- package/dist/client/index.d.ts +15 -15
- 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 +16 -8
- package/dist/client/key-rotation-core.d.ts.map +1 -1
- package/dist/client/key-rotation-core.js +14 -3
- package/dist/client/key-rotation-core.js.map +1 -1
- package/dist/client/key-rotation.d.ts +3 -2
- package/dist/client/key-rotation.d.ts.map +1 -1
- package/dist/client/key-rotation.js +5 -5
- 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 +1 -1
- package/dist/client/messages.d.ts.map +1 -1
- package/dist/client/messages.js +14 -15
- package/dist/client/messages.js.map +1 -1
- package/dist/client/multi-device.d.ts +1 -1
- package/dist/client/multi-device.js +1 -1
- package/dist/client/prekeys.d.ts +1 -1
- package/dist/client/prekeys.d.ts.map +1 -1
- package/dist/client/prekeys.js +132 -44
- package/dist/client/prekeys.js.map +1 -1
- package/dist/client/relay-subscription.d.ts +5 -1
- package/dist/client/relay-subscription.d.ts.map +1 -1
- package/dist/client/relay-subscription.js +59 -26
- package/dist/client/relay-subscription.js.map +1 -1
- package/dist/client/retry.d.ts +3 -3
- package/dist/client/retry.d.ts.map +1 -1
- package/dist/client/retry.js +1 -1
- package/dist/client/retry.js.map +1 -1
- package/dist/client/sealed-sender.d.ts +5 -5
- package/dist/client/sealed-sender.d.ts.map +1 -1
- package/dist/client/sealed-sender.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/sessions.d.ts +3 -3
- package/dist/client/sessions.d.ts.map +1 -1
- package/dist/client/sessions.js +1 -1
- package/dist/client/sessions.js.map +1 -1
- package/dist/client/signal-service-cipher.d.ts +12 -8
- 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/client/state.d.ts +1 -1
- package/dist/client/state.js +1 -1
- package/dist/client/types.d.ts +10 -10
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/types.js +1 -1
- package/dist/device/connection.d.ts.map +1 -1
- package/dist/device/connection.js.map +1 -1
- package/dist/device/device-id.d.ts +2 -2
- package/dist/device/device-id.d.ts.map +1 -1
- package/dist/device/device-id.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.d.ts +1 -1
- package/dist/device/index.d.ts.map +1 -1
- package/dist/device/index.js +1 -1
- package/dist/device/index.js.map +1 -1
- package/dist/device/lifecycle/index.d.ts +1 -1
- package/dist/device/lifecycle/index.d.ts.map +1 -1
- package/dist/device/lifecycle/types.d.ts +8 -8
- package/dist/device/lifecycle/types.d.ts.map +1 -1
- package/dist/device/provisioning.d.ts +13 -13
- package/dist/device/provisioning.d.ts.map +1 -1
- package/dist/device/provisioning.js +1 -1
- package/dist/device/provisioning.js.map +1 -1
- package/dist/device/transfer.d.ts +13 -13
- package/dist/device/transfer.d.ts.map +1 -1
- package/dist/device/transfer.js.map +1 -1
- package/dist/device/types.d.ts +3 -3
- package/dist/device/types.d.ts.map +1 -1
- package/dist/groups/index.d.ts +1 -1
- package/dist/groups/index.d.ts.map +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 +6 -8
- 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/hooks/use-group-membership.d.ts +2 -2
- package/dist/hooks/use-group-membership.d.ts.map +1 -1
- package/dist/hooks/use-group-membership.js.map +1 -1
- package/dist/hooks/use-key-rotation.d.ts +2 -2
- package/dist/hooks/use-key-rotation.d.ts.map +1 -1
- package/dist/hooks/use-session-health.d.ts +2 -2
- package/dist/hooks/use-session-health.d.ts.map +1 -1
- package/dist/index.d.ts +57 -55
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -26
- package/dist/index.js.map +1 -1
- package/dist/internal/crypto/ec/x25519-validation.d.ts +4 -4
- package/dist/internal/crypto/ec/x25519-validation.d.ts.map +1 -1
- package/dist/internal/crypto/ec/x25519-validation.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/index.d.ts +1 -1
- package/dist/internal/groups/index.d.ts.map +1 -1
- package/dist/internal/groups/manager.d.ts +9 -4
- 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/sdk-store.d.ts +4 -4
- package/dist/internal/groups/sdk-store.d.ts.map +1 -1
- package/dist/internal/groups/sdk-store.js.map +1 -1
- package/dist/internal/groups/server-engine.d.ts +9 -2
- 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/index.d.ts +2 -2
- package/dist/internal/manager/index.d.ts.map +1 -1
- package/dist/internal/manager/index.js +1 -1
- package/dist/internal/manager/index.js.map +1 -1
- package/dist/internal/manager/manager.d.ts +23 -23
- package/dist/internal/manager/manager.d.ts.map +1 -1
- package/dist/internal/manager/manager.js +40 -43
- package/dist/internal/manager/manager.js.map +1 -1
- package/dist/internal/protocol/double-ratchet/chains.d.ts +9 -9
- package/dist/internal/protocol/double-ratchet/chains.d.ts.map +1 -1
- package/dist/internal/protocol/double-ratchet/chains.js.map +1 -1
- package/dist/internal/protocol/double-ratchet/ratchet.d.ts +2 -2
- package/dist/internal/protocol/double-ratchet/ratchet.d.ts.map +1 -1
- package/dist/internal/protocol/double-ratchet/ratchet.js.map +1 -1
- package/dist/internal/protocol/pqxdh/pqxdh.d.ts +3 -3
- package/dist/internal/protocol/pqxdh/pqxdh.d.ts.map +1 -1
- package/dist/internal/protocol/pqxdh/pqxdh.js.map +1 -1
- package/dist/internal/protocol/sender-keys/manager.d.ts +4 -4
- 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/protocol/spqr/ml-kem-braid/authenticator.d.ts +3 -3
- package/dist/internal/protocol/spqr/ml-kem-braid/authenticator.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.d.ts +3 -3
- package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/index.d.ts +2 -2
- package/dist/internal/protocol/spqr/ml-kem-braid/index.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/index.js +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/index.js.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.d.ts +3 -3
- package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js +2 -2
- package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts +3 -3
- package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/spqr.d.ts +5 -5
- package/dist/internal/protocol/spqr/spqr.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/spqr.js.map +1 -1
- package/dist/internal/protocol/triple-ratchet/ratchet.d.ts +4 -4
- package/dist/internal/protocol/triple-ratchet/ratchet.d.ts.map +1 -1
- package/dist/internal/protocol/triple-ratchet/ratchet.js.map +1 -1
- package/dist/internal/protocol/x3dh/x3dh.d.ts +3 -3
- package/dist/internal/protocol/x3dh/x3dh.d.ts.map +1 -1
- package/dist/internal/protocol/x3dh/x3dh.js.map +1 -1
- package/dist/internal/sesame/device-registry.d.ts +16 -16
- package/dist/internal/sesame/device-registry.d.ts.map +1 -1
- package/dist/internal/sesame/device-registry.js +6 -6
- package/dist/internal/sesame/device-registry.js.map +1 -1
- package/dist/internal/sesame/index.d.ts +4 -4
- package/dist/internal/sesame/index.d.ts.map +1 -1
- package/dist/internal/sesame/index.js +2 -2
- package/dist/internal/sesame/index.js.map +1 -1
- package/dist/internal/sesame/manager.d.ts +10 -10
- package/dist/internal/sesame/manager.d.ts.map +1 -1
- package/dist/internal/sesame/manager.js +13 -13
- package/dist/internal/sesame/manager.js.map +1 -1
- package/dist/internal/sesame/types.d.ts +5 -5
- package/dist/internal/sesame/types.d.ts.map +1 -1
- package/dist/internal/session/cipher.d.ts +4 -4
- 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/internal/session/decryption.js.map +1 -1
- package/dist/internal/session/factory.d.ts +3 -3
- package/dist/internal/session/factory.d.ts.map +1 -1
- package/dist/internal/session/factory.js.map +1 -1
- package/dist/internal/session/handshake.d.ts +2 -2
- package/dist/internal/session/handshake.d.ts.map +1 -1
- package/dist/internal/session/handshake.js.map +1 -1
- package/dist/internal/session/ratchet.d.ts +4 -4
- package/dist/internal/session/ratchet.d.ts.map +1 -1
- package/dist/internal/session/ratchet.js.map +1 -1
- package/dist/internal/session/types.d.ts +5 -5
- package/dist/internal/session/types.d.ts.map +1 -1
- package/dist/internal/session/validation.d.ts +3 -3
- package/dist/internal/session/validation.d.ts.map +1 -1
- package/dist/internal/session/validation.js.map +1 -1
- package/dist/layers.d.ts +4 -4
- package/dist/layers.d.ts.map +1 -1
- package/dist/layers.js +12 -12
- package/dist/layers.js.map +1 -1
- package/dist/local/store/expo/adapter.d.ts +15 -9
- package/dist/local/store/expo/adapter.d.ts.map +1 -1
- package/dist/local/store/expo/adapter.js +29 -10
- package/dist/local/store/expo/adapter.js.map +1 -1
- package/dist/local/store/expo/database-key.d.ts +5 -5
- package/dist/local/store/expo/database-key.d.ts.map +1 -1
- package/dist/local/store/expo/database-key.js.map +1 -1
- package/dist/local/store/expo/index.d.ts +3 -3
- package/dist/local/store/expo/index.d.ts.map +1 -1
- package/dist/local/store/expo/key-storage.d.ts +11 -5
- 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/index.d.ts +3 -3
- package/dist/local/store/index.d.ts.map +1 -1
- package/dist/local/store/index.js +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 +14 -6
- package/dist/local/store/memory/adapter.d.ts.map +1 -1
- package/dist/local/store/memory/adapter.js +114 -29
- package/dist/local/store/memory/adapter.js.map +1 -1
- package/dist/local/store/node/adapter.d.ts +9 -3
- 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 +17 -16
- 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 +10 -4
- 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 +4 -4
- 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 +11 -5
- package/dist/local/store/web/adapter.d.ts.map +1 -1
- package/dist/local/store/web/adapter.js +207 -74
- package/dist/local/store/web/adapter.js.map +1 -1
- package/dist/local/vault/expo-secure-store.d.ts +2 -2
- package/dist/local/vault/expo-secure-store.d.ts.map +1 -1
- package/dist/local/vault/index.d.ts +1 -1
- package/dist/local/vault/index.d.ts.map +1 -1
- package/dist/logger.d.ts +4 -4
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.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/profile/contact-state.d.ts +2 -2
- package/dist/profile/contact-state.d.ts.map +1 -1
- package/dist/profile/contact-state.js.map +1 -1
- package/dist/profile/profile-key.d.ts +2 -2
- package/dist/profile/profile-key.d.ts.map +1 -1
- package/dist/profile/profile-key.js.map +1 -1
- package/dist/profile/update-service.d.ts +2 -2
- package/dist/profile/update-service.d.ts.map +1 -1
- package/dist/profile/update-service.js.map +1 -1
- 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 +7 -14
- package/dist/remote/relay/index.d.ts.map +1 -1
- package/dist/remote/relay/index.js +6 -13
- package/dist/remote/relay/index.js.map +1 -1
- package/dist/remote/relay/memory/adapter.d.ts +5 -4
- package/dist/remote/relay/memory/adapter.d.ts.map +1 -1
- package/dist/remote/relay/memory/adapter.js +14 -4
- package/dist/remote/relay/memory/adapter.js.map +1 -1
- package/dist/remote/relay/types.d.ts +36 -25
- package/dist/remote/relay/types.d.ts.map +1 -1
- package/dist/remote/relay/types.js +1 -1
- package/dist/types/api.d.ts +59 -24
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.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 +16 -23
- package/docs/DEVIATIONS.md +1 -1
- package/docs/DOCUMENTATION_STANDARDS.md +4 -0
- package/docs/ERROR_HANDLING.md +2 -2
- package/docs/GETTING_STARTED.md +23 -38
- package/docs/INTERFACES.md +36 -27
- package/docs/PACKAGE_SURFACE.md +9 -16
- package/docs/RECIPES.md +10 -23
- package/examples/browser/index.html +2 -2
- package/groups/README.md +4 -4
- package/local/store/README.md +22 -7
- package/local/store/expo/README.md +24 -20
- package/local/store/memory/README.md +1 -1
- package/local/store/node/README.md +31 -2
- package/local/store/react-native/README.md +1 -1
- package/local/store/web/README.md +1 -1
- package/local/vault/README.md +1 -1
- package/media/README.md +94 -0
- package/package.json +17 -27
- package/remote/README.md +24 -24
- package/remote/object-store/README.md +8 -0
- package/remote/object-store/s3/README.md +10 -1
- package/remote/relay/README.md +4 -3
- package/remote/relay/memory/README.md +1 -1
- package/types/README.md +2 -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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../../../remote/relay/convex/component/_generated/component.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated data model types.
|
|
3
|
-
*
|
|
4
|
-
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
5
|
-
*
|
|
6
|
-
* To regenerate, run `npx convex dev`.
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
import type { DataModelFromSchemaDefinition, DocumentByName, TableNamesInDataModel, SystemTableNames } from "convex/server";
|
|
10
|
-
import type { GenericId } from "convex/values";
|
|
11
|
-
import schema from "../schema.js";
|
|
12
|
-
/**
|
|
13
|
-
* The names of all of your Convex tables.
|
|
14
|
-
*/
|
|
15
|
-
export type TableNames = TableNamesInDataModel<DataModel>;
|
|
16
|
-
/**
|
|
17
|
-
* The type of a document stored in Convex.
|
|
18
|
-
*
|
|
19
|
-
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
20
|
-
*/
|
|
21
|
-
export type Doc<TableName extends TableNames> = DocumentByName<DataModel, TableName>;
|
|
22
|
-
/**
|
|
23
|
-
* An identifier for a document in Convex.
|
|
24
|
-
*
|
|
25
|
-
* Convex documents are uniquely identified by their `Id`, which is accessible
|
|
26
|
-
* on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
|
|
27
|
-
*
|
|
28
|
-
* Documents can be loaded using `db.get(tableName, id)` in query and mutation functions.
|
|
29
|
-
*
|
|
30
|
-
* IDs are just strings at runtime, but this type can be used to distinguish them from other
|
|
31
|
-
* strings when type checking.
|
|
32
|
-
*
|
|
33
|
-
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
34
|
-
*/
|
|
35
|
-
export type Id<TableName extends TableNames | SystemTableNames> = GenericId<TableName>;
|
|
36
|
-
/**
|
|
37
|
-
* A type describing your Convex data model.
|
|
38
|
-
*
|
|
39
|
-
* This type includes information about what tables you have, the type of
|
|
40
|
-
* documents stored in those tables, and the indexes defined on them.
|
|
41
|
-
*
|
|
42
|
-
* This type is used to parameterize methods like `queryGeneric` and
|
|
43
|
-
* `mutationGeneric` to make them type-safe.
|
|
44
|
-
*/
|
|
45
|
-
export type DataModel = DataModelFromSchemaDefinition<typeof schema>;
|
|
46
|
-
//# sourceMappingURL=dataModel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dataModel.d.ts","sourceRoot":"","sources":["../../../../../../remote/relay/convex/component/_generated/dataModel.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,6BAA6B,EAC7B,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,GAAG,CAAC,SAAS,SAAS,UAAU,IAAI,cAAc,CAC5D,SAAS,EACT,SAAS,CACV,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,EAAE,CAAC,SAAS,SAAS,UAAU,GAAG,gBAAgB,IAC5D,SAAS,CAAC,SAAS,CAAC,CAAC;AAEvB;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,6BAA6B,CAAC,OAAO,MAAM,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dataModel.js","sourceRoot":"","sources":["../../../../../../remote/relay/convex/component/_generated/dataModel.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG"}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated utilities for implementing server-side Convex query and mutation functions.
|
|
3
|
-
*
|
|
4
|
-
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
5
|
-
*
|
|
6
|
-
* To regenerate, run `npx convex dev`.
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
import type { ActionBuilder, HttpActionBuilder, MutationBuilder, QueryBuilder, GenericActionCtx, GenericMutationCtx, GenericQueryCtx, GenericDatabaseReader, GenericDatabaseWriter } from "convex/server";
|
|
10
|
-
import type { DataModel } from "./dataModel.js";
|
|
11
|
-
/**
|
|
12
|
-
* Typesafe environment variables declared in `convex.config.ts`.
|
|
13
|
-
*/
|
|
14
|
-
type Env = {
|
|
15
|
-
readonly OE_GROUPS_SERVER_SECRET: string | undefined;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Define a query in this Convex app's public API.
|
|
19
|
-
*
|
|
20
|
-
* This function will be allowed to read your Convex database and will be accessible from the client.
|
|
21
|
-
*
|
|
22
|
-
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
23
|
-
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
24
|
-
*/
|
|
25
|
-
export declare const query: QueryBuilder<DataModel, "public">;
|
|
26
|
-
/**
|
|
27
|
-
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
28
|
-
*
|
|
29
|
-
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
|
|
30
|
-
*
|
|
31
|
-
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
32
|
-
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
33
|
-
*/
|
|
34
|
-
export declare const internalQuery: QueryBuilder<DataModel, "internal">;
|
|
35
|
-
/**
|
|
36
|
-
* Define a mutation in this Convex app's public API.
|
|
37
|
-
*
|
|
38
|
-
* This function will be allowed to modify your Convex database and will be accessible from the client.
|
|
39
|
-
*
|
|
40
|
-
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
41
|
-
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
42
|
-
*/
|
|
43
|
-
export declare const mutation: MutationBuilder<DataModel, "public">;
|
|
44
|
-
/**
|
|
45
|
-
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
46
|
-
*
|
|
47
|
-
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
|
|
48
|
-
*
|
|
49
|
-
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
50
|
-
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
51
|
-
*/
|
|
52
|
-
export declare const internalMutation: MutationBuilder<DataModel, "internal">;
|
|
53
|
-
/**
|
|
54
|
-
* Define an action in this Convex app's public API.
|
|
55
|
-
*
|
|
56
|
-
* An action is a function which can execute any JavaScript code, including non-deterministic
|
|
57
|
-
* code and code with side-effects, like calling third-party services.
|
|
58
|
-
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
|
|
59
|
-
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
|
|
60
|
-
*
|
|
61
|
-
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
|
|
62
|
-
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
63
|
-
*/
|
|
64
|
-
export declare const action: ActionBuilder<DataModel, "public">;
|
|
65
|
-
/**
|
|
66
|
-
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
67
|
-
*
|
|
68
|
-
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
|
|
69
|
-
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
70
|
-
*/
|
|
71
|
-
export declare const internalAction: ActionBuilder<DataModel, "internal">;
|
|
72
|
-
/**
|
|
73
|
-
* Define an HTTP action.
|
|
74
|
-
*
|
|
75
|
-
* The wrapped function will be used to respond to HTTP requests received
|
|
76
|
-
* by a Convex deployment if the requests matches the path and method where
|
|
77
|
-
* this action is routed. Be sure to route your httpAction in `convex/http.js`.
|
|
78
|
-
*
|
|
79
|
-
* @param func - The function. It receives an {@link ActionCtx} as its first argument
|
|
80
|
-
* and a Fetch API `Request` object as its second.
|
|
81
|
-
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
82
|
-
*/
|
|
83
|
-
export declare const httpAction: HttpActionBuilder;
|
|
84
|
-
export declare const env: Env;
|
|
85
|
-
/**
|
|
86
|
-
* A set of services for use within Convex query functions.
|
|
87
|
-
*
|
|
88
|
-
* The query context is passed as the first argument to any Convex query
|
|
89
|
-
* function run on the server.
|
|
90
|
-
*
|
|
91
|
-
* If you're using code generation, use the `QueryCtx` type in `convex/_generated/server.d.ts` instead.
|
|
92
|
-
*/
|
|
93
|
-
export type QueryCtx = GenericQueryCtx<DataModel>;
|
|
94
|
-
/**
|
|
95
|
-
* A set of services for use within Convex mutation functions.
|
|
96
|
-
*
|
|
97
|
-
* The mutation context is passed as the first argument to any Convex mutation
|
|
98
|
-
* function run on the server.
|
|
99
|
-
*
|
|
100
|
-
* If you're using code generation, use the `MutationCtx` type in `convex/_generated/server.d.ts` instead.
|
|
101
|
-
*/
|
|
102
|
-
export type MutationCtx = GenericMutationCtx<DataModel>;
|
|
103
|
-
/**
|
|
104
|
-
* A set of services for use within Convex action functions.
|
|
105
|
-
*
|
|
106
|
-
* The action context is passed as the first argument to any Convex action
|
|
107
|
-
* function run on the server.
|
|
108
|
-
*/
|
|
109
|
-
export type ActionCtx = GenericActionCtx<DataModel>;
|
|
110
|
-
/**
|
|
111
|
-
* An interface to read from the database within Convex query functions.
|
|
112
|
-
*
|
|
113
|
-
* The two entry points are {@link DatabaseReader.get}, which fetches a single
|
|
114
|
-
* document by its {@link Id}, or {@link DatabaseReader.query}, which starts
|
|
115
|
-
* building a query.
|
|
116
|
-
*/
|
|
117
|
-
export type DatabaseReader = GenericDatabaseReader<DataModel>;
|
|
118
|
-
/**
|
|
119
|
-
* An interface to read from and write to the database within Convex mutation
|
|
120
|
-
* functions.
|
|
121
|
-
*
|
|
122
|
-
* Convex guarantees that all writes within a single mutation are
|
|
123
|
-
* executed atomically, so you never have to worry about partial writes leaving
|
|
124
|
-
* your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)
|
|
125
|
-
* for the guarantees Convex provides your functions.
|
|
126
|
-
*/
|
|
127
|
-
export type DatabaseWriter = GenericDatabaseWriter<DataModel>;
|
|
128
|
-
export {};
|
|
129
|
-
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../../../remote/relay/convex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SAAS,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/**
|
|
3
|
-
* Generated utilities for implementing server-side Convex query and mutation functions.
|
|
4
|
-
*
|
|
5
|
-
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
-
*
|
|
7
|
-
* To regenerate, run `npx convex dev`.
|
|
8
|
-
* @module
|
|
9
|
-
*/
|
|
10
|
-
import { actionGeneric, httpActionGeneric, queryGeneric, mutationGeneric, internalActionGeneric, internalMutationGeneric, internalQueryGeneric, } from "convex/server";
|
|
11
|
-
/**
|
|
12
|
-
* Define a query in this Convex app's public API.
|
|
13
|
-
*
|
|
14
|
-
* This function will be allowed to read your Convex database and will be accessible from the client.
|
|
15
|
-
*
|
|
16
|
-
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
17
|
-
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
18
|
-
*/
|
|
19
|
-
export const query = queryGeneric;
|
|
20
|
-
/**
|
|
21
|
-
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
22
|
-
*
|
|
23
|
-
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
|
|
24
|
-
*
|
|
25
|
-
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
26
|
-
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
27
|
-
*/
|
|
28
|
-
export const internalQuery = internalQueryGeneric;
|
|
29
|
-
/**
|
|
30
|
-
* Define a mutation in this Convex app's public API.
|
|
31
|
-
*
|
|
32
|
-
* This function will be allowed to modify your Convex database and will be accessible from the client.
|
|
33
|
-
*
|
|
34
|
-
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
35
|
-
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
36
|
-
*/
|
|
37
|
-
export const mutation = mutationGeneric;
|
|
38
|
-
/**
|
|
39
|
-
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
40
|
-
*
|
|
41
|
-
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
|
|
42
|
-
*
|
|
43
|
-
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
44
|
-
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
45
|
-
*/
|
|
46
|
-
export const internalMutation = internalMutationGeneric;
|
|
47
|
-
/**
|
|
48
|
-
* Define an action in this Convex app's public API.
|
|
49
|
-
*
|
|
50
|
-
* An action is a function which can execute any JavaScript code, including non-deterministic
|
|
51
|
-
* code and code with side-effects, like calling third-party services.
|
|
52
|
-
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
|
|
53
|
-
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
|
|
54
|
-
*
|
|
55
|
-
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
|
|
56
|
-
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
57
|
-
*/
|
|
58
|
-
export const action = actionGeneric;
|
|
59
|
-
/**
|
|
60
|
-
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
61
|
-
*
|
|
62
|
-
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
|
|
63
|
-
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
64
|
-
*/
|
|
65
|
-
export const internalAction = internalActionGeneric;
|
|
66
|
-
/**
|
|
67
|
-
* Define an HTTP action.
|
|
68
|
-
*
|
|
69
|
-
* The wrapped function will be used to respond to HTTP requests received
|
|
70
|
-
* by a Convex deployment if the requests matches the path and method where
|
|
71
|
-
* this action is routed. Be sure to route your httpAction in `convex/http.js`.
|
|
72
|
-
*
|
|
73
|
-
* @param func - The function. It receives an {@link ActionCtx} as its first argument
|
|
74
|
-
* and a Fetch API `Request` object as its second.
|
|
75
|
-
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
76
|
-
*/
|
|
77
|
-
export const httpAction = httpActionGeneric;
|
|
78
|
-
export const env = process.env;
|
|
79
|
-
//# sourceMappingURL=server.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../../../remote/relay/convex/component/_generated/server.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAaH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAUvB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAsC,YAAY,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GACxB,oBAAoB,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAyC,eAAe,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAC3B,uBAAuB,CAAC;AAE1B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,MAAM,GAAuC,aAAa,CAAC;AAExE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GACzB,qBAAqB,CAAC;AAExB;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAsB,iBAAiB,CAAC;AAC/D,MAAM,CAAC,MAAM,GAAG,GAAQ,OAAO,CAAC,GAAqB,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { MutationCtx, QueryCtx } from './_generated/server.js';
|
|
2
|
-
export declare const callerIdentityArgs: {
|
|
3
|
-
callerUserId: import("convex/values").VString<string, "required">;
|
|
4
|
-
callerAciBytes: import("convex/values").VBytes<ArrayBuffer, "required">;
|
|
5
|
-
callerPniBytes: import("convex/values").VBytes<ArrayBuffer | undefined, "optional">;
|
|
6
|
-
};
|
|
7
|
-
type CallerIdentity = {
|
|
8
|
-
callerUserId: string;
|
|
9
|
-
callerAciBytes: ArrayBuffer;
|
|
10
|
-
callerPniBytes?: ArrayBuffer;
|
|
11
|
-
};
|
|
12
|
-
export declare function rememberAccount(ctx: MutationCtx, input: CallerIdentity): Promise<void>;
|
|
13
|
-
export declare function setUnidentifiedAccessKey(ctx: MutationCtx, userId: string, accessKey: Uint8Array): Promise<void>;
|
|
14
|
-
export declare function authorizeAccessKey(ctx: QueryCtx | MutationCtx, targetUserId: string, encodedAccessKey: string): Promise<void>;
|
|
15
|
-
/** A sealed-send recipient as named by the caller: routing ID plus the ACI
|
|
16
|
-
* the caller claims for it. */
|
|
17
|
-
export interface GroupSendRecipient {
|
|
18
|
-
userId: string;
|
|
19
|
-
aciBytes: ArrayBuffer;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Authorize a sealed send by group-send token, verifying before reading.
|
|
23
|
-
*
|
|
24
|
-
* The token endorses a set of ACIs, and the caller supplies the ACI it
|
|
25
|
-
* claims for each recipient. The entire cryptographic check runs before this
|
|
26
|
-
* function touches the database: parse, expiration, key derivation, and
|
|
27
|
-
* signature over the claimed set.
|
|
28
|
-
*
|
|
29
|
-
* That ordering is what the reference implementation gets by construction,
|
|
30
|
-
* because its sealed payloads name recipients by service ID. It is
|
|
31
|
-
* load-bearing here. With the lookups first, an anonymous caller holding a
|
|
32
|
-
* garbage token could bill the deployment. The cost is up to one indexed
|
|
33
|
-
* read per named recipient per call. This path is deliberately exempt from
|
|
34
|
-
* the per-recipient send budget, because the token is supposed to be the
|
|
35
|
-
* gate.
|
|
36
|
-
*
|
|
37
|
-
* Only after the token verifies are the claims bound. Each recipient's
|
|
38
|
-
* stored account must carry exactly the ACI the caller supplied for it. A
|
|
39
|
-
* caller who lies about a binding fails here. Such a caller has necessarily
|
|
40
|
-
* already presented a token our own group server issued over the claimed
|
|
41
|
-
* set. The reads it spent were an authenticated member's to spend.
|
|
42
|
-
*/
|
|
43
|
-
export declare function authorizeGroupSendToken(ctx: QueryCtx | MutationCtx, recipients: GroupSendRecipient[], serializedToken: ArrayBuffer): Promise<void>;
|
|
44
|
-
export {};
|
|
45
|
-
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../../../../remote/relay/convex/component/accounts.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAIjE,eAAO,MAAM,kBAAkB;IAC7B,YAAY;IACZ,cAAc;IACd,cAAc;CACf,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,WAAW,CAAC;IAC5B,cAAc,CAAC,EAAE,WAAW,CAAC;CAC9B,CAAC;AAoBF,wBAAsB,eAAe,CACnC,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,IAAI,CAAC,CAuEf;AAED,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,UAAU,GACpB,OAAO,CAAC,IAAI,CAAC,CAYf;AAED,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,QAAQ,GAAG,WAAW,EAC3B,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED;+BAC+B;AAC/B,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,WAAW,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,QAAQ,GAAG,WAAW,EAC3B,UAAU,EAAE,kBAAkB,EAAE,EAChC,eAAe,EAAE,WAAW,GAC3B,OAAO,CAAC,IAAI,CAAC,CA8Cf"}
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import { v } from 'convex/values';
|
|
2
|
-
import { base64ToBytes, bytesToBase64, constantTimeEqual, } from '../../../../internal/crypto/utils.js';
|
|
3
|
-
import { deriveForExpiration, deserializeFullToken, verifyFullToken, } from '../../../../internal/protocol/zk/groups/group-send-endorsement.js';
|
|
4
|
-
import { SERVICE_ID_ACI, } from '../../../../internal/protocol/zk/groups/uid-struct.js';
|
|
5
|
-
import { asBase64 } from '../../../../types/utils.js';
|
|
6
|
-
import { relayError, unauthorized } from './errors.js';
|
|
7
|
-
import { groupServerSecretParams, serviceIds } from './runtime.js';
|
|
8
|
-
export const callerIdentityArgs = {
|
|
9
|
-
callerUserId: v.string(),
|
|
10
|
-
callerAciBytes: v.bytes(),
|
|
11
|
-
callerPniBytes: v.optional(v.bytes()),
|
|
12
|
-
};
|
|
13
|
-
function requireUserId(userId) {
|
|
14
|
-
if (userId.length === 0) {
|
|
15
|
-
throw unauthorized('the resolved caller has no user ID');
|
|
16
|
-
}
|
|
17
|
-
return userId;
|
|
18
|
-
}
|
|
19
|
-
function sameBytes(a, b) {
|
|
20
|
-
if (a === undefined || b === undefined)
|
|
21
|
-
return a === b;
|
|
22
|
-
const left = new Uint8Array(a);
|
|
23
|
-
const right = new Uint8Array(b);
|
|
24
|
-
if (left.length !== right.length)
|
|
25
|
-
return false;
|
|
26
|
-
return left.every((byte, index) => byte === right[index]);
|
|
27
|
-
}
|
|
28
|
-
export async function rememberAccount(ctx, input) {
|
|
29
|
-
const userId = requireUserId(input.callerUserId);
|
|
30
|
-
serviceIds({
|
|
31
|
-
aciBytes: input.callerAciBytes,
|
|
32
|
-
pniBytes: input.callerPniBytes,
|
|
33
|
-
});
|
|
34
|
-
// One ACI, one account. The ACI is what sealed-sender authorization and
|
|
35
|
-
// group endorsements actually name. A second userId claiming the same ACI
|
|
36
|
-
// would inherit every authorization decision made about the first. The
|
|
37
|
-
// host's identify hook owns the userId↔ACI mapping. This enforces that the
|
|
38
|
-
// mapping is a function, at write time, on every mutation that passes
|
|
39
|
-
// through here.
|
|
40
|
-
//
|
|
41
|
-
// This is a write-time guard only: it keeps a duplicate from ever being
|
|
42
|
-
// written, but it does not repair one that already exists. If two rows
|
|
43
|
-
// somehow shared an ACI, `authorizeGroupSendToken` binds by reading
|
|
44
|
-
// `by_user_id` and comparing the stored ACI. A token naming that ACI would
|
|
45
|
-
// then bind for both userIds, the very inheritance this prevents. A
|
|
46
|
-
// duplicate must therefore never be allowed to exist. It cannot arise
|
|
47
|
-
// here: the check postdates the table, but no deployment carried data
|
|
48
|
-
// across that window.
|
|
49
|
-
//
|
|
50
|
-
// `.first()`, not `.unique()`: fail closed without an untyped throw. Were a
|
|
51
|
-
// duplicate ever present, `.unique()` would throw on *every* mutation from
|
|
52
|
-
// that ACI, and rememberAccount fronts nearly all of them. The losing
|
|
53
|
-
// account would then be locked out of sends, prekey uploads, device and
|
|
54
|
-
// provisioning operations alike, until an operator deleted the row. The
|
|
55
|
-
// loser is whichever this index happens to return second, not whoever
|
|
56
|
-
// registered first. Using `.first()` degrades that to a clean 409 on the
|
|
57
|
-
// same broad surface.
|
|
58
|
-
const claimant = await ctx.db
|
|
59
|
-
.query('accounts')
|
|
60
|
-
.withIndex('by_aci_bytes', (q) => q.eq('aciBytes', input.callerAciBytes))
|
|
61
|
-
.first();
|
|
62
|
-
if (claimant && claimant.userId !== userId) {
|
|
63
|
-
throw relayError('CONFLICT', 409, 'This protocol identity is already registered to another account');
|
|
64
|
-
}
|
|
65
|
-
const existing = await ctx.db
|
|
66
|
-
.query('accounts')
|
|
67
|
-
.withIndex('by_user_id', (q) => q.eq('userId', userId))
|
|
68
|
-
.unique();
|
|
69
|
-
if (existing) {
|
|
70
|
-
// Skip the write when the identity is unchanged. The rememberAccount
|
|
71
|
-
// mutation runs at the top of essentially every mutation, and
|
|
72
|
-
// sealed-sender authorization reads the same row on the recipient side.
|
|
73
|
-
// An unconditional freshness patch would turn this one document into an
|
|
74
|
-
// OCC conflict hotspot. The conflicts would be between a user's own
|
|
75
|
-
// concurrent mutations and every sealed send addressed to them.
|
|
76
|
-
if (sameBytes(existing.aciBytes, input.callerAciBytes) &&
|
|
77
|
-
sameBytes(existing.pniBytes, input.callerPniBytes)) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
await ctx.db.patch(existing._id, {
|
|
81
|
-
aciBytes: input.callerAciBytes,
|
|
82
|
-
pniBytes: input.callerPniBytes,
|
|
83
|
-
updatedAt: Date.now(),
|
|
84
|
-
});
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
await ctx.db.insert('accounts', {
|
|
88
|
-
userId,
|
|
89
|
-
aciBytes: input.callerAciBytes,
|
|
90
|
-
pniBytes: input.callerPniBytes,
|
|
91
|
-
updatedAt: Date.now(),
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
export async function setUnidentifiedAccessKey(ctx, userId, accessKey) {
|
|
95
|
-
const account = await ctx.db
|
|
96
|
-
.query('accounts')
|
|
97
|
-
.withIndex('by_user_id', (q) => q.eq('userId', userId))
|
|
98
|
-
.unique();
|
|
99
|
-
if (!account) {
|
|
100
|
-
throw unauthorized('the recipient account is not registered');
|
|
101
|
-
}
|
|
102
|
-
await ctx.db.patch(account._id, {
|
|
103
|
-
unidentifiedAccessKey: bytesToBase64(accessKey),
|
|
104
|
-
updatedAt: Date.now(),
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
export async function authorizeAccessKey(ctx, targetUserId, encodedAccessKey) {
|
|
108
|
-
const account = await ctx.db
|
|
109
|
-
.query('accounts')
|
|
110
|
-
.withIndex('by_user_id', (q) => q.eq('userId', targetUserId))
|
|
111
|
-
.unique();
|
|
112
|
-
if (!account?.unidentifiedAccessKey) {
|
|
113
|
-
throw unauthorized('the recipient has no unidentified-access key');
|
|
114
|
-
}
|
|
115
|
-
let supplied;
|
|
116
|
-
let expected;
|
|
117
|
-
try {
|
|
118
|
-
supplied = base64ToBytes(asBase64(encodedAccessKey));
|
|
119
|
-
expected = base64ToBytes(asBase64(account.unidentifiedAccessKey));
|
|
120
|
-
}
|
|
121
|
-
catch {
|
|
122
|
-
throw unauthorized('the unidentified-access key is malformed');
|
|
123
|
-
}
|
|
124
|
-
if (supplied.length !== 16 ||
|
|
125
|
-
expected.length !== 16 ||
|
|
126
|
-
!constantTimeEqual(supplied, expected)) {
|
|
127
|
-
throw unauthorized('the unidentified-access key is invalid');
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Authorize a sealed send by group-send token, verifying before reading.
|
|
132
|
-
*
|
|
133
|
-
* The token endorses a set of ACIs, and the caller supplies the ACI it
|
|
134
|
-
* claims for each recipient. The entire cryptographic check runs before this
|
|
135
|
-
* function touches the database: parse, expiration, key derivation, and
|
|
136
|
-
* signature over the claimed set.
|
|
137
|
-
*
|
|
138
|
-
* That ordering is what the reference implementation gets by construction,
|
|
139
|
-
* because its sealed payloads name recipients by service ID. It is
|
|
140
|
-
* load-bearing here. With the lookups first, an anonymous caller holding a
|
|
141
|
-
* garbage token could bill the deployment. The cost is up to one indexed
|
|
142
|
-
* read per named recipient per call. This path is deliberately exempt from
|
|
143
|
-
* the per-recipient send budget, because the token is supposed to be the
|
|
144
|
-
* gate.
|
|
145
|
-
*
|
|
146
|
-
* Only after the token verifies are the claims bound. Each recipient's
|
|
147
|
-
* stored account must carry exactly the ACI the caller supplied for it. A
|
|
148
|
-
* caller who lies about a binding fails here. Such a caller has necessarily
|
|
149
|
-
* already presented a token our own group server issued over the claimed
|
|
150
|
-
* set. The reads it spent were an authenticated member's to spend.
|
|
151
|
-
*/
|
|
152
|
-
export async function authorizeGroupSendToken(ctx, recipients, serializedToken) {
|
|
153
|
-
const claimedByUserId = new Map();
|
|
154
|
-
for (const recipient of recipients) {
|
|
155
|
-
const claimed = new Uint8Array(recipient.aciBytes);
|
|
156
|
-
if (claimed.length !== 16) {
|
|
157
|
-
throw unauthorized('a recipient ACI must be 16 bytes');
|
|
158
|
-
}
|
|
159
|
-
const existing = claimedByUserId.get(recipient.userId);
|
|
160
|
-
if (existing && !constantTimeEqual(existing, claimed)) {
|
|
161
|
-
throw unauthorized('conflicting ACIs claimed for one recipient');
|
|
162
|
-
}
|
|
163
|
-
claimedByUserId.set(recipient.userId, claimed);
|
|
164
|
-
}
|
|
165
|
-
try {
|
|
166
|
-
const fullToken = deserializeFullToken(new Uint8Array(serializedToken));
|
|
167
|
-
const serviceIdList = [...claimedByUserId.values()].map((uuid) => ({ kind: SERVICE_ID_ACI, uuid }));
|
|
168
|
-
verifyFullToken(fullToken, serviceIdList, Math.floor(Date.now() / 1000), deriveForExpiration(groupServerSecretParams().endorsementKeyPair, fullToken.expiration));
|
|
169
|
-
}
|
|
170
|
-
catch {
|
|
171
|
-
throw unauthorized('the group-send token is invalid');
|
|
172
|
-
}
|
|
173
|
-
for (const [userId, claimed] of claimedByUserId) {
|
|
174
|
-
const account = await ctx.db
|
|
175
|
-
.query('accounts')
|
|
176
|
-
.withIndex('by_user_id', (q) => q.eq('userId', userId))
|
|
177
|
-
.unique();
|
|
178
|
-
if (!account ||
|
|
179
|
-
!constantTimeEqual(new Uint8Array(account.aciBytes), claimed)) {
|
|
180
|
-
throw unauthorized(`recipient ${userId} does not hold the endorsed identity`);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
//# sourceMappingURL=accounts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../../../../remote/relay/convex/component/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EACL,aAAa,EACb,aAAa,EACb,iBAAiB,GAClB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,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,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAC7D,CAAC;YACD,MAAM,YAAY,CAChB,aAAa,MAAM,sCAAsC,CAC1D,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { PublicKey } from '../../../../keys/branded.js';
|
|
2
|
-
/** The deterministic trust root applications pin for sender certificates. */
|
|
3
|
-
export declare function senderCertificateTrustRoot(): Promise<PublicKey>;
|
|
4
|
-
export declare const issueSenderCertificate: import("convex/server").RegisteredMutation<"public", {
|
|
5
|
-
callerAciBytes: ArrayBuffer;
|
|
6
|
-
callerPniBytes?: ArrayBuffer | undefined;
|
|
7
|
-
callerUserId: string;
|
|
8
|
-
deviceId: number;
|
|
9
|
-
}, Promise<string>>;
|
|
10
|
-
//# sourceMappingURL=certificates.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"certificates.d.ts","sourceRoot":"","sources":["../../../../../remote/relay/convex/component/certificates.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,0BAA0B,CAAC;AA6EtE,6EAA6E;AAC7E,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,SAAS,CAAC,CAErE;AAED,eAAO,MAAM,sBAAsB;;;;;mBA8FjC,CAAC"}
|