@open-e2ee/signal-protocol-sdk 11.0.0 → 12.0.1
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 +4 -4
- package/ARCHITECTURE.md +6 -8
- package/CHANGELOG.md +1348 -0
- package/README.md +1 -1
- package/SECURITY.md +2 -2
- package/TROUBLESHOOTING.md +8 -8
- package/client/README.md +70 -37
- package/device/README.md +39 -85
- package/dist/client/client.d.ts +334 -63
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +1175 -186
- package/dist/client/client.js.map +1 -1
- package/dist/client/config.d.ts +57 -42
- package/dist/client/config.d.ts.map +1 -1
- package/dist/client/config.js +1 -1
- package/dist/client/config.js.map +1 -1
- package/dist/client/constants.d.ts +42 -8
- package/dist/client/constants.d.ts.map +1 -1
- package/dist/client/constants.js +48 -3
- package/dist/client/constants.js.map +1 -1
- package/dist/client/content-adapter.d.ts +80 -0
- package/dist/client/content-adapter.d.ts.map +1 -1
- package/dist/client/content-adapter.js +225 -12
- package/dist/client/content-adapter.js.map +1 -1
- package/dist/client/delivery-error.d.ts +150 -0
- package/dist/client/delivery-error.d.ts.map +1 -0
- package/dist/client/delivery-error.js +226 -0
- package/dist/client/delivery-error.js.map +1 -0
- package/dist/client/delivery-status.d.ts +32 -6
- package/dist/client/delivery-status.d.ts.map +1 -1
- package/dist/client/delivery-status.js +61 -13
- package/dist/client/delivery-status.js.map +1 -1
- package/dist/client/device-set-reconciliation.d.ts +196 -0
- package/dist/client/device-set-reconciliation.d.ts.map +1 -0
- package/dist/client/device-set-reconciliation.js +282 -0
- package/dist/client/device-set-reconciliation.js.map +1 -0
- package/dist/client/distribution-records.d.ts +29 -0
- package/dist/client/distribution-records.d.ts.map +1 -0
- package/dist/client/distribution-records.js +33 -0
- package/dist/client/distribution-records.js.map +1 -0
- package/dist/client/event-hooks.d.ts +280 -14
- package/dist/client/event-hooks.d.ts.map +1 -1
- package/dist/client/event-hooks.js +8 -0
- package/dist/client/event-hooks.js.map +1 -1
- package/dist/client/group-device-set.d.ts +47 -0
- package/dist/client/group-device-set.d.ts.map +1 -0
- package/dist/client/group-device-set.js +65 -0
- package/dist/client/group-device-set.js.map +1 -0
- package/dist/client/group-fetcher.d.ts +116 -0
- package/dist/client/group-fetcher.d.ts.map +1 -0
- package/dist/client/group-fetcher.js +598 -0
- package/dist/client/group-fetcher.js.map +1 -0
- package/dist/client/group-outbox.d.ts +172 -10
- package/dist/client/group-outbox.d.ts.map +1 -1
- package/dist/client/group-outbox.js +915 -74
- package/dist/client/group-outbox.js.map +1 -1
- package/dist/client/group-receive-authorization.d.ts +127 -4
- package/dist/client/group-receive-authorization.d.ts.map +1 -1
- package/dist/client/group-receive-authorization.js +270 -20
- package/dist/client/group-receive-authorization.js.map +1 -1
- package/dist/client/group-sealed-sender.d.ts +3 -0
- package/dist/client/group-sealed-sender.d.ts.map +1 -1
- package/dist/client/group-sealed-sender.js +1 -0
- package/dist/client/group-sealed-sender.js.map +1 -1
- package/dist/client/group-sender-key-operations.d.ts +14 -3
- package/dist/client/group-sender-key-operations.d.ts.map +1 -1
- package/dist/client/group-sender-key-operations.js +26 -5
- package/dist/client/group-sender-key-operations.js.map +1 -1
- package/dist/client/groups.d.ts +5 -5
- package/dist/client/groups.d.ts.map +1 -1
- package/dist/client/groups.js +5 -4
- package/dist/client/groups.js.map +1 -1
- package/dist/client/hosted-anonymous-delivery.d.ts +61 -9
- package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -1
- package/dist/client/hosted-anonymous-delivery.js +242 -48
- package/dist/client/hosted-anonymous-delivery.js.map +1 -1
- package/dist/client/hosted-assertion-id.d.ts +7 -0
- package/dist/client/hosted-assertion-id.d.ts.map +1 -0
- package/dist/client/hosted-assertion-id.js +51 -0
- package/dist/client/hosted-assertion-id.js.map +1 -0
- package/dist/client/hosted-mailbox-subscription.d.ts +34 -2
- package/dist/client/hosted-mailbox-subscription.d.ts.map +1 -1
- package/dist/client/hosted-mailbox-subscription.js +87 -17
- package/dist/client/hosted-mailbox-subscription.js.map +1 -1
- package/dist/client/hosted-push.d.ts +22 -4
- package/dist/client/hosted-push.d.ts.map +1 -1
- package/dist/client/hosted-push.js +75 -22
- package/dist/client/hosted-push.js.map +1 -1
- package/dist/client/hosted-transport.d.ts +22 -28
- package/dist/client/hosted-transport.d.ts.map +1 -1
- package/dist/client/hosted-transport.js +115 -55
- package/dist/client/hosted-transport.js.map +1 -1
- package/dist/client/hosted.d.ts +10 -4
- package/dist/client/hosted.d.ts.map +1 -1
- package/dist/client/hosted.js +10 -4
- package/dist/client/hosted.js.map +1 -1
- package/dist/client/index.d.ts +5 -3
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/messages.d.ts +25 -3
- package/dist/client/messages.d.ts.map +1 -1
- package/dist/client/messages.js +111 -20
- package/dist/client/messages.js.map +1 -1
- package/dist/client/receive-admission.d.ts +58 -0
- package/dist/client/receive-admission.d.ts.map +1 -0
- package/dist/client/receive-admission.js +78 -0
- package/dist/client/receive-admission.js.map +1 -0
- package/dist/client/receive-expiry.d.ts +31 -0
- package/dist/client/receive-expiry.d.ts.map +1 -0
- package/dist/client/receive-expiry.js +35 -0
- package/dist/client/receive-expiry.js.map +1 -0
- package/dist/client/receive-hook-bound.d.ts +50 -0
- package/dist/client/receive-hook-bound.d.ts.map +1 -0
- package/dist/client/receive-hook-bound.js +115 -0
- package/dist/client/receive-hook-bound.js.map +1 -0
- package/dist/client/receive-queue.d.ts +299 -0
- package/dist/client/receive-queue.d.ts.map +1 -0
- package/dist/client/receive-queue.js +1420 -0
- package/dist/client/receive-queue.js.map +1 -0
- package/dist/client/receive-work-seed.d.ts +54 -0
- package/dist/client/receive-work-seed.d.ts.map +1 -0
- package/dist/client/receive-work-seed.js +116 -0
- package/dist/client/receive-work-seed.js.map +1 -0
- package/dist/client/recovery-driver.d.ts +25 -0
- package/dist/client/recovery-driver.d.ts.map +1 -0
- package/dist/client/recovery-driver.js +121 -0
- package/dist/client/recovery-driver.js.map +1 -0
- package/dist/client/relay-acceptance.d.ts +20 -7
- package/dist/client/relay-acceptance.d.ts.map +1 -1
- package/dist/client/relay-acceptance.js +30 -12
- package/dist/client/relay-acceptance.js.map +1 -1
- package/dist/client/relay-device-refusal.d.ts +18 -0
- package/dist/client/relay-device-refusal.d.ts.map +1 -1
- package/dist/client/relay-device-refusal.js +31 -0
- package/dist/client/relay-device-refusal.js.map +1 -1
- package/dist/client/relay-sealed-route.d.ts +36 -0
- package/dist/client/relay-sealed-route.d.ts.map +1 -0
- package/dist/client/relay-sealed-route.js +45 -0
- package/dist/client/relay-sealed-route.js.map +1 -0
- package/dist/client/relay-subscription.d.ts +56 -13
- package/dist/client/relay-subscription.d.ts.map +1 -1
- package/dist/client/relay-subscription.js +193 -123
- package/dist/client/relay-subscription.js.map +1 -1
- package/dist/client/resendable-content.d.ts +98 -0
- package/dist/client/resendable-content.d.ts.map +1 -0
- package/dist/client/resendable-content.js +136 -0
- package/dist/client/resendable-content.js.map +1 -0
- package/dist/client/retry-family.d.ts +57 -10
- package/dist/client/retry-family.d.ts.map +1 -1
- package/dist/client/retry-family.js +54 -12
- package/dist/client/retry-family.js.map +1 -1
- package/dist/client/retry-request-envelope.d.ts +107 -8
- package/dist/client/retry-request-envelope.d.ts.map +1 -1
- package/dist/client/retry-request-envelope.js +172 -23
- package/dist/client/retry-request-envelope.js.map +1 -1
- package/dist/client/retry-request-lifecycle.d.ts +70 -14
- package/dist/client/retry-request-lifecycle.d.ts.map +1 -1
- package/dist/client/retry-request-lifecycle.js +162 -32
- package/dist/client/retry-request-lifecycle.js.map +1 -1
- package/dist/client/retry-terminal-recovery.d.ts +100 -0
- package/dist/client/retry-terminal-recovery.d.ts.map +1 -0
- package/dist/client/retry-terminal-recovery.js +164 -0
- package/dist/client/retry-terminal-recovery.js.map +1 -0
- package/dist/client/retry-utils.d.ts +27 -0
- package/dist/client/retry-utils.d.ts.map +1 -1
- package/dist/client/retry-utils.js +46 -0
- package/dist/client/retry-utils.js.map +1 -1
- package/dist/client/retry.d.ts +100 -12
- package/dist/client/retry.d.ts.map +1 -1
- package/dist/client/retry.js +619 -116
- package/dist/client/retry.js.map +1 -1
- package/dist/client/sealed-sender.d.ts +23 -6
- package/dist/client/sealed-sender.d.ts.map +1 -1
- package/dist/client/sealed-sender.js +30 -6
- package/dist/client/sealed-sender.js.map +1 -1
- package/dist/client/sessions.d.ts +2 -2
- package/dist/client/sessions.js +2 -2
- package/dist/client/signal-service-cipher.d.ts +726 -19
- package/dist/client/signal-service-cipher.d.ts.map +1 -1
- package/dist/client/signal-service-cipher.js +2260 -342
- package/dist/client/signal-service-cipher.js.map +1 -1
- package/dist/client/state.d.ts +5 -0
- package/dist/client/state.d.ts.map +1 -1
- package/dist/client/state.js +11 -1
- package/dist/client/state.js.map +1 -1
- package/dist/client/storage-protection.d.ts +64 -0
- package/dist/client/storage-protection.d.ts.map +1 -0
- package/dist/client/storage-protection.js +150 -0
- package/dist/client/storage-protection.js.map +1 -0
- package/dist/client/types.d.ts +149 -15
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/types.js +1 -1
- package/dist/client/types.js.map +1 -1
- package/dist/device/constants.d.ts +0 -5
- package/dist/device/constants.d.ts.map +1 -1
- package/dist/device/constants.js +0 -5
- package/dist/device/constants.js.map +1 -1
- package/dist/device/expo/index.d.ts +4 -17
- package/dist/device/expo/index.d.ts.map +1 -1
- package/dist/device/expo/index.js +4 -23
- package/dist/device/expo/index.js.map +1 -1
- package/dist/device/index.d.ts +0 -2
- package/dist/device/index.d.ts.map +1 -1
- package/dist/device/index.js +0 -7
- package/dist/device/index.js.map +1 -1
- package/dist/device/lifecycle/manager.d.ts +5 -4
- package/dist/device/lifecycle/manager.d.ts.map +1 -1
- package/dist/device/lifecycle/manager.js +16 -16
- package/dist/device/lifecycle/manager.js.map +1 -1
- package/dist/device/lifecycle/types.d.ts +2 -2
- package/dist/device/lifecycle/types.d.ts.map +1 -1
- package/dist/device/react-native/index.d.ts +4 -15
- package/dist/device/react-native/index.d.ts.map +1 -1
- package/dist/device/react-native/index.js +4 -21
- package/dist/device/react-native/index.js.map +1 -1
- package/dist/device/types.d.ts +1 -1
- package/dist/groups/index.d.ts +1 -1
- package/dist/groups/index.d.ts.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/crypto/ec/x25519-validation.d.ts +0 -1
- package/dist/internal/crypto/ec/x25519-validation.d.ts.map +1 -1
- package/dist/internal/crypto/ec/x25519-validation.js +0 -1
- package/dist/internal/crypto/ec/x25519-validation.js.map +1 -1
- package/dist/internal/crypto/validation.d.ts +2 -2
- package/dist/internal/groups/index.d.ts +1 -0
- package/dist/internal/groups/index.d.ts.map +1 -1
- package/dist/internal/groups/index.js +1 -0
- package/dist/internal/groups/index.js.map +1 -1
- package/dist/internal/groups/manager.d.ts +37 -16
- package/dist/internal/groups/manager.d.ts.map +1 -1
- package/dist/internal/groups/manager.js +46 -1
- package/dist/internal/groups/manager.js.map +1 -1
- package/dist/internal/groups/receive-record.d.ts +78 -0
- package/dist/internal/groups/receive-record.d.ts.map +1 -0
- package/dist/internal/groups/receive-record.js +43 -0
- package/dist/internal/groups/receive-record.js.map +1 -0
- package/dist/internal/groups/sdk-store.d.ts +27 -3
- package/dist/internal/groups/sdk-store.d.ts.map +1 -1
- package/dist/internal/groups/sdk-store.js +151 -19
- package/dist/internal/groups/sdk-store.js.map +1 -1
- package/dist/internal/groups/wire.d.ts +12 -1
- package/dist/internal/groups/wire.d.ts.map +1 -1
- package/dist/internal/groups/wire.js +36 -0
- package/dist/internal/groups/wire.js.map +1 -1
- package/dist/internal/manager/index.d.ts +1 -1
- package/dist/internal/manager/manager.d.ts +26 -20
- package/dist/internal/manager/manager.d.ts.map +1 -1
- package/dist/internal/manager/manager.js +64 -41
- package/dist/internal/manager/manager.js.map +1 -1
- package/dist/internal/protocol/double-ratchet/chains.d.ts +4 -18
- package/dist/internal/protocol/double-ratchet/chains.d.ts.map +1 -1
- package/dist/internal/protocol/double-ratchet/chains.js +23 -74
- package/dist/internal/protocol/double-ratchet/chains.js.map +1 -1
- package/dist/internal/protocol/double-ratchet/index.d.ts +1 -1
- package/dist/internal/protocol/double-ratchet/index.d.ts.map +1 -1
- package/dist/internal/protocol/double-ratchet/index.js +1 -1
- package/dist/internal/protocol/double-ratchet/index.js.map +1 -1
- package/dist/internal/protocol/double-ratchet/ratchet.d.ts +5 -7
- package/dist/internal/protocol/double-ratchet/ratchet.d.ts.map +1 -1
- package/dist/internal/protocol/double-ratchet/ratchet.js +4 -6
- package/dist/internal/protocol/double-ratchet/ratchet.js.map +1 -1
- package/dist/internal/protocol/pqxdh/pqxdh.d.ts.map +1 -1
- package/dist/internal/protocol/pqxdh/pqxdh.js +2 -1
- package/dist/internal/protocol/pqxdh/pqxdh.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/types.d.ts +6 -8
- package/dist/internal/protocol/sealed-sender/types.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/types.js +8 -9
- package/dist/internal/protocol/sealed-sender/types.js.map +1 -1
- package/dist/internal/protocol/sender-keys/handoff-ledger.d.ts +110 -0
- package/dist/internal/protocol/sender-keys/handoff-ledger.d.ts.map +1 -0
- package/dist/internal/protocol/sender-keys/handoff-ledger.js +124 -0
- package/dist/internal/protocol/sender-keys/handoff-ledger.js.map +1 -0
- package/dist/internal/protocol/sender-keys/manager.d.ts +71 -62
- package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
- package/dist/internal/protocol/sender-keys/manager.js +228 -175
- package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
- package/dist/internal/protocol/spqr/index.d.ts +2 -2
- package/dist/internal/protocol/spqr/index.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/index.js +2 -2
- package/dist/internal/protocol/spqr/index.js.map +1 -1
- package/dist/internal/protocol/spqr/serialize.d.ts +9 -1
- package/dist/internal/protocol/spqr/serialize.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/serialize.js +56 -16
- package/dist/internal/protocol/spqr/serialize.js.map +1 -1
- package/dist/internal/protocol/spqr/spqr.d.ts +1 -14
- package/dist/internal/protocol/spqr/spqr.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/spqr.js +54 -42
- package/dist/internal/protocol/spqr/spqr.js.map +1 -1
- package/dist/internal/protocol/spqr/validate.d.ts +26 -6
- package/dist/internal/protocol/spqr/validate.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/validate.js +49 -21
- package/dist/internal/protocol/spqr/validate.js.map +1 -1
- package/dist/internal/sesame/index.d.ts +1 -1
- package/dist/internal/sesame/index.d.ts.map +1 -1
- package/dist/internal/sesame/index.js.map +1 -1
- package/dist/internal/sesame/manager.d.ts +66 -13
- package/dist/internal/sesame/manager.d.ts.map +1 -1
- package/dist/internal/sesame/manager.js +221 -87
- package/dist/internal/sesame/manager.js.map +1 -1
- package/dist/internal/sesame/types.d.ts +95 -17
- package/dist/internal/sesame/types.d.ts.map +1 -1
- package/dist/internal/sesame/types.js +17 -0
- package/dist/internal/sesame/types.js.map +1 -1
- package/dist/internal/session/builder.d.ts +5 -5
- package/dist/internal/session/builder.d.ts.map +1 -1
- package/dist/internal/session/builder.js +12 -17
- package/dist/internal/session/builder.js.map +1 -1
- package/dist/internal/session/cipher.d.ts +15 -13
- package/dist/internal/session/cipher.d.ts.map +1 -1
- package/dist/internal/session/cipher.js +41 -23
- package/dist/internal/session/cipher.js.map +1 -1
- package/dist/internal/session/factory.d.ts +5 -5
- package/dist/internal/session/factory.d.ts.map +1 -1
- package/dist/internal/session/factory.js +4 -4
- package/dist/internal/session/factory.js.map +1 -1
- package/dist/internal/session/handshake.d.ts +14 -16
- package/dist/internal/session/handshake.d.ts.map +1 -1
- package/dist/internal/session/handshake.js +18 -75
- package/dist/internal/session/handshake.js.map +1 -1
- package/dist/internal/session/index.d.ts +1 -1
- package/dist/internal/session/index.js +1 -1
- package/dist/internal/session/record-locks.d.ts +17 -6
- package/dist/internal/session/record-locks.d.ts.map +1 -1
- package/dist/internal/session/record-locks.js +43 -7
- package/dist/internal/session/record-locks.js.map +1 -1
- package/dist/internal/session/session-resolver.d.ts +1 -1
- package/dist/internal/session/session-resolver.js +1 -1
- package/dist/internal/session/state.d.ts +2 -2
- package/dist/internal/session/state.js +1 -1
- package/dist/internal/session/types.d.ts +5 -13
- package/dist/internal/session/types.d.ts.map +1 -1
- package/dist/internal/session/types.js +1 -1
- package/dist/keys/generation.d.ts +2 -2
- package/dist/keys/generation.js +2 -2
- package/dist/keys/types.d.ts +5 -5
- package/dist/keys/types.d.ts.map +1 -1
- package/dist/keys/types.js +1 -1
- package/dist/layers.d.ts +1 -1
- package/dist/layers.js +2 -2
- package/dist/layers.js.map +1 -1
- package/dist/local/store/expo/adapter.d.ts.map +1 -1
- package/dist/local/store/expo/adapter.js +12 -8
- package/dist/local/store/expo/adapter.js.map +1 -1
- package/dist/local/store/key-value/adapter.d.ts +76 -10
- package/dist/local/store/key-value/adapter.d.ts.map +1 -1
- package/dist/local/store/key-value/adapter.js +367 -61
- package/dist/local/store/key-value/adapter.js.map +1 -1
- package/dist/local/store/key-value/backend-conformance.d.ts.map +1 -1
- package/dist/local/store/key-value/backend-conformance.js +74 -0
- package/dist/local/store/key-value/backend-conformance.js.map +1 -1
- package/dist/local/store/key-value/batch.d.ts +2 -0
- package/dist/local/store/key-value/batch.d.ts.map +1 -1
- package/dist/local/store/key-value/batch.js +26 -0
- package/dist/local/store/key-value/batch.js.map +1 -1
- package/dist/local/store/key-value/receive-work.d.ts +55 -0
- package/dist/local/store/key-value/receive-work.d.ts.map +1 -0
- package/dist/local/store/key-value/receive-work.js +162 -0
- package/dist/local/store/key-value/receive-work.js.map +1 -0
- package/dist/local/store/key-value/send-log.d.ts +61 -0
- package/dist/local/store/key-value/send-log.d.ts.map +1 -0
- package/dist/local/store/key-value/send-log.js +430 -0
- package/dist/local/store/key-value/send-log.js.map +1 -0
- package/dist/local/store/key-value/sender-key-handoff.d.ts +68 -0
- package/dist/local/store/key-value/sender-key-handoff.d.ts.map +1 -0
- package/dist/local/store/key-value/sender-key-handoff.js +189 -0
- package/dist/local/store/key-value/sender-key-handoff.js.map +1 -0
- package/dist/local/store/key-value/storage.d.ts +15 -0
- package/dist/local/store/key-value/storage.d.ts.map +1 -1
- package/dist/local/store/keyed-index.d.ts +23 -0
- package/dist/local/store/keyed-index.d.ts.map +1 -0
- package/dist/local/store/keyed-index.js +41 -0
- package/dist/local/store/keyed-index.js.map +1 -0
- package/dist/local/store/memory/adapter.d.ts +44 -12
- package/dist/local/store/memory/adapter.d.ts.map +1 -1
- package/dist/local/store/memory/adapter.js +197 -46
- package/dist/local/store/memory/adapter.js.map +1 -1
- package/dist/local/store/memory/send-log.d.ts +42 -0
- package/dist/local/store/memory/send-log.d.ts.map +1 -0
- package/dist/local/store/memory/send-log.js +190 -0
- package/dist/local/store/memory/send-log.js.map +1 -0
- package/dist/local/store/node/adapter.d.ts.map +1 -1
- package/dist/local/store/node/adapter.js +8 -6
- package/dist/local/store/node/adapter.js.map +1 -1
- package/dist/local/store/react-native/adapter.d.ts.map +1 -1
- package/dist/local/store/react-native/adapter.js +12 -8
- package/dist/local/store/react-native/adapter.js.map +1 -1
- package/dist/local/store/receive-work.d.ts +87 -0
- package/dist/local/store/receive-work.d.ts.map +1 -0
- package/dist/local/store/receive-work.js +204 -0
- package/dist/local/store/receive-work.js.map +1 -0
- package/dist/local/store/received-content.d.ts +3 -3
- package/dist/local/store/received-content.d.ts.map +1 -1
- package/dist/local/store/received-content.js +2 -11
- package/dist/local/store/received-content.js.map +1 -1
- package/dist/local/store/reliability.d.ts +317 -18
- package/dist/local/store/reliability.d.ts.map +1 -1
- package/dist/local/store/reliability.js +371 -46
- package/dist/local/store/reliability.js.map +1 -1
- package/dist/local/store/send-log-order.d.ts +15 -0
- package/dist/local/store/send-log-order.d.ts.map +1 -0
- package/dist/local/store/send-log-order.js +24 -0
- package/dist/local/store/send-log-order.js.map +1 -0
- package/dist/local/store/sender-key-handoff-index.d.ts +38 -0
- package/dist/local/store/sender-key-handoff-index.d.ts.map +1 -0
- package/dist/local/store/sender-key-handoff-index.js +101 -0
- package/dist/local/store/sender-key-handoff-index.js.map +1 -0
- package/dist/local/store/sender-key-handoff-table.d.ts +29 -0
- package/dist/local/store/sender-key-handoff-table.d.ts.map +1 -0
- package/dist/local/store/sender-key-handoff-table.js +97 -0
- package/dist/local/store/sender-key-handoff-table.js.map +1 -0
- package/dist/local/store/sqlite/driver.d.ts +9 -0
- package/dist/local/store/sqlite/driver.d.ts.map +1 -1
- package/dist/local/store/sqlite/encryption.d.ts +8 -1
- package/dist/local/store/sqlite/encryption.d.ts.map +1 -1
- package/dist/local/store/sqlite/encryption.js +9 -0
- package/dist/local/store/sqlite/encryption.js.map +1 -1
- package/dist/local/store/sqlite/key-storage/index.d.ts +25 -4
- package/dist/local/store/sqlite/key-storage/index.d.ts.map +1 -1
- package/dist/local/store/sqlite/key-storage/index.js +68 -7
- package/dist/local/store/sqlite/key-storage/index.js.map +1 -1
- package/dist/local/store/sqlite/key-storage/message-records.d.ts +16 -4
- package/dist/local/store/sqlite/key-storage/message-records.d.ts.map +1 -1
- package/dist/local/store/sqlite/key-storage/message-records.js +49 -6
- package/dist/local/store/sqlite/key-storage/message-records.js.map +1 -1
- package/dist/local/store/sqlite/key-storage/metadata.d.ts +8 -7
- package/dist/local/store/sqlite/key-storage/metadata.d.ts.map +1 -1
- package/dist/local/store/sqlite/key-storage/metadata.js +17 -15
- package/dist/local/store/sqlite/key-storage/metadata.js.map +1 -1
- package/dist/local/store/sqlite/key-storage/receive-work.d.ts +27 -0
- package/dist/local/store/sqlite/key-storage/receive-work.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/receive-work.js +98 -0
- package/dist/local/store/sqlite/key-storage/receive-work.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/send-log.d.ts +27 -0
- package/dist/local/store/sqlite/key-storage/send-log.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/send-log.js +178 -0
- package/dist/local/store/sqlite/key-storage/send-log.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/sender-key-handoff.d.ts +27 -0
- package/dist/local/store/sqlite/key-storage/sender-key-handoff.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/sender-key-handoff.js +75 -0
- package/dist/local/store/sqlite/key-storage/sender-key-handoff.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/session-trust.d.ts +2 -2
- package/dist/local/store/sqlite/key-storage/session-trust.js +5 -5
- package/dist/local/store/sqlite/key-storage/session-trust.js.map +1 -1
- package/dist/local/store/sqlite/migrations.d.ts.map +1 -1
- package/dist/local/store/sqlite/migrations.js +101 -0
- package/dist/local/store/sqlite/migrations.js.map +1 -1
- package/dist/local/store/sqlite/models/index.d.ts +2 -1
- package/dist/local/store/sqlite/models/index.d.ts.map +1 -1
- package/dist/local/store/sqlite/models/index.js +5 -1
- package/dist/local/store/sqlite/models/index.js.map +1 -1
- package/dist/local/store/sqlite/models/message-record.d.ts +15 -0
- package/dist/local/store/sqlite/models/message-record.d.ts.map +1 -1
- package/dist/local/store/sqlite/models/message-record.js +24 -0
- package/dist/local/store/sqlite/models/message-record.js.map +1 -1
- package/dist/local/store/sqlite/models/send-log.d.ts +51 -0
- package/dist/local/store/sqlite/models/send-log.d.ts.map +1 -0
- package/dist/local/store/sqlite/models/send-log.js +206 -0
- package/dist/local/store/sqlite/models/send-log.js.map +1 -0
- package/dist/local/store/sqlite/open-store.d.ts +9 -1
- package/dist/local/store/sqlite/open-store.d.ts.map +1 -1
- package/dist/local/store/sqlite/open-store.js +20 -1
- package/dist/local/store/sqlite/open-store.js.map +1 -1
- package/dist/local/store/sqlite/schema.d.ts +34 -1
- package/dist/local/store/sqlite/schema.d.ts.map +1 -1
- package/dist/local/store/sqlite/schema.js +14 -0
- package/dist/local/store/sqlite/schema.js.map +1 -1
- package/dist/local/store/sqlite/store.d.ts +61 -11
- package/dist/local/store/sqlite/store.d.ts.map +1 -1
- package/dist/local/store/sqlite/store.js +191 -27
- package/dist/local/store/sqlite/store.js.map +1 -1
- package/dist/local/store/sqlite/web/sqlite3mc/sqlite3.mjs +2 -1
- package/dist/local/store/sqlite/web/worker.d.ts +8 -0
- package/dist/local/store/sqlite/web/worker.d.ts.map +1 -1
- package/dist/local/store/sqlite/web/worker.js +64 -2
- package/dist/local/store/sqlite/web/worker.js.map +1 -1
- package/dist/local/store/web/adapter.d.ts +76 -8
- package/dist/local/store/web/adapter.d.ts.map +1 -1
- package/dist/local/store/web/adapter.js +579 -127
- package/dist/local/store/web/adapter.js.map +1 -1
- package/dist/local/store/web/receive-work.d.ts +57 -0
- package/dist/local/store/web/receive-work.d.ts.map +1 -0
- package/dist/local/store/web/receive-work.js +99 -0
- package/dist/local/store/web/receive-work.js.map +1 -0
- package/dist/local/store/web/send-log.d.ts +92 -0
- package/dist/local/store/web/send-log.d.ts.map +1 -0
- package/dist/local/store/web/send-log.js +267 -0
- package/dist/local/store/web/send-log.js.map +1 -0
- package/dist/local/store/web/sender-key-handoff.d.ts +81 -0
- package/dist/local/store/web/sender-key-handoff.d.ts.map +1 -0
- package/dist/local/store/web/sender-key-handoff.js +156 -0
- package/dist/local/store/web/sender-key-handoff.js.map +1 -0
- package/dist/local/store/web-sqlite/adapter.d.ts +2 -0
- package/dist/local/store/web-sqlite/adapter.d.ts.map +1 -1
- package/dist/local/store/web-sqlite/adapter.js +12 -6
- package/dist/local/store/web-sqlite/adapter.js.map +1 -1
- package/dist/local/vault/custody.d.ts +8 -0
- package/dist/local/vault/custody.d.ts.map +1 -0
- package/dist/local/vault/custody.js +9 -0
- package/dist/local/vault/custody.js.map +1 -0
- package/dist/local/vault/electron-safe-storage.d.ts +3 -1
- package/dist/local/vault/electron-safe-storage.d.ts.map +1 -1
- package/dist/local/vault/electron-safe-storage.js +2 -0
- package/dist/local/vault/electron-safe-storage.js.map +1 -1
- package/dist/local/vault/expo-secure-store.d.ts +3 -1
- package/dist/local/vault/expo-secure-store.d.ts.map +1 -1
- package/dist/local/vault/expo-secure-store.js +2 -0
- package/dist/local/vault/expo-secure-store.js.map +1 -1
- package/dist/local/vault/indexed-db.d.ts +3 -1
- package/dist/local/vault/indexed-db.d.ts.map +1 -1
- package/dist/local/vault/indexed-db.js +2 -0
- package/dist/local/vault/indexed-db.js.map +1 -1
- package/dist/local/vault/react-native-keychain.d.ts +3 -1
- package/dist/local/vault/react-native-keychain.d.ts.map +1 -1
- package/dist/local/vault/react-native-keychain.js +2 -0
- package/dist/local/vault/react-native-keychain.js.map +1 -1
- package/dist/remote/relay/device-set.d.ts +94 -0
- package/dist/remote/relay/device-set.d.ts.map +1 -0
- package/dist/remote/relay/device-set.js +156 -0
- package/dist/remote/relay/device-set.js.map +1 -0
- package/dist/remote/relay/types.d.ts +92 -107
- package/dist/remote/relay/types.d.ts.map +1 -1
- package/dist/safety/core.d.ts +15 -6
- package/dist/safety/core.d.ts.map +1 -1
- package/dist/safety/core.js +41 -27
- package/dist/safety/core.js.map +1 -1
- package/dist/safety/index.d.ts +2 -1
- package/dist/safety/index.d.ts.map +1 -1
- package/dist/safety/index.js +12 -18
- package/dist/safety/index.js.map +1 -1
- package/dist/types/api.d.ts +707 -62
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/errors.d.ts +14 -33
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +14 -24
- package/dist/types/errors.js.map +1 -1
- package/dist/types/messages.d.ts +2 -2
- package/dist/types/messages.js +1 -1
- package/dist/types/protocol-config.d.ts +175 -42
- package/dist/types/protocol-config.d.ts.map +1 -1
- package/dist/types/protocol-config.js +19 -38
- package/dist/types/protocol-config.js.map +1 -1
- package/dist/types/protocol-constants.d.ts +6 -6
- package/dist/types/protocol-constants.js +6 -6
- package/dist/types/session.d.ts +7 -7
- package/dist/types/session.d.ts.map +1 -1
- package/dist/types/session.js +39 -21
- package/dist/types/session.js.map +1 -1
- package/dist/username/link.d.ts +2 -2
- package/dist/username/link.js +2 -2
- package/dist/utils/origin-lock.d.ts +45 -0
- package/dist/utils/origin-lock.d.ts.map +1 -0
- package/dist/utils/origin-lock.js +80 -0
- package/dist/utils/origin-lock.js.map +1 -0
- package/docs/ASSURANCE.md +6 -6
- package/docs/CLIENT_COMPOSITION.md +2 -2
- package/docs/DEVIATIONS.md +677 -182
- package/docs/E2EE.md +1 -1
- package/docs/ERROR_HANDLING.md +165 -2
- package/docs/GETTING_STARTED.md +7 -4
- package/docs/INTERFACES.md +1 -1
- package/docs/PACKAGE_SURFACE.md +6 -5
- package/docs/PROTOCOL_POLICY.md +102 -22
- package/docs/RECIPES.md +3 -15
- package/docs/SECURITY.md +90 -5
- package/keys/README.md +3 -3
- package/local/store/README.md +78 -14
- package/local/store/key-value/README.md +14 -3
- package/local/store/node/README.md +8 -3
- package/local/store/web/README.md +9 -0
- package/local/store/web-sqlite/README.md +14 -2
- package/local/vault/README.md +21 -0
- package/package.json +1 -6
- package/remote/README.md +0 -1
- package/remote/relay/README.md +2 -2
- package/dist/device/provisioning.d.ts +0 -242
- package/dist/device/provisioning.d.ts.map +0 -1
- package/dist/device/provisioning.js +0 -421
- package/dist/device/provisioning.js.map +0 -1
- package/dist/internal/protocol/x3dh/index.d.ts +0 -15
- package/dist/internal/protocol/x3dh/index.d.ts.map +0 -1
- package/dist/internal/protocol/x3dh/index.js +0 -13
- package/dist/internal/protocol/x3dh/index.js.map +0 -1
- package/dist/internal/protocol/x3dh/x3dh.d.ts +0 -131
- package/dist/internal/protocol/x3dh/x3dh.d.ts.map +0 -1
- package/dist/internal/protocol/x3dh/x3dh.js +0 -261
- package/dist/internal/protocol/x3dh/x3dh.js.map +0 -1
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage protection and the content recovery gate.
|
|
3
|
+
*
|
|
4
|
+
* A sender keeps the plaintext of a resendable message to answer a retry
|
|
5
|
+
* request: the pairwise MessageRecord and the group send log. This module
|
|
6
|
+
* reads the protection that a local store declares, derives its level, and
|
|
7
|
+
* decides whether the content recovery policy lets the client keep that
|
|
8
|
+
* plaintext. A declaration states how the store protects its data. It adds
|
|
9
|
+
* no encryption.
|
|
10
|
+
*/
|
|
11
|
+
import { MAX_RESENDABLE_CONTENT_RETENTION_MS, RECEIVE_QUEUE_DEFAULT_BLOCKED_GROUP_SHARE, RECEIVE_QUEUE_DEFAULT_MAX_BYTES, RECEIVE_QUEUE_DEFAULT_MAX_ITEMS, RESENDABLE_CONTENT_RETENTION_MS, } from './constants.js';
|
|
12
|
+
import { RECEIVE_HOOK_TIMEOUT_MS } from './receive-hook-bound.js';
|
|
13
|
+
const AT_REST_VALUES = ['file-cipher', 'record-cipher', 'none'];
|
|
14
|
+
const KEY_CUSTODY_VALUES = [
|
|
15
|
+
'os-keychain',
|
|
16
|
+
'app-vault',
|
|
17
|
+
'same-origin',
|
|
18
|
+
'none',
|
|
19
|
+
];
|
|
20
|
+
const MODES = ['require-protected', 'allow-co-located-key', 'off'];
|
|
21
|
+
/**
|
|
22
|
+
* Read the protection that a local store declares.
|
|
23
|
+
*
|
|
24
|
+
* @throws Error when the store declares no protection, an unknown value, or
|
|
25
|
+
* a cipher without a key or a key without a cipher.
|
|
26
|
+
*/
|
|
27
|
+
export function readLocalStoreProtection(storage) {
|
|
28
|
+
const protection = storage.protection;
|
|
29
|
+
if (typeof protection !== 'object' || protection === null) {
|
|
30
|
+
throw new Error('The local store declares no protection. A custom store must set `protection` ' +
|
|
31
|
+
'to { atRest, keyCustody }. See Content Recovery in docs/PROTOCOL_POLICY.md.');
|
|
32
|
+
}
|
|
33
|
+
const { atRest, keyCustody } = protection;
|
|
34
|
+
if (!AT_REST_VALUES.includes(atRest)) {
|
|
35
|
+
throw new Error(`The local store declares an unknown protection.atRest value. Use one of: ${AT_REST_VALUES.join(', ')}.`);
|
|
36
|
+
}
|
|
37
|
+
if (!KEY_CUSTODY_VALUES.includes(keyCustody)) {
|
|
38
|
+
throw new Error(`The local store declares an unknown protection.keyCustody value. Use one of: ${KEY_CUSTODY_VALUES.join(', ')}.`);
|
|
39
|
+
}
|
|
40
|
+
if ((atRest === 'none') !== (keyCustody === 'none')) {
|
|
41
|
+
throw new Error('The local store declares a cipher without a key, or a key without a cipher. ' +
|
|
42
|
+
'Set protection.atRest and protection.keyCustody both to none, or neither.');
|
|
43
|
+
}
|
|
44
|
+
return Object.freeze({
|
|
45
|
+
atRest: atRest,
|
|
46
|
+
keyCustody: keyCustody,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/** Derive the protection level of a validated declaration. */
|
|
50
|
+
export function storageProtectionLevel(protection) {
|
|
51
|
+
if (protection.atRest === 'none' || protection.keyCustody === 'none')
|
|
52
|
+
return 'none';
|
|
53
|
+
if (protection.keyCustody === 'same-origin')
|
|
54
|
+
return 'co-located';
|
|
55
|
+
return 'protected';
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Validate the content recovery policy and apply its defaults.
|
|
59
|
+
*
|
|
60
|
+
* @throws Error on an unknown mode, a retention that is not a positive
|
|
61
|
+
* integer or exceeds 30 days, or a membership hook that is not a function.
|
|
62
|
+
*/
|
|
63
|
+
export function resolveContentRecoveryPolicy(policy) {
|
|
64
|
+
const mode = policy?.mode ?? 'require-protected';
|
|
65
|
+
if (!MODES.includes(mode)) {
|
|
66
|
+
throw new Error(`Unsupported protocol.contentRecovery.mode: ${String(mode)}. Use one of: ${MODES.join(', ')}.`);
|
|
67
|
+
}
|
|
68
|
+
const retentionMs = policy?.retentionMs ?? RESENDABLE_CONTENT_RETENTION_MS;
|
|
69
|
+
if (!Number.isSafeInteger(retentionMs) ||
|
|
70
|
+
retentionMs <= 0 ||
|
|
71
|
+
retentionMs > MAX_RESENDABLE_CONTENT_RETENTION_MS) {
|
|
72
|
+
throw new Error('protocol.contentRecovery.retentionMs must be a positive integer of at most ' +
|
|
73
|
+
`${MAX_RESENDABLE_CONTENT_RETENTION_MS} ms (30 days).`);
|
|
74
|
+
}
|
|
75
|
+
const isCurrentMember = policy?.isCurrentMember;
|
|
76
|
+
if (isCurrentMember !== undefined && typeof isCurrentMember !== 'function') {
|
|
77
|
+
throw new Error('protocol.contentRecovery.isCurrentMember must be a function.');
|
|
78
|
+
}
|
|
79
|
+
return Object.freeze({ mode, retentionMs, isCurrentMember });
|
|
80
|
+
}
|
|
81
|
+
/** The longest delay that one timer can hold. */
|
|
82
|
+
const MAX_TIMER_DELAY_MS = 2 ** 31 - 1;
|
|
83
|
+
/**
|
|
84
|
+
* Validate the receive queue policy and apply its defaults. It reads no
|
|
85
|
+
* content recovery setting and no retry deadline. The receive age is fixed
|
|
86
|
+
* at `MAX_RECEIVE_WORK_AGE_MS`, so the policy carries no age.
|
|
87
|
+
*
|
|
88
|
+
* @throws Error on a `maxAgeMs` field, a bound that is not a positive
|
|
89
|
+
* integer, a share that is not above 0 and at most 1, or a hook timeout
|
|
90
|
+
* that is not a positive integer that one timer can hold.
|
|
91
|
+
*/
|
|
92
|
+
export function resolveReceiveQueuePolicy(policy) {
|
|
93
|
+
// The type has no `maxAgeMs`, but a JavaScript caller or a cast can pass one.
|
|
94
|
+
if (policy?.maxAgeMs !== undefined) {
|
|
95
|
+
throw new Error('protocol.receiveQueue.maxAgeMs is not supported in SDK 12.0.0 and later. ' +
|
|
96
|
+
'Receive retention is fixed at 30 days. Remove the field.');
|
|
97
|
+
}
|
|
98
|
+
const maxItems = policy?.maxItems ?? RECEIVE_QUEUE_DEFAULT_MAX_ITEMS;
|
|
99
|
+
if (!Number.isSafeInteger(maxItems) || maxItems <= 0) {
|
|
100
|
+
throw new Error('protocol.receiveQueue.maxItems must be a positive integer.');
|
|
101
|
+
}
|
|
102
|
+
const maxBytes = policy?.maxBytes ?? RECEIVE_QUEUE_DEFAULT_MAX_BYTES;
|
|
103
|
+
if (!Number.isSafeInteger(maxBytes) || maxBytes <= 0) {
|
|
104
|
+
throw new Error('protocol.receiveQueue.maxBytes must be a positive integer.');
|
|
105
|
+
}
|
|
106
|
+
const blockedGroupShare = policy?.blockedGroupShare ?? RECEIVE_QUEUE_DEFAULT_BLOCKED_GROUP_SHARE;
|
|
107
|
+
if (!Number.isFinite(blockedGroupShare) || blockedGroupShare <= 0 || blockedGroupShare > 1) {
|
|
108
|
+
throw new Error('protocol.receiveQueue.blockedGroupShare must be above 0 and at most 1.');
|
|
109
|
+
}
|
|
110
|
+
const receiveHookTimeoutMs = policy?.receiveHookTimeoutMs ?? RECEIVE_HOOK_TIMEOUT_MS;
|
|
111
|
+
if (!Number.isSafeInteger(receiveHookTimeoutMs) ||
|
|
112
|
+
receiveHookTimeoutMs <= 0 ||
|
|
113
|
+
receiveHookTimeoutMs > MAX_TIMER_DELAY_MS) {
|
|
114
|
+
throw new Error('protocol.receiveQueue.receiveHookTimeoutMs must be a positive integer of at most ' +
|
|
115
|
+
`${MAX_TIMER_DELAY_MS} ms.`);
|
|
116
|
+
}
|
|
117
|
+
return Object.freeze({ maxItems, maxBytes, blockedGroupShare, receiveHookTimeoutMs });
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Decide whether the client may keep resendable content.
|
|
121
|
+
*
|
|
122
|
+
* - `protected` stores keep it unless the mode is `off`.
|
|
123
|
+
* - `co-located` stores keep it only under `allow-co-located-key`.
|
|
124
|
+
* - Stores with no cipher or no key never keep it.
|
|
125
|
+
*
|
|
126
|
+
* The status also names the group membership source. A missing source
|
|
127
|
+
* does not change the decision: a direct message resend needs none, and a
|
|
128
|
+
* group resend with no source is refused when it is due.
|
|
129
|
+
*/
|
|
130
|
+
export function decideContentRecovery(protection, policy, groupMembershipSource) {
|
|
131
|
+
const level = storageProtectionLevel(protection);
|
|
132
|
+
const { mode } = policy;
|
|
133
|
+
const base = {
|
|
134
|
+
level,
|
|
135
|
+
mode,
|
|
136
|
+
atRest: protection.atRest,
|
|
137
|
+
keyCustody: protection.keyCustody,
|
|
138
|
+
groupMembershipSource,
|
|
139
|
+
};
|
|
140
|
+
if (mode === 'off')
|
|
141
|
+
return Object.freeze({ ...base, enabled: false, reason: 'policy-off' });
|
|
142
|
+
if (level === 'none') {
|
|
143
|
+
return Object.freeze({ ...base, enabled: false, reason: 'unprotected-store' });
|
|
144
|
+
}
|
|
145
|
+
if (level === 'co-located' && mode !== 'allow-co-located-key') {
|
|
146
|
+
return Object.freeze({ ...base, enabled: false, reason: 'co-located-key-not-allowed' });
|
|
147
|
+
}
|
|
148
|
+
return Object.freeze({ ...base, enabled: true });
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=storage-protection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-protection.js","sourceRoot":"","sources":["../../client/storage-protection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAeH,OAAO,EACL,mCAAmC,EACnC,yCAAyC,EACzC,+BAA+B,EAC/B,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,cAAc,GAAgC,CAAC,aAAa,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;AAC7F,MAAM,kBAAkB,GAAoC;IAC1D,aAAa;IACb,WAAW;IACX,aAAa;IACb,MAAM;CACP,CAAC;AACF,MAAM,KAAK,GAAmC,CAAC,mBAAmB,EAAE,sBAAsB,EAAE,KAAK,CAAC,CAAC;AASnG;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAgB;IACvD,MAAM,UAAU,GAAI,OAAoC,CAAC,UAAU,CAAC;IACpE,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CACb,+EAA+E;YAC7E,6EAA6E,CAChF,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,UAAwD,CAA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,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC,CAAC;IACjF,CAAC;IACD,IAAI,KAAK,KAAK,YAAY,IAAI,IAAI,KAAK,sBAAsB,EAAE,CAAC;QAC9D,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,4BAA4B,EAAE,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AACnD,CAAC"}
|
package/dist/client/types.d.ts
CHANGED
|
@@ -122,13 +122,24 @@ export interface SendOptions {
|
|
|
122
122
|
* supplies a timestamp, that timestamp must match the original send. The SDK
|
|
123
123
|
* persists the exact encrypted transmission before it contacts the Relay, so
|
|
124
124
|
* an unknown result never advances the protocol ratchet twice.
|
|
125
|
+
*
|
|
126
|
+
* On a relay that does not compare device sets, a first send that fails on
|
|
127
|
+
* the read of the own device list throws before the SDK stores it. The
|
|
128
|
+
* error carries this identifier, but the outbox holds no transmission for
|
|
129
|
+
* it. The application calls `send()` again, and the SDK encrypts the
|
|
130
|
+
* content again.
|
|
125
131
|
*/
|
|
126
132
|
clientMessageId?: string;
|
|
127
133
|
/**
|
|
128
134
|
* Content hint for recipient retry behavior.
|
|
129
135
|
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
136
|
+
* A group send of a `DataMessage` defaults to `Resendable` when
|
|
137
|
+
* `protocol.contentRecovery` keeps content, and the client logs its
|
|
138
|
+
* content for a retry request before it sends. When the policy keeps no
|
|
139
|
+
* content, the send goes out as `Default`. A group send of a string or
|
|
140
|
+
* bytes keeps no content, so a `Resendable` hint on it goes out as
|
|
141
|
+
* `Default`. Use `Implicit` for protocol and no-op payloads, such as
|
|
142
|
+
* NullMessage resend responses, that the recipient discards on failure.
|
|
132
143
|
*/
|
|
133
144
|
contentHint?: ContentHint;
|
|
134
145
|
/**
|
|
@@ -200,6 +211,20 @@ export interface SendResult {
|
|
|
200
211
|
* post did not report it.
|
|
201
212
|
*/
|
|
202
213
|
expiresAt?: number;
|
|
214
|
+
/**
|
|
215
|
+
* For a group send over a group token, the number of destination devices
|
|
216
|
+
* that the relay refused when it accepted the shared post. A refusal after
|
|
217
|
+
* that acceptance is not counted. Absent for any other send, and when the
|
|
218
|
+
* relay does not report it.
|
|
219
|
+
*/
|
|
220
|
+
refusedDestinationCount?: number;
|
|
221
|
+
/**
|
|
222
|
+
* True when the relay accepted the send for every recipient device but the
|
|
223
|
+
* copies for this account's other devices are not posted yet. The send is
|
|
224
|
+
* delivered. Call `send()` again with the same `clientMessageId` to post
|
|
225
|
+
* the pending copies. Absent when the copies were posted or none were due.
|
|
226
|
+
*/
|
|
227
|
+
syncPending?: true;
|
|
203
228
|
/** Group ID if sent to a group */
|
|
204
229
|
groupId?: string;
|
|
205
230
|
/** Opaque remote object identifier for the encrypted attachment */
|
|
@@ -214,10 +239,16 @@ export interface SendResult {
|
|
|
214
239
|
contentType?: string;
|
|
215
240
|
}
|
|
216
241
|
/**
|
|
217
|
-
* A send failure
|
|
242
|
+
* A send failure that carries the logical-send identifier.
|
|
218
243
|
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
244
|
+
* `isOutgoingMessageError` is true for every send error, also for an error
|
|
245
|
+
* before the SDK stores the send, such as a failed content serialization or
|
|
246
|
+
* a failed read of the own device list on a relay that does not compare
|
|
247
|
+
* device sets. The exact encrypted transmission stays in the outbox only for a send
|
|
248
|
+
* that the SDK already stored. In both cases, the application calls `send()`
|
|
249
|
+
* again with the same `clientMessageId`. For a stored send, the durable
|
|
250
|
+
* outbox supplies the original timestamp. For a send that the SDK did not
|
|
251
|
+
* store, the SDK encrypts the content again.
|
|
221
252
|
*
|
|
222
253
|
* A direct send attempts every device of the recipient, also when a device
|
|
223
254
|
* before it fails, and the error is that of the first failed device. A
|
|
@@ -228,7 +259,7 @@ export interface SendResult {
|
|
|
228
259
|
export interface OutgoingMessageError extends Error {
|
|
229
260
|
readonly clientMessageId: string;
|
|
230
261
|
}
|
|
231
|
-
/** Return true when a send error exposes its
|
|
262
|
+
/** Return true when a send error exposes its logical-send identifier. */
|
|
232
263
|
export declare function isOutgoingMessageError(error: unknown): error is OutgoingMessageError;
|
|
233
264
|
/**
|
|
234
265
|
* Safety number for verifying identity with another user
|
|
@@ -257,9 +288,13 @@ export interface SafetyNumber {
|
|
|
257
288
|
*
|
|
258
289
|
* This uses strings instead of mutable Uint8Array instances, so application code
|
|
259
290
|
* cannot accidentally change the value between display and confirmation.
|
|
291
|
+
*
|
|
292
|
+
* Version 2 carries the fingerprint in the byte order of the two display
|
|
293
|
+
* strings. A version 1 confirmation from an older SDK is refused as an
|
|
294
|
+
* unsupported version. Call `verify()` again to get a new one.
|
|
260
295
|
*/
|
|
261
296
|
export interface SafetyNumberConfirmation {
|
|
262
|
-
readonly version:
|
|
297
|
+
readonly version: 2;
|
|
263
298
|
readonly userId: string;
|
|
264
299
|
readonly identityType: import('../keys/index.js').IdentityType;
|
|
265
300
|
/** Canonical Base64 of the complete displayed composite fingerprint. */
|
|
@@ -440,13 +475,23 @@ export interface IncomingEnvelope {
|
|
|
440
475
|
*/
|
|
441
476
|
messageType?: string;
|
|
442
477
|
/**
|
|
443
|
-
*
|
|
478
|
+
* The content hint of the sender. It sets what the receiver does when a
|
|
479
|
+
* decrypt fails with an error that a resend can repair.
|
|
444
480
|
*
|
|
445
|
-
* -
|
|
446
|
-
*
|
|
447
|
-
* -
|
|
481
|
+
* - `Default`: the client sends a retry request and runs
|
|
482
|
+
* `onDeliveryError` at once.
|
|
483
|
+
* - `Resendable`: the client sends a retry request. It runs
|
|
484
|
+
* `onDeliveryError` one hour after the receive
|
|
485
|
+
* (`RETRY_PLACEHOLDER_DEADLINE_MS`) if the content has not arrived. It
|
|
486
|
+
* runs it at once when a rate limit refuses the request, when the
|
|
487
|
+
* request allowance for the sender is used up, or when the request
|
|
488
|
+
* ends.
|
|
489
|
+
* - `Implicit`: disposable content, such as typing indicators and
|
|
490
|
+
* receipts. The client sends no retry request and never runs
|
|
491
|
+
* `onDeliveryError`. A resend that answers a retry request of this
|
|
492
|
+
* device still asks again.
|
|
448
493
|
*
|
|
449
|
-
*
|
|
494
|
+
* With no hint, the client uses the `Default` behavior.
|
|
450
495
|
*/
|
|
451
496
|
contentHint?: ContentHint;
|
|
452
497
|
}
|
|
@@ -463,13 +508,17 @@ export interface ProcessEnvelopeOptions {
|
|
|
463
508
|
* Required for background processing where there is no WebSocket relay.
|
|
464
509
|
* The callback receives a `retry_request` envelope for the device that sent
|
|
465
510
|
* the failed message. Deliver it to that device as any other envelope.
|
|
511
|
+
* The envelope is identified, and without a relay the client cannot seal
|
|
512
|
+
* it. The client calls the callback only when the sealed sender delivery
|
|
513
|
+
* mode permits identified delivery, so `'required'` never calls it.
|
|
466
514
|
*/
|
|
467
515
|
sendRetryRequest?: (envelope: import('../remote/relay/types.js').Envelope) => Promise<void>;
|
|
468
516
|
/**
|
|
469
|
-
* Callback
|
|
517
|
+
* Callback that acknowledges an envelope when no relay is available.
|
|
470
518
|
*
|
|
471
|
-
*
|
|
472
|
-
*
|
|
519
|
+
* The client calls it after it sends a retry request for a failed
|
|
520
|
+
* envelope, and after it discards an envelope that it does not process
|
|
521
|
+
* again, so the envelope is not fetched again.
|
|
473
522
|
*/
|
|
474
523
|
markDelivered?: (messageId: string) => Promise<void>;
|
|
475
524
|
/**
|
|
@@ -483,5 +532,90 @@ export interface ProcessEnvelopeOptions {
|
|
|
483
532
|
*
|
|
484
533
|
*/
|
|
485
534
|
forcePreKeyRotation?: () => Promise<void>;
|
|
535
|
+
/**
|
|
536
|
+
* Save content that `processIncomingEnvelope` gives. The client calls it
|
|
537
|
+
* with the `processed` outcome before the method returns. When it
|
|
538
|
+
* resolves, the client completes the receive record, so you do not call
|
|
539
|
+
* `completeReceive`. When it rejects, the method still returns the
|
|
540
|
+
* `processed` outcome, and the record waits for `completeReceive` or for
|
|
541
|
+
* its expiry. A redelivery of the envelope calls it again.
|
|
542
|
+
*/
|
|
543
|
+
onPersist?: (outcome: ProcessedReceive) => Promise<void>;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Content that `processIncomingEnvelope` gives. The client keeps it until
|
|
547
|
+
* the application calls `completeReceive` with its `messageId`, or until
|
|
548
|
+
* it expires after 30 days on this device. A redelivery of the
|
|
549
|
+
* envelope gives it again with the same `messageId`.
|
|
550
|
+
*/
|
|
551
|
+
export interface ProcessedReceive {
|
|
552
|
+
kind: 'processed';
|
|
553
|
+
/** The content, as its sender gave it. */
|
|
554
|
+
plaintext: string;
|
|
555
|
+
/** The ID that `completeReceive` takes. */
|
|
556
|
+
messageId: string;
|
|
557
|
+
/** The group of group content. */
|
|
558
|
+
groupId?: string;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* The outcome of `processIncomingEnvelope`.
|
|
562
|
+
*
|
|
563
|
+
* - `processed`: the client gives the content. Save it, then call
|
|
564
|
+
* `completeReceive`, or pass `onPersist`. Acknowledge the envelope.
|
|
565
|
+
* - `pending`: the client stored the content, and it waits for its group
|
|
566
|
+
* state. The client resumes it and `listPendingReceives({ ready: true })`
|
|
567
|
+
* lists it when it is ready. Acknowledge the envelope.
|
|
568
|
+
* - `duplicate`: the client processed the envelope before, or the
|
|
569
|
+
* application already has its content. Acknowledge the envelope.
|
|
570
|
+
* - `null-message`: the envelope carries no content. Acknowledge it.
|
|
571
|
+
* - `denied`: the client refused the content and ran `onDecryptionError`,
|
|
572
|
+
* except for a group that the user blocked (reason `blocked`), which has
|
|
573
|
+
* no report. Acknowledge the envelope.
|
|
574
|
+
* - `refused`: the receive queue has no room, so the client decrypted
|
|
575
|
+
* nothing. Do not acknowledge the envelope. Give it again later.
|
|
576
|
+
*/
|
|
577
|
+
export type ReceiveOutcome = ProcessedReceive | {
|
|
578
|
+
kind: 'pending';
|
|
579
|
+
messageId: string;
|
|
580
|
+
reason: string;
|
|
581
|
+
} | {
|
|
582
|
+
kind: 'duplicate';
|
|
583
|
+
} | {
|
|
584
|
+
kind: 'null-message';
|
|
585
|
+
} | {
|
|
586
|
+
kind: 'denied';
|
|
587
|
+
reason: string;
|
|
588
|
+
} | {
|
|
589
|
+
kind: 'refused';
|
|
590
|
+
persisted: false;
|
|
591
|
+
reason: string;
|
|
592
|
+
};
|
|
593
|
+
/** One receive that `processIncomingEnvelope` stored and did not complete. */
|
|
594
|
+
export interface PendingReceive {
|
|
595
|
+
/**
|
|
596
|
+
* The ID that `completeReceive` and `discardPendingReceive` take. A
|
|
597
|
+
* receive stored before the client kept message IDs gives its record ID.
|
|
598
|
+
*/
|
|
599
|
+
messageId: string;
|
|
600
|
+
/**
|
|
601
|
+
* `awaiting-completion` when the content is ready and waits for
|
|
602
|
+
* `completeReceive`. `decrypted` when it waits for its group state.
|
|
603
|
+
*/
|
|
604
|
+
stage: 'decrypted' | 'awaiting-completion';
|
|
605
|
+
/** `caller` for an envelope that the application gave. */
|
|
606
|
+
origin: 'relay' | 'caller';
|
|
607
|
+
/** The time of the first decrypt. */
|
|
608
|
+
receivedAt: number;
|
|
609
|
+
senderId?: string;
|
|
610
|
+
senderDeviceId?: number;
|
|
611
|
+
groupId?: string;
|
|
612
|
+
/** The content of a ready receive, as its sender gave it. */
|
|
613
|
+
plaintext?: string;
|
|
614
|
+
/**
|
|
615
|
+
* The calls of `onMessageDecrypted` that started for this receive and
|
|
616
|
+
* did not complete it. At the cap of 10 attempts, the receive holds back
|
|
617
|
+
* no later receive, and each start offers it to the hook once.
|
|
618
|
+
*/
|
|
619
|
+
hookAttempts: number;
|
|
486
620
|
}
|
|
487
621
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../client/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO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IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,GACxB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D,8EAA8E;AAC9E,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,KAAK,EAAE,WAAW,GAAG,qBAAqB,CAAC;IAC3C,0DAA0D;IAC1D,MAAM,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC3B,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB"}
|
package/dist/client/types.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* These types are used to pass dependencies between the core DefaultSignalProtocolClient class
|
|
5
5
|
* and the extracted operation modules.
|
|
6
6
|
*/
|
|
7
|
-
/** Return true when a send error exposes its
|
|
7
|
+
/** Return true when a send error exposes its logical-send identifier. */
|
|
8
8
|
export function isOutgoingMessageError(error) {
|
|
9
9
|
return (error instanceof Error &&
|
|
10
10
|
'clientMessageId' in error &&
|
package/dist/client/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../client/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../client/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA6bH,yEAAyE;AACzE,MAAM,UAAU,sBAAsB,CAAC,KAAc;IACnD,OAAO,CACL,KAAK,YAAY,KAAK;QACtB,iBAAiB,IAAI,KAAK;QAC1B,OAAQ,KAAuC,CAAC,eAAe,KAAK,QAAQ,CAC7E,CAAC;AACJ,CAAC;AAkHD,+EAA+E;AAC/E,yBAAyB;AACzB,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAN,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,kDAAkD;IAClD,qDAAY,CAAA;IACZ,oCAAoC;IACpC,6CAAQ,CAAA;IACR,8DAA8D;IAC9D,iDAAU,CAAA;AACZ,CAAC,EAPW,WAAW,KAAX,WAAW,QAOtB;AA4BD,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,0BAA0B;IAC1B,qDAAW,CAAA;IACX,2EAA2E;IAC3E,qDAAW,CAAA;AACb,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB"}
|
|
@@ -61,9 +61,4 @@ export declare const DEFAULT_DEVICE_ID = 1;
|
|
|
61
61
|
* Maximum number of devices per user (1 primary + 4 linked)
|
|
62
62
|
*/
|
|
63
63
|
export declare const MAX_DEVICES = 5;
|
|
64
|
-
/**
|
|
65
|
-
* Provisioning session QR code expires after 5 minutes.
|
|
66
|
-
* The short TTL blocks reuse of a QR code after the linking window.
|
|
67
|
-
*/
|
|
68
|
-
export declare const PROVISIONING_SESSION_TTL_MS: number;
|
|
69
64
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../device/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;GAGG;AACH,OAAO,EAAE,CAAC;AACV,eAAO,MAAM,aAAa,qBAAqB,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,eAAe,uBAAuB,CAAC;AAEpD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,+BAA+B,CAAC;AAE/D;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,8BAA8B,CAAC;AAEzE;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,kBAAkB,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,WAAW,IAAI,CAAC
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../device/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;GAGG;AACH,OAAO,EAAE,CAAC;AACV,eAAO,MAAM,aAAa,qBAAqB,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,eAAe,uBAAuB,CAAC;AAEpD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,+BAA+B,CAAC;AAE/D;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,8BAA8B,CAAC;AAEzE;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,kBAAkB,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,WAAW,IAAI,CAAC"}
|
package/dist/device/constants.js
CHANGED
|
@@ -56,9 +56,4 @@ export const DEFAULT_DEVICE_ID = 1;
|
|
|
56
56
|
* Maximum number of devices per user (1 primary + 4 linked)
|
|
57
57
|
*/
|
|
58
58
|
export const MAX_DEVICES = 5;
|
|
59
|
-
/**
|
|
60
|
-
* Provisioning session QR code expires after 5 minutes.
|
|
61
|
-
* The short TTL blocks reuse of a QR code after the linking window.
|
|
62
|
-
*/
|
|
63
|
-
export const PROVISIONING_SESSION_TTL_MS = 5 * 60 * 1000;
|
|
64
59
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../device/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH,MAAM,CAAC,MAAM,aAAa,GAAG,kBAAkB,CAAC;AAEhD;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,4BAA4B,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,2BAA2B,CAAC;AAEzE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../device/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH,MAAM,CAAC,MAAM,aAAa,GAAG,kBAAkB,CAAC;AAEhD;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,4BAA4B,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,2BAA2B,CAAC;AAEzE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC"}
|
|
@@ -1,32 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Local device metadata, read from Expo and React Native.
|
|
3
3
|
*
|
|
4
|
-
* The shared `./device` entry reads no platform API:
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* The shared `./device` entry reads no platform API: transfer and the device
|
|
5
|
+
* lifecycle take the device's description as a parameter. This entry reads it
|
|
6
|
+
* on Expo, through `expo-constants`, `expo-device`, and the React Native
|
|
7
|
+
* `Platform`. Bare React Native apps use `./device/react-native`.
|
|
8
8
|
* Callers on a platform this package cannot see build the metadata themselves.
|
|
9
9
|
*
|
|
10
10
|
* Expo exposes no device fingerprint without another package, so
|
|
11
11
|
* `getDeviceLifecyclePlatform()` omits `getDeviceFingerprint`. Supply one to
|
|
12
12
|
* enable reclaim detection.
|
|
13
13
|
*/
|
|
14
|
-
import type { LocalDeviceMetadata } from '../provisioning.js';
|
|
15
14
|
import type { TransferDeviceInfo } from '../types.js';
|
|
16
15
|
import type { DeviceLifecyclePlatform } from '../lifecycle/types.js';
|
|
17
16
|
export {};
|
|
18
|
-
/**
|
|
19
|
-
* Describe the device that runs this code, for device linking.
|
|
20
|
-
*
|
|
21
|
-
* The device name stays local until provisioning delivers the account
|
|
22
|
-
* identity key needed to encrypt it for server storage. That is why it is
|
|
23
|
-
* passed in rather than read from the platform. The name is the user's choice,
|
|
24
|
-
* not a property of the hardware.
|
|
25
|
-
*
|
|
26
|
-
* @param deviceName - Human-readable device name chosen on the new device
|
|
27
|
-
* @returns Local device metadata, ready to hand to `connectToProvisioningSession`
|
|
28
|
-
*/
|
|
29
|
-
export declare function getDeviceMetadata(deviceName: string): LocalDeviceMetadata;
|
|
30
17
|
/**
|
|
31
18
|
* Describe the device that runs this code, for a transfer QR code and a
|
|
32
19
|
* linked-device bundle.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../device/expo/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../device/expo/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,EAAE,CAAC;AAEV;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,CAO1D;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,IAAI,uBAAuB,CAepE"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Local device metadata, read from Expo and React Native.
|
|
3
3
|
*
|
|
4
|
-
* The shared `./device` entry reads no platform API:
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* The shared `./device` entry reads no platform API: transfer and the device
|
|
5
|
+
* lifecycle take the device's description as a parameter. This entry reads it
|
|
6
|
+
* on Expo, through `expo-constants`, `expo-device`, and the React Native
|
|
7
|
+
* `Platform`. Bare React Native apps use `./device/react-native`.
|
|
8
8
|
* Callers on a platform this package cannot see build the metadata themselves.
|
|
9
9
|
*
|
|
10
10
|
* Expo exposes no device fingerprint without another package, so
|
|
@@ -14,25 +14,6 @@
|
|
|
14
14
|
import { Platform } from 'react-native';
|
|
15
15
|
import Constants from 'expo-constants';
|
|
16
16
|
import * as Device from 'expo-device';
|
|
17
|
-
/**
|
|
18
|
-
* Describe the device that runs this code, for device linking.
|
|
19
|
-
*
|
|
20
|
-
* The device name stays local until provisioning delivers the account
|
|
21
|
-
* identity key needed to encrypt it for server storage. That is why it is
|
|
22
|
-
* passed in rather than read from the platform. The name is the user's choice,
|
|
23
|
-
* not a property of the hardware.
|
|
24
|
-
*
|
|
25
|
-
* @param deviceName - Human-readable device name chosen on the new device
|
|
26
|
-
* @returns Local device metadata, ready to hand to `connectToProvisioningSession`
|
|
27
|
-
*/
|
|
28
|
-
export function getDeviceMetadata(deviceName) {
|
|
29
|
-
return {
|
|
30
|
-
deviceName,
|
|
31
|
-
platform: Platform.OS,
|
|
32
|
-
appVersion: Constants.expoConfig?.version ?? 'unknown',
|
|
33
|
-
osVersion: Platform.Version.toString(),
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
17
|
/**
|
|
37
18
|
* Describe the device that runs this code, for a transfer QR code and a
|
|
38
19
|
* linked-device bundle.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../device/expo/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../device/expo/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAMtC;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC;IACjD,OAAO;QACL,GAAG,CAAC,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxF,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE;QACtC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtC,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B;IACxC,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC;IACjD,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IACnC,OAAO;QACL,kBAAkB;QAClB,UAAU,EACR,MAAM,CAAC,UAAU,KAAK,MAAM,CAAC,UAAU,CAAC,MAAM;YAC5C,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,MAAM,CAAC,UAAU,KAAK,MAAM,CAAC,UAAU,CAAC,OAAO;gBAC/C,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,QAAQ;QAChB,QAAQ,EAAE,QAAQ,CAAC,EAAE;QACrB,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtC,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB;IACzB,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,gBAAgB,CAAC;IACvD,QAAQ,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1B,KAAK,MAAM,CAAC,UAAU,CAAC,KAAK;YAC1B,OAAO,SAAS,CAAC;QACnB,KAAK,MAAM,CAAC,UAAU,CAAC,MAAM;YAC3B,OAAO,GAAG,SAAS,WAAW,CAAC;QACjC,KAAK,MAAM,CAAC,UAAU,CAAC,OAAO;YAC5B,OAAO,GAAG,SAAS,YAAY,CAAC;QAClC;YACE,OAAO,GAAG,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,SAAS,CAAC;IACpE,CAAC;AACH,CAAC"}
|
package/dist/device/index.d.ts
CHANGED
|
@@ -21,9 +21,7 @@ export type { BackupStorage, RestoreDeviceBackupResult } from './transfer.js';
|
|
|
21
21
|
export { RelayConnection, createRelayConnection, generateConnectionId, } from './connection.js';
|
|
22
22
|
export type { TransferKeyPair, TransferQRCode, DeviceBackup, EncryptedBackup, TransferPacket, TransferSession, TransferStatus, BackupIdentityKeyPair, TransferDeviceInfo, LocalConnection, ConnectionConfig, ConnectionRole, ConnectionStatus, ProgressCallback, DetailedProgressCallback, RetryConfig, RelayConfig, } from './types.js';
|
|
23
23
|
export { DEFAULT_RETRY_CONFIG, QR_CODE_MAX_AGE, TRANSFER_PROTOCOL_VERSION, BACKUP_FORMAT_VERSION, } from './types.js';
|
|
24
|
-
export { generateProvisioningQR, provisionDevice, parseProvisioningQR, connectToProvisioningSession, receiveProvisioningMessage, cancelProvisioning, } from './provisioning.js';
|
|
25
24
|
export { encryptDeviceName, decryptDeviceName } from './device-name-crypto.js';
|
|
26
|
-
export type { ProvisioningKeyPair, ProvisioningQRData, ProvisioningMessage, LocalDeviceMetadata, ProvisioningIdentityStore, ProvisioningLocalStateStore, ProvisioningSendOptions, ProvisioningReceiveOptions, ProvisioningUsernameStateStore, } from './provisioning.js';
|
|
27
25
|
export { getDeviceId, getDeviceIdSync, clearDeviceIdCache, preloadDeviceId } from './device-id.js';
|
|
28
26
|
export { DEVICE_ID_KEY, DEVICE_NAME_KEY, DEVICE_REGISTERED_USER_ID_KEY, DEVICE_OWNER_SENTINEL, DEFAULT_DEVICE_ID, MAX_DEVICES, } from './constants.js';
|
|
29
27
|
export { DeviceLifecycleManager } from './lifecycle/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../device/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,CAAC;AACV,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EAEjB,kBAAkB,EAClB,mBAAmB,EACnB,kCAAkC,GACnC,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAG3E,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAGtB,YAAY,EAEV,eAAe,EACf,cAAc,EACd,YAAY,EACZ,eAAe,EACf,cAAc,EACd,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAElB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,EACxB,WAAW,EACX,WAAW,GACZ,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../device/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,CAAC;AACV,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EAEjB,kBAAkB,EAClB,mBAAmB,EACnB,kCAAkC,GACnC,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAG3E,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAGtB,YAAY,EAEV,eAAe,EACf,cAAc,EACd,YAAY,EACZ,eAAe,EACf,cAAc,EACd,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAElB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,EACxB,WAAW,EACX,WAAW,GACZ,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG5E,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGhG,OAAO,EACL,aAAa,EACb,eAAe,EACf,6BAA6B,EAC7B,qBAAqB,EACrB,iBAAiB,EACjB,WAAW,GACZ,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,YAAY,EAEV,uBAAuB,EACvB,2BAA2B,EAC3B,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EAEnB,UAAU,EACV,cAAc,EAEd,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAElB,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EAEV,qBAAqB,EACrB,wBAAwB,EAExB,YAAY,EACZ,uBAAuB,EACvB,4BAA4B,EAC5B,YAAY,GACb,MAAM,aAAa,CAAC"}
|
package/dist/device/index.js
CHANGED
|
@@ -22,13 +22,6 @@ createDeviceBackup, restoreDeviceBackup, prepareOldDeviceTransferWithBackup, } f
|
|
|
22
22
|
export { RelayConnection, createRelayConnection, generateConnectionId, } from './connection.js';
|
|
23
23
|
// Constants
|
|
24
24
|
export { DEFAULT_RETRY_CONFIG, QR_CODE_MAX_AGE, TRANSFER_PROTOCOL_VERSION, BACKUP_FORMAT_VERSION, } from './types.js';
|
|
25
|
-
// Provisioning functions (device linking via QR code)
|
|
26
|
-
//
|
|
27
|
-
// `getDeviceMetadata` is deliberately absent: it reads the platform, and lives
|
|
28
|
-
// on `./device/expo` and `./device/react-native` so that the provisioning
|
|
29
|
-
// protocol stays importable everywhere. Callers elsewhere build
|
|
30
|
-
// `LocalDeviceMetadata` themselves.
|
|
31
|
-
export { generateProvisioningQR, provisionDevice, parseProvisioningQR, connectToProvisioningSession, receiveProvisioningMessage, cancelProvisioning, } from './provisioning.js';
|
|
32
25
|
// Device name encryption/decryption
|
|
33
26
|
export { encryptDeviceName, decryptDeviceName } from './device-name-crypto.js';
|
|
34
27
|
// Device ID utilities (for non-React contexts)
|
package/dist/device/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../device/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB;AACjB,gCAAgC;AAChC,kBAAkB,EAClB,mBAAmB,EACnB,kCAAkC,GACnC,MAAM,YAAY,CAAC;AAKpB,uBAAuB;AACvB,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAyBtB,YAAY;AACZ,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AAEjB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../device/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB;AACjB,gCAAgC;AAChC,kBAAkB,EAClB,mBAAmB,EACnB,kCAAkC,GACnC,MAAM,YAAY,CAAC;AAKpB,uBAAuB;AACvB,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAyBtB,YAAY;AACZ,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AAEjB,oCAAoC;AACpC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE5E,+CAA+C;AAC/C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEhG,4CAA4C;AAC5C,OAAO,EACL,aAAa,EACb,eAAe,EACf,6BAA6B,EAC7B,qBAAqB,EACrB,iBAAiB,EACjB,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,8EAA8E;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC"}
|