@unwanted/matrix-sdk-mini 34.12.0-1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +5910 -0
- package/LICENSE +177 -0
- package/README.md +459 -0
- package/git-revision.txt +1 -0
- package/lib/@types/AESEncryptedSecretStoragePayload.d.ts +14 -0
- package/lib/@types/AESEncryptedSecretStoragePayload.d.ts.map +1 -0
- package/lib/@types/AESEncryptedSecretStoragePayload.js +1 -0
- package/lib/@types/AESEncryptedSecretStoragePayload.js.map +1 -0
- package/lib/@types/IIdentityServerProvider.d.ts +9 -0
- package/lib/@types/IIdentityServerProvider.d.ts.map +1 -0
- package/lib/@types/IIdentityServerProvider.js +1 -0
- package/lib/@types/IIdentityServerProvider.js.map +1 -0
- package/lib/@types/PushRules.d.ts +140 -0
- package/lib/@types/PushRules.d.ts.map +1 -0
- package/lib/@types/PushRules.js +94 -0
- package/lib/@types/PushRules.js.map +1 -0
- package/lib/@types/another-json.d.js +0 -0
- package/lib/@types/another-json.d.js.map +1 -0
- package/lib/@types/auth.d.ts +208 -0
- package/lib/@types/auth.d.ts.map +1 -0
- package/lib/@types/auth.js +99 -0
- package/lib/@types/auth.js.map +1 -0
- package/lib/@types/beacon.d.ts +106 -0
- package/lib/@types/beacon.d.ts.map +1 -0
- package/lib/@types/beacon.js +119 -0
- package/lib/@types/beacon.js.map +1 -0
- package/lib/@types/common.d.ts +9 -0
- package/lib/@types/common.d.ts.map +1 -0
- package/lib/@types/common.js +1 -0
- package/lib/@types/common.js.map +1 -0
- package/lib/@types/crypto.d.ts +47 -0
- package/lib/@types/crypto.d.ts.map +1 -0
- package/lib/@types/crypto.js +1 -0
- package/lib/@types/crypto.js.map +1 -0
- package/lib/@types/event.d.ts +258 -0
- package/lib/@types/event.d.ts.map +1 -0
- package/lib/@types/event.js +239 -0
- package/lib/@types/event.js.map +1 -0
- package/lib/@types/events.d.ts +92 -0
- package/lib/@types/events.d.ts.map +1 -0
- package/lib/@types/events.js +1 -0
- package/lib/@types/events.js.map +1 -0
- package/lib/@types/extensible_events.d.ts +98 -0
- package/lib/@types/extensible_events.d.ts.map +1 -0
- package/lib/@types/extensible_events.js +116 -0
- package/lib/@types/extensible_events.js.map +1 -0
- package/lib/@types/global.d.js +20 -0
- package/lib/@types/global.d.js.map +1 -0
- package/lib/@types/local_notifications.d.ts +4 -0
- package/lib/@types/local_notifications.d.ts.map +1 -0
- package/lib/@types/local_notifications.js +1 -0
- package/lib/@types/local_notifications.js.map +1 -0
- package/lib/@types/location.d.ts +60 -0
- package/lib/@types/location.d.ts.map +1 -0
- package/lib/@types/location.js +67 -0
- package/lib/@types/location.js.map +1 -0
- package/lib/@types/matrix-sdk-crypto-wasm.d.js +1 -0
- package/lib/@types/matrix-sdk-crypto-wasm.d.js.map +1 -0
- package/lib/@types/media.d.ts +220 -0
- package/lib/@types/media.d.ts.map +1 -0
- package/lib/@types/media.js +1 -0
- package/lib/@types/media.js.map +1 -0
- package/lib/@types/membership.d.ts +41 -0
- package/lib/@types/membership.d.ts.map +1 -0
- package/lib/@types/membership.js +37 -0
- package/lib/@types/membership.js.map +1 -0
- package/lib/@types/oidc-client-ts.d.js +18 -0
- package/lib/@types/oidc-client-ts.d.js.map +1 -0
- package/lib/@types/partials.d.ts +39 -0
- package/lib/@types/partials.d.ts.map +1 -0
- package/lib/@types/partials.js +53 -0
- package/lib/@types/partials.js.map +1 -0
- package/lib/@types/polls.d.ts +88 -0
- package/lib/@types/polls.d.ts.map +1 -0
- package/lib/@types/polls.js +86 -0
- package/lib/@types/polls.js.map +1 -0
- package/lib/@types/read_receipts.d.ts +36 -0
- package/lib/@types/read_receipts.d.ts.map +1 -0
- package/lib/@types/read_receipts.js +27 -0
- package/lib/@types/read_receipts.js.map +1 -0
- package/lib/@types/registration.d.ts +85 -0
- package/lib/@types/registration.d.ts.map +1 -0
- package/lib/@types/registration.js +1 -0
- package/lib/@types/registration.js.map +1 -0
- package/lib/@types/requests.d.ts +241 -0
- package/lib/@types/requests.d.ts.map +1 -0
- package/lib/@types/requests.js +28 -0
- package/lib/@types/requests.js.map +1 -0
- package/lib/@types/search.d.ts +90 -0
- package/lib/@types/search.d.ts.map +1 -0
- package/lib/@types/search.js +30 -0
- package/lib/@types/search.js.map +1 -0
- package/lib/@types/signed.d.ts +9 -0
- package/lib/@types/signed.d.ts.map +1 -0
- package/lib/@types/signed.js +1 -0
- package/lib/@types/signed.js.map +1 -0
- package/lib/@types/spaces.d.ts +16 -0
- package/lib/@types/spaces.d.ts.map +1 -0
- package/lib/@types/spaces.js +1 -0
- package/lib/@types/spaces.js.map +1 -0
- package/lib/@types/state_events.d.ts +116 -0
- package/lib/@types/state_events.d.ts.map +1 -0
- package/lib/@types/state_events.js +1 -0
- package/lib/@types/state_events.js.map +1 -0
- package/lib/@types/synapse.d.ts +19 -0
- package/lib/@types/synapse.d.ts.map +1 -0
- package/lib/@types/synapse.js +1 -0
- package/lib/@types/synapse.js.map +1 -0
- package/lib/@types/sync.d.ts +8 -0
- package/lib/@types/sync.d.ts.map +1 -0
- package/lib/@types/sync.js +25 -0
- package/lib/@types/sync.js.map +1 -0
- package/lib/@types/threepids.d.ts +12 -0
- package/lib/@types/threepids.d.ts.map +1 -0
- package/lib/@types/threepids.js +24 -0
- package/lib/@types/threepids.js.map +1 -0
- package/lib/@types/topic.d.ts +48 -0
- package/lib/@types/topic.d.ts.map +1 -0
- package/lib/@types/topic.js +57 -0
- package/lib/@types/topic.js.map +1 -0
- package/lib/@types/uia.d.ts +12 -0
- package/lib/@types/uia.d.ts.map +1 -0
- package/lib/@types/uia.js +1 -0
- package/lib/@types/uia.js.map +1 -0
- package/lib/NamespacedValue.d.ts +33 -0
- package/lib/NamespacedValue.d.ts.map +1 -0
- package/lib/NamespacedValue.js +113 -0
- package/lib/NamespacedValue.js.map +1 -0
- package/lib/ReEmitter.d.ts +15 -0
- package/lib/ReEmitter.d.ts.map +1 -0
- package/lib/ReEmitter.js +87 -0
- package/lib/ReEmitter.js.map +1 -0
- package/lib/ToDeviceMessageQueue.d.ts +28 -0
- package/lib/ToDeviceMessageQueue.d.ts.map +1 -0
- package/lib/ToDeviceMessageQueue.js +135 -0
- package/lib/ToDeviceMessageQueue.js.map +1 -0
- package/lib/autodiscovery.d.ts +136 -0
- package/lib/autodiscovery.d.ts.map +1 -0
- package/lib/autodiscovery.js +464 -0
- package/lib/autodiscovery.js.map +1 -0
- package/lib/base64.d.ts +28 -0
- package/lib/base64.d.ts.map +1 -0
- package/lib/base64.js +88 -0
- package/lib/base64.js.map +1 -0
- package/lib/browser-index.d.ts +8 -0
- package/lib/browser-index.d.ts.map +1 -0
- package/lib/browser-index.js +35 -0
- package/lib/browser-index.js.map +1 -0
- package/lib/client.d.ts +4232 -0
- package/lib/client.d.ts.map +1 -0
- package/lib/client.js +8622 -0
- package/lib/client.js.map +1 -0
- package/lib/common-crypto/CryptoBackend.d.ts +240 -0
- package/lib/common-crypto/CryptoBackend.d.ts.map +1 -0
- package/lib/common-crypto/CryptoBackend.js +73 -0
- package/lib/common-crypto/CryptoBackend.js.map +1 -0
- package/lib/common-crypto/key-passphrase.d.ts +14 -0
- package/lib/common-crypto/key-passphrase.d.ts.map +1 -0
- package/lib/common-crypto/key-passphrase.js +33 -0
- package/lib/common-crypto/key-passphrase.js.map +1 -0
- package/lib/content-helpers.d.ts +90 -0
- package/lib/content-helpers.d.ts.map +1 -0
- package/lib/content-helpers.js +250 -0
- package/lib/content-helpers.js.map +1 -0
- package/lib/content-repo.d.ts +24 -0
- package/lib/content-repo.d.ts.map +1 -0
- package/lib/content-repo.js +104 -0
- package/lib/content-repo.js.map +1 -0
- package/lib/crypto/CrossSigning.d.ts +184 -0
- package/lib/crypto/CrossSigning.d.ts.map +1 -0
- package/lib/crypto/CrossSigning.js +718 -0
- package/lib/crypto/CrossSigning.js.map +1 -0
- package/lib/crypto/DeviceList.d.ts +216 -0
- package/lib/crypto/DeviceList.d.ts.map +1 -0
- package/lib/crypto/DeviceList.js +892 -0
- package/lib/crypto/DeviceList.js.map +1 -0
- package/lib/crypto/EncryptionSetup.d.ts +152 -0
- package/lib/crypto/EncryptionSetup.d.ts.map +1 -0
- package/lib/crypto/EncryptionSetup.js +356 -0
- package/lib/crypto/EncryptionSetup.js.map +1 -0
- package/lib/crypto/OlmDevice.d.ts +457 -0
- package/lib/crypto/OlmDevice.d.ts.map +1 -0
- package/lib/crypto/OlmDevice.js +1241 -0
- package/lib/crypto/OlmDevice.js.map +1 -0
- package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts +109 -0
- package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts.map +1 -0
- package/lib/crypto/OutgoingRoomKeyRequestManager.js +415 -0
- package/lib/crypto/OutgoingRoomKeyRequestManager.js.map +1 -0
- package/lib/crypto/RoomList.d.ts +26 -0
- package/lib/crypto/RoomList.d.ts.map +1 -0
- package/lib/crypto/RoomList.js +71 -0
- package/lib/crypto/RoomList.js.map +1 -0
- package/lib/crypto/SecretSharing.d.ts +24 -0
- package/lib/crypto/SecretSharing.d.ts.map +1 -0
- package/lib/crypto/SecretSharing.js +194 -0
- package/lib/crypto/SecretSharing.js.map +1 -0
- package/lib/crypto/SecretStorage.d.ts +55 -0
- package/lib/crypto/SecretStorage.d.ts.map +1 -0
- package/lib/crypto/SecretStorage.js +118 -0
- package/lib/crypto/SecretStorage.js.map +1 -0
- package/lib/crypto/aes.d.ts +6 -0
- package/lib/crypto/aes.d.ts.map +1 -0
- package/lib/crypto/aes.js +24 -0
- package/lib/crypto/aes.js.map +1 -0
- package/lib/crypto/algorithms/base.d.ts +156 -0
- package/lib/crypto/algorithms/base.d.ts.map +1 -0
- package/lib/crypto/algorithms/base.js +187 -0
- package/lib/crypto/algorithms/base.js.map +1 -0
- package/lib/crypto/algorithms/index.d.ts +4 -0
- package/lib/crypto/algorithms/index.d.ts.map +1 -0
- package/lib/crypto/algorithms/index.js +20 -0
- package/lib/crypto/algorithms/index.js.map +1 -0
- package/lib/crypto/algorithms/megolm.d.ts +385 -0
- package/lib/crypto/algorithms/megolm.d.ts.map +1 -0
- package/lib/crypto/algorithms/megolm.js +1822 -0
- package/lib/crypto/algorithms/megolm.js.map +1 -0
- package/lib/crypto/algorithms/olm.d.ts +5 -0
- package/lib/crypto/algorithms/olm.d.ts.map +1 -0
- package/lib/crypto/algorithms/olm.js +299 -0
- package/lib/crypto/algorithms/olm.js.map +1 -0
- package/lib/crypto/api.d.ts +32 -0
- package/lib/crypto/api.d.ts.map +1 -0
- package/lib/crypto/api.js +22 -0
- package/lib/crypto/api.js.map +1 -0
- package/lib/crypto/backup.d.ts +227 -0
- package/lib/crypto/backup.d.ts.map +1 -0
- package/lib/crypto/backup.js +824 -0
- package/lib/crypto/backup.js.map +1 -0
- package/lib/crypto/crypto.d.ts +3 -0
- package/lib/crypto/crypto.d.ts.map +1 -0
- package/lib/crypto/crypto.js +19 -0
- package/lib/crypto/crypto.js.map +1 -0
- package/lib/crypto/dehydration.d.ts +34 -0
- package/lib/crypto/dehydration.d.ts.map +1 -0
- package/lib/crypto/dehydration.js +252 -0
- package/lib/crypto/dehydration.js.map +1 -0
- package/lib/crypto/device-converter.d.ts +9 -0
- package/lib/crypto/device-converter.d.ts.map +1 -0
- package/lib/crypto/device-converter.js +42 -0
- package/lib/crypto/device-converter.js.map +1 -0
- package/lib/crypto/deviceinfo.d.ts +99 -0
- package/lib/crypto/deviceinfo.d.ts.map +1 -0
- package/lib/crypto/deviceinfo.js +148 -0
- package/lib/crypto/deviceinfo.js.map +1 -0
- package/lib/crypto/index.d.ts +1209 -0
- package/lib/crypto/index.d.ts.map +1 -0
- package/lib/crypto/index.js +4097 -0
- package/lib/crypto/index.js.map +1 -0
- package/lib/crypto/key_passphrase.d.ts +14 -0
- package/lib/crypto/key_passphrase.d.ts.map +1 -0
- package/lib/crypto/key_passphrase.js +44 -0
- package/lib/crypto/key_passphrase.js.map +1 -0
- package/lib/crypto/keybackup.d.ts +18 -0
- package/lib/crypto/keybackup.d.ts.map +1 -0
- package/lib/crypto/keybackup.js +1 -0
- package/lib/crypto/keybackup.js.map +1 -0
- package/lib/crypto/olmlib.d.ts +129 -0
- package/lib/crypto/olmlib.d.ts.map +1 -0
- package/lib/crypto/olmlib.js +492 -0
- package/lib/crypto/olmlib.js.map +1 -0
- package/lib/crypto/recoverykey.d.ts +2 -0
- package/lib/crypto/recoverykey.d.ts.map +1 -0
- package/lib/crypto/recoverykey.js +19 -0
- package/lib/crypto/recoverykey.js.map +1 -0
- package/lib/crypto/store/base.d.ts +252 -0
- package/lib/crypto/store/base.d.ts.map +1 -0
- package/lib/crypto/store/base.js +64 -0
- package/lib/crypto/store/base.js.map +1 -0
- package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts +187 -0
- package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts.map +1 -0
- package/lib/crypto/store/indexeddb-crypto-store-backend.js +1145 -0
- package/lib/crypto/store/indexeddb-crypto-store-backend.js.map +1 -0
- package/lib/crypto/store/indexeddb-crypto-store.d.ts +432 -0
- package/lib/crypto/store/indexeddb-crypto-store.d.ts.map +1 -0
- package/lib/crypto/store/indexeddb-crypto-store.js +728 -0
- package/lib/crypto/store/indexeddb-crypto-store.js.map +1 -0
- package/lib/crypto/store/localStorage-crypto-store.d.ts +119 -0
- package/lib/crypto/store/localStorage-crypto-store.d.ts.map +1 -0
- package/lib/crypto/store/localStorage-crypto-store.js +531 -0
- package/lib/crypto/store/localStorage-crypto-store.js.map +1 -0
- package/lib/crypto/store/memory-crypto-store.d.ts +215 -0
- package/lib/crypto/store/memory-crypto-store.d.ts.map +1 -0
- package/lib/crypto/store/memory-crypto-store.js +622 -0
- package/lib/crypto/store/memory-crypto-store.js.map +1 -0
- package/lib/crypto/verification/Base.d.ts +105 -0
- package/lib/crypto/verification/Base.d.ts.map +1 -0
- package/lib/crypto/verification/Base.js +372 -0
- package/lib/crypto/verification/Base.js.map +1 -0
- package/lib/crypto/verification/Error.d.ts +35 -0
- package/lib/crypto/verification/Error.d.ts.map +1 -0
- package/lib/crypto/verification/Error.js +86 -0
- package/lib/crypto/verification/Error.js.map +1 -0
- package/lib/crypto/verification/IllegalMethod.d.ts +15 -0
- package/lib/crypto/verification/IllegalMethod.d.ts.map +1 -0
- package/lib/crypto/verification/IllegalMethod.js +43 -0
- package/lib/crypto/verification/IllegalMethod.js.map +1 -0
- package/lib/crypto/verification/QRCode.d.ts +51 -0
- package/lib/crypto/verification/QRCode.d.ts.map +1 -0
- package/lib/crypto/verification/QRCode.js +277 -0
- package/lib/crypto/verification/QRCode.js.map +1 -0
- package/lib/crypto/verification/SAS.d.ts +27 -0
- package/lib/crypto/verification/SAS.d.ts.map +1 -0
- package/lib/crypto/verification/SAS.js +485 -0
- package/lib/crypto/verification/SAS.js.map +1 -0
- package/lib/crypto/verification/SASDecimal.d.ts +8 -0
- package/lib/crypto/verification/SASDecimal.d.ts.map +1 -0
- package/lib/crypto/verification/SASDecimal.js +34 -0
- package/lib/crypto/verification/SASDecimal.js.map +1 -0
- package/lib/crypto/verification/request/Channel.d.ts +18 -0
- package/lib/crypto/verification/request/Channel.d.ts.map +1 -0
- package/lib/crypto/verification/request/Channel.js +1 -0
- package/lib/crypto/verification/request/Channel.js.map +1 -0
- package/lib/crypto/verification/request/InRoomChannel.d.ts +113 -0
- package/lib/crypto/verification/request/InRoomChannel.d.ts.map +1 -0
- package/lib/crypto/verification/request/InRoomChannel.js +351 -0
- package/lib/crypto/verification/request/InRoomChannel.js.map +1 -0
- package/lib/crypto/verification/request/ToDeviceChannel.d.ts +105 -0
- package/lib/crypto/verification/request/ToDeviceChannel.d.ts.map +1 -0
- package/lib/crypto/verification/request/ToDeviceChannel.js +328 -0
- package/lib/crypto/verification/request/ToDeviceChannel.js.map +1 -0
- package/lib/crypto/verification/request/VerificationRequest.d.ts +227 -0
- package/lib/crypto/verification/request/VerificationRequest.d.ts.map +1 -0
- package/lib/crypto/verification/request/VerificationRequest.js +937 -0
- package/lib/crypto/verification/request/VerificationRequest.js.map +1 -0
- package/lib/crypto-api/CryptoEvent.d.ts +69 -0
- package/lib/crypto-api/CryptoEvent.d.ts.map +1 -0
- package/lib/crypto-api/CryptoEvent.js +33 -0
- package/lib/crypto-api/CryptoEvent.js.map +1 -0
- package/lib/crypto-api/CryptoEventHandlerMap.d.ts +16 -0
- package/lib/crypto-api/CryptoEventHandlerMap.d.ts.map +1 -0
- package/lib/crypto-api/CryptoEventHandlerMap.js +22 -0
- package/lib/crypto-api/CryptoEventHandlerMap.js.map +1 -0
- package/lib/crypto-api/index.d.ts +978 -0
- package/lib/crypto-api/index.d.ts.map +1 -0
- package/lib/crypto-api/index.js +304 -0
- package/lib/crypto-api/index.js.map +1 -0
- package/lib/crypto-api/key-passphrase.d.ts +11 -0
- package/lib/crypto-api/key-passphrase.d.ts.map +1 -0
- package/lib/crypto-api/key-passphrase.js +51 -0
- package/lib/crypto-api/key-passphrase.js.map +1 -0
- package/lib/crypto-api/keybackup.d.ts +88 -0
- package/lib/crypto-api/keybackup.d.ts.map +1 -0
- package/lib/crypto-api/keybackup.js +1 -0
- package/lib/crypto-api/keybackup.js.map +1 -0
- package/lib/crypto-api/recovery-key.d.ts +11 -0
- package/lib/crypto-api/recovery-key.d.ts.map +1 -0
- package/lib/crypto-api/recovery-key.js +65 -0
- package/lib/crypto-api/recovery-key.js.map +1 -0
- package/lib/crypto-api/verification.d.ts +344 -0
- package/lib/crypto-api/verification.d.ts.map +1 -0
- package/lib/crypto-api/verification.js +91 -0
- package/lib/crypto-api/verification.js.map +1 -0
- package/lib/digest.d.ts +10 -0
- package/lib/digest.d.ts.map +1 -0
- package/lib/digest.js +40 -0
- package/lib/digest.js.map +1 -0
- package/lib/embedded.d.ts +143 -0
- package/lib/embedded.d.ts.map +1 -0
- package/lib/embedded.js +567 -0
- package/lib/embedded.js.map +1 -0
- package/lib/errors.d.ts +24 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +51 -0
- package/lib/errors.js.map +1 -0
- package/lib/event-mapper.d.ts +10 -0
- package/lib/event-mapper.d.ts.map +1 -0
- package/lib/event-mapper.js +81 -0
- package/lib/event-mapper.js.map +1 -0
- package/lib/extensible_events_v1/ExtensibleEvent.d.ts +38 -0
- package/lib/extensible_events_v1/ExtensibleEvent.d.ts.map +1 -0
- package/lib/extensible_events_v1/ExtensibleEvent.js +57 -0
- package/lib/extensible_events_v1/ExtensibleEvent.js.map +1 -0
- package/lib/extensible_events_v1/InvalidEventError.d.ts +7 -0
- package/lib/extensible_events_v1/InvalidEventError.d.ts.map +1 -0
- package/lib/extensible_events_v1/InvalidEventError.js +25 -0
- package/lib/extensible_events_v1/InvalidEventError.js.map +1 -0
- package/lib/extensible_events_v1/MessageEvent.d.ts +45 -0
- package/lib/extensible_events_v1/MessageEvent.d.ts.map +1 -0
- package/lib/extensible_events_v1/MessageEvent.js +134 -0
- package/lib/extensible_events_v1/MessageEvent.js.map +1 -0
- package/lib/extensible_events_v1/PollEndEvent.d.ts +33 -0
- package/lib/extensible_events_v1/PollEndEvent.d.ts.map +1 -0
- package/lib/extensible_events_v1/PollEndEvent.js +88 -0
- package/lib/extensible_events_v1/PollEndEvent.js.map +1 -0
- package/lib/extensible_events_v1/PollResponseEvent.d.ts +49 -0
- package/lib/extensible_events_v1/PollResponseEvent.d.ts.map +1 -0
- package/lib/extensible_events_v1/PollResponseEvent.js +135 -0
- package/lib/extensible_events_v1/PollResponseEvent.js.map +1 -0
- package/lib/extensible_events_v1/PollStartEvent.d.ts +71 -0
- package/lib/extensible_events_v1/PollStartEvent.d.ts.map +1 -0
- package/lib/extensible_events_v1/PollStartEvent.js +185 -0
- package/lib/extensible_events_v1/PollStartEvent.js.map +1 -0
- package/lib/extensible_events_v1/utilities.d.ts +14 -0
- package/lib/extensible_events_v1/utilities.d.ts.map +1 -0
- package/lib/extensible_events_v1/utilities.js +34 -0
- package/lib/extensible_events_v1/utilities.js.map +1 -0
- package/lib/feature.d.ts +20 -0
- package/lib/feature.d.ts.map +1 -0
- package/lib/feature.js +85 -0
- package/lib/feature.js.map +1 -0
- package/lib/filter-component.d.ts +64 -0
- package/lib/filter-component.d.ts.map +1 -0
- package/lib/filter-component.js +167 -0
- package/lib/filter-component.js.map +1 -0
- package/lib/filter.d.ts +97 -0
- package/lib/filter.d.ts.map +1 -0
- package/lib/filter.js +207 -0
- package/lib/filter.js.map +1 -0
- package/lib/http-api/errors.d.ts +80 -0
- package/lib/http-api/errors.d.ts.map +1 -0
- package/lib/http-api/errors.js +185 -0
- package/lib/http-api/errors.js.map +1 -0
- package/lib/http-api/fetch.d.ts +114 -0
- package/lib/http-api/fetch.d.ts.map +1 -0
- package/lib/http-api/fetch.js +346 -0
- package/lib/http-api/fetch.js.map +1 -0
- package/lib/http-api/index.d.ts +33 -0
- package/lib/http-api/index.d.ts.map +1 -0
- package/lib/http-api/index.js +180 -0
- package/lib/http-api/index.js.map +1 -0
- package/lib/http-api/interface.d.ts +142 -0
- package/lib/http-api/interface.d.ts.map +1 -0
- package/lib/http-api/interface.js +35 -0
- package/lib/http-api/interface.js.map +1 -0
- package/lib/http-api/method.d.ts +10 -0
- package/lib/http-api/method.d.ts.map +1 -0
- package/lib/http-api/method.js +27 -0
- package/lib/http-api/method.js.map +1 -0
- package/lib/http-api/prefix.d.ts +31 -0
- package/lib/http-api/prefix.d.ts.map +1 -0
- package/lib/http-api/prefix.js +32 -0
- package/lib/http-api/prefix.js.map +1 -0
- package/lib/http-api/utils.d.ts +37 -0
- package/lib/http-api/utils.d.ts.map +1 -0
- package/lib/http-api/utils.js +178 -0
- package/lib/http-api/utils.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +24 -0
- package/lib/index.js.map +1 -0
- package/lib/indexeddb-helpers.d.ts +10 -0
- package/lib/indexeddb-helpers.d.ts.map +1 -0
- package/lib/indexeddb-helpers.js +51 -0
- package/lib/indexeddb-helpers.js.map +1 -0
- package/lib/indexeddb-worker.d.ts +7 -0
- package/lib/indexeddb-worker.d.ts.map +1 -0
- package/lib/indexeddb-worker.js +25 -0
- package/lib/indexeddb-worker.js.map +1 -0
- package/lib/interactive-auth.d.ts +337 -0
- package/lib/interactive-auth.d.ts.map +1 -0
- package/lib/interactive-auth.js +557 -0
- package/lib/interactive-auth.js.map +1 -0
- package/lib/logger.d.ts +81 -0
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +139 -0
- package/lib/logger.js.map +1 -0
- package/lib/matrix.d.ts +118 -0
- package/lib/matrix.d.ts.map +1 -0
- package/lib/matrix.js +146 -0
- package/lib/matrix.js.map +1 -0
- package/lib/matrixrtc/CallMembership.d.ts +66 -0
- package/lib/matrixrtc/CallMembership.d.ts.map +1 -0
- package/lib/matrixrtc/CallMembership.js +197 -0
- package/lib/matrixrtc/CallMembership.js.map +1 -0
- package/lib/matrixrtc/LivekitFocus.d.ts +16 -0
- package/lib/matrixrtc/LivekitFocus.d.ts.map +1 -0
- package/lib/matrixrtc/LivekitFocus.js +20 -0
- package/lib/matrixrtc/LivekitFocus.js.map +1 -0
- package/lib/matrixrtc/MatrixRTCSession.d.ts +295 -0
- package/lib/matrixrtc/MatrixRTCSession.d.ts.map +1 -0
- package/lib/matrixrtc/MatrixRTCSession.js +1043 -0
- package/lib/matrixrtc/MatrixRTCSession.js.map +1 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.d.ts +40 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.d.ts.map +1 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.js +146 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.js.map +1 -0
- package/lib/matrixrtc/focus.d.ts +10 -0
- package/lib/matrixrtc/focus.d.ts.map +1 -0
- package/lib/matrixrtc/focus.js +1 -0
- package/lib/matrixrtc/focus.js.map +1 -0
- package/lib/matrixrtc/index.d.ts +7 -0
- package/lib/matrixrtc/index.d.ts.map +1 -0
- package/lib/matrixrtc/index.js +21 -0
- package/lib/matrixrtc/index.js.map +1 -0
- package/lib/matrixrtc/types.d.ts +19 -0
- package/lib/matrixrtc/types.d.ts.map +1 -0
- package/lib/matrixrtc/types.js +1 -0
- package/lib/matrixrtc/types.js.map +1 -0
- package/lib/models/MSC3089Branch.d.ts +98 -0
- package/lib/models/MSC3089Branch.d.ts.map +1 -0
- package/lib/models/MSC3089Branch.js +240 -0
- package/lib/models/MSC3089Branch.js.map +1 -0
- package/lib/models/MSC3089TreeSpace.d.ts +165 -0
- package/lib/models/MSC3089TreeSpace.d.ts.map +1 -0
- package/lib/models/MSC3089TreeSpace.js +520 -0
- package/lib/models/MSC3089TreeSpace.js.map +1 -0
- package/lib/models/ToDeviceMessage.d.ts +17 -0
- package/lib/models/ToDeviceMessage.d.ts.map +1 -0
- package/lib/models/ToDeviceMessage.js +1 -0
- package/lib/models/ToDeviceMessage.js.map +1 -0
- package/lib/models/beacon.d.ts +53 -0
- package/lib/models/beacon.d.ts.map +1 -0
- package/lib/models/beacon.js +174 -0
- package/lib/models/beacon.js.map +1 -0
- package/lib/models/compare-event-ordering.d.ts +24 -0
- package/lib/models/compare-event-ordering.d.ts.map +1 -0
- package/lib/models/compare-event-ordering.js +120 -0
- package/lib/models/compare-event-ordering.js.map +1 -0
- package/lib/models/device.d.ts +45 -0
- package/lib/models/device.d.ts.map +1 -0
- package/lib/models/device.js +77 -0
- package/lib/models/device.js.map +1 -0
- package/lib/models/event-context.d.ts +62 -0
- package/lib/models/event-context.d.ts.map +1 -0
- package/lib/models/event-context.js +113 -0
- package/lib/models/event-context.js.map +1 -0
- package/lib/models/event-status.d.ts +19 -0
- package/lib/models/event-status.d.ts.map +1 -0
- package/lib/models/event-status.js +30 -0
- package/lib/models/event-status.js.map +1 -0
- package/lib/models/event-timeline-set.d.ts +312 -0
- package/lib/models/event-timeline-set.d.ts.map +1 -0
- package/lib/models/event-timeline-set.js +813 -0
- package/lib/models/event-timeline-set.js.map +1 -0
- package/lib/models/event-timeline.d.ts +219 -0
- package/lib/models/event-timeline.d.ts.map +1 -0
- package/lib/models/event-timeline.js +455 -0
- package/lib/models/event-timeline.js.map +1 -0
- package/lib/models/event.d.ts +811 -0
- package/lib/models/event.d.ts.map +1 -0
- package/lib/models/event.js +1520 -0
- package/lib/models/event.js.map +1 -0
- package/lib/models/invites-ignorer.d.ts +136 -0
- package/lib/models/invites-ignorer.d.ts.map +1 -0
- package/lib/models/invites-ignorer.js +382 -0
- package/lib/models/invites-ignorer.js.map +1 -0
- package/lib/models/poll.d.ts +67 -0
- package/lib/models/poll.d.ts.map +1 -0
- package/lib/models/poll.js +241 -0
- package/lib/models/poll.js.map +1 -0
- package/lib/models/profile-keys.d.ts +8 -0
- package/lib/models/profile-keys.d.ts.map +1 -0
- package/lib/models/profile-keys.js +8 -0
- package/lib/models/profile-keys.js.map +1 -0
- package/lib/models/read-receipt.d.ts +115 -0
- package/lib/models/read-receipt.d.ts.map +1 -0
- package/lib/models/read-receipt.js +366 -0
- package/lib/models/read-receipt.js.map +1 -0
- package/lib/models/related-relations.d.ts +11 -0
- package/lib/models/related-relations.d.ts.map +1 -0
- package/lib/models/related-relations.js +33 -0
- package/lib/models/related-relations.js.map +1 -0
- package/lib/models/relations-container.d.ts +44 -0
- package/lib/models/relations-container.d.ts.map +1 -0
- package/lib/models/relations-container.js +132 -0
- package/lib/models/relations-container.js.map +1 -0
- package/lib/models/relations.d.ts +114 -0
- package/lib/models/relations.d.ts.map +1 -0
- package/lib/models/relations.js +354 -0
- package/lib/models/relations.js.map +1 -0
- package/lib/models/room-member.d.ts +204 -0
- package/lib/models/room-member.d.ts.map +1 -0
- package/lib/models/room-member.js +360 -0
- package/lib/models/room-member.js.map +1 -0
- package/lib/models/room-receipts.d.ts +39 -0
- package/lib/models/room-receipts.d.ts.map +1 -0
- package/lib/models/room-receipts.js +392 -0
- package/lib/models/room-receipts.js.map +1 -0
- package/lib/models/room-state.d.ts +468 -0
- package/lib/models/room-state.d.ts.map +1 -0
- package/lib/models/room-state.js +984 -0
- package/lib/models/room-state.js.map +1 -0
- package/lib/models/room-summary.d.ts +29 -0
- package/lib/models/room-summary.d.ts.map +1 -0
- package/lib/models/room-summary.js +28 -0
- package/lib/models/room-summary.js.map +1 -0
- package/lib/models/room.d.ts +1203 -0
- package/lib/models/room.d.ts.map +1 -0
- package/lib/models/room.js +3336 -0
- package/lib/models/room.js.map +1 -0
- package/lib/models/search-result.d.ts +20 -0
- package/lib/models/search-result.d.ts.map +1 -0
- package/lib/models/search-result.js +52 -0
- package/lib/models/search-result.js.map +1 -0
- package/lib/models/thread.d.ts +246 -0
- package/lib/models/thread.d.ts.map +1 -0
- package/lib/models/thread.js +861 -0
- package/lib/models/thread.js.map +1 -0
- package/lib/models/typed-event-emitter.d.ts +157 -0
- package/lib/models/typed-event-emitter.d.ts.map +1 -0
- package/lib/models/typed-event-emitter.js +227 -0
- package/lib/models/typed-event-emitter.js.map +1 -0
- package/lib/models/user.d.ts +195 -0
- package/lib/models/user.d.ts.map +1 -0
- package/lib/models/user.js +218 -0
- package/lib/models/user.js.map +1 -0
- package/lib/oidc/authorize.d.ts +90 -0
- package/lib/oidc/authorize.d.ts.map +1 -0
- package/lib/oidc/authorize.js +278 -0
- package/lib/oidc/authorize.js.map +1 -0
- package/lib/oidc/discovery.d.ts +14 -0
- package/lib/oidc/discovery.d.ts.map +1 -0
- package/lib/oidc/discovery.js +66 -0
- package/lib/oidc/discovery.js.map +1 -0
- package/lib/oidc/error.d.ts +18 -0
- package/lib/oidc/error.d.ts.map +1 -0
- package/lib/oidc/error.js +35 -0
- package/lib/oidc/error.js.map +1 -0
- package/lib/oidc/index.d.ts +17 -0
- package/lib/oidc/index.d.ts.map +1 -0
- package/lib/oidc/index.js +29 -0
- package/lib/oidc/index.js.map +1 -0
- package/lib/oidc/register.d.ts +43 -0
- package/lib/oidc/register.d.ts.map +1 -0
- package/lib/oidc/register.js +96 -0
- package/lib/oidc/register.js.map +1 -0
- package/lib/oidc/tokenRefresher.d.ts +69 -0
- package/lib/oidc/tokenRefresher.d.ts.map +1 -0
- package/lib/oidc/tokenRefresher.js +148 -0
- package/lib/oidc/tokenRefresher.js.map +1 -0
- package/lib/oidc/validate.d.ts +90 -0
- package/lib/oidc/validate.d.ts.map +1 -0
- package/lib/oidc/validate.js +194 -0
- package/lib/oidc/validate.js.map +1 -0
- package/lib/pushprocessor.d.ts +128 -0
- package/lib/pushprocessor.d.ts.map +1 -0
- package/lib/pushprocessor.js +685 -0
- package/lib/pushprocessor.js.map +1 -0
- package/lib/randomstring.d.ts +5 -0
- package/lib/randomstring.d.ts.map +1 -0
- package/lib/randomstring.js +43 -0
- package/lib/randomstring.js.map +1 -0
- package/lib/realtime-callbacks.d.ts +18 -0
- package/lib/realtime-callbacks.d.ts.map +1 -0
- package/lib/realtime-callbacks.js +177 -0
- package/lib/realtime-callbacks.js.map +1 -0
- package/lib/receipt-accumulator.d.ts +51 -0
- package/lib/receipt-accumulator.d.ts.map +1 -0
- package/lib/receipt-accumulator.js +164 -0
- package/lib/receipt-accumulator.js.map +1 -0
- package/lib/rendezvous/MSC4108SignInWithQR.d.ts +112 -0
- package/lib/rendezvous/MSC4108SignInWithQR.d.ts.map +1 -0
- package/lib/rendezvous/MSC4108SignInWithQR.js +392 -0
- package/lib/rendezvous/MSC4108SignInWithQR.js.map +1 -0
- package/lib/rendezvous/RendezvousChannel.d.ts +27 -0
- package/lib/rendezvous/RendezvousChannel.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousChannel.js +1 -0
- package/lib/rendezvous/RendezvousChannel.js.map +1 -0
- package/lib/rendezvous/RendezvousCode.d.ts +9 -0
- package/lib/rendezvous/RendezvousCode.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousCode.js +1 -0
- package/lib/rendezvous/RendezvousCode.js.map +1 -0
- package/lib/rendezvous/RendezvousError.d.ts +6 -0
- package/lib/rendezvous/RendezvousError.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousError.js +23 -0
- package/lib/rendezvous/RendezvousError.js.map +1 -0
- package/lib/rendezvous/RendezvousFailureReason.d.ts +31 -0
- package/lib/rendezvous/RendezvousFailureReason.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousFailureReason.js +38 -0
- package/lib/rendezvous/RendezvousFailureReason.js.map +1 -0
- package/lib/rendezvous/RendezvousIntent.d.ts +5 -0
- package/lib/rendezvous/RendezvousIntent.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousIntent.js +22 -0
- package/lib/rendezvous/RendezvousIntent.js.map +1 -0
- package/lib/rendezvous/RendezvousTransport.d.ts +36 -0
- package/lib/rendezvous/RendezvousTransport.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousTransport.js +1 -0
- package/lib/rendezvous/RendezvousTransport.js.map +1 -0
- package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts +58 -0
- package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts.map +1 -0
- package/lib/rendezvous/channels/MSC4108SecureChannel.js +246 -0
- package/lib/rendezvous/channels/MSC4108SecureChannel.js.map +1 -0
- package/lib/rendezvous/channels/index.d.ts +2 -0
- package/lib/rendezvous/channels/index.d.ts.map +1 -0
- package/lib/rendezvous/channels/index.js +18 -0
- package/lib/rendezvous/channels/index.js.map +1 -0
- package/lib/rendezvous/index.d.ts +10 -0
- package/lib/rendezvous/index.d.ts.map +1 -0
- package/lib/rendezvous/index.js +23 -0
- package/lib/rendezvous/index.js.map +1 -0
- package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts +61 -0
- package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts.map +1 -0
- package/lib/rendezvous/transports/MSC4108RendezvousSession.js +253 -0
- package/lib/rendezvous/transports/MSC4108RendezvousSession.js.map +1 -0
- package/lib/rendezvous/transports/index.d.ts +2 -0
- package/lib/rendezvous/transports/index.d.ts.map +1 -0
- package/lib/rendezvous/transports/index.js +18 -0
- package/lib/rendezvous/transports/index.js.map +1 -0
- package/lib/room-hierarchy.d.ts +35 -0
- package/lib/room-hierarchy.d.ts.map +1 -0
- package/lib/room-hierarchy.js +136 -0
- package/lib/room-hierarchy.js.map +1 -0
- package/lib/rust-crypto/CrossSigningIdentity.d.ts +33 -0
- package/lib/rust-crypto/CrossSigningIdentity.d.ts.map +1 -0
- package/lib/rust-crypto/CrossSigningIdentity.js +157 -0
- package/lib/rust-crypto/CrossSigningIdentity.js.map +1 -0
- package/lib/rust-crypto/DehydratedDeviceManager.d.ts +98 -0
- package/lib/rust-crypto/DehydratedDeviceManager.d.ts.map +1 -0
- package/lib/rust-crypto/DehydratedDeviceManager.js +285 -0
- package/lib/rust-crypto/DehydratedDeviceManager.js.map +1 -0
- package/lib/rust-crypto/KeyClaimManager.d.ts +33 -0
- package/lib/rust-crypto/KeyClaimManager.d.ts.map +1 -0
- package/lib/rust-crypto/KeyClaimManager.js +82 -0
- package/lib/rust-crypto/KeyClaimManager.js.map +1 -0
- package/lib/rust-crypto/OutgoingRequestProcessor.d.ts +43 -0
- package/lib/rust-crypto/OutgoingRequestProcessor.d.ts.map +1 -0
- package/lib/rust-crypto/OutgoingRequestProcessor.js +195 -0
- package/lib/rust-crypto/OutgoingRequestProcessor.js.map +1 -0
- package/lib/rust-crypto/OutgoingRequestsManager.d.ts +47 -0
- package/lib/rust-crypto/OutgoingRequestsManager.d.ts.map +1 -0
- package/lib/rust-crypto/OutgoingRequestsManager.js +148 -0
- package/lib/rust-crypto/OutgoingRequestsManager.js.map +1 -0
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts +120 -0
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts.map +1 -0
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.js +467 -0
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.js.map +1 -0
- package/lib/rust-crypto/RoomEncryptor.d.ts +98 -0
- package/lib/rust-crypto/RoomEncryptor.d.ts.map +1 -0
- package/lib/rust-crypto/RoomEncryptor.js +299 -0
- package/lib/rust-crypto/RoomEncryptor.js.map +1 -0
- package/lib/rust-crypto/backup.d.ts +254 -0
- package/lib/rust-crypto/backup.d.ts.map +1 -0
- package/lib/rust-crypto/backup.js +837 -0
- package/lib/rust-crypto/backup.js.map +1 -0
- package/lib/rust-crypto/constants.d.ts +3 -0
- package/lib/rust-crypto/constants.d.ts.map +1 -0
- package/lib/rust-crypto/constants.js +19 -0
- package/lib/rust-crypto/constants.js.map +1 -0
- package/lib/rust-crypto/device-converter.d.ts +28 -0
- package/lib/rust-crypto/device-converter.d.ts.map +1 -0
- package/lib/rust-crypto/device-converter.js +123 -0
- package/lib/rust-crypto/device-converter.js.map +1 -0
- package/lib/rust-crypto/index.d.ts +61 -0
- package/lib/rust-crypto/index.d.ts.map +1 -0
- package/lib/rust-crypto/index.js +152 -0
- package/lib/rust-crypto/index.js.map +1 -0
- package/lib/rust-crypto/libolm_migration.d.ts +81 -0
- package/lib/rust-crypto/libolm_migration.d.ts.map +1 -0
- package/lib/rust-crypto/libolm_migration.js +459 -0
- package/lib/rust-crypto/libolm_migration.js.map +1 -0
- package/lib/rust-crypto/rust-crypto.d.ts +556 -0
- package/lib/rust-crypto/rust-crypto.d.ts.map +1 -0
- package/lib/rust-crypto/rust-crypto.js +2016 -0
- package/lib/rust-crypto/rust-crypto.js.map +1 -0
- package/lib/rust-crypto/secret-storage.d.ts +22 -0
- package/lib/rust-crypto/secret-storage.d.ts.map +1 -0
- package/lib/rust-crypto/secret-storage.js +63 -0
- package/lib/rust-crypto/secret-storage.js.map +1 -0
- package/lib/rust-crypto/verification.d.ts +319 -0
- package/lib/rust-crypto/verification.d.ts.map +1 -0
- package/lib/rust-crypto/verification.js +816 -0
- package/lib/rust-crypto/verification.js.map +1 -0
- package/lib/scheduler.d.ts +132 -0
- package/lib/scheduler.d.ts.map +1 -0
- package/lib/scheduler.js +259 -0
- package/lib/scheduler.js.map +1 -0
- package/lib/secret-storage.d.ts +370 -0
- package/lib/secret-storage.d.ts.map +1 -0
- package/lib/secret-storage.js +466 -0
- package/lib/secret-storage.js.map +1 -0
- package/lib/serverCapabilities.d.ts +72 -0
- package/lib/serverCapabilities.d.ts.map +1 -0
- package/lib/serverCapabilities.js +105 -0
- package/lib/serverCapabilities.js.map +1 -0
- package/lib/service-types.d.ts +5 -0
- package/lib/service-types.d.ts.map +1 -0
- package/lib/service-types.js +22 -0
- package/lib/service-types.js.map +1 -0
- package/lib/sliding-sync-sdk.d.ts +107 -0
- package/lib/sliding-sync-sdk.d.ts.map +1 -0
- package/lib/sliding-sync-sdk.js +903 -0
- package/lib/sliding-sync-sdk.js.map +1 -0
- package/lib/sliding-sync.d.ts +343 -0
- package/lib/sliding-sync.d.ts.map +1 -0
- package/lib/sliding-sync.js +817 -0
- package/lib/sliding-sync.js.map +1 -0
- package/lib/store/index.d.ts +201 -0
- package/lib/store/index.d.ts.map +1 -0
- package/lib/store/index.js +1 -0
- package/lib/store/index.js.map +1 -0
- package/lib/store/indexeddb-backend.d.ts +24 -0
- package/lib/store/indexeddb-backend.d.ts.map +1 -0
- package/lib/store/indexeddb-backend.js +1 -0
- package/lib/store/indexeddb-backend.js.map +1 -0
- package/lib/store/indexeddb-local-backend.d.ts +129 -0
- package/lib/store/indexeddb-local-backend.d.ts.map +1 -0
- package/lib/store/indexeddb-local-backend.js +597 -0
- package/lib/store/indexeddb-local-backend.js.map +1 -0
- package/lib/store/indexeddb-remote-backend.d.ts +79 -0
- package/lib/store/indexeddb-remote-backend.d.ts.map +1 -0
- package/lib/store/indexeddb-remote-backend.js +210 -0
- package/lib/store/indexeddb-remote-backend.js.map +1 -0
- package/lib/store/indexeddb-store-worker.d.ts +35 -0
- package/lib/store/indexeddb-store-worker.d.ts.map +1 -0
- package/lib/store/indexeddb-store-worker.js +146 -0
- package/lib/store/indexeddb-store-worker.js.map +1 -0
- package/lib/store/indexeddb.d.ts +142 -0
- package/lib/store/indexeddb.d.ts.map +1 -0
- package/lib/store/indexeddb.js +347 -0
- package/lib/store/indexeddb.js.map +1 -0
- package/lib/store/local-storage-events-emitter.d.ts +30 -0
- package/lib/store/local-storage-events-emitter.d.ts.map +1 -0
- package/lib/store/local-storage-events-emitter.js +37 -0
- package/lib/store/local-storage-events-emitter.js.map +1 -0
- package/lib/store/memory.d.ts +209 -0
- package/lib/store/memory.d.ts.map +1 -0
- package/lib/store/memory.js +432 -0
- package/lib/store/memory.js.map +1 -0
- package/lib/store/stub.d.ts +161 -0
- package/lib/store/stub.d.ts.map +1 -0
- package/lib/store/stub.js +268 -0
- package/lib/store/stub.js.map +1 -0
- package/lib/sync-accumulator.d.ts +172 -0
- package/lib/sync-accumulator.d.ts.map +1 -0
- package/lib/sync-accumulator.js +532 -0
- package/lib/sync-accumulator.js.map +1 -0
- package/lib/sync.d.ts +260 -0
- package/lib/sync.d.ts.map +1 -0
- package/lib/sync.js +1686 -0
- package/lib/sync.js.map +1 -0
- package/lib/testing.d.ts +81 -0
- package/lib/testing.d.ts.map +1 -0
- package/lib/testing.js +162 -0
- package/lib/testing.js.map +1 -0
- package/lib/thread-utils.d.ts +10 -0
- package/lib/thread-utils.d.ts.map +1 -0
- package/lib/thread-utils.js +31 -0
- package/lib/thread-utils.js.map +1 -0
- package/lib/timeline-window.d.ts +168 -0
- package/lib/timeline-window.d.ts.map +1 -0
- package/lib/timeline-window.js +494 -0
- package/lib/timeline-window.js.map +1 -0
- package/lib/types.d.ts +33 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +33 -0
- package/lib/types.js.map +1 -0
- package/lib/utils/decryptAESSecretStorageItem.d.ts +12 -0
- package/lib/utils/decryptAESSecretStorageItem.d.ts.map +1 -0
- package/lib/utils/decryptAESSecretStorageItem.js +50 -0
- package/lib/utils/decryptAESSecretStorageItem.js.map +1 -0
- package/lib/utils/encryptAESSecretStorageItem.d.ts +16 -0
- package/lib/utils/encryptAESSecretStorageItem.d.ts.map +1 -0
- package/lib/utils/encryptAESSecretStorageItem.js +68 -0
- package/lib/utils/encryptAESSecretStorageItem.js.map +1 -0
- package/lib/utils/internal/deriveKeys.d.ts +10 -0
- package/lib/utils/internal/deriveKeys.d.ts.map +1 -0
- package/lib/utils/internal/deriveKeys.js +60 -0
- package/lib/utils/internal/deriveKeys.js.map +1 -0
- package/lib/utils.d.ts +267 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +749 -0
- package/lib/utils.js.map +1 -0
- package/lib/version-support.d.ts +19 -0
- package/lib/version-support.d.ts.map +1 -0
- package/lib/version-support.js +37 -0
- package/lib/version-support.js.map +1 -0
- package/lib/webrtc/audioContext.d.ts +15 -0
- package/lib/webrtc/audioContext.d.ts.map +1 -0
- package/lib/webrtc/audioContext.js +46 -0
- package/lib/webrtc/audioContext.js.map +1 -0
- package/lib/webrtc/call.d.ts +560 -0
- package/lib/webrtc/call.d.ts.map +1 -0
- package/lib/webrtc/call.js +2541 -0
- package/lib/webrtc/call.js.map +1 -0
- package/lib/webrtc/callEventHandler.d.ts +37 -0
- package/lib/webrtc/callEventHandler.d.ts.map +1 -0
- package/lib/webrtc/callEventHandler.js +344 -0
- package/lib/webrtc/callEventHandler.js.map +1 -0
- package/lib/webrtc/callEventTypes.d.ts +73 -0
- package/lib/webrtc/callEventTypes.d.ts.map +1 -0
- package/lib/webrtc/callEventTypes.js +13 -0
- package/lib/webrtc/callEventTypes.js.map +1 -0
- package/lib/webrtc/callFeed.d.ts +128 -0
- package/lib/webrtc/callFeed.d.ts.map +1 -0
- package/lib/webrtc/callFeed.js +289 -0
- package/lib/webrtc/callFeed.js.map +1 -0
- package/lib/webrtc/groupCall.d.ts +323 -0
- package/lib/webrtc/groupCall.d.ts.map +1 -0
- package/lib/webrtc/groupCall.js +1337 -0
- package/lib/webrtc/groupCall.js.map +1 -0
- package/lib/webrtc/groupCallEventHandler.d.ts +31 -0
- package/lib/webrtc/groupCallEventHandler.d.ts.map +1 -0
- package/lib/webrtc/groupCallEventHandler.js +178 -0
- package/lib/webrtc/groupCallEventHandler.js.map +1 -0
- package/lib/webrtc/mediaHandler.d.ts +89 -0
- package/lib/webrtc/mediaHandler.d.ts.map +1 -0
- package/lib/webrtc/mediaHandler.js +437 -0
- package/lib/webrtc/mediaHandler.js.map +1 -0
- package/lib/webrtc/stats/callFeedStatsReporter.d.ts +8 -0
- package/lib/webrtc/stats/callFeedStatsReporter.d.ts.map +1 -0
- package/lib/webrtc/stats/callFeedStatsReporter.js +82 -0
- package/lib/webrtc/stats/callFeedStatsReporter.js.map +1 -0
- package/lib/webrtc/stats/callStatsReportGatherer.d.ts +25 -0
- package/lib/webrtc/stats/callStatsReportGatherer.d.ts.map +1 -0
- package/lib/webrtc/stats/callStatsReportGatherer.js +199 -0
- package/lib/webrtc/stats/callStatsReportGatherer.js.map +1 -0
- package/lib/webrtc/stats/callStatsReportSummary.d.ts +17 -0
- package/lib/webrtc/stats/callStatsReportSummary.d.ts.map +1 -0
- package/lib/webrtc/stats/callStatsReportSummary.js +1 -0
- package/lib/webrtc/stats/callStatsReportSummary.js.map +1 -0
- package/lib/webrtc/stats/connectionStats.d.ts +28 -0
- package/lib/webrtc/stats/connectionStats.d.ts.map +1 -0
- package/lib/webrtc/stats/connectionStats.js +26 -0
- package/lib/webrtc/stats/connectionStats.js.map +1 -0
- package/lib/webrtc/stats/connectionStatsBuilder.d.ts +5 -0
- package/lib/webrtc/stats/connectionStatsBuilder.d.ts.map +1 -0
- package/lib/webrtc/stats/connectionStatsBuilder.js +27 -0
- package/lib/webrtc/stats/connectionStatsBuilder.js.map +1 -0
- package/lib/webrtc/stats/connectionStatsReportBuilder.d.ts +7 -0
- package/lib/webrtc/stats/connectionStatsReportBuilder.d.ts.map +1 -0
- package/lib/webrtc/stats/connectionStatsReportBuilder.js +121 -0
- package/lib/webrtc/stats/connectionStatsReportBuilder.js.map +1 -0
- package/lib/webrtc/stats/groupCallStats.d.ts +22 -0
- package/lib/webrtc/stats/groupCallStats.d.ts.map +1 -0
- package/lib/webrtc/stats/groupCallStats.js +78 -0
- package/lib/webrtc/stats/groupCallStats.js.map +1 -0
- package/lib/webrtc/stats/media/mediaSsrcHandler.d.ts +10 -0
- package/lib/webrtc/stats/media/mediaSsrcHandler.d.ts.map +1 -0
- package/lib/webrtc/stats/media/mediaSsrcHandler.js +57 -0
- package/lib/webrtc/stats/media/mediaSsrcHandler.js.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackHandler.d.ts +12 -0
- package/lib/webrtc/stats/media/mediaTrackHandler.d.ts.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackHandler.js +62 -0
- package/lib/webrtc/stats/media/mediaTrackHandler.js.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackStats.d.ts +86 -0
- package/lib/webrtc/stats/media/mediaTrackStats.d.ts.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackStats.js +142 -0
- package/lib/webrtc/stats/media/mediaTrackStats.js.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.d.ts +22 -0
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.d.ts.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.js +76 -0
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.js.map +1 -0
- package/lib/webrtc/stats/statsReport.d.ts +99 -0
- package/lib/webrtc/stats/statsReport.d.ts.map +1 -0
- package/lib/webrtc/stats/statsReport.js +32 -0
- package/lib/webrtc/stats/statsReport.js.map +1 -0
- package/lib/webrtc/stats/statsReportEmitter.d.ts +15 -0
- package/lib/webrtc/stats/statsReportEmitter.d.ts.map +1 -0
- package/lib/webrtc/stats/statsReportEmitter.js +33 -0
- package/lib/webrtc/stats/statsReportEmitter.js.map +1 -0
- package/lib/webrtc/stats/summaryStatsReportGatherer.d.ts +16 -0
- package/lib/webrtc/stats/summaryStatsReportGatherer.d.ts.map +1 -0
- package/lib/webrtc/stats/summaryStatsReportGatherer.js +116 -0
- package/lib/webrtc/stats/summaryStatsReportGatherer.js.map +1 -0
- package/lib/webrtc/stats/trackStatsBuilder.d.ts +19 -0
- package/lib/webrtc/stats/trackStatsBuilder.d.ts.map +1 -0
- package/lib/webrtc/stats/trackStatsBuilder.js +168 -0
- package/lib/webrtc/stats/trackStatsBuilder.js.map +1 -0
- package/lib/webrtc/stats/transportStats.d.ts +11 -0
- package/lib/webrtc/stats/transportStats.d.ts.map +1 -0
- package/lib/webrtc/stats/transportStats.js +1 -0
- package/lib/webrtc/stats/transportStats.js.map +1 -0
- package/lib/webrtc/stats/transportStatsBuilder.d.ts +5 -0
- package/lib/webrtc/stats/transportStatsBuilder.d.ts.map +1 -0
- package/lib/webrtc/stats/transportStatsBuilder.js +34 -0
- package/lib/webrtc/stats/transportStatsBuilder.js.map +1 -0
- package/lib/webrtc/stats/valueFormatter.d.ts +4 -0
- package/lib/webrtc/stats/valueFormatter.d.ts.map +1 -0
- package/lib/webrtc/stats/valueFormatter.js +25 -0
- package/lib/webrtc/stats/valueFormatter.js.map +1 -0
- package/package.json +134 -0
- package/src/@types/AESEncryptedSecretStoragePayload.ts +29 -0
- package/src/@types/IIdentityServerProvider.ts +24 -0
- package/src/@types/PushRules.ts +209 -0
- package/src/@types/another-json.d.ts +19 -0
- package/src/@types/auth.ts +252 -0
- package/src/@types/beacon.ts +140 -0
- package/src/@types/common.ts +22 -0
- package/src/@types/crypto.ts +73 -0
- package/src/@types/event.ts +370 -0
- package/src/@types/events.ts +119 -0
- package/src/@types/extensible_events.ts +150 -0
- package/src/@types/global.d.ts +70 -0
- package/src/@types/local_notifications.ts +19 -0
- package/src/@types/location.ts +92 -0
- package/src/@types/matrix-sdk-crypto-wasm.d.ts +44 -0
- package/src/@types/media.ts +245 -0
- package/src/@types/membership.ts +57 -0
- package/src/@types/oidc-client-ts.d.ts +24 -0
- package/src/@types/partials.ts +67 -0
- package/src/@types/polls.ts +119 -0
- package/src/@types/read_receipts.ts +61 -0
- package/src/@types/registration.ts +102 -0
- package/src/@types/requests.ts +314 -0
- package/src/@types/search.ts +119 -0
- package/src/@types/signed.ts +25 -0
- package/src/@types/spaces.ts +37 -0
- package/src/@types/state_events.ts +147 -0
- package/src/@types/synapse.ts +40 -0
- package/src/@types/sync.ts +27 -0
- package/src/@types/threepids.ts +29 -0
- package/src/@types/topic.ts +63 -0
- package/src/@types/uia.ts +29 -0
- package/src/NamespacedValue.ts +123 -0
- package/src/ReEmitter.ts +93 -0
- package/src/ToDeviceMessageQueue.ts +153 -0
- package/src/autodiscovery.ts +505 -0
- package/src/base64.ts +88 -0
- package/src/browser-index.ts +44 -0
- package/src/client.ts +10474 -0
- package/src/common-crypto/CryptoBackend.ts +302 -0
- package/src/common-crypto/README.md +4 -0
- package/src/common-crypto/key-passphrase.ts +43 -0
- package/src/content-helpers.ts +288 -0
- package/src/content-repo.ts +117 -0
- package/src/crypto/CrossSigning.ts +773 -0
- package/src/crypto/DeviceList.ts +989 -0
- package/src/crypto/EncryptionSetup.ts +351 -0
- package/src/crypto/OlmDevice.ts +1500 -0
- package/src/crypto/OutgoingRoomKeyRequestManager.ts +485 -0
- package/src/crypto/RoomList.ts +70 -0
- package/src/crypto/SecretSharing.ts +240 -0
- package/src/crypto/SecretStorage.ts +136 -0
- package/src/crypto/aes.ts +23 -0
- package/src/crypto/algorithms/base.ts +236 -0
- package/src/crypto/algorithms/index.ts +20 -0
- package/src/crypto/algorithms/megolm.ts +2216 -0
- package/src/crypto/algorithms/olm.ts +381 -0
- package/src/crypto/api.ts +70 -0
- package/src/crypto/backup.ts +922 -0
- package/src/crypto/crypto.ts +18 -0
- package/src/crypto/dehydration.ts +272 -0
- package/src/crypto/device-converter.ts +45 -0
- package/src/crypto/deviceinfo.ts +158 -0
- package/src/crypto/index.ts +4414 -0
- package/src/crypto/key_passphrase.ts +42 -0
- package/src/crypto/keybackup.ts +47 -0
- package/src/crypto/olmlib.ts +539 -0
- package/src/crypto/recoverykey.ts +18 -0
- package/src/crypto/store/base.ts +348 -0
- package/src/crypto/store/indexeddb-crypto-store-backend.ts +1250 -0
- package/src/crypto/store/indexeddb-crypto-store.ts +845 -0
- package/src/crypto/store/localStorage-crypto-store.ts +579 -0
- package/src/crypto/store/memory-crypto-store.ts +680 -0
- package/src/crypto/verification/Base.ts +409 -0
- package/src/crypto/verification/Error.ts +76 -0
- package/src/crypto/verification/IllegalMethod.ts +50 -0
- package/src/crypto/verification/QRCode.ts +310 -0
- package/src/crypto/verification/SAS.ts +494 -0
- package/src/crypto/verification/SASDecimal.ts +37 -0
- package/src/crypto/verification/request/Channel.ts +34 -0
- package/src/crypto/verification/request/InRoomChannel.ts +371 -0
- package/src/crypto/verification/request/ToDeviceChannel.ts +354 -0
- package/src/crypto/verification/request/VerificationRequest.ts +976 -0
- package/src/crypto-api/CryptoEvent.ts +93 -0
- package/src/crypto-api/CryptoEventHandlerMap.ts +32 -0
- package/src/crypto-api/index.ts +1175 -0
- package/src/crypto-api/key-passphrase.ts +58 -0
- package/src/crypto-api/keybackup.ts +115 -0
- package/src/crypto-api/recovery-key.ts +69 -0
- package/src/crypto-api/verification.ts +408 -0
- package/src/digest.ts +34 -0
- package/src/embedded.ts +631 -0
- package/src/errors.ts +54 -0
- package/src/event-mapper.ts +97 -0
- package/src/extensible_events_v1/ExtensibleEvent.ts +58 -0
- package/src/extensible_events_v1/InvalidEventError.ts +24 -0
- package/src/extensible_events_v1/MessageEvent.ts +145 -0
- package/src/extensible_events_v1/PollEndEvent.ts +97 -0
- package/src/extensible_events_v1/PollResponseEvent.ts +148 -0
- package/src/extensible_events_v1/PollStartEvent.ts +207 -0
- package/src/extensible_events_v1/utilities.ts +35 -0
- package/src/feature.ts +87 -0
- package/src/filter-component.ts +207 -0
- package/src/filter.ts +245 -0
- package/src/http-api/errors.ts +199 -0
- package/src/http-api/fetch.ts +383 -0
- package/src/http-api/index.ts +191 -0
- package/src/http-api/interface.ts +178 -0
- package/src/http-api/method.ts +25 -0
- package/src/http-api/prefix.ts +48 -0
- package/src/http-api/utils.ts +200 -0
- package/src/index.ts +25 -0
- package/src/indexeddb-helpers.ts +50 -0
- package/src/indexeddb-worker.ts +24 -0
- package/src/interactive-auth.ts +694 -0
- package/src/logger.ts +185 -0
- package/src/matrix.ts +177 -0
- package/src/matrixrtc/CallMembership.ts +247 -0
- package/src/matrixrtc/LivekitFocus.ts +39 -0
- package/src/matrixrtc/MatrixRTCSession.ts +1319 -0
- package/src/matrixrtc/MatrixRTCSessionManager.ts +166 -0
- package/src/matrixrtc/focus.ts +25 -0
- package/src/matrixrtc/index.ts +22 -0
- package/src/matrixrtc/types.ts +36 -0
- package/src/models/MSC3089Branch.ts +272 -0
- package/src/models/MSC3089TreeSpace.ts +565 -0
- package/src/models/ToDeviceMessage.ts +38 -0
- package/src/models/beacon.ts +214 -0
- package/src/models/compare-event-ordering.ts +139 -0
- package/src/models/device.ts +85 -0
- package/src/models/event-context.ts +110 -0
- package/src/models/event-status.ts +39 -0
- package/src/models/event-timeline-set.ts +979 -0
- package/src/models/event-timeline.ts +476 -0
- package/src/models/event.ts +1751 -0
- package/src/models/invites-ignorer.ts +376 -0
- package/src/models/poll.ts +285 -0
- package/src/models/profile-keys.ts +7 -0
- package/src/models/read-receipt.ts +422 -0
- package/src/models/related-relations.ts +39 -0
- package/src/models/relations-container.ts +149 -0
- package/src/models/relations.ts +368 -0
- package/src/models/room-member.ts +457 -0
- package/src/models/room-receipts.ts +439 -0
- package/src/models/room-state.ts +1130 -0
- package/src/models/room-summary.ts +47 -0
- package/src/models/room.ts +3822 -0
- package/src/models/search-result.ts +57 -0
- package/src/models/thread.ts +923 -0
- package/src/models/typed-event-emitter.ts +246 -0
- package/src/models/user.ts +302 -0
- package/src/oidc/authorize.ts +274 -0
- package/src/oidc/discovery.ts +60 -0
- package/src/oidc/error.ts +33 -0
- package/src/oidc/index.ts +34 -0
- package/src/oidc/register.ts +123 -0
- package/src/oidc/tokenRefresher.ts +149 -0
- package/src/oidc/validate.ts +282 -0
- package/src/pushprocessor.ts +837 -0
- package/src/randomstring.ts +51 -0
- package/src/realtime-callbacks.ts +191 -0
- package/src/receipt-accumulator.ts +189 -0
- package/src/rendezvous/MSC4108SignInWithQR.ts +444 -0
- package/src/rendezvous/RendezvousChannel.ts +48 -0
- package/src/rendezvous/RendezvousCode.ts +25 -0
- package/src/rendezvous/RendezvousError.ts +26 -0
- package/src/rendezvous/RendezvousFailureReason.ts +49 -0
- package/src/rendezvous/RendezvousIntent.ts +20 -0
- package/src/rendezvous/RendezvousTransport.ts +58 -0
- package/src/rendezvous/channels/MSC4108SecureChannel.ts +270 -0
- package/src/rendezvous/channels/index.ts +17 -0
- package/src/rendezvous/index.ts +25 -0
- package/src/rendezvous/transports/MSC4108RendezvousSession.ts +270 -0
- package/src/rendezvous/transports/index.ts +17 -0
- package/src/room-hierarchy.ts +152 -0
- package/src/rust-crypto/CrossSigningIdentity.ts +183 -0
- package/src/rust-crypto/DehydratedDeviceManager.ts +306 -0
- package/src/rust-crypto/KeyClaimManager.ts +86 -0
- package/src/rust-crypto/OutgoingRequestProcessor.ts +236 -0
- package/src/rust-crypto/OutgoingRequestsManager.ts +143 -0
- package/src/rust-crypto/PerSessionKeyBackupDownloader.ts +501 -0
- package/src/rust-crypto/RoomEncryptor.ts +352 -0
- package/src/rust-crypto/backup.ts +881 -0
- package/src/rust-crypto/constants.ts +18 -0
- package/src/rust-crypto/device-converter.ts +128 -0
- package/src/rust-crypto/index.ts +237 -0
- package/src/rust-crypto/libolm_migration.ts +530 -0
- package/src/rust-crypto/rust-crypto.ts +2205 -0
- package/src/rust-crypto/secret-storage.ts +60 -0
- package/src/rust-crypto/verification.ts +830 -0
- package/src/scheduler.ts +309 -0
- package/src/secret-storage.ts +693 -0
- package/src/serverCapabilities.ts +139 -0
- package/src/service-types.ts +20 -0
- package/src/sliding-sync-sdk.ts +1026 -0
- package/src/sliding-sync.ts +965 -0
- package/src/store/index.ts +261 -0
- package/src/store/indexeddb-backend.ts +41 -0
- package/src/store/indexeddb-local-backend.ts +610 -0
- package/src/store/indexeddb-remote-backend.ts +213 -0
- package/src/store/indexeddb-store-worker.ts +157 -0
- package/src/store/indexeddb.ts +397 -0
- package/src/store/local-storage-events-emitter.ts +46 -0
- package/src/store/memory.ts +448 -0
- package/src/store/stub.ts +280 -0
- package/src/sync-accumulator.ts +689 -0
- package/src/sync.ts +1920 -0
- package/src/testing.ts +191 -0
- package/src/thread-utils.ts +31 -0
- package/src/timeline-window.ts +536 -0
- package/src/types.ts +59 -0
- package/src/utils/decryptAESSecretStorageItem.ts +54 -0
- package/src/utils/encryptAESSecretStorageItem.ts +73 -0
- package/src/utils/internal/deriveKeys.ts +63 -0
- package/src/utils.ts +763 -0
- package/src/version-support.ts +36 -0
- package/src/webrtc/audioContext.ts +44 -0
- package/src/webrtc/call.ts +3074 -0
- package/src/webrtc/callEventHandler.ts +425 -0
- package/src/webrtc/callEventTypes.ts +93 -0
- package/src/webrtc/callFeed.ts +364 -0
- package/src/webrtc/groupCall.ts +1735 -0
- package/src/webrtc/groupCallEventHandler.ts +234 -0
- package/src/webrtc/mediaHandler.ts +484 -0
- package/src/webrtc/stats/callFeedStatsReporter.ts +94 -0
- package/src/webrtc/stats/callStatsReportGatherer.ts +219 -0
- package/src/webrtc/stats/callStatsReportSummary.ts +30 -0
- package/src/webrtc/stats/connectionStats.ts +47 -0
- package/src/webrtc/stats/connectionStatsBuilder.ts +28 -0
- package/src/webrtc/stats/connectionStatsReportBuilder.ts +140 -0
- package/src/webrtc/stats/groupCallStats.ts +93 -0
- package/src/webrtc/stats/media/mediaSsrcHandler.ts +57 -0
- package/src/webrtc/stats/media/mediaTrackHandler.ts +76 -0
- package/src/webrtc/stats/media/mediaTrackStats.ts +176 -0
- package/src/webrtc/stats/media/mediaTrackStatsHandler.ts +90 -0
- package/src/webrtc/stats/statsReport.ts +133 -0
- package/src/webrtc/stats/statsReportEmitter.ts +49 -0
- package/src/webrtc/stats/summaryStatsReportGatherer.ts +148 -0
- package/src/webrtc/stats/trackStatsBuilder.ts +207 -0
- package/src/webrtc/stats/transportStats.ts +26 -0
- package/src/webrtc/stats/transportStatsBuilder.ts +48 -0
- package/src/webrtc/stats/valueFormatter.ts +27 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"receipt-accumulator.js","names":["EventType","isSupportedReceiptType","MapWithDefault","recursiveMapToObject","ReceiptAccumulator","constructor","_defineProperty","Map","setUnthreaded","userId","receipt","unthreadedReadReceipts","set","setThreaded","threadId","threadedReadReceipts","getOrCreate","allUnthreaded","entries","allThreaded","receiptsForThread","values","e","consumeEphemeralEvents","events","forEach","type","Receipt","content","Object","keys","eventId","_ref","key","value","data","thread_id","buildAccumulatedReceiptEvent","roomId","receiptEvent","room_id","receiptEventContent","receiptData","size"],"sources":["../src/receipt-accumulator.ts"],"sourcesContent":["/*\nCopyright 2023 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { IMinimalEvent } from \"./sync-accumulator.ts\";\nimport { EventType } from \"./@types/event.ts\";\nimport { isSupportedReceiptType, MapWithDefault, recursiveMapToObject } from \"./utils.ts\";\nimport { IContent } from \"./models/event.ts\";\nimport { ReceiptContent, ReceiptType } from \"./@types/read_receipts.ts\";\n\ninterface AccumulatedReceipt {\n data: IMinimalEvent;\n type: ReceiptType;\n eventId: string;\n}\n\n/**\n * Summarises the read receipts within a room. Used by the sync accumulator.\n *\n * Given receipts for users, picks the most recently-received one and provides\n * the results in a new fake receipt event returned from\n * buildAccumulatedReceiptEvent().\n *\n * Handles unthreaded receipts and receipts in each thread separately, so the\n * returned event contains the most recently received unthreaded receipt, and\n * the most recently received receipt in each thread.\n */\nexport class ReceiptAccumulator {\n /** user_id -\\> most-recently-received unthreaded receipt */\n private unthreadedReadReceipts: Map<string, AccumulatedReceipt> = new Map();\n\n /** thread_id -\\> user_id -\\> most-recently-received receipt for this thread */\n private threadedReadReceipts: MapWithDefault<string, Map<string, AccumulatedReceipt>> = new MapWithDefault(\n () => new Map(),\n );\n\n /**\n * Provide an unthreaded receipt for this user. Overwrites any other\n * unthreaded receipt we have for this user.\n */\n private setUnthreaded(userId: string, receipt: AccumulatedReceipt): void {\n this.unthreadedReadReceipts.set(userId, receipt);\n }\n\n /**\n * Provide a receipt for this user in this thread. Overwrites any other\n * receipt we have for this user in this thread.\n */\n private setThreaded(threadId: string, userId: string, receipt: AccumulatedReceipt): void {\n this.threadedReadReceipts.getOrCreate(threadId).set(userId, receipt);\n }\n\n /**\n * @returns an iterator of pairs of [userId, AccumulatedReceipt] - all the\n * most recently-received unthreaded receipts for each user.\n */\n private allUnthreaded(): IterableIterator<[string, AccumulatedReceipt]> {\n return this.unthreadedReadReceipts.entries();\n }\n\n /**\n * @returns an iterator of pairs of [userId, AccumulatedReceipt] - all the\n * most recently-received threaded receipts for each user, in all\n * threads.\n */\n private *allThreaded(): IterableIterator<[string, AccumulatedReceipt]> {\n for (const receiptsForThread of this.threadedReadReceipts.values()) {\n for (const e of receiptsForThread.entries()) {\n yield e;\n }\n }\n }\n\n /**\n * Given a list of ephemeral events, find the receipts and store the\n * relevant ones to be returned later from buildAccumulatedReceiptEvent().\n */\n public consumeEphemeralEvents(events: IMinimalEvent[] | undefined): void {\n events?.forEach((e) => {\n if (e.type !== EventType.Receipt || !e.content) {\n // This means we'll drop unknown ephemeral events but that\n // seems okay.\n return;\n }\n\n // Handle m.receipt events. They clobber based on:\n // (user_id, receipt_type)\n // but they are keyed in the event as:\n // content:{ $event_id: { $receipt_type: { $user_id: {json} }}}\n // so store them in the former so we can accumulate receipt deltas\n // quickly and efficiently (we expect a lot of them). Fold the\n // receipt type into the key name since we only have 1 at the\n // moment (m.read) and nested JSON objects are slower and more\n // of a hassle to work with. We'll inflate this back out when\n // getJSON() is called.\n Object.keys(e.content).forEach((eventId) => {\n Object.entries<ReceiptContent>(e.content[eventId]).forEach(([key, value]) => {\n if (!isSupportedReceiptType(key)) return;\n\n for (const userId of Object.keys(value)) {\n const data = e.content[eventId][key][userId];\n\n const receipt = {\n data: e.content[eventId][key][userId],\n type: key as ReceiptType,\n eventId,\n };\n\n // In a world that supports threads, read receipts normally have\n // a `thread_id` which is either the thread they belong in or\n // `MAIN_ROOM_TIMELINE`, so we normally use `setThreaded(...)`\n // here. The `MAIN_ROOM_TIMELINE` is just treated as another\n // thread.\n //\n // We still encounter read receipts that are \"unthreaded\"\n // (missing the `thread_id` property). These come from clients\n // that don't support threads, and from threaded clients that\n // are doing a \"Mark room as read\" operation. Unthreaded\n // receipts mark everything \"before\" them as read, in all\n // threads, where \"before\" means in Sync Order i.e. the order\n // the events were received from the homeserver in a sync.\n // [Note: we have some bugs where we use timestamp order instead\n // of Sync Order, because we don't correctly remember the Sync\n // Order. See #3325.]\n //\n // Calling the wrong method will cause incorrect behavior like\n // messages re-appearing as \"new\" when you already read them\n // previously.\n if (!data.thread_id) {\n this.setUnthreaded(userId, receipt);\n } else {\n this.setThreaded(data.thread_id, userId, receipt);\n }\n }\n });\n });\n });\n }\n\n /**\n * Build a receipt event that contains all relevant information for this\n * room, taking the most recently received receipt for each user in an\n * unthreaded context, and in each thread.\n */\n public buildAccumulatedReceiptEvent(roomId: string): IMinimalEvent | null {\n const receiptEvent: IMinimalEvent = {\n type: EventType.Receipt,\n room_id: roomId,\n content: {\n // $event_id: { \"m.read\": { $user_id: $json } }\n } as IContent,\n };\n\n const receiptEventContent: MapWithDefault<\n string,\n MapWithDefault<ReceiptType, Map<string, object>>\n > = new MapWithDefault(() => new MapWithDefault(() => new Map()));\n\n for (const [userId, receiptData] of this.allUnthreaded()) {\n receiptEventContent\n .getOrCreate(receiptData.eventId)\n .getOrCreate(receiptData.type)\n .set(userId, receiptData.data);\n }\n\n for (const [userId, receiptData] of this.allThreaded()) {\n receiptEventContent\n .getOrCreate(receiptData.eventId)\n .getOrCreate(receiptData.type)\n .set(userId, receiptData.data);\n }\n\n receiptEvent.content = recursiveMapToObject(receiptEventContent);\n\n return receiptEventContent.size > 0 ? receiptEvent : null;\n }\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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C,YAA2B,GAAG;MAChCb,IAAI,EAAE1B,SAAS,CAAC2B,OAAO;MACvBa,OAAO,EAAEF,MAAM;MACfV,OAAO,EAAE;QACL;MAAA;IAER,CAAC;IAED,IAAMa,mBAGL,GAAG,IAAIvC,cAAc,CAAC,MAAM,IAAIA,cAAc,CAAC,MAAM,IAAIK,GAAG,CAAC,CAAC,CAAC,CAAC;IAEjE,KAAK,IAAM,CAACE,MAAM,EAAEiC,WAAW,CAAC,IAAI,IAAI,CAACzB,aAAa,CAAC,CAAC,EAAE;MACtDwB,mBAAmB,CACdzB,WAAW,CAAC0B,WAAW,CAACX,OAAO,CAAC,CAChCf,WAAW,CAAC0B,WAAW,CAAChB,IAAI,CAAC,CAC7Bd,GAAG,CAACH,MAAM,EAAEiC,WAAW,CAACP,IAAI,CAAC;IACtC;IAEA,KAAK,IAAM,CAAC1B,OAAM,EAAEiC,YAAW,CAAC,IAAI,IAAI,CAACvB,WAAW,CAAC,CAAC,EAAE;MACpDsB,mBAAmB,CACdzB,WAAW,CAAC0B,YAAW,CAACX,OAAO,CAAC,CAChCf,WAAW,CAAC0B,YAAW,CAAChB,IAAI,CAAC,CAC7Bd,GAAG,CAACH,OAAM,EAAEiC,YAAW,CAACP,IAAI,CAAC;IACtC;IAEAI,YAAY,CAACX,OAAO,GAAGzB,oBAAoB,CAACsC,mBAAmB,CAAC;IAEhE,OAAOA,mBAAmB,CAACE,IAAI,GAAG,CAAC,GAAGJ,YAAY,GAAG,IAAI;EAC7D;AACJ","ignoreList":[]}
|
@@ -0,0 +1,112 @@
|
|
1
|
+
import { ClientRendezvousFailureReason, MSC4108FailureReason, RendezvousFailureListener } from "./index.ts";
|
2
|
+
import { MatrixClient } from "../client.ts";
|
3
|
+
import { MSC4108SecureChannel } from "./channels/MSC4108SecureChannel.ts";
|
4
|
+
import { CryptoApi } from "../crypto-api/index.ts";
|
5
|
+
/**
|
6
|
+
* Enum representing the payload types transmissible over [MSC4108](https://github.com/matrix-org/matrix-spec-proposals/pull/4108)
|
7
|
+
* secure channels.
|
8
|
+
* @experimental Note that this is UNSTABLE and may have breaking changes without notice.
|
9
|
+
*/
|
10
|
+
export declare enum PayloadType {
|
11
|
+
Protocols = "m.login.protocols",
|
12
|
+
Protocol = "m.login.protocol",
|
13
|
+
Failure = "m.login.failure",
|
14
|
+
Success = "m.login.success",
|
15
|
+
Secrets = "m.login.secrets",
|
16
|
+
ProtocolAccepted = "m.login.protocol_accepted",
|
17
|
+
Declined = "m.login.declined"
|
18
|
+
}
|
19
|
+
/**
|
20
|
+
* Type representing the base payload format for [MSC4108](https://github.com/matrix-org/matrix-spec-proposals/pull/4108)
|
21
|
+
* messages sent over the secure channel.
|
22
|
+
* @experimental Note that this is UNSTABLE and may have breaking changes without notice.
|
23
|
+
*/
|
24
|
+
export interface MSC4108Payload {
|
25
|
+
type: PayloadType;
|
26
|
+
}
|
27
|
+
interface SecretsPayload extends MSC4108Payload, Awaited<ReturnType<NonNullable<CryptoApi["exportSecretsBundle"]>>> {
|
28
|
+
type: PayloadType.Secrets;
|
29
|
+
}
|
30
|
+
/**
|
31
|
+
* Prototype of the unstable [MSC4108](https://github.com/matrix-org/matrix-spec-proposals/pull/4108)
|
32
|
+
* sign in with QR + OIDC flow.
|
33
|
+
* @experimental Note that this is UNSTABLE and may have breaking changes without notice.
|
34
|
+
*/
|
35
|
+
export declare class MSC4108SignInWithQR {
|
36
|
+
private readonly channel;
|
37
|
+
private readonly didScanCode;
|
38
|
+
private readonly client?;
|
39
|
+
onFailure?: RendezvousFailureListener | undefined;
|
40
|
+
private readonly ourIntent;
|
41
|
+
private _code?;
|
42
|
+
private expectingNewDeviceId?;
|
43
|
+
/**
|
44
|
+
* Returns the check code for the secure channel or undefined if not generated yet.
|
45
|
+
*/
|
46
|
+
get checkCode(): string | undefined;
|
47
|
+
/**
|
48
|
+
* @param channel - The secure channel used for communication
|
49
|
+
* @param client - The Matrix client in used on the device already logged in
|
50
|
+
* @param didScanCode - Whether this side of the channel scanned the QR code from the other party
|
51
|
+
* @param onFailure - Callback for when the rendezvous fails
|
52
|
+
*/
|
53
|
+
constructor(channel: MSC4108SecureChannel, didScanCode: boolean, client?: MatrixClient | undefined, onFailure?: RendezvousFailureListener | undefined);
|
54
|
+
/**
|
55
|
+
* Returns the code representing the rendezvous suitable for rendering in a QR code or undefined if not generated yet.
|
56
|
+
*/
|
57
|
+
get code(): Uint8Array | undefined;
|
58
|
+
/**
|
59
|
+
* Generate the code including doing partial set up of the channel where required.
|
60
|
+
*/
|
61
|
+
generateCode(): Promise<void>;
|
62
|
+
/**
|
63
|
+
* Returns true if the device is the already logged in device reciprocating a new login on the other side of the channel.
|
64
|
+
*/
|
65
|
+
get isExistingDevice(): boolean;
|
66
|
+
/**
|
67
|
+
* Returns true if the device is the new device logging in being reciprocated by the device on the other side of the channel.
|
68
|
+
*/
|
69
|
+
get isNewDevice(): boolean;
|
70
|
+
/**
|
71
|
+
* The first step in the OIDC QR login process.
|
72
|
+
* To be called after the QR code has been rendered or scanned.
|
73
|
+
* The scanning device has to discover the homeserver details, if they scanned the code then they already have it.
|
74
|
+
* If the new device is the one rendering the QR code then it has to wait be sent the homeserver details via the rendezvous channel.
|
75
|
+
*/
|
76
|
+
negotiateProtocols(): Promise<{
|
77
|
+
serverName?: string;
|
78
|
+
}>;
|
79
|
+
/**
|
80
|
+
* The second & third step in the OIDC QR login process.
|
81
|
+
* To be called after `negotiateProtocols` for the existing device.
|
82
|
+
* To be called after OIDC negotiation for the new device. (Currently unsupported)
|
83
|
+
*/
|
84
|
+
deviceAuthorizationGrant(): Promise<{
|
85
|
+
verificationUri?: string;
|
86
|
+
userCode?: string;
|
87
|
+
}>;
|
88
|
+
/**
|
89
|
+
* The fifth (and final) step in the OIDC QR login process.
|
90
|
+
* To be called after the new device has completed authentication.
|
91
|
+
*/
|
92
|
+
shareSecrets(): Promise<{
|
93
|
+
secrets?: Omit<SecretsPayload, "type">;
|
94
|
+
}>;
|
95
|
+
private receive;
|
96
|
+
private send;
|
97
|
+
/**
|
98
|
+
* Decline the login on the existing device.
|
99
|
+
*/
|
100
|
+
declineLoginOnExistingDevice(): Promise<void>;
|
101
|
+
/**
|
102
|
+
* Cancels the rendezvous session.
|
103
|
+
* @param reason the reason for the cancellation
|
104
|
+
*/
|
105
|
+
cancel(reason: MSC4108FailureReason | ClientRendezvousFailureReason): Promise<void>;
|
106
|
+
/**
|
107
|
+
* Closes the rendezvous session.
|
108
|
+
*/
|
109
|
+
close(): Promise<void>;
|
110
|
+
}
|
111
|
+
export {};
|
112
|
+
//# sourceMappingURL=MSC4108SignInWithQR.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MSC4108SignInWithQR.d.ts","sourceRoot":"","sources":["../../src/rendezvous/MSC4108SignInWithQR.ts"],"names":[],"mappings":"AAkBA,OAAO,EACH,6BAA6B,EAC7B,oBAAoB,EAEpB,yBAAyB,EAC5B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAI1E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;;;GAIG;AACH,oBAAY,WAAW;IACnB,SAAS,sBAAsB;IAC/B,QAAQ,qBAAqB;IAC7B,OAAO,oBAAoB;IAC3B,OAAO,oBAAoB;IAC3B,OAAO,oBAAoB;IAC3B,gBAAgB,8BAA8B;IAC9C,QAAQ,qBAAqB;CAChC;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,WAAW,CAAC;CACrB;AA8CD,UAAU,cAAe,SAAQ,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAC/G,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC;CAC7B;AAED;;;;GAIG;AACH,qBAAa,mBAAmB;IAmBxB,OAAO,CAAC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KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAGtC"}
|
@@ -0,0 +1,392 @@
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
5
|
+
/*
|
6
|
+
Copyright 2024 The Matrix.org Foundation C.I.C.
|
7
|
+
|
8
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
+
you may not use this file except in compliance with the License.
|
10
|
+
You may obtain a copy of the License at
|
11
|
+
|
12
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
|
14
|
+
Unless required by applicable law or agreed to in writing, software
|
15
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
+
See the License for the specific language governing permissions and
|
18
|
+
limitations under the License.
|
19
|
+
*/
|
20
|
+
|
21
|
+
import { QrCodeMode } from "@matrix-org/matrix-sdk-crypto-wasm";
|
22
|
+
import { ClientRendezvousFailureReason, MSC4108FailureReason, RendezvousError } from "./index.js";
|
23
|
+
import { logger } from "../logger.js";
|
24
|
+
import { MatrixError } from "../http-api/index.js";
|
25
|
+
import { sleep } from "../utils.js";
|
26
|
+
import { DEVICE_CODE_SCOPE, discoverAndValidateOIDCIssuerWellKnown } from "../oidc/index.js";
|
27
|
+
/**
|
28
|
+
* Enum representing the payload types transmissible over [MSC4108](https://github.com/matrix-org/matrix-spec-proposals/pull/4108)
|
29
|
+
* secure channels.
|
30
|
+
* @experimental Note that this is UNSTABLE and may have breaking changes without notice.
|
31
|
+
*/
|
32
|
+
export var PayloadType = /*#__PURE__*/function (PayloadType) {
|
33
|
+
PayloadType["Protocols"] = "m.login.protocols";
|
34
|
+
PayloadType["Protocol"] = "m.login.protocol";
|
35
|
+
PayloadType["Failure"] = "m.login.failure";
|
36
|
+
PayloadType["Success"] = "m.login.success";
|
37
|
+
PayloadType["Secrets"] = "m.login.secrets";
|
38
|
+
PayloadType["ProtocolAccepted"] = "m.login.protocol_accepted";
|
39
|
+
PayloadType["Declined"] = "m.login.declined";
|
40
|
+
return PayloadType;
|
41
|
+
}({});
|
42
|
+
|
43
|
+
/**
|
44
|
+
* Type representing the base payload format for [MSC4108](https://github.com/matrix-org/matrix-spec-proposals/pull/4108)
|
45
|
+
* messages sent over the secure channel.
|
46
|
+
* @experimental Note that this is UNSTABLE and may have breaking changes without notice.
|
47
|
+
*/
|
48
|
+
|
49
|
+
function isDeviceAuthorizationGrantProtocolPayload(payload) {
|
50
|
+
return payload.protocol === "device_authorization_grant";
|
51
|
+
}
|
52
|
+
/**
|
53
|
+
* Prototype of the unstable [MSC4108](https://github.com/matrix-org/matrix-spec-proposals/pull/4108)
|
54
|
+
* sign in with QR + OIDC flow.
|
55
|
+
* @experimental Note that this is UNSTABLE and may have breaking changes without notice.
|
56
|
+
*/
|
57
|
+
export class MSC4108SignInWithQR {
|
58
|
+
/**
|
59
|
+
* Returns the check code for the secure channel or undefined if not generated yet.
|
60
|
+
*/
|
61
|
+
get checkCode() {
|
62
|
+
var _this$channel;
|
63
|
+
return (_this$channel = this.channel) === null || _this$channel === void 0 ? void 0 : _this$channel.getCheckCode();
|
64
|
+
}
|
65
|
+
|
66
|
+
/**
|
67
|
+
* @param channel - The secure channel used for communication
|
68
|
+
* @param client - The Matrix client in used on the device already logged in
|
69
|
+
* @param didScanCode - Whether this side of the channel scanned the QR code from the other party
|
70
|
+
* @param onFailure - Callback for when the rendezvous fails
|
71
|
+
*/
|
72
|
+
constructor(channel, didScanCode, client, onFailure) {
|
73
|
+
this.channel = channel;
|
74
|
+
this.didScanCode = didScanCode;
|
75
|
+
this.client = client;
|
76
|
+
this.onFailure = onFailure;
|
77
|
+
_defineProperty(this, "ourIntent", void 0);
|
78
|
+
_defineProperty(this, "_code", void 0);
|
79
|
+
_defineProperty(this, "expectingNewDeviceId", void 0);
|
80
|
+
this.ourIntent = client ? QrCodeMode.Reciprocate : QrCodeMode.Login;
|
81
|
+
}
|
82
|
+
|
83
|
+
/**
|
84
|
+
* Returns the code representing the rendezvous suitable for rendering in a QR code or undefined if not generated yet.
|
85
|
+
*/
|
86
|
+
get code() {
|
87
|
+
return this._code;
|
88
|
+
}
|
89
|
+
|
90
|
+
/**
|
91
|
+
* Generate the code including doing partial set up of the channel where required.
|
92
|
+
*/
|
93
|
+
generateCode() {
|
94
|
+
var _this = this;
|
95
|
+
return _asyncToGenerator(function* () {
|
96
|
+
if (_this._code) {
|
97
|
+
return;
|
98
|
+
}
|
99
|
+
if (_this.ourIntent === QrCodeMode.Reciprocate && _this.client) {
|
100
|
+
_this._code = yield _this.channel.generateCode(_this.ourIntent, _this.client.getDomain());
|
101
|
+
} else if (_this.ourIntent === QrCodeMode.Login) {
|
102
|
+
_this._code = yield _this.channel.generateCode(_this.ourIntent);
|
103
|
+
}
|
104
|
+
})();
|
105
|
+
}
|
106
|
+
|
107
|
+
/**
|
108
|
+
* Returns true if the device is the already logged in device reciprocating a new login on the other side of the channel.
|
109
|
+
*/
|
110
|
+
get isExistingDevice() {
|
111
|
+
return this.ourIntent === QrCodeMode.Reciprocate;
|
112
|
+
}
|
113
|
+
|
114
|
+
/**
|
115
|
+
* Returns true if the device is the new device logging in being reciprocated by the device on the other side of the channel.
|
116
|
+
*/
|
117
|
+
get isNewDevice() {
|
118
|
+
return !this.isExistingDevice;
|
119
|
+
}
|
120
|
+
|
121
|
+
/**
|
122
|
+
* The first step in the OIDC QR login process.
|
123
|
+
* To be called after the QR code has been rendered or scanned.
|
124
|
+
* The scanning device has to discover the homeserver details, if they scanned the code then they already have it.
|
125
|
+
* If the new device is the one rendering the QR code then it has to wait be sent the homeserver details via the rendezvous channel.
|
126
|
+
*/
|
127
|
+
negotiateProtocols() {
|
128
|
+
var _this2 = this;
|
129
|
+
return _asyncToGenerator(function* () {
|
130
|
+
logger.info("negotiateProtocols(isNewDevice=".concat(_this2.isNewDevice, " didScanCode=").concat(_this2.didScanCode, ")"));
|
131
|
+
yield _this2.channel.connect();
|
132
|
+
if (_this2.didScanCode) {
|
133
|
+
// Secure Channel step 6 completed, we trust the channel
|
134
|
+
|
135
|
+
if (_this2.isNewDevice) {
|
136
|
+
// MSC4108-Flow: ExistingScanned - take homeserver from QR code which should already be set
|
137
|
+
} else {
|
138
|
+
var _oidcClientConfig;
|
139
|
+
// MSC4108-Flow: NewScanned -send protocols message
|
140
|
+
var oidcClientConfig;
|
141
|
+
try {
|
142
|
+
var {
|
143
|
+
issuer
|
144
|
+
} = yield _this2.client.getAuthIssuer();
|
145
|
+
oidcClientConfig = yield discoverAndValidateOIDCIssuerWellKnown(issuer);
|
146
|
+
} catch (e) {
|
147
|
+
logger.error("Failed to discover OIDC metadata", e);
|
148
|
+
}
|
149
|
+
if ((_oidcClientConfig = oidcClientConfig) !== null && _oidcClientConfig !== void 0 && _oidcClientConfig.metadata.grant_types_supported.includes(DEVICE_CODE_SCOPE)) {
|
150
|
+
yield _this2.send({
|
151
|
+
type: PayloadType.Protocols,
|
152
|
+
protocols: ["device_authorization_grant"],
|
153
|
+
homeserver: _this2.client.getDomain()
|
154
|
+
});
|
155
|
+
} else {
|
156
|
+
yield _this2.send({
|
157
|
+
type: PayloadType.Failure,
|
158
|
+
reason: MSC4108FailureReason.UnsupportedProtocol
|
159
|
+
});
|
160
|
+
throw new RendezvousError("Device code grant unsupported", MSC4108FailureReason.UnsupportedProtocol);
|
161
|
+
}
|
162
|
+
}
|
163
|
+
} else if (_this2.isNewDevice) {
|
164
|
+
// MSC4108-Flow: ExistingScanned - wait for protocols message
|
165
|
+
logger.info("Waiting for protocols message");
|
166
|
+
var payload = yield _this2.receive();
|
167
|
+
if ((payload === null || payload === void 0 ? void 0 : payload.type) === PayloadType.Failure) {
|
168
|
+
throw new RendezvousError("Failed", payload.reason);
|
169
|
+
}
|
170
|
+
if ((payload === null || payload === void 0 ? void 0 : payload.type) !== PayloadType.Protocols) {
|
171
|
+
yield _this2.send({
|
172
|
+
type: PayloadType.Failure,
|
173
|
+
reason: MSC4108FailureReason.UnexpectedMessageReceived
|
174
|
+
});
|
175
|
+
throw new RendezvousError("Unexpected message received", MSC4108FailureReason.UnexpectedMessageReceived);
|
176
|
+
}
|
177
|
+
return {
|
178
|
+
serverName: payload.homeserver
|
179
|
+
};
|
180
|
+
} else {
|
181
|
+
// MSC4108-Flow: NewScanned - nothing to do
|
182
|
+
}
|
183
|
+
return {};
|
184
|
+
})();
|
185
|
+
}
|
186
|
+
|
187
|
+
/**
|
188
|
+
* The second & third step in the OIDC QR login process.
|
189
|
+
* To be called after `negotiateProtocols` for the existing device.
|
190
|
+
* To be called after OIDC negotiation for the new device. (Currently unsupported)
|
191
|
+
*/
|
192
|
+
deviceAuthorizationGrant() {
|
193
|
+
var _this3 = this;
|
194
|
+
return _asyncToGenerator(function* () {
|
195
|
+
if (_this3.isNewDevice) {
|
196
|
+
throw new Error("New device flows around OIDC are not yet implemented");
|
197
|
+
} else {
|
198
|
+
// The user needs to do step 7 for the out-of-band confirmation
|
199
|
+
// but, first we receive the protocol chosen by the other device so that
|
200
|
+
// the confirmation_uri is ready to go
|
201
|
+
logger.info("Waiting for protocol message");
|
202
|
+
var payload = yield _this3.receive();
|
203
|
+
if ((payload === null || payload === void 0 ? void 0 : payload.type) === PayloadType.Failure) {
|
204
|
+
throw new RendezvousError("Failed", payload.reason);
|
205
|
+
}
|
206
|
+
if ((payload === null || payload === void 0 ? void 0 : payload.type) !== PayloadType.Protocol) {
|
207
|
+
yield _this3.send({
|
208
|
+
type: PayloadType.Failure,
|
209
|
+
reason: MSC4108FailureReason.UnexpectedMessageReceived
|
210
|
+
});
|
211
|
+
throw new RendezvousError("Unexpected message received", MSC4108FailureReason.UnexpectedMessageReceived);
|
212
|
+
}
|
213
|
+
if (isDeviceAuthorizationGrantProtocolPayload(payload)) {
|
214
|
+
var {
|
215
|
+
device_authorization_grant: dag,
|
216
|
+
device_id: expectingNewDeviceId
|
217
|
+
} = payload;
|
218
|
+
var {
|
219
|
+
verification_uri: verificationUri,
|
220
|
+
verification_uri_complete: verificationUriComplete
|
221
|
+
} = dag;
|
222
|
+
var deviceAlreadyExists = true;
|
223
|
+
try {
|
224
|
+
var _this3$client;
|
225
|
+
yield (_this3$client = _this3.client) === null || _this3$client === void 0 ? void 0 : _this3$client.getDevice(expectingNewDeviceId);
|
226
|
+
} catch (err) {
|
227
|
+
if (err instanceof MatrixError && err.httpStatus === 404) {
|
228
|
+
deviceAlreadyExists = false;
|
229
|
+
}
|
230
|
+
}
|
231
|
+
if (deviceAlreadyExists) {
|
232
|
+
yield _this3.send({
|
233
|
+
type: PayloadType.Failure,
|
234
|
+
reason: MSC4108FailureReason.DeviceAlreadyExists
|
235
|
+
});
|
236
|
+
throw new RendezvousError("Specified device ID already exists", MSC4108FailureReason.DeviceAlreadyExists);
|
237
|
+
}
|
238
|
+
_this3.expectingNewDeviceId = expectingNewDeviceId;
|
239
|
+
return {
|
240
|
+
verificationUri: verificationUriComplete !== null && verificationUriComplete !== void 0 ? verificationUriComplete : verificationUri
|
241
|
+
};
|
242
|
+
}
|
243
|
+
yield _this3.send({
|
244
|
+
type: PayloadType.Failure,
|
245
|
+
reason: MSC4108FailureReason.UnsupportedProtocol
|
246
|
+
});
|
247
|
+
throw new RendezvousError("Received a request for an unsupported protocol", MSC4108FailureReason.UnsupportedProtocol);
|
248
|
+
}
|
249
|
+
})();
|
250
|
+
}
|
251
|
+
|
252
|
+
/**
|
253
|
+
* The fifth (and final) step in the OIDC QR login process.
|
254
|
+
* To be called after the new device has completed authentication.
|
255
|
+
*/
|
256
|
+
shareSecrets() {
|
257
|
+
var _this4 = this;
|
258
|
+
return _asyncToGenerator(function* () {
|
259
|
+
if (_this4.isNewDevice) {
|
260
|
+
yield _this4.send({
|
261
|
+
type: PayloadType.Success
|
262
|
+
});
|
263
|
+
// then wait for secrets
|
264
|
+
logger.info("Waiting for secrets message");
|
265
|
+
var payload = yield _this4.receive();
|
266
|
+
if ((payload === null || payload === void 0 ? void 0 : payload.type) === PayloadType.Failure) {
|
267
|
+
throw new RendezvousError("Failed", payload.reason);
|
268
|
+
}
|
269
|
+
if ((payload === null || payload === void 0 ? void 0 : payload.type) !== PayloadType.Secrets) {
|
270
|
+
yield _this4.send({
|
271
|
+
type: PayloadType.Failure,
|
272
|
+
reason: MSC4108FailureReason.UnexpectedMessageReceived
|
273
|
+
});
|
274
|
+
throw new RendezvousError("Unexpected message received", MSC4108FailureReason.UnexpectedMessageReceived);
|
275
|
+
}
|
276
|
+
return {
|
277
|
+
secrets: payload
|
278
|
+
};
|
279
|
+
// then done?
|
280
|
+
} else {
|
281
|
+
if (!_this4.expectingNewDeviceId) {
|
282
|
+
throw new Error("No new device ID expected");
|
283
|
+
}
|
284
|
+
yield _this4.send({
|
285
|
+
type: PayloadType.ProtocolAccepted
|
286
|
+
});
|
287
|
+
logger.info("Waiting for outcome message");
|
288
|
+
var _payload = yield _this4.receive();
|
289
|
+
if ((_payload === null || _payload === void 0 ? void 0 : _payload.type) === PayloadType.Failure) {
|
290
|
+
throw new RendezvousError("Failed", _payload.reason);
|
291
|
+
}
|
292
|
+
if ((_payload === null || _payload === void 0 ? void 0 : _payload.type) === PayloadType.Declined) {
|
293
|
+
throw new RendezvousError("User declined", ClientRendezvousFailureReason.UserDeclined);
|
294
|
+
}
|
295
|
+
if ((_payload === null || _payload === void 0 ? void 0 : _payload.type) !== PayloadType.Success) {
|
296
|
+
yield _this4.send({
|
297
|
+
type: PayloadType.Failure,
|
298
|
+
reason: MSC4108FailureReason.UnexpectedMessageReceived
|
299
|
+
});
|
300
|
+
throw new RendezvousError("Unexpected message", MSC4108FailureReason.UnexpectedMessageReceived);
|
301
|
+
}
|
302
|
+
var timeout = Date.now() + 10000; // wait up to 10 seconds
|
303
|
+
do {
|
304
|
+
// is the device visible via the Homeserver?
|
305
|
+
try {
|
306
|
+
var _this4$client;
|
307
|
+
var device = yield (_this4$client = _this4.client) === null || _this4$client === void 0 ? void 0 : _this4$client.getDevice(_this4.expectingNewDeviceId);
|
308
|
+
if (device) {
|
309
|
+
// if so, return the secrets
|
310
|
+
var secretsBundle = yield _this4.client.getCrypto().exportSecretsBundle();
|
311
|
+
if (_this4.channel.cancelled) {
|
312
|
+
throw new RendezvousError("User cancelled", MSC4108FailureReason.UserCancelled);
|
313
|
+
}
|
314
|
+
// send secrets
|
315
|
+
yield _this4.send(_objectSpread({
|
316
|
+
type: PayloadType.Secrets
|
317
|
+
}, secretsBundle));
|
318
|
+
return {
|
319
|
+
secrets: secretsBundle
|
320
|
+
};
|
321
|
+
// let the other side close the rendezvous session
|
322
|
+
}
|
323
|
+
} catch (err) {
|
324
|
+
if (err instanceof MatrixError && err.httpStatus === 404) {
|
325
|
+
// not found, so keep waiting until timeout
|
326
|
+
} else {
|
327
|
+
throw err;
|
328
|
+
}
|
329
|
+
}
|
330
|
+
yield sleep(1000);
|
331
|
+
} while (Date.now() < timeout);
|
332
|
+
yield _this4.send({
|
333
|
+
type: PayloadType.Failure,
|
334
|
+
reason: MSC4108FailureReason.DeviceNotFound
|
335
|
+
});
|
336
|
+
throw new RendezvousError("New device not found", MSC4108FailureReason.DeviceNotFound);
|
337
|
+
}
|
338
|
+
})();
|
339
|
+
}
|
340
|
+
receive() {
|
341
|
+
var _this5 = this;
|
342
|
+
return _asyncToGenerator(function* () {
|
343
|
+
return yield _this5.channel.secureReceive();
|
344
|
+
})();
|
345
|
+
}
|
346
|
+
send(payload) {
|
347
|
+
var _this6 = this;
|
348
|
+
return _asyncToGenerator(function* () {
|
349
|
+
yield _this6.channel.secureSend(payload);
|
350
|
+
})();
|
351
|
+
}
|
352
|
+
|
353
|
+
/**
|
354
|
+
* Decline the login on the existing device.
|
355
|
+
*/
|
356
|
+
declineLoginOnExistingDevice() {
|
357
|
+
var _this7 = this;
|
358
|
+
return _asyncToGenerator(function* () {
|
359
|
+
if (!_this7.isExistingDevice) {
|
360
|
+
throw new Error("Can only decline login on existing device");
|
361
|
+
}
|
362
|
+
yield _this7.send({
|
363
|
+
type: PayloadType.Failure,
|
364
|
+
reason: MSC4108FailureReason.UserCancelled
|
365
|
+
});
|
366
|
+
})();
|
367
|
+
}
|
368
|
+
|
369
|
+
/**
|
370
|
+
* Cancels the rendezvous session.
|
371
|
+
* @param reason the reason for the cancellation
|
372
|
+
*/
|
373
|
+
cancel(reason) {
|
374
|
+
var _this8 = this;
|
375
|
+
return _asyncToGenerator(function* () {
|
376
|
+
var _this8$onFailure;
|
377
|
+
(_this8$onFailure = _this8.onFailure) === null || _this8$onFailure === void 0 || _this8$onFailure.call(_this8, reason);
|
378
|
+
yield _this8.channel.cancel(reason);
|
379
|
+
})();
|
380
|
+
}
|
381
|
+
|
382
|
+
/**
|
383
|
+
* Closes the rendezvous session.
|
384
|
+
*/
|
385
|
+
close() {
|
386
|
+
var _this9 = this;
|
387
|
+
return _asyncToGenerator(function* () {
|
388
|
+
yield _this9.channel.close();
|
389
|
+
})();
|
390
|
+
}
|
391
|
+
}
|
392
|
+
//# sourceMappingURL=MSC4108SignInWithQR.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MSC4108SignInWithQR.js","names":["QrCodeMode","ClientRendezvousFailureReason","MSC4108FailureReason","RendezvousError","logger","MatrixError","sleep","DEVICE_CODE_SCOPE","discoverAndValidateOIDCIssuerWellKnown","PayloadType","isDeviceAuthorizationGrantProtocolPayload","payload","protocol","MSC4108SignInWithQR","checkCode","_this$channel","channel","getCheckCode","constructor","didScanCode","client","onFailure","_defineProperty","ourIntent","Reciprocate","Login","code","_code","generateCode","_this","_asyncToGenerator","getDomain","isExistingDevice","isNewDevice","negotiateProtocols","_this2","info","concat","connect","_oidcClientConfig","oidcClientConfig","issuer","getAuthIssuer","e","error","metadata","grant_types_supported","includes","send","type","Protocols","protocols","homeserver","Failure","reason","UnsupportedProtocol","receive","UnexpectedMessageReceived","serverName","deviceAuthorizationGrant","_this3","Error","Protocol","device_authorization_grant","dag","device_id","expectingNewDeviceId","verification_uri","verificationUri","verification_uri_complete","verificationUriComplete","deviceAlreadyExists","_this3$client","getDevice","err","httpStatus","DeviceAlreadyExists","shareSecrets","_this4","Success","Secrets","secrets","ProtocolAccepted","Declined","UserDeclined","timeout","Date","now","_this4$client","device","secretsBundle","getCrypto","exportSecretsBundle","cancelled","UserCancelled","_objectSpread","DeviceNotFound","_this5","secureReceive","_this6","secureSend","declineLoginOnExistingDevice","_this7","cancel","_this8","_this8$onFailure","call","close","_this9"],"sources":["../../src/rendezvous/MSC4108SignInWithQR.ts"],"sourcesContent":["/*\nCopyright 2024 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { QrCodeMode } from \"@matrix-org/matrix-sdk-crypto-wasm\";\n\nimport {\n ClientRendezvousFailureReason,\n MSC4108FailureReason,\n RendezvousError,\n RendezvousFailureListener,\n} from \"./index.ts\";\nimport { MatrixClient } from \"../client.ts\";\nimport { logger } from \"../logger.ts\";\nimport { MSC4108SecureChannel } from \"./channels/MSC4108SecureChannel.ts\";\nimport { MatrixError } from \"../http-api/index.ts\";\nimport { sleep } from \"../utils.ts\";\nimport { DEVICE_CODE_SCOPE, discoverAndValidateOIDCIssuerWellKnown, OidcClientConfig } from \"../oidc/index.ts\";\nimport { CryptoApi } from \"../crypto-api/index.ts\";\n\n/**\n * Enum representing the payload types transmissible over [MSC4108](https://github.com/matrix-org/matrix-spec-proposals/pull/4108)\n * secure channels.\n * @experimental Note that this is UNSTABLE and may have breaking changes without notice.\n */\nexport enum PayloadType {\n Protocols = \"m.login.protocols\",\n Protocol = \"m.login.protocol\",\n Failure = \"m.login.failure\",\n Success = \"m.login.success\",\n Secrets = \"m.login.secrets\",\n ProtocolAccepted = \"m.login.protocol_accepted\",\n Declined = \"m.login.declined\",\n}\n\n/**\n * Type representing the base payload format for [MSC4108](https://github.com/matrix-org/matrix-spec-proposals/pull/4108)\n * messages sent over the secure channel.\n * @experimental Note that this is UNSTABLE and may have breaking changes without notice.\n */\nexport interface MSC4108Payload {\n type: PayloadType;\n}\n\ninterface ProtocolsPayload extends MSC4108Payload {\n type: PayloadType.Protocols;\n protocols: string[];\n homeserver: string;\n}\n\ninterface ProtocolPayload extends MSC4108Payload {\n type: PayloadType.Protocol;\n protocol: Exclude<string, \"device_authorization_grant\">;\n device_id: string;\n}\n\ninterface DeviceAuthorizationGrantProtocolPayload extends ProtocolPayload {\n protocol: \"device_authorization_grant\";\n device_authorization_grant: {\n verification_uri: string;\n verification_uri_complete?: string;\n };\n}\n\nfunction isDeviceAuthorizationGrantProtocolPayload(\n payload: ProtocolPayload,\n): payload is DeviceAuthorizationGrantProtocolPayload {\n return payload.protocol === \"device_authorization_grant\";\n}\n\ninterface FailurePayload extends MSC4108Payload {\n type: PayloadType.Failure;\n reason: MSC4108FailureReason;\n homeserver?: string;\n}\n\ninterface DeclinedPayload extends MSC4108Payload {\n type: PayloadType.Declined;\n}\n\ninterface SuccessPayload extends MSC4108Payload {\n type: PayloadType.Success;\n}\n\ninterface AcceptedPayload extends MSC4108Payload {\n type: PayloadType.ProtocolAccepted;\n}\n\ninterface SecretsPayload extends MSC4108Payload, Awaited<ReturnType<NonNullable<CryptoApi[\"exportSecretsBundle\"]>>> {\n type: PayloadType.Secrets;\n}\n\n/**\n * Prototype of the unstable [MSC4108](https://github.com/matrix-org/matrix-spec-proposals/pull/4108)\n * sign in with QR + OIDC flow.\n * @experimental Note that this is UNSTABLE and may have breaking changes without notice.\n */\nexport class MSC4108SignInWithQR {\n private readonly ourIntent: QrCodeMode;\n private _code?: Uint8Array;\n private expectingNewDeviceId?: string;\n\n /**\n * Returns the check code for the secure channel or undefined if not generated yet.\n */\n public get checkCode(): string | undefined {\n return this.channel?.getCheckCode();\n }\n\n /**\n * @param channel - The secure channel used for communication\n * @param client - The Matrix client in used on the device already logged in\n * @param didScanCode - Whether this side of the channel scanned the QR code from the other party\n * @param onFailure - Callback for when the rendezvous fails\n */\n public constructor(\n private readonly channel: MSC4108SecureChannel,\n private readonly didScanCode: boolean,\n private readonly client?: MatrixClient,\n public onFailure?: RendezvousFailureListener,\n ) {\n this.ourIntent = client ? QrCodeMode.Reciprocate : QrCodeMode.Login;\n }\n\n /**\n * Returns the code representing the rendezvous suitable for rendering in a QR code or undefined if not generated yet.\n */\n public get code(): Uint8Array | undefined {\n return this._code;\n }\n\n /**\n * Generate the code including doing partial set up of the channel where required.\n */\n public async generateCode(): Promise<void> {\n if (this._code) {\n return;\n }\n\n if (this.ourIntent === QrCodeMode.Reciprocate && this.client) {\n this._code = await this.channel.generateCode(this.ourIntent, this.client.getDomain()!);\n } else if (this.ourIntent === QrCodeMode.Login) {\n this._code = await this.channel.generateCode(this.ourIntent);\n }\n }\n\n /**\n * Returns true if the device is the already logged in device reciprocating a new login on the other side of the channel.\n */\n public get isExistingDevice(): boolean {\n return this.ourIntent === QrCodeMode.Reciprocate;\n }\n\n /**\n * Returns true if the device is the new device logging in being reciprocated by the device on the other side of the channel.\n */\n public get isNewDevice(): boolean {\n return !this.isExistingDevice;\n }\n\n /**\n * The first step in the OIDC QR login process.\n * To be called after the QR code has been rendered or scanned.\n * The scanning device has to discover the homeserver details, if they scanned the code then they already have it.\n * If the new device is the one rendering the QR code then it has to wait be sent the homeserver details via the rendezvous channel.\n */\n public async negotiateProtocols(): Promise<{ serverName?: string }> {\n logger.info(`negotiateProtocols(isNewDevice=${this.isNewDevice} didScanCode=${this.didScanCode})`);\n await this.channel.connect();\n\n if (this.didScanCode) {\n // Secure Channel step 6 completed, we trust the channel\n\n if (this.isNewDevice) {\n // MSC4108-Flow: ExistingScanned - take homeserver from QR code which should already be set\n } else {\n // MSC4108-Flow: NewScanned -send protocols message\n let oidcClientConfig: OidcClientConfig | undefined;\n try {\n const { issuer } = await this.client!.getAuthIssuer();\n oidcClientConfig = await discoverAndValidateOIDCIssuerWellKnown(issuer);\n } catch (e) {\n logger.error(\"Failed to discover OIDC metadata\", e);\n }\n\n if (oidcClientConfig?.metadata.grant_types_supported.includes(DEVICE_CODE_SCOPE)) {\n await this.send<ProtocolsPayload>({\n type: PayloadType.Protocols,\n protocols: [\"device_authorization_grant\"],\n homeserver: this.client!.getDomain()!,\n });\n } else {\n await this.send<FailurePayload>({\n type: PayloadType.Failure,\n reason: MSC4108FailureReason.UnsupportedProtocol,\n });\n throw new RendezvousError(\n \"Device code grant unsupported\",\n MSC4108FailureReason.UnsupportedProtocol,\n );\n }\n }\n } else if (this.isNewDevice) {\n // MSC4108-Flow: ExistingScanned - wait for protocols message\n logger.info(\"Waiting for protocols message\");\n const payload = await this.receive<ProtocolsPayload>();\n\n if (payload?.type === PayloadType.Failure) {\n throw new RendezvousError(\"Failed\", payload.reason);\n }\n\n if (payload?.type !== PayloadType.Protocols) {\n await this.send<FailurePayload>({\n type: PayloadType.Failure,\n reason: MSC4108FailureReason.UnexpectedMessageReceived,\n });\n throw new RendezvousError(\n \"Unexpected message received\",\n MSC4108FailureReason.UnexpectedMessageReceived,\n );\n }\n\n return { serverName: payload.homeserver };\n } else {\n // MSC4108-Flow: NewScanned - nothing to do\n }\n return {};\n }\n\n /**\n * The second & third step in the OIDC QR login process.\n * To be called after `negotiateProtocols` for the existing device.\n * To be called after OIDC negotiation for the new device. (Currently unsupported)\n */\n public async deviceAuthorizationGrant(): Promise<{\n verificationUri?: string;\n userCode?: string;\n }> {\n if (this.isNewDevice) {\n throw new Error(\"New device flows around OIDC are not yet implemented\");\n } else {\n // The user needs to do step 7 for the out-of-band confirmation\n // but, first we receive the protocol chosen by the other device so that\n // the confirmation_uri is ready to go\n logger.info(\"Waiting for protocol message\");\n const payload = await this.receive<ProtocolPayload | DeviceAuthorizationGrantProtocolPayload>();\n\n if (payload?.type === PayloadType.Failure) {\n throw new RendezvousError(\"Failed\", payload.reason);\n }\n\n if (payload?.type !== PayloadType.Protocol) {\n await this.send<FailurePayload>({\n type: PayloadType.Failure,\n reason: MSC4108FailureReason.UnexpectedMessageReceived,\n });\n throw new RendezvousError(\n \"Unexpected message received\",\n MSC4108FailureReason.UnexpectedMessageReceived,\n );\n }\n\n if (isDeviceAuthorizationGrantProtocolPayload(payload)) {\n const { device_authorization_grant: dag, device_id: expectingNewDeviceId } = payload;\n const { verification_uri: verificationUri, verification_uri_complete: verificationUriComplete } = dag;\n\n let deviceAlreadyExists = true;\n try {\n await this.client?.getDevice(expectingNewDeviceId);\n } catch (err: MatrixError | unknown) {\n if (err instanceof MatrixError && err.httpStatus === 404) {\n deviceAlreadyExists = false;\n }\n }\n\n if (deviceAlreadyExists) {\n await this.send<FailurePayload>({\n type: PayloadType.Failure,\n reason: MSC4108FailureReason.DeviceAlreadyExists,\n });\n throw new RendezvousError(\n \"Specified device ID already exists\",\n MSC4108FailureReason.DeviceAlreadyExists,\n );\n }\n\n this.expectingNewDeviceId = expectingNewDeviceId;\n\n return { verificationUri: verificationUriComplete ?? verificationUri };\n }\n\n await this.send<FailurePayload>({\n type: PayloadType.Failure,\n reason: MSC4108FailureReason.UnsupportedProtocol,\n });\n throw new RendezvousError(\n \"Received a request for an unsupported protocol\",\n MSC4108FailureReason.UnsupportedProtocol,\n );\n }\n }\n\n /**\n * The fifth (and final) step in the OIDC QR login process.\n * To be called after the new device has completed authentication.\n */\n public async shareSecrets(): Promise<{ secrets?: Omit<SecretsPayload, \"type\"> }> {\n if (this.isNewDevice) {\n await this.send<SuccessPayload>({\n type: PayloadType.Success,\n });\n // then wait for secrets\n logger.info(\"Waiting for secrets message\");\n const payload = await this.receive<SecretsPayload>();\n if (payload?.type === PayloadType.Failure) {\n throw new RendezvousError(\"Failed\", payload.reason);\n }\n\n if (payload?.type !== PayloadType.Secrets) {\n await this.send<FailurePayload>({\n type: PayloadType.Failure,\n reason: MSC4108FailureReason.UnexpectedMessageReceived,\n });\n throw new RendezvousError(\n \"Unexpected message received\",\n MSC4108FailureReason.UnexpectedMessageReceived,\n );\n }\n return { secrets: payload };\n // then done?\n } else {\n if (!this.expectingNewDeviceId) {\n throw new Error(\"No new device ID expected\");\n }\n await this.send<AcceptedPayload>({\n type: PayloadType.ProtocolAccepted,\n });\n\n logger.info(\"Waiting for outcome message\");\n const payload = await this.receive<SuccessPayload | DeclinedPayload>();\n\n if (payload?.type === PayloadType.Failure) {\n throw new RendezvousError(\"Failed\", payload.reason);\n }\n\n if (payload?.type === PayloadType.Declined) {\n throw new RendezvousError(\"User declined\", ClientRendezvousFailureReason.UserDeclined);\n }\n\n if (payload?.type !== PayloadType.Success) {\n await this.send<FailurePayload>({\n type: PayloadType.Failure,\n reason: MSC4108FailureReason.UnexpectedMessageReceived,\n });\n throw new RendezvousError(\"Unexpected message\", MSC4108FailureReason.UnexpectedMessageReceived);\n }\n\n const timeout = Date.now() + 10000; // wait up to 10 seconds\n do {\n // is the device visible via the Homeserver?\n try {\n const device = await this.client?.getDevice(this.expectingNewDeviceId);\n\n if (device) {\n // if so, return the secrets\n const secretsBundle = await this.client!.getCrypto()!.exportSecretsBundle!();\n if (this.channel.cancelled) {\n throw new RendezvousError(\"User cancelled\", MSC4108FailureReason.UserCancelled);\n }\n // send secrets\n await this.send<SecretsPayload>({\n type: PayloadType.Secrets,\n ...secretsBundle,\n });\n return { secrets: secretsBundle };\n // let the other side close the rendezvous session\n }\n } catch (err: MatrixError | unknown) {\n if (err instanceof MatrixError && err.httpStatus === 404) {\n // not found, so keep waiting until timeout\n } else {\n throw err;\n }\n }\n await sleep(1000);\n } while (Date.now() < timeout);\n\n await this.send<FailurePayload>({\n type: PayloadType.Failure,\n reason: MSC4108FailureReason.DeviceNotFound,\n });\n throw new RendezvousError(\"New device not found\", MSC4108FailureReason.DeviceNotFound);\n }\n }\n\n private async receive<T extends MSC4108Payload>(): Promise<T | FailurePayload | undefined> {\n return (await this.channel.secureReceive()) as T | undefined;\n }\n\n private async send<T extends MSC4108Payload>(payload: T): Promise<void> {\n await this.channel.secureSend(payload);\n }\n\n /**\n * Decline the login on the existing device.\n */\n public async declineLoginOnExistingDevice(): Promise<void> {\n if (!this.isExistingDevice) {\n throw new Error(\"Can only decline login on existing device\");\n }\n await this.send<FailurePayload>({\n type: PayloadType.Failure,\n reason: MSC4108FailureReason.UserCancelled,\n });\n }\n\n /**\n * Cancels the rendezvous session.\n * @param reason the reason for the cancellation\n */\n public async cancel(reason: MSC4108FailureReason | ClientRendezvousFailureReason): Promise<void> {\n this.onFailure?.(reason);\n await this.channel.cancel(reason);\n }\n\n /**\n * Closes the rendezvous session.\n */\n public async close(): Promise<void> {\n await this.channel.close();\n }\n}\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,QAAQ,oCAAoC;AAE/D,SACIC,6BAA6B,EAC7BC,oBAAoB,EACpBC,eAAe,QAEZ,YAAY;AAEnB,SAASC,MAAM,QAAQ,cAAc;AAErC,SAASC,WAAW,QAAQ,sBAAsB;AAClD,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,iBAAiB,EAAEC,sCAAsC,QAA0B,kBAAkB;AAG9G;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CAAC;MACxB,MAAMkD,MAAI,CAACxF,OAAO,CAACuF,MAAM,CAACjD,MAAM,CAAC;IAAC;EACtC;;EAEA;AACJ;AACA;EACiBqD,KAAKA,CAAA,EAAkB;IAAA,IAAAC,MAAA;IAAA,OAAA9E,iBAAA;MAChC,MAAM8E,MAAI,CAAC5F,OAAO,CAAC2F,KAAK,CAAC,CAAC;IAAC;EAC/B;AACJ","ignoreList":[]}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { RendezvousCode, RendezvousIntent, RendezvousFailureReason } from "./index.ts";
|
2
|
+
export interface RendezvousChannel<T> {
|
3
|
+
/**
|
4
|
+
* @returns the checksum/confirmation digits to be shown to the user
|
5
|
+
*/
|
6
|
+
connect(): Promise<string>;
|
7
|
+
/**
|
8
|
+
* Send a payload via the channel.
|
9
|
+
* @param data - payload to send
|
10
|
+
*/
|
11
|
+
send(data: T): Promise<void>;
|
12
|
+
/**
|
13
|
+
* Receive a payload from the channel.
|
14
|
+
* @returns the received payload
|
15
|
+
*/
|
16
|
+
receive(): Promise<Partial<T> | undefined>;
|
17
|
+
/**
|
18
|
+
* Close the channel and clear up any resources.
|
19
|
+
*/
|
20
|
+
close(): Promise<void>;
|
21
|
+
/**
|
22
|
+
* @returns a representation of the channel that can be encoded in a QR or similar
|
23
|
+
*/
|
24
|
+
generateCode(intent: RendezvousIntent): Promise<RendezvousCode>;
|
25
|
+
cancel(reason: RendezvousFailureReason): Promise<void>;
|
26
|
+
}
|
27
|
+
//# sourceMappingURL=RendezvousChannel.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"RendezvousChannel.d.ts","sourceRoot":"","sources":["../../src/rendezvous/RendezvousChannel.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAEvF,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAChC;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3B;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7B;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAE3C;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAEhE,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1D"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"RendezvousChannel.js","names":[],"sources":["../../src/rendezvous/RendezvousChannel.ts"],"sourcesContent":["/*\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { RendezvousCode, RendezvousIntent, RendezvousFailureReason } from \"./index.ts\";\n\nexport interface RendezvousChannel<T> {\n /**\n * @returns the checksum/confirmation digits to be shown to the user\n */\n connect(): Promise<string>;\n\n /**\n * Send a payload via the channel.\n * @param data - payload to send\n */\n send(data: T): Promise<void>;\n\n /**\n * Receive a payload from the channel.\n * @returns the received payload\n */\n receive(): Promise<Partial<T> | undefined>;\n\n /**\n * Close the channel and clear up any resources.\n */\n close(): Promise<void>;\n\n /**\n * @returns a representation of the channel that can be encoded in a QR or similar\n */\n generateCode(intent: RendezvousIntent): Promise<RendezvousCode>;\n\n cancel(reason: RendezvousFailureReason): Promise<void>;\n}\n"],"mappings":"","ignoreList":[]}
|