@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,903 @@
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
|
+
/*
|
4
|
+
Copyright 2022 The Matrix.org Foundation C.I.C.
|
5
|
+
|
6
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
you may not use this file except in compliance with the License.
|
8
|
+
You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing, software
|
13
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
See the License for the specific language governing permissions and
|
16
|
+
limitations under the License.
|
17
|
+
*/
|
18
|
+
|
19
|
+
import { NotificationCountType, Room, RoomEvent } from "./models/room.js";
|
20
|
+
import { logger } from "./logger.js";
|
21
|
+
import { promiseMapSeries } from "./utils.js";
|
22
|
+
import { EventTimeline } from "./models/event-timeline.js";
|
23
|
+
import { ClientEvent } from "./client.js";
|
24
|
+
import { SyncState, _createAndReEmitRoom, defaultClientOpts, defaultSyncApiOpts } from "./sync.js";
|
25
|
+
import { MatrixError } from "./http-api/index.js";
|
26
|
+
import { ExtensionState, SlidingSyncEvent, SlidingSyncState } from "./sliding-sync.js";
|
27
|
+
import { EventType } from "./@types/event.js";
|
28
|
+
import { RoomStateEvent } from "./models/room-state.js";
|
29
|
+
import { RoomMemberEvent } from "./models/room-member.js";
|
30
|
+
import { KnownMembership } from "./@types/membership.js";
|
31
|
+
|
32
|
+
// Number of consecutive failed syncs that will lead to a syncState of ERROR as opposed
|
33
|
+
// to RECONNECTING. This is needed to inform the client of server issues when the
|
34
|
+
// keepAlive is successful but the server /sync fails.
|
35
|
+
var FAILED_SYNC_ERROR_THRESHOLD = 3;
|
36
|
+
class ExtensionE2EE {
|
37
|
+
constructor(crypto) {
|
38
|
+
this.crypto = crypto;
|
39
|
+
}
|
40
|
+
name() {
|
41
|
+
return "e2ee";
|
42
|
+
}
|
43
|
+
when() {
|
44
|
+
return ExtensionState.PreProcess;
|
45
|
+
}
|
46
|
+
onRequest(isInitial) {
|
47
|
+
if (!isInitial) {
|
48
|
+
return undefined;
|
49
|
+
}
|
50
|
+
return {
|
51
|
+
enabled: true // this is sticky so only send it on the initial request
|
52
|
+
};
|
53
|
+
}
|
54
|
+
onResponse(data) {
|
55
|
+
var _this = this;
|
56
|
+
return _asyncToGenerator(function* () {
|
57
|
+
// Handle device list updates
|
58
|
+
if (data.device_lists) {
|
59
|
+
yield _this.crypto.processDeviceLists(data.device_lists);
|
60
|
+
}
|
61
|
+
|
62
|
+
// Handle one_time_keys_count and unused_fallback_key_types
|
63
|
+
yield _this.crypto.processKeyCounts(data.device_one_time_keys_count, data["device_unused_fallback_key_types"] || data["org.matrix.msc2732.device_unused_fallback_key_types"]);
|
64
|
+
_this.crypto.onSyncCompleted({});
|
65
|
+
})();
|
66
|
+
}
|
67
|
+
}
|
68
|
+
class ExtensionToDevice {
|
69
|
+
constructor(client, cryptoCallbacks) {
|
70
|
+
this.client = client;
|
71
|
+
this.cryptoCallbacks = cryptoCallbacks;
|
72
|
+
_defineProperty(this, "nextBatch", null);
|
73
|
+
}
|
74
|
+
name() {
|
75
|
+
return "to_device";
|
76
|
+
}
|
77
|
+
when() {
|
78
|
+
return ExtensionState.PreProcess;
|
79
|
+
}
|
80
|
+
onRequest(isInitial) {
|
81
|
+
var extReq = {
|
82
|
+
since: this.nextBatch !== null ? this.nextBatch : undefined
|
83
|
+
};
|
84
|
+
if (isInitial) {
|
85
|
+
extReq["limit"] = 100;
|
86
|
+
extReq["enabled"] = true;
|
87
|
+
}
|
88
|
+
return extReq;
|
89
|
+
}
|
90
|
+
onResponse(data) {
|
91
|
+
var _this2 = this;
|
92
|
+
return _asyncToGenerator(function* () {
|
93
|
+
var cancelledKeyVerificationTxns = [];
|
94
|
+
var events = data["events"] || [];
|
95
|
+
if (events.length > 0 && _this2.cryptoCallbacks) {
|
96
|
+
events = yield _this2.cryptoCallbacks.preprocessToDeviceMessages(events);
|
97
|
+
}
|
98
|
+
events.map(_this2.client.getEventMapper()).map(toDeviceEvent => {
|
99
|
+
// map is a cheap inline forEach
|
100
|
+
// We want to flag m.key.verification.start events as cancelled
|
101
|
+
// if there's an accompanying m.key.verification.cancel event, so
|
102
|
+
// we pull out the transaction IDs from the cancellation events
|
103
|
+
// so we can flag the verification events as cancelled in the loop
|
104
|
+
// below.
|
105
|
+
if (toDeviceEvent.getType() === "m.key.verification.cancel") {
|
106
|
+
var txnId = toDeviceEvent.getContent()["transaction_id"];
|
107
|
+
if (txnId) {
|
108
|
+
cancelledKeyVerificationTxns.push(txnId);
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
// as mentioned above, .map is a cheap inline forEach, so return
|
113
|
+
// the unmodified event.
|
114
|
+
return toDeviceEvent;
|
115
|
+
}).forEach(toDeviceEvent => {
|
116
|
+
var content = toDeviceEvent.getContent();
|
117
|
+
if (toDeviceEvent.getType() == "m.room.message" && content.msgtype == "m.bad.encrypted") {
|
118
|
+
// the mapper already logged a warning.
|
119
|
+
logger.log("Ignoring undecryptable to-device event from " + toDeviceEvent.getSender());
|
120
|
+
return;
|
121
|
+
}
|
122
|
+
if (toDeviceEvent.getType() === "m.key.verification.start" || toDeviceEvent.getType() === "m.key.verification.request") {
|
123
|
+
var txnId = content["transaction_id"];
|
124
|
+
if (cancelledKeyVerificationTxns.includes(txnId)) {
|
125
|
+
toDeviceEvent.flagCancelled();
|
126
|
+
}
|
127
|
+
}
|
128
|
+
_this2.client.emit(ClientEvent.ToDeviceEvent, toDeviceEvent);
|
129
|
+
});
|
130
|
+
_this2.nextBatch = data.next_batch;
|
131
|
+
})();
|
132
|
+
}
|
133
|
+
}
|
134
|
+
class ExtensionAccountData {
|
135
|
+
constructor(client) {
|
136
|
+
this.client = client;
|
137
|
+
}
|
138
|
+
name() {
|
139
|
+
return "account_data";
|
140
|
+
}
|
141
|
+
when() {
|
142
|
+
return ExtensionState.PostProcess;
|
143
|
+
}
|
144
|
+
onRequest(isInitial) {
|
145
|
+
if (!isInitial) {
|
146
|
+
return undefined;
|
147
|
+
}
|
148
|
+
return {
|
149
|
+
enabled: true
|
150
|
+
};
|
151
|
+
}
|
152
|
+
onResponse(data) {
|
153
|
+
var _this3 = this;
|
154
|
+
return _asyncToGenerator(function* () {
|
155
|
+
if (data.global && data.global.length > 0) {
|
156
|
+
_this3.processGlobalAccountData(data.global);
|
157
|
+
}
|
158
|
+
for (var roomId in data.rooms) {
|
159
|
+
var accountDataEvents = mapEvents(_this3.client, roomId, data.rooms[roomId]);
|
160
|
+
var room = _this3.client.getRoom(roomId);
|
161
|
+
if (!room) {
|
162
|
+
logger.warn("got account data for room but room doesn't exist on client:", roomId);
|
163
|
+
continue;
|
164
|
+
}
|
165
|
+
room.addAccountData(accountDataEvents);
|
166
|
+
accountDataEvents.forEach(e => {
|
167
|
+
_this3.client.emit(ClientEvent.Event, e);
|
168
|
+
});
|
169
|
+
}
|
170
|
+
})();
|
171
|
+
}
|
172
|
+
processGlobalAccountData(globalAccountData) {
|
173
|
+
var events = mapEvents(this.client, undefined, globalAccountData);
|
174
|
+
var prevEventsMap = events.reduce((m, c) => {
|
175
|
+
m[c.getType()] = this.client.store.getAccountData(c.getType());
|
176
|
+
return m;
|
177
|
+
}, {});
|
178
|
+
this.client.store.storeAccountDataEvents(events);
|
179
|
+
events.forEach(accountDataEvent => {
|
180
|
+
// Honour push rules that come down the sync stream but also
|
181
|
+
// honour push rules that were previously cached. Base rules
|
182
|
+
// will be updated when we receive push rules via getPushRules
|
183
|
+
// (see sync) before syncing over the network.
|
184
|
+
if (accountDataEvent.getType() === EventType.PushRules) {
|
185
|
+
var rules = accountDataEvent.getContent();
|
186
|
+
this.client.setPushRules(rules);
|
187
|
+
}
|
188
|
+
var prevEvent = prevEventsMap[accountDataEvent.getType()];
|
189
|
+
this.client.emit(ClientEvent.AccountData, accountDataEvent, prevEvent);
|
190
|
+
return accountDataEvent;
|
191
|
+
});
|
192
|
+
}
|
193
|
+
}
|
194
|
+
class ExtensionTyping {
|
195
|
+
constructor(client) {
|
196
|
+
this.client = client;
|
197
|
+
}
|
198
|
+
name() {
|
199
|
+
return "typing";
|
200
|
+
}
|
201
|
+
when() {
|
202
|
+
return ExtensionState.PostProcess;
|
203
|
+
}
|
204
|
+
onRequest(isInitial) {
|
205
|
+
if (!isInitial) {
|
206
|
+
return undefined; // don't send a JSON object for subsequent requests, we don't need to.
|
207
|
+
}
|
208
|
+
return {
|
209
|
+
enabled: true
|
210
|
+
};
|
211
|
+
}
|
212
|
+
onResponse(data) {
|
213
|
+
var _this4 = this;
|
214
|
+
return _asyncToGenerator(function* () {
|
215
|
+
if (!(data !== null && data !== void 0 && data.rooms)) {
|
216
|
+
return;
|
217
|
+
}
|
218
|
+
for (var roomId in data.rooms) {
|
219
|
+
processEphemeralEvents(_this4.client, roomId, [data.rooms[roomId]]);
|
220
|
+
}
|
221
|
+
})();
|
222
|
+
}
|
223
|
+
}
|
224
|
+
class ExtensionReceipts {
|
225
|
+
constructor(client) {
|
226
|
+
this.client = client;
|
227
|
+
}
|
228
|
+
name() {
|
229
|
+
return "receipts";
|
230
|
+
}
|
231
|
+
when() {
|
232
|
+
return ExtensionState.PostProcess;
|
233
|
+
}
|
234
|
+
onRequest(isInitial) {
|
235
|
+
if (isInitial) {
|
236
|
+
return {
|
237
|
+
enabled: true
|
238
|
+
};
|
239
|
+
}
|
240
|
+
return undefined; // don't send a JSON object for subsequent requests, we don't need to.
|
241
|
+
}
|
242
|
+
onResponse(data) {
|
243
|
+
var _this5 = this;
|
244
|
+
return _asyncToGenerator(function* () {
|
245
|
+
if (!(data !== null && data !== void 0 && data.rooms)) {
|
246
|
+
return;
|
247
|
+
}
|
248
|
+
for (var roomId in data.rooms) {
|
249
|
+
processEphemeralEvents(_this5.client, roomId, [data.rooms[roomId]]);
|
250
|
+
}
|
251
|
+
})();
|
252
|
+
}
|
253
|
+
}
|
254
|
+
|
255
|
+
/**
|
256
|
+
* A copy of SyncApi such that it can be used as a drop-in replacement for sync v2. For the actual
|
257
|
+
* sliding sync API, see sliding-sync.ts or the class SlidingSync.
|
258
|
+
*/
|
259
|
+
export class SlidingSyncSdk {
|
260
|
+
// accumulator of sync events in the current sync response
|
261
|
+
|
262
|
+
constructor(slidingSync, client, opts, syncOpts) {
|
263
|
+
this.slidingSync = slidingSync;
|
264
|
+
this.client = client;
|
265
|
+
_defineProperty(this, "opts", void 0);
|
266
|
+
_defineProperty(this, "syncOpts", void 0);
|
267
|
+
_defineProperty(this, "syncState", null);
|
268
|
+
_defineProperty(this, "syncStateData", void 0);
|
269
|
+
_defineProperty(this, "lastPos", null);
|
270
|
+
_defineProperty(this, "failCount", 0);
|
271
|
+
_defineProperty(this, "notifEvents", []);
|
272
|
+
this.opts = defaultClientOpts(opts);
|
273
|
+
this.syncOpts = defaultSyncApiOpts(syncOpts);
|
274
|
+
if (client.getNotifTimelineSet()) {
|
275
|
+
client.reEmitter.reEmit(client.getNotifTimelineSet(), [RoomEvent.Timeline, RoomEvent.TimelineReset]);
|
276
|
+
}
|
277
|
+
this.slidingSync.on(SlidingSyncEvent.Lifecycle, this.onLifecycle.bind(this));
|
278
|
+
this.slidingSync.on(SlidingSyncEvent.RoomData, this.onRoomData.bind(this));
|
279
|
+
var extensions = [new ExtensionToDevice(this.client, this.syncOpts.cryptoCallbacks), new ExtensionAccountData(this.client), new ExtensionTyping(this.client), new ExtensionReceipts(this.client)];
|
280
|
+
if (this.syncOpts.crypto) {
|
281
|
+
extensions.push(new ExtensionE2EE(this.syncOpts.crypto));
|
282
|
+
}
|
283
|
+
extensions.forEach(ext => {
|
284
|
+
this.slidingSync.registerExtension(ext);
|
285
|
+
});
|
286
|
+
}
|
287
|
+
onRoomData(roomId, roomData) {
|
288
|
+
var _this6 = this;
|
289
|
+
return _asyncToGenerator(function* () {
|
290
|
+
var room = _this6.client.store.getRoom(roomId);
|
291
|
+
if (!room) {
|
292
|
+
if (!roomData.initial) {
|
293
|
+
logger.debug("initial flag not set but no stored room exists for room ", roomId, roomData);
|
294
|
+
return;
|
295
|
+
}
|
296
|
+
room = _createAndReEmitRoom(_this6.client, roomId, _this6.opts);
|
297
|
+
}
|
298
|
+
yield _this6.processRoomData(_this6.client, room, roomData);
|
299
|
+
})();
|
300
|
+
}
|
301
|
+
onLifecycle(state, resp, err) {
|
302
|
+
if (err) {
|
303
|
+
logger.debug("onLifecycle", state, err);
|
304
|
+
}
|
305
|
+
switch (state) {
|
306
|
+
case SlidingSyncState.Complete:
|
307
|
+
this.purgeNotifications();
|
308
|
+
if (!resp) {
|
309
|
+
break;
|
310
|
+
}
|
311
|
+
// Element won't stop showing the initial loading spinner unless we fire SyncState.Prepared
|
312
|
+
if (!this.lastPos) {
|
313
|
+
this.updateSyncState(SyncState.Prepared, {
|
314
|
+
oldSyncToken: undefined,
|
315
|
+
nextSyncToken: resp.pos,
|
316
|
+
catchingUp: false,
|
317
|
+
fromCache: false
|
318
|
+
});
|
319
|
+
}
|
320
|
+
// Conversely, Element won't show the room list unless there is at least 1x SyncState.Syncing
|
321
|
+
// so hence for the very first sync we will fire prepared then immediately syncing.
|
322
|
+
this.updateSyncState(SyncState.Syncing, {
|
323
|
+
oldSyncToken: this.lastPos,
|
324
|
+
nextSyncToken: resp.pos,
|
325
|
+
catchingUp: false,
|
326
|
+
fromCache: false
|
327
|
+
});
|
328
|
+
this.lastPos = resp.pos;
|
329
|
+
break;
|
330
|
+
case SlidingSyncState.RequestFinished:
|
331
|
+
if (err) {
|
332
|
+
this.failCount += 1;
|
333
|
+
this.updateSyncState(this.failCount > FAILED_SYNC_ERROR_THRESHOLD ? SyncState.Error : SyncState.Reconnecting, {
|
334
|
+
error: new MatrixError(err)
|
335
|
+
});
|
336
|
+
if (this.shouldAbortSync(new MatrixError(err))) {
|
337
|
+
return; // shouldAbortSync actually stops syncing too so we don't need to do anything.
|
338
|
+
}
|
339
|
+
} else {
|
340
|
+
this.failCount = 0;
|
341
|
+
}
|
342
|
+
break;
|
343
|
+
}
|
344
|
+
}
|
345
|
+
|
346
|
+
/**
|
347
|
+
* Sync rooms the user has left.
|
348
|
+
* @returns Resolved when they've been added to the store.
|
349
|
+
*/
|
350
|
+
syncLeftRooms() {
|
351
|
+
return _asyncToGenerator(function* () {
|
352
|
+
return []; // TODO
|
353
|
+
})();
|
354
|
+
}
|
355
|
+
|
356
|
+
/**
|
357
|
+
* Peek into a room. This will result in the room in question being synced so it
|
358
|
+
* is accessible via getRooms(). Live updates for the room will be provided.
|
359
|
+
* @param roomId - The room ID to peek into.
|
360
|
+
* @returns A promise which resolves once the room has been added to the
|
361
|
+
* store.
|
362
|
+
*/
|
363
|
+
peek(roomId) {
|
364
|
+
return _asyncToGenerator(function* () {
|
365
|
+
return null; // TODO
|
366
|
+
})();
|
367
|
+
}
|
368
|
+
|
369
|
+
/**
|
370
|
+
* Stop polling for updates in the peeked room. NOPs if there is no room being
|
371
|
+
* peeked.
|
372
|
+
*/
|
373
|
+
stopPeeking() {
|
374
|
+
// TODO
|
375
|
+
}
|
376
|
+
|
377
|
+
/**
|
378
|
+
* Specify the set_presence value to be used for subsequent calls to the Sync API.
|
379
|
+
* @param presence - the presence to specify to set_presence of sync calls
|
380
|
+
*/
|
381
|
+
setPresence(presence) {
|
382
|
+
// TODO not possible in sliding sync yet
|
383
|
+
}
|
384
|
+
|
385
|
+
/**
|
386
|
+
* Returns the current state of this sync object
|
387
|
+
* @see MatrixClient#event:"sync"
|
388
|
+
*/
|
389
|
+
getSyncState() {
|
390
|
+
return this.syncState;
|
391
|
+
}
|
392
|
+
|
393
|
+
/**
|
394
|
+
* Returns the additional data object associated with
|
395
|
+
* the current sync state, or null if there is no
|
396
|
+
* such data.
|
397
|
+
* Sync errors, if available, are put in the 'error' key of
|
398
|
+
* this object.
|
399
|
+
*/
|
400
|
+
getSyncStateData() {
|
401
|
+
var _this$syncStateData;
|
402
|
+
return (_this$syncStateData = this.syncStateData) !== null && _this$syncStateData !== void 0 ? _this$syncStateData : null;
|
403
|
+
}
|
404
|
+
|
405
|
+
// Helper functions which set up JS SDK structs are below and are identical to the sync v2 counterparts
|
406
|
+
|
407
|
+
createRoom(roomId) {
|
408
|
+
// XXX cargoculted from sync.ts
|
409
|
+
var {
|
410
|
+
timelineSupport
|
411
|
+
} = this.client;
|
412
|
+
var room = new Room(roomId, this.client, this.client.getUserId(), {
|
413
|
+
lazyLoadMembers: this.opts.lazyLoadMembers,
|
414
|
+
pendingEventOrdering: this.opts.pendingEventOrdering,
|
415
|
+
timelineSupport
|
416
|
+
});
|
417
|
+
this.client.reEmitter.reEmit(room, [RoomEvent.Name, RoomEvent.Redaction, RoomEvent.RedactionCancelled, RoomEvent.Receipt, RoomEvent.Tags, RoomEvent.LocalEchoUpdated, RoomEvent.AccountData, RoomEvent.MyMembership, RoomEvent.Timeline, RoomEvent.TimelineReset]);
|
418
|
+
this.registerStateListeners(room);
|
419
|
+
return room;
|
420
|
+
}
|
421
|
+
registerStateListeners(room) {
|
422
|
+
// XXX cargoculted from sync.ts
|
423
|
+
// we need to also re-emit room state and room member events, so hook it up
|
424
|
+
// to the client now. We need to add a listener for RoomState.members in
|
425
|
+
// order to hook them correctly.
|
426
|
+
this.client.reEmitter.reEmit(room.currentState, [RoomStateEvent.Events, RoomStateEvent.Members, RoomStateEvent.NewMember, RoomStateEvent.Update]);
|
427
|
+
room.currentState.on(RoomStateEvent.NewMember, (event, state, member) => {
|
428
|
+
var _this$client$getUser;
|
429
|
+
member.user = (_this$client$getUser = this.client.getUser(member.userId)) !== null && _this$client$getUser !== void 0 ? _this$client$getUser : undefined;
|
430
|
+
this.client.reEmitter.reEmit(member, [RoomMemberEvent.Name, RoomMemberEvent.Typing, RoomMemberEvent.PowerLevel, RoomMemberEvent.Membership]);
|
431
|
+
});
|
432
|
+
}
|
433
|
+
|
434
|
+
/*
|
435
|
+
private deregisterStateListeners(room: Room): void { // XXX cargoculted from sync.ts
|
436
|
+
// could do with a better way of achieving this.
|
437
|
+
room.currentState.removeAllListeners(RoomStateEvent.Events);
|
438
|
+
room.currentState.removeAllListeners(RoomStateEvent.Members);
|
439
|
+
room.currentState.removeAllListeners(RoomStateEvent.NewMember);
|
440
|
+
} */
|
441
|
+
|
442
|
+
shouldAbortSync(error) {
|
443
|
+
if (error.errcode === "M_UNKNOWN_TOKEN") {
|
444
|
+
// The logout already happened, we just need to stop.
|
445
|
+
logger.warn("Token no longer valid - assuming logout");
|
446
|
+
this.stop();
|
447
|
+
this.updateSyncState(SyncState.Error, {
|
448
|
+
error
|
449
|
+
});
|
450
|
+
return true;
|
451
|
+
}
|
452
|
+
return false;
|
453
|
+
}
|
454
|
+
processRoomData(client, room, roomData) {
|
455
|
+
var _this7 = this;
|
456
|
+
return _asyncToGenerator(function* () {
|
457
|
+
roomData = ensureNameEvent(client, room.roomId, roomData);
|
458
|
+
var stateEvents = mapEvents(_this7.client, room.roomId, roomData.required_state);
|
459
|
+
// Prevent events from being decrypted ahead of time
|
460
|
+
// this helps large account to speed up faster
|
461
|
+
// room::decryptCriticalEvent is in charge of decrypting all the events
|
462
|
+
// required for a client to function properly
|
463
|
+
var timelineEvents = mapEvents(_this7.client, room.roomId, roomData.timeline, false);
|
464
|
+
var ephemeralEvents = []; // TODO this.mapSyncEventsFormat(joinObj.ephemeral);
|
465
|
+
|
466
|
+
// TODO: handle threaded / beacon events
|
467
|
+
|
468
|
+
if (roomData.initial) {
|
469
|
+
// we should not know about any of these timeline entries if this is a genuinely new room.
|
470
|
+
// If we do, then we've effectively done scrollback (e.g requesting timeline_limit: 1 for
|
471
|
+
// this room, then timeline_limit: 50).
|
472
|
+
var knownEvents = new Set();
|
473
|
+
room.getLiveTimeline().getEvents().forEach(e => {
|
474
|
+
knownEvents.add(e.getId());
|
475
|
+
});
|
476
|
+
// all unknown events BEFORE a known event must be scrollback e.g:
|
477
|
+
// D E <-- what we know
|
478
|
+
// A B C D E F <-- what we just received
|
479
|
+
// means:
|
480
|
+
// A B C <-- scrollback
|
481
|
+
// D E <-- dupes
|
482
|
+
// F <-- new event
|
483
|
+
// We bucket events based on if we have seen a known event yet.
|
484
|
+
var oldEvents = [];
|
485
|
+
var newEvents = [];
|
486
|
+
var seenKnownEvent = false;
|
487
|
+
for (var i = timelineEvents.length - 1; i >= 0; i--) {
|
488
|
+
var recvEvent = timelineEvents[i];
|
489
|
+
if (knownEvents.has(recvEvent.getId())) {
|
490
|
+
seenKnownEvent = true;
|
491
|
+
continue; // don't include this event, it's a dupe
|
492
|
+
}
|
493
|
+
if (seenKnownEvent) {
|
494
|
+
// old -> new
|
495
|
+
oldEvents.push(recvEvent);
|
496
|
+
} else {
|
497
|
+
// old -> new
|
498
|
+
newEvents.unshift(recvEvent);
|
499
|
+
}
|
500
|
+
}
|
501
|
+
timelineEvents = newEvents;
|
502
|
+
if (oldEvents.length > 0) {
|
503
|
+
// old events are scrollback, insert them now
|
504
|
+
room.addEventsToTimeline(oldEvents, true, room.getLiveTimeline(), roomData.prev_batch);
|
505
|
+
}
|
506
|
+
}
|
507
|
+
var encrypted = room.hasEncryptionStateEvent();
|
508
|
+
// we do this first so it's correct when any of the events fire
|
509
|
+
if (roomData.notification_count != null) {
|
510
|
+
room.setUnreadNotificationCount(NotificationCountType.Total, roomData.notification_count);
|
511
|
+
}
|
512
|
+
if (roomData.highlight_count != null) {
|
513
|
+
// We track unread notifications ourselves in encrypted rooms, so don't
|
514
|
+
// bother setting it here. We trust our calculations better than the
|
515
|
+
// server's for this case, and therefore will assume that our non-zero
|
516
|
+
// count is accurate.
|
517
|
+
if (!encrypted || encrypted && room.getUnreadNotificationCount(NotificationCountType.Highlight) <= 0) {
|
518
|
+
room.setUnreadNotificationCount(NotificationCountType.Highlight, roomData.highlight_count);
|
519
|
+
}
|
520
|
+
}
|
521
|
+
if (Number.isInteger(roomData.invited_count)) {
|
522
|
+
room.currentState.setInvitedMemberCount(roomData.invited_count);
|
523
|
+
}
|
524
|
+
if (Number.isInteger(roomData.joined_count)) {
|
525
|
+
room.currentState.setJoinedMemberCount(roomData.joined_count);
|
526
|
+
}
|
527
|
+
if (roomData.invite_state) {
|
528
|
+
var inviteStateEvents = mapEvents(_this7.client, room.roomId, roomData.invite_state);
|
529
|
+
yield _this7.injectRoomEvents(room, inviteStateEvents);
|
530
|
+
if (roomData.initial) {
|
531
|
+
room.recalculate();
|
532
|
+
_this7.client.store.storeRoom(room);
|
533
|
+
_this7.client.emit(ClientEvent.Room, room);
|
534
|
+
}
|
535
|
+
inviteStateEvents.forEach(e => {
|
536
|
+
_this7.client.emit(ClientEvent.Event, e);
|
537
|
+
});
|
538
|
+
room.updateMyMembership(KnownMembership.Invite);
|
539
|
+
return;
|
540
|
+
}
|
541
|
+
if (roomData.initial) {
|
542
|
+
var _roomData$prev_batch;
|
543
|
+
// set the back-pagination token. Do this *before* adding any
|
544
|
+
// events so that clients can start back-paginating.
|
545
|
+
room.getLiveTimeline().setPaginationToken((_roomData$prev_batch = roomData.prev_batch) !== null && _roomData$prev_batch !== void 0 ? _roomData$prev_batch : null, EventTimeline.BACKWARDS);
|
546
|
+
}
|
547
|
+
|
548
|
+
/* TODO
|
549
|
+
else if (roomData.limited) {
|
550
|
+
let limited = true;
|
551
|
+
// we've got a limited sync, so we *probably* have a gap in the
|
552
|
+
// timeline, so should reset. But we might have been peeking or
|
553
|
+
// paginating and already have some of the events, in which
|
554
|
+
// case we just want to append any subsequent events to the end
|
555
|
+
// of the existing timeline.
|
556
|
+
//
|
557
|
+
// This is particularly important in the case that we already have
|
558
|
+
// *all* of the events in the timeline - in that case, if we reset
|
559
|
+
// the timeline, we'll end up with an entirely empty timeline,
|
560
|
+
// which we'll try to paginate but not get any new events (which
|
561
|
+
// will stop us linking the empty timeline into the chain).
|
562
|
+
//
|
563
|
+
for (let i = timelineEvents.length - 1; i >= 0; i--) {
|
564
|
+
const eventId = timelineEvents[i].getId();
|
565
|
+
if (room.getTimelineForEvent(eventId)) {
|
566
|
+
logger.debug("Already have event " + eventId + " in limited " +
|
567
|
+
"sync - not resetting");
|
568
|
+
limited = false;
|
569
|
+
// we might still be missing some of the events before i;
|
570
|
+
// we don't want to be adding them to the end of the
|
571
|
+
// timeline because that would put them out of order.
|
572
|
+
timelineEvents.splice(0, i);
|
573
|
+
// XXX: there's a problem here if the skipped part of the
|
574
|
+
// timeline modifies the state set in stateEvents, because
|
575
|
+
// we'll end up using the state from stateEvents rather
|
576
|
+
// than the later state from timelineEvents. We probably
|
577
|
+
// need to wind stateEvents forward over the events we're
|
578
|
+
// skipping.
|
579
|
+
break;
|
580
|
+
}
|
581
|
+
}
|
582
|
+
if (limited) {
|
583
|
+
room.resetLiveTimeline(
|
584
|
+
roomData.prev_batch,
|
585
|
+
null, // TODO this.syncOpts.canResetEntireTimeline(room.roomId) ? null : syncEventData.oldSyncToken,
|
586
|
+
);
|
587
|
+
// We have to assume any gap in any timeline is
|
588
|
+
// reason to stop incrementally tracking notifications and
|
589
|
+
// reset the timeline.
|
590
|
+
this.client.resetNotifTimelineSet();
|
591
|
+
this.registerStateListeners(room);
|
592
|
+
}
|
593
|
+
} */
|
594
|
+
|
595
|
+
yield _this7.injectRoomEvents(room, stateEvents, timelineEvents, roomData.num_live);
|
596
|
+
|
597
|
+
// we deliberately don't add ephemeral events to the timeline
|
598
|
+
room.addEphemeralEvents(ephemeralEvents);
|
599
|
+
|
600
|
+
// local fields must be set before any async calls because call site assumes
|
601
|
+
// synchronous execution prior to emitting SlidingSyncState.Complete
|
602
|
+
room.updateMyMembership(KnownMembership.Join);
|
603
|
+
room.recalculate();
|
604
|
+
if (roomData.initial) {
|
605
|
+
client.store.storeRoom(room);
|
606
|
+
client.emit(ClientEvent.Room, room);
|
607
|
+
}
|
608
|
+
|
609
|
+
// check if any timeline events should bing and add them to the notifEvents array:
|
610
|
+
// we'll purge this once we've fully processed the sync response
|
611
|
+
_this7.addNotifications(timelineEvents);
|
612
|
+
var processRoomEvent = /*#__PURE__*/function () {
|
613
|
+
var _ref = _asyncToGenerator(function* (e) {
|
614
|
+
client.emit(ClientEvent.Event, e);
|
615
|
+
if (e.isState() && e.getType() == EventType.RoomEncryption && _this7.syncOpts.cryptoCallbacks) {
|
616
|
+
yield _this7.syncOpts.cryptoCallbacks.onCryptoEvent(room, e);
|
617
|
+
}
|
618
|
+
});
|
619
|
+
return function processRoomEvent(_x) {
|
620
|
+
return _ref.apply(this, arguments);
|
621
|
+
};
|
622
|
+
}();
|
623
|
+
yield promiseMapSeries(stateEvents, processRoomEvent);
|
624
|
+
yield promiseMapSeries(timelineEvents, processRoomEvent);
|
625
|
+
ephemeralEvents.forEach(function (e) {
|
626
|
+
client.emit(ClientEvent.Event, e);
|
627
|
+
});
|
628
|
+
|
629
|
+
// Decrypt only the last message in all rooms to make sure we can generate a preview
|
630
|
+
// And decrypt all events after the recorded read receipt to ensure an accurate
|
631
|
+
// notification count
|
632
|
+
room.decryptCriticalEvents();
|
633
|
+
})();
|
634
|
+
}
|
635
|
+
|
636
|
+
/**
|
637
|
+
* Injects events into a room's model.
|
638
|
+
* @param stateEventList - A list of state events. This is the state
|
639
|
+
* at the *START* of the timeline list if it is supplied.
|
640
|
+
* @param timelineEventList - A list of timeline events. Lower index
|
641
|
+
* is earlier in time. Higher index is later.
|
642
|
+
* @param numLive - the number of events in timelineEventList which just happened,
|
643
|
+
* supplied from the server.
|
644
|
+
*/
|
645
|
+
injectRoomEvents(room, stateEventList, timelineEventList, numLive) {
|
646
|
+
var _this8 = this;
|
647
|
+
return _asyncToGenerator(function* () {
|
648
|
+
timelineEventList = timelineEventList || [];
|
649
|
+
stateEventList = stateEventList || [];
|
650
|
+
numLive = numLive || 0;
|
651
|
+
|
652
|
+
// If there are no events in the timeline yet, initialise it with
|
653
|
+
// the given state events
|
654
|
+
var liveTimeline = room.getLiveTimeline();
|
655
|
+
var timelineWasEmpty = liveTimeline.getEvents().length == 0;
|
656
|
+
if (timelineWasEmpty) {
|
657
|
+
// Passing these events into initialiseState will freeze them, so we need
|
658
|
+
// to compute and cache the push actions for them now, otherwise sync dies
|
659
|
+
// with an attempt to assign to read only property.
|
660
|
+
// XXX: This is pretty horrible and is assuming all sorts of behaviour from
|
661
|
+
// these functions that it shouldn't be. We should probably either store the
|
662
|
+
// push actions cache elsewhere so we can freeze MatrixEvents, or otherwise
|
663
|
+
// find some solution where MatrixEvents are immutable but allow for a cache
|
664
|
+
// field.
|
665
|
+
for (var ev of stateEventList) {
|
666
|
+
_this8.client.getPushActionsForEvent(ev);
|
667
|
+
}
|
668
|
+
liveTimeline.initialiseState(stateEventList);
|
669
|
+
}
|
670
|
+
|
671
|
+
// If the timeline wasn't empty, we process the state events here: they're
|
672
|
+
// defined as updates to the state before the start of the timeline, so this
|
673
|
+
// starts to roll the state forward.
|
674
|
+
// XXX: That's what we *should* do, but this can happen if we were previously
|
675
|
+
// peeking in a room, in which case we obviously do *not* want to add the
|
676
|
+
// state events here onto the end of the timeline. Historically, the js-sdk
|
677
|
+
// has just set these new state events on the old and new state. This seems
|
678
|
+
// very wrong because there could be events in the timeline that diverge the
|
679
|
+
// state, in which case this is going to leave things out of sync. However,
|
680
|
+
// for now I think it;s best to behave the same as the code has done previously.
|
681
|
+
if (!timelineWasEmpty) {
|
682
|
+
// XXX: As above, don't do this...
|
683
|
+
//room.addLiveEvents(stateEventList || []);
|
684
|
+
// Do this instead...
|
685
|
+
room.oldState.setStateEvents(stateEventList);
|
686
|
+
room.currentState.setStateEvents(stateEventList);
|
687
|
+
}
|
688
|
+
|
689
|
+
// the timeline is broken into 'live' events which just happened and normal timeline events
|
690
|
+
// which are still to be appended to the end of the live timeline but happened a while ago.
|
691
|
+
// The live events are marked as fromCache=false to ensure that downstream components know
|
692
|
+
// this is a live event, not historical (from a remote server cache).
|
693
|
+
|
694
|
+
var liveTimelineEvents = [];
|
695
|
+
if (numLive > 0) {
|
696
|
+
// last numLive events are live
|
697
|
+
liveTimelineEvents = timelineEventList.slice(-1 * numLive);
|
698
|
+
// everything else is not live
|
699
|
+
timelineEventList = timelineEventList.slice(0, -1 * liveTimelineEvents.length);
|
700
|
+
}
|
701
|
+
|
702
|
+
// execute the timeline events. This will continue to diverge the current state
|
703
|
+
// if the timeline has any state events in it.
|
704
|
+
// This also needs to be done before running push rules on the events as they need
|
705
|
+
// to be decorated with sender etc.
|
706
|
+
yield room.addLiveEvents(timelineEventList, {
|
707
|
+
fromCache: true
|
708
|
+
});
|
709
|
+
if (liveTimelineEvents.length > 0) {
|
710
|
+
yield room.addLiveEvents(liveTimelineEvents, {
|
711
|
+
fromCache: false
|
712
|
+
});
|
713
|
+
}
|
714
|
+
room.recalculate();
|
715
|
+
|
716
|
+
// resolve invites now we have set the latest state
|
717
|
+
_this8.resolveInvites(room);
|
718
|
+
})();
|
719
|
+
}
|
720
|
+
resolveInvites(room) {
|
721
|
+
if (!room || !this.opts.resolveInvitesToProfiles) {
|
722
|
+
return;
|
723
|
+
}
|
724
|
+
var client = this.client;
|
725
|
+
// For each invited room member we want to give them a displayname/avatar url
|
726
|
+
// if they have one (the m.room.member invites don't contain this).
|
727
|
+
room.getMembersWithMembership(KnownMembership.Invite).forEach(function (member) {
|
728
|
+
if (member.requestedProfileInfo) return;
|
729
|
+
member.requestedProfileInfo = true;
|
730
|
+
// try to get a cached copy first.
|
731
|
+
var user = client.getUser(member.userId);
|
732
|
+
var promise;
|
733
|
+
if (user) {
|
734
|
+
promise = Promise.resolve({
|
735
|
+
avatar_url: user.avatarUrl,
|
736
|
+
displayname: user.displayName
|
737
|
+
});
|
738
|
+
} else {
|
739
|
+
promise = client.getProfileInfo(member.userId);
|
740
|
+
}
|
741
|
+
promise.then(function (info) {
|
742
|
+
// slightly naughty by doctoring the invite event but this means all
|
743
|
+
// the code paths remain the same between invite/join display name stuff
|
744
|
+
// which is a worthy trade-off for some minor pollution.
|
745
|
+
var inviteEvent = member.events.member;
|
746
|
+
if (inviteEvent.getContent().membership !== KnownMembership.Invite) {
|
747
|
+
// between resolving and now they have since joined, so don't clobber
|
748
|
+
return;
|
749
|
+
}
|
750
|
+
inviteEvent.getContent().avatar_url = info.avatar_url;
|
751
|
+
inviteEvent.getContent().displayname = info.displayname;
|
752
|
+
// fire listeners
|
753
|
+
member.setMembershipEvent(inviteEvent, room.currentState);
|
754
|
+
}, function (_err) {
|
755
|
+
// OH WELL.
|
756
|
+
});
|
757
|
+
});
|
758
|
+
}
|
759
|
+
retryImmediately() {
|
760
|
+
return true;
|
761
|
+
}
|
762
|
+
|
763
|
+
/**
|
764
|
+
* Main entry point. Blocks until stop() is called.
|
765
|
+
*/
|
766
|
+
sync() {
|
767
|
+
var _this9 = this;
|
768
|
+
return _asyncToGenerator(function* () {
|
769
|
+
logger.debug("Sliding sync init loop");
|
770
|
+
|
771
|
+
// 1) We need to get push rules so we can check if events should bing as we get
|
772
|
+
// them from /sync.
|
773
|
+
while (!_this9.client.isGuest()) {
|
774
|
+
try {
|
775
|
+
logger.debug("Getting push rules...");
|
776
|
+
var result = yield _this9.client.getPushRules();
|
777
|
+
logger.debug("Got push rules");
|
778
|
+
_this9.client.pushRules = result;
|
779
|
+
break;
|
780
|
+
} catch (err) {
|
781
|
+
logger.error("Getting push rules failed", err);
|
782
|
+
if (_this9.shouldAbortSync(err)) {
|
783
|
+
return;
|
784
|
+
}
|
785
|
+
}
|
786
|
+
}
|
787
|
+
|
788
|
+
// start syncing
|
789
|
+
yield _this9.slidingSync.start();
|
790
|
+
})();
|
791
|
+
}
|
792
|
+
|
793
|
+
/**
|
794
|
+
* Stops the sync object from syncing.
|
795
|
+
*/
|
796
|
+
stop() {
|
797
|
+
logger.debug("SyncApi.stop");
|
798
|
+
this.slidingSync.stop();
|
799
|
+
}
|
800
|
+
|
801
|
+
/**
|
802
|
+
* Sets the sync state and emits an event to say so
|
803
|
+
* @param newState - The new state string
|
804
|
+
* @param data - Object of additional data to emit in the event
|
805
|
+
*/
|
806
|
+
updateSyncState(newState, data) {
|
807
|
+
var old = this.syncState;
|
808
|
+
this.syncState = newState;
|
809
|
+
this.syncStateData = data;
|
810
|
+
this.client.emit(ClientEvent.Sync, this.syncState, old, data);
|
811
|
+
}
|
812
|
+
|
813
|
+
/**
|
814
|
+
* Takes a list of timelineEvents and adds and adds to notifEvents
|
815
|
+
* as appropriate.
|
816
|
+
* This must be called after the room the events belong to has been stored.
|
817
|
+
*
|
818
|
+
* @param timelineEventList - A list of timeline events. Lower index
|
819
|
+
* is earlier in time. Higher index is later.
|
820
|
+
*/
|
821
|
+
addNotifications(timelineEventList) {
|
822
|
+
// gather our notifications into this.notifEvents
|
823
|
+
if (!this.client.getNotifTimelineSet()) {
|
824
|
+
return;
|
825
|
+
}
|
826
|
+
for (var timelineEvent of timelineEventList) {
|
827
|
+
var pushActions = this.client.getPushActionsForEvent(timelineEvent);
|
828
|
+
if (pushActions && pushActions.notify && pushActions.tweaks && pushActions.tweaks.highlight) {
|
829
|
+
this.notifEvents.push(timelineEvent);
|
830
|
+
}
|
831
|
+
}
|
832
|
+
}
|
833
|
+
|
834
|
+
/**
|
835
|
+
* Purge any events in the notifEvents array. Used after a /sync has been complete.
|
836
|
+
* This should not be called at a per-room scope (e.g in onRoomData) because otherwise the ordering
|
837
|
+
* will be messed up e.g room A gets a bing, room B gets a newer bing, but both in the same /sync
|
838
|
+
* response. If we purge at a per-room scope then we could process room B before room A leading to
|
839
|
+
* room B appearing earlier in the notifications timeline, even though it has the higher origin_server_ts.
|
840
|
+
*/
|
841
|
+
purgeNotifications() {
|
842
|
+
this.notifEvents.sort(function (a, b) {
|
843
|
+
return a.getTs() - b.getTs();
|
844
|
+
});
|
845
|
+
this.notifEvents.forEach(event => {
|
846
|
+
var _this$client$getNotif;
|
847
|
+
(_this$client$getNotif = this.client.getNotifTimelineSet()) === null || _this$client$getNotif === void 0 || _this$client$getNotif.addLiveEvent(event);
|
848
|
+
});
|
849
|
+
this.notifEvents = [];
|
850
|
+
}
|
851
|
+
}
|
852
|
+
function ensureNameEvent(client, roomId, roomData) {
|
853
|
+
// make sure m.room.name is in required_state if there is a name, replacing anything previously
|
854
|
+
// there if need be. This ensures clients transparently 'calculate' the right room name. Native
|
855
|
+
// sliding sync clients should just read the "name" field.
|
856
|
+
if (!roomData.name) {
|
857
|
+
return roomData;
|
858
|
+
}
|
859
|
+
for (var stateEvent of roomData.required_state) {
|
860
|
+
if (stateEvent.type === EventType.RoomName && stateEvent.state_key === "") {
|
861
|
+
stateEvent.content = {
|
862
|
+
name: roomData.name
|
863
|
+
};
|
864
|
+
return roomData;
|
865
|
+
}
|
866
|
+
}
|
867
|
+
roomData.required_state.push({
|
868
|
+
event_id: "$fake-sliding-sync-name-event-" + roomId,
|
869
|
+
state_key: "",
|
870
|
+
type: EventType.RoomName,
|
871
|
+
content: {
|
872
|
+
name: roomData.name
|
873
|
+
},
|
874
|
+
sender: client.getUserId(),
|
875
|
+
origin_server_ts: new Date().getTime()
|
876
|
+
});
|
877
|
+
return roomData;
|
878
|
+
}
|
879
|
+
// Helper functions which set up JS SDK structs are below and are identical to the sync v2 counterparts,
|
880
|
+
// just outside the class.
|
881
|
+
function mapEvents(client, roomId, events) {
|
882
|
+
var decrypt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
883
|
+
var mapper = client.getEventMapper({
|
884
|
+
decrypt
|
885
|
+
});
|
886
|
+
return events.map(function (e) {
|
887
|
+
e.room_id = roomId;
|
888
|
+
return mapper(e);
|
889
|
+
});
|
890
|
+
}
|
891
|
+
function processEphemeralEvents(client, roomId, ephEvents) {
|
892
|
+
var ephemeralEvents = mapEvents(client, roomId, ephEvents);
|
893
|
+
var room = client.getRoom(roomId);
|
894
|
+
if (!room) {
|
895
|
+
logger.warn("got ephemeral events for room but room doesn't exist on client:", roomId);
|
896
|
+
return;
|
897
|
+
}
|
898
|
+
room.addEphemeralEvents(ephemeralEvents);
|
899
|
+
ephemeralEvents.forEach(e => {
|
900
|
+
client.emit(ClientEvent.Event, e);
|
901
|
+
});
|
902
|
+
}
|
903
|
+
//# sourceMappingURL=sliding-sync-sdk.js.map
|