@unwanted/matrix-sdk-mini 34.12.0-1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +5910 -0
- package/LICENSE +177 -0
- package/README.md +459 -0
- package/git-revision.txt +1 -0
- package/lib/@types/AESEncryptedSecretStoragePayload.d.ts +14 -0
- package/lib/@types/AESEncryptedSecretStoragePayload.d.ts.map +1 -0
- package/lib/@types/AESEncryptedSecretStoragePayload.js +1 -0
- package/lib/@types/AESEncryptedSecretStoragePayload.js.map +1 -0
- package/lib/@types/IIdentityServerProvider.d.ts +9 -0
- package/lib/@types/IIdentityServerProvider.d.ts.map +1 -0
- package/lib/@types/IIdentityServerProvider.js +1 -0
- package/lib/@types/IIdentityServerProvider.js.map +1 -0
- package/lib/@types/PushRules.d.ts +140 -0
- package/lib/@types/PushRules.d.ts.map +1 -0
- package/lib/@types/PushRules.js +94 -0
- package/lib/@types/PushRules.js.map +1 -0
- package/lib/@types/another-json.d.js +0 -0
- package/lib/@types/another-json.d.js.map +1 -0
- package/lib/@types/auth.d.ts +208 -0
- package/lib/@types/auth.d.ts.map +1 -0
- package/lib/@types/auth.js +99 -0
- package/lib/@types/auth.js.map +1 -0
- package/lib/@types/beacon.d.ts +106 -0
- package/lib/@types/beacon.d.ts.map +1 -0
- package/lib/@types/beacon.js +119 -0
- package/lib/@types/beacon.js.map +1 -0
- package/lib/@types/common.d.ts +9 -0
- package/lib/@types/common.d.ts.map +1 -0
- package/lib/@types/common.js +1 -0
- package/lib/@types/common.js.map +1 -0
- package/lib/@types/crypto.d.ts +47 -0
- package/lib/@types/crypto.d.ts.map +1 -0
- package/lib/@types/crypto.js +1 -0
- package/lib/@types/crypto.js.map +1 -0
- package/lib/@types/event.d.ts +258 -0
- package/lib/@types/event.d.ts.map +1 -0
- package/lib/@types/event.js +239 -0
- package/lib/@types/event.js.map +1 -0
- package/lib/@types/events.d.ts +92 -0
- package/lib/@types/events.d.ts.map +1 -0
- package/lib/@types/events.js +1 -0
- package/lib/@types/events.js.map +1 -0
- package/lib/@types/extensible_events.d.ts +98 -0
- package/lib/@types/extensible_events.d.ts.map +1 -0
- package/lib/@types/extensible_events.js +116 -0
- package/lib/@types/extensible_events.js.map +1 -0
- package/lib/@types/global.d.js +20 -0
- package/lib/@types/global.d.js.map +1 -0
- package/lib/@types/local_notifications.d.ts +4 -0
- package/lib/@types/local_notifications.d.ts.map +1 -0
- package/lib/@types/local_notifications.js +1 -0
- package/lib/@types/local_notifications.js.map +1 -0
- package/lib/@types/location.d.ts +60 -0
- package/lib/@types/location.d.ts.map +1 -0
- package/lib/@types/location.js +67 -0
- package/lib/@types/location.js.map +1 -0
- package/lib/@types/matrix-sdk-crypto-wasm.d.js +1 -0
- package/lib/@types/matrix-sdk-crypto-wasm.d.js.map +1 -0
- package/lib/@types/media.d.ts +220 -0
- package/lib/@types/media.d.ts.map +1 -0
- package/lib/@types/media.js +1 -0
- package/lib/@types/media.js.map +1 -0
- package/lib/@types/membership.d.ts +41 -0
- package/lib/@types/membership.d.ts.map +1 -0
- package/lib/@types/membership.js +37 -0
- package/lib/@types/membership.js.map +1 -0
- package/lib/@types/oidc-client-ts.d.js +18 -0
- package/lib/@types/oidc-client-ts.d.js.map +1 -0
- package/lib/@types/partials.d.ts +39 -0
- package/lib/@types/partials.d.ts.map +1 -0
- package/lib/@types/partials.js +53 -0
- package/lib/@types/partials.js.map +1 -0
- package/lib/@types/polls.d.ts +88 -0
- package/lib/@types/polls.d.ts.map +1 -0
- package/lib/@types/polls.js +86 -0
- package/lib/@types/polls.js.map +1 -0
- package/lib/@types/read_receipts.d.ts +36 -0
- package/lib/@types/read_receipts.d.ts.map +1 -0
- package/lib/@types/read_receipts.js +27 -0
- package/lib/@types/read_receipts.js.map +1 -0
- package/lib/@types/registration.d.ts +85 -0
- package/lib/@types/registration.d.ts.map +1 -0
- package/lib/@types/registration.js +1 -0
- package/lib/@types/registration.js.map +1 -0
- package/lib/@types/requests.d.ts +241 -0
- package/lib/@types/requests.d.ts.map +1 -0
- package/lib/@types/requests.js +28 -0
- package/lib/@types/requests.js.map +1 -0
- package/lib/@types/search.d.ts +90 -0
- package/lib/@types/search.d.ts.map +1 -0
- package/lib/@types/search.js +30 -0
- package/lib/@types/search.js.map +1 -0
- package/lib/@types/signed.d.ts +9 -0
- package/lib/@types/signed.d.ts.map +1 -0
- package/lib/@types/signed.js +1 -0
- package/lib/@types/signed.js.map +1 -0
- package/lib/@types/spaces.d.ts +16 -0
- package/lib/@types/spaces.d.ts.map +1 -0
- package/lib/@types/spaces.js +1 -0
- package/lib/@types/spaces.js.map +1 -0
- package/lib/@types/state_events.d.ts +116 -0
- package/lib/@types/state_events.d.ts.map +1 -0
- package/lib/@types/state_events.js +1 -0
- package/lib/@types/state_events.js.map +1 -0
- package/lib/@types/synapse.d.ts +19 -0
- package/lib/@types/synapse.d.ts.map +1 -0
- package/lib/@types/synapse.js +1 -0
- package/lib/@types/synapse.js.map +1 -0
- package/lib/@types/sync.d.ts +8 -0
- package/lib/@types/sync.d.ts.map +1 -0
- package/lib/@types/sync.js +25 -0
- package/lib/@types/sync.js.map +1 -0
- package/lib/@types/threepids.d.ts +12 -0
- package/lib/@types/threepids.d.ts.map +1 -0
- package/lib/@types/threepids.js +24 -0
- package/lib/@types/threepids.js.map +1 -0
- package/lib/@types/topic.d.ts +48 -0
- package/lib/@types/topic.d.ts.map +1 -0
- package/lib/@types/topic.js +57 -0
- package/lib/@types/topic.js.map +1 -0
- package/lib/@types/uia.d.ts +12 -0
- package/lib/@types/uia.d.ts.map +1 -0
- package/lib/@types/uia.js +1 -0
- package/lib/@types/uia.js.map +1 -0
- package/lib/NamespacedValue.d.ts +33 -0
- package/lib/NamespacedValue.d.ts.map +1 -0
- package/lib/NamespacedValue.js +113 -0
- package/lib/NamespacedValue.js.map +1 -0
- package/lib/ReEmitter.d.ts +15 -0
- package/lib/ReEmitter.d.ts.map +1 -0
- package/lib/ReEmitter.js +87 -0
- package/lib/ReEmitter.js.map +1 -0
- package/lib/ToDeviceMessageQueue.d.ts +28 -0
- package/lib/ToDeviceMessageQueue.d.ts.map +1 -0
- package/lib/ToDeviceMessageQueue.js +135 -0
- package/lib/ToDeviceMessageQueue.js.map +1 -0
- package/lib/autodiscovery.d.ts +136 -0
- package/lib/autodiscovery.d.ts.map +1 -0
- package/lib/autodiscovery.js +464 -0
- package/lib/autodiscovery.js.map +1 -0
- package/lib/base64.d.ts +28 -0
- package/lib/base64.d.ts.map +1 -0
- package/lib/base64.js +88 -0
- package/lib/base64.js.map +1 -0
- package/lib/browser-index.d.ts +8 -0
- package/lib/browser-index.d.ts.map +1 -0
- package/lib/browser-index.js +35 -0
- package/lib/browser-index.js.map +1 -0
- package/lib/client.d.ts +4232 -0
- package/lib/client.d.ts.map +1 -0
- package/lib/client.js +8622 -0
- package/lib/client.js.map +1 -0
- package/lib/common-crypto/CryptoBackend.d.ts +240 -0
- package/lib/common-crypto/CryptoBackend.d.ts.map +1 -0
- package/lib/common-crypto/CryptoBackend.js +73 -0
- package/lib/common-crypto/CryptoBackend.js.map +1 -0
- package/lib/common-crypto/key-passphrase.d.ts +14 -0
- package/lib/common-crypto/key-passphrase.d.ts.map +1 -0
- package/lib/common-crypto/key-passphrase.js +33 -0
- package/lib/common-crypto/key-passphrase.js.map +1 -0
- package/lib/content-helpers.d.ts +90 -0
- package/lib/content-helpers.d.ts.map +1 -0
- package/lib/content-helpers.js +250 -0
- package/lib/content-helpers.js.map +1 -0
- package/lib/content-repo.d.ts +24 -0
- package/lib/content-repo.d.ts.map +1 -0
- package/lib/content-repo.js +104 -0
- package/lib/content-repo.js.map +1 -0
- package/lib/crypto/CrossSigning.d.ts +184 -0
- package/lib/crypto/CrossSigning.d.ts.map +1 -0
- package/lib/crypto/CrossSigning.js +718 -0
- package/lib/crypto/CrossSigning.js.map +1 -0
- package/lib/crypto/DeviceList.d.ts +216 -0
- package/lib/crypto/DeviceList.d.ts.map +1 -0
- package/lib/crypto/DeviceList.js +892 -0
- package/lib/crypto/DeviceList.js.map +1 -0
- package/lib/crypto/EncryptionSetup.d.ts +152 -0
- package/lib/crypto/EncryptionSetup.d.ts.map +1 -0
- package/lib/crypto/EncryptionSetup.js +356 -0
- package/lib/crypto/EncryptionSetup.js.map +1 -0
- package/lib/crypto/OlmDevice.d.ts +457 -0
- package/lib/crypto/OlmDevice.d.ts.map +1 -0
- package/lib/crypto/OlmDevice.js +1241 -0
- package/lib/crypto/OlmDevice.js.map +1 -0
- package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts +109 -0
- package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts.map +1 -0
- package/lib/crypto/OutgoingRoomKeyRequestManager.js +415 -0
- package/lib/crypto/OutgoingRoomKeyRequestManager.js.map +1 -0
- package/lib/crypto/RoomList.d.ts +26 -0
- package/lib/crypto/RoomList.d.ts.map +1 -0
- package/lib/crypto/RoomList.js +71 -0
- package/lib/crypto/RoomList.js.map +1 -0
- package/lib/crypto/SecretSharing.d.ts +24 -0
- package/lib/crypto/SecretSharing.d.ts.map +1 -0
- package/lib/crypto/SecretSharing.js +194 -0
- package/lib/crypto/SecretSharing.js.map +1 -0
- package/lib/crypto/SecretStorage.d.ts +55 -0
- package/lib/crypto/SecretStorage.d.ts.map +1 -0
- package/lib/crypto/SecretStorage.js +118 -0
- package/lib/crypto/SecretStorage.js.map +1 -0
- package/lib/crypto/aes.d.ts +6 -0
- package/lib/crypto/aes.d.ts.map +1 -0
- package/lib/crypto/aes.js +24 -0
- package/lib/crypto/aes.js.map +1 -0
- package/lib/crypto/algorithms/base.d.ts +156 -0
- package/lib/crypto/algorithms/base.d.ts.map +1 -0
- package/lib/crypto/algorithms/base.js +187 -0
- package/lib/crypto/algorithms/base.js.map +1 -0
- package/lib/crypto/algorithms/index.d.ts +4 -0
- package/lib/crypto/algorithms/index.d.ts.map +1 -0
- package/lib/crypto/algorithms/index.js +20 -0
- package/lib/crypto/algorithms/index.js.map +1 -0
- package/lib/crypto/algorithms/megolm.d.ts +385 -0
- package/lib/crypto/algorithms/megolm.d.ts.map +1 -0
- package/lib/crypto/algorithms/megolm.js +1822 -0
- package/lib/crypto/algorithms/megolm.js.map +1 -0
- package/lib/crypto/algorithms/olm.d.ts +5 -0
- package/lib/crypto/algorithms/olm.d.ts.map +1 -0
- package/lib/crypto/algorithms/olm.js +299 -0
- package/lib/crypto/algorithms/olm.js.map +1 -0
- package/lib/crypto/api.d.ts +32 -0
- package/lib/crypto/api.d.ts.map +1 -0
- package/lib/crypto/api.js +22 -0
- package/lib/crypto/api.js.map +1 -0
- package/lib/crypto/backup.d.ts +227 -0
- package/lib/crypto/backup.d.ts.map +1 -0
- package/lib/crypto/backup.js +824 -0
- package/lib/crypto/backup.js.map +1 -0
- package/lib/crypto/crypto.d.ts +3 -0
- package/lib/crypto/crypto.d.ts.map +1 -0
- package/lib/crypto/crypto.js +19 -0
- package/lib/crypto/crypto.js.map +1 -0
- package/lib/crypto/dehydration.d.ts +34 -0
- package/lib/crypto/dehydration.d.ts.map +1 -0
- package/lib/crypto/dehydration.js +252 -0
- package/lib/crypto/dehydration.js.map +1 -0
- package/lib/crypto/device-converter.d.ts +9 -0
- package/lib/crypto/device-converter.d.ts.map +1 -0
- package/lib/crypto/device-converter.js +42 -0
- package/lib/crypto/device-converter.js.map +1 -0
- package/lib/crypto/deviceinfo.d.ts +99 -0
- package/lib/crypto/deviceinfo.d.ts.map +1 -0
- package/lib/crypto/deviceinfo.js +148 -0
- package/lib/crypto/deviceinfo.js.map +1 -0
- package/lib/crypto/index.d.ts +1209 -0
- package/lib/crypto/index.d.ts.map +1 -0
- package/lib/crypto/index.js +4097 -0
- package/lib/crypto/index.js.map +1 -0
- package/lib/crypto/key_passphrase.d.ts +14 -0
- package/lib/crypto/key_passphrase.d.ts.map +1 -0
- package/lib/crypto/key_passphrase.js +44 -0
- package/lib/crypto/key_passphrase.js.map +1 -0
- package/lib/crypto/keybackup.d.ts +18 -0
- package/lib/crypto/keybackup.d.ts.map +1 -0
- package/lib/crypto/keybackup.js +1 -0
- package/lib/crypto/keybackup.js.map +1 -0
- package/lib/crypto/olmlib.d.ts +129 -0
- package/lib/crypto/olmlib.d.ts.map +1 -0
- package/lib/crypto/olmlib.js +492 -0
- package/lib/crypto/olmlib.js.map +1 -0
- package/lib/crypto/recoverykey.d.ts +2 -0
- package/lib/crypto/recoverykey.d.ts.map +1 -0
- package/lib/crypto/recoverykey.js +19 -0
- package/lib/crypto/recoverykey.js.map +1 -0
- package/lib/crypto/store/base.d.ts +252 -0
- package/lib/crypto/store/base.d.ts.map +1 -0
- package/lib/crypto/store/base.js +64 -0
- package/lib/crypto/store/base.js.map +1 -0
- package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts +187 -0
- package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts.map +1 -0
- package/lib/crypto/store/indexeddb-crypto-store-backend.js +1145 -0
- package/lib/crypto/store/indexeddb-crypto-store-backend.js.map +1 -0
- package/lib/crypto/store/indexeddb-crypto-store.d.ts +432 -0
- package/lib/crypto/store/indexeddb-crypto-store.d.ts.map +1 -0
- package/lib/crypto/store/indexeddb-crypto-store.js +728 -0
- package/lib/crypto/store/indexeddb-crypto-store.js.map +1 -0
- package/lib/crypto/store/localStorage-crypto-store.d.ts +119 -0
- package/lib/crypto/store/localStorage-crypto-store.d.ts.map +1 -0
- package/lib/crypto/store/localStorage-crypto-store.js +531 -0
- package/lib/crypto/store/localStorage-crypto-store.js.map +1 -0
- package/lib/crypto/store/memory-crypto-store.d.ts +215 -0
- package/lib/crypto/store/memory-crypto-store.d.ts.map +1 -0
- package/lib/crypto/store/memory-crypto-store.js +622 -0
- package/lib/crypto/store/memory-crypto-store.js.map +1 -0
- package/lib/crypto/verification/Base.d.ts +105 -0
- package/lib/crypto/verification/Base.d.ts.map +1 -0
- package/lib/crypto/verification/Base.js +372 -0
- package/lib/crypto/verification/Base.js.map +1 -0
- package/lib/crypto/verification/Error.d.ts +35 -0
- package/lib/crypto/verification/Error.d.ts.map +1 -0
- package/lib/crypto/verification/Error.js +86 -0
- package/lib/crypto/verification/Error.js.map +1 -0
- package/lib/crypto/verification/IllegalMethod.d.ts +15 -0
- package/lib/crypto/verification/IllegalMethod.d.ts.map +1 -0
- package/lib/crypto/verification/IllegalMethod.js +43 -0
- package/lib/crypto/verification/IllegalMethod.js.map +1 -0
- package/lib/crypto/verification/QRCode.d.ts +51 -0
- package/lib/crypto/verification/QRCode.d.ts.map +1 -0
- package/lib/crypto/verification/QRCode.js +277 -0
- package/lib/crypto/verification/QRCode.js.map +1 -0
- package/lib/crypto/verification/SAS.d.ts +27 -0
- package/lib/crypto/verification/SAS.d.ts.map +1 -0
- package/lib/crypto/verification/SAS.js +485 -0
- package/lib/crypto/verification/SAS.js.map +1 -0
- package/lib/crypto/verification/SASDecimal.d.ts +8 -0
- package/lib/crypto/verification/SASDecimal.d.ts.map +1 -0
- package/lib/crypto/verification/SASDecimal.js +34 -0
- package/lib/crypto/verification/SASDecimal.js.map +1 -0
- package/lib/crypto/verification/request/Channel.d.ts +18 -0
- package/lib/crypto/verification/request/Channel.d.ts.map +1 -0
- package/lib/crypto/verification/request/Channel.js +1 -0
- package/lib/crypto/verification/request/Channel.js.map +1 -0
- package/lib/crypto/verification/request/InRoomChannel.d.ts +113 -0
- package/lib/crypto/verification/request/InRoomChannel.d.ts.map +1 -0
- package/lib/crypto/verification/request/InRoomChannel.js +351 -0
- package/lib/crypto/verification/request/InRoomChannel.js.map +1 -0
- package/lib/crypto/verification/request/ToDeviceChannel.d.ts +105 -0
- package/lib/crypto/verification/request/ToDeviceChannel.d.ts.map +1 -0
- package/lib/crypto/verification/request/ToDeviceChannel.js +328 -0
- package/lib/crypto/verification/request/ToDeviceChannel.js.map +1 -0
- package/lib/crypto/verification/request/VerificationRequest.d.ts +227 -0
- package/lib/crypto/verification/request/VerificationRequest.d.ts.map +1 -0
- package/lib/crypto/verification/request/VerificationRequest.js +937 -0
- package/lib/crypto/verification/request/VerificationRequest.js.map +1 -0
- package/lib/crypto-api/CryptoEvent.d.ts +69 -0
- package/lib/crypto-api/CryptoEvent.d.ts.map +1 -0
- package/lib/crypto-api/CryptoEvent.js +33 -0
- package/lib/crypto-api/CryptoEvent.js.map +1 -0
- package/lib/crypto-api/CryptoEventHandlerMap.d.ts +16 -0
- package/lib/crypto-api/CryptoEventHandlerMap.d.ts.map +1 -0
- package/lib/crypto-api/CryptoEventHandlerMap.js +22 -0
- package/lib/crypto-api/CryptoEventHandlerMap.js.map +1 -0
- package/lib/crypto-api/index.d.ts +978 -0
- package/lib/crypto-api/index.d.ts.map +1 -0
- package/lib/crypto-api/index.js +304 -0
- package/lib/crypto-api/index.js.map +1 -0
- package/lib/crypto-api/key-passphrase.d.ts +11 -0
- package/lib/crypto-api/key-passphrase.d.ts.map +1 -0
- package/lib/crypto-api/key-passphrase.js +51 -0
- package/lib/crypto-api/key-passphrase.js.map +1 -0
- package/lib/crypto-api/keybackup.d.ts +88 -0
- package/lib/crypto-api/keybackup.d.ts.map +1 -0
- package/lib/crypto-api/keybackup.js +1 -0
- package/lib/crypto-api/keybackup.js.map +1 -0
- package/lib/crypto-api/recovery-key.d.ts +11 -0
- package/lib/crypto-api/recovery-key.d.ts.map +1 -0
- package/lib/crypto-api/recovery-key.js +65 -0
- package/lib/crypto-api/recovery-key.js.map +1 -0
- package/lib/crypto-api/verification.d.ts +344 -0
- package/lib/crypto-api/verification.d.ts.map +1 -0
- package/lib/crypto-api/verification.js +91 -0
- package/lib/crypto-api/verification.js.map +1 -0
- package/lib/digest.d.ts +10 -0
- package/lib/digest.d.ts.map +1 -0
- package/lib/digest.js +40 -0
- package/lib/digest.js.map +1 -0
- package/lib/embedded.d.ts +143 -0
- package/lib/embedded.d.ts.map +1 -0
- package/lib/embedded.js +567 -0
- package/lib/embedded.js.map +1 -0
- package/lib/errors.d.ts +24 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +51 -0
- package/lib/errors.js.map +1 -0
- package/lib/event-mapper.d.ts +10 -0
- package/lib/event-mapper.d.ts.map +1 -0
- package/lib/event-mapper.js +81 -0
- package/lib/event-mapper.js.map +1 -0
- package/lib/extensible_events_v1/ExtensibleEvent.d.ts +38 -0
- package/lib/extensible_events_v1/ExtensibleEvent.d.ts.map +1 -0
- package/lib/extensible_events_v1/ExtensibleEvent.js +57 -0
- package/lib/extensible_events_v1/ExtensibleEvent.js.map +1 -0
- package/lib/extensible_events_v1/InvalidEventError.d.ts +7 -0
- package/lib/extensible_events_v1/InvalidEventError.d.ts.map +1 -0
- package/lib/extensible_events_v1/InvalidEventError.js +25 -0
- package/lib/extensible_events_v1/InvalidEventError.js.map +1 -0
- package/lib/extensible_events_v1/MessageEvent.d.ts +45 -0
- package/lib/extensible_events_v1/MessageEvent.d.ts.map +1 -0
- package/lib/extensible_events_v1/MessageEvent.js +134 -0
- package/lib/extensible_events_v1/MessageEvent.js.map +1 -0
- package/lib/extensible_events_v1/PollEndEvent.d.ts +33 -0
- package/lib/extensible_events_v1/PollEndEvent.d.ts.map +1 -0
- package/lib/extensible_events_v1/PollEndEvent.js +88 -0
- package/lib/extensible_events_v1/PollEndEvent.js.map +1 -0
- package/lib/extensible_events_v1/PollResponseEvent.d.ts +49 -0
- package/lib/extensible_events_v1/PollResponseEvent.d.ts.map +1 -0
- package/lib/extensible_events_v1/PollResponseEvent.js +135 -0
- package/lib/extensible_events_v1/PollResponseEvent.js.map +1 -0
- package/lib/extensible_events_v1/PollStartEvent.d.ts +71 -0
- package/lib/extensible_events_v1/PollStartEvent.d.ts.map +1 -0
- package/lib/extensible_events_v1/PollStartEvent.js +185 -0
- package/lib/extensible_events_v1/PollStartEvent.js.map +1 -0
- package/lib/extensible_events_v1/utilities.d.ts +14 -0
- package/lib/extensible_events_v1/utilities.d.ts.map +1 -0
- package/lib/extensible_events_v1/utilities.js +34 -0
- package/lib/extensible_events_v1/utilities.js.map +1 -0
- package/lib/feature.d.ts +20 -0
- package/lib/feature.d.ts.map +1 -0
- package/lib/feature.js +85 -0
- package/lib/feature.js.map +1 -0
- package/lib/filter-component.d.ts +64 -0
- package/lib/filter-component.d.ts.map +1 -0
- package/lib/filter-component.js +167 -0
- package/lib/filter-component.js.map +1 -0
- package/lib/filter.d.ts +97 -0
- package/lib/filter.d.ts.map +1 -0
- package/lib/filter.js +207 -0
- package/lib/filter.js.map +1 -0
- package/lib/http-api/errors.d.ts +80 -0
- package/lib/http-api/errors.d.ts.map +1 -0
- package/lib/http-api/errors.js +185 -0
- package/lib/http-api/errors.js.map +1 -0
- package/lib/http-api/fetch.d.ts +114 -0
- package/lib/http-api/fetch.d.ts.map +1 -0
- package/lib/http-api/fetch.js +346 -0
- package/lib/http-api/fetch.js.map +1 -0
- package/lib/http-api/index.d.ts +33 -0
- package/lib/http-api/index.d.ts.map +1 -0
- package/lib/http-api/index.js +180 -0
- package/lib/http-api/index.js.map +1 -0
- package/lib/http-api/interface.d.ts +142 -0
- package/lib/http-api/interface.d.ts.map +1 -0
- package/lib/http-api/interface.js +35 -0
- package/lib/http-api/interface.js.map +1 -0
- package/lib/http-api/method.d.ts +10 -0
- package/lib/http-api/method.d.ts.map +1 -0
- package/lib/http-api/method.js +27 -0
- package/lib/http-api/method.js.map +1 -0
- package/lib/http-api/prefix.d.ts +31 -0
- package/lib/http-api/prefix.d.ts.map +1 -0
- package/lib/http-api/prefix.js +32 -0
- package/lib/http-api/prefix.js.map +1 -0
- package/lib/http-api/utils.d.ts +37 -0
- package/lib/http-api/utils.d.ts.map +1 -0
- package/lib/http-api/utils.js +178 -0
- package/lib/http-api/utils.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +24 -0
- package/lib/index.js.map +1 -0
- package/lib/indexeddb-helpers.d.ts +10 -0
- package/lib/indexeddb-helpers.d.ts.map +1 -0
- package/lib/indexeddb-helpers.js +51 -0
- package/lib/indexeddb-helpers.js.map +1 -0
- package/lib/indexeddb-worker.d.ts +7 -0
- package/lib/indexeddb-worker.d.ts.map +1 -0
- package/lib/indexeddb-worker.js +25 -0
- package/lib/indexeddb-worker.js.map +1 -0
- package/lib/interactive-auth.d.ts +337 -0
- package/lib/interactive-auth.d.ts.map +1 -0
- package/lib/interactive-auth.js +557 -0
- package/lib/interactive-auth.js.map +1 -0
- package/lib/logger.d.ts +81 -0
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +139 -0
- package/lib/logger.js.map +1 -0
- package/lib/matrix.d.ts +118 -0
- package/lib/matrix.d.ts.map +1 -0
- package/lib/matrix.js +146 -0
- package/lib/matrix.js.map +1 -0
- package/lib/matrixrtc/CallMembership.d.ts +66 -0
- package/lib/matrixrtc/CallMembership.d.ts.map +1 -0
- package/lib/matrixrtc/CallMembership.js +197 -0
- package/lib/matrixrtc/CallMembership.js.map +1 -0
- package/lib/matrixrtc/LivekitFocus.d.ts +16 -0
- package/lib/matrixrtc/LivekitFocus.d.ts.map +1 -0
- package/lib/matrixrtc/LivekitFocus.js +20 -0
- package/lib/matrixrtc/LivekitFocus.js.map +1 -0
- package/lib/matrixrtc/MatrixRTCSession.d.ts +295 -0
- package/lib/matrixrtc/MatrixRTCSession.d.ts.map +1 -0
- package/lib/matrixrtc/MatrixRTCSession.js +1043 -0
- package/lib/matrixrtc/MatrixRTCSession.js.map +1 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.d.ts +40 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.d.ts.map +1 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.js +146 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.js.map +1 -0
- package/lib/matrixrtc/focus.d.ts +10 -0
- package/lib/matrixrtc/focus.d.ts.map +1 -0
- package/lib/matrixrtc/focus.js +1 -0
- package/lib/matrixrtc/focus.js.map +1 -0
- package/lib/matrixrtc/index.d.ts +7 -0
- package/lib/matrixrtc/index.d.ts.map +1 -0
- package/lib/matrixrtc/index.js +21 -0
- package/lib/matrixrtc/index.js.map +1 -0
- package/lib/matrixrtc/types.d.ts +19 -0
- package/lib/matrixrtc/types.d.ts.map +1 -0
- package/lib/matrixrtc/types.js +1 -0
- package/lib/matrixrtc/types.js.map +1 -0
- package/lib/models/MSC3089Branch.d.ts +98 -0
- package/lib/models/MSC3089Branch.d.ts.map +1 -0
- package/lib/models/MSC3089Branch.js +240 -0
- package/lib/models/MSC3089Branch.js.map +1 -0
- package/lib/models/MSC3089TreeSpace.d.ts +165 -0
- package/lib/models/MSC3089TreeSpace.d.ts.map +1 -0
- package/lib/models/MSC3089TreeSpace.js +520 -0
- package/lib/models/MSC3089TreeSpace.js.map +1 -0
- package/lib/models/ToDeviceMessage.d.ts +17 -0
- package/lib/models/ToDeviceMessage.d.ts.map +1 -0
- package/lib/models/ToDeviceMessage.js +1 -0
- package/lib/models/ToDeviceMessage.js.map +1 -0
- package/lib/models/beacon.d.ts +53 -0
- package/lib/models/beacon.d.ts.map +1 -0
- package/lib/models/beacon.js +174 -0
- package/lib/models/beacon.js.map +1 -0
- package/lib/models/compare-event-ordering.d.ts +24 -0
- package/lib/models/compare-event-ordering.d.ts.map +1 -0
- package/lib/models/compare-event-ordering.js +120 -0
- package/lib/models/compare-event-ordering.js.map +1 -0
- package/lib/models/device.d.ts +45 -0
- package/lib/models/device.d.ts.map +1 -0
- package/lib/models/device.js +77 -0
- package/lib/models/device.js.map +1 -0
- package/lib/models/event-context.d.ts +62 -0
- package/lib/models/event-context.d.ts.map +1 -0
- package/lib/models/event-context.js +113 -0
- package/lib/models/event-context.js.map +1 -0
- package/lib/models/event-status.d.ts +19 -0
- package/lib/models/event-status.d.ts.map +1 -0
- package/lib/models/event-status.js +30 -0
- package/lib/models/event-status.js.map +1 -0
- package/lib/models/event-timeline-set.d.ts +312 -0
- package/lib/models/event-timeline-set.d.ts.map +1 -0
- package/lib/models/event-timeline-set.js +813 -0
- package/lib/models/event-timeline-set.js.map +1 -0
- package/lib/models/event-timeline.d.ts +219 -0
- package/lib/models/event-timeline.d.ts.map +1 -0
- package/lib/models/event-timeline.js +455 -0
- package/lib/models/event-timeline.js.map +1 -0
- package/lib/models/event.d.ts +811 -0
- package/lib/models/event.d.ts.map +1 -0
- package/lib/models/event.js +1520 -0
- package/lib/models/event.js.map +1 -0
- package/lib/models/invites-ignorer.d.ts +136 -0
- package/lib/models/invites-ignorer.d.ts.map +1 -0
- package/lib/models/invites-ignorer.js +382 -0
- package/lib/models/invites-ignorer.js.map +1 -0
- package/lib/models/poll.d.ts +67 -0
- package/lib/models/poll.d.ts.map +1 -0
- package/lib/models/poll.js +241 -0
- package/lib/models/poll.js.map +1 -0
- package/lib/models/profile-keys.d.ts +8 -0
- package/lib/models/profile-keys.d.ts.map +1 -0
- package/lib/models/profile-keys.js +8 -0
- package/lib/models/profile-keys.js.map +1 -0
- package/lib/models/read-receipt.d.ts +115 -0
- package/lib/models/read-receipt.d.ts.map +1 -0
- package/lib/models/read-receipt.js +366 -0
- package/lib/models/read-receipt.js.map +1 -0
- package/lib/models/related-relations.d.ts +11 -0
- package/lib/models/related-relations.d.ts.map +1 -0
- package/lib/models/related-relations.js +33 -0
- package/lib/models/related-relations.js.map +1 -0
- package/lib/models/relations-container.d.ts +44 -0
- package/lib/models/relations-container.d.ts.map +1 -0
- package/lib/models/relations-container.js +132 -0
- package/lib/models/relations-container.js.map +1 -0
- package/lib/models/relations.d.ts +114 -0
- package/lib/models/relations.d.ts.map +1 -0
- package/lib/models/relations.js +354 -0
- package/lib/models/relations.js.map +1 -0
- package/lib/models/room-member.d.ts +204 -0
- package/lib/models/room-member.d.ts.map +1 -0
- package/lib/models/room-member.js +360 -0
- package/lib/models/room-member.js.map +1 -0
- package/lib/models/room-receipts.d.ts +39 -0
- package/lib/models/room-receipts.d.ts.map +1 -0
- package/lib/models/room-receipts.js +392 -0
- package/lib/models/room-receipts.js.map +1 -0
- package/lib/models/room-state.d.ts +468 -0
- package/lib/models/room-state.d.ts.map +1 -0
- package/lib/models/room-state.js +984 -0
- package/lib/models/room-state.js.map +1 -0
- package/lib/models/room-summary.d.ts +29 -0
- package/lib/models/room-summary.d.ts.map +1 -0
- package/lib/models/room-summary.js +28 -0
- package/lib/models/room-summary.js.map +1 -0
- package/lib/models/room.d.ts +1203 -0
- package/lib/models/room.d.ts.map +1 -0
- package/lib/models/room.js +3336 -0
- package/lib/models/room.js.map +1 -0
- package/lib/models/search-result.d.ts +20 -0
- package/lib/models/search-result.d.ts.map +1 -0
- package/lib/models/search-result.js +52 -0
- package/lib/models/search-result.js.map +1 -0
- package/lib/models/thread.d.ts +246 -0
- package/lib/models/thread.d.ts.map +1 -0
- package/lib/models/thread.js +861 -0
- package/lib/models/thread.js.map +1 -0
- package/lib/models/typed-event-emitter.d.ts +157 -0
- package/lib/models/typed-event-emitter.d.ts.map +1 -0
- package/lib/models/typed-event-emitter.js +227 -0
- package/lib/models/typed-event-emitter.js.map +1 -0
- package/lib/models/user.d.ts +195 -0
- package/lib/models/user.d.ts.map +1 -0
- package/lib/models/user.js +218 -0
- package/lib/models/user.js.map +1 -0
- package/lib/oidc/authorize.d.ts +90 -0
- package/lib/oidc/authorize.d.ts.map +1 -0
- package/lib/oidc/authorize.js +278 -0
- package/lib/oidc/authorize.js.map +1 -0
- package/lib/oidc/discovery.d.ts +14 -0
- package/lib/oidc/discovery.d.ts.map +1 -0
- package/lib/oidc/discovery.js +66 -0
- package/lib/oidc/discovery.js.map +1 -0
- package/lib/oidc/error.d.ts +18 -0
- package/lib/oidc/error.d.ts.map +1 -0
- package/lib/oidc/error.js +35 -0
- package/lib/oidc/error.js.map +1 -0
- package/lib/oidc/index.d.ts +17 -0
- package/lib/oidc/index.d.ts.map +1 -0
- package/lib/oidc/index.js +29 -0
- package/lib/oidc/index.js.map +1 -0
- package/lib/oidc/register.d.ts +43 -0
- package/lib/oidc/register.d.ts.map +1 -0
- package/lib/oidc/register.js +96 -0
- package/lib/oidc/register.js.map +1 -0
- package/lib/oidc/tokenRefresher.d.ts +69 -0
- package/lib/oidc/tokenRefresher.d.ts.map +1 -0
- package/lib/oidc/tokenRefresher.js +148 -0
- package/lib/oidc/tokenRefresher.js.map +1 -0
- package/lib/oidc/validate.d.ts +90 -0
- package/lib/oidc/validate.d.ts.map +1 -0
- package/lib/oidc/validate.js +194 -0
- package/lib/oidc/validate.js.map +1 -0
- package/lib/pushprocessor.d.ts +128 -0
- package/lib/pushprocessor.d.ts.map +1 -0
- package/lib/pushprocessor.js +685 -0
- package/lib/pushprocessor.js.map +1 -0
- package/lib/randomstring.d.ts +5 -0
- package/lib/randomstring.d.ts.map +1 -0
- package/lib/randomstring.js +43 -0
- package/lib/randomstring.js.map +1 -0
- package/lib/realtime-callbacks.d.ts +18 -0
- package/lib/realtime-callbacks.d.ts.map +1 -0
- package/lib/realtime-callbacks.js +177 -0
- package/lib/realtime-callbacks.js.map +1 -0
- package/lib/receipt-accumulator.d.ts +51 -0
- package/lib/receipt-accumulator.d.ts.map +1 -0
- package/lib/receipt-accumulator.js +164 -0
- package/lib/receipt-accumulator.js.map +1 -0
- package/lib/rendezvous/MSC4108SignInWithQR.d.ts +112 -0
- package/lib/rendezvous/MSC4108SignInWithQR.d.ts.map +1 -0
- package/lib/rendezvous/MSC4108SignInWithQR.js +392 -0
- package/lib/rendezvous/MSC4108SignInWithQR.js.map +1 -0
- package/lib/rendezvous/RendezvousChannel.d.ts +27 -0
- package/lib/rendezvous/RendezvousChannel.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousChannel.js +1 -0
- package/lib/rendezvous/RendezvousChannel.js.map +1 -0
- package/lib/rendezvous/RendezvousCode.d.ts +9 -0
- package/lib/rendezvous/RendezvousCode.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousCode.js +1 -0
- package/lib/rendezvous/RendezvousCode.js.map +1 -0
- package/lib/rendezvous/RendezvousError.d.ts +6 -0
- package/lib/rendezvous/RendezvousError.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousError.js +23 -0
- package/lib/rendezvous/RendezvousError.js.map +1 -0
- package/lib/rendezvous/RendezvousFailureReason.d.ts +31 -0
- package/lib/rendezvous/RendezvousFailureReason.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousFailureReason.js +38 -0
- package/lib/rendezvous/RendezvousFailureReason.js.map +1 -0
- package/lib/rendezvous/RendezvousIntent.d.ts +5 -0
- package/lib/rendezvous/RendezvousIntent.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousIntent.js +22 -0
- package/lib/rendezvous/RendezvousIntent.js.map +1 -0
- package/lib/rendezvous/RendezvousTransport.d.ts +36 -0
- package/lib/rendezvous/RendezvousTransport.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousTransport.js +1 -0
- package/lib/rendezvous/RendezvousTransport.js.map +1 -0
- package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts +58 -0
- package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts.map +1 -0
- package/lib/rendezvous/channels/MSC4108SecureChannel.js +246 -0
- package/lib/rendezvous/channels/MSC4108SecureChannel.js.map +1 -0
- package/lib/rendezvous/channels/index.d.ts +2 -0
- package/lib/rendezvous/channels/index.d.ts.map +1 -0
- package/lib/rendezvous/channels/index.js +18 -0
- package/lib/rendezvous/channels/index.js.map +1 -0
- package/lib/rendezvous/index.d.ts +10 -0
- package/lib/rendezvous/index.d.ts.map +1 -0
- package/lib/rendezvous/index.js +23 -0
- package/lib/rendezvous/index.js.map +1 -0
- package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts +61 -0
- package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts.map +1 -0
- package/lib/rendezvous/transports/MSC4108RendezvousSession.js +253 -0
- package/lib/rendezvous/transports/MSC4108RendezvousSession.js.map +1 -0
- package/lib/rendezvous/transports/index.d.ts +2 -0
- package/lib/rendezvous/transports/index.d.ts.map +1 -0
- package/lib/rendezvous/transports/index.js +18 -0
- package/lib/rendezvous/transports/index.js.map +1 -0
- package/lib/room-hierarchy.d.ts +35 -0
- package/lib/room-hierarchy.d.ts.map +1 -0
- package/lib/room-hierarchy.js +136 -0
- package/lib/room-hierarchy.js.map +1 -0
- package/lib/rust-crypto/CrossSigningIdentity.d.ts +33 -0
- package/lib/rust-crypto/CrossSigningIdentity.d.ts.map +1 -0
- package/lib/rust-crypto/CrossSigningIdentity.js +157 -0
- package/lib/rust-crypto/CrossSigningIdentity.js.map +1 -0
- package/lib/rust-crypto/DehydratedDeviceManager.d.ts +98 -0
- package/lib/rust-crypto/DehydratedDeviceManager.d.ts.map +1 -0
- package/lib/rust-crypto/DehydratedDeviceManager.js +285 -0
- package/lib/rust-crypto/DehydratedDeviceManager.js.map +1 -0
- package/lib/rust-crypto/KeyClaimManager.d.ts +33 -0
- package/lib/rust-crypto/KeyClaimManager.d.ts.map +1 -0
- package/lib/rust-crypto/KeyClaimManager.js +82 -0
- package/lib/rust-crypto/KeyClaimManager.js.map +1 -0
- package/lib/rust-crypto/OutgoingRequestProcessor.d.ts +43 -0
- package/lib/rust-crypto/OutgoingRequestProcessor.d.ts.map +1 -0
- package/lib/rust-crypto/OutgoingRequestProcessor.js +195 -0
- package/lib/rust-crypto/OutgoingRequestProcessor.js.map +1 -0
- package/lib/rust-crypto/OutgoingRequestsManager.d.ts +47 -0
- package/lib/rust-crypto/OutgoingRequestsManager.d.ts.map +1 -0
- package/lib/rust-crypto/OutgoingRequestsManager.js +148 -0
- package/lib/rust-crypto/OutgoingRequestsManager.js.map +1 -0
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts +120 -0
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts.map +1 -0
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.js +467 -0
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.js.map +1 -0
- package/lib/rust-crypto/RoomEncryptor.d.ts +98 -0
- package/lib/rust-crypto/RoomEncryptor.d.ts.map +1 -0
- package/lib/rust-crypto/RoomEncryptor.js +299 -0
- package/lib/rust-crypto/RoomEncryptor.js.map +1 -0
- package/lib/rust-crypto/backup.d.ts +254 -0
- package/lib/rust-crypto/backup.d.ts.map +1 -0
- package/lib/rust-crypto/backup.js +837 -0
- package/lib/rust-crypto/backup.js.map +1 -0
- package/lib/rust-crypto/constants.d.ts +3 -0
- package/lib/rust-crypto/constants.d.ts.map +1 -0
- package/lib/rust-crypto/constants.js +19 -0
- package/lib/rust-crypto/constants.js.map +1 -0
- package/lib/rust-crypto/device-converter.d.ts +28 -0
- package/lib/rust-crypto/device-converter.d.ts.map +1 -0
- package/lib/rust-crypto/device-converter.js +123 -0
- package/lib/rust-crypto/device-converter.js.map +1 -0
- package/lib/rust-crypto/index.d.ts +61 -0
- package/lib/rust-crypto/index.d.ts.map +1 -0
- package/lib/rust-crypto/index.js +152 -0
- package/lib/rust-crypto/index.js.map +1 -0
- package/lib/rust-crypto/libolm_migration.d.ts +81 -0
- package/lib/rust-crypto/libolm_migration.d.ts.map +1 -0
- package/lib/rust-crypto/libolm_migration.js +459 -0
- package/lib/rust-crypto/libolm_migration.js.map +1 -0
- package/lib/rust-crypto/rust-crypto.d.ts +556 -0
- package/lib/rust-crypto/rust-crypto.d.ts.map +1 -0
- package/lib/rust-crypto/rust-crypto.js +2016 -0
- package/lib/rust-crypto/rust-crypto.js.map +1 -0
- package/lib/rust-crypto/secret-storage.d.ts +22 -0
- package/lib/rust-crypto/secret-storage.d.ts.map +1 -0
- package/lib/rust-crypto/secret-storage.js +63 -0
- package/lib/rust-crypto/secret-storage.js.map +1 -0
- package/lib/rust-crypto/verification.d.ts +319 -0
- package/lib/rust-crypto/verification.d.ts.map +1 -0
- package/lib/rust-crypto/verification.js +816 -0
- package/lib/rust-crypto/verification.js.map +1 -0
- package/lib/scheduler.d.ts +132 -0
- package/lib/scheduler.d.ts.map +1 -0
- package/lib/scheduler.js +259 -0
- package/lib/scheduler.js.map +1 -0
- package/lib/secret-storage.d.ts +370 -0
- package/lib/secret-storage.d.ts.map +1 -0
- package/lib/secret-storage.js +466 -0
- package/lib/secret-storage.js.map +1 -0
- package/lib/serverCapabilities.d.ts +72 -0
- package/lib/serverCapabilities.d.ts.map +1 -0
- package/lib/serverCapabilities.js +105 -0
- package/lib/serverCapabilities.js.map +1 -0
- package/lib/service-types.d.ts +5 -0
- package/lib/service-types.d.ts.map +1 -0
- package/lib/service-types.js +22 -0
- package/lib/service-types.js.map +1 -0
- package/lib/sliding-sync-sdk.d.ts +107 -0
- package/lib/sliding-sync-sdk.d.ts.map +1 -0
- package/lib/sliding-sync-sdk.js +903 -0
- package/lib/sliding-sync-sdk.js.map +1 -0
- package/lib/sliding-sync.d.ts +343 -0
- package/lib/sliding-sync.d.ts.map +1 -0
- package/lib/sliding-sync.js +817 -0
- package/lib/sliding-sync.js.map +1 -0
- package/lib/store/index.d.ts +201 -0
- package/lib/store/index.d.ts.map +1 -0
- package/lib/store/index.js +1 -0
- package/lib/store/index.js.map +1 -0
- package/lib/store/indexeddb-backend.d.ts +24 -0
- package/lib/store/indexeddb-backend.d.ts.map +1 -0
- package/lib/store/indexeddb-backend.js +1 -0
- package/lib/store/indexeddb-backend.js.map +1 -0
- package/lib/store/indexeddb-local-backend.d.ts +129 -0
- package/lib/store/indexeddb-local-backend.d.ts.map +1 -0
- package/lib/store/indexeddb-local-backend.js +597 -0
- package/lib/store/indexeddb-local-backend.js.map +1 -0
- package/lib/store/indexeddb-remote-backend.d.ts +79 -0
- package/lib/store/indexeddb-remote-backend.d.ts.map +1 -0
- package/lib/store/indexeddb-remote-backend.js +210 -0
- package/lib/store/indexeddb-remote-backend.js.map +1 -0
- package/lib/store/indexeddb-store-worker.d.ts +35 -0
- package/lib/store/indexeddb-store-worker.d.ts.map +1 -0
- package/lib/store/indexeddb-store-worker.js +146 -0
- package/lib/store/indexeddb-store-worker.js.map +1 -0
- package/lib/store/indexeddb.d.ts +142 -0
- package/lib/store/indexeddb.d.ts.map +1 -0
- package/lib/store/indexeddb.js +347 -0
- package/lib/store/indexeddb.js.map +1 -0
- package/lib/store/local-storage-events-emitter.d.ts +30 -0
- package/lib/store/local-storage-events-emitter.d.ts.map +1 -0
- package/lib/store/local-storage-events-emitter.js +37 -0
- package/lib/store/local-storage-events-emitter.js.map +1 -0
- package/lib/store/memory.d.ts +209 -0
- package/lib/store/memory.d.ts.map +1 -0
- package/lib/store/memory.js +432 -0
- package/lib/store/memory.js.map +1 -0
- package/lib/store/stub.d.ts +161 -0
- package/lib/store/stub.d.ts.map +1 -0
- package/lib/store/stub.js +268 -0
- package/lib/store/stub.js.map +1 -0
- package/lib/sync-accumulator.d.ts +172 -0
- package/lib/sync-accumulator.d.ts.map +1 -0
- package/lib/sync-accumulator.js +532 -0
- package/lib/sync-accumulator.js.map +1 -0
- package/lib/sync.d.ts +260 -0
- package/lib/sync.d.ts.map +1 -0
- package/lib/sync.js +1686 -0
- package/lib/sync.js.map +1 -0
- package/lib/testing.d.ts +81 -0
- package/lib/testing.d.ts.map +1 -0
- package/lib/testing.js +162 -0
- package/lib/testing.js.map +1 -0
- package/lib/thread-utils.d.ts +10 -0
- package/lib/thread-utils.d.ts.map +1 -0
- package/lib/thread-utils.js +31 -0
- package/lib/thread-utils.js.map +1 -0
- package/lib/timeline-window.d.ts +168 -0
- package/lib/timeline-window.d.ts.map +1 -0
- package/lib/timeline-window.js +494 -0
- package/lib/timeline-window.js.map +1 -0
- package/lib/types.d.ts +33 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +33 -0
- package/lib/types.js.map +1 -0
- package/lib/utils/decryptAESSecretStorageItem.d.ts +12 -0
- package/lib/utils/decryptAESSecretStorageItem.d.ts.map +1 -0
- package/lib/utils/decryptAESSecretStorageItem.js +50 -0
- package/lib/utils/decryptAESSecretStorageItem.js.map +1 -0
- package/lib/utils/encryptAESSecretStorageItem.d.ts +16 -0
- package/lib/utils/encryptAESSecretStorageItem.d.ts.map +1 -0
- package/lib/utils/encryptAESSecretStorageItem.js +68 -0
- package/lib/utils/encryptAESSecretStorageItem.js.map +1 -0
- package/lib/utils/internal/deriveKeys.d.ts +10 -0
- package/lib/utils/internal/deriveKeys.d.ts.map +1 -0
- package/lib/utils/internal/deriveKeys.js +60 -0
- package/lib/utils/internal/deriveKeys.js.map +1 -0
- package/lib/utils.d.ts +267 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +749 -0
- package/lib/utils.js.map +1 -0
- package/lib/version-support.d.ts +19 -0
- package/lib/version-support.d.ts.map +1 -0
- package/lib/version-support.js +37 -0
- package/lib/version-support.js.map +1 -0
- package/lib/webrtc/audioContext.d.ts +15 -0
- package/lib/webrtc/audioContext.d.ts.map +1 -0
- package/lib/webrtc/audioContext.js +46 -0
- package/lib/webrtc/audioContext.js.map +1 -0
- package/lib/webrtc/call.d.ts +560 -0
- package/lib/webrtc/call.d.ts.map +1 -0
- package/lib/webrtc/call.js +2541 -0
- package/lib/webrtc/call.js.map +1 -0
- package/lib/webrtc/callEventHandler.d.ts +37 -0
- package/lib/webrtc/callEventHandler.d.ts.map +1 -0
- package/lib/webrtc/callEventHandler.js +344 -0
- package/lib/webrtc/callEventHandler.js.map +1 -0
- package/lib/webrtc/callEventTypes.d.ts +73 -0
- package/lib/webrtc/callEventTypes.d.ts.map +1 -0
- package/lib/webrtc/callEventTypes.js +13 -0
- package/lib/webrtc/callEventTypes.js.map +1 -0
- package/lib/webrtc/callFeed.d.ts +128 -0
- package/lib/webrtc/callFeed.d.ts.map +1 -0
- package/lib/webrtc/callFeed.js +289 -0
- package/lib/webrtc/callFeed.js.map +1 -0
- package/lib/webrtc/groupCall.d.ts +323 -0
- package/lib/webrtc/groupCall.d.ts.map +1 -0
- package/lib/webrtc/groupCall.js +1337 -0
- package/lib/webrtc/groupCall.js.map +1 -0
- package/lib/webrtc/groupCallEventHandler.d.ts +31 -0
- package/lib/webrtc/groupCallEventHandler.d.ts.map +1 -0
- package/lib/webrtc/groupCallEventHandler.js +178 -0
- package/lib/webrtc/groupCallEventHandler.js.map +1 -0
- package/lib/webrtc/mediaHandler.d.ts +89 -0
- package/lib/webrtc/mediaHandler.d.ts.map +1 -0
- package/lib/webrtc/mediaHandler.js +437 -0
- package/lib/webrtc/mediaHandler.js.map +1 -0
- package/lib/webrtc/stats/callFeedStatsReporter.d.ts +8 -0
- package/lib/webrtc/stats/callFeedStatsReporter.d.ts.map +1 -0
- package/lib/webrtc/stats/callFeedStatsReporter.js +82 -0
- package/lib/webrtc/stats/callFeedStatsReporter.js.map +1 -0
- package/lib/webrtc/stats/callStatsReportGatherer.d.ts +25 -0
- package/lib/webrtc/stats/callStatsReportGatherer.d.ts.map +1 -0
- package/lib/webrtc/stats/callStatsReportGatherer.js +199 -0
- package/lib/webrtc/stats/callStatsReportGatherer.js.map +1 -0
- package/lib/webrtc/stats/callStatsReportSummary.d.ts +17 -0
- package/lib/webrtc/stats/callStatsReportSummary.d.ts.map +1 -0
- package/lib/webrtc/stats/callStatsReportSummary.js +1 -0
- package/lib/webrtc/stats/callStatsReportSummary.js.map +1 -0
- package/lib/webrtc/stats/connectionStats.d.ts +28 -0
- package/lib/webrtc/stats/connectionStats.d.ts.map +1 -0
- package/lib/webrtc/stats/connectionStats.js +26 -0
- package/lib/webrtc/stats/connectionStats.js.map +1 -0
- package/lib/webrtc/stats/connectionStatsBuilder.d.ts +5 -0
- package/lib/webrtc/stats/connectionStatsBuilder.d.ts.map +1 -0
- package/lib/webrtc/stats/connectionStatsBuilder.js +27 -0
- package/lib/webrtc/stats/connectionStatsBuilder.js.map +1 -0
- package/lib/webrtc/stats/connectionStatsReportBuilder.d.ts +7 -0
- package/lib/webrtc/stats/connectionStatsReportBuilder.d.ts.map +1 -0
- package/lib/webrtc/stats/connectionStatsReportBuilder.js +121 -0
- package/lib/webrtc/stats/connectionStatsReportBuilder.js.map +1 -0
- package/lib/webrtc/stats/groupCallStats.d.ts +22 -0
- package/lib/webrtc/stats/groupCallStats.d.ts.map +1 -0
- package/lib/webrtc/stats/groupCallStats.js +78 -0
- package/lib/webrtc/stats/groupCallStats.js.map +1 -0
- package/lib/webrtc/stats/media/mediaSsrcHandler.d.ts +10 -0
- package/lib/webrtc/stats/media/mediaSsrcHandler.d.ts.map +1 -0
- package/lib/webrtc/stats/media/mediaSsrcHandler.js +57 -0
- package/lib/webrtc/stats/media/mediaSsrcHandler.js.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackHandler.d.ts +12 -0
- package/lib/webrtc/stats/media/mediaTrackHandler.d.ts.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackHandler.js +62 -0
- package/lib/webrtc/stats/media/mediaTrackHandler.js.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackStats.d.ts +86 -0
- package/lib/webrtc/stats/media/mediaTrackStats.d.ts.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackStats.js +142 -0
- package/lib/webrtc/stats/media/mediaTrackStats.js.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.d.ts +22 -0
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.d.ts.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.js +76 -0
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.js.map +1 -0
- package/lib/webrtc/stats/statsReport.d.ts +99 -0
- package/lib/webrtc/stats/statsReport.d.ts.map +1 -0
- package/lib/webrtc/stats/statsReport.js +32 -0
- package/lib/webrtc/stats/statsReport.js.map +1 -0
- package/lib/webrtc/stats/statsReportEmitter.d.ts +15 -0
- package/lib/webrtc/stats/statsReportEmitter.d.ts.map +1 -0
- package/lib/webrtc/stats/statsReportEmitter.js +33 -0
- package/lib/webrtc/stats/statsReportEmitter.js.map +1 -0
- package/lib/webrtc/stats/summaryStatsReportGatherer.d.ts +16 -0
- package/lib/webrtc/stats/summaryStatsReportGatherer.d.ts.map +1 -0
- package/lib/webrtc/stats/summaryStatsReportGatherer.js +116 -0
- package/lib/webrtc/stats/summaryStatsReportGatherer.js.map +1 -0
- package/lib/webrtc/stats/trackStatsBuilder.d.ts +19 -0
- package/lib/webrtc/stats/trackStatsBuilder.d.ts.map +1 -0
- package/lib/webrtc/stats/trackStatsBuilder.js +168 -0
- package/lib/webrtc/stats/trackStatsBuilder.js.map +1 -0
- package/lib/webrtc/stats/transportStats.d.ts +11 -0
- package/lib/webrtc/stats/transportStats.d.ts.map +1 -0
- package/lib/webrtc/stats/transportStats.js +1 -0
- package/lib/webrtc/stats/transportStats.js.map +1 -0
- package/lib/webrtc/stats/transportStatsBuilder.d.ts +5 -0
- package/lib/webrtc/stats/transportStatsBuilder.d.ts.map +1 -0
- package/lib/webrtc/stats/transportStatsBuilder.js +34 -0
- package/lib/webrtc/stats/transportStatsBuilder.js.map +1 -0
- package/lib/webrtc/stats/valueFormatter.d.ts +4 -0
- package/lib/webrtc/stats/valueFormatter.d.ts.map +1 -0
- package/lib/webrtc/stats/valueFormatter.js +25 -0
- package/lib/webrtc/stats/valueFormatter.js.map +1 -0
- package/package.json +134 -0
- package/src/@types/AESEncryptedSecretStoragePayload.ts +29 -0
- package/src/@types/IIdentityServerProvider.ts +24 -0
- package/src/@types/PushRules.ts +209 -0
- package/src/@types/another-json.d.ts +19 -0
- package/src/@types/auth.ts +252 -0
- package/src/@types/beacon.ts +140 -0
- package/src/@types/common.ts +22 -0
- package/src/@types/crypto.ts +73 -0
- package/src/@types/event.ts +370 -0
- package/src/@types/events.ts +119 -0
- package/src/@types/extensible_events.ts +150 -0
- package/src/@types/global.d.ts +70 -0
- package/src/@types/local_notifications.ts +19 -0
- package/src/@types/location.ts +92 -0
- package/src/@types/matrix-sdk-crypto-wasm.d.ts +44 -0
- package/src/@types/media.ts +245 -0
- package/src/@types/membership.ts +57 -0
- package/src/@types/oidc-client-ts.d.ts +24 -0
- package/src/@types/partials.ts +67 -0
- package/src/@types/polls.ts +119 -0
- package/src/@types/read_receipts.ts +61 -0
- package/src/@types/registration.ts +102 -0
- package/src/@types/requests.ts +314 -0
- package/src/@types/search.ts +119 -0
- package/src/@types/signed.ts +25 -0
- package/src/@types/spaces.ts +37 -0
- package/src/@types/state_events.ts +147 -0
- package/src/@types/synapse.ts +40 -0
- package/src/@types/sync.ts +27 -0
- package/src/@types/threepids.ts +29 -0
- package/src/@types/topic.ts +63 -0
- package/src/@types/uia.ts +29 -0
- package/src/NamespacedValue.ts +123 -0
- package/src/ReEmitter.ts +93 -0
- package/src/ToDeviceMessageQueue.ts +153 -0
- package/src/autodiscovery.ts +505 -0
- package/src/base64.ts +88 -0
- package/src/browser-index.ts +44 -0
- package/src/client.ts +10474 -0
- package/src/common-crypto/CryptoBackend.ts +302 -0
- package/src/common-crypto/README.md +4 -0
- package/src/common-crypto/key-passphrase.ts +43 -0
- package/src/content-helpers.ts +288 -0
- package/src/content-repo.ts +117 -0
- package/src/crypto/CrossSigning.ts +773 -0
- package/src/crypto/DeviceList.ts +989 -0
- package/src/crypto/EncryptionSetup.ts +351 -0
- package/src/crypto/OlmDevice.ts +1500 -0
- package/src/crypto/OutgoingRoomKeyRequestManager.ts +485 -0
- package/src/crypto/RoomList.ts +70 -0
- package/src/crypto/SecretSharing.ts +240 -0
- package/src/crypto/SecretStorage.ts +136 -0
- package/src/crypto/aes.ts +23 -0
- package/src/crypto/algorithms/base.ts +236 -0
- package/src/crypto/algorithms/index.ts +20 -0
- package/src/crypto/algorithms/megolm.ts +2216 -0
- package/src/crypto/algorithms/olm.ts +381 -0
- package/src/crypto/api.ts +70 -0
- package/src/crypto/backup.ts +922 -0
- package/src/crypto/crypto.ts +18 -0
- package/src/crypto/dehydration.ts +272 -0
- package/src/crypto/device-converter.ts +45 -0
- package/src/crypto/deviceinfo.ts +158 -0
- package/src/crypto/index.ts +4414 -0
- package/src/crypto/key_passphrase.ts +42 -0
- package/src/crypto/keybackup.ts +47 -0
- package/src/crypto/olmlib.ts +539 -0
- package/src/crypto/recoverykey.ts +18 -0
- package/src/crypto/store/base.ts +348 -0
- package/src/crypto/store/indexeddb-crypto-store-backend.ts +1250 -0
- package/src/crypto/store/indexeddb-crypto-store.ts +845 -0
- package/src/crypto/store/localStorage-crypto-store.ts +579 -0
- package/src/crypto/store/memory-crypto-store.ts +680 -0
- package/src/crypto/verification/Base.ts +409 -0
- package/src/crypto/verification/Error.ts +76 -0
- package/src/crypto/verification/IllegalMethod.ts +50 -0
- package/src/crypto/verification/QRCode.ts +310 -0
- package/src/crypto/verification/SAS.ts +494 -0
- package/src/crypto/verification/SASDecimal.ts +37 -0
- package/src/crypto/verification/request/Channel.ts +34 -0
- package/src/crypto/verification/request/InRoomChannel.ts +371 -0
- package/src/crypto/verification/request/ToDeviceChannel.ts +354 -0
- package/src/crypto/verification/request/VerificationRequest.ts +976 -0
- package/src/crypto-api/CryptoEvent.ts +93 -0
- package/src/crypto-api/CryptoEventHandlerMap.ts +32 -0
- package/src/crypto-api/index.ts +1175 -0
- package/src/crypto-api/key-passphrase.ts +58 -0
- package/src/crypto-api/keybackup.ts +115 -0
- package/src/crypto-api/recovery-key.ts +69 -0
- package/src/crypto-api/verification.ts +408 -0
- package/src/digest.ts +34 -0
- package/src/embedded.ts +631 -0
- package/src/errors.ts +54 -0
- package/src/event-mapper.ts +97 -0
- package/src/extensible_events_v1/ExtensibleEvent.ts +58 -0
- package/src/extensible_events_v1/InvalidEventError.ts +24 -0
- package/src/extensible_events_v1/MessageEvent.ts +145 -0
- package/src/extensible_events_v1/PollEndEvent.ts +97 -0
- package/src/extensible_events_v1/PollResponseEvent.ts +148 -0
- package/src/extensible_events_v1/PollStartEvent.ts +207 -0
- package/src/extensible_events_v1/utilities.ts +35 -0
- package/src/feature.ts +87 -0
- package/src/filter-component.ts +207 -0
- package/src/filter.ts +245 -0
- package/src/http-api/errors.ts +199 -0
- package/src/http-api/fetch.ts +383 -0
- package/src/http-api/index.ts +191 -0
- package/src/http-api/interface.ts +178 -0
- package/src/http-api/method.ts +25 -0
- package/src/http-api/prefix.ts +48 -0
- package/src/http-api/utils.ts +200 -0
- package/src/index.ts +25 -0
- package/src/indexeddb-helpers.ts +50 -0
- package/src/indexeddb-worker.ts +24 -0
- package/src/interactive-auth.ts +694 -0
- package/src/logger.ts +185 -0
- package/src/matrix.ts +177 -0
- package/src/matrixrtc/CallMembership.ts +247 -0
- package/src/matrixrtc/LivekitFocus.ts +39 -0
- package/src/matrixrtc/MatrixRTCSession.ts +1319 -0
- package/src/matrixrtc/MatrixRTCSessionManager.ts +166 -0
- package/src/matrixrtc/focus.ts +25 -0
- package/src/matrixrtc/index.ts +22 -0
- package/src/matrixrtc/types.ts +36 -0
- package/src/models/MSC3089Branch.ts +272 -0
- package/src/models/MSC3089TreeSpace.ts +565 -0
- package/src/models/ToDeviceMessage.ts +38 -0
- package/src/models/beacon.ts +214 -0
- package/src/models/compare-event-ordering.ts +139 -0
- package/src/models/device.ts +85 -0
- package/src/models/event-context.ts +110 -0
- package/src/models/event-status.ts +39 -0
- package/src/models/event-timeline-set.ts +979 -0
- package/src/models/event-timeline.ts +476 -0
- package/src/models/event.ts +1751 -0
- package/src/models/invites-ignorer.ts +376 -0
- package/src/models/poll.ts +285 -0
- package/src/models/profile-keys.ts +7 -0
- package/src/models/read-receipt.ts +422 -0
- package/src/models/related-relations.ts +39 -0
- package/src/models/relations-container.ts +149 -0
- package/src/models/relations.ts +368 -0
- package/src/models/room-member.ts +457 -0
- package/src/models/room-receipts.ts +439 -0
- package/src/models/room-state.ts +1130 -0
- package/src/models/room-summary.ts +47 -0
- package/src/models/room.ts +3822 -0
- package/src/models/search-result.ts +57 -0
- package/src/models/thread.ts +923 -0
- package/src/models/typed-event-emitter.ts +246 -0
- package/src/models/user.ts +302 -0
- package/src/oidc/authorize.ts +274 -0
- package/src/oidc/discovery.ts +60 -0
- package/src/oidc/error.ts +33 -0
- package/src/oidc/index.ts +34 -0
- package/src/oidc/register.ts +123 -0
- package/src/oidc/tokenRefresher.ts +149 -0
- package/src/oidc/validate.ts +282 -0
- package/src/pushprocessor.ts +837 -0
- package/src/randomstring.ts +51 -0
- package/src/realtime-callbacks.ts +191 -0
- package/src/receipt-accumulator.ts +189 -0
- package/src/rendezvous/MSC4108SignInWithQR.ts +444 -0
- package/src/rendezvous/RendezvousChannel.ts +48 -0
- package/src/rendezvous/RendezvousCode.ts +25 -0
- package/src/rendezvous/RendezvousError.ts +26 -0
- package/src/rendezvous/RendezvousFailureReason.ts +49 -0
- package/src/rendezvous/RendezvousIntent.ts +20 -0
- package/src/rendezvous/RendezvousTransport.ts +58 -0
- package/src/rendezvous/channels/MSC4108SecureChannel.ts +270 -0
- package/src/rendezvous/channels/index.ts +17 -0
- package/src/rendezvous/index.ts +25 -0
- package/src/rendezvous/transports/MSC4108RendezvousSession.ts +270 -0
- package/src/rendezvous/transports/index.ts +17 -0
- package/src/room-hierarchy.ts +152 -0
- package/src/rust-crypto/CrossSigningIdentity.ts +183 -0
- package/src/rust-crypto/DehydratedDeviceManager.ts +306 -0
- package/src/rust-crypto/KeyClaimManager.ts +86 -0
- package/src/rust-crypto/OutgoingRequestProcessor.ts +236 -0
- package/src/rust-crypto/OutgoingRequestsManager.ts +143 -0
- package/src/rust-crypto/PerSessionKeyBackupDownloader.ts +501 -0
- package/src/rust-crypto/RoomEncryptor.ts +352 -0
- package/src/rust-crypto/backup.ts +881 -0
- package/src/rust-crypto/constants.ts +18 -0
- package/src/rust-crypto/device-converter.ts +128 -0
- package/src/rust-crypto/index.ts +237 -0
- package/src/rust-crypto/libolm_migration.ts +530 -0
- package/src/rust-crypto/rust-crypto.ts +2205 -0
- package/src/rust-crypto/secret-storage.ts +60 -0
- package/src/rust-crypto/verification.ts +830 -0
- package/src/scheduler.ts +309 -0
- package/src/secret-storage.ts +693 -0
- package/src/serverCapabilities.ts +139 -0
- package/src/service-types.ts +20 -0
- package/src/sliding-sync-sdk.ts +1026 -0
- package/src/sliding-sync.ts +965 -0
- package/src/store/index.ts +261 -0
- package/src/store/indexeddb-backend.ts +41 -0
- package/src/store/indexeddb-local-backend.ts +610 -0
- package/src/store/indexeddb-remote-backend.ts +213 -0
- package/src/store/indexeddb-store-worker.ts +157 -0
- package/src/store/indexeddb.ts +397 -0
- package/src/store/local-storage-events-emitter.ts +46 -0
- package/src/store/memory.ts +448 -0
- package/src/store/stub.ts +280 -0
- package/src/sync-accumulator.ts +689 -0
- package/src/sync.ts +1920 -0
- package/src/testing.ts +191 -0
- package/src/thread-utils.ts +31 -0
- package/src/timeline-window.ts +536 -0
- package/src/types.ts +59 -0
- package/src/utils/decryptAESSecretStorageItem.ts +54 -0
- package/src/utils/encryptAESSecretStorageItem.ts +73 -0
- package/src/utils/internal/deriveKeys.ts +63 -0
- package/src/utils.ts +763 -0
- package/src/version-support.ts +36 -0
- package/src/webrtc/audioContext.ts +44 -0
- package/src/webrtc/call.ts +3074 -0
- package/src/webrtc/callEventHandler.ts +425 -0
- package/src/webrtc/callEventTypes.ts +93 -0
- package/src/webrtc/callFeed.ts +364 -0
- package/src/webrtc/groupCall.ts +1735 -0
- package/src/webrtc/groupCallEventHandler.ts +234 -0
- package/src/webrtc/mediaHandler.ts +484 -0
- package/src/webrtc/stats/callFeedStatsReporter.ts +94 -0
- package/src/webrtc/stats/callStatsReportGatherer.ts +219 -0
- package/src/webrtc/stats/callStatsReportSummary.ts +30 -0
- package/src/webrtc/stats/connectionStats.ts +47 -0
- package/src/webrtc/stats/connectionStatsBuilder.ts +28 -0
- package/src/webrtc/stats/connectionStatsReportBuilder.ts +140 -0
- package/src/webrtc/stats/groupCallStats.ts +93 -0
- package/src/webrtc/stats/media/mediaSsrcHandler.ts +57 -0
- package/src/webrtc/stats/media/mediaTrackHandler.ts +76 -0
- package/src/webrtc/stats/media/mediaTrackStats.ts +176 -0
- package/src/webrtc/stats/media/mediaTrackStatsHandler.ts +90 -0
- package/src/webrtc/stats/statsReport.ts +133 -0
- package/src/webrtc/stats/statsReportEmitter.ts +49 -0
- package/src/webrtc/stats/summaryStatsReportGatherer.ts +148 -0
- package/src/webrtc/stats/trackStatsBuilder.ts +207 -0
- package/src/webrtc/stats/transportStats.ts +26 -0
- package/src/webrtc/stats/transportStatsBuilder.ts +48 -0
- package/src/webrtc/stats/valueFormatter.ts +27 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"sliding-sync-sdk.js","names":["NotificationCountType","Room","RoomEvent","logger","promiseMapSeries","EventTimeline","ClientEvent","SyncState","_createAndReEmitRoom","defaultClientOpts","defaultSyncApiOpts","MatrixError","ExtensionState","SlidingSyncEvent","SlidingSyncState","EventType","RoomStateEvent","RoomMemberEvent","KnownMembership","FAILED_SYNC_ERROR_THRESHOLD","ExtensionE2EE","constructor","crypto","name","when","PreProcess","onRequest","isInitial","undefined","enabled","onResponse","data","_this","_asyncToGenerator","device_lists","processDeviceLists","processKeyCounts","device_one_time_keys_count","onSyncCompleted","ExtensionToDevice","client","cryptoCallbacks","_defineProperty","extReq","since","nextBatch","_this2","cancelledKeyVerificationTxns","events","length","preprocessToDeviceMessages","map","getEventMapper","toDeviceEvent","getType","txnId","getContent","push","forEach","content","msgtype","log","getSender","includes","flagCancelled","emit","ToDeviceEvent","next_batch","ExtensionAccountData","PostProcess","_this3","global","processGlobalAccountData","roomId","rooms","accountDataEvents","mapEvents","room","getRoom","warn","addAccountData","e","Event","globalAccountData","prevEventsMap","reduce","m","c","store","getAccountData","storeAccountDataEvents","accountDataEvent","PushRules","rules","setPushRules","prevEvent","AccountData","ExtensionTyping","_this4","processEphemeralEvents","ExtensionReceipts","_this5","SlidingSyncSdk","slidingSync","opts","syncOpts","getNotifTimelineSet","reEmitter","reEmit","Timeline","TimelineReset","on","Lifecycle","onLifecycle","bind","RoomData","onRoomData","extensions","ext","registerExtension","roomData","_this6","initial","debug","processRoomData","state","resp","err","Complete","purgeNotifications","lastPos","updateSyncState","Prepared","oldSyncToken","nextSyncToken","pos","catchingUp","fromCache","Syncing","RequestFinished","failCount","Error","Reconnecting","error","shouldAbortSync","syncLeftRooms","peek","stopPeeking","setPresence","presence","getSyncState","syncState","getSyncStateData","_this$syncStateData","syncStateData","createRoom","timelineSupport","getUserId","lazyLoadMembers","pendingEventOrdering","Name","Redaction","RedactionCancelled","Receipt","Tags","LocalEchoUpdated","MyMembership","registerStateListeners","currentState","Events","Members","NewMember","Update","event","member","_this$client$getUser","user","getUser","userId","Typing","PowerLevel","Membership","errcode","stop","_this7","ensureNameEvent","stateEvents","required_state","timelineEvents","timeline","ephemeralEvents","knownEvents","Set","getLiveTimeline","getEvents","add","getId","oldEvents","newEvents","seenKnownEvent","i","recvEvent","has","unshift","addEventsToTimeline","prev_batch","encrypted","hasEncryptionStateEvent","notification_count","setUnreadNotificationCount","Total","highlight_count","getUnreadNotificationCount","Highlight","Number","isInteger","invited_count","setInvitedMemberCount","joined_count","setJoinedMemberCount","invite_state","inviteStateEvents","injectRoomEvents","recalculate","storeRoom","updateMyMembership","Invite","_roomData$prev_batch","setPaginationToken","BACKWARDS","num_live","addEphemeralEvents","Join","addNotifications","processRoomEvent","_ref","isState","RoomEncryption","onCryptoEvent","_x","apply","arguments","decryptCriticalEvents","stateEventList","timelineEventList","numLive","_this8","liveTimeline","timelineWasEmpty","ev","getPushActionsForEvent","initialiseState","oldState","setStateEvents","liveTimelineEvents","slice","addLiveEvents","resolveInvites","resolveInvitesToProfiles","getMembersWithMembership","requestedProfileInfo","promise","Promise","resolve","avatar_url","avatarUrl","displayname","displayName","getProfileInfo","then","info","inviteEvent","membership","setMembershipEvent","_err","retryImmediately","sync","_this9","isGuest","result","getPushRules","pushRules","start","newState","old","Sync","timelineEvent","pushActions","notify","tweaks","highlight","notifEvents","sort","a","b","getTs","_this$client$getNotif","addLiveEvent","stateEvent","type","RoomName","state_key","event_id","sender","origin_server_ts","Date","getTime","decrypt","mapper","room_id","ephEvents"],"sources":["../src/sliding-sync-sdk.ts"],"sourcesContent":["/*\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport type { SyncCryptoCallbacks } from \"./common-crypto/CryptoBackend.ts\";\nimport { NotificationCountType, Room, RoomEvent } from \"./models/room.ts\";\nimport { logger } from \"./logger.ts\";\nimport { promiseMapSeries } from \"./utils.ts\";\nimport { EventTimeline } from \"./models/event-timeline.ts\";\nimport { ClientEvent, IStoredClientOpts, MatrixClient } from \"./client.ts\";\nimport {\n ISyncStateData,\n SyncState,\n _createAndReEmitRoom,\n SyncApiOptions,\n defaultClientOpts,\n defaultSyncApiOpts,\n SetPresence,\n} from \"./sync.ts\";\nimport { MatrixEvent } from \"./models/event.ts\";\nimport { Crypto } from \"./crypto/index.ts\";\nimport { IMinimalEvent, IRoomEvent, IStateEvent, IStrippedState, ISyncResponse } from \"./sync-accumulator.ts\";\nimport { MatrixError } from \"./http-api/index.ts\";\nimport {\n Extension,\n ExtensionState,\n MSC3575RoomData,\n MSC3575SlidingSyncResponse,\n SlidingSync,\n SlidingSyncEvent,\n SlidingSyncState,\n} from \"./sliding-sync.ts\";\nimport { EventType } from \"./@types/event.ts\";\nimport { IPushRules } from \"./@types/PushRules.ts\";\nimport { RoomStateEvent } from \"./models/room-state.ts\";\nimport { RoomMemberEvent } from \"./models/room-member.ts\";\nimport { KnownMembership } from \"./@types/membership.ts\";\n\n// Number of consecutive failed syncs that will lead to a syncState of ERROR as opposed\n// to RECONNECTING. This is needed to inform the client of server issues when the\n// keepAlive is successful but the server /sync fails.\nconst FAILED_SYNC_ERROR_THRESHOLD = 3;\n\ntype ExtensionE2EERequest = {\n enabled: boolean;\n};\n\ntype ExtensionE2EEResponse = Pick<\n ISyncResponse,\n | \"device_lists\"\n | \"device_one_time_keys_count\"\n | \"device_unused_fallback_key_types\"\n | \"org.matrix.msc2732.device_unused_fallback_key_types\"\n>;\n\nclass ExtensionE2EE implements Extension<ExtensionE2EERequest, ExtensionE2EEResponse> {\n public constructor(private readonly crypto: Crypto) {}\n\n public name(): string {\n return \"e2ee\";\n }\n\n public when(): ExtensionState {\n return ExtensionState.PreProcess;\n }\n\n public onRequest(isInitial: boolean): ExtensionE2EERequest | undefined {\n if (!isInitial) {\n return undefined;\n }\n return {\n enabled: true, // this is sticky so only send it on the initial request\n };\n }\n\n public async onResponse(data: ExtensionE2EEResponse): Promise<void> {\n // Handle device list updates\n if (data.device_lists) {\n await this.crypto.processDeviceLists(data.device_lists);\n }\n\n // Handle one_time_keys_count and unused_fallback_key_types\n await this.crypto.processKeyCounts(\n data.device_one_time_keys_count,\n data[\"device_unused_fallback_key_types\"] || data[\"org.matrix.msc2732.device_unused_fallback_key_types\"],\n );\n\n this.crypto.onSyncCompleted({});\n }\n}\n\ntype ExtensionToDeviceRequest = {\n since?: string;\n limit?: number;\n enabled?: boolean;\n};\n\ntype ExtensionToDeviceResponse = {\n events: Required<ISyncResponse>[\"to_device\"][\"events\"];\n next_batch: string | null;\n};\n\nclass ExtensionToDevice implements Extension<ExtensionToDeviceRequest, ExtensionToDeviceResponse> {\n private nextBatch: string | null = null;\n\n public constructor(\n private readonly client: MatrixClient,\n private readonly cryptoCallbacks?: SyncCryptoCallbacks,\n ) {}\n\n public name(): string {\n return \"to_device\";\n }\n\n public when(): ExtensionState {\n return ExtensionState.PreProcess;\n }\n\n public onRequest(isInitial: boolean): ExtensionToDeviceRequest {\n const extReq: ExtensionToDeviceRequest = {\n since: this.nextBatch !== null ? this.nextBatch : undefined,\n };\n if (isInitial) {\n extReq[\"limit\"] = 100;\n extReq[\"enabled\"] = true;\n }\n return extReq;\n }\n\n public async onResponse(data: ExtensionToDeviceResponse): Promise<void> {\n const cancelledKeyVerificationTxns: string[] = [];\n let events = data[\"events\"] || [];\n if (events.length > 0 && this.cryptoCallbacks) {\n events = await this.cryptoCallbacks.preprocessToDeviceMessages(events);\n }\n events\n .map(this.client.getEventMapper())\n .map((toDeviceEvent) => {\n // map is a cheap inline forEach\n // We want to flag m.key.verification.start events as cancelled\n // if there's an accompanying m.key.verification.cancel event, so\n // we pull out the transaction IDs from the cancellation events\n // so we can flag the verification events as cancelled in the loop\n // below.\n if (toDeviceEvent.getType() === \"m.key.verification.cancel\") {\n const txnId: string | undefined = toDeviceEvent.getContent()[\"transaction_id\"];\n if (txnId) {\n cancelledKeyVerificationTxns.push(txnId);\n }\n }\n\n // as mentioned above, .map is a cheap inline forEach, so return\n // the unmodified event.\n return toDeviceEvent;\n })\n .forEach((toDeviceEvent) => {\n const content = toDeviceEvent.getContent();\n if (toDeviceEvent.getType() == \"m.room.message\" && content.msgtype == \"m.bad.encrypted\") {\n // the mapper already logged a warning.\n logger.log(\"Ignoring undecryptable to-device event from \" + toDeviceEvent.getSender());\n return;\n }\n\n if (\n toDeviceEvent.getType() === \"m.key.verification.start\" ||\n toDeviceEvent.getType() === \"m.key.verification.request\"\n ) {\n const txnId = content[\"transaction_id\"];\n if (cancelledKeyVerificationTxns.includes(txnId)) {\n toDeviceEvent.flagCancelled();\n }\n }\n\n this.client.emit(ClientEvent.ToDeviceEvent, toDeviceEvent);\n });\n\n this.nextBatch = data.next_batch;\n }\n}\n\ntype ExtensionAccountDataRequest = {\n enabled: boolean;\n};\n\ntype ExtensionAccountDataResponse = {\n global: IMinimalEvent[];\n rooms: Record<string, IMinimalEvent[]>;\n};\n\nclass ExtensionAccountData implements Extension<ExtensionAccountDataRequest, ExtensionAccountDataResponse> {\n public constructor(private readonly client: MatrixClient) {}\n\n public name(): string {\n return \"account_data\";\n }\n\n public when(): ExtensionState {\n return ExtensionState.PostProcess;\n }\n\n public onRequest(isInitial: boolean): ExtensionAccountDataRequest | undefined {\n if (!isInitial) {\n return undefined;\n }\n return {\n enabled: true,\n };\n }\n\n public async onResponse(data: ExtensionAccountDataResponse): Promise<void> {\n if (data.global && data.global.length > 0) {\n this.processGlobalAccountData(data.global);\n }\n\n for (const roomId in data.rooms) {\n const accountDataEvents = mapEvents(this.client, roomId, data.rooms[roomId]);\n const room = this.client.getRoom(roomId);\n if (!room) {\n logger.warn(\"got account data for room but room doesn't exist on client:\", roomId);\n continue;\n }\n room.addAccountData(accountDataEvents);\n accountDataEvents.forEach((e) => {\n this.client.emit(ClientEvent.Event, e);\n });\n }\n }\n\n private processGlobalAccountData(globalAccountData: IMinimalEvent[]): void {\n const events = mapEvents(this.client, undefined, globalAccountData);\n const prevEventsMap = events.reduce<Record<string, MatrixEvent | undefined>>((m, c) => {\n m[c.getType()] = this.client.store.getAccountData(c.getType());\n return m;\n }, {});\n this.client.store.storeAccountDataEvents(events);\n events.forEach((accountDataEvent) => {\n // Honour push rules that come down the sync stream but also\n // honour push rules that were previously cached. Base rules\n // will be updated when we receive push rules via getPushRules\n // (see sync) before syncing over the network.\n if (accountDataEvent.getType() === EventType.PushRules) {\n const rules = accountDataEvent.getContent<IPushRules>();\n this.client.setPushRules(rules);\n }\n const prevEvent = prevEventsMap[accountDataEvent.getType()];\n this.client.emit(ClientEvent.AccountData, accountDataEvent, prevEvent);\n return accountDataEvent;\n });\n }\n}\n\ntype ExtensionTypingRequest = {\n enabled: boolean;\n};\n\ntype ExtensionTypingResponse = {\n rooms: Record<string, IMinimalEvent>;\n};\n\nclass ExtensionTyping implements Extension<ExtensionTypingRequest, ExtensionTypingResponse> {\n public constructor(private readonly client: MatrixClient) {}\n\n public name(): string {\n return \"typing\";\n }\n\n public when(): ExtensionState {\n return ExtensionState.PostProcess;\n }\n\n public onRequest(isInitial: boolean): ExtensionTypingRequest | undefined {\n if (!isInitial) {\n return undefined; // don't send a JSON object for subsequent requests, we don't need to.\n }\n return {\n enabled: true,\n };\n }\n\n public async onResponse(data: ExtensionTypingResponse): Promise<void> {\n if (!data?.rooms) {\n return;\n }\n\n for (const roomId in data.rooms) {\n processEphemeralEvents(this.client, roomId, [data.rooms[roomId]]);\n }\n }\n}\n\ntype ExtensionReceiptsRequest = {\n enabled: boolean;\n};\n\ntype ExtensionReceiptsResponse = {\n rooms: Record<string, IMinimalEvent>;\n};\n\nclass ExtensionReceipts implements Extension<ExtensionReceiptsRequest, ExtensionReceiptsResponse> {\n public constructor(private readonly client: MatrixClient) {}\n\n public name(): string {\n return \"receipts\";\n }\n\n public when(): ExtensionState {\n return ExtensionState.PostProcess;\n }\n\n public onRequest(isInitial: boolean): ExtensionReceiptsRequest | undefined {\n if (isInitial) {\n return {\n enabled: true,\n };\n }\n return undefined; // don't send a JSON object for subsequent requests, we don't need to.\n }\n\n public async onResponse(data: ExtensionReceiptsResponse): Promise<void> {\n if (!data?.rooms) {\n return;\n }\n\n for (const roomId in data.rooms) {\n processEphemeralEvents(this.client, roomId, [data.rooms[roomId]]);\n }\n }\n}\n\n/**\n * A copy of SyncApi such that it can be used as a drop-in replacement for sync v2. For the actual\n * sliding sync API, see sliding-sync.ts or the class SlidingSync.\n */\nexport class SlidingSyncSdk {\n private readonly opts: IStoredClientOpts;\n private readonly syncOpts: SyncApiOptions;\n private syncState: SyncState | null = null;\n private syncStateData?: ISyncStateData;\n private lastPos: string | null = null;\n private failCount = 0;\n private notifEvents: MatrixEvent[] = []; // accumulator of sync events in the current sync response\n\n public constructor(\n private readonly slidingSync: SlidingSync,\n private readonly client: MatrixClient,\n opts?: IStoredClientOpts,\n syncOpts?: SyncApiOptions,\n ) {\n this.opts = defaultClientOpts(opts);\n this.syncOpts = defaultSyncApiOpts(syncOpts);\n\n if (client.getNotifTimelineSet()) {\n client.reEmitter.reEmit(client.getNotifTimelineSet()!, [RoomEvent.Timeline, RoomEvent.TimelineReset]);\n }\n\n this.slidingSync.on(SlidingSyncEvent.Lifecycle, this.onLifecycle.bind(this));\n this.slidingSync.on(SlidingSyncEvent.RoomData, this.onRoomData.bind(this));\n const extensions: Extension<any, any>[] = [\n new ExtensionToDevice(this.client, this.syncOpts.cryptoCallbacks),\n new ExtensionAccountData(this.client),\n new ExtensionTyping(this.client),\n new ExtensionReceipts(this.client),\n ];\n if (this.syncOpts.crypto) {\n extensions.push(new ExtensionE2EE(this.syncOpts.crypto));\n }\n extensions.forEach((ext) => {\n this.slidingSync.registerExtension(ext);\n });\n }\n\n private async onRoomData(roomId: string, roomData: MSC3575RoomData): Promise<void> {\n let room = this.client.store.getRoom(roomId);\n if (!room) {\n if (!roomData.initial) {\n logger.debug(\"initial flag not set but no stored room exists for room \", roomId, roomData);\n return;\n }\n room = _createAndReEmitRoom(this.client, roomId, this.opts);\n }\n await this.processRoomData(this.client, room!, roomData);\n }\n\n private onLifecycle(state: SlidingSyncState, resp: MSC3575SlidingSyncResponse | null, err?: Error): void {\n if (err) {\n logger.debug(\"onLifecycle\", state, err);\n }\n switch (state) {\n case SlidingSyncState.Complete:\n this.purgeNotifications();\n if (!resp) {\n break;\n }\n // Element won't stop showing the initial loading spinner unless we fire SyncState.Prepared\n if (!this.lastPos) {\n this.updateSyncState(SyncState.Prepared, {\n oldSyncToken: undefined,\n nextSyncToken: resp.pos,\n catchingUp: false,\n fromCache: false,\n });\n }\n // Conversely, Element won't show the room list unless there is at least 1x SyncState.Syncing\n // so hence for the very first sync we will fire prepared then immediately syncing.\n this.updateSyncState(SyncState.Syncing, {\n oldSyncToken: this.lastPos!,\n nextSyncToken: resp.pos,\n catchingUp: false,\n fromCache: false,\n });\n this.lastPos = resp.pos;\n break;\n case SlidingSyncState.RequestFinished:\n if (err) {\n this.failCount += 1;\n this.updateSyncState(\n this.failCount > FAILED_SYNC_ERROR_THRESHOLD ? SyncState.Error : SyncState.Reconnecting,\n {\n error: new MatrixError(err),\n },\n );\n if (this.shouldAbortSync(new MatrixError(err))) {\n return; // shouldAbortSync actually stops syncing too so we don't need to do anything.\n }\n } else {\n this.failCount = 0;\n }\n break;\n }\n }\n\n /**\n * Sync rooms the user has left.\n * @returns Resolved when they've been added to the store.\n */\n public async syncLeftRooms(): Promise<Room[]> {\n return []; // TODO\n }\n\n /**\n * Peek into a room. This will result in the room in question being synced so it\n * is accessible via getRooms(). Live updates for the room will be provided.\n * @param roomId - The room ID to peek into.\n * @returns A promise which resolves once the room has been added to the\n * store.\n */\n public async peek(roomId: string): Promise<Room> {\n return null!; // TODO\n }\n\n /**\n * Stop polling for updates in the peeked room. NOPs if there is no room being\n * peeked.\n */\n public stopPeeking(): void {\n // TODO\n }\n\n /**\n * Specify the set_presence value to be used for subsequent calls to the Sync API.\n * @param presence - the presence to specify to set_presence of sync calls\n */\n public setPresence(presence?: SetPresence): void {\n // TODO not possible in sliding sync yet\n }\n\n /**\n * Returns the current state of this sync object\n * @see MatrixClient#event:\"sync\"\n */\n public getSyncState(): SyncState | null {\n return this.syncState;\n }\n\n /**\n * Returns the additional data object associated with\n * the current sync state, or null if there is no\n * such data.\n * Sync errors, if available, are put in the 'error' key of\n * this object.\n */\n public getSyncStateData(): ISyncStateData | null {\n return this.syncStateData ?? null;\n }\n\n // Helper functions which set up JS SDK structs are below and are identical to the sync v2 counterparts\n\n public createRoom(roomId: string): Room {\n // XXX cargoculted from sync.ts\n const { timelineSupport } = this.client;\n const room = new Room(roomId, this.client, this.client.getUserId()!, {\n lazyLoadMembers: this.opts.lazyLoadMembers,\n pendingEventOrdering: this.opts.pendingEventOrdering,\n timelineSupport,\n });\n this.client.reEmitter.reEmit(room, [\n RoomEvent.Name,\n RoomEvent.Redaction,\n RoomEvent.RedactionCancelled,\n RoomEvent.Receipt,\n RoomEvent.Tags,\n RoomEvent.LocalEchoUpdated,\n RoomEvent.AccountData,\n RoomEvent.MyMembership,\n RoomEvent.Timeline,\n RoomEvent.TimelineReset,\n ]);\n this.registerStateListeners(room);\n return room;\n }\n\n private registerStateListeners(room: Room): void {\n // XXX cargoculted from sync.ts\n // we need to also re-emit room state and room member events, so hook it up\n // to the client now. We need to add a listener for RoomState.members in\n // order to hook them correctly.\n this.client.reEmitter.reEmit(room.currentState, [\n RoomStateEvent.Events,\n RoomStateEvent.Members,\n RoomStateEvent.NewMember,\n RoomStateEvent.Update,\n ]);\n room.currentState.on(RoomStateEvent.NewMember, (event, state, member) => {\n member.user = this.client.getUser(member.userId) ?? undefined;\n this.client.reEmitter.reEmit(member, [\n RoomMemberEvent.Name,\n RoomMemberEvent.Typing,\n RoomMemberEvent.PowerLevel,\n RoomMemberEvent.Membership,\n ]);\n });\n }\n\n /*\n private deregisterStateListeners(room: Room): void { // XXX cargoculted from sync.ts\n // could do with a better way of achieving this.\n room.currentState.removeAllListeners(RoomStateEvent.Events);\n room.currentState.removeAllListeners(RoomStateEvent.Members);\n room.currentState.removeAllListeners(RoomStateEvent.NewMember);\n } */\n\n private shouldAbortSync(error: MatrixError): boolean {\n if (error.errcode === \"M_UNKNOWN_TOKEN\") {\n // The logout already happened, we just need to stop.\n logger.warn(\"Token no longer valid - assuming logout\");\n this.stop();\n this.updateSyncState(SyncState.Error, { error });\n return true;\n }\n return false;\n }\n\n private async processRoomData(client: MatrixClient, room: Room, roomData: MSC3575RoomData): Promise<void> {\n roomData = ensureNameEvent(client, room.roomId, roomData);\n const stateEvents = mapEvents(this.client, room.roomId, roomData.required_state);\n // Prevent events from being decrypted ahead of time\n // this helps large account to speed up faster\n // room::decryptCriticalEvent is in charge of decrypting all the events\n // required for a client to function properly\n let timelineEvents = mapEvents(this.client, room.roomId, roomData.timeline, false);\n const ephemeralEvents: MatrixEvent[] = []; // TODO this.mapSyncEventsFormat(joinObj.ephemeral);\n\n // TODO: handle threaded / beacon events\n\n if (roomData.initial) {\n // we should not know about any of these timeline entries if this is a genuinely new room.\n // If we do, then we've effectively done scrollback (e.g requesting timeline_limit: 1 for\n // this room, then timeline_limit: 50).\n const knownEvents = new Set<string>();\n room.getLiveTimeline()\n .getEvents()\n .forEach((e) => {\n knownEvents.add(e.getId()!);\n });\n // all unknown events BEFORE a known event must be scrollback e.g:\n // D E <-- what we know\n // A B C D E F <-- what we just received\n // means:\n // A B C <-- scrollback\n // D E <-- dupes\n // F <-- new event\n // We bucket events based on if we have seen a known event yet.\n const oldEvents: MatrixEvent[] = [];\n const newEvents: MatrixEvent[] = [];\n let seenKnownEvent = false;\n for (let i = timelineEvents.length - 1; i >= 0; i--) {\n const recvEvent = timelineEvents[i];\n if (knownEvents.has(recvEvent.getId()!)) {\n seenKnownEvent = true;\n continue; // don't include this event, it's a dupe\n }\n if (seenKnownEvent) {\n // old -> new\n oldEvents.push(recvEvent);\n } else {\n // old -> new\n newEvents.unshift(recvEvent);\n }\n }\n timelineEvents = newEvents;\n if (oldEvents.length > 0) {\n // old events are scrollback, insert them now\n room.addEventsToTimeline(oldEvents, true, room.getLiveTimeline(), roomData.prev_batch);\n }\n }\n\n const encrypted = room.hasEncryptionStateEvent();\n // we do this first so it's correct when any of the events fire\n if (roomData.notification_count != null) {\n room.setUnreadNotificationCount(NotificationCountType.Total, roomData.notification_count);\n }\n\n if (roomData.highlight_count != null) {\n // We track unread notifications ourselves in encrypted rooms, so don't\n // bother setting it here. We trust our calculations better than the\n // server's for this case, and therefore will assume that our non-zero\n // count is accurate.\n if (!encrypted || (encrypted && room.getUnreadNotificationCount(NotificationCountType.Highlight) <= 0)) {\n room.setUnreadNotificationCount(NotificationCountType.Highlight, roomData.highlight_count);\n }\n }\n\n if (Number.isInteger(roomData.invited_count)) {\n room.currentState.setInvitedMemberCount(roomData.invited_count!);\n }\n if (Number.isInteger(roomData.joined_count)) {\n room.currentState.setJoinedMemberCount(roomData.joined_count!);\n }\n\n if (roomData.invite_state) {\n const inviteStateEvents = mapEvents(this.client, room.roomId, roomData.invite_state);\n await this.injectRoomEvents(room, inviteStateEvents);\n if (roomData.initial) {\n room.recalculate();\n this.client.store.storeRoom(room);\n this.client.emit(ClientEvent.Room, room);\n }\n inviteStateEvents.forEach((e) => {\n this.client.emit(ClientEvent.Event, e);\n });\n room.updateMyMembership(KnownMembership.Invite);\n return;\n }\n\n if (roomData.initial) {\n // set the back-pagination token. Do this *before* adding any\n // events so that clients can start back-paginating.\n room.getLiveTimeline().setPaginationToken(roomData.prev_batch ?? null, EventTimeline.BACKWARDS);\n }\n\n /* TODO\n else if (roomData.limited) {\n\n let limited = true;\n\n // we've got a limited sync, so we *probably* have a gap in the\n // timeline, so should reset. But we might have been peeking or\n // paginating and already have some of the events, in which\n // case we just want to append any subsequent events to the end\n // of the existing timeline.\n //\n // This is particularly important in the case that we already have\n // *all* of the events in the timeline - in that case, if we reset\n // the timeline, we'll end up with an entirely empty timeline,\n // which we'll try to paginate but not get any new events (which\n // will stop us linking the empty timeline into the chain).\n //\n for (let i = timelineEvents.length - 1; i >= 0; i--) {\n const eventId = timelineEvents[i].getId();\n if (room.getTimelineForEvent(eventId)) {\n logger.debug(\"Already have event \" + eventId + \" in limited \" +\n \"sync - not resetting\");\n limited = false;\n\n // we might still be missing some of the events before i;\n // we don't want to be adding them to the end of the\n // timeline because that would put them out of order.\n timelineEvents.splice(0, i);\n\n // XXX: there's a problem here if the skipped part of the\n // timeline modifies the state set in stateEvents, because\n // we'll end up using the state from stateEvents rather\n // than the later state from timelineEvents. We probably\n // need to wind stateEvents forward over the events we're\n // skipping.\n break;\n }\n }\n\n if (limited) {\n room.resetLiveTimeline(\n roomData.prev_batch,\n null, // TODO this.syncOpts.canResetEntireTimeline(room.roomId) ? null : syncEventData.oldSyncToken,\n );\n\n // We have to assume any gap in any timeline is\n // reason to stop incrementally tracking notifications and\n // reset the timeline.\n this.client.resetNotifTimelineSet();\n this.registerStateListeners(room);\n }\n } */\n\n await this.injectRoomEvents(room, stateEvents, timelineEvents, roomData.num_live);\n\n // we deliberately don't add ephemeral events to the timeline\n room.addEphemeralEvents(ephemeralEvents);\n\n // local fields must be set before any async calls because call site assumes\n // synchronous execution prior to emitting SlidingSyncState.Complete\n room.updateMyMembership(KnownMembership.Join);\n\n room.recalculate();\n if (roomData.initial) {\n client.store.storeRoom(room);\n client.emit(ClientEvent.Room, room);\n }\n\n // check if any timeline events should bing and add them to the notifEvents array:\n // we'll purge this once we've fully processed the sync response\n this.addNotifications(timelineEvents);\n\n const processRoomEvent = async (e: MatrixEvent): Promise<void> => {\n client.emit(ClientEvent.Event, e);\n if (e.isState() && e.getType() == EventType.RoomEncryption && this.syncOpts.cryptoCallbacks) {\n await this.syncOpts.cryptoCallbacks.onCryptoEvent(room, e);\n }\n };\n\n await promiseMapSeries(stateEvents, processRoomEvent);\n await promiseMapSeries(timelineEvents, processRoomEvent);\n ephemeralEvents.forEach(function (e) {\n client.emit(ClientEvent.Event, e);\n });\n\n // Decrypt only the last message in all rooms to make sure we can generate a preview\n // And decrypt all events after the recorded read receipt to ensure an accurate\n // notification count\n room.decryptCriticalEvents();\n }\n\n /**\n * Injects events into a room's model.\n * @param stateEventList - A list of state events. This is the state\n * at the *START* of the timeline list if it is supplied.\n * @param timelineEventList - A list of timeline events. Lower index\n * is earlier in time. Higher index is later.\n * @param numLive - the number of events in timelineEventList which just happened,\n * supplied from the server.\n */\n public async injectRoomEvents(\n room: Room,\n stateEventList: MatrixEvent[],\n timelineEventList?: MatrixEvent[],\n numLive?: number,\n ): Promise<void> {\n timelineEventList = timelineEventList || [];\n stateEventList = stateEventList || [];\n numLive = numLive || 0;\n\n // If there are no events in the timeline yet, initialise it with\n // the given state events\n const liveTimeline = room.getLiveTimeline();\n const timelineWasEmpty = liveTimeline.getEvents().length == 0;\n if (timelineWasEmpty) {\n // Passing these events into initialiseState will freeze them, so we need\n // to compute and cache the push actions for them now, otherwise sync dies\n // with an attempt to assign to read only property.\n // XXX: This is pretty horrible and is assuming all sorts of behaviour from\n // these functions that it shouldn't be. We should probably either store the\n // push actions cache elsewhere so we can freeze MatrixEvents, or otherwise\n // find some solution where MatrixEvents are immutable but allow for a cache\n // field.\n for (const ev of stateEventList) {\n this.client.getPushActionsForEvent(ev);\n }\n liveTimeline.initialiseState(stateEventList);\n }\n\n // If the timeline wasn't empty, we process the state events here: they're\n // defined as updates to the state before the start of the timeline, so this\n // starts to roll the state forward.\n // XXX: That's what we *should* do, but this can happen if we were previously\n // peeking in a room, in which case we obviously do *not* want to add the\n // state events here onto the end of the timeline. Historically, the js-sdk\n // has just set these new state events on the old and new state. This seems\n // very wrong because there could be events in the timeline that diverge the\n // state, in which case this is going to leave things out of sync. However,\n // for now I think it;s best to behave the same as the code has done previously.\n if (!timelineWasEmpty) {\n // XXX: As above, don't do this...\n //room.addLiveEvents(stateEventList || []);\n // Do this instead...\n room.oldState.setStateEvents(stateEventList);\n room.currentState.setStateEvents(stateEventList);\n }\n\n // the timeline is broken into 'live' events which just happened and normal timeline events\n // which are still to be appended to the end of the live timeline but happened a while ago.\n // The live events are marked as fromCache=false to ensure that downstream components know\n // this is a live event, not historical (from a remote server cache).\n\n let liveTimelineEvents: MatrixEvent[] = [];\n if (numLive > 0) {\n // last numLive events are live\n liveTimelineEvents = timelineEventList.slice(-1 * numLive);\n // everything else is not live\n timelineEventList = timelineEventList.slice(0, -1 * liveTimelineEvents.length);\n }\n\n // execute the timeline events. This will continue to diverge the current state\n // if the timeline has any state events in it.\n // This also needs to be done before running push rules on the events as they need\n // to be decorated with sender etc.\n await room.addLiveEvents(timelineEventList, {\n fromCache: true,\n });\n if (liveTimelineEvents.length > 0) {\n await room.addLiveEvents(liveTimelineEvents, {\n fromCache: false,\n });\n }\n\n room.recalculate();\n\n // resolve invites now we have set the latest state\n this.resolveInvites(room);\n }\n\n private resolveInvites(room: Room): void {\n if (!room || !this.opts.resolveInvitesToProfiles) {\n return;\n }\n const client = this.client;\n // For each invited room member we want to give them a displayname/avatar url\n // if they have one (the m.room.member invites don't contain this).\n room.getMembersWithMembership(KnownMembership.Invite).forEach(function (member) {\n if (member.requestedProfileInfo) return;\n member.requestedProfileInfo = true;\n // try to get a cached copy first.\n const user = client.getUser(member.userId);\n let promise: ReturnType<MatrixClient[\"getProfileInfo\"]>;\n if (user) {\n promise = Promise.resolve({\n avatar_url: user.avatarUrl,\n displayname: user.displayName,\n });\n } else {\n promise = client.getProfileInfo(member.userId);\n }\n promise.then(\n function (info) {\n // slightly naughty by doctoring the invite event but this means all\n // the code paths remain the same between invite/join display name stuff\n // which is a worthy trade-off for some minor pollution.\n const inviteEvent = member.events.member!;\n if (inviteEvent.getContent().membership !== KnownMembership.Invite) {\n // between resolving and now they have since joined, so don't clobber\n return;\n }\n inviteEvent.getContent().avatar_url = info.avatar_url;\n inviteEvent.getContent().displayname = info.displayname;\n // fire listeners\n member.setMembershipEvent(inviteEvent, room.currentState);\n },\n function (_err) {\n // OH WELL.\n },\n );\n });\n }\n\n public retryImmediately(): boolean {\n return true;\n }\n\n /**\n * Main entry point. Blocks until stop() is called.\n */\n public async sync(): Promise<void> {\n logger.debug(\"Sliding sync init loop\");\n\n // 1) We need to get push rules so we can check if events should bing as we get\n // them from /sync.\n while (!this.client.isGuest()) {\n try {\n logger.debug(\"Getting push rules...\");\n const result = await this.client.getPushRules();\n logger.debug(\"Got push rules\");\n this.client.pushRules = result;\n break;\n } catch (err) {\n logger.error(\"Getting push rules failed\", err);\n if (this.shouldAbortSync(<MatrixError>err)) {\n return;\n }\n }\n }\n\n // start syncing\n await this.slidingSync.start();\n }\n\n /**\n * Stops the sync object from syncing.\n */\n public stop(): void {\n logger.debug(\"SyncApi.stop\");\n this.slidingSync.stop();\n }\n\n /**\n * Sets the sync state and emits an event to say so\n * @param newState - The new state string\n * @param data - Object of additional data to emit in the event\n */\n private updateSyncState(newState: SyncState, data?: ISyncStateData): void {\n const old = this.syncState;\n this.syncState = newState;\n this.syncStateData = data;\n this.client.emit(ClientEvent.Sync, this.syncState, old, data);\n }\n\n /**\n * Takes a list of timelineEvents and adds and adds to notifEvents\n * as appropriate.\n * This must be called after the room the events belong to has been stored.\n *\n * @param timelineEventList - A list of timeline events. Lower index\n * is earlier in time. Higher index is later.\n */\n private addNotifications(timelineEventList: MatrixEvent[]): void {\n // gather our notifications into this.notifEvents\n if (!this.client.getNotifTimelineSet()) {\n return;\n }\n for (const timelineEvent of timelineEventList) {\n const pushActions = this.client.getPushActionsForEvent(timelineEvent);\n if (pushActions && pushActions.notify && pushActions.tweaks && pushActions.tweaks.highlight) {\n this.notifEvents.push(timelineEvent);\n }\n }\n }\n\n /**\n * Purge any events in the notifEvents array. Used after a /sync has been complete.\n * This should not be called at a per-room scope (e.g in onRoomData) because otherwise the ordering\n * will be messed up e.g room A gets a bing, room B gets a newer bing, but both in the same /sync\n * response. If we purge at a per-room scope then we could process room B before room A leading to\n * room B appearing earlier in the notifications timeline, even though it has the higher origin_server_ts.\n */\n private purgeNotifications(): void {\n this.notifEvents.sort(function (a, b) {\n return a.getTs() - b.getTs();\n });\n this.notifEvents.forEach((event) => {\n this.client.getNotifTimelineSet()?.addLiveEvent(event);\n });\n this.notifEvents = [];\n }\n}\n\nfunction ensureNameEvent(client: MatrixClient, roomId: string, roomData: MSC3575RoomData): MSC3575RoomData {\n // make sure m.room.name is in required_state if there is a name, replacing anything previously\n // there if need be. This ensures clients transparently 'calculate' the right room name. Native\n // sliding sync clients should just read the \"name\" field.\n if (!roomData.name) {\n return roomData;\n }\n for (const stateEvent of roomData.required_state) {\n if (stateEvent.type === EventType.RoomName && stateEvent.state_key === \"\") {\n stateEvent.content = {\n name: roomData.name,\n };\n return roomData;\n }\n }\n roomData.required_state.push({\n event_id: \"$fake-sliding-sync-name-event-\" + roomId,\n state_key: \"\",\n type: EventType.RoomName,\n content: {\n name: roomData.name,\n },\n sender: client.getUserId()!,\n origin_server_ts: new Date().getTime(),\n });\n return roomData;\n}\n\ntype TaggedEvent = (IStrippedState | IRoomEvent | IStateEvent | IMinimalEvent) & { room_id?: string };\n\n// Helper functions which set up JS SDK structs are below and are identical to the sync v2 counterparts,\n// just outside the class.\nfunction mapEvents(client: MatrixClient, roomId: string | undefined, events: object[], decrypt = true): MatrixEvent[] {\n const mapper = client.getEventMapper({ decrypt });\n return (events as TaggedEvent[]).map(function (e) {\n e.room_id = roomId;\n return mapper(e);\n });\n}\n\nfunction processEphemeralEvents(client: MatrixClient, roomId: string, ephEvents: IMinimalEvent[]): void {\n const ephemeralEvents = mapEvents(client, roomId, ephEvents);\n const room = client.getRoom(roomId);\n if (!room) {\n logger.warn(\"got ephemeral events for room but room doesn't exist on client:\", roomId);\n return;\n }\n room.addEphemeralEvents(ephemeralEvents);\n ephemeralEvents.forEach((e) => {\n client.emit(ClientEvent.Event, e);\n });\n}\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,qBAAqB,EAAEC,IAAI,EAAEC,SA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AsBA,CAAC3D,MAAoB,EAAEiC,MAAc,EAAE6O,SAA0B,EAAQ;EACpG,IAAMxH,eAAe,GAAGlH,SAAS,CAACpC,MAAM,EAAEiC,MAAM,EAAE6O,SAAS,CAAC;EAC5D,IAAMzO,IAAI,GAAGrC,MAAM,CAACsC,OAAO,CAACL,MAAM,CAAC;EACnC,IAAI,CAACI,IAAI,EAAE;IACP1E,MAAM,CAAC4E,IAAI,CAAC,iEAAiE,EAAEN,MAAM,CAAC;IACtF;EACJ;EACAI,IAAI,CAAC0J,kBAAkB,CAACzC,eAAe,CAAC;EACxCA,eAAe,CAACpI,OAAO,CAAEuB,CAAC,IAAK;IAC3BzC,MAAM,CAACyB,IAAI,CAAC3D,WAAW,CAAC4E,KAAK,EAAED,CAAC,CAAC;EACrC,CAAC,CAAC;AACN","ignoreList":[]}
|
@@ -0,0 +1,343 @@
|
|
1
|
+
import { MatrixClient } from "./client.ts";
|
2
|
+
import { IRoomEvent, IStateEvent } from "./sync-accumulator.ts";
|
3
|
+
import { TypedEventEmitter } from "./models/typed-event-emitter.ts";
|
4
|
+
export declare const MSC3575_WILDCARD = "*";
|
5
|
+
export declare const MSC3575_STATE_KEY_ME = "$ME";
|
6
|
+
export declare const MSC3575_STATE_KEY_LAZY = "$LAZY";
|
7
|
+
/**
|
8
|
+
* Represents a subscription to a room or set of rooms. Controls which events are returned.
|
9
|
+
*/
|
10
|
+
export interface MSC3575RoomSubscription {
|
11
|
+
required_state?: string[][];
|
12
|
+
timeline_limit?: number;
|
13
|
+
include_old_rooms?: MSC3575RoomSubscription;
|
14
|
+
}
|
15
|
+
/**
|
16
|
+
* Controls which rooms are returned in a given list.
|
17
|
+
*/
|
18
|
+
export interface MSC3575Filter {
|
19
|
+
is_dm?: boolean;
|
20
|
+
is_encrypted?: boolean;
|
21
|
+
is_invite?: boolean;
|
22
|
+
room_name_like?: string;
|
23
|
+
room_types?: string[];
|
24
|
+
not_room_types?: string[];
|
25
|
+
spaces?: string[];
|
26
|
+
tags?: string[];
|
27
|
+
not_tags?: string[];
|
28
|
+
}
|
29
|
+
/**
|
30
|
+
* Represents a list subscription.
|
31
|
+
*/
|
32
|
+
export interface MSC3575List extends MSC3575RoomSubscription {
|
33
|
+
ranges: number[][];
|
34
|
+
sort?: string[];
|
35
|
+
filters?: MSC3575Filter;
|
36
|
+
slow_get_all_rooms?: boolean;
|
37
|
+
}
|
38
|
+
/**
|
39
|
+
* A complete Sliding Sync request.
|
40
|
+
*/
|
41
|
+
export interface MSC3575SlidingSyncRequest {
|
42
|
+
lists?: Record<string, MSC3575List>;
|
43
|
+
unsubscribe_rooms?: string[];
|
44
|
+
room_subscriptions?: Record<string, MSC3575RoomSubscription>;
|
45
|
+
extensions?: object;
|
46
|
+
txn_id?: string;
|
47
|
+
pos?: string;
|
48
|
+
timeout?: number;
|
49
|
+
clientTimeout?: number;
|
50
|
+
}
|
51
|
+
export interface MSC3575RoomData {
|
52
|
+
name: string;
|
53
|
+
required_state: IStateEvent[];
|
54
|
+
timeline: (IRoomEvent | IStateEvent)[];
|
55
|
+
notification_count?: number;
|
56
|
+
highlight_count?: number;
|
57
|
+
joined_count?: number;
|
58
|
+
invited_count?: number;
|
59
|
+
invite_state?: IStateEvent[];
|
60
|
+
initial?: boolean;
|
61
|
+
limited?: boolean;
|
62
|
+
is_dm?: boolean;
|
63
|
+
prev_batch?: string;
|
64
|
+
num_live?: number;
|
65
|
+
}
|
66
|
+
interface ListResponse {
|
67
|
+
count: number;
|
68
|
+
ops: Operation[];
|
69
|
+
}
|
70
|
+
interface BaseOperation {
|
71
|
+
op: string;
|
72
|
+
}
|
73
|
+
interface DeleteOperation extends BaseOperation {
|
74
|
+
op: "DELETE";
|
75
|
+
index: number;
|
76
|
+
}
|
77
|
+
interface InsertOperation extends BaseOperation {
|
78
|
+
op: "INSERT";
|
79
|
+
index: number;
|
80
|
+
room_id: string;
|
81
|
+
}
|
82
|
+
interface InvalidateOperation extends BaseOperation {
|
83
|
+
op: "INVALIDATE";
|
84
|
+
range: [number, number];
|
85
|
+
}
|
86
|
+
interface SyncOperation extends BaseOperation {
|
87
|
+
op: "SYNC";
|
88
|
+
range: [number, number];
|
89
|
+
room_ids: string[];
|
90
|
+
}
|
91
|
+
type Operation = DeleteOperation | InsertOperation | InvalidateOperation | SyncOperation;
|
92
|
+
/**
|
93
|
+
* A complete Sliding Sync response
|
94
|
+
*/
|
95
|
+
export interface MSC3575SlidingSyncResponse {
|
96
|
+
pos: string;
|
97
|
+
txn_id?: string;
|
98
|
+
lists: Record<string, ListResponse>;
|
99
|
+
rooms: Record<string, MSC3575RoomData>;
|
100
|
+
extensions: Record<string, object>;
|
101
|
+
}
|
102
|
+
export declare enum SlidingSyncState {
|
103
|
+
/**
|
104
|
+
* Fired by SlidingSyncEvent.Lifecycle event immediately before processing the response.
|
105
|
+
*/
|
106
|
+
RequestFinished = "FINISHED",
|
107
|
+
/**
|
108
|
+
* Fired by SlidingSyncEvent.Lifecycle event immediately after all room data listeners have been
|
109
|
+
* invoked, but before list listeners.
|
110
|
+
*/
|
111
|
+
Complete = "COMPLETE"
|
112
|
+
}
|
113
|
+
/**
|
114
|
+
* When onResponse extensions should be invoked: before or after processing the main response.
|
115
|
+
*/
|
116
|
+
export declare enum ExtensionState {
|
117
|
+
PreProcess = "ExtState.PreProcess",
|
118
|
+
PostProcess = "ExtState.PostProcess"
|
119
|
+
}
|
120
|
+
/**
|
121
|
+
* An interface that must be satisfied to register extensions
|
122
|
+
*/
|
123
|
+
export interface Extension<Req extends {}, Res extends {}> {
|
124
|
+
/**
|
125
|
+
* The extension name to go under 'extensions' in the request body.
|
126
|
+
* @returns The JSON key.
|
127
|
+
*/
|
128
|
+
name(): string;
|
129
|
+
/**
|
130
|
+
* A function which is called when the request JSON is being formed.
|
131
|
+
* Returns the data to insert under this key.
|
132
|
+
* @param isInitial - True when this is part of the initial request (send sticky params)
|
133
|
+
* @returns The request JSON to send.
|
134
|
+
*/
|
135
|
+
onRequest(isInitial: boolean): Req | undefined;
|
136
|
+
/**
|
137
|
+
* A function which is called when there is response JSON under this extension.
|
138
|
+
* @param data - The response JSON under the extension name.
|
139
|
+
*/
|
140
|
+
onResponse(data: Res): Promise<void>;
|
141
|
+
/**
|
142
|
+
* Controls when onResponse should be called.
|
143
|
+
* @returns The state when it should be called.
|
144
|
+
*/
|
145
|
+
when(): ExtensionState;
|
146
|
+
}
|
147
|
+
/**
|
148
|
+
* Events which can be fired by the SlidingSync class. These are designed to provide different levels
|
149
|
+
* of information when processing sync responses.
|
150
|
+
* - RoomData: concerns rooms, useful for SlidingSyncSdk to update its knowledge of rooms.
|
151
|
+
* - Lifecycle: concerns callbacks at various well-defined points in the sync process.
|
152
|
+
* - List: concerns lists, useful for UI layers to re-render room lists.
|
153
|
+
* Specifically, the order of event invocation is:
|
154
|
+
* - Lifecycle (state=RequestFinished)
|
155
|
+
* - RoomData (N times)
|
156
|
+
* - Lifecycle (state=Complete)
|
157
|
+
* - List (at most once per list)
|
158
|
+
*/
|
159
|
+
export declare enum SlidingSyncEvent {
|
160
|
+
/**
|
161
|
+
* This event fires when there are updates for a room. Fired as and when rooms are encountered
|
162
|
+
* in the response.
|
163
|
+
*/
|
164
|
+
RoomData = "SlidingSync.RoomData",
|
165
|
+
/**
|
166
|
+
* This event fires at various points in the /sync loop lifecycle.
|
167
|
+
* - SlidingSyncState.RequestFinished: Fires after we receive a valid response but before the
|
168
|
+
* response has been processed. Perform any pre-process steps here. If there was a problem syncing,
|
169
|
+
* `err` will be set (e.g network errors).
|
170
|
+
* - SlidingSyncState.Complete: Fires after all SlidingSyncEvent.RoomData have been fired but before
|
171
|
+
* SlidingSyncEvent.List.
|
172
|
+
*/
|
173
|
+
Lifecycle = "SlidingSync.Lifecycle",
|
174
|
+
/**
|
175
|
+
* This event fires whenever there has been a change to this list index. It fires exactly once
|
176
|
+
* per list, even if there were multiple operations for the list.
|
177
|
+
* It fires AFTER Lifecycle and RoomData events.
|
178
|
+
*/
|
179
|
+
List = "SlidingSync.List"
|
180
|
+
}
|
181
|
+
export type SlidingSyncEventHandlerMap = {
|
182
|
+
[SlidingSyncEvent.RoomData]: (roomId: string, roomData: MSC3575RoomData) => Promise<void> | void;
|
183
|
+
[SlidingSyncEvent.Lifecycle]: (state: SlidingSyncState, resp: MSC3575SlidingSyncResponse | null, err?: Error) => void;
|
184
|
+
[SlidingSyncEvent.List]: (listKey: string, joinedCount: number, roomIndexToRoomId: Record<number, string>) => void;
|
185
|
+
};
|
186
|
+
/**
|
187
|
+
* SlidingSync is a high-level data structure which controls the majority of sliding sync.
|
188
|
+
* It has no hooks into JS SDK except for needing a MatrixClient to perform the HTTP request.
|
189
|
+
* This means this class (and everything it uses) can be used in isolation from JS SDK if needed.
|
190
|
+
* To hook this up with the JS SDK, you need to use SlidingSyncSdk.
|
191
|
+
*/
|
192
|
+
export declare class SlidingSync extends TypedEventEmitter<SlidingSyncEvent, SlidingSyncEventHandlerMap> {
|
193
|
+
private readonly proxyBaseUrl;
|
194
|
+
private roomSubscriptionInfo;
|
195
|
+
private readonly client;
|
196
|
+
private readonly timeoutMS;
|
197
|
+
private lists;
|
198
|
+
private listModifiedCount;
|
199
|
+
private terminated;
|
200
|
+
private needsResend;
|
201
|
+
private txnId;
|
202
|
+
private txnIdDefers;
|
203
|
+
private extensions;
|
204
|
+
private desiredRoomSubscriptions;
|
205
|
+
private confirmedRoomSubscriptions;
|
206
|
+
private customSubscriptions;
|
207
|
+
private roomIdToCustomSubscription;
|
208
|
+
private pendingReq?;
|
209
|
+
private abortController?;
|
210
|
+
/**
|
211
|
+
* Create a new sliding sync instance
|
212
|
+
* @param proxyBaseUrl - The base URL of the sliding sync proxy
|
213
|
+
* @param lists - The lists to use for sliding sync.
|
214
|
+
* @param roomSubscriptionInfo - The params to use for room subscriptions.
|
215
|
+
* @param client - The client to use for /sync calls.
|
216
|
+
* @param timeoutMS - The number of milliseconds to wait for a response.
|
217
|
+
*/
|
218
|
+
constructor(proxyBaseUrl: string, lists: Map<string, MSC3575List>, roomSubscriptionInfo: MSC3575RoomSubscription, client: MatrixClient, timeoutMS: number);
|
219
|
+
/**
|
220
|
+
* Add a custom room subscription, referred to by an arbitrary name. If a subscription with this
|
221
|
+
* name already exists, it is replaced. No requests are sent by calling this method.
|
222
|
+
* @param name - The name of the subscription. Only used to reference this subscription in
|
223
|
+
* useCustomSubscription.
|
224
|
+
* @param sub - The subscription information.
|
225
|
+
*/
|
226
|
+
addCustomSubscription(name: string, sub: MSC3575RoomSubscription): void;
|
227
|
+
/**
|
228
|
+
* Use a custom subscription previously added via addCustomSubscription. No requests are sent
|
229
|
+
* by calling this method. Use modifyRoomSubscriptions to resend subscription information.
|
230
|
+
* @param roomId - The room to use the subscription in.
|
231
|
+
* @param name - The name of the subscription. If this name is unknown, the default subscription
|
232
|
+
* will be used.
|
233
|
+
*/
|
234
|
+
useCustomSubscription(roomId: string, name: string): void;
|
235
|
+
/**
|
236
|
+
* Get the room index data for a list.
|
237
|
+
* @param key - The list key
|
238
|
+
* @returns The list data which contains the rooms in this list
|
239
|
+
*/
|
240
|
+
getListData(key: string): {
|
241
|
+
joinedCount: number;
|
242
|
+
roomIndexToRoomId: Record<number, string>;
|
243
|
+
} | null;
|
244
|
+
/**
|
245
|
+
* Get the full request list parameters for a list index. This function is provided for callers to use
|
246
|
+
* in conjunction with setList to update fields on an existing list.
|
247
|
+
* @param key - The list key to get the params for.
|
248
|
+
* @returns A copy of the list params or undefined.
|
249
|
+
*/
|
250
|
+
getListParams(key: string): MSC3575List | null;
|
251
|
+
/**
|
252
|
+
* Set new ranges for an existing list. Calling this function when _only_ the ranges have changed
|
253
|
+
* is more efficient than calling setList(index,list) as this function won't resend sticky params,
|
254
|
+
* whereas setList always will.
|
255
|
+
* @param key - The list key to modify
|
256
|
+
* @param ranges - The new ranges to apply.
|
257
|
+
* @returns A promise which resolves to the transaction ID when it has been received down sync
|
258
|
+
* (or rejects with the transaction ID if the action was not applied e.g the request was cancelled
|
259
|
+
* immediately after sending, in which case the action will be applied in the subsequent request)
|
260
|
+
*/
|
261
|
+
setListRanges(key: string, ranges: number[][]): Promise<string>;
|
262
|
+
/**
|
263
|
+
* Add or replace a list. Calling this function will interrupt the /sync request to resend new
|
264
|
+
* lists.
|
265
|
+
* @param key - The key to modify
|
266
|
+
* @param list - The new list parameters.
|
267
|
+
* @returns A promise which resolves to the transaction ID when it has been received down sync
|
268
|
+
* (or rejects with the transaction ID if the action was not applied e.g the request was cancelled
|
269
|
+
* immediately after sending, in which case the action will be applied in the subsequent request)
|
270
|
+
*/
|
271
|
+
setList(key: string, list: MSC3575List): Promise<string>;
|
272
|
+
/**
|
273
|
+
* Get the room subscriptions for the sync API.
|
274
|
+
* @returns A copy of the desired room subscriptions.
|
275
|
+
*/
|
276
|
+
getRoomSubscriptions(): Set<string>;
|
277
|
+
/**
|
278
|
+
* Modify the room subscriptions for the sync API. Calling this function will interrupt the
|
279
|
+
* /sync request to resend new subscriptions. If the /sync stream has not started, this will
|
280
|
+
* prepare the room subscriptions for when start() is called.
|
281
|
+
* @param s - The new desired room subscriptions.
|
282
|
+
* @returns A promise which resolves to the transaction ID when it has been received down sync
|
283
|
+
* (or rejects with the transaction ID if the action was not applied e.g the request was cancelled
|
284
|
+
* immediately after sending, in which case the action will be applied in the subsequent request)
|
285
|
+
*/
|
286
|
+
modifyRoomSubscriptions(s: Set<string>): Promise<string>;
|
287
|
+
/**
|
288
|
+
* Modify which events to retrieve for room subscriptions. Invalidates all room subscriptions
|
289
|
+
* such that they will be sent up afresh.
|
290
|
+
* @param rs - The new room subscription fields to fetch.
|
291
|
+
* @returns A promise which resolves to the transaction ID when it has been received down sync
|
292
|
+
* (or rejects with the transaction ID if the action was not applied e.g the request was cancelled
|
293
|
+
* immediately after sending, in which case the action will be applied in the subsequent request)
|
294
|
+
*/
|
295
|
+
modifyRoomSubscriptionInfo(rs: MSC3575RoomSubscription): Promise<string>;
|
296
|
+
/**
|
297
|
+
* Register an extension to send with the /sync request.
|
298
|
+
* @param ext - The extension to register.
|
299
|
+
*/
|
300
|
+
registerExtension(ext: Extension<any, any>): void;
|
301
|
+
private getExtensionRequest;
|
302
|
+
private onPreExtensionsResponse;
|
303
|
+
private onPostExtensionsResponse;
|
304
|
+
/**
|
305
|
+
* Invoke all attached room data listeners.
|
306
|
+
* @param roomId - The room which received some data.
|
307
|
+
* @param roomData - The raw sliding sync response JSON.
|
308
|
+
*/
|
309
|
+
private invokeRoomDataListeners;
|
310
|
+
/**
|
311
|
+
* Invoke all attached lifecycle listeners.
|
312
|
+
* @param state - The Lifecycle state
|
313
|
+
* @param resp - The raw sync response JSON
|
314
|
+
* @param err - Any error that occurred when making the request e.g. network errors.
|
315
|
+
*/
|
316
|
+
private invokeLifecycleListeners;
|
317
|
+
private shiftRight;
|
318
|
+
private shiftLeft;
|
319
|
+
private removeEntry;
|
320
|
+
private addEntry;
|
321
|
+
private processListOps;
|
322
|
+
/**
|
323
|
+
* Resend a Sliding Sync request. Used when something has changed in the request. Resolves with
|
324
|
+
* the transaction ID of this request on success. Rejects with the transaction ID of this request
|
325
|
+
* on failure.
|
326
|
+
*/
|
327
|
+
resend(): Promise<string>;
|
328
|
+
private resolveTransactionDefers;
|
329
|
+
/**
|
330
|
+
* Stop syncing with the server.
|
331
|
+
*/
|
332
|
+
stop(): void;
|
333
|
+
/**
|
334
|
+
* Re-setup this connection e.g in the event of an expired session.
|
335
|
+
*/
|
336
|
+
private resetup;
|
337
|
+
/**
|
338
|
+
* Start syncing with the server. Blocks until stopped.
|
339
|
+
*/
|
340
|
+
start(): Promise<void>;
|
341
|
+
}
|
342
|
+
export {};
|
343
|
+
//# sourceMappingURL=sliding-sync.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"sliding-sync.d.ts","sourceRoot":"","sources":["../src/sliding-sync.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAA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