@textrp/briij-js-sdk 41.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6464 -0
- package/LICENSE +177 -0
- package/README.md +477 -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 +213 -0
- package/lib/@types/auth.d.ts.map +1 -0
- package/lib/@types/auth.js +107 -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 +10 -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 +46 -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 +356 -0
- package/lib/@types/event.d.ts.map +1 -0
- package/lib/@types/event.js +280 -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 +18 -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 +66 -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 +58 -0
- package/lib/@types/membership.js.map +1 -0
- package/lib/@types/partials.d.ts +72 -0
- package/lib/@types/partials.d.ts.map +1 -0
- package/lib/@types/partials.js +71 -0
- package/lib/@types/partials.js.map +1 -0
- package/lib/@types/polls.d.ts +89 -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 +267 -0
- package/lib/@types/requests.d.ts.map +1 -0
- package/lib/@types/requests.js +42 -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 +121 -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 +55 -0
- package/lib/@types/topic.d.ts.map +1 -0
- package/lib/@types/topic.js +62 -0
- package/lib/@types/topic.js.map +1 -0
- package/lib/@types/uia.d.ts +8 -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 +32 -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 +30 -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 +25 -0
- package/lib/base64.d.ts.map +1 -0
- package/lib/base64.js +95 -0
- package/lib/base64.js.map +1 -0
- package/lib/briij.d.ts +116 -0
- package/lib/briij.d.ts.map +1 -0
- package/lib/briij.js +145 -0
- package/lib/briij.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 +3493 -0
- package/lib/client.d.ts.map +1 -0
- package/lib/client.js +7482 -0
- package/lib/client.js.map +1 -0
- package/lib/common-crypto/CryptoBackend.d.ts +234 -0
- package/lib/common-crypto/CryptoBackend.d.ts.map +1 -0
- package/lib/common-crypto/CryptoBackend.js +69 -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 +262 -0
- package/lib/content-helpers.js.map +1 -0
- package/lib/content-repo.d.ts +25 -0
- package/lib/content-repo.d.ts.map +1 -0
- package/lib/content-repo.js +109 -0
- package/lib/content-repo.js.map +1 -0
- package/lib/crypto/store/base.d.ts +301 -0
- package/lib/crypto/store/base.d.ts.map +1 -0
- package/lib/crypto/store/base.js +145 -0
- package/lib/crypto/store/base.js.map +1 -0
- package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts +94 -0
- package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts.map +1 -0
- package/lib/crypto/store/indexeddb-crypto-store-backend.js +604 -0
- package/lib/crypto/store/indexeddb-crypto-store-backend.js.map +1 -0
- package/lib/crypto/store/indexeddb-crypto-store.d.ts +251 -0
- package/lib/crypto/store/indexeddb-crypto-store.d.ts.map +1 -0
- package/lib/crypto/store/indexeddb-crypto-store.js +477 -0
- package/lib/crypto/store/indexeddb-crypto-store.js.map +1 -0
- package/lib/crypto/store/localStorage-crypto-store.d.ts +102 -0
- package/lib/crypto/store/localStorage-crypto-store.d.ts.map +1 -0
- package/lib/crypto/store/localStorage-crypto-store.js +374 -0
- package/lib/crypto/store/localStorage-crypto-store.js.map +1 -0
- package/lib/crypto/store/memory-crypto-store.d.ts +117 -0
- package/lib/crypto/store/memory-crypto-store.d.ts.map +1 -0
- package/lib/crypto/store/memory-crypto-store.js +311 -0
- package/lib/crypto/store/memory-crypto-store.js.map +1 -0
- package/lib/crypto-api/CryptoEvent.d.ts +120 -0
- package/lib/crypto-api/CryptoEvent.d.ts.map +1 -0
- package/lib/crypto-api/CryptoEvent.js +137 -0
- package/lib/crypto-api/CryptoEvent.js.map +1 -0
- package/lib/crypto-api/CryptoEventHandlerMap.d.ts +26 -0
- package/lib/crypto-api/CryptoEventHandlerMap.d.ts.map +1 -0
- package/lib/crypto-api/CryptoEventHandlerMap.js +1 -0
- package/lib/crypto-api/CryptoEventHandlerMap.js.map +1 -0
- package/lib/crypto-api/index.d.ts +1160 -0
- package/lib/crypto-api/index.d.ts.map +1 -0
- package/lib/crypto-api/index.js +410 -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 +87 -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 +315 -0
- package/lib/crypto-api/verification.d.ts.map +1 -0
- package/lib/crypto-api/verification.js +130 -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 +182 -0
- package/lib/embedded.d.ts.map +1 -0
- package/lib/embedded.js +746 -0
- package/lib/embedded.js.map +1 -0
- package/lib/errors.d.ts +38 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +73 -0
- package/lib/errors.js.map +1 -0
- package/lib/event-mapper.d.ts +9 -0
- package/lib/event-mapper.d.ts.map +1 -0
- package/lib/event-mapper.js +74 -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 +44 -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 +89 -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 +170 -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 +117 -0
- package/lib/http-api/errors.d.ts.map +1 -0
- package/lib/http-api/errors.js +245 -0
- package/lib/http-api/errors.js.map +1 -0
- package/lib/http-api/fetch.d.ts +80 -0
- package/lib/http-api/fetch.d.ts.map +1 -0
- package/lib/http-api/fetch.js +332 -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 +178 -0
- package/lib/http-api/index.js.map +1 -0
- package/lib/http-api/interface.d.ts +186 -0
- package/lib/http-api/interface.d.ts.map +1 -0
- package/lib/http-api/interface.js +39 -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 +50 -0
- package/lib/http-api/prefix.js.map +1 -0
- package/lib/http-api/refresh.d.ts +53 -0
- package/lib/http-api/refresh.d.ts.map +1 -0
- package/lib/http-api/refresh.js +174 -0
- package/lib/http-api/refresh.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 +182 -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 +341 -0
- package/lib/interactive-auth.d.ts.map +1 -0
- package/lib/interactive-auth.js +563 -0
- package/lib/interactive-auth.js.map +1 -0
- package/lib/logger.d.ts +124 -0
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +230 -0
- package/lib/logger.js.map +1 -0
- package/lib/matrixrtc/CallMembership.d.ts +154 -0
- package/lib/matrixrtc/CallMembership.d.ts.map +1 -0
- package/lib/matrixrtc/CallMembership.js +469 -0
- package/lib/matrixrtc/CallMembership.js.map +1 -0
- package/lib/matrixrtc/EncryptionManager.d.ts +44 -0
- package/lib/matrixrtc/EncryptionManager.d.ts.map +1 -0
- package/lib/matrixrtc/EncryptionManager.js +13 -0
- package/lib/matrixrtc/EncryptionManager.js.map +1 -0
- package/lib/matrixrtc/IKeyTransport.d.ts +37 -0
- package/lib/matrixrtc/IKeyTransport.d.ts.map +1 -0
- package/lib/matrixrtc/IKeyTransport.js +27 -0
- package/lib/matrixrtc/IKeyTransport.js.map +1 -0
- package/lib/matrixrtc/IMembershipManager.d.ts +94 -0
- package/lib/matrixrtc/IMembershipManager.d.ts.map +1 -0
- package/lib/matrixrtc/IMembershipManager.js +40 -0
- package/lib/matrixrtc/IMembershipManager.js.map +1 -0
- package/lib/matrixrtc/LivekitTransport.d.ts +23 -0
- package/lib/matrixrtc/LivekitTransport.d.ts.map +1 -0
- package/lib/matrixrtc/LivekitTransport.js +29 -0
- package/lib/matrixrtc/LivekitTransport.js.map +1 -0
- package/lib/matrixrtc/MatrixRTCSession.d.ts +343 -0
- package/lib/matrixrtc/MatrixRTCSession.d.ts.map +1 -0
- package/lib/matrixrtc/MatrixRTCSession.js +623 -0
- package/lib/matrixrtc/MatrixRTCSession.js.map +1 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.d.ts +46 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.d.ts.map +1 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.js +149 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.js.map +1 -0
- package/lib/matrixrtc/MembershipManager.d.ts +210 -0
- package/lib/matrixrtc/MembershipManager.d.ts.map +1 -0
- package/lib/matrixrtc/MembershipManager.js +977 -0
- package/lib/matrixrtc/MembershipManager.js.map +1 -0
- package/lib/matrixrtc/MembershipManagerActionScheduler.d.ts +59 -0
- package/lib/matrixrtc/MembershipManagerActionScheduler.d.ts.map +1 -0
- package/lib/matrixrtc/MembershipManagerActionScheduler.js +125 -0
- package/lib/matrixrtc/MembershipManagerActionScheduler.js.map +1 -0
- package/lib/matrixrtc/RTCEncryptionManager.d.ts +110 -0
- package/lib/matrixrtc/RTCEncryptionManager.d.ts.map +1 -0
- package/lib/matrixrtc/RTCEncryptionManager.js +376 -0
- package/lib/matrixrtc/RTCEncryptionManager.js.map +1 -0
- package/lib/matrixrtc/ToDeviceKeyTransport.d.ts +30 -0
- package/lib/matrixrtc/ToDeviceKeyTransport.d.ts.map +1 -0
- package/lib/matrixrtc/ToDeviceKeyTransport.js +164 -0
- package/lib/matrixrtc/ToDeviceKeyTransport.js.map +1 -0
- package/lib/matrixrtc/index.d.ts +9 -0
- package/lib/matrixrtc/index.d.ts.map +1 -0
- package/lib/matrixrtc/index.js +23 -0
- package/lib/matrixrtc/index.js.map +1 -0
- package/lib/matrixrtc/membershipData/common.d.ts +8 -0
- package/lib/matrixrtc/membershipData/common.d.ts.map +1 -0
- package/lib/matrixrtc/membershipData/common.js +26 -0
- package/lib/matrixrtc/membershipData/common.js.map +1 -0
- package/lib/matrixrtc/membershipData/index.d.ts +4 -0
- package/lib/matrixrtc/membershipData/index.d.ts.map +1 -0
- package/lib/matrixrtc/membershipData/index.js +20 -0
- package/lib/matrixrtc/membershipData/index.js.map +1 -0
- package/lib/matrixrtc/membershipData/rtc.d.ts +33 -0
- package/lib/matrixrtc/membershipData/rtc.d.ts.map +1 -0
- package/lib/matrixrtc/membershipData/rtc.js +137 -0
- package/lib/matrixrtc/membershipData/rtc.js.map +1 -0
- package/lib/matrixrtc/membershipData/session.d.ts +77 -0
- package/lib/matrixrtc/membershipData/session.d.ts.map +1 -0
- package/lib/matrixrtc/membershipData/session.js +62 -0
- package/lib/matrixrtc/membershipData/session.js.map +1 -0
- package/lib/matrixrtc/types.d.ts +169 -0
- package/lib/matrixrtc/types.d.ts.map +1 -0
- package/lib/matrixrtc/types.js +117 -0
- package/lib/matrixrtc/types.js.map +1 -0
- package/lib/matrixrtc/utils.d.ts +27 -0
- package/lib/matrixrtc/utils.d.ts.map +1 -0
- package/lib/matrixrtc/utils.js +72 -0
- package/lib/matrixrtc/utils.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 +166 -0
- package/lib/models/MSC3089TreeSpace.d.ts.map +1 -0
- package/lib/models/MSC3089TreeSpace.js +521 -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 +52 -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 +36 -0
- package/lib/models/event-status.js.map +1 -0
- package/lib/models/event-timeline-set.d.ts +308 -0
- package/lib/models/event-timeline-set.d.ts.map +1 -0
- package/lib/models/event-timeline-set.js +805 -0
- package/lib/models/event-timeline-set.js.map +1 -0
- package/lib/models/event-timeline.d.ts +224 -0
- package/lib/models/event-timeline.d.ts.map +1 -0
- package/lib/models/event-timeline.js +434 -0
- package/lib/models/event-timeline.js.map +1 -0
- package/lib/models/event.d.ts +844 -0
- package/lib/models/event.d.ts.map +1 -0
- package/lib/models/event.js +1600 -0
- package/lib/models/event.js.map +1 -0
- package/lib/models/invites-ignorer-types.d.ts +27 -0
- package/lib/models/invites-ignorer-types.d.ts.map +1 -0
- package/lib/models/invites-ignorer-types.js +56 -0
- package/lib/models/invites-ignorer-types.js.map +1 -0
- package/lib/models/invites-ignorer.d.ts +112 -0
- package/lib/models/invites-ignorer.d.ts.map +1 -0
- package/lib/models/invites-ignorer.js +357 -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 +17 -0
- package/lib/models/profile-keys.d.ts.map +1 -0
- package/lib/models/profile-keys.js +34 -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 +123 -0
- package/lib/models/relations.d.ts.map +1 -0
- package/lib/models/relations.js +378 -0
- package/lib/models/relations.js.map +1 -0
- package/lib/models/room-member.d.ts +221 -0
- package/lib/models/room-member.d.ts.map +1 -0
- package/lib/models/room-member.js +376 -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 +463 -0
- package/lib/models/room-state.d.ts.map +1 -0
- package/lib/models/room-state.js +1066 -0
- package/lib/models/room-state.js.map +1 -0
- package/lib/models/room-sticky-events.d.ts +110 -0
- package/lib/models/room-sticky-events.d.ts.map +1 -0
- package/lib/models/room-sticky-events.js +353 -0
- package/lib/models/room-sticky-events.js.map +1 -0
- package/lib/models/room-summary.d.ts +59 -0
- package/lib/models/room-summary.d.ts.map +1 -0
- package/lib/models/room-summary.js +39 -0
- package/lib/models/room-summary.js.map +1 -0
- package/lib/models/room.d.ts +1285 -0
- package/lib/models/room.d.ts.map +1 -0
- package/lib/models/room.js +3548 -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 +245 -0
- package/lib/models/thread.d.ts.map +1 -0
- package/lib/models/thread.js +866 -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 +93 -0
- package/lib/oidc/authorize.d.ts.map +1 -0
- package/lib/oidc/authorize.js +282 -0
- package/lib/oidc/authorize.js.map +1 -0
- package/lib/oidc/discovery.d.ts +22 -0
- package/lib/oidc/discovery.d.ts.map +1 -0
- package/lib/oidc/discovery.js +78 -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 +16 -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 +70 -0
- package/lib/oidc/register.d.ts.map +1 -0
- package/lib/oidc/register.js +135 -0
- package/lib/oidc/register.js.map +1 -0
- package/lib/oidc/tokenRefresher.d.ts +91 -0
- package/lib/oidc/tokenRefresher.d.ts.map +1 -0
- package/lib/oidc/tokenRefresher.js +187 -0
- package/lib/oidc/tokenRefresher.js.map +1 -0
- package/lib/oidc/validate.d.ts +78 -0
- package/lib/oidc/validate.d.ts.map +1 -0
- package/lib/oidc/validate.js +181 -0
- package/lib/oidc/validate.js.map +1 -0
- package/lib/pushprocessor.d.ts +140 -0
- package/lib/pushprocessor.d.ts.map +1 -0
- package/lib/pushprocessor.js +702 -0
- package/lib/pushprocessor.js.map +1 -0
- package/lib/randomstring.d.ts +32 -0
- package/lib/randomstring.d.ts.map +1 -0
- package/lib/randomstring.js +97 -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 +389 -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 +47 -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 +254 -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 +35 -0
- package/lib/rust-crypto/CrossSigningIdentity.d.ts.map +1 -0
- package/lib/rust-crypto/CrossSigningIdentity.js +163 -0
- package/lib/rust-crypto/CrossSigningIdentity.js.map +1 -0
- package/lib/rust-crypto/DehydratedDeviceManager.d.ts +118 -0
- package/lib/rust-crypto/DehydratedDeviceManager.d.ts.map +1 -0
- package/lib/rust-crypto/DehydratedDeviceManager.js +361 -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 +36 -0
- package/lib/rust-crypto/OutgoingRequestProcessor.d.ts.map +1 -0
- package/lib/rust-crypto/OutgoingRequestProcessor.js +194 -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 +175 -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 +469 -0
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.js.map +1 -0
- package/lib/rust-crypto/RoomEncryptor.d.ts +100 -0
- package/lib/rust-crypto/RoomEncryptor.d.ts.map +1 -0
- package/lib/rust-crypto/RoomEncryptor.js +308 -0
- package/lib/rust-crypto/RoomEncryptor.js.map +1 -0
- package/lib/rust-crypto/backup.d.ts +278 -0
- package/lib/rust-crypto/backup.d.ts.map +1 -0
- package/lib/rust-crypto/backup.js +898 -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 +65 -0
- package/lib/rust-crypto/index.d.ts.map +1 -0
- package/lib/rust-crypto/index.js +149 -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 +456 -0
- package/lib/rust-crypto/libolm_migration.js.map +1 -0
- package/lib/rust-crypto/rust-crypto.d.ts +576 -0
- package/lib/rust-crypto/rust-crypto.d.ts.map +1 -0
- package/lib/rust-crypto/rust-crypto.js +2324 -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 +321 -0
- package/lib/rust-crypto/verification.d.ts.map +1 -0
- package/lib/rust-crypto/verification.js +817 -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 +383 -0
- package/lib/secret-storage.d.ts.map +1 -0
- package/lib/secret-storage.js +487 -0
- package/lib/secret-storage.js.map +1 -0
- package/lib/serverCapabilities.d.ts +78 -0
- package/lib/serverCapabilities.d.ts.map +1 -0
- package/lib/serverCapabilities.js +104 -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 +23 -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 +892 -0
- package/lib/sliding-sync-sdk.js.map +1 -0
- package/lib/sliding-sync.d.ts +306 -0
- package/lib/sliding-sync.d.ts.map +1 -0
- package/lib/sliding-sync.js +585 -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 +599 -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 +209 -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 +207 -0
- package/lib/sync-accumulator.d.ts.map +1 -0
- package/lib/sync-accumulator.js +588 -0
- package/lib/sync-accumulator.js.map +1 -0
- package/lib/sync.d.ts +273 -0
- package/lib/sync.d.ts.map +1 -0
- package/lib/sync.js +1764 -0
- package/lib/sync.js.map +1 -0
- package/lib/testing.d.ts +98 -0
- package/lib/testing.d.ts.map +1 -0
- package/lib/testing.js +205 -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 +52 -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/roomVersion.d.ts +13 -0
- package/lib/utils/roomVersion.d.ts.map +1 -0
- package/lib/utils/roomVersion.js +36 -0
- package/lib/utils/roomVersion.js.map +1 -0
- package/lib/utils.d.ts +270 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +764 -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 +2596 -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 +79 -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 +319 -0
- package/lib/webrtc/groupCall.d.ts.map +1 -0
- package/lib/webrtc/groupCall.js +1334 -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 +454 -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 +79 -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 +58 -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 +129 -0
- package/src/@types/AESEncryptedSecretStoragePayload.ts +29 -0
- package/src/@types/IIdentityServerProvider.ts +24 -0
- package/src/@types/PushRules.ts +208 -0
- package/src/@types/another-json.d.ts +19 -0
- package/src/@types/auth.ts +258 -0
- package/src/@types/beacon.ts +140 -0
- package/src/@types/common.ts +24 -0
- package/src/@types/crypto.ts +71 -0
- package/src/@types/event.ts +449 -0
- package/src/@types/events.ts +119 -0
- package/src/@types/extensible_events.ts +147 -0
- package/src/@types/global.d.ts +67 -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 +39 -0
- package/src/@types/media.ts +245 -0
- package/src/@types/membership.ts +57 -0
- package/src/@types/partials.ts +103 -0
- package/src/@types/polls.ts +120 -0
- package/src/@types/read_receipts.ts +61 -0
- package/src/@types/registration.ts +102 -0
- package/src/@types/requests.ts +346 -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 +153 -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 +69 -0
- package/src/@types/uia.ts +24 -0
- package/src/NamespacedValue.ts +121 -0
- package/src/ReEmitter.ts +93 -0
- package/src/ToDeviceMessageQueue.ts +156 -0
- package/src/autodiscovery.ts +505 -0
- package/src/base64.ts +86 -0
- package/src/briij.ts +173 -0
- package/src/browser-index.ts +44 -0
- package/src/client.ts +9031 -0
- package/src/common-crypto/CryptoBackend.ts +295 -0
- package/src/common-crypto/README.md +4 -0
- package/src/common-crypto/key-passphrase.ts +43 -0
- package/src/content-helpers.ts +298 -0
- package/src/content-repo.ts +122 -0
- package/src/crypto/store/base.ts +388 -0
- package/src/crypto/store/indexeddb-crypto-store-backend.ts +655 -0
- package/src/crypto/store/indexeddb-crypto-store.ts +555 -0
- package/src/crypto/store/localStorage-crypto-store.ts +409 -0
- package/src/crypto/store/memory-crypto-store.ts +326 -0
- package/src/crypto-api/CryptoEvent.ts +152 -0
- package/src/crypto-api/CryptoEventHandlerMap.ts +42 -0
- package/src/crypto-api/index.ts +1362 -0
- package/src/crypto-api/key-passphrase.ts +58 -0
- package/src/crypto-api/keybackup.ts +114 -0
- package/src/crypto-api/recovery-key.ts +69 -0
- package/src/crypto-api/verification.ts +382 -0
- package/src/digest.ts +34 -0
- package/src/embedded.ts +865 -0
- package/src/errors.ts +87 -0
- package/src/event-mapper.ts +88 -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 +143 -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 +88 -0
- package/src/filter-component.ts +209 -0
- package/src/filter.ts +245 -0
- package/src/http-api/errors.ts +261 -0
- package/src/http-api/fetch.ts +377 -0
- package/src/http-api/index.ts +194 -0
- package/src/http-api/interface.ts +229 -0
- package/src/http-api/method.ts +25 -0
- package/src/http-api/prefix.ts +48 -0
- package/src/http-api/refresh.ts +167 -0
- package/src/http-api/utils.ts +217 -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 +700 -0
- package/src/logger.ts +279 -0
- package/src/matrixrtc/CallMembership.ts +438 -0
- package/src/matrixrtc/EncryptionManager.ts +54 -0
- package/src/matrixrtc/IKeyTransport.ts +63 -0
- package/src/matrixrtc/IMembershipManager.ts +120 -0
- package/src/matrixrtc/LivekitTransport.ts +46 -0
- package/src/matrixrtc/MatrixRTCSession.ts +934 -0
- package/src/matrixrtc/MatrixRTCSessionManager.ts +170 -0
- package/src/matrixrtc/MembershipManager.ts +1122 -0
- package/src/matrixrtc/MembershipManagerActionScheduler.ts +135 -0
- package/src/matrixrtc/RTCEncryptionManager.ts +459 -0
- package/src/matrixrtc/ToDeviceKeyTransport.ts +197 -0
- package/src/matrixrtc/index.ts +24 -0
- package/src/matrixrtc/membershipData/common.ts +27 -0
- package/src/matrixrtc/membershipData/index.ts +19 -0
- package/src/matrixrtc/membershipData/rtc.ts +156 -0
- package/src/matrixrtc/membershipData/session.ts +146 -0
- package/src/matrixrtc/types.ts +227 -0
- package/src/matrixrtc/utils.ts +71 -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 +213 -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 +962 -0
- package/src/models/event-timeline.ts +461 -0
- package/src/models/event.ts +1819 -0
- package/src/models/invites-ignorer-types.ts +58 -0
- package/src/models/invites-ignorer.ts +341 -0
- package/src/models/poll.ts +285 -0
- package/src/models/profile-keys.ts +33 -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 +392 -0
- package/src/models/room-member.ts +486 -0
- package/src/models/room-receipts.ts +439 -0
- package/src/models/room-state.ts +1230 -0
- package/src/models/room-sticky-events.ts +383 -0
- package/src/models/room-summary.ts +78 -0
- package/src/models/room.ts +4067 -0
- package/src/models/search-result.ts +57 -0
- package/src/models/thread.ts +928 -0
- package/src/models/typed-event-emitter.ts +246 -0
- package/src/models/user.ts +302 -0
- package/src/oidc/authorize.ts +279 -0
- package/src/oidc/discovery.ts +67 -0
- package/src/oidc/error.ts +33 -0
- package/src/oidc/index.ts +33 -0
- package/src/oidc/register.ts +163 -0
- package/src/oidc/tokenRefresher.ts +184 -0
- package/src/oidc/validate.ts +265 -0
- package/src/pushprocessor.ts +856 -0
- package/src/randomstring.ts +103 -0
- package/src/realtime-callbacks.ts +191 -0
- package/src/receipt-accumulator.ts +189 -0
- package/src/rendezvous/MSC4108SignInWithQR.ts +443 -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 +272 -0
- package/src/rendezvous/transports/index.ts +17 -0
- package/src/room-hierarchy.ts +152 -0
- package/src/rust-crypto/CrossSigningIdentity.ts +195 -0
- package/src/rust-crypto/DehydratedDeviceManager.ts +392 -0
- package/src/rust-crypto/KeyClaimManager.ts +86 -0
- package/src/rust-crypto/OutgoingRequestProcessor.ts +233 -0
- package/src/rust-crypto/OutgoingRequestsManager.ts +170 -0
- package/src/rust-crypto/PerSessionKeyBackupDownloader.ts +501 -0
- package/src/rust-crypto/RoomEncryptor.ts +362 -0
- package/src/rust-crypto/backup.ts +942 -0
- package/src/rust-crypto/constants.ts +18 -0
- package/src/rust-crypto/device-converter.ts +128 -0
- package/src/rust-crypto/index.ts +251 -0
- package/src/rust-crypto/libolm_migration.ts +532 -0
- package/src/rust-crypto/rust-crypto.ts +2542 -0
- package/src/rust-crypto/secret-storage.ts +60 -0
- package/src/rust-crypto/verification.ts +833 -0
- package/src/scheduler.ts +309 -0
- package/src/secret-storage.ts +714 -0
- package/src/serverCapabilities.ts +146 -0
- package/src/service-types.ts +20 -0
- package/src/sliding-sync-sdk.ts +1005 -0
- package/src/sliding-sync.ts +674 -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 +212 -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 +779 -0
- package/src/sync.ts +2020 -0
- package/src/testing.ts +231 -0
- package/src/thread-utils.ts +31 -0
- package/src/timeline-window.ts +534 -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/roomVersion.ts +35 -0
- package/src/utils.ts +775 -0
- package/src/version-support.ts +50 -0
- package/src/webrtc/audioContext.ts +44 -0
- package/src/webrtc/call.ts +3061 -0
- package/src/webrtc/callEventHandler.ts +425 -0
- package/src/webrtc/callEventTypes.ts +101 -0
- package/src/webrtc/callFeed.ts +364 -0
- package/src/webrtc/groupCall.ts +1729 -0
- package/src/webrtc/groupCallEventHandler.ts +234 -0
- package/src/webrtc/mediaHandler.ts +501 -0
- package/src/webrtc/stats/callFeedStatsReporter.ts +91 -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 +70 -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
package/lib/client.d.ts
ADDED
|
@@ -0,0 +1,3493 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is an internal module. See {@link BriijClient} for the public class.
|
|
3
|
+
*/
|
|
4
|
+
import type { IDeviceKeys, IOneTimeKey } from "./@types/crypto.ts";
|
|
5
|
+
import { type ISyncStateData, type SetPresence, SyncApi, type SyncApiOptions, SyncState } from "./sync.ts";
|
|
6
|
+
import { EventStatus, type IDecryptOptions, type IEvent, BriijEvent, BriijEventEvent, type BriijEventHandlerMap, type PushDetails } from "./models/event.ts";
|
|
7
|
+
import { type CallEvent, type CallEventHandlerMap, type BriijCall } from "./webrtc/call.ts";
|
|
8
|
+
import { Filter, type IFilterDefinition } from "./filter.ts";
|
|
9
|
+
import { CallEventHandler, type CallEventHandlerEvent, type CallEventHandlerEventHandlerMap } from "./webrtc/callEventHandler.ts";
|
|
10
|
+
import { GroupCallEventHandler, type GroupCallEventHandlerEvent, type GroupCallEventHandlerEventHandlerMap } from "./webrtc/groupCallEventHandler.ts";
|
|
11
|
+
import { type QueryDict } from "./utils.ts";
|
|
12
|
+
import { Direction, EventTimeline } from "./models/event-timeline.ts";
|
|
13
|
+
import { type IActionsObject, PushProcessor } from "./pushprocessor.ts";
|
|
14
|
+
import { type AutoDiscoveryAction } from "./autodiscovery.ts";
|
|
15
|
+
import { TypedReEmitter } from "./ReEmitter.ts";
|
|
16
|
+
import { type Logger } from "./logger.ts";
|
|
17
|
+
import { SERVICE_TYPES } from "./service-types.ts";
|
|
18
|
+
import { type FileType, type HttpApiEvent, type HttpApiEventHandlerMap, type IHttpOpts, type IRequestOpts, BriijError, BriijHttpApi, type TokenRefreshFunction, type Upload, type UploadOpts, type UploadResponse } from "./http-api/index.ts";
|
|
19
|
+
import { User, UserEvent, type UserEventHandlerMap } from "./models/user.ts";
|
|
20
|
+
import { type IIdentityServerProvider } from "./@types/IIdentityServerProvider.ts";
|
|
21
|
+
import { type BriijScheduler } from "./scheduler.ts";
|
|
22
|
+
import { type BeaconEvent, type BeaconEventHandlerMap } from "./models/beacon.ts";
|
|
23
|
+
import { type AuthDict } from "./interactive-auth.ts";
|
|
24
|
+
import { type IMinimalEvent, type IRoomEvent, type IStateEvent, type ReceivedToDeviceMessage } from "./sync-accumulator.ts";
|
|
25
|
+
import type { EventTimelineSet } from "./models/event-timeline-set.ts";
|
|
26
|
+
import { type Room, type RoomEvent, type RoomEventHandlerMap, type RoomNameState } from "./models/room.ts";
|
|
27
|
+
import { RoomMemberEvent, type RoomMemberEventHandlerMap } from "./models/room-member.ts";
|
|
28
|
+
import { type RoomStateEvent, type RoomStateEventHandlerMap } from "./models/room-state.ts";
|
|
29
|
+
import { UpdateDelayedEventAction, type DelayedEventInfo, type IAddThreePidOnlyBody, type IBindThreePidBody, type ICreateRoomOpts, type IEventSearchOpts, type IGuestAccessOpts, type IJoinRoomOpts, type InviteOpts, type IPaginateOpts, type IPresenceOpts, type IRedactOpts, type IRelationsRequestOpts, type IRelationsResponse, type IRoomDirectoryOptions, type ISearchOpts, type ISendEventResponse, type IStatusResponse, type ITagsResponse, type KnockRoomOpts, type SendDelayedEventRequestOpts, type SendDelayedEventResponse } from "./@types/requests.ts";
|
|
30
|
+
import { type AccountDataEvents, EventType, RelationType, type RoomAccountDataEvents, RoomType, type StateEvents, type TimelineEvents, type WritableAccountDataEvents } from "./@types/event.ts";
|
|
31
|
+
import { type IdServerUnbindResult, type JoinRule, Preset, type Terms, type Visibility } from "./@types/partials.ts";
|
|
32
|
+
import { type EventMapper, type MapperOpts } from "./event-mapper.ts";
|
|
33
|
+
import { MSC3089TreeSpace } from "./models/MSC3089TreeSpace.ts";
|
|
34
|
+
import { type ISignatures } from "./@types/signed.ts";
|
|
35
|
+
import { type IStore } from "./store/index.ts";
|
|
36
|
+
import { type IEventWithRoomId, type ISearchRequestBody, type ISearchResponse, type ISearchResults, type IStateEventWithRoomId } from "./@types/search.ts";
|
|
37
|
+
import { type ISynapseAdminDeactivateResponse, type ISynapseAdminWhoisResponse } from "./@types/synapse.ts";
|
|
38
|
+
import { type IHierarchyRoom } from "./@types/spaces.ts";
|
|
39
|
+
import { type IPusher, type IPusherRequest, type IPushRule, type IPushRules, type PushRuleAction, PushRuleKind, type RuleId } from "./@types/PushRules.ts";
|
|
40
|
+
import { type IThreepid } from "./@types/threepids.ts";
|
|
41
|
+
import { type CryptoStore } from "./crypto/store/base.ts";
|
|
42
|
+
import { GroupCall, type GroupCallIntent, type GroupCallType, type IGroupCallDataChannelOptions } from "./webrtc/groupCall.ts";
|
|
43
|
+
import { MediaHandler } from "./webrtc/mediaHandler.ts";
|
|
44
|
+
import { type ILoginFlowsResponse, type IRefreshTokenResponse, type LoginRequest, type LoginResponse, type LoginTokenPostResponse, type SSOAction } from "./@types/auth.ts";
|
|
45
|
+
import { TypedEventEmitter } from "./models/typed-event-emitter.ts";
|
|
46
|
+
import { ReceiptType } from "./@types/read_receipts.ts";
|
|
47
|
+
import { type MSC3575SlidingSyncRequest, type MSC3575SlidingSyncResponse, type SlidingSync } from "./sliding-sync.ts";
|
|
48
|
+
import { SlidingSyncSdk } from "./sliding-sync-sdk.ts";
|
|
49
|
+
import { FeatureSupport, ThreadFilterType } from "./models/thread.ts";
|
|
50
|
+
import { type MBeaconInfoEventContent } from "./@types/beacon.ts";
|
|
51
|
+
import { NamespacedValue, UnstableValue } from "./NamespacedValue.ts";
|
|
52
|
+
import { type ToDeviceBatch, type ToDevicePayload } from "./models/ToDeviceMessage.ts";
|
|
53
|
+
import { IgnoredInvites } from "./models/invites-ignorer.ts";
|
|
54
|
+
import { type LocalNotificationSettings } from "./@types/local_notifications.ts";
|
|
55
|
+
import { Feature, ServerSupport } from "./feature.ts";
|
|
56
|
+
import { type CrossSigningKeyInfo, type CryptoApi, type CryptoCallbacks, CryptoEvent, type CryptoEventHandlerMap } from "./crypto-api/index.ts";
|
|
57
|
+
import { type SecretStorageKeyDescription, type ServerSideSecretStorage } from "./secret-storage.ts";
|
|
58
|
+
import { type RegisterRequest, type RegisterResponse } from "./@types/registration.ts";
|
|
59
|
+
import { BriijRTCSessionManager } from "./matrixrtc/MatrixRTCSessionManager.ts";
|
|
60
|
+
import { type Membership } from "./@types/membership.ts";
|
|
61
|
+
import { type RoomMessageEventContent } from "./@types/events.ts";
|
|
62
|
+
import { type ImageInfo } from "./@types/media.ts";
|
|
63
|
+
import { type Capabilities } from "./serverCapabilities.ts";
|
|
64
|
+
import { type OidcClientConfig } from "./oidc/index.ts";
|
|
65
|
+
import { type EmptyObject } from "./@types/common.ts";
|
|
66
|
+
import { type Transport } from "./matrixrtc/index.ts";
|
|
67
|
+
export type Store = IStore;
|
|
68
|
+
export type ResetTimelineCallback = (roomId: string) => boolean;
|
|
69
|
+
export declare const UNSTABLE_MSC3852_LAST_SEEN_UA: UnstableValue<"last_seen_user_agent", "org.matrix.msc3852.last_seen_user_agent">;
|
|
70
|
+
export interface IKeysUploadResponse {
|
|
71
|
+
one_time_key_counts: {
|
|
72
|
+
[algorithm: string]: number;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export interface ICreateClientOpts {
|
|
76
|
+
baseUrl: string;
|
|
77
|
+
idBaseUrl?: string;
|
|
78
|
+
/**
|
|
79
|
+
* The data store used for sync data from the homeserver. If not specified,
|
|
80
|
+
* this client will not store any HTTP responses. The `createClient` helper
|
|
81
|
+
* will create a default store if needed.
|
|
82
|
+
*/
|
|
83
|
+
store?: Store;
|
|
84
|
+
/**
|
|
85
|
+
* A store to be used for end-to-end crypto session data.
|
|
86
|
+
* The `createClient` helper will create a default store if needed. Calls the factory supplied to
|
|
87
|
+
* {@link setCryptoStoreFactory} if unspecified; or if no factory has been
|
|
88
|
+
* specified, uses a default implementation (indexeddb in the browser,
|
|
89
|
+
* in-memory otherwise).
|
|
90
|
+
*
|
|
91
|
+
* This is only used for the legacy crypto implementation,
|
|
92
|
+
* but if you use the rust crypto implementation ({@link BriijClient#initRustCrypto}) and the device
|
|
93
|
+
* previously used legacy crypto (so must be migrated), then this must still be provided, so that the
|
|
94
|
+
* data can be migrated from the legacy store.
|
|
95
|
+
*/
|
|
96
|
+
cryptoStore?: CryptoStore;
|
|
97
|
+
/**
|
|
98
|
+
* The scheduler to use. If not
|
|
99
|
+
* specified, this client will not retry requests on failure. This client
|
|
100
|
+
* will supply its own processing function to
|
|
101
|
+
* {@link BriijScheduler#setProcessFunction}.
|
|
102
|
+
*/
|
|
103
|
+
scheduler?: BriijScheduler;
|
|
104
|
+
/**
|
|
105
|
+
* The function to invoke for HTTP requests.
|
|
106
|
+
* Most supported environments have a global `fetch` registered to which this will fall back.
|
|
107
|
+
*/
|
|
108
|
+
fetchFn?: typeof globalThis.fetch;
|
|
109
|
+
userId?: string;
|
|
110
|
+
/**
|
|
111
|
+
* A unique identifier for this device; used for tracking things like crypto
|
|
112
|
+
* keys and access tokens. If not specified, end-to-end encryption will be
|
|
113
|
+
* disabled.
|
|
114
|
+
*/
|
|
115
|
+
deviceId?: string;
|
|
116
|
+
accessToken?: string;
|
|
117
|
+
refreshToken?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Function used to attempt refreshing access and refresh tokens
|
|
120
|
+
* Called by http-api when a possibly expired token is encountered
|
|
121
|
+
* and a refreshToken is found
|
|
122
|
+
*/
|
|
123
|
+
tokenRefreshFunction?: TokenRefreshFunction;
|
|
124
|
+
/**
|
|
125
|
+
* Identity server provider to retrieve the user's access token when accessing
|
|
126
|
+
* the identity server. See also https://github.com/vector-im/element-web/issues/10615
|
|
127
|
+
* which seeks to replace the previous approach of manual access tokens params
|
|
128
|
+
* with this callback throughout the SDK.
|
|
129
|
+
*/
|
|
130
|
+
identityServer?: IIdentityServerProvider;
|
|
131
|
+
/**
|
|
132
|
+
* The default maximum amount of
|
|
133
|
+
* time to wait before timing out HTTP requests. If not specified, there is no timeout.
|
|
134
|
+
*/
|
|
135
|
+
localTimeoutMs?: number;
|
|
136
|
+
/**
|
|
137
|
+
* Set to false to send the access token to the server via a query parameter rather
|
|
138
|
+
* than the Authorization HTTP header.
|
|
139
|
+
*
|
|
140
|
+
* Note that as of v1.11 of the Matrix spec, sending the access token via a query
|
|
141
|
+
* is deprecated.
|
|
142
|
+
*
|
|
143
|
+
* Default true.
|
|
144
|
+
*/
|
|
145
|
+
useAuthorizationHeader?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Set to true to enable
|
|
148
|
+
* improved timeline support, see {@link BriijClient#getEventTimeline}.
|
|
149
|
+
* It is disabled by default for compatibility with older clients - in particular to
|
|
150
|
+
* maintain support for back-paginating the live timeline after a '/sync'
|
|
151
|
+
* result with a gap.
|
|
152
|
+
*/
|
|
153
|
+
timelineSupport?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Extra query parameters to append
|
|
156
|
+
* to all requests with this client. Useful for application services which require
|
|
157
|
+
* `?user_id=`.
|
|
158
|
+
*/
|
|
159
|
+
queryParams?: QueryDict;
|
|
160
|
+
/**
|
|
161
|
+
* Encryption key used for encrypting sensitive data (such as e2ee keys) in {@link ICreateClientOpts#cryptoStore}.
|
|
162
|
+
*
|
|
163
|
+
* This must be set to the same value every time the client is initialised for the same device.
|
|
164
|
+
*
|
|
165
|
+
* This is only used for the legacy crypto implementation,
|
|
166
|
+
* but if you use the rust crypto implementation ({@link BriijClient#initRustCrypto}) and the device
|
|
167
|
+
* previously used legacy crypto (so must be migrated), then this must still be provided, so that the
|
|
168
|
+
* data can be migrated from the legacy store.
|
|
169
|
+
*/
|
|
170
|
+
pickleKey?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Verification methods we should offer to the other side when performing an interactive verification.
|
|
173
|
+
* If unset, we will offer all known methods. Currently these are: showing a QR code, scanning a QR code, and SAS
|
|
174
|
+
* (aka "emojis").
|
|
175
|
+
*
|
|
176
|
+
* See {@link types.VerificationMethod} for a set of useful constants for this parameter.
|
|
177
|
+
*/
|
|
178
|
+
verificationMethods?: Array<string>;
|
|
179
|
+
/**
|
|
180
|
+
* Whether relaying calls through a TURN server should be forced. Default false.
|
|
181
|
+
*/
|
|
182
|
+
forceTURN?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Up to this many ICE candidates will be gathered when an incoming call arrives.
|
|
185
|
+
* Gathering does not send data to the caller, but will communicate with the configured TURN
|
|
186
|
+
* server. Default 0.
|
|
187
|
+
*/
|
|
188
|
+
iceCandidatePoolSize?: number;
|
|
189
|
+
/**
|
|
190
|
+
* True to advertise support for call transfers to other parties on Matrix calls. Default false.
|
|
191
|
+
*/
|
|
192
|
+
supportsCallTransfer?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Whether to allow a fallback ICE server should be used for negotiating a
|
|
195
|
+
* WebRTC connection if the homeserver doesn't provide any servers. Defaults to false.
|
|
196
|
+
*/
|
|
197
|
+
fallbackICEServerAllowed?: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* If true, to-device signalling for group calls will be encrypted
|
|
200
|
+
* with Olm. Default: true.
|
|
201
|
+
*/
|
|
202
|
+
useE2eForGroupCall?: boolean;
|
|
203
|
+
livekitServiceURL?: string;
|
|
204
|
+
/**
|
|
205
|
+
* Crypto callbacks provided by the application
|
|
206
|
+
*/
|
|
207
|
+
cryptoCallbacks?: CryptoCallbacks;
|
|
208
|
+
/**
|
|
209
|
+
* Enable encrypted state events.
|
|
210
|
+
*/
|
|
211
|
+
enableEncryptedStateEvents?: boolean;
|
|
212
|
+
/**
|
|
213
|
+
* Method to generate room names for empty rooms and rooms names based on membership.
|
|
214
|
+
* Defaults to a built-in English handler with basic pluralisation.
|
|
215
|
+
*/
|
|
216
|
+
roomNameGenerator?: (roomId: string, state: RoomNameState) => string | null;
|
|
217
|
+
/**
|
|
218
|
+
* If true, participant can join group call without video and audio this has to be allowed. By default, a local
|
|
219
|
+
* media stream is needed to establish a group call.
|
|
220
|
+
* Default: false.
|
|
221
|
+
*/
|
|
222
|
+
isVoipWithNoMediaAllowed?: boolean;
|
|
223
|
+
/**
|
|
224
|
+
* Disable VoIP support (prevents fetching TURN servers, etc.)
|
|
225
|
+
* Default: false (VoIP enabled)
|
|
226
|
+
*/
|
|
227
|
+
disableVoip?: boolean;
|
|
228
|
+
/**
|
|
229
|
+
* If true, group calls will not establish media connectivity and only create the signaling events,
|
|
230
|
+
* so that livekit media can be used in the application layer (js-sdk contains no livekit code).
|
|
231
|
+
*/
|
|
232
|
+
useLivekitForGroupCalls?: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* A logger to associate with this BriijClient.
|
|
235
|
+
* Defaults to the built-in global logger; see {@link DebugLogger} for an alternative.
|
|
236
|
+
*/
|
|
237
|
+
logger?: Logger;
|
|
238
|
+
}
|
|
239
|
+
export interface IBriijClientCreateOpts extends ICreateClientOpts {
|
|
240
|
+
/**
|
|
241
|
+
* Whether to allow sending messages to encrypted rooms when encryption
|
|
242
|
+
* is not available internally within this SDK. This is useful if you are using an external
|
|
243
|
+
* E2E proxy, for example. Defaults to false.
|
|
244
|
+
*/
|
|
245
|
+
usingExternalCrypto?: boolean;
|
|
246
|
+
}
|
|
247
|
+
export declare enum PendingEventOrdering {
|
|
248
|
+
Chronological = "chronological",
|
|
249
|
+
Detached = "detached"
|
|
250
|
+
}
|
|
251
|
+
export interface IStartClientOpts {
|
|
252
|
+
/**
|
|
253
|
+
* The event `limit=` to apply to initial sync. Default: 8.
|
|
254
|
+
*/
|
|
255
|
+
initialSyncLimit?: number;
|
|
256
|
+
/**
|
|
257
|
+
* True to put `archived=true</code> on the <code>/initialSync` request. Default: false.
|
|
258
|
+
*/
|
|
259
|
+
includeArchivedRooms?: boolean;
|
|
260
|
+
/**
|
|
261
|
+
* True to do /profile requests on every invite event if the displayname/avatar_url is not known for this user ID. Default: false.
|
|
262
|
+
*/
|
|
263
|
+
resolveInvitesToProfiles?: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* Controls where pending messages appear in a room's timeline. If "<b>chronological</b>", messages will
|
|
266
|
+
* appear in the timeline when the call to `sendEvent` was made. If "<b>detached</b>",
|
|
267
|
+
* pending messages will appear in a separate list, accessible via {@link Room#getPendingEvents}.
|
|
268
|
+
* Default: "chronological".
|
|
269
|
+
*/
|
|
270
|
+
pendingEventOrdering?: PendingEventOrdering;
|
|
271
|
+
/**
|
|
272
|
+
* The number of milliseconds to wait on /sync. Default: 30000 (30 seconds).
|
|
273
|
+
*/
|
|
274
|
+
pollTimeout?: number;
|
|
275
|
+
/**
|
|
276
|
+
* The filter to apply to /sync calls.
|
|
277
|
+
*/
|
|
278
|
+
filter?: Filter;
|
|
279
|
+
/**
|
|
280
|
+
* True to perform syncing without automatically updating presence.
|
|
281
|
+
*/
|
|
282
|
+
disablePresence?: boolean;
|
|
283
|
+
/**
|
|
284
|
+
* True to not load all membership events during initial sync but fetch them when needed by calling
|
|
285
|
+
* `loadOutOfBandMembers` This will override the filter option at this moment.
|
|
286
|
+
*/
|
|
287
|
+
lazyLoadMembers?: boolean;
|
|
288
|
+
/**
|
|
289
|
+
* The number of seconds between polls to /.well-known/matrix/client, undefined to disable.
|
|
290
|
+
* This should be in the order of hours. Default: undefined.
|
|
291
|
+
*/
|
|
292
|
+
clientWellKnownPollPeriod?: number;
|
|
293
|
+
/**
|
|
294
|
+
* Will organises events in threaded conversations when
|
|
295
|
+
* a thread relation is encountered
|
|
296
|
+
*/
|
|
297
|
+
threadSupport?: boolean;
|
|
298
|
+
/**
|
|
299
|
+
* @experimental
|
|
300
|
+
*/
|
|
301
|
+
slidingSync?: SlidingSync;
|
|
302
|
+
}
|
|
303
|
+
export interface IStoredClientOpts extends IStartClientOpts {
|
|
304
|
+
}
|
|
305
|
+
export declare const GET_LOGIN_TOKEN_CAPABILITY: NamespacedValue<"m.get_login_token", "org.matrix.msc3882.get_login_token">;
|
|
306
|
+
export declare const UNSTABLE_MSC2666_SHARED_ROOMS = "uk.half-shot.msc2666";
|
|
307
|
+
export declare const UNSTABLE_MSC2666_MUTUAL_ROOMS = "uk.half-shot.msc2666.mutual_rooms";
|
|
308
|
+
export declare const UNSTABLE_MSC2666_QUERY_MUTUAL_ROOMS = "uk.half-shot.msc2666.query_mutual_rooms";
|
|
309
|
+
export declare const UNSTABLE_MSC4140_DELAYED_EVENTS = "org.matrix.msc4140";
|
|
310
|
+
export declare const UNSTABLE_MSC4354_STICKY_EVENTS = "org.matrix.msc4354";
|
|
311
|
+
export declare const UNSTABLE_MSC4133_EXTENDED_PROFILES = "uk.tcpip.msc4133";
|
|
312
|
+
export declare const STABLE_MSC4133_EXTENDED_PROFILES = "uk.tcpip.msc4133.stable";
|
|
313
|
+
declare enum CrossSigningKeyType {
|
|
314
|
+
MasterKey = "master_key",
|
|
315
|
+
SelfSigningKey = "self_signing_key",
|
|
316
|
+
UserSigningKey = "user_signing_key"
|
|
317
|
+
}
|
|
318
|
+
export type CrossSigningKeys = Record<CrossSigningKeyType, CrossSigningKeyInfo>;
|
|
319
|
+
export type SendToDeviceContentMap = Map<string, Map<string, Record<string, any>>>;
|
|
320
|
+
export interface ISignedKey {
|
|
321
|
+
keys: Record<string, string>;
|
|
322
|
+
signatures: ISignatures;
|
|
323
|
+
user_id: string;
|
|
324
|
+
algorithms: string[];
|
|
325
|
+
device_id: string;
|
|
326
|
+
}
|
|
327
|
+
export type KeySignatures = Record<string, Record<string, CrossSigningKeyInfo | ISignedKey>>;
|
|
328
|
+
export interface IUploadKeySignaturesResponse {
|
|
329
|
+
failures: Record<string, Record<string, {
|
|
330
|
+
errcode: string;
|
|
331
|
+
error: string;
|
|
332
|
+
}>>;
|
|
333
|
+
}
|
|
334
|
+
export interface IPreviewUrlResponse {
|
|
335
|
+
[key: string]: undefined | string | number;
|
|
336
|
+
"og:title": string;
|
|
337
|
+
"og:type": string;
|
|
338
|
+
"og:url": string;
|
|
339
|
+
"og:image"?: string;
|
|
340
|
+
"og:image:type"?: string;
|
|
341
|
+
"og:image:height"?: number;
|
|
342
|
+
"og:image:width"?: number;
|
|
343
|
+
"og:description"?: string;
|
|
344
|
+
"matrix:image:size"?: number;
|
|
345
|
+
}
|
|
346
|
+
export interface ITurnServerResponse {
|
|
347
|
+
uris: string[];
|
|
348
|
+
username: string;
|
|
349
|
+
password: string;
|
|
350
|
+
ttl: number;
|
|
351
|
+
}
|
|
352
|
+
export interface ITurnServer {
|
|
353
|
+
urls: string[];
|
|
354
|
+
username: string;
|
|
355
|
+
credential: string;
|
|
356
|
+
}
|
|
357
|
+
export interface IServerVersions {
|
|
358
|
+
versions: string[];
|
|
359
|
+
unstable_features: Record<string, boolean>;
|
|
360
|
+
}
|
|
361
|
+
export interface IClientWellKnown {
|
|
362
|
+
[key: string]: any;
|
|
363
|
+
"m.homeserver"?: IWellKnownConfig;
|
|
364
|
+
"m.identity_server"?: IWellKnownConfig;
|
|
365
|
+
}
|
|
366
|
+
export interface IWellKnownConfig<T = IClientWellKnown> {
|
|
367
|
+
raw?: T;
|
|
368
|
+
action?: AutoDiscoveryAction;
|
|
369
|
+
reason?: string;
|
|
370
|
+
error?: Error | string;
|
|
371
|
+
base_url?: string | null;
|
|
372
|
+
server_name?: string;
|
|
373
|
+
}
|
|
374
|
+
interface IMediaConfig {
|
|
375
|
+
[key: string]: any;
|
|
376
|
+
"m.upload.size"?: number;
|
|
377
|
+
}
|
|
378
|
+
interface ITagMetadata {
|
|
379
|
+
[key: string]: any;
|
|
380
|
+
order?: number;
|
|
381
|
+
}
|
|
382
|
+
interface IMessagesResponse {
|
|
383
|
+
start?: string;
|
|
384
|
+
end?: string;
|
|
385
|
+
chunk: IRoomEvent[];
|
|
386
|
+
state?: IStateEvent[];
|
|
387
|
+
}
|
|
388
|
+
export interface IRequestTokenResponse {
|
|
389
|
+
sid: string;
|
|
390
|
+
submit_url?: string;
|
|
391
|
+
}
|
|
392
|
+
export interface IRequestMsisdnTokenResponse extends IRequestTokenResponse {
|
|
393
|
+
msisdn: string;
|
|
394
|
+
success: boolean;
|
|
395
|
+
intl_fmt: string;
|
|
396
|
+
}
|
|
397
|
+
export interface IUploadKeysRequest {
|
|
398
|
+
"device_keys"?: Required<IDeviceKeys>;
|
|
399
|
+
"one_time_keys"?: Record<string, IOneTimeKey>;
|
|
400
|
+
"org.matrix.msc2732.fallback_keys"?: Record<string, IOneTimeKey>;
|
|
401
|
+
}
|
|
402
|
+
export interface IQueryKeysRequest {
|
|
403
|
+
device_keys: {
|
|
404
|
+
[userId: string]: string[];
|
|
405
|
+
};
|
|
406
|
+
timeout?: number;
|
|
407
|
+
token?: string;
|
|
408
|
+
}
|
|
409
|
+
export interface IClaimKeysRequest {
|
|
410
|
+
one_time_keys: {
|
|
411
|
+
[userId: string]: {
|
|
412
|
+
[deviceId: string]: string;
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
timeout?: number;
|
|
416
|
+
}
|
|
417
|
+
export interface IOpenIDToken {
|
|
418
|
+
access_token: string;
|
|
419
|
+
token_type: "Bearer" | string;
|
|
420
|
+
matrix_server_name: string;
|
|
421
|
+
expires_in: number;
|
|
422
|
+
}
|
|
423
|
+
interface IRoomInitialSyncResponse {
|
|
424
|
+
room_id: string;
|
|
425
|
+
membership: Membership;
|
|
426
|
+
messages?: {
|
|
427
|
+
start?: string;
|
|
428
|
+
end?: string;
|
|
429
|
+
chunk: IEventWithRoomId[];
|
|
430
|
+
};
|
|
431
|
+
state?: IStateEventWithRoomId[];
|
|
432
|
+
visibility: Visibility;
|
|
433
|
+
account_data?: IMinimalEvent[];
|
|
434
|
+
presence: Partial<IEvent>;
|
|
435
|
+
}
|
|
436
|
+
interface IJoinedRoomsResponse {
|
|
437
|
+
joined_rooms: string[];
|
|
438
|
+
}
|
|
439
|
+
interface IJoinedMembersResponse {
|
|
440
|
+
joined: {
|
|
441
|
+
[userId: string]: {
|
|
442
|
+
display_name: string;
|
|
443
|
+
avatar_url: string;
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
export type IRegisterRequestParams = RegisterRequest;
|
|
448
|
+
export interface IPublicRoomsChunkRoom {
|
|
449
|
+
room_id: string;
|
|
450
|
+
name?: string;
|
|
451
|
+
avatar_url?: string;
|
|
452
|
+
topic?: string;
|
|
453
|
+
canonical_alias?: string;
|
|
454
|
+
aliases?: string[];
|
|
455
|
+
world_readable: boolean;
|
|
456
|
+
guest_can_join: boolean;
|
|
457
|
+
num_joined_members: number;
|
|
458
|
+
room_type?: RoomType | string;
|
|
459
|
+
join_rule?: JoinRule.Knock | JoinRule.Public;
|
|
460
|
+
}
|
|
461
|
+
interface IPublicRoomsResponse {
|
|
462
|
+
chunk: IPublicRoomsChunkRoom[];
|
|
463
|
+
next_batch?: string;
|
|
464
|
+
prev_batch?: string;
|
|
465
|
+
total_room_count_estimate?: number;
|
|
466
|
+
}
|
|
467
|
+
interface IUserDirectoryResponse {
|
|
468
|
+
results: {
|
|
469
|
+
user_id: string;
|
|
470
|
+
display_name?: string;
|
|
471
|
+
avatar_url?: string;
|
|
472
|
+
}[];
|
|
473
|
+
limited: boolean;
|
|
474
|
+
}
|
|
475
|
+
export interface IMyDevice {
|
|
476
|
+
"device_id": string;
|
|
477
|
+
"display_name"?: string;
|
|
478
|
+
"last_seen_ip"?: string;
|
|
479
|
+
"last_seen_ts"?: number;
|
|
480
|
+
"last_seen_user_agent"?: string;
|
|
481
|
+
"org.matrix.msc3852.last_seen_user_agent"?: string;
|
|
482
|
+
}
|
|
483
|
+
export interface Keys {
|
|
484
|
+
keys: {
|
|
485
|
+
[keyId: string]: string;
|
|
486
|
+
};
|
|
487
|
+
usage: string[];
|
|
488
|
+
user_id: string;
|
|
489
|
+
}
|
|
490
|
+
export interface SigningKeys extends Keys {
|
|
491
|
+
signatures: ISignatures;
|
|
492
|
+
}
|
|
493
|
+
export interface DeviceKeys {
|
|
494
|
+
[deviceId: string]: IDeviceKeys & {
|
|
495
|
+
unsigned?: {
|
|
496
|
+
device_display_name: string;
|
|
497
|
+
};
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
export interface IDownloadKeyResult {
|
|
501
|
+
failures: {
|
|
502
|
+
[serverName: string]: object;
|
|
503
|
+
};
|
|
504
|
+
device_keys: {
|
|
505
|
+
[userId: string]: DeviceKeys;
|
|
506
|
+
};
|
|
507
|
+
master_keys?: {
|
|
508
|
+
[userId: string]: Keys;
|
|
509
|
+
};
|
|
510
|
+
self_signing_keys?: {
|
|
511
|
+
[userId: string]: SigningKeys;
|
|
512
|
+
};
|
|
513
|
+
user_signing_keys?: {
|
|
514
|
+
[userId: string]: SigningKeys;
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
export interface IClaimOTKsResult {
|
|
518
|
+
failures: {
|
|
519
|
+
[serverName: string]: object;
|
|
520
|
+
};
|
|
521
|
+
one_time_keys: {
|
|
522
|
+
[userId: string]: {
|
|
523
|
+
[deviceId: string]: {
|
|
524
|
+
[keyId: string]: {
|
|
525
|
+
key: string;
|
|
526
|
+
signatures: ISignatures;
|
|
527
|
+
};
|
|
528
|
+
};
|
|
529
|
+
};
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
export interface IFieldType {
|
|
533
|
+
regexp: string;
|
|
534
|
+
placeholder: string;
|
|
535
|
+
}
|
|
536
|
+
export interface IInstance {
|
|
537
|
+
desc: string;
|
|
538
|
+
icon?: string;
|
|
539
|
+
fields: object;
|
|
540
|
+
network_id: string;
|
|
541
|
+
instance_id: string;
|
|
542
|
+
}
|
|
543
|
+
export interface IProtocol {
|
|
544
|
+
user_fields: string[];
|
|
545
|
+
location_fields: string[];
|
|
546
|
+
icon: string;
|
|
547
|
+
field_types: Record<string, IFieldType>;
|
|
548
|
+
instances: IInstance[];
|
|
549
|
+
}
|
|
550
|
+
interface IThirdPartyLocation {
|
|
551
|
+
alias: string;
|
|
552
|
+
protocol: string;
|
|
553
|
+
fields: object;
|
|
554
|
+
}
|
|
555
|
+
interface IThirdPartyUser {
|
|
556
|
+
userid: string;
|
|
557
|
+
protocol: string;
|
|
558
|
+
fields: object;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* The summary of a room as defined by an initial version of MSC3266 and implemented in Synapse
|
|
562
|
+
* Proposed at https://github.com/matrix-org/matrix-doc/pull/3266
|
|
563
|
+
*/
|
|
564
|
+
export interface RoomSummary extends Omit<IPublicRoomsChunkRoom, "canonical_alias" | "aliases"> {
|
|
565
|
+
/**
|
|
566
|
+
* The current membership of this user in the room.
|
|
567
|
+
* Usually "leave" if the room is fetched over federation.
|
|
568
|
+
*/
|
|
569
|
+
"membership"?: Membership;
|
|
570
|
+
/**
|
|
571
|
+
* Version of the room.
|
|
572
|
+
*/
|
|
573
|
+
"im.nheko.summary.room_version"?: string;
|
|
574
|
+
/**
|
|
575
|
+
* The encryption algorithm used for this room, if the room is encrypted.
|
|
576
|
+
*/
|
|
577
|
+
"im.nheko.summary.encryption"?: string;
|
|
578
|
+
}
|
|
579
|
+
interface IRoomHierarchy {
|
|
580
|
+
rooms: IHierarchyRoom[];
|
|
581
|
+
next_batch?: string;
|
|
582
|
+
}
|
|
583
|
+
export interface TimestampToEventResponse {
|
|
584
|
+
event_id: string;
|
|
585
|
+
origin_server_ts: number;
|
|
586
|
+
}
|
|
587
|
+
interface IWhoamiResponse {
|
|
588
|
+
user_id: string;
|
|
589
|
+
device_id?: string;
|
|
590
|
+
is_guest?: boolean;
|
|
591
|
+
}
|
|
592
|
+
export declare enum ClientEvent {
|
|
593
|
+
/**
|
|
594
|
+
* Fires whenever the SDK's syncing state is updated. The state can be one of:
|
|
595
|
+
* <ul>
|
|
596
|
+
*
|
|
597
|
+
* <li>PREPARED: The client has synced with the server at least once and is
|
|
598
|
+
* ready for methods to be called on it. This will be immediately followed by
|
|
599
|
+
* a state of SYNCING. <i>This is the equivalent of "syncComplete" in the
|
|
600
|
+
* previous API.</i></li>
|
|
601
|
+
*
|
|
602
|
+
* <li>CATCHUP: The client has detected the connection to the server might be
|
|
603
|
+
* available again and will now try to do a sync again. As this sync might take
|
|
604
|
+
* a long time (depending how long ago was last synced, and general server
|
|
605
|
+
* performance) the client is put in this mode so the UI can reflect trying
|
|
606
|
+
* to catch up with the server after losing connection.</li>
|
|
607
|
+
*
|
|
608
|
+
* <li>SYNCING : The client is currently polling for new events from the server.
|
|
609
|
+
* This will be called <i>after</i> processing latest events from a sync.</li>
|
|
610
|
+
*
|
|
611
|
+
* <li>ERROR : The client has had a problem syncing with the server. If this is
|
|
612
|
+
* called <i>before</i> PREPARED then there was a problem performing the initial
|
|
613
|
+
* sync. If this is called <i>after</i> PREPARED then there was a problem polling
|
|
614
|
+
* the server for updates. This may be called multiple times even if the state is
|
|
615
|
+
* already ERROR. <i>This is the equivalent of "syncError" in the previous
|
|
616
|
+
* API.</i></li>
|
|
617
|
+
*
|
|
618
|
+
* <li>RECONNECTING: The sync connection has dropped, but not (yet) in a way that
|
|
619
|
+
* should be considered erroneous.
|
|
620
|
+
* </li>
|
|
621
|
+
*
|
|
622
|
+
* <li>STOPPED: The client has stopped syncing with server due to stopClient
|
|
623
|
+
* being called.
|
|
624
|
+
* </li>
|
|
625
|
+
* </ul>
|
|
626
|
+
* State transition diagram:
|
|
627
|
+
* ```
|
|
628
|
+
* +---->STOPPED
|
|
629
|
+
* |
|
|
630
|
+
* +----->PREPARED -------> SYNCING <--+
|
|
631
|
+
* | ^ | ^ |
|
|
632
|
+
* | CATCHUP ----------+ | | |
|
|
633
|
+
* | ^ V | |
|
|
634
|
+
* null ------+ | +------- RECONNECTING |
|
|
635
|
+
* | V V |
|
|
636
|
+
* +------->ERROR ---------------------+
|
|
637
|
+
*
|
|
638
|
+
* NB: 'null' will never be emitted by this event.
|
|
639
|
+
*
|
|
640
|
+
* ```
|
|
641
|
+
* Transitions:
|
|
642
|
+
* <ul>
|
|
643
|
+
*
|
|
644
|
+
* <li>`null -> PREPARED` : Occurs when the initial sync is completed
|
|
645
|
+
* first time. This involves setting up filters and obtaining push rules.
|
|
646
|
+
*
|
|
647
|
+
* <li>`null -> ERROR` : Occurs when the initial sync failed first time.
|
|
648
|
+
*
|
|
649
|
+
* <li>`ERROR -> PREPARED` : Occurs when the initial sync succeeds
|
|
650
|
+
* after previously failing.
|
|
651
|
+
*
|
|
652
|
+
* <li>`PREPARED -> SYNCING` : Occurs immediately after transitioning
|
|
653
|
+
* to PREPARED. Starts listening for live updates rather than catching up.
|
|
654
|
+
*
|
|
655
|
+
* <li>`SYNCING -> RECONNECTING` : Occurs when the live update fails.
|
|
656
|
+
*
|
|
657
|
+
* <li>`RECONNECTING -> RECONNECTING` : Can occur if the update calls
|
|
658
|
+
* continue to fail, but the keepalive calls (to /versions) succeed.
|
|
659
|
+
*
|
|
660
|
+
* <li>`RECONNECTING -> ERROR` : Occurs when the keepalive call also fails
|
|
661
|
+
*
|
|
662
|
+
* <li>`ERROR -> SYNCING` : Occurs when the client has performed a
|
|
663
|
+
* live update after having previously failed.
|
|
664
|
+
*
|
|
665
|
+
* <li>`ERROR -> ERROR` : Occurs when the client has failed to keepalive
|
|
666
|
+
* for a second time or more.</li>
|
|
667
|
+
*
|
|
668
|
+
* <li>`SYNCING -> SYNCING` : Occurs when the client has performed a live
|
|
669
|
+
* update. This is called <i>after</i> processing.</li>
|
|
670
|
+
*
|
|
671
|
+
* <li>`* -> STOPPED` : Occurs once the client has stopped syncing or
|
|
672
|
+
* trying to sync after stopClient has been called.</li>
|
|
673
|
+
* </ul>
|
|
674
|
+
*
|
|
675
|
+
* The payloads consits of the following 3 parameters:
|
|
676
|
+
*
|
|
677
|
+
* - state - An enum representing the syncing state. One of "PREPARED",
|
|
678
|
+
* "SYNCING", "ERROR", "STOPPED".
|
|
679
|
+
*
|
|
680
|
+
* - prevState - An enum representing the previous syncing state.
|
|
681
|
+
* One of "PREPARED", "SYNCING", "ERROR", "STOPPED" <b>or null</b>.
|
|
682
|
+
*
|
|
683
|
+
* - data - Data about this transition.
|
|
684
|
+
*
|
|
685
|
+
* @example
|
|
686
|
+
* ```
|
|
687
|
+
* matrixClient.on("sync", function(state, prevState, data) {
|
|
688
|
+
* switch (state) {
|
|
689
|
+
* case "ERROR":
|
|
690
|
+
* // update UI to say "Connection Lost"
|
|
691
|
+
* break;
|
|
692
|
+
* case "SYNCING":
|
|
693
|
+
* // update UI to remove any "Connection Lost" message
|
|
694
|
+
* break;
|
|
695
|
+
* case "PREPARED":
|
|
696
|
+
* // the client instance is ready to be queried.
|
|
697
|
+
* var rooms = matrixClient.getRooms();
|
|
698
|
+
* break;
|
|
699
|
+
* }
|
|
700
|
+
* });
|
|
701
|
+
* ```
|
|
702
|
+
*/
|
|
703
|
+
Sync = "sync",
|
|
704
|
+
/**
|
|
705
|
+
* Fires whenever the SDK receives a new event.
|
|
706
|
+
* <p>
|
|
707
|
+
* This is only fired for live events received via /sync - it is not fired for
|
|
708
|
+
* events received over context, search, or pagination APIs.
|
|
709
|
+
*
|
|
710
|
+
* The payload is the matrix event which caused this event to fire.
|
|
711
|
+
* @example
|
|
712
|
+
* ```
|
|
713
|
+
* matrixClient.on("event", function(event){
|
|
714
|
+
* var sender = event.getSender();
|
|
715
|
+
* });
|
|
716
|
+
* ```
|
|
717
|
+
*/
|
|
718
|
+
Event = "event",
|
|
719
|
+
/** @deprecated Use {@link ReceivedToDeviceMessage}.
|
|
720
|
+
* Fires whenever the SDK receives a new to-device event.
|
|
721
|
+
* The payload is the matrix event ({@link BriijEvent}) which caused this event to fire.
|
|
722
|
+
* @example
|
|
723
|
+
* ```
|
|
724
|
+
* matrixClient.on("toDeviceEvent", function(event){
|
|
725
|
+
* var sender = event.getSender();
|
|
726
|
+
* });
|
|
727
|
+
* ```
|
|
728
|
+
*/
|
|
729
|
+
ToDeviceEvent = "toDeviceEvent",
|
|
730
|
+
/**
|
|
731
|
+
* Fires whenever the SDK receives a new (potentially decrypted) to-device message.
|
|
732
|
+
* The payload is the to-device message and the encryption info for that message ({@link ReceivedToDeviceMessage}).
|
|
733
|
+
* @example
|
|
734
|
+
* ```
|
|
735
|
+
* matrixClient.on("receivedToDeviceMessage", function(payload){
|
|
736
|
+
* const { message, encryptionInfo } = payload;
|
|
737
|
+
* var claimed_sender = encryptionInfo ? encryptionInfo.sender : message.sender;
|
|
738
|
+
* var isVerified = encryptionInfo ? encryptionInfo.verified : false;
|
|
739
|
+
* var type = message.type;
|
|
740
|
+
* });
|
|
741
|
+
*/
|
|
742
|
+
ReceivedToDeviceMessage = "receivedToDeviceMessage",
|
|
743
|
+
/**
|
|
744
|
+
* Fires whenever new user-scoped account_data is added.
|
|
745
|
+
* The payload is a pair of event ({@link BriijEvent}) describing the account_data just added, and the previous event, if known:
|
|
746
|
+
* - event: The event describing the account_data just added
|
|
747
|
+
* - oldEvent: The previous account data, if known.
|
|
748
|
+
* @example
|
|
749
|
+
* ```
|
|
750
|
+
* matrixClient.on("accountData", function(event, oldEvent){
|
|
751
|
+
* myAccountData[event.type] = event.content;
|
|
752
|
+
* });
|
|
753
|
+
* ```
|
|
754
|
+
*/
|
|
755
|
+
AccountData = "accountData",
|
|
756
|
+
/**
|
|
757
|
+
* Fires whenever a new Room is added. This will fire when you are invited to a
|
|
758
|
+
* room, as well as when you join a room. <strong>This event is experimental and
|
|
759
|
+
* may change.</strong>
|
|
760
|
+
*
|
|
761
|
+
* The payload is the newly created room, fully populated.
|
|
762
|
+
* @example
|
|
763
|
+
* ```
|
|
764
|
+
* matrixClient.on("Room", function(room){
|
|
765
|
+
* var roomId = room.roomId;
|
|
766
|
+
* });
|
|
767
|
+
* ```
|
|
768
|
+
*/
|
|
769
|
+
Room = "Room",
|
|
770
|
+
/**
|
|
771
|
+
* Fires whenever a Room is removed. This will fire when you forget a room.
|
|
772
|
+
* <strong>This event is experimental and may change.</strong>
|
|
773
|
+
* The payload is the roomId of the deleted room.
|
|
774
|
+
* @example
|
|
775
|
+
* ```
|
|
776
|
+
* matrixClient.on("deleteRoom", function(roomId){
|
|
777
|
+
* // update UI from getRooms()
|
|
778
|
+
* });
|
|
779
|
+
* ```
|
|
780
|
+
*/
|
|
781
|
+
DeleteRoom = "deleteRoom",
|
|
782
|
+
SyncUnexpectedError = "sync.unexpectedError",
|
|
783
|
+
/**
|
|
784
|
+
* Fires when the client .well-known info is fetched.
|
|
785
|
+
* The payload is the JSON object (see {@link IClientWellKnown}) returned by the server
|
|
786
|
+
*/
|
|
787
|
+
ClientWellKnown = "WellKnown.client",
|
|
788
|
+
ReceivedVoipEvent = "received_voip_event",
|
|
789
|
+
TurnServers = "turnServers",
|
|
790
|
+
TurnServersError = "turnServers.error"
|
|
791
|
+
}
|
|
792
|
+
type RoomEvents = RoomEvent.Name | RoomEvent.Redaction | RoomEvent.RedactionCancelled | RoomEvent.Receipt | RoomEvent.Tags | RoomEvent.LocalEchoUpdated | RoomEvent.HistoryImportedWithinTimeline | RoomEvent.AccountData | RoomEvent.MyMembership | RoomEvent.Timeline | RoomEvent.TimelineReset;
|
|
793
|
+
type RoomStateEvents = RoomStateEvent.Events | RoomStateEvent.Members | RoomStateEvent.NewMember | RoomStateEvent.Update | RoomStateEvent.Marker;
|
|
794
|
+
type CryptoEvents = (typeof CryptoEvent)[keyof typeof CryptoEvent];
|
|
795
|
+
type BriijEventEvents = BriijEventEvent.Decrypted | BriijEventEvent.Replaced | BriijEventEvent.VisibilityChange;
|
|
796
|
+
type RoomMemberEvents = RoomMemberEvent.Name | RoomMemberEvent.Typing | RoomMemberEvent.PowerLevel | RoomMemberEvent.Membership;
|
|
797
|
+
type UserEvents = UserEvent.AvatarUrl | UserEvent.DisplayName | UserEvent.Presence | UserEvent.CurrentlyActive | UserEvent.LastPresenceTs;
|
|
798
|
+
export type EmittedEvents = ClientEvent | RoomEvents | RoomStateEvents | CryptoEvents | BriijEventEvents | RoomMemberEvents | UserEvents | CallEvent | CallEventHandlerEvent.Incoming | GroupCallEventHandlerEvent.Incoming | GroupCallEventHandlerEvent.Outgoing | GroupCallEventHandlerEvent.Ended | GroupCallEventHandlerEvent.Participants | HttpApiEvent.SessionLoggedOut | HttpApiEvent.NoConsent | BeaconEvent;
|
|
799
|
+
export type ClientEventHandlerMap = {
|
|
800
|
+
[ClientEvent.Sync]: (state: SyncState, prevState: SyncState | null, data?: ISyncStateData) => void;
|
|
801
|
+
[ClientEvent.Event]: (event: BriijEvent) => void;
|
|
802
|
+
[ClientEvent.ToDeviceEvent]: (event: BriijEvent) => void;
|
|
803
|
+
[ClientEvent.ReceivedToDeviceMessage]: (payload: ReceivedToDeviceMessage) => void;
|
|
804
|
+
[ClientEvent.AccountData]: (event: BriijEvent, lastEvent?: BriijEvent) => void;
|
|
805
|
+
[ClientEvent.Room]: (room: Room) => void;
|
|
806
|
+
[ClientEvent.DeleteRoom]: (roomId: string) => void;
|
|
807
|
+
[ClientEvent.SyncUnexpectedError]: (error: Error) => void;
|
|
808
|
+
[ClientEvent.ClientWellKnown]: (data: IClientWellKnown) => void;
|
|
809
|
+
[ClientEvent.ReceivedVoipEvent]: (event: BriijEvent) => void;
|
|
810
|
+
[ClientEvent.TurnServers]: (servers: ITurnServer[]) => void;
|
|
811
|
+
[ClientEvent.TurnServersError]: (error: Error, fatal: boolean) => void;
|
|
812
|
+
} & RoomEventHandlerMap & RoomStateEventHandlerMap & CryptoEventHandlerMap & BriijEventHandlerMap & RoomMemberEventHandlerMap & UserEventHandlerMap & CallEventHandlerEventHandlerMap & GroupCallEventHandlerEventHandlerMap & CallEventHandlerMap & HttpApiEventHandlerMap & BeaconEventHandlerMap;
|
|
813
|
+
/**
|
|
814
|
+
* Represents a Matrix Client. Only directly construct this if you want to use
|
|
815
|
+
* custom modules. Normally, {@link createClient} should be used
|
|
816
|
+
* as it specifies 'sensible' defaults for these modules.
|
|
817
|
+
*/
|
|
818
|
+
export declare class BriijClient extends TypedEventEmitter<EmittedEvents, ClientEventHandlerMap> {
|
|
819
|
+
static readonly RESTORE_BACKUP_ERROR_BAD_KEY = "RESTORE_BACKUP_ERROR_BAD_KEY";
|
|
820
|
+
private readonly logger;
|
|
821
|
+
reEmitter: TypedReEmitter<EmittedEvents, ClientEventHandlerMap>;
|
|
822
|
+
olmVersion: [number, number, number] | null;
|
|
823
|
+
usingExternalCrypto: boolean;
|
|
824
|
+
private _store;
|
|
825
|
+
deviceId: string | null;
|
|
826
|
+
credentials: {
|
|
827
|
+
userId: string | null;
|
|
828
|
+
};
|
|
829
|
+
/**
|
|
830
|
+
* Encryption key used for encrypting sensitive data (such as e2ee keys) in storage.
|
|
831
|
+
*
|
|
832
|
+
* As supplied in the constructor via {@link IBriijClientCreateOpts#pickleKey}.
|
|
833
|
+
* Used for migration from the legacy crypto to the rust crypto
|
|
834
|
+
*/
|
|
835
|
+
private readonly legacyPickleKey?;
|
|
836
|
+
scheduler?: BriijScheduler;
|
|
837
|
+
clientRunning: boolean;
|
|
838
|
+
timelineSupport: boolean;
|
|
839
|
+
urlPreviewCache: {
|
|
840
|
+
[key: string]: Promise<IPreviewUrlResponse>;
|
|
841
|
+
};
|
|
842
|
+
identityServer?: IIdentityServerProvider;
|
|
843
|
+
http: BriijHttpApi<IHttpOpts & {
|
|
844
|
+
onlyData: true;
|
|
845
|
+
}>;
|
|
846
|
+
private cryptoBackend?;
|
|
847
|
+
/**
|
|
848
|
+
* Support MSC4362: Simplified Encrypted State Events.
|
|
849
|
+
*
|
|
850
|
+
* The client must be recreated for changes to this setting to take effect
|
|
851
|
+
* reliably.
|
|
852
|
+
*
|
|
853
|
+
* When this setting is true, if we find a state event that is encrypted
|
|
854
|
+
* (within a room that supports encrypted state), we will attempt to decrypt
|
|
855
|
+
* it as specified in MSC4362. If the user was in the room at the time an
|
|
856
|
+
* encrypted state event was received (meaning we have the key), even if
|
|
857
|
+
* this setting was set to false at the time it was received, recreating the
|
|
858
|
+
* client with this setting set to true will allow decrypting that event.
|
|
859
|
+
*
|
|
860
|
+
* When this setting is false, any state event that is encrypted will not be
|
|
861
|
+
* decrypted, meaning it will have no effect. This matched the behaviour of
|
|
862
|
+
* a client that does not support MSC4362.
|
|
863
|
+
*/
|
|
864
|
+
enableEncryptedStateEvents: boolean;
|
|
865
|
+
cryptoCallbacks: CryptoCallbacks;
|
|
866
|
+
callEventHandler?: CallEventHandler;
|
|
867
|
+
groupCallEventHandler?: GroupCallEventHandler;
|
|
868
|
+
supportsCallTransfer: boolean;
|
|
869
|
+
forceTURN: boolean;
|
|
870
|
+
iceCandidatePoolSize: number;
|
|
871
|
+
idBaseUrl?: string;
|
|
872
|
+
baseUrl: string;
|
|
873
|
+
readonly isVoipWithNoMediaAllowed: boolean;
|
|
874
|
+
disableVoip: boolean;
|
|
875
|
+
useLivekitForGroupCalls: boolean;
|
|
876
|
+
protected canSupportVoip: boolean;
|
|
877
|
+
protected peekSync: SyncApi | null;
|
|
878
|
+
protected isGuestAccount: boolean;
|
|
879
|
+
protected ongoingScrollbacks: {
|
|
880
|
+
[roomId: string]: {
|
|
881
|
+
promise?: Promise<Room>;
|
|
882
|
+
errorTs?: number;
|
|
883
|
+
};
|
|
884
|
+
};
|
|
885
|
+
protected notifTimelineSet: EventTimelineSet | null;
|
|
886
|
+
/**
|
|
887
|
+
* Legacy crypto store used for migration from the legacy crypto to the rust crypto
|
|
888
|
+
* @private
|
|
889
|
+
*/
|
|
890
|
+
private readonly legacyCryptoStore?;
|
|
891
|
+
protected verificationMethods?: string[];
|
|
892
|
+
protected fallbackICEServerAllowed: boolean;
|
|
893
|
+
protected syncApi?: SlidingSyncSdk | SyncApi;
|
|
894
|
+
roomNameGenerator?: ICreateClientOpts["roomNameGenerator"];
|
|
895
|
+
pushRules?: IPushRules;
|
|
896
|
+
protected syncLeftRoomsPromise?: Promise<Room[]>;
|
|
897
|
+
protected syncedLeftRooms: boolean;
|
|
898
|
+
protected clientOpts?: IStoredClientOpts;
|
|
899
|
+
protected clientWellKnownIntervalID?: ReturnType<typeof setInterval>;
|
|
900
|
+
protected canResetTimelineCallback?: ResetTimelineCallback;
|
|
901
|
+
canSupport: Map<Feature, ServerSupport>;
|
|
902
|
+
readonly pushProcessor: PushProcessor;
|
|
903
|
+
protected serverVersionsPromise?: Promise<IServerVersions>;
|
|
904
|
+
protected clientWellKnown?: IClientWellKnown;
|
|
905
|
+
protected clientWellKnownPromise?: Promise<IClientWellKnown>;
|
|
906
|
+
protected turnServers: ITurnServer[];
|
|
907
|
+
protected turnServersExpiry: number;
|
|
908
|
+
protected checkTurnServersIntervalID?: ReturnType<typeof setInterval>;
|
|
909
|
+
protected txnCtr: number;
|
|
910
|
+
protected mediaHandler: MediaHandler;
|
|
911
|
+
protected sessionId: string;
|
|
912
|
+
/** IDs of events which are currently being encrypted.
|
|
913
|
+
*
|
|
914
|
+
* This is part of the cancellation mechanism: if the event is no longer listed here when encryption completes,
|
|
915
|
+
* that tells us that it has been cancelled, and we should not send it.
|
|
916
|
+
*/
|
|
917
|
+
private eventsBeingEncrypted;
|
|
918
|
+
private useE2eForGroupCall;
|
|
919
|
+
private toDeviceMessageQueue;
|
|
920
|
+
livekitServiceURL?: string;
|
|
921
|
+
private _secretStorage;
|
|
922
|
+
readonly ignoredInvites: IgnoredInvites;
|
|
923
|
+
readonly matrixRTC: BriijRTCSessionManager;
|
|
924
|
+
private serverCapabilitiesService;
|
|
925
|
+
constructor(opts: IBriijClientCreateOpts);
|
|
926
|
+
set store(newStore: Store);
|
|
927
|
+
get store(): Store;
|
|
928
|
+
/**
|
|
929
|
+
* High level helper method to begin syncing and poll for new events. To listen for these
|
|
930
|
+
* events, add a listener for {@link ClientEvent.Event}
|
|
931
|
+
* via {@link BriijClient#on}. Alternatively, listen for specific
|
|
932
|
+
* state change events.
|
|
933
|
+
* @param opts - Options to apply when syncing.
|
|
934
|
+
*/
|
|
935
|
+
startClient(opts?: IStartClientOpts): Promise<void>;
|
|
936
|
+
/**
|
|
937
|
+
* Construct a SyncApiOptions for this client, suitable for passing into the SyncApi constructor
|
|
938
|
+
*/
|
|
939
|
+
protected buildSyncApiOptions(): SyncApiOptions;
|
|
940
|
+
/**
|
|
941
|
+
* High level helper method to stop the client from polling and allow a
|
|
942
|
+
* clean shutdown.
|
|
943
|
+
*/
|
|
944
|
+
stopClient(): void;
|
|
945
|
+
/**
|
|
946
|
+
* Clear any data out of the persistent stores used by the client.
|
|
947
|
+
*
|
|
948
|
+
* @param args.cryptoDatabasePrefix - The database name to use for indexeddb, defaults to 'briij-js-sdk'.
|
|
949
|
+
* @returns Promise which resolves when the stores have been cleared.
|
|
950
|
+
*/
|
|
951
|
+
clearStores(args?: {
|
|
952
|
+
cryptoDatabasePrefix?: string;
|
|
953
|
+
}): Promise<void>;
|
|
954
|
+
/**
|
|
955
|
+
* Get the user-id of the logged-in user
|
|
956
|
+
*
|
|
957
|
+
* @returns MXID for the logged-in user, or null if not logged in
|
|
958
|
+
*/
|
|
959
|
+
getUserId(): string | null;
|
|
960
|
+
/**
|
|
961
|
+
* Get the user-id of the logged-in user
|
|
962
|
+
*
|
|
963
|
+
* @returns MXID for the logged-in user
|
|
964
|
+
* @throws Error if not logged in
|
|
965
|
+
*/
|
|
966
|
+
getSafeUserId(): string;
|
|
967
|
+
/**
|
|
968
|
+
* Get the domain for this client's MXID
|
|
969
|
+
* @returns Domain of this MXID
|
|
970
|
+
*/
|
|
971
|
+
getDomain(): string | null;
|
|
972
|
+
/**
|
|
973
|
+
* Get the local part of the current user ID e.g. "foo" in "\@foo:bar".
|
|
974
|
+
* @returns The user ID localpart or null.
|
|
975
|
+
*/
|
|
976
|
+
getUserIdLocalpart(): string | null;
|
|
977
|
+
/**
|
|
978
|
+
* Get the device ID of this client
|
|
979
|
+
* @returns device ID
|
|
980
|
+
*/
|
|
981
|
+
getDeviceId(): string | null;
|
|
982
|
+
/**
|
|
983
|
+
* Get the session ID of this client
|
|
984
|
+
* @returns session ID
|
|
985
|
+
*/
|
|
986
|
+
getSessionId(): string;
|
|
987
|
+
/**
|
|
988
|
+
* Check if the runtime environment supports VoIP calling.
|
|
989
|
+
* @returns True if VoIP is supported.
|
|
990
|
+
*/
|
|
991
|
+
supportsVoip(): boolean;
|
|
992
|
+
/**
|
|
993
|
+
* @returns
|
|
994
|
+
*/
|
|
995
|
+
getMediaHandler(): MediaHandler;
|
|
996
|
+
/**
|
|
997
|
+
* Set whether VoIP calls are forced to use only TURN
|
|
998
|
+
* candidates. This is the same as the forceTURN option
|
|
999
|
+
* when creating the client.
|
|
1000
|
+
* @param force - True to force use of TURN servers
|
|
1001
|
+
*/
|
|
1002
|
+
setForceTURN(force: boolean): void;
|
|
1003
|
+
/**
|
|
1004
|
+
* Set whether to advertise transfer support to other parties on Matrix calls.
|
|
1005
|
+
* @param support - True to advertise the 'm.call.transferee' capability
|
|
1006
|
+
*/
|
|
1007
|
+
setSupportsCallTransfer(support: boolean): void;
|
|
1008
|
+
/**
|
|
1009
|
+
* Returns true if to-device signalling for group calls will be encrypted with Olm.
|
|
1010
|
+
* If false, it will be sent unencrypted.
|
|
1011
|
+
* @returns boolean Whether group call signalling will be encrypted
|
|
1012
|
+
*/
|
|
1013
|
+
getUseE2eForGroupCall(): boolean;
|
|
1014
|
+
/**
|
|
1015
|
+
* Creates a new call.
|
|
1016
|
+
* The place*Call methods on the returned call can be used to actually place a call
|
|
1017
|
+
*
|
|
1018
|
+
* @param roomId - The room the call is to be placed in.
|
|
1019
|
+
* @returns the call or null if the browser doesn't support calling.
|
|
1020
|
+
*/
|
|
1021
|
+
createCall(roomId: string): BriijCall | null;
|
|
1022
|
+
/**
|
|
1023
|
+
* Creates a new group call and sends the associated state event
|
|
1024
|
+
* to alert other members that the room now has a group call.
|
|
1025
|
+
*
|
|
1026
|
+
* @param roomId - The room the call is to be placed in.
|
|
1027
|
+
*/
|
|
1028
|
+
createGroupCall(roomId: string, type: GroupCallType, isPtt: boolean, intent: GroupCallIntent, dataChannelsEnabled?: boolean, dataChannelOptions?: IGroupCallDataChannelOptions): Promise<GroupCall>;
|
|
1029
|
+
getLivekitServiceURL(): string | undefined;
|
|
1030
|
+
setLivekitServiceURL(newURL: string): void;
|
|
1031
|
+
/**
|
|
1032
|
+
* Wait until an initial state for the given room has been processed by the
|
|
1033
|
+
* client and the client is aware of any ongoing group calls. Awaiting on
|
|
1034
|
+
* the promise returned by this method before calling getGroupCallForRoom()
|
|
1035
|
+
* avoids races where getGroupCallForRoom is called before the state for that
|
|
1036
|
+
* room has been processed. It does not, however, fix other races, eg. two
|
|
1037
|
+
* clients both creating a group call at the same time.
|
|
1038
|
+
* @param roomId - The room ID to wait for
|
|
1039
|
+
* @returns A promise that resolves once existing group calls in the room
|
|
1040
|
+
* have been processed.
|
|
1041
|
+
*/
|
|
1042
|
+
waitUntilRoomReadyForGroupCalls(roomId: string): Promise<void>;
|
|
1043
|
+
/**
|
|
1044
|
+
* Get an existing group call for the provided room.
|
|
1045
|
+
* @returns The group call or null if it doesn't already exist.
|
|
1046
|
+
*/
|
|
1047
|
+
getGroupCallForRoom(roomId: string): GroupCall | null;
|
|
1048
|
+
/**
|
|
1049
|
+
* Get the current sync state.
|
|
1050
|
+
* @returns the sync state, which may be null.
|
|
1051
|
+
* @see BriijClient#event:"sync"
|
|
1052
|
+
*/
|
|
1053
|
+
getSyncState(): SyncState | null;
|
|
1054
|
+
/**
|
|
1055
|
+
* Returns the additional data object associated with
|
|
1056
|
+
* the current sync state, or null if there is no
|
|
1057
|
+
* such data.
|
|
1058
|
+
* Sync errors, if available, are put in the 'error' key of
|
|
1059
|
+
* this object.
|
|
1060
|
+
*/
|
|
1061
|
+
getSyncStateData(): ISyncStateData | null;
|
|
1062
|
+
/**
|
|
1063
|
+
* Whether the initial sync has completed.
|
|
1064
|
+
* @returns True if at least one sync has happened.
|
|
1065
|
+
*/
|
|
1066
|
+
isInitialSyncComplete(): boolean;
|
|
1067
|
+
/**
|
|
1068
|
+
* Return whether the client is configured for a guest account.
|
|
1069
|
+
* @returns True if this is a guest access_token (or no token is supplied).
|
|
1070
|
+
*/
|
|
1071
|
+
isGuest(): boolean;
|
|
1072
|
+
/**
|
|
1073
|
+
* Set whether this client is a guest account. <b>This method is experimental
|
|
1074
|
+
* and may change without warning.</b>
|
|
1075
|
+
* @param guest - True if this is a guest account.
|
|
1076
|
+
* @experimental if the token is a macaroon, it should be encoded in it that it is a 'guest'
|
|
1077
|
+
* access token, which means that the SDK can determine this entirely without
|
|
1078
|
+
* the dev manually flipping this flag.
|
|
1079
|
+
*/
|
|
1080
|
+
setGuest(guest: boolean): void;
|
|
1081
|
+
/**
|
|
1082
|
+
* Return the provided scheduler, if any.
|
|
1083
|
+
* @returns The scheduler or undefined
|
|
1084
|
+
*/
|
|
1085
|
+
getScheduler(): BriijScheduler | undefined;
|
|
1086
|
+
/**
|
|
1087
|
+
* Retry a backed off syncing request immediately. This should only be used when
|
|
1088
|
+
* the user <b>explicitly</b> attempts to retry their lost connection.
|
|
1089
|
+
* Will also retry any outbound to-device messages currently in the queue to be sent
|
|
1090
|
+
* (retries of regular outgoing events are handled separately, per-event).
|
|
1091
|
+
* @returns True if this resulted in a request being retried.
|
|
1092
|
+
*/
|
|
1093
|
+
retryImmediately(): boolean;
|
|
1094
|
+
/**
|
|
1095
|
+
* Return the global notification EventTimelineSet, if any
|
|
1096
|
+
*
|
|
1097
|
+
* @returns the globl notification EventTimelineSet
|
|
1098
|
+
*/
|
|
1099
|
+
getNotifTimelineSet(): EventTimelineSet | null;
|
|
1100
|
+
/**
|
|
1101
|
+
* Set the global notification EventTimelineSet
|
|
1102
|
+
*
|
|
1103
|
+
*/
|
|
1104
|
+
setNotifTimelineSet(set: EventTimelineSet): void;
|
|
1105
|
+
/**
|
|
1106
|
+
* Gets the cached capabilities of the homeserver, returning cached ones if available.
|
|
1107
|
+
* If there are no cached capabilities and none can be fetched, throw an exception.
|
|
1108
|
+
*
|
|
1109
|
+
* @returns Promise resolving with The capabilities of the homeserver
|
|
1110
|
+
*/
|
|
1111
|
+
getCapabilities(): Promise<Capabilities>;
|
|
1112
|
+
/**
|
|
1113
|
+
* Gets the cached capabilities of the homeserver. If none have been fetched yet,
|
|
1114
|
+
* return undefined.
|
|
1115
|
+
*
|
|
1116
|
+
* @returns The capabilities of the homeserver
|
|
1117
|
+
*/
|
|
1118
|
+
getCachedCapabilities(): Capabilities | undefined;
|
|
1119
|
+
/**
|
|
1120
|
+
* Fetches the latest capabilities from the homeserver, ignoring any cached
|
|
1121
|
+
* versions. The newly returned version is cached.
|
|
1122
|
+
*
|
|
1123
|
+
* @returns A promise which resolves to the capabilities of the homeserver
|
|
1124
|
+
*/
|
|
1125
|
+
fetchCapabilities(): Promise<Capabilities>;
|
|
1126
|
+
/**
|
|
1127
|
+
* Initialise support for end-to-end encryption in this client, using the rust matrix-sdk-crypto.
|
|
1128
|
+
*
|
|
1129
|
+
* **WARNING**: the cryptography stack is not thread-safe. Having multiple `BriijClient` instances connected to
|
|
1130
|
+
* the same Indexed DB will cause data corruption and decryption failures. The application layer is responsible for
|
|
1131
|
+
* ensuring that only one `BriijClient` issue is instantiated at a time.
|
|
1132
|
+
*
|
|
1133
|
+
* @param args.useIndexedDB - True to use an indexeddb store, false to use an in-memory store. Defaults to 'true'.
|
|
1134
|
+
* @param args.cryptoDatabasePrefix - The database name to use for indexeddb, defaults to 'briij-js-sdk'.
|
|
1135
|
+
* Unused if useIndexedDB is 'false'.
|
|
1136
|
+
* @param args.storageKey - A key with which to encrypt the indexeddb store. If provided, it must be exactly
|
|
1137
|
+
* 32 bytes of data, and must be the same each time the client is initialised for a given device.
|
|
1138
|
+
* If both this and `storagePassword` are unspecified, the store will be unencrypted.
|
|
1139
|
+
* @param args.storagePassword - An alternative to `storageKey`. A password which will be used to derive a key to
|
|
1140
|
+
* encrypt the store with. Deriving a key from a password is (deliberately) a slow operation, so prefer
|
|
1141
|
+
* to pass a `storageKey` directly where possible.
|
|
1142
|
+
*
|
|
1143
|
+
* @returns a Promise which will resolve when the crypto layer has been
|
|
1144
|
+
* successfully initialised.
|
|
1145
|
+
*/
|
|
1146
|
+
initRustCrypto(args?: {
|
|
1147
|
+
useIndexedDB?: boolean;
|
|
1148
|
+
cryptoDatabasePrefix?: string;
|
|
1149
|
+
storageKey?: Uint8Array;
|
|
1150
|
+
storagePassword?: string;
|
|
1151
|
+
}): Promise<void>;
|
|
1152
|
+
/**
|
|
1153
|
+
* Access the server-side secret storage API for this client.
|
|
1154
|
+
*/
|
|
1155
|
+
get secretStorage(): ServerSideSecretStorage;
|
|
1156
|
+
/**
|
|
1157
|
+
* Access the crypto API for this client.
|
|
1158
|
+
*
|
|
1159
|
+
* If end-to-end encryption has been enabled for this client (via {@link initRustCrypto}),
|
|
1160
|
+
* returns an object giving access to the crypto API. Otherwise, returns `undefined`.
|
|
1161
|
+
*/
|
|
1162
|
+
getCrypto(): CryptoApi | undefined;
|
|
1163
|
+
/**
|
|
1164
|
+
* Whether encryption is enabled for a room.
|
|
1165
|
+
* @param roomId - the room id to query.
|
|
1166
|
+
* @returns whether encryption is enabled.
|
|
1167
|
+
*
|
|
1168
|
+
* @deprecated Not correctly supported for Rust Cryptography. Use {@link CryptoApi.isEncryptionEnabledInRoom} and/or
|
|
1169
|
+
* {@link Room.hasEncryptionStateEvent}.
|
|
1170
|
+
*/
|
|
1171
|
+
isRoomEncrypted(roomId: string): boolean;
|
|
1172
|
+
/**
|
|
1173
|
+
* Check whether the key backup private key is stored in secret storage.
|
|
1174
|
+
* @returns map of key name to key info the secret is
|
|
1175
|
+
* encrypted with, or null if it is not present or not encrypted with a
|
|
1176
|
+
* trusted key
|
|
1177
|
+
*/
|
|
1178
|
+
isKeyBackupKeyStored(): Promise<Record<string, SecretStorageKeyDescription> | null>;
|
|
1179
|
+
private makeKeyBackupPath;
|
|
1180
|
+
deleteKeysFromBackup(roomId: undefined, sessionId: undefined, version?: string): Promise<void>;
|
|
1181
|
+
deleteKeysFromBackup(roomId: string, sessionId: undefined, version?: string): Promise<void>;
|
|
1182
|
+
deleteKeysFromBackup(roomId: string, sessionId: string, version?: string): Promise<void>;
|
|
1183
|
+
/**
|
|
1184
|
+
* Get the config for the media repository.
|
|
1185
|
+
*
|
|
1186
|
+
* @param useAuthenticatedMedia - If true, the caller supports authenticated
|
|
1187
|
+
* media and wants an authentication-required URL. Note that server support
|
|
1188
|
+
* for authenticated media will *not* be checked - it is the caller's responsibility
|
|
1189
|
+
* to do so before calling this function.
|
|
1190
|
+
*
|
|
1191
|
+
* @returns Promise which resolves with an object containing the config.
|
|
1192
|
+
*/
|
|
1193
|
+
getMediaConfig(useAuthenticatedMedia?: boolean): Promise<IMediaConfig>;
|
|
1194
|
+
/**
|
|
1195
|
+
* Get the room for the given room ID.
|
|
1196
|
+
* This function will return a valid room for any room for which a Room event
|
|
1197
|
+
* has been emitted. Note in particular that other events, eg. RoomState.members
|
|
1198
|
+
* will be emitted for a room before this function will return the given room.
|
|
1199
|
+
* @param roomId - The room ID
|
|
1200
|
+
* @returns The Room or null if it doesn't exist or there is no data store.
|
|
1201
|
+
*/
|
|
1202
|
+
getRoom(roomId: string | undefined): Room | null;
|
|
1203
|
+
/**
|
|
1204
|
+
* Retrieve all known rooms.
|
|
1205
|
+
* @returns A list of rooms, or an empty list if there is no data store.
|
|
1206
|
+
*/
|
|
1207
|
+
getRooms(): Room[];
|
|
1208
|
+
/**
|
|
1209
|
+
* Retrieve all rooms that should be displayed to the user
|
|
1210
|
+
* This is essentially getRooms() with some rooms filtered out, eg. old versions
|
|
1211
|
+
* of rooms that have been replaced or (in future) other rooms that have been
|
|
1212
|
+
* marked at the protocol level as not to be displayed to the user.
|
|
1213
|
+
*
|
|
1214
|
+
* @param msc3946ProcessDynamicPredecessor - if true, look for an
|
|
1215
|
+
* m.room.predecessor state event and
|
|
1216
|
+
* use it if found (MSC3946).
|
|
1217
|
+
* @returns A list of rooms, or an empty list if there is no data store.
|
|
1218
|
+
*/
|
|
1219
|
+
getVisibleRooms(msc3946ProcessDynamicPredecessor?: boolean): Room[];
|
|
1220
|
+
/**
|
|
1221
|
+
* Retrieve a user.
|
|
1222
|
+
* @param userId - The user ID to retrieve.
|
|
1223
|
+
* @returns A user or null if there is no data store or the user does
|
|
1224
|
+
* not exist.
|
|
1225
|
+
*/
|
|
1226
|
+
getUser(userId: string): User | null;
|
|
1227
|
+
/**
|
|
1228
|
+
* Retrieve all known users.
|
|
1229
|
+
* @returns A list of users, or an empty list if there is no data store.
|
|
1230
|
+
*/
|
|
1231
|
+
getUsers(): User[];
|
|
1232
|
+
/**
|
|
1233
|
+
* Set account data event for the current user, and wait for the result to be echoed over `/sync`.
|
|
1234
|
+
*
|
|
1235
|
+
* Waiting for the remote echo ensures that a subsequent call to {@link getAccountData} will return the updated
|
|
1236
|
+
* value.
|
|
1237
|
+
*
|
|
1238
|
+
* If called before the client is started with {@link startClient}, logs a warning and falls back to
|
|
1239
|
+
* {@link setAccountDataRaw}.
|
|
1240
|
+
*
|
|
1241
|
+
* Retries the request up to 5 times in the case of an {@link ConnectionError}.
|
|
1242
|
+
*
|
|
1243
|
+
* @param eventType - The event type
|
|
1244
|
+
* @param content - the contents object for the event
|
|
1245
|
+
*/
|
|
1246
|
+
setAccountData<K extends keyof WritableAccountDataEvents>(eventType: K, content: AccountDataEvents[K] | Record<string, never>): Promise<EmptyObject>;
|
|
1247
|
+
/**
|
|
1248
|
+
* Set account data event for the current user, without waiting for the remote echo.
|
|
1249
|
+
*
|
|
1250
|
+
* @param eventType - The event type
|
|
1251
|
+
* @param content - the contents object for the event
|
|
1252
|
+
*/
|
|
1253
|
+
setAccountDataRaw<K extends keyof WritableAccountDataEvents>(eventType: K, content: AccountDataEvents[K] | Record<string, never>): Promise<EmptyObject>;
|
|
1254
|
+
/**
|
|
1255
|
+
* Get account data event of given type for the current user.
|
|
1256
|
+
* @param eventType - The event type
|
|
1257
|
+
* @returns The contents of the given account data event
|
|
1258
|
+
*/
|
|
1259
|
+
getAccountData<K extends keyof AccountDataEvents>(eventType: K): BriijEvent | undefined;
|
|
1260
|
+
/**
|
|
1261
|
+
* Get account data event of given type for the current user. This variant
|
|
1262
|
+
* gets account data directly from the homeserver if the local store is not
|
|
1263
|
+
* ready, which can be useful very early in startup before the initial sync.
|
|
1264
|
+
* @param eventType - The event type
|
|
1265
|
+
* @returns Promise which resolves: The contents of the given account data event.
|
|
1266
|
+
* @returns Rejects: with an error response.
|
|
1267
|
+
*/
|
|
1268
|
+
getAccountDataFromServer<K extends keyof AccountDataEvents>(eventType: K): Promise<AccountDataEvents[K] | null>;
|
|
1269
|
+
deleteAccountData(eventType: keyof WritableAccountDataEvents): Promise<void>;
|
|
1270
|
+
/**
|
|
1271
|
+
* Gets the users that are ignored by this client
|
|
1272
|
+
* @returns The array of users that are ignored (empty if none)
|
|
1273
|
+
*/
|
|
1274
|
+
getIgnoredUsers(): string[];
|
|
1275
|
+
/**
|
|
1276
|
+
* Sets the users that the current user should ignore.
|
|
1277
|
+
* @param userIds - the user IDs to ignore
|
|
1278
|
+
* @returns Promise which resolves: an empty object
|
|
1279
|
+
* @returns Rejects: with an error response.
|
|
1280
|
+
*/
|
|
1281
|
+
setIgnoredUsers(userIds: string[]): Promise<EmptyObject>;
|
|
1282
|
+
/**
|
|
1283
|
+
* Gets whether or not a specific user is being ignored by this client.
|
|
1284
|
+
* @param userId - the user ID to check
|
|
1285
|
+
* @returns true if the user is ignored, false otherwise
|
|
1286
|
+
*/
|
|
1287
|
+
isUserIgnored(userId: string): boolean;
|
|
1288
|
+
/**
|
|
1289
|
+
* Join a room. If you have already joined the room, this will no-op.
|
|
1290
|
+
* @param roomIdOrAlias - The room ID or room alias to join.
|
|
1291
|
+
* @param opts - Options when joining the room.
|
|
1292
|
+
* @returns Promise which resolves: Room object.
|
|
1293
|
+
* @returns Rejects: with an error response.
|
|
1294
|
+
*/
|
|
1295
|
+
joinRoom(roomIdOrAlias: string, opts?: IJoinRoomOpts): Promise<Room>;
|
|
1296
|
+
/**
|
|
1297
|
+
* Knock a room. If you have already knocked the room, this will no-op.
|
|
1298
|
+
* @param roomIdOrAlias - The room ID or room alias to knock.
|
|
1299
|
+
* @param opts - Options when knocking the room.
|
|
1300
|
+
* @returns Promise which resolves: `{room_id: {string}}`
|
|
1301
|
+
* @returns Rejects: with an error response.
|
|
1302
|
+
*/
|
|
1303
|
+
knockRoom(roomIdOrAlias: string, opts?: KnockRoomOpts): Promise<{
|
|
1304
|
+
room_id: string;
|
|
1305
|
+
}>;
|
|
1306
|
+
/**
|
|
1307
|
+
* Resend an event. Will also retry any to-device messages waiting to be sent.
|
|
1308
|
+
* @param event - The event to resend.
|
|
1309
|
+
* @param room - Optional. The room the event is in. Will update the
|
|
1310
|
+
* timeline entry if provided.
|
|
1311
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1312
|
+
* @see BriijSafetyError
|
|
1313
|
+
*/
|
|
1314
|
+
resendEvent(event: BriijEvent, room: Room): Promise<ISendEventResponse>;
|
|
1315
|
+
/**
|
|
1316
|
+
* Cancel a queued or unsent event.
|
|
1317
|
+
*
|
|
1318
|
+
* @param event - Event to cancel
|
|
1319
|
+
* @throws Error if the event is not in QUEUED, NOT_SENT or ENCRYPTING state
|
|
1320
|
+
*/
|
|
1321
|
+
cancelPendingEvent(event: BriijEvent): void;
|
|
1322
|
+
/**
|
|
1323
|
+
* @returns Promise which resolves: TODO
|
|
1324
|
+
* @returns Rejects: with an error response.
|
|
1325
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1326
|
+
* @see BriijSafetyError
|
|
1327
|
+
*/
|
|
1328
|
+
setRoomName(roomId: string, name: string): Promise<ISendEventResponse>;
|
|
1329
|
+
/**
|
|
1330
|
+
* @param roomId - The room to update the topic in.
|
|
1331
|
+
* @param topic - The plaintext topic. May be empty to remove the topic.
|
|
1332
|
+
* @param htmlTopic - Optional.
|
|
1333
|
+
* @returns Promise which resolves: TODO
|
|
1334
|
+
* @returns Rejects: with an error response.
|
|
1335
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1336
|
+
* @see BriijSafetyError
|
|
1337
|
+
*/
|
|
1338
|
+
setRoomTopic(roomId: string, topic?: string, htmlTopic?: string): Promise<ISendEventResponse>;
|
|
1339
|
+
/**
|
|
1340
|
+
* @returns Promise which resolves: to an object keyed by tagId with objects containing a numeric order field.
|
|
1341
|
+
* @returns Rejects: with an error response.
|
|
1342
|
+
*/
|
|
1343
|
+
getRoomTags(roomId: string): Promise<ITagsResponse>;
|
|
1344
|
+
/**
|
|
1345
|
+
* @param tagName - name of room tag to be set
|
|
1346
|
+
* @param metadata - associated with that tag to be stored
|
|
1347
|
+
* @returns Promise which resolves: to an empty object
|
|
1348
|
+
* @returns Rejects: with an error response.
|
|
1349
|
+
*/
|
|
1350
|
+
setRoomTag(roomId: string, tagName: string, metadata?: ITagMetadata): Promise<EmptyObject>;
|
|
1351
|
+
/**
|
|
1352
|
+
* @param tagName - name of room tag to be removed
|
|
1353
|
+
* @returns Promise which resolves: to an empty object
|
|
1354
|
+
* @returns Rejects: with an error response.
|
|
1355
|
+
*/
|
|
1356
|
+
deleteRoomTag(roomId: string, tagName: string): Promise<EmptyObject>;
|
|
1357
|
+
/**
|
|
1358
|
+
* @param roomId - the ID of the room this event should be stored within
|
|
1359
|
+
* @param eventType - event type to be set
|
|
1360
|
+
* @param content - event content
|
|
1361
|
+
* @returns Promise which resolves: to an empty object `{}`
|
|
1362
|
+
* @returns Rejects: with an error response.
|
|
1363
|
+
*/
|
|
1364
|
+
setRoomAccountData<K extends keyof RoomAccountDataEvents>(roomId: string, eventType: K, content: RoomAccountDataEvents[K] | Record<string, never>): Promise<EmptyObject>;
|
|
1365
|
+
/**
|
|
1366
|
+
* Set a power level to one or multiple users.
|
|
1367
|
+
* Will apply changes atop of current power level event from local state if running & synced, falling back
|
|
1368
|
+
* to fetching latest from the `/state/` API.
|
|
1369
|
+
* @param roomId - the room to update power levels in
|
|
1370
|
+
* @param userId - the ID of the user or users to update power levels of
|
|
1371
|
+
* @param powerLevel - the numeric power level to update given users to
|
|
1372
|
+
* @returns Promise which resolves: to an ISendEventResponse object
|
|
1373
|
+
* @returns Rejects: with an error response.
|
|
1374
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1375
|
+
* @see BriijSafetyError
|
|
1376
|
+
*/
|
|
1377
|
+
setPowerLevel(roomId: string, userId: string | string[], powerLevel: number | undefined): Promise<ISendEventResponse>;
|
|
1378
|
+
/**
|
|
1379
|
+
* Create an m.beacon_info event
|
|
1380
|
+
* @returns
|
|
1381
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1382
|
+
* @see BriijSafetyError
|
|
1383
|
+
*/
|
|
1384
|
+
unstable_createLiveBeacon(roomId: Room["roomId"], beaconInfoContent: MBeaconInfoEventContent): Promise<ISendEventResponse>;
|
|
1385
|
+
/**
|
|
1386
|
+
* Upsert a live beacon event
|
|
1387
|
+
* using a specific m.beacon_info.* event variable type
|
|
1388
|
+
* @param roomId - string
|
|
1389
|
+
* @returns
|
|
1390
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1391
|
+
* @see BriijSafetyError
|
|
1392
|
+
*/
|
|
1393
|
+
unstable_setLiveBeacon(roomId: string, beaconInfoContent: MBeaconInfoEventContent): Promise<ISendEventResponse>;
|
|
1394
|
+
/**
|
|
1395
|
+
* Send a Matrix timeline event.
|
|
1396
|
+
* @param roomId The room to send to.
|
|
1397
|
+
* @param eventType The event type.
|
|
1398
|
+
* @param content The event content.
|
|
1399
|
+
* @param txnId An optional ID to deduplicate requests in case of repeated attempts.
|
|
1400
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1401
|
+
* @see BriijSafetyError
|
|
1402
|
+
*/
|
|
1403
|
+
sendEvent<K extends keyof TimelineEvents>(roomId: string, eventType: K, content: TimelineEvents[K], txnId?: string): Promise<ISendEventResponse>;
|
|
1404
|
+
sendEvent<K extends keyof TimelineEvents>(roomId: string, threadId: string | null, eventType: K, content: TimelineEvents[K], txnId?: string): Promise<ISendEventResponse>;
|
|
1405
|
+
/**
|
|
1406
|
+
* If we expect that an event is part of a thread but is missing the relation
|
|
1407
|
+
* we need to add it manually, as well as the reply fallback
|
|
1408
|
+
*/
|
|
1409
|
+
private addThreadRelationIfNeeded;
|
|
1410
|
+
/**
|
|
1411
|
+
* @param eventObject - An object with the partial structure of an event, to which event_id, user_id, room_id and origin_server_ts will be added.
|
|
1412
|
+
* @param txnId - Optional.
|
|
1413
|
+
* @returns Promise which resolves: to an empty object `{}`
|
|
1414
|
+
* @returns Rejects: with an error response.
|
|
1415
|
+
*/
|
|
1416
|
+
private sendCompleteEvent;
|
|
1417
|
+
/**
|
|
1418
|
+
* encrypts the event if necessary; adds the event to the queue, or sends it; marks the event as sent/unsent
|
|
1419
|
+
* @returns returns a promise which resolves with the result of the send request
|
|
1420
|
+
*/
|
|
1421
|
+
protected encryptAndSendEvent(room: Room | null, event: BriijEvent, queryDict?: QueryDict): Promise<ISendEventResponse>;
|
|
1422
|
+
/**
|
|
1423
|
+
* Simply sends a delayed event without encrypting it.
|
|
1424
|
+
* TODO: Allow encrypted delayed events, and encrypt them properly
|
|
1425
|
+
* @param delayOpts - Properties of the delay for this event.
|
|
1426
|
+
* @returns returns a promise which resolves with the result of the delayed send request
|
|
1427
|
+
*/
|
|
1428
|
+
protected encryptAndSendEvent(room: Room | null, event: BriijEvent, delayOpts: SendDelayedEventRequestOpts, queryDict?: QueryDict): Promise<ISendEventResponse>;
|
|
1429
|
+
private encryptEventIfNeeded;
|
|
1430
|
+
/**
|
|
1431
|
+
* Determine whether a given event should be encrypted when we send it to the given room.
|
|
1432
|
+
*
|
|
1433
|
+
* This takes into account event type and room configuration.
|
|
1434
|
+
*/
|
|
1435
|
+
private shouldEncryptEventForRoom;
|
|
1436
|
+
/**
|
|
1437
|
+
* Returns the eventType that should be used taking encryption into account
|
|
1438
|
+
* for a given eventType.
|
|
1439
|
+
* @param roomId - the room for the events `eventType` relates to
|
|
1440
|
+
* @param eventType - the event type
|
|
1441
|
+
* @returns the event type taking encryption into account
|
|
1442
|
+
*/
|
|
1443
|
+
private getEncryptedIfNeededEventType;
|
|
1444
|
+
protected updatePendingEventStatus(room: Room | null, event: BriijEvent, newStatus: EventStatus): void;
|
|
1445
|
+
private sendEventHttpRequest;
|
|
1446
|
+
/**
|
|
1447
|
+
* @param txnId - transaction id. One will be made up if not supplied.
|
|
1448
|
+
* @param opts - Redact options
|
|
1449
|
+
* @returns Promise which resolves: TODO
|
|
1450
|
+
* @returns Rejects: with an error response.
|
|
1451
|
+
* @throws Error if called with `with_rel_types` (MSC3912) but the server does not support it.
|
|
1452
|
+
* Callers should check whether the server supports MSC3912 via `BriijClient.canSupport`.
|
|
1453
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1454
|
+
* @see BriijSafetyError
|
|
1455
|
+
*/
|
|
1456
|
+
redactEvent(roomId: string, eventId: string, txnId?: string | undefined, opts?: IRedactOpts): Promise<ISendEventResponse>;
|
|
1457
|
+
redactEvent(roomId: string, threadId: string | null, eventId: string, txnId?: string | undefined, opts?: IRedactOpts): Promise<ISendEventResponse>;
|
|
1458
|
+
/**
|
|
1459
|
+
* @param txnId - Optional.
|
|
1460
|
+
* @returns Promise which resolves: to an ISendEventResponse object
|
|
1461
|
+
* @returns Rejects: with an error response.
|
|
1462
|
+
*/
|
|
1463
|
+
sendMessage(roomId: string, content: RoomMessageEventContent, txnId?: string): Promise<ISendEventResponse>;
|
|
1464
|
+
sendMessage(roomId: string, threadId: string | null, content: RoomMessageEventContent, txnId?: string): Promise<ISendEventResponse>;
|
|
1465
|
+
/**
|
|
1466
|
+
* @param txnId - Optional.
|
|
1467
|
+
* @returns
|
|
1468
|
+
* @returns Rejects: with an error response.
|
|
1469
|
+
*/
|
|
1470
|
+
sendTextMessage(roomId: string, body: string, txnId?: string): Promise<ISendEventResponse>;
|
|
1471
|
+
sendTextMessage(roomId: string, threadId: string | null, body: string, txnId?: string): Promise<ISendEventResponse>;
|
|
1472
|
+
/**
|
|
1473
|
+
* @param txnId - Optional.
|
|
1474
|
+
* @returns Promise which resolves: to a ISendEventResponse object
|
|
1475
|
+
* @returns Rejects: with an error response.
|
|
1476
|
+
*/
|
|
1477
|
+
sendNotice(roomId: string, body: string, txnId?: string): Promise<ISendEventResponse>;
|
|
1478
|
+
sendNotice(roomId: string, threadId: string | null, body: string, txnId?: string): Promise<ISendEventResponse>;
|
|
1479
|
+
/**
|
|
1480
|
+
* @param txnId - Optional.
|
|
1481
|
+
* @returns Promise which resolves: to a ISendEventResponse object
|
|
1482
|
+
* @returns Rejects: with an error response.
|
|
1483
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1484
|
+
* @see BriijSafetyError
|
|
1485
|
+
*/
|
|
1486
|
+
sendEmoteMessage(roomId: string, body: string, txnId?: string): Promise<ISendEventResponse>;
|
|
1487
|
+
sendEmoteMessage(roomId: string, threadId: string | null, body: string, txnId?: string): Promise<ISendEventResponse>;
|
|
1488
|
+
/**
|
|
1489
|
+
* @returns Promise which resolves: to a ISendEventResponse object
|
|
1490
|
+
* @returns Rejects: with an error response.
|
|
1491
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1492
|
+
* @see BriijSafetyError
|
|
1493
|
+
*/
|
|
1494
|
+
sendImageMessage(roomId: string, url: string, info?: ImageInfo, text?: string): Promise<ISendEventResponse>;
|
|
1495
|
+
sendImageMessage(roomId: string, threadId: string | null, url: string, info?: ImageInfo, text?: string): Promise<ISendEventResponse>;
|
|
1496
|
+
/**
|
|
1497
|
+
* @returns Promise which resolves: to a ISendEventResponse object
|
|
1498
|
+
* @returns Rejects: with an error response.
|
|
1499
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1500
|
+
* @see BriijSafetyError
|
|
1501
|
+
*/
|
|
1502
|
+
sendStickerMessage(roomId: string, url: string, info?: ImageInfo, text?: string): Promise<ISendEventResponse>;
|
|
1503
|
+
sendStickerMessage(roomId: string, threadId: string | null, url: string, info?: ImageInfo, text?: string): Promise<ISendEventResponse>;
|
|
1504
|
+
/**
|
|
1505
|
+
* @returns Promise which resolves: to a ISendEventResponse object
|
|
1506
|
+
* @returns Rejects: with an error response.
|
|
1507
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1508
|
+
* @see BriijSafetyError
|
|
1509
|
+
*/
|
|
1510
|
+
sendHtmlMessage(roomId: string, body: string, htmlBody: string): Promise<ISendEventResponse>;
|
|
1511
|
+
sendHtmlMessage(roomId: string, threadId: string | null, body: string, htmlBody: string): Promise<ISendEventResponse>;
|
|
1512
|
+
/**
|
|
1513
|
+
* @returns Promise which resolves: to a ISendEventResponse object
|
|
1514
|
+
* @returns Rejects: with an error response.
|
|
1515
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1516
|
+
* @see BriijSafetyError
|
|
1517
|
+
*/
|
|
1518
|
+
sendHtmlNotice(roomId: string, body: string, htmlBody: string): Promise<ISendEventResponse>;
|
|
1519
|
+
sendHtmlNotice(roomId: string, threadId: string | null, body: string, htmlBody: string): Promise<ISendEventResponse>;
|
|
1520
|
+
/**
|
|
1521
|
+
* @returns Promise which resolves: to a ISendEventResponse object
|
|
1522
|
+
* @returns Rejects: with an error response.
|
|
1523
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1524
|
+
* @see BriijSafetyError
|
|
1525
|
+
*/
|
|
1526
|
+
sendHtmlEmote(roomId: string, body: string, htmlBody: string): Promise<ISendEventResponse>;
|
|
1527
|
+
sendHtmlEmote(roomId: string, threadId: string | null, body: string, htmlBody: string): Promise<ISendEventResponse>;
|
|
1528
|
+
/**
|
|
1529
|
+
* Send a delayed timeline event.
|
|
1530
|
+
*
|
|
1531
|
+
* Note: This endpoint is unstable, and can throw an `Error`.
|
|
1532
|
+
* Check progress on [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) for more details.
|
|
1533
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1534
|
+
* @see BriijSafetyError
|
|
1535
|
+
*/
|
|
1536
|
+
_unstable_sendDelayedEvent<K extends keyof TimelineEvents>(roomId: string, delayOpts: SendDelayedEventRequestOpts, threadId: string | null, eventType: K, content: TimelineEvents[K], txnId?: string): Promise<SendDelayedEventResponse>;
|
|
1537
|
+
/**
|
|
1538
|
+
* Send a delayed sticky timeline event.
|
|
1539
|
+
*
|
|
1540
|
+
* Note: This endpoint is unstable, and can throw an `Error`.
|
|
1541
|
+
* Check progress on [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) and
|
|
1542
|
+
* [MSC4354](https://github.com/matrix-org/matrix-spec-proposals/pull/4354) for more details.
|
|
1543
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1544
|
+
* @see BriijSafetyError
|
|
1545
|
+
*/
|
|
1546
|
+
_unstable_sendStickyDelayedEvent<K extends keyof TimelineEvents>(roomId: string, stickDuration: number, delayOpts: SendDelayedEventRequestOpts, threadId: string | null, eventType: K, content: TimelineEvents[K] & {
|
|
1547
|
+
msc4354_sticky_key?: string;
|
|
1548
|
+
}, txnId?: string): Promise<SendDelayedEventResponse>;
|
|
1549
|
+
/**
|
|
1550
|
+
* Send a delayed state event.
|
|
1551
|
+
*
|
|
1552
|
+
* Note: This endpoint is unstable, and can throw an `Error`.
|
|
1553
|
+
* Check progress on [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) for more details.
|
|
1554
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1555
|
+
* @see BriijSafetyError
|
|
1556
|
+
*/
|
|
1557
|
+
_unstable_sendDelayedStateEvent<K extends keyof StateEvents>(roomId: string, delayOpts: SendDelayedEventRequestOpts, eventType: K, content: StateEvents[K], stateKey?: string, opts?: IRequestOpts): Promise<SendDelayedEventResponse>;
|
|
1558
|
+
/**
|
|
1559
|
+
* Send a sticky timeline event.
|
|
1560
|
+
*
|
|
1561
|
+
* Note: This endpoint is unstable, and can throw an `Error`.
|
|
1562
|
+
* Check progress on [MSC4354](https://github.com/matrix-org/matrix-spec-proposals/pull/4354) for more details.
|
|
1563
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1564
|
+
* @see BriijSafetyError
|
|
1565
|
+
*/
|
|
1566
|
+
_unstable_sendStickyEvent<K extends keyof TimelineEvents>(roomId: string, stickDuration: number, threadId: string | null, eventType: K, content: TimelineEvents[K] & {
|
|
1567
|
+
msc4354_sticky_key?: string;
|
|
1568
|
+
}, txnId?: string): Promise<ISendEventResponse>;
|
|
1569
|
+
/**
|
|
1570
|
+
* Get information about delayed events owned by the requesting user.
|
|
1571
|
+
*
|
|
1572
|
+
* Note: This endpoint is unstable, and can throw an `Error`.
|
|
1573
|
+
* Check progress on [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) for more details.
|
|
1574
|
+
*/
|
|
1575
|
+
_unstable_getDelayedEvents(status?: "scheduled" | "finalised", delayId?: string | string[], fromToken?: string): Promise<DelayedEventInfo>;
|
|
1576
|
+
/**
|
|
1577
|
+
* Manage a delayed event associated with the given delay_id.
|
|
1578
|
+
*
|
|
1579
|
+
* Note: This endpoint is unstable, and can throw an `Error`.
|
|
1580
|
+
* Check progress on [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) for more details.
|
|
1581
|
+
*
|
|
1582
|
+
* @deprecated Instead use one of:
|
|
1583
|
+
* - {@link _unstable_cancelScheduledDelayedEvent}
|
|
1584
|
+
* - {@link _unstable_restartScheduledDelayedEvent}
|
|
1585
|
+
* - {@link _unstable_sendScheduledDelayedEvent}
|
|
1586
|
+
*/
|
|
1587
|
+
_unstable_updateDelayedEvent(delayId: string, action: UpdateDelayedEventAction, requestOptions?: IRequestOpts): Promise<EmptyObject>;
|
|
1588
|
+
/**
|
|
1589
|
+
* Cancel the scheduled delivery of the delayed event matching the provided delayId.
|
|
1590
|
+
*
|
|
1591
|
+
* Note: This endpoint is unstable, and can throw an `Error`.
|
|
1592
|
+
* Check progress on [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) for more details.
|
|
1593
|
+
*
|
|
1594
|
+
* @throws A M_NOT_FOUND error if no matching delayed event could be found.
|
|
1595
|
+
*/
|
|
1596
|
+
_unstable_cancelScheduledDelayedEvent(delayId: string, requestOptions?: IRequestOpts): Promise<EmptyObject>;
|
|
1597
|
+
/**
|
|
1598
|
+
* Restart the scheduled delivery of the delayed event matching the given delayId.
|
|
1599
|
+
*
|
|
1600
|
+
* Note: This endpoint is unstable, and can throw an `Error`.
|
|
1601
|
+
* Check progress on [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) for more details.
|
|
1602
|
+
*
|
|
1603
|
+
* @throws A M_NOT_FOUND error if no matching delayed event could be found.
|
|
1604
|
+
*/
|
|
1605
|
+
_unstable_restartScheduledDelayedEvent(delayId: string, requestOptions?: IRequestOpts): Promise<EmptyObject>;
|
|
1606
|
+
/**
|
|
1607
|
+
* Immediately send the delayed event matching the given delayId,
|
|
1608
|
+
* instead of waiting for its scheduled delivery.
|
|
1609
|
+
*
|
|
1610
|
+
* Note: This endpoint is unstable, and can throw an `Error`.
|
|
1611
|
+
* Check progress on [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) for more details.
|
|
1612
|
+
*
|
|
1613
|
+
* @throws A M_NOT_FOUND error if no matching delayed event could be found.
|
|
1614
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1615
|
+
* @see BriijSafetyError
|
|
1616
|
+
*/
|
|
1617
|
+
_unstable_sendScheduledDelayedEvent(delayId: string, requestOptions?: IRequestOpts): Promise<EmptyObject>;
|
|
1618
|
+
private updateScheduledDelayedEvent;
|
|
1619
|
+
/**
|
|
1620
|
+
* @deprecated Present for backwards compatibility with an older version of MSC4140
|
|
1621
|
+
* which had a single, authenticated endpoint for updating a delayed event, instead
|
|
1622
|
+
* of one unauthenticated endpoint per update action.
|
|
1623
|
+
*/
|
|
1624
|
+
private updateScheduledDelayedEventWithActionInBody;
|
|
1625
|
+
/**
|
|
1626
|
+
* Send a receipt.
|
|
1627
|
+
* @param event - The event being acknowledged
|
|
1628
|
+
* @param receiptType - The kind of receipt e.g. "m.read". Other than
|
|
1629
|
+
* ReceiptType.Read are experimental!
|
|
1630
|
+
* @param body - Additional content to send alongside the receipt.
|
|
1631
|
+
* @param unthreaded - An unthreaded receipt will clear room+thread notifications
|
|
1632
|
+
* @returns Promise which resolves: to an empty object `{}`
|
|
1633
|
+
* @returns Rejects: with an error response.
|
|
1634
|
+
*/
|
|
1635
|
+
sendReceipt(event: BriijEvent, receiptType: ReceiptType, body?: Record<string, any>, unthreaded?: boolean): Promise<EmptyObject>;
|
|
1636
|
+
/**
|
|
1637
|
+
* Send a read receipt.
|
|
1638
|
+
* @param event - The event that has been read.
|
|
1639
|
+
* @param receiptType - other than ReceiptType.Read are experimental! Optional.
|
|
1640
|
+
* @returns Promise which resolves: to an empty object `{}`
|
|
1641
|
+
* @returns Rejects: with an error response.
|
|
1642
|
+
*/
|
|
1643
|
+
sendReadReceipt(event: BriijEvent | null, receiptType?: ReceiptType, unthreaded?: boolean): Promise<EmptyObject | undefined>;
|
|
1644
|
+
/**
|
|
1645
|
+
* Set a marker to indicate the point in a room before which the user has read every
|
|
1646
|
+
* event. This can be retrieved from room account data (the event type is `m.fully_read`)
|
|
1647
|
+
* and displayed as a horizontal line in the timeline that is visually distinct to the
|
|
1648
|
+
* position of the user's own read receipt.
|
|
1649
|
+
* @param roomId - ID of the room that has been read
|
|
1650
|
+
* @param rmEventId - ID of the event that has been read
|
|
1651
|
+
* @param rrEvent - the event tracked by the read receipt. This is here for
|
|
1652
|
+
* convenience because the RR and the RM are commonly updated at the same time as each
|
|
1653
|
+
* other. The local echo of this receipt will be done if set. Optional.
|
|
1654
|
+
* @param rpEvent - the m.read.private read receipt event for when we don't
|
|
1655
|
+
* want other users to see the read receipts. This is experimental. Optional.
|
|
1656
|
+
* @returns Promise which resolves: the empty object, `{}`.
|
|
1657
|
+
*/
|
|
1658
|
+
setRoomReadMarkers(roomId: string, rmEventId: string, rrEvent?: BriijEvent, rpEvent?: BriijEvent): Promise<EmptyObject>;
|
|
1659
|
+
/**
|
|
1660
|
+
*
|
|
1661
|
+
* @param roomId
|
|
1662
|
+
* @param notificationEventId
|
|
1663
|
+
* @returns
|
|
1664
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1665
|
+
* @see BriijSafetyError
|
|
1666
|
+
*/
|
|
1667
|
+
sendRtcDecline(roomId: string, notificationEventId: string): Promise<ISendEventResponse>;
|
|
1668
|
+
/**
|
|
1669
|
+
* Get a preview of the given URL as of (roughly) the given point in time,
|
|
1670
|
+
* described as an object with OpenGraph keys and associated values.
|
|
1671
|
+
* Attributes may be synthesized where actual OG metadata is lacking.
|
|
1672
|
+
* Caches results to prevent hammering the server.
|
|
1673
|
+
* @param url - The URL to get preview data for
|
|
1674
|
+
* @param ts - The preferred point in time that the preview should
|
|
1675
|
+
* describe (ms since epoch). The preview returned will either be the most
|
|
1676
|
+
* recent one preceding this timestamp if available, or failing that the next
|
|
1677
|
+
* most recent available preview.
|
|
1678
|
+
* @returns Promise which resolves: Object of OG metadata.
|
|
1679
|
+
* @returns Rejects: with an error response.
|
|
1680
|
+
* May return synthesized attributes if the URL lacked OG meta.
|
|
1681
|
+
*/
|
|
1682
|
+
getUrlPreview(url: string, ts: number): Promise<IPreviewUrlResponse>;
|
|
1683
|
+
/**
|
|
1684
|
+
* @returns Promise which resolves: to an empty object `{}`
|
|
1685
|
+
* @returns Rejects: with an error response.
|
|
1686
|
+
*/
|
|
1687
|
+
sendTyping(roomId: string, isTyping: boolean, timeoutMs: number): Promise<EmptyObject>;
|
|
1688
|
+
/**
|
|
1689
|
+
* Determines the history of room upgrades for a given room, as far as the
|
|
1690
|
+
* client can see. Returns an array of Rooms where the first entry is the
|
|
1691
|
+
* oldest and the last entry is the newest (likely current) room. If the
|
|
1692
|
+
* provided room is not found, this returns an empty list. This works in
|
|
1693
|
+
* both directions, looking for older and newer rooms of the given room.
|
|
1694
|
+
* @param roomId - The room ID to search from
|
|
1695
|
+
* @param verifyLinks - If true, the function will only return rooms
|
|
1696
|
+
* which can be proven to be linked. For example, rooms which have a create
|
|
1697
|
+
* event pointing to an old room which the client is not aware of or doesn't
|
|
1698
|
+
* have a matching tombstone would not be returned.
|
|
1699
|
+
* @param msc3946ProcessDynamicPredecessor - if true, look for
|
|
1700
|
+
* m.room.predecessor state events as well as create events, and prefer
|
|
1701
|
+
* predecessor events where they exist (MSC3946).
|
|
1702
|
+
* @returns An array of rooms representing the upgrade
|
|
1703
|
+
* history.
|
|
1704
|
+
*/
|
|
1705
|
+
getRoomUpgradeHistory(roomId: string, verifyLinks?: boolean, msc3946ProcessDynamicPredecessor?: boolean): Room[];
|
|
1706
|
+
private findPredecessorRooms;
|
|
1707
|
+
private findSuccessorRooms;
|
|
1708
|
+
/**
|
|
1709
|
+
* Send an invite to the given user to join the given room.
|
|
1710
|
+
*
|
|
1711
|
+
* @param roomId - The ID of the room to which the user should be invited.
|
|
1712
|
+
* @param userId - The ID of the user that should be invited.
|
|
1713
|
+
* @param opts - Optional reason object. For backwards compatibility, a string is also accepted, and will be interpreted as a reason.
|
|
1714
|
+
*
|
|
1715
|
+
* @returns An empty object.
|
|
1716
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1717
|
+
* @see BriijSafetyError
|
|
1718
|
+
*/
|
|
1719
|
+
invite(roomId: string, userId: string, opts?: InviteOpts | string): Promise<EmptyObject>;
|
|
1720
|
+
/**
|
|
1721
|
+
* Invite a user to a room based on their email address.
|
|
1722
|
+
* @param roomId - The room to invite the user to.
|
|
1723
|
+
* @param email - The email address to invite.
|
|
1724
|
+
* @returns Promise which resolves: `{}` an empty object.
|
|
1725
|
+
* @returns Rejects: with an error response.
|
|
1726
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1727
|
+
* @see BriijSafetyError
|
|
1728
|
+
*/
|
|
1729
|
+
inviteByEmail(roomId: string, email: string): Promise<EmptyObject>;
|
|
1730
|
+
/**
|
|
1731
|
+
* Invite a user to a room based on a third-party identifier.
|
|
1732
|
+
* @param roomId - The room to invite the user to.
|
|
1733
|
+
* @param medium - The medium to invite the user e.g. "email".
|
|
1734
|
+
* @param address - The address for the specified medium.
|
|
1735
|
+
* @returns Promise which resolves: `{}` an empty object.
|
|
1736
|
+
* @returns Rejects: with an error response.
|
|
1737
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1738
|
+
* @see BriijSafetyError
|
|
1739
|
+
*/
|
|
1740
|
+
inviteByThreePid(roomId: string, medium: string, address: string): Promise<EmptyObject>;
|
|
1741
|
+
/**
|
|
1742
|
+
* @returns Promise which resolves: `{}` an empty object.
|
|
1743
|
+
* @returns Rejects: with an error response.
|
|
1744
|
+
*/
|
|
1745
|
+
leave(roomId: string): Promise<EmptyObject>;
|
|
1746
|
+
/**
|
|
1747
|
+
* Leaves all rooms in the chain of room upgrades based on the given room. By
|
|
1748
|
+
* default, this will leave all the previous and upgraded rooms, including the
|
|
1749
|
+
* given room. To only leave the given room and any previous rooms, keeping the
|
|
1750
|
+
* upgraded (modern) rooms untouched supply `false` to `includeFuture`.
|
|
1751
|
+
* @param roomId - The room ID to start leaving at
|
|
1752
|
+
* @param includeFuture - If true, the whole chain (past and future) of
|
|
1753
|
+
* upgraded rooms will be left.
|
|
1754
|
+
* @returns Promise which resolves when completed with an object keyed
|
|
1755
|
+
* by room ID and value of the error encountered when leaving or null.
|
|
1756
|
+
*/
|
|
1757
|
+
leaveRoomChain(roomId: string, includeFuture?: boolean): Promise<{
|
|
1758
|
+
[roomId: string]: Error | BriijError | null;
|
|
1759
|
+
}>;
|
|
1760
|
+
/**
|
|
1761
|
+
* @param reason - Optional.
|
|
1762
|
+
* @returns Promise which resolves: TODO
|
|
1763
|
+
* @returns Rejects: with an error response.
|
|
1764
|
+
*/
|
|
1765
|
+
ban(roomId: string, userId: string, reason?: string): Promise<EmptyObject>;
|
|
1766
|
+
/**
|
|
1767
|
+
* @param deleteRoom - True to delete the room from the store on success.
|
|
1768
|
+
* Default: true.
|
|
1769
|
+
* @returns Promise which resolves: `{}` an empty object.
|
|
1770
|
+
* @returns Rejects: with an error response.
|
|
1771
|
+
*/
|
|
1772
|
+
forget(roomId: string, deleteRoom?: boolean): Promise<EmptyObject>;
|
|
1773
|
+
/**
|
|
1774
|
+
* @returns Promise which resolves: Object (currently empty)
|
|
1775
|
+
* @returns Rejects: with an error response.
|
|
1776
|
+
*/
|
|
1777
|
+
unban(roomId: string, userId: string): Promise<EmptyObject>;
|
|
1778
|
+
/**
|
|
1779
|
+
* @param reason - Optional.
|
|
1780
|
+
* @returns Promise which resolves: `{}` an empty object.
|
|
1781
|
+
* @returns Rejects: with an error response.
|
|
1782
|
+
*/
|
|
1783
|
+
kick(roomId: string, userId: string, reason?: string): Promise<EmptyObject>;
|
|
1784
|
+
private membershipChange;
|
|
1785
|
+
/**
|
|
1786
|
+
* Obtain a dict of actions which should be performed for this event according
|
|
1787
|
+
* to the push rules for this user. Caches the dict on the event.
|
|
1788
|
+
* @param event - The event to get push actions for.
|
|
1789
|
+
* @param forceRecalculate - forces to recalculate actions for an event
|
|
1790
|
+
* Useful when an event just got decrypted
|
|
1791
|
+
* @returns A dict of actions to perform.
|
|
1792
|
+
*/
|
|
1793
|
+
getPushActionsForEvent(event: BriijEvent, forceRecalculate?: boolean): IActionsObject | null;
|
|
1794
|
+
/**
|
|
1795
|
+
* Obtain a dict of actions which should be performed for this event according
|
|
1796
|
+
* to the push rules for this user. Caches the dict on the event.
|
|
1797
|
+
* @param event - The event to get push actions for.
|
|
1798
|
+
* @param forceRecalculate - forces to recalculate actions for an event
|
|
1799
|
+
* Useful when an event just got decrypted
|
|
1800
|
+
* @returns A dict of actions to perform.
|
|
1801
|
+
*/
|
|
1802
|
+
getPushDetailsForEvent(event: BriijEvent, forceRecalculate?: boolean): PushDetails | null;
|
|
1803
|
+
/**
|
|
1804
|
+
* @param info - The kind of info to set (e.g. 'avatar_url')
|
|
1805
|
+
* @param data - The JSON object to set.
|
|
1806
|
+
* @returns
|
|
1807
|
+
* @returns Rejects: with an error response.
|
|
1808
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1809
|
+
* @see BriijSafetyError
|
|
1810
|
+
*/
|
|
1811
|
+
setProfileInfo(info: "avatar_url", data: {
|
|
1812
|
+
avatar_url: string;
|
|
1813
|
+
}): Promise<EmptyObject>;
|
|
1814
|
+
setProfileInfo(info: "displayname", data: {
|
|
1815
|
+
displayname: string;
|
|
1816
|
+
}): Promise<EmptyObject>;
|
|
1817
|
+
/**
|
|
1818
|
+
* @returns Promise which resolves: `{}` an empty object.
|
|
1819
|
+
* @returns Rejects: with an error response.
|
|
1820
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1821
|
+
* @see BriijSafetyError
|
|
1822
|
+
*/
|
|
1823
|
+
setDisplayName(name: string): Promise<EmptyObject>;
|
|
1824
|
+
/**
|
|
1825
|
+
* @returns Promise which resolves: `{}` an empty object.
|
|
1826
|
+
* @returns Rejects: with an error response.
|
|
1827
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
1828
|
+
* @see BriijSafetyError
|
|
1829
|
+
*/
|
|
1830
|
+
setAvatarUrl(url: string): Promise<EmptyObject>;
|
|
1831
|
+
/**
|
|
1832
|
+
* Turn an MXC URL into an HTTP one. <strong>This method is experimental and
|
|
1833
|
+
* may change.</strong>
|
|
1834
|
+
* @param mxcUrl - The MXC URL
|
|
1835
|
+
* @param width - The desired width of the thumbnail.
|
|
1836
|
+
* @param height - The desired height of the thumbnail.
|
|
1837
|
+
* @param resizeMethod - The thumbnail resize method to use, either
|
|
1838
|
+
* "crop" or "scale".
|
|
1839
|
+
* @param allowDirectLinks - If true, return any non-mxc URLs
|
|
1840
|
+
* directly. Fetching such URLs will leak information about the user to
|
|
1841
|
+
* anyone they share a room with. If false, will return null for such URLs.
|
|
1842
|
+
* @param allowRedirects - If true, the caller supports the URL being 307 or
|
|
1843
|
+
* 308 redirected to another resource upon request. If false, redirects
|
|
1844
|
+
* are not expected. Implied `true` when `useAuthentication` is `true`.
|
|
1845
|
+
* @param useAuthentication - If true, the caller supports authenticated
|
|
1846
|
+
* media and wants an authentication-required URL. Note that server support
|
|
1847
|
+
* for authenticated media will *not* be checked - it is the caller's responsibility
|
|
1848
|
+
* to do so before calling this function. Note also that `useAuthentication`
|
|
1849
|
+
* implies `allowRedirects`. Defaults to false (unauthenticated endpoints).
|
|
1850
|
+
* @returns the avatar URL or null.
|
|
1851
|
+
*/
|
|
1852
|
+
mxcUrlToHttp(mxcUrl: string, width?: number, height?: number, resizeMethod?: string, allowDirectLinks?: boolean, allowRedirects?: boolean, useAuthentication?: boolean): string | null;
|
|
1853
|
+
/**
|
|
1854
|
+
* Specify the set_presence value to be used for subsequent calls to the Sync API.
|
|
1855
|
+
* This has an advantage over calls to the PUT /presence API in that it
|
|
1856
|
+
* doesn't clobber status_msg set by other devices.
|
|
1857
|
+
* @param presence - the presence to specify to set_presence of sync calls
|
|
1858
|
+
*/
|
|
1859
|
+
setSyncPresence(presence?: SetPresence): Promise<void>;
|
|
1860
|
+
/**
|
|
1861
|
+
* @param opts - Options to apply
|
|
1862
|
+
* @returns Promise which resolves
|
|
1863
|
+
* @returns Rejects: with an error response.
|
|
1864
|
+
* @throws If 'presence' isn't a valid presence enum value.
|
|
1865
|
+
*/
|
|
1866
|
+
setPresence(opts: IPresenceOpts): Promise<void>;
|
|
1867
|
+
/**
|
|
1868
|
+
* @param userId - The user to get presence for
|
|
1869
|
+
* @returns Promise which resolves: The presence state for this user.
|
|
1870
|
+
* @returns Rejects: with an error response.
|
|
1871
|
+
*/
|
|
1872
|
+
getPresence(userId: string): Promise<IStatusResponse>;
|
|
1873
|
+
/**
|
|
1874
|
+
* Retrieve older messages from the given room and put them in the timeline.
|
|
1875
|
+
*
|
|
1876
|
+
* If this is called multiple times whilst a request is ongoing, the <i>same</i>
|
|
1877
|
+
* Promise will be returned. If there was a problem requesting scrollback, there
|
|
1878
|
+
* will be a small delay before another request can be made (to prevent tight-looping
|
|
1879
|
+
* when there is no connection).
|
|
1880
|
+
*
|
|
1881
|
+
* @param room - The room to get older messages in.
|
|
1882
|
+
* @param limit - Optional. The maximum number of previous events to
|
|
1883
|
+
* pull in. Default: 30.
|
|
1884
|
+
* @returns Promise which resolves: Room. If you are at the beginning
|
|
1885
|
+
* of the timeline, `Room.oldState.paginationToken` will be
|
|
1886
|
+
* `null`.
|
|
1887
|
+
* @returns Rejects: with an error response.
|
|
1888
|
+
*/
|
|
1889
|
+
scrollback(room: Room, limit?: number): Promise<Room>;
|
|
1890
|
+
getEventMapper(options?: MapperOpts): EventMapper;
|
|
1891
|
+
/**
|
|
1892
|
+
* Calls the `/context` API for the given room ID & event ID.
|
|
1893
|
+
* Returns the response, with `event` asserted and all optional arrays defaulted to an empty array.
|
|
1894
|
+
* @param roomId - the room ID to request a context for
|
|
1895
|
+
* @param eventId - the event ID to request a context for
|
|
1896
|
+
* @throws if `event` in the response is missing
|
|
1897
|
+
* @private
|
|
1898
|
+
*/
|
|
1899
|
+
private getEventContext;
|
|
1900
|
+
/**
|
|
1901
|
+
* Get an EventTimeline for the given event
|
|
1902
|
+
*
|
|
1903
|
+
* <p>If the EventTimelineSet object already has the given event in its store, the
|
|
1904
|
+
* corresponding timeline will be returned. Otherwise, a /context request is
|
|
1905
|
+
* made, and used to construct an EventTimeline.
|
|
1906
|
+
* If the event does not belong to this EventTimelineSet then undefined will be returned.
|
|
1907
|
+
*
|
|
1908
|
+
* @param timelineSet - The timelineSet to look for the event in, must be bound to a room
|
|
1909
|
+
* @param eventId - The ID of the event to look for
|
|
1910
|
+
*
|
|
1911
|
+
* @returns Promise which resolves:
|
|
1912
|
+
* {@link EventTimeline} including the given event
|
|
1913
|
+
*/
|
|
1914
|
+
getEventTimeline(timelineSet: EventTimelineSet, eventId: string): Promise<EventTimeline | null>;
|
|
1915
|
+
getThreadTimeline(timelineSet: EventTimelineSet, eventId: string): Promise<EventTimeline | undefined>;
|
|
1916
|
+
/**
|
|
1917
|
+
* Get an EventTimeline for the latest events in the room. This will just
|
|
1918
|
+
* call `/messages` to get the latest message in the room, then use
|
|
1919
|
+
* `client.getEventTimeline(...)` to construct a new timeline from it.
|
|
1920
|
+
*
|
|
1921
|
+
* @param timelineSet - The timelineSet to find or add the timeline to
|
|
1922
|
+
*
|
|
1923
|
+
* @returns Promise which resolves:
|
|
1924
|
+
* {@link EventTimeline} timeline with the latest events in the room
|
|
1925
|
+
*/
|
|
1926
|
+
getLatestTimeline(timelineSet: EventTimelineSet): Promise<EventTimeline | null>;
|
|
1927
|
+
/**
|
|
1928
|
+
* Makes a request to /messages with the appropriate lazy loading filter set.
|
|
1929
|
+
* XXX: if we do get rid of scrollback (as it's not used at the moment),
|
|
1930
|
+
* we could inline this method again in paginateEventTimeline as that would
|
|
1931
|
+
* then be the only call-site
|
|
1932
|
+
* @param limit - the maximum amount of events the retrieve
|
|
1933
|
+
* @param dir - 'f' or 'b'
|
|
1934
|
+
* @param timelineFilter - the timeline filter to pass
|
|
1935
|
+
*/
|
|
1936
|
+
createMessagesRequest(roomId: string, fromToken: string | null, limit: number | undefined, dir: Direction, timelineFilter?: Filter): Promise<IMessagesResponse>;
|
|
1937
|
+
/**
|
|
1938
|
+
* Makes a request to /messages with the appropriate lazy loading filter set.
|
|
1939
|
+
* XXX: if we do get rid of scrollback (as it's not used at the moment),
|
|
1940
|
+
* we could inline this method again in paginateEventTimeline as that would
|
|
1941
|
+
* then be the only call-site
|
|
1942
|
+
* @param limit - the maximum amount of events the retrieve
|
|
1943
|
+
* @param dir - 'f' or 'b'
|
|
1944
|
+
* @param timelineFilter - the timeline filter to pass
|
|
1945
|
+
*/
|
|
1946
|
+
createThreadListMessagesRequest(roomId: string, fromToken: string | null, limit?: number, dir?: Direction, threadListType?: ThreadFilterType | null, timelineFilter?: Filter): Promise<IMessagesResponse>;
|
|
1947
|
+
/**
|
|
1948
|
+
* Take an EventTimeline, and back/forward-fill results.
|
|
1949
|
+
*
|
|
1950
|
+
* @param eventTimeline - timeline object to be updated
|
|
1951
|
+
*
|
|
1952
|
+
* @returns Promise which resolves to a boolean: false if there are no
|
|
1953
|
+
* events and we reached either end of the timeline; else true.
|
|
1954
|
+
*/
|
|
1955
|
+
paginateEventTimeline(eventTimeline: EventTimeline, opts: IPaginateOpts): Promise<boolean>;
|
|
1956
|
+
/**
|
|
1957
|
+
* Reset the notifTimelineSet entirely, paginating in some historical notifs as
|
|
1958
|
+
* a starting point for subsequent pagination.
|
|
1959
|
+
*/
|
|
1960
|
+
resetNotifTimelineSet(): void;
|
|
1961
|
+
/**
|
|
1962
|
+
* Peek into a room and receive updates about the room. This only works if the
|
|
1963
|
+
* history visibility for the room is world_readable.
|
|
1964
|
+
* @param roomId - The room to attempt to peek into.
|
|
1965
|
+
* @param limit - The number of timeline events to initially retrieve.
|
|
1966
|
+
* @returns Promise which resolves: Room object
|
|
1967
|
+
* @returns Rejects: with an error response.
|
|
1968
|
+
*/
|
|
1969
|
+
peekInRoom(roomId: string, limit?: number): Promise<Room>;
|
|
1970
|
+
/**
|
|
1971
|
+
* Stop any ongoing room peeking.
|
|
1972
|
+
*/
|
|
1973
|
+
stopPeeking(): void;
|
|
1974
|
+
/**
|
|
1975
|
+
* Set r/w flags for guest access in a room.
|
|
1976
|
+
* @param roomId - The room to configure guest access in.
|
|
1977
|
+
* @param opts - Options
|
|
1978
|
+
* @returns Promise which resolves
|
|
1979
|
+
* @returns Rejects: with an error response.
|
|
1980
|
+
*/
|
|
1981
|
+
setGuestAccess(roomId: string, opts: IGuestAccessOpts): Promise<void>;
|
|
1982
|
+
/**
|
|
1983
|
+
* Requests an email verification token for the purposes of registration.
|
|
1984
|
+
* This API requests a token from the homeserver.
|
|
1985
|
+
* The doesServerRequireIdServerParam() method can be used to determine if
|
|
1986
|
+
* the server requires the id_server parameter to be provided.
|
|
1987
|
+
*
|
|
1988
|
+
* Parameters and return value are as for requestEmailToken
|
|
1989
|
+
|
|
1990
|
+
* @param email - As requestEmailToken
|
|
1991
|
+
* @param clientSecret - As requestEmailToken
|
|
1992
|
+
* @param sendAttempt - As requestEmailToken
|
|
1993
|
+
* @param nextLink - As requestEmailToken
|
|
1994
|
+
* @returns Promise which resolves: As requestEmailToken
|
|
1995
|
+
*/
|
|
1996
|
+
requestRegisterEmailToken(email: string, clientSecret: string, sendAttempt: number, nextLink?: string): Promise<IRequestTokenResponse>;
|
|
1997
|
+
/**
|
|
1998
|
+
* Requests a text message verification token for the purposes of registration.
|
|
1999
|
+
* This API requests a token from the homeserver.
|
|
2000
|
+
* The doesServerRequireIdServerParam() method can be used to determine if
|
|
2001
|
+
* the server requires the id_server parameter to be provided.
|
|
2002
|
+
*
|
|
2003
|
+
* @param phoneCountry - The ISO 3166-1 alpha-2 code for the country in which
|
|
2004
|
+
* phoneNumber should be parsed relative to.
|
|
2005
|
+
* @param phoneNumber - The phone number, in national or international format
|
|
2006
|
+
* @param clientSecret - As requestEmailToken
|
|
2007
|
+
* @param sendAttempt - As requestEmailToken
|
|
2008
|
+
* @param nextLink - As requestEmailToken
|
|
2009
|
+
* @returns Promise which resolves: As requestEmailToken
|
|
2010
|
+
*/
|
|
2011
|
+
requestRegisterMsisdnToken(phoneCountry: string, phoneNumber: string, clientSecret: string, sendAttempt: number, nextLink?: string): Promise<IRequestMsisdnTokenResponse>;
|
|
2012
|
+
/**
|
|
2013
|
+
* Requests an email verification token for the purposes of adding a
|
|
2014
|
+
* third party identifier to an account.
|
|
2015
|
+
* This API requests a token from the homeserver.
|
|
2016
|
+
* The doesServerRequireIdServerParam() method can be used to determine if
|
|
2017
|
+
* the server requires the id_server parameter to be provided.
|
|
2018
|
+
* If an account with the given email address already exists and is
|
|
2019
|
+
* associated with an account other than the one the user is authed as,
|
|
2020
|
+
* it will either send an email to the address informing them of this
|
|
2021
|
+
* or return M_THREEPID_IN_USE (which one is up to the homeserver).
|
|
2022
|
+
*
|
|
2023
|
+
* @param email - As requestEmailToken
|
|
2024
|
+
* @param clientSecret - As requestEmailToken
|
|
2025
|
+
* @param sendAttempt - As requestEmailToken
|
|
2026
|
+
* @param nextLink - As requestEmailToken
|
|
2027
|
+
* @returns Promise which resolves: As requestEmailToken
|
|
2028
|
+
*/
|
|
2029
|
+
requestAdd3pidEmailToken(email: string, clientSecret: string, sendAttempt: number, nextLink?: string): Promise<IRequestTokenResponse>;
|
|
2030
|
+
/**
|
|
2031
|
+
* Requests a text message verification token for the purposes of adding a
|
|
2032
|
+
* third party identifier to an account.
|
|
2033
|
+
* This API proxies the identity server /validate/email/requestToken API,
|
|
2034
|
+
* adding specific behaviour for the addition of phone numbers to an
|
|
2035
|
+
* account, as requestAdd3pidEmailToken.
|
|
2036
|
+
*
|
|
2037
|
+
* @param phoneCountry - As requestRegisterMsisdnToken
|
|
2038
|
+
* @param phoneNumber - As requestRegisterMsisdnToken
|
|
2039
|
+
* @param clientSecret - As requestEmailToken
|
|
2040
|
+
* @param sendAttempt - As requestEmailToken
|
|
2041
|
+
* @param nextLink - As requestEmailToken
|
|
2042
|
+
* @returns Promise which resolves: As requestEmailToken
|
|
2043
|
+
*/
|
|
2044
|
+
requestAdd3pidMsisdnToken(phoneCountry: string, phoneNumber: string, clientSecret: string, sendAttempt: number, nextLink?: string): Promise<IRequestMsisdnTokenResponse>;
|
|
2045
|
+
/**
|
|
2046
|
+
* Requests an email verification token for the purposes of resetting
|
|
2047
|
+
* the password on an account.
|
|
2048
|
+
* This API proxies the identity server /validate/email/requestToken API,
|
|
2049
|
+
* adding specific behaviour for the password resetting. Specifically,
|
|
2050
|
+
* if no account with the given email address exists, it may either
|
|
2051
|
+
* return M_THREEPID_NOT_FOUND or send an email
|
|
2052
|
+
* to the address informing them of this (which one is up to the homeserver).
|
|
2053
|
+
*
|
|
2054
|
+
* requestEmailToken calls the equivalent API directly on the identity server,
|
|
2055
|
+
* therefore bypassing the password reset specific logic.
|
|
2056
|
+
*
|
|
2057
|
+
* @param email - As requestEmailToken
|
|
2058
|
+
* @param clientSecret - As requestEmailToken
|
|
2059
|
+
* @param sendAttempt - As requestEmailToken
|
|
2060
|
+
* @param nextLink - As requestEmailToken
|
|
2061
|
+
* @returns Promise which resolves: As requestEmailToken
|
|
2062
|
+
*/
|
|
2063
|
+
requestPasswordEmailToken(email: string, clientSecret: string, sendAttempt: number, nextLink?: string): Promise<IRequestTokenResponse>;
|
|
2064
|
+
/**
|
|
2065
|
+
* Requests a text message verification token for the purposes of resetting
|
|
2066
|
+
* the password on an account.
|
|
2067
|
+
* This API proxies the identity server /validate/email/requestToken API,
|
|
2068
|
+
* adding specific behaviour for the password resetting, as requestPasswordEmailToken.
|
|
2069
|
+
*
|
|
2070
|
+
* @param phoneCountry - As requestRegisterMsisdnToken
|
|
2071
|
+
* @param phoneNumber - As requestRegisterMsisdnToken
|
|
2072
|
+
* @param clientSecret - As requestEmailToken
|
|
2073
|
+
* @param sendAttempt - As requestEmailToken
|
|
2074
|
+
* @param nextLink - As requestEmailToken
|
|
2075
|
+
* @returns Promise which resolves: As requestEmailToken
|
|
2076
|
+
*/
|
|
2077
|
+
requestPasswordMsisdnToken(phoneCountry: string, phoneNumber: string, clientSecret: string, sendAttempt: number, nextLink: string): Promise<IRequestMsisdnTokenResponse>;
|
|
2078
|
+
/**
|
|
2079
|
+
* Internal utility function for requesting validation tokens from usage-specific
|
|
2080
|
+
* requestToken endpoints.
|
|
2081
|
+
*
|
|
2082
|
+
* @param endpoint - The endpoint to send the request to
|
|
2083
|
+
* @param params - Parameters for the POST request
|
|
2084
|
+
* @returns Promise which resolves: As requestEmailToken
|
|
2085
|
+
*/
|
|
2086
|
+
private requestTokenFromEndpoint;
|
|
2087
|
+
/**
|
|
2088
|
+
* Get the room-kind push rule associated with a room.
|
|
2089
|
+
* @param scope - "global" or device-specific.
|
|
2090
|
+
* @param roomId - the id of the room.
|
|
2091
|
+
* @returns the rule or undefined.
|
|
2092
|
+
*/
|
|
2093
|
+
getRoomPushRule(scope: "global" | "device", roomId: string): IPushRule | undefined;
|
|
2094
|
+
/**
|
|
2095
|
+
* Set a room-kind muting push rule in a room.
|
|
2096
|
+
* The operation also updates BriijClient.pushRules at the end.
|
|
2097
|
+
* @param scope - "global" or device-specific.
|
|
2098
|
+
* @param roomId - the id of the room.
|
|
2099
|
+
* @param mute - the mute state.
|
|
2100
|
+
* @returns Promise which resolves: result object
|
|
2101
|
+
* @returns Rejects: with an error response.
|
|
2102
|
+
*/
|
|
2103
|
+
setRoomMutePushRule(scope: "global" | "device", roomId: string, mute: boolean): Promise<void> | undefined;
|
|
2104
|
+
searchMessageText(opts: ISearchOpts): Promise<ISearchResponse>;
|
|
2105
|
+
/**
|
|
2106
|
+
* Perform a server-side search for room events.
|
|
2107
|
+
*
|
|
2108
|
+
* The returned promise resolves to an object containing the fields:
|
|
2109
|
+
*
|
|
2110
|
+
* * count: estimate of the number of results
|
|
2111
|
+
* * next_batch: token for back-pagination; if undefined, there are no more results
|
|
2112
|
+
* * highlights: a list of words to highlight from the stemming algorithm
|
|
2113
|
+
* * results: a list of results
|
|
2114
|
+
*
|
|
2115
|
+
* Each entry in the results list is a SearchResult.
|
|
2116
|
+
*
|
|
2117
|
+
* @returns Promise which resolves: result object
|
|
2118
|
+
* @returns Rejects: with an error response.
|
|
2119
|
+
*/
|
|
2120
|
+
searchRoomEvents(opts: IEventSearchOpts): Promise<ISearchResults>;
|
|
2121
|
+
/**
|
|
2122
|
+
* Take a result from an earlier searchRoomEvents call, and backfill results.
|
|
2123
|
+
*
|
|
2124
|
+
* @param searchResults - the results object to be updated
|
|
2125
|
+
* @returns Promise which resolves: updated result object
|
|
2126
|
+
* @returns Rejects: with an error response.
|
|
2127
|
+
*/
|
|
2128
|
+
backPaginateRoomEventsSearch<T extends ISearchResults>(searchResults: T): Promise<T>;
|
|
2129
|
+
/**
|
|
2130
|
+
* helper for searchRoomEvents and backPaginateRoomEventsSearch. Processes the
|
|
2131
|
+
* response from the API call and updates the searchResults
|
|
2132
|
+
*
|
|
2133
|
+
* @returns searchResults
|
|
2134
|
+
* @internal
|
|
2135
|
+
*/
|
|
2136
|
+
processRoomEventsSearch<T extends ISearchResults>(searchResults: T, response: ISearchResponse): T;
|
|
2137
|
+
/**
|
|
2138
|
+
* Populate the store with rooms the user has left.
|
|
2139
|
+
* @returns Promise which resolves: TODO - Resolved when the rooms have
|
|
2140
|
+
* been added to the data store.
|
|
2141
|
+
* @returns Rejects: with an error response.
|
|
2142
|
+
*/
|
|
2143
|
+
syncLeftRooms(): Promise<Room[]>;
|
|
2144
|
+
/**
|
|
2145
|
+
* Create a new filter.
|
|
2146
|
+
* @param content - The HTTP body for the request
|
|
2147
|
+
* @returns Promise which resolves to a Filter object.
|
|
2148
|
+
* @returns Rejects: with an error response.
|
|
2149
|
+
*/
|
|
2150
|
+
createFilter(content: IFilterDefinition): Promise<Filter>;
|
|
2151
|
+
/**
|
|
2152
|
+
* Retrieve a filter.
|
|
2153
|
+
* @param userId - The user ID of the filter owner
|
|
2154
|
+
* @param filterId - The filter ID to retrieve
|
|
2155
|
+
* @param allowCached - True to allow cached filters to be returned.
|
|
2156
|
+
* Default: True.
|
|
2157
|
+
* @returns Promise which resolves: a Filter object
|
|
2158
|
+
* @returns Rejects: with an error response.
|
|
2159
|
+
*/
|
|
2160
|
+
getFilter(userId: string, filterId: string, allowCached: boolean): Promise<Filter>;
|
|
2161
|
+
/**
|
|
2162
|
+
* @returns Filter ID
|
|
2163
|
+
*/
|
|
2164
|
+
getOrCreateFilter(filterName: string, filter: Filter): Promise<string>;
|
|
2165
|
+
/**
|
|
2166
|
+
* Gets a bearer token from the homeserver that the user can
|
|
2167
|
+
* present to a third party in order to prove their ownership
|
|
2168
|
+
* of the Matrix account they are logged into.
|
|
2169
|
+
* @returns Promise which resolves: Token object
|
|
2170
|
+
* @returns Rejects: with an error response.
|
|
2171
|
+
*/
|
|
2172
|
+
getOpenIdToken(): Promise<IOpenIDToken>;
|
|
2173
|
+
private startCallEventHandler;
|
|
2174
|
+
private startMatrixRTC;
|
|
2175
|
+
/**
|
|
2176
|
+
* Once the client has been initialised, we want to clear notifications we
|
|
2177
|
+
* know for a fact should be here.
|
|
2178
|
+
* This issue should also be addressed on synapse's side and is tracked as part
|
|
2179
|
+
* of https://github.com/matrix-org/synapse/issues/14837
|
|
2180
|
+
*
|
|
2181
|
+
* We consider a room or a thread as fully read if the current user has sent
|
|
2182
|
+
* the last event in the live timeline of that context and if the read receipt
|
|
2183
|
+
* we have on record matches.
|
|
2184
|
+
*/
|
|
2185
|
+
private fixupRoomNotifications;
|
|
2186
|
+
/**
|
|
2187
|
+
* @returns Promise which resolves: ITurnServerResponse object
|
|
2188
|
+
* @returns Rejects: with an error response.
|
|
2189
|
+
*/
|
|
2190
|
+
turnServer(): Promise<ITurnServerResponse>;
|
|
2191
|
+
/**
|
|
2192
|
+
* Get the TURN servers for this homeserver.
|
|
2193
|
+
* @returns The servers or an empty list.
|
|
2194
|
+
*/
|
|
2195
|
+
getTurnServers(): ITurnServer[];
|
|
2196
|
+
/**
|
|
2197
|
+
* Get the unix timestamp (in milliseconds) at which the current
|
|
2198
|
+
* TURN credentials (from getTurnServers) expire
|
|
2199
|
+
* @returns The expiry timestamp in milliseconds
|
|
2200
|
+
*/
|
|
2201
|
+
getTurnServersExpiry(): number;
|
|
2202
|
+
get pollingTurnServers(): boolean;
|
|
2203
|
+
checkTurnServers(): Promise<boolean | undefined>;
|
|
2204
|
+
/**
|
|
2205
|
+
* Set whether to allow a fallback ICE server should be used for negotiating a
|
|
2206
|
+
* WebRTC connection if the homeserver doesn't provide any servers. Defaults to
|
|
2207
|
+
* false.
|
|
2208
|
+
*
|
|
2209
|
+
*/
|
|
2210
|
+
setFallbackICEServerAllowed(allow: boolean): void;
|
|
2211
|
+
/**
|
|
2212
|
+
* Get whether to allow a fallback ICE server should be used for negotiating a
|
|
2213
|
+
* WebRTC connection if the homeserver doesn't provide any servers. Defaults to
|
|
2214
|
+
* false.
|
|
2215
|
+
*
|
|
2216
|
+
* @returns
|
|
2217
|
+
*/
|
|
2218
|
+
isFallbackICEServerAllowed(): boolean;
|
|
2219
|
+
/**
|
|
2220
|
+
* Determines if the current user is an administrator of the Synapse homeserver.
|
|
2221
|
+
* Returns false if untrue or the homeserver does not appear to be a Synapse
|
|
2222
|
+
* homeserver. <strong>This function is implementation specific and may change
|
|
2223
|
+
* as a result.</strong>
|
|
2224
|
+
* @returns true if the user appears to be a Synapse administrator.
|
|
2225
|
+
*/
|
|
2226
|
+
isSynapseAdministrator(): Promise<boolean>;
|
|
2227
|
+
/**
|
|
2228
|
+
* Performs a whois lookup on a user using Synapse's administrator API.
|
|
2229
|
+
* <strong>This function is implementation specific and may change as a
|
|
2230
|
+
* result.</strong>
|
|
2231
|
+
* @param userId - the User ID to look up.
|
|
2232
|
+
* @returns the whois response - see Synapse docs for information.
|
|
2233
|
+
*/
|
|
2234
|
+
whoisSynapseUser(userId: string): Promise<ISynapseAdminWhoisResponse>;
|
|
2235
|
+
/**
|
|
2236
|
+
* Deactivates a user using Synapse's administrator API. <strong>This
|
|
2237
|
+
* function is implementation specific and may change as a result.</strong>
|
|
2238
|
+
* @param userId - the User ID to deactivate.
|
|
2239
|
+
* @returns the deactivate response - see Synapse docs for information.
|
|
2240
|
+
*/
|
|
2241
|
+
deactivateSynapseUser(userId: string): Promise<ISynapseAdminDeactivateResponse>;
|
|
2242
|
+
protected fetchClientWellKnown(): Promise<void>;
|
|
2243
|
+
getClientWellKnown(): IClientWellKnown | undefined;
|
|
2244
|
+
waitForClientWellKnown(): Promise<IClientWellKnown>;
|
|
2245
|
+
/**
|
|
2246
|
+
* store client options with boolean/string/numeric values
|
|
2247
|
+
* to know in the next session what flags the sync data was
|
|
2248
|
+
* created with (e.g. lazy loading)
|
|
2249
|
+
* @returns for store operation
|
|
2250
|
+
*/
|
|
2251
|
+
storeClientOptions(): Promise<void>;
|
|
2252
|
+
/**
|
|
2253
|
+
* Gets a set of room IDs in common with another user.
|
|
2254
|
+
*
|
|
2255
|
+
* Note: This endpoint is unstable, and can throw an `Error`.
|
|
2256
|
+
* Check progress on [MSC2666](https://github.com/matrix-org/matrix-spec-proposals/pull/2666) for more details.
|
|
2257
|
+
*
|
|
2258
|
+
* @param userId - The userId to check.
|
|
2259
|
+
* @returns Promise which resolves to an array of rooms
|
|
2260
|
+
* @returns Rejects: with an error response.
|
|
2261
|
+
*/
|
|
2262
|
+
_unstable_getSharedRooms(userId: string): Promise<string[]>;
|
|
2263
|
+
/**
|
|
2264
|
+
* Returns a set of configured RTC transports supported by the homeserver.
|
|
2265
|
+
* Requires homeserver support for MSC4143.
|
|
2266
|
+
* @throws A M_NOT_FOUND error if not supported by the homeserver.
|
|
2267
|
+
*/
|
|
2268
|
+
_unstable_getRTCTransports(): Promise<Transport[]>;
|
|
2269
|
+
/**
|
|
2270
|
+
* Get the API versions supported by the server, along with any
|
|
2271
|
+
* unstable APIs it supports
|
|
2272
|
+
* @returns The server /versions response
|
|
2273
|
+
*/
|
|
2274
|
+
getVersions(): Promise<IServerVersions>;
|
|
2275
|
+
/**
|
|
2276
|
+
* Check if a particular spec version is supported by the server.
|
|
2277
|
+
* @param version - The spec version (such as "r0.5.0") to check for.
|
|
2278
|
+
* @returns Whether it is supported
|
|
2279
|
+
*/
|
|
2280
|
+
isVersionSupported(version: string): Promise<boolean>;
|
|
2281
|
+
/**
|
|
2282
|
+
* Query the server to see if it lists support for an unstable feature
|
|
2283
|
+
* in the /versions response
|
|
2284
|
+
* @param feature - the feature name
|
|
2285
|
+
* @returns true if the feature is supported
|
|
2286
|
+
*/
|
|
2287
|
+
doesServerSupportUnstableFeature(feature: string): Promise<boolean>;
|
|
2288
|
+
/**
|
|
2289
|
+
* Query the server to see if it is forcing encryption to be enabled for
|
|
2290
|
+
* a given room preset, based on the /versions response.
|
|
2291
|
+
* @param presetName - The name of the preset to check.
|
|
2292
|
+
* @returns true if the server is forcing encryption
|
|
2293
|
+
* for the preset.
|
|
2294
|
+
*/
|
|
2295
|
+
doesServerForceEncryptionForPreset(presetName: Preset): Promise<boolean>;
|
|
2296
|
+
doesServerSupportThread(): Promise<{
|
|
2297
|
+
threads: FeatureSupport;
|
|
2298
|
+
list: FeatureSupport;
|
|
2299
|
+
fwdPagination: FeatureSupport;
|
|
2300
|
+
}>;
|
|
2301
|
+
/**
|
|
2302
|
+
* Get if lazy loading members is being used.
|
|
2303
|
+
* @returns Whether or not members are lazy loaded by this client
|
|
2304
|
+
*/
|
|
2305
|
+
hasLazyLoadMembersEnabled(): boolean;
|
|
2306
|
+
/**
|
|
2307
|
+
* Set a function which is called when /sync returns a 'limited' response.
|
|
2308
|
+
* It is called with a room ID and returns a boolean. It should return 'true' if the SDK
|
|
2309
|
+
* can SAFELY remove events from this room. It may not be safe to remove events if there
|
|
2310
|
+
* are other references to the timelines for this room, e.g because the client is
|
|
2311
|
+
* actively viewing events in this room.
|
|
2312
|
+
* Default: returns false.
|
|
2313
|
+
* @param cb - The callback which will be invoked.
|
|
2314
|
+
*/
|
|
2315
|
+
setCanResetTimelineCallback(cb: ResetTimelineCallback): void;
|
|
2316
|
+
/**
|
|
2317
|
+
* Get the callback set via `setCanResetTimelineCallback`.
|
|
2318
|
+
* @returns The callback or null
|
|
2319
|
+
*/
|
|
2320
|
+
getCanResetTimelineCallback(): ResetTimelineCallback | undefined;
|
|
2321
|
+
/**
|
|
2322
|
+
* Returns relations for a given event. Handles encryption transparently,
|
|
2323
|
+
* with the caveat that the amount of events returned might be 0, even though you get a nextBatch.
|
|
2324
|
+
* When the returned promise resolves, all messages should have finished trying to decrypt.
|
|
2325
|
+
* @param roomId - the room of the event
|
|
2326
|
+
* @param eventId - the id of the event
|
|
2327
|
+
* @param relationType - the rel_type of the relations requested
|
|
2328
|
+
* @param eventType - the event type of the relations requested
|
|
2329
|
+
* @param opts - options with optional values for the request.
|
|
2330
|
+
* @returns an object with `events` as `BriijEvent[]` and optionally `nextBatch` if more relations are available.
|
|
2331
|
+
*/
|
|
2332
|
+
relations(roomId: string, eventId: string, relationType: RelationType | string | null, eventType?: EventType | string | null, opts?: IRelationsRequestOpts): Promise<{
|
|
2333
|
+
originalEvent?: BriijEvent | null;
|
|
2334
|
+
events: BriijEvent[];
|
|
2335
|
+
nextBatch?: string | null;
|
|
2336
|
+
prevBatch?: string | null;
|
|
2337
|
+
}>;
|
|
2338
|
+
/**
|
|
2339
|
+
* Generates a random string suitable for use as a client secret. <strong>This
|
|
2340
|
+
* method is experimental and may change.</strong>
|
|
2341
|
+
* @returns A new client secret
|
|
2342
|
+
*/
|
|
2343
|
+
generateClientSecret(): string;
|
|
2344
|
+
/**
|
|
2345
|
+
* Attempts to decrypt an event
|
|
2346
|
+
* @param event - The event to decrypt
|
|
2347
|
+
* @returns A decryption promise
|
|
2348
|
+
*/
|
|
2349
|
+
decryptEventIfNeeded(event: BriijEvent, options?: IDecryptOptions): Promise<void>;
|
|
2350
|
+
private termsUrlForService;
|
|
2351
|
+
/**
|
|
2352
|
+
* Get the Homeserver URL of this client
|
|
2353
|
+
* @returns Homeserver URL of this client
|
|
2354
|
+
*/
|
|
2355
|
+
getHomeserverUrl(): string;
|
|
2356
|
+
/**
|
|
2357
|
+
* Get the identity server URL of this client
|
|
2358
|
+
* @param stripProto - whether or not to strip the protocol from the URL
|
|
2359
|
+
* @returns Identity server URL of this client
|
|
2360
|
+
*/
|
|
2361
|
+
getIdentityServerUrl(stripProto?: boolean): string | undefined;
|
|
2362
|
+
/**
|
|
2363
|
+
* Set the identity server URL of this client
|
|
2364
|
+
* @param url - New identity server URL
|
|
2365
|
+
*/
|
|
2366
|
+
setIdentityServerUrl(url?: string): void;
|
|
2367
|
+
/**
|
|
2368
|
+
* Get the access token associated with this account.
|
|
2369
|
+
* @returns The access_token or null
|
|
2370
|
+
*/
|
|
2371
|
+
getAccessToken(): string | null;
|
|
2372
|
+
/**
|
|
2373
|
+
* Get the refresh token associated with this account.
|
|
2374
|
+
* @returns The refresh_token or null
|
|
2375
|
+
*/
|
|
2376
|
+
getRefreshToken(): string | null;
|
|
2377
|
+
/**
|
|
2378
|
+
* Set the access token associated with this account.
|
|
2379
|
+
* @param token - The new access token.
|
|
2380
|
+
*/
|
|
2381
|
+
setAccessToken(token: string): void;
|
|
2382
|
+
/**
|
|
2383
|
+
* @returns true if there is a valid access_token for this client.
|
|
2384
|
+
*/
|
|
2385
|
+
isLoggedIn(): boolean;
|
|
2386
|
+
/**
|
|
2387
|
+
* Make up a new transaction id
|
|
2388
|
+
*
|
|
2389
|
+
* @returns a new, unique, transaction id
|
|
2390
|
+
*/
|
|
2391
|
+
makeTxnId(): string;
|
|
2392
|
+
/**
|
|
2393
|
+
* Check whether a username is available prior to registration. An error response
|
|
2394
|
+
* indicates an invalid/unavailable username.
|
|
2395
|
+
* @param username - The username to check the availability of.
|
|
2396
|
+
* @returns Promise which resolves: to boolean of whether the username is available.
|
|
2397
|
+
*/
|
|
2398
|
+
isUsernameAvailable(username: string): Promise<boolean>;
|
|
2399
|
+
/**
|
|
2400
|
+
* @param bindThreepids - Set key 'email' to true to bind any email
|
|
2401
|
+
* threepid uses during registration in the identity server. Set 'msisdn' to
|
|
2402
|
+
* true to bind msisdn.
|
|
2403
|
+
* @returns Promise which resolves to a RegisterResponse object
|
|
2404
|
+
* @returns Rejects: with an error response.
|
|
2405
|
+
*/
|
|
2406
|
+
register(username: string, password: string, sessionId: string | null, auth: {
|
|
2407
|
+
session?: string;
|
|
2408
|
+
type: string;
|
|
2409
|
+
}, bindThreepids?: {
|
|
2410
|
+
email?: boolean;
|
|
2411
|
+
msisdn?: boolean;
|
|
2412
|
+
}, guestAccessToken?: string, inhibitLogin?: boolean): Promise<RegisterResponse>;
|
|
2413
|
+
/**
|
|
2414
|
+
* Register a guest account.
|
|
2415
|
+
* This method returns the auth info needed to create a new authenticated client,
|
|
2416
|
+
* Remember to call `setGuest(true)` on the (guest-)authenticated client, e.g:
|
|
2417
|
+
* ```javascript
|
|
2418
|
+
* const tmpClient = await sdk.createClient(MATRIX_INSTANCE);
|
|
2419
|
+
* const { user_id, device_id, access_token } = tmpClient.registerGuest();
|
|
2420
|
+
* const client = createClient({
|
|
2421
|
+
* baseUrl: MATRIX_INSTANCE,
|
|
2422
|
+
* accessToken: access_token,
|
|
2423
|
+
* userId: user_id,
|
|
2424
|
+
* deviceId: device_id,
|
|
2425
|
+
* })
|
|
2426
|
+
* client.setGuest(true);
|
|
2427
|
+
* ```
|
|
2428
|
+
*
|
|
2429
|
+
* @param body - JSON HTTP body to provide.
|
|
2430
|
+
* @returns Promise which resolves: JSON object that contains:
|
|
2431
|
+
* `{ user_id, device_id, access_token, home_server }`
|
|
2432
|
+
* @returns Rejects: with an error response.
|
|
2433
|
+
*/
|
|
2434
|
+
registerGuest({ body }?: {
|
|
2435
|
+
body?: RegisterRequest;
|
|
2436
|
+
}): Promise<RegisterResponse>;
|
|
2437
|
+
/**
|
|
2438
|
+
* @param data - parameters for registration request
|
|
2439
|
+
* @param kind - type of user to register. may be "guest"
|
|
2440
|
+
* @returns Promise which resolves: to the /register response
|
|
2441
|
+
* @returns Rejects: with an error response.
|
|
2442
|
+
*/
|
|
2443
|
+
registerRequest(data: RegisterRequest, kind?: string): Promise<RegisterResponse>;
|
|
2444
|
+
/**
|
|
2445
|
+
* Refreshes an access token using a provided refresh token. The refresh token
|
|
2446
|
+
* must be valid for the current access token known to the client instance.
|
|
2447
|
+
*
|
|
2448
|
+
* Note that this function will not cause a logout if the token is deemed
|
|
2449
|
+
* unknown by the server - the caller is responsible for managing logout
|
|
2450
|
+
* actions on error.
|
|
2451
|
+
* @param refreshToken - The refresh token.
|
|
2452
|
+
* @returns Promise which resolves to the new token.
|
|
2453
|
+
* @returns Rejects with an error response.
|
|
2454
|
+
*/
|
|
2455
|
+
refreshToken(refreshToken: string): Promise<IRefreshTokenResponse>;
|
|
2456
|
+
/**
|
|
2457
|
+
* @returns Promise which resolves to the available login flows
|
|
2458
|
+
* @returns Rejects: with an error response.
|
|
2459
|
+
*/
|
|
2460
|
+
loginFlows(): Promise<ILoginFlowsResponse>;
|
|
2461
|
+
/**
|
|
2462
|
+
* @returns Promise which resolves to a LoginResponse object
|
|
2463
|
+
* @returns Rejects: with an error response.
|
|
2464
|
+
*
|
|
2465
|
+
* @deprecated This method has unintuitive behaviour: it updates the `BriijClient` instance with *some* of the
|
|
2466
|
+
* returned credentials. Instead, call {@link loginRequest} and create a new `BriijClient` instance using the
|
|
2467
|
+
* results. See https://github.com/matrix-org/briij-js-sdk/issues/4502.
|
|
2468
|
+
*/
|
|
2469
|
+
login(loginType: LoginRequest["type"], data: Omit<LoginRequest, "type">): Promise<LoginResponse>;
|
|
2470
|
+
/**
|
|
2471
|
+
* @returns Promise which resolves to a LoginResponse object
|
|
2472
|
+
* @returns Rejects: with an error response.
|
|
2473
|
+
*
|
|
2474
|
+
* @deprecated This method has unintuitive behaviour: it updates the `BriijClient` instance with *some* of the
|
|
2475
|
+
* returned credentials. Instead, call {@link loginRequest} with `data.type: "m.login.password"`, and create a new
|
|
2476
|
+
* `BriijClient` instance using the results. See https://github.com/matrix-org/briij-js-sdk/issues/4502.
|
|
2477
|
+
*/
|
|
2478
|
+
loginWithPassword(user: string, password: string): Promise<LoginResponse>;
|
|
2479
|
+
/**
|
|
2480
|
+
* @param redirectUrl - The URL to redirect to after the HS
|
|
2481
|
+
* authenticates with CAS.
|
|
2482
|
+
* @returns The HS URL to hit to begin the CAS login process.
|
|
2483
|
+
*/
|
|
2484
|
+
getCasLoginUrl(redirectUrl: string): string;
|
|
2485
|
+
/**
|
|
2486
|
+
* @param redirectUrl - The URL to redirect to after the HS
|
|
2487
|
+
* authenticates with the SSO.
|
|
2488
|
+
* @param loginType - The type of SSO login we are doing (sso or cas).
|
|
2489
|
+
* Defaults to 'sso'.
|
|
2490
|
+
* @param idpId - The ID of the Identity Provider being targeted, optional.
|
|
2491
|
+
* @param action - the SSO flow to indicate to the IdP, optional.
|
|
2492
|
+
* @returns The HS URL to hit to begin the SSO login process.
|
|
2493
|
+
*/
|
|
2494
|
+
getSsoLoginUrl(redirectUrl: string, loginType?: string, idpId?: string, action?: SSOAction): string;
|
|
2495
|
+
/**
|
|
2496
|
+
* @param token - Login token previously received from homeserver
|
|
2497
|
+
* @returns Promise which resolves to a LoginResponse object
|
|
2498
|
+
* @returns Rejects: with an error response.
|
|
2499
|
+
*
|
|
2500
|
+
* @deprecated This method has unintuitive behaviour: it updates the `BriijClient` instance with *some* of the
|
|
2501
|
+
* returned credentials. Instead, call {@link loginRequest} with `data.type: "m.login.token"`, and create a new
|
|
2502
|
+
* `BriijClient` instance using the results. See https://github.com/matrix-org/briij-js-sdk/issues/4502.
|
|
2503
|
+
*/
|
|
2504
|
+
loginWithToken(token: string): Promise<LoginResponse>;
|
|
2505
|
+
/**
|
|
2506
|
+
* Sends a `POST /login` request to the server.
|
|
2507
|
+
*
|
|
2508
|
+
* If successful, this will create a new device and access token for the user.
|
|
2509
|
+
*
|
|
2510
|
+
* @see {@link BriijClient.loginFlows} which makes a `GET /login` request.
|
|
2511
|
+
* @see https://spec.matrix.org/v1.13/client-server-api/#post_matrixclientv3login
|
|
2512
|
+
*
|
|
2513
|
+
* @param data - Credentials and other details for the login request.
|
|
2514
|
+
*/
|
|
2515
|
+
loginRequest(data: LoginRequest): Promise<LoginResponse>;
|
|
2516
|
+
/**
|
|
2517
|
+
* Logs out the current session.
|
|
2518
|
+
* Obviously, further calls that require authorisation should fail after this
|
|
2519
|
+
* method is called. The state of the BriijClient object is not affected:
|
|
2520
|
+
* it is up to the caller to either reset or destroy the BriijClient after
|
|
2521
|
+
* this method succeeds.
|
|
2522
|
+
* @param stopClient - whether to stop the client before calling /logout to prevent invalid token errors.
|
|
2523
|
+
* @returns Promise which resolves: On success, the empty object `{}`
|
|
2524
|
+
*/
|
|
2525
|
+
logout(stopClient?: boolean): Promise<EmptyObject>;
|
|
2526
|
+
/**
|
|
2527
|
+
* Deactivates the logged-in account.
|
|
2528
|
+
* Obviously, further calls that require authorisation should fail after this
|
|
2529
|
+
* method is called. The state of the BriijClient object is not affected:
|
|
2530
|
+
* it is up to the caller to either reset or destroy the BriijClient after
|
|
2531
|
+
* this method succeeds.
|
|
2532
|
+
* @param auth - Optional. Auth data to supply for User-Interactive auth.
|
|
2533
|
+
* @param erase - Optional. If set, send as `erase` attribute in the
|
|
2534
|
+
* JSON request body, indicating whether the account should be erased. Defaults
|
|
2535
|
+
* to false.
|
|
2536
|
+
* @returns Promise which resolves: On success, the empty object
|
|
2537
|
+
*/
|
|
2538
|
+
deactivateAccount(auth?: AuthDict, erase?: boolean): Promise<{
|
|
2539
|
+
id_server_unbind_result: IdServerUnbindResult;
|
|
2540
|
+
}>;
|
|
2541
|
+
/**
|
|
2542
|
+
* Make a request for an `m.login.token` to be issued as per
|
|
2543
|
+
* https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv1loginget_token
|
|
2544
|
+
*
|
|
2545
|
+
* The server may require User-Interactive auth.
|
|
2546
|
+
*
|
|
2547
|
+
* @param auth - Optional. Auth data to supply for User-Interactive auth.
|
|
2548
|
+
* @returns Promise which resolves: On success, the token response
|
|
2549
|
+
* or UIA auth data.
|
|
2550
|
+
*/
|
|
2551
|
+
requestLoginToken(auth?: AuthDict): Promise<LoginTokenPostResponse>;
|
|
2552
|
+
/**
|
|
2553
|
+
* Get the fallback URL to use for unknown interactive-auth stages.
|
|
2554
|
+
*
|
|
2555
|
+
* @param loginType - the type of stage being attempted
|
|
2556
|
+
* @param authSessionId - the auth session ID provided by the homeserver
|
|
2557
|
+
*
|
|
2558
|
+
* @returns HS URL to hit to for the fallback interface
|
|
2559
|
+
*/
|
|
2560
|
+
getFallbackAuthUrl(loginType: string, authSessionId: string): string;
|
|
2561
|
+
/**
|
|
2562
|
+
* Create a new room.
|
|
2563
|
+
* @param options - a list of options to pass to the /createRoom API.
|
|
2564
|
+
* @returns Promise which resolves: `{room_id: {string}}`
|
|
2565
|
+
* @returns Rejects: with an error response.
|
|
2566
|
+
*/
|
|
2567
|
+
createRoom(options: ICreateRoomOpts): Promise<{
|
|
2568
|
+
room_id: string;
|
|
2569
|
+
}>;
|
|
2570
|
+
/**
|
|
2571
|
+
* Fetches relations for a given event
|
|
2572
|
+
* @param roomId - the room of the event
|
|
2573
|
+
* @param eventId - the id of the event
|
|
2574
|
+
* @param relationType - the rel_type of the relations requested
|
|
2575
|
+
* @param eventType - the event type of the relations requested
|
|
2576
|
+
* @param opts - options with optional values for the request.
|
|
2577
|
+
* @returns the response, with chunk, prev_batch and, next_batch.
|
|
2578
|
+
*/
|
|
2579
|
+
fetchRelations(roomId: string, eventId: string, relationType: RelationType | string | null, eventType?: EventType | string | null, opts?: IRelationsRequestOpts): Promise<IRelationsResponse>;
|
|
2580
|
+
/**
|
|
2581
|
+
* @returns Promise which resolves: TODO
|
|
2582
|
+
* @returns Rejects: with an error response.
|
|
2583
|
+
*/
|
|
2584
|
+
roomState(roomId: string): Promise<IStateEventWithRoomId[]>;
|
|
2585
|
+
/**
|
|
2586
|
+
* Get an event in a room by its event id.
|
|
2587
|
+
*
|
|
2588
|
+
* @returns Promise which resolves to an object containing the event.
|
|
2589
|
+
* @returns Rejects: with an error response.
|
|
2590
|
+
*/
|
|
2591
|
+
fetchRoomEvent(roomId: string, eventId: string): Promise<Partial<IEvent>>;
|
|
2592
|
+
/**
|
|
2593
|
+
* @param includeMembership - the membership type to include in the response
|
|
2594
|
+
* @param excludeMembership - the membership type to exclude from the response
|
|
2595
|
+
* @param atEventId - the id of the event for which moment in the timeline the members should be returned for
|
|
2596
|
+
* @returns Promise which resolves: dictionary of userid to profile information
|
|
2597
|
+
* @returns Rejects: with an error response.
|
|
2598
|
+
*/
|
|
2599
|
+
members(roomId: string, includeMembership?: string, excludeMembership?: string, atEventId?: string): Promise<{
|
|
2600
|
+
[userId: string]: IStateEventWithRoomId[];
|
|
2601
|
+
}>;
|
|
2602
|
+
/**
|
|
2603
|
+
* Upgrades a room to a new protocol version
|
|
2604
|
+
* @param newVersion - The target version to upgrade to
|
|
2605
|
+
* @param additionalCreators - an optional list of user IDs of users who
|
|
2606
|
+
* should have the same permissions as the user performing the
|
|
2607
|
+
* upgrade
|
|
2608
|
+
* @returns Promise which resolves: Object with key 'replacement_room'
|
|
2609
|
+
* @returns Rejects: with an error response.
|
|
2610
|
+
*/
|
|
2611
|
+
upgradeRoom(roomId: string, newVersion: string, additionalCreators?: string[]): Promise<{
|
|
2612
|
+
replacement_room: string;
|
|
2613
|
+
}>;
|
|
2614
|
+
/**
|
|
2615
|
+
* Retrieve a state event.
|
|
2616
|
+
* @returns Promise which resolves: TODO
|
|
2617
|
+
* @returns Rejects: with an error response.
|
|
2618
|
+
*/
|
|
2619
|
+
getStateEvent(roomId: string, eventType: string, stateKey: string): Promise<Record<string, any>>;
|
|
2620
|
+
/**
|
|
2621
|
+
* Send a state event into a room
|
|
2622
|
+
* @param roomId - ID of the room to send the event into
|
|
2623
|
+
* @param eventType - type of the state event to send
|
|
2624
|
+
* @param content - content of the event to send
|
|
2625
|
+
* @param stateKey - the stateKey to send into the room
|
|
2626
|
+
* @param opts - Options for the request function.
|
|
2627
|
+
* @returns Promise which resolves: TODO
|
|
2628
|
+
* @returns Rejects: with an error response.
|
|
2629
|
+
*/
|
|
2630
|
+
sendStateEvent<K extends keyof StateEvents>(roomId: string, eventType: K, content: StateEvents[K], stateKey?: string, opts?: IRequestOpts): Promise<ISendEventResponse>;
|
|
2631
|
+
private encryptStateEventIfNeeded;
|
|
2632
|
+
/**
|
|
2633
|
+
* @returns Promise which resolves: TODO
|
|
2634
|
+
* @returns Rejects: with an error response.
|
|
2635
|
+
*/
|
|
2636
|
+
roomInitialSync(roomId: string, limit: number): Promise<IRoomInitialSyncResponse>;
|
|
2637
|
+
/**
|
|
2638
|
+
* Set a marker to indicate the point in a room before which the user has read every
|
|
2639
|
+
* event. This can be retrieved from room account data (the event type is `m.fully_read`)
|
|
2640
|
+
* and displayed as a horizontal line in the timeline that is visually distinct to the
|
|
2641
|
+
* position of the user's own read receipt.
|
|
2642
|
+
* @param roomId - ID of the room that has been read
|
|
2643
|
+
* @param rmEventId - ID of the event that has been read
|
|
2644
|
+
* @param rrEventId - ID of the event tracked by the read receipt. This is here
|
|
2645
|
+
* for convenience because the RR and the RM are commonly updated at the same time as
|
|
2646
|
+
* each other. Optional.
|
|
2647
|
+
* @param rpEventId - rpEvent the m.read.private read receipt event for when we
|
|
2648
|
+
* don't want other users to see the read receipts. This is experimental. Optional.
|
|
2649
|
+
* @returns Promise which resolves: the empty object, `{}`.
|
|
2650
|
+
*/
|
|
2651
|
+
setRoomReadMarkersHttpRequest(roomId: string, rmEventId: string, rrEventId?: string, rpEventId?: string): Promise<EmptyObject>;
|
|
2652
|
+
/**
|
|
2653
|
+
* @returns Promise which resolves: A list of the user's current rooms
|
|
2654
|
+
* @returns Rejects: with an error response.
|
|
2655
|
+
*/
|
|
2656
|
+
getJoinedRooms(): Promise<IJoinedRoomsResponse>;
|
|
2657
|
+
/**
|
|
2658
|
+
* Retrieve membership info. for a room.
|
|
2659
|
+
* @param roomId - ID of the room to get membership for
|
|
2660
|
+
* @returns Promise which resolves: A list of currently joined users
|
|
2661
|
+
* and their profile data.
|
|
2662
|
+
* @returns Rejects: with an error response.
|
|
2663
|
+
*/
|
|
2664
|
+
getJoinedRoomMembers(roomId: string): Promise<IJoinedMembersResponse>;
|
|
2665
|
+
/**
|
|
2666
|
+
* Get the public rooms list from the server. Supports pagination
|
|
2667
|
+
* @param params - Options for this request
|
|
2668
|
+
* @returns Promise which resolves: IPublicRoomsResponse
|
|
2669
|
+
* @returns Rejects: with an error response.
|
|
2670
|
+
* @throws May throw a `BriijSafetyError` if content is deemed unsafe.
|
|
2671
|
+
* @see BriijSafetyError
|
|
2672
|
+
*/
|
|
2673
|
+
publicRooms({ server, limit, since, ...options }?: IRoomDirectoryOptions): Promise<IPublicRoomsResponse>;
|
|
2674
|
+
/**
|
|
2675
|
+
* Create an alias to room ID mapping.
|
|
2676
|
+
* @param alias - The room alias to create.
|
|
2677
|
+
* @param roomId - The room ID to link the alias to.
|
|
2678
|
+
* @returns Promise which resolves: an empty object `{}`
|
|
2679
|
+
* @returns Rejects: with an error response.
|
|
2680
|
+
*/
|
|
2681
|
+
createAlias(alias: string, roomId: string): Promise<EmptyObject>;
|
|
2682
|
+
/**
|
|
2683
|
+
* Delete an alias to room ID mapping. This alias must be on your local server,
|
|
2684
|
+
* and you must have sufficient access to do this operation.
|
|
2685
|
+
* @param alias - The room alias to delete.
|
|
2686
|
+
* @returns Promise which resolves: an empty object `{}`.
|
|
2687
|
+
* @returns Rejects: with an error response.
|
|
2688
|
+
*/
|
|
2689
|
+
deleteAlias(alias: string): Promise<EmptyObject>;
|
|
2690
|
+
/**
|
|
2691
|
+
* Gets the local aliases for the room. Note: this includes all local aliases, unlike the
|
|
2692
|
+
* curated list from the m.room.canonical_alias state event.
|
|
2693
|
+
* @param roomId - The room ID to get local aliases for.
|
|
2694
|
+
* @returns Promise which resolves: an object with an `aliases` property, containing an array of local aliases
|
|
2695
|
+
* @returns Rejects: with an error response.
|
|
2696
|
+
*/
|
|
2697
|
+
getLocalAliases(roomId: string): Promise<{
|
|
2698
|
+
aliases: string[];
|
|
2699
|
+
}>;
|
|
2700
|
+
/**
|
|
2701
|
+
* Get room info for the given alias.
|
|
2702
|
+
* @param alias - The room alias to resolve.
|
|
2703
|
+
* @returns Promise which resolves: Object with room_id and servers.
|
|
2704
|
+
* @returns Rejects: with an error response.
|
|
2705
|
+
*/
|
|
2706
|
+
getRoomIdForAlias(alias: string): Promise<{
|
|
2707
|
+
room_id: string;
|
|
2708
|
+
servers: string[];
|
|
2709
|
+
}>;
|
|
2710
|
+
/**
|
|
2711
|
+
* Get the visibility of a room in the current HS's room directory
|
|
2712
|
+
* @returns Promise which resolves: TODO
|
|
2713
|
+
* @returns Rejects: with an error response.
|
|
2714
|
+
*/
|
|
2715
|
+
getRoomDirectoryVisibility(roomId: string): Promise<{
|
|
2716
|
+
visibility: Visibility;
|
|
2717
|
+
}>;
|
|
2718
|
+
/**
|
|
2719
|
+
* Set the visibility of a room in the current HS's room directory
|
|
2720
|
+
* @param visibility - "public" to make the room visible
|
|
2721
|
+
* in the public directory, or "private" to make
|
|
2722
|
+
* it invisible.
|
|
2723
|
+
* @returns Promise which resolves: to an empty object `{}`
|
|
2724
|
+
* @returns Rejects: with an error response.
|
|
2725
|
+
*/
|
|
2726
|
+
setRoomDirectoryVisibility(roomId: string, visibility: Visibility): Promise<EmptyObject>;
|
|
2727
|
+
/**
|
|
2728
|
+
* Query the user directory with a term matching user IDs, display names and domains.
|
|
2729
|
+
* @param options
|
|
2730
|
+
* @param options.term - the term with which to search.
|
|
2731
|
+
* @param options.limit - the maximum number of results to return. The server will apply a limit if unspecified.
|
|
2732
|
+
* @returns Promise which resolves: an array of results.
|
|
2733
|
+
*/
|
|
2734
|
+
searchUserDirectory({ term, limit }: {
|
|
2735
|
+
term: string;
|
|
2736
|
+
limit?: number;
|
|
2737
|
+
}): Promise<IUserDirectoryResponse>;
|
|
2738
|
+
/**
|
|
2739
|
+
* Upload a file to the media repository on the homeserver.
|
|
2740
|
+
*
|
|
2741
|
+
* @param file - The object to upload. On a browser, something that
|
|
2742
|
+
* can be sent to XMLHttpRequest.send (typically a File). Under node.js,
|
|
2743
|
+
* a a Buffer, String or ReadStream.
|
|
2744
|
+
*
|
|
2745
|
+
* @param opts - options object
|
|
2746
|
+
*
|
|
2747
|
+
* @returns Promise which resolves to response object, or rejects with an error (usually a BriijError).
|
|
2748
|
+
*/
|
|
2749
|
+
uploadContent(file: FileType, opts?: UploadOpts): Promise<UploadResponse>;
|
|
2750
|
+
/**
|
|
2751
|
+
* Cancel a file upload in progress
|
|
2752
|
+
* @param upload - The object returned from uploadContent
|
|
2753
|
+
* @returns true if canceled, otherwise false
|
|
2754
|
+
*/
|
|
2755
|
+
cancelUpload(upload: Promise<UploadResponse>): boolean;
|
|
2756
|
+
/**
|
|
2757
|
+
* Get a list of all file uploads in progress
|
|
2758
|
+
* @returns Array of objects representing current uploads.
|
|
2759
|
+
* Currently in progress is element 0. Keys:
|
|
2760
|
+
* - promise: The promise associated with the upload
|
|
2761
|
+
* - loaded: Number of bytes uploaded
|
|
2762
|
+
* - total: Total number of bytes to upload
|
|
2763
|
+
*/
|
|
2764
|
+
getCurrentUploads(): Upload[];
|
|
2765
|
+
/**
|
|
2766
|
+
* @param info - The kind of info to retrieve (e.g. 'displayname',
|
|
2767
|
+
* 'avatar_url').
|
|
2768
|
+
* @returns Promise which resolves: TODO
|
|
2769
|
+
* @returns Rejects: with an error response.
|
|
2770
|
+
*/
|
|
2771
|
+
getProfileInfo(userId: string, info?: string): Promise<{
|
|
2772
|
+
avatar_url?: string;
|
|
2773
|
+
displayname?: string;
|
|
2774
|
+
}>;
|
|
2775
|
+
/**
|
|
2776
|
+
* Determine if the server supports extended profiles, as described by MSC4133.
|
|
2777
|
+
*
|
|
2778
|
+
* @returns `true` if supported, otherwise `false`
|
|
2779
|
+
*/
|
|
2780
|
+
doesServerSupportExtendedProfiles(): Promise<boolean>;
|
|
2781
|
+
/**
|
|
2782
|
+
* Get the prefix used for extended profile requests.
|
|
2783
|
+
*
|
|
2784
|
+
* @returns The prefix for use with `authedRequest`
|
|
2785
|
+
*/
|
|
2786
|
+
private getExtendedProfileRequestPrefix;
|
|
2787
|
+
/**
|
|
2788
|
+
* Fetch a user's *extended* profile, which may include additional keys.
|
|
2789
|
+
*
|
|
2790
|
+
* @see https://github.com/tcpipuk/matrix-spec-proposals/blob/main/proposals/4133-extended-profiles.md
|
|
2791
|
+
* @param userId The user ID to fetch the profile of.
|
|
2792
|
+
* @returns A set of keys to property values.
|
|
2793
|
+
*
|
|
2794
|
+
* @throws An error if the server does not support MSC4133.
|
|
2795
|
+
* @throws A M_NOT_FOUND error if the profile could not be found.
|
|
2796
|
+
*/
|
|
2797
|
+
getExtendedProfile(userId: string): Promise<Record<string, unknown>>;
|
|
2798
|
+
/**
|
|
2799
|
+
* Fetch a specific key from the user's *extended* profile.
|
|
2800
|
+
*
|
|
2801
|
+
* @see https://github.com/tcpipuk/matrix-spec-proposals/blob/main/proposals/4133-extended-profiles.md
|
|
2802
|
+
* @param userId The user ID to fetch the profile of.
|
|
2803
|
+
* @param key The key of the property to fetch.
|
|
2804
|
+
* @returns The property value.
|
|
2805
|
+
*
|
|
2806
|
+
* @throws An error if the server does not support MSC4133.
|
|
2807
|
+
* @throws A M_NOT_FOUND error if the key was not set OR the profile could not be found.
|
|
2808
|
+
*/
|
|
2809
|
+
getExtendedProfileProperty(userId: string, key: string): Promise<unknown>;
|
|
2810
|
+
/**
|
|
2811
|
+
* Set a property on your *extended* profile.
|
|
2812
|
+
*
|
|
2813
|
+
* @see https://github.com/tcpipuk/matrix-spec-proposals/blob/main/proposals/4133-extended-profiles.md
|
|
2814
|
+
* @param key The key of the property to set.
|
|
2815
|
+
* @param value The value to set on the property.
|
|
2816
|
+
*
|
|
2817
|
+
* @throws An error if the server does not support MSC4133 OR the server disallows editing the user profile.
|
|
2818
|
+
*/
|
|
2819
|
+
setExtendedProfileProperty(key: string, value: unknown): Promise<void>;
|
|
2820
|
+
/**
|
|
2821
|
+
* Delete a property on your *extended* profile.
|
|
2822
|
+
*
|
|
2823
|
+
* @see https://github.com/tcpipuk/matrix-spec-proposals/blob/main/proposals/4133-extended-profiles.md
|
|
2824
|
+
* @param key The key of the property to delete.
|
|
2825
|
+
*
|
|
2826
|
+
* @throws An error if the server does not support MSC4133 OR the server disallows editing the user profile.
|
|
2827
|
+
*/
|
|
2828
|
+
deleteExtendedProfileProperty(key: string): Promise<void>;
|
|
2829
|
+
/**
|
|
2830
|
+
* Update multiple properties on your *extended* profile. This will
|
|
2831
|
+
* merge with any existing keys.
|
|
2832
|
+
*
|
|
2833
|
+
* @see https://github.com/tcpipuk/matrix-spec-proposals/blob/main/proposals/4133-extended-profiles.md
|
|
2834
|
+
* @param profile The profile object to merge with the existing profile.
|
|
2835
|
+
* @returns The newly merged profile.
|
|
2836
|
+
*
|
|
2837
|
+
* @throws An error if the server does not support MSC4133 OR the server disallows editing the user profile.
|
|
2838
|
+
*/
|
|
2839
|
+
patchExtendedProfile(profile: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
2840
|
+
/**
|
|
2841
|
+
* Set multiple properties on your *extended* profile. This will completely
|
|
2842
|
+
* replace the existing profile, removing any unspecified keys.
|
|
2843
|
+
*
|
|
2844
|
+
* @see https://github.com/tcpipuk/matrix-spec-proposals/blob/main/proposals/4133-extended-profiles.md
|
|
2845
|
+
* @param profile The profile object to set.
|
|
2846
|
+
*
|
|
2847
|
+
* @throws An error if the server does not support MSC4133 OR the server disallows editing the user profile.
|
|
2848
|
+
*/
|
|
2849
|
+
setExtendedProfile(profile: Record<string, unknown>): Promise<void>;
|
|
2850
|
+
/**
|
|
2851
|
+
* @returns Promise which resolves to a list of the user's threepids.
|
|
2852
|
+
* @returns Rejects: with an error response.
|
|
2853
|
+
*/
|
|
2854
|
+
getThreePids(): Promise<{
|
|
2855
|
+
threepids: IThreepid[];
|
|
2856
|
+
}>;
|
|
2857
|
+
/**
|
|
2858
|
+
* Add a 3PID to your homeserver account. This API does not use an identity
|
|
2859
|
+
* server, as the homeserver is expected to handle 3PID ownership validation.
|
|
2860
|
+
*
|
|
2861
|
+
* @param data - A object with 3PID validation data from having called
|
|
2862
|
+
* `account/3pid/<medium>/requestToken` on the homeserver.
|
|
2863
|
+
* @returns Promise which resolves: to an empty object `{}`
|
|
2864
|
+
* @returns Rejects: with an error response.
|
|
2865
|
+
*/
|
|
2866
|
+
addThreePidOnly(data: IAddThreePidOnlyBody): Promise<EmptyObject>;
|
|
2867
|
+
/**
|
|
2868
|
+
* Bind a 3PID for discovery onto an identity server via the homeserver. The
|
|
2869
|
+
* identity server handles 3PID ownership validation and the homeserver records
|
|
2870
|
+
* the new binding to track where all 3PIDs for the account are bound.
|
|
2871
|
+
*
|
|
2872
|
+
* @param data - A object with 3PID validation data from having called
|
|
2873
|
+
* `validate/<medium>/requestToken` on the identity server. It should also
|
|
2874
|
+
* contain `id_server` and `id_access_token` fields as well.
|
|
2875
|
+
* @returns Promise which resolves: to an empty object `{}`
|
|
2876
|
+
* @returns Rejects: with an error response.
|
|
2877
|
+
*/
|
|
2878
|
+
bindThreePid(data: IBindThreePidBody): Promise<EmptyObject>;
|
|
2879
|
+
/**
|
|
2880
|
+
* Unbind a 3PID for discovery on an identity server via the homeserver. The
|
|
2881
|
+
* homeserver removes its record of the binding to keep an updated record of
|
|
2882
|
+
* where all 3PIDs for the account are bound.
|
|
2883
|
+
*
|
|
2884
|
+
* @param medium - The threepid medium (eg. 'email')
|
|
2885
|
+
* @param address - The threepid address (eg. 'bob\@example.com')
|
|
2886
|
+
* this must be as returned by getThreePids.
|
|
2887
|
+
* @returns Promise which resolves: on success
|
|
2888
|
+
* @returns Rejects: with an error response.
|
|
2889
|
+
*/
|
|
2890
|
+
unbindThreePid(medium: string, address: string): Promise<{
|
|
2891
|
+
id_server_unbind_result: IdServerUnbindResult;
|
|
2892
|
+
}>;
|
|
2893
|
+
/**
|
|
2894
|
+
* @param medium - The threepid medium (eg. 'email')
|
|
2895
|
+
* @param address - The threepid address (eg. 'bob\@example.com')
|
|
2896
|
+
* this must be as returned by getThreePids.
|
|
2897
|
+
* @returns Promise which resolves: The server response on success
|
|
2898
|
+
* (generally the empty JSON object)
|
|
2899
|
+
* @returns Rejects: with an error response.
|
|
2900
|
+
*/
|
|
2901
|
+
deleteThreePid(medium: string, address: string): Promise<{
|
|
2902
|
+
id_server_unbind_result: IdServerUnbindResult;
|
|
2903
|
+
}>;
|
|
2904
|
+
/**
|
|
2905
|
+
* Make a request to change your password.
|
|
2906
|
+
* @param newPassword - The new desired password.
|
|
2907
|
+
* @param logoutDevices - Should all sessions be logged out after the password change. Defaults to true.
|
|
2908
|
+
* @returns Promise which resolves: to an empty object `{}`
|
|
2909
|
+
* @returns Rejects: with an error response.
|
|
2910
|
+
*/
|
|
2911
|
+
setPassword(authDict: AuthDict, newPassword: string, logoutDevices?: boolean): Promise<EmptyObject>;
|
|
2912
|
+
/**
|
|
2913
|
+
* Gets all devices recorded for the logged-in user
|
|
2914
|
+
* @returns Promise which resolves: result object
|
|
2915
|
+
* @returns Rejects: with an error response.
|
|
2916
|
+
*/
|
|
2917
|
+
getDevices(): Promise<{
|
|
2918
|
+
devices: IMyDevice[];
|
|
2919
|
+
}>;
|
|
2920
|
+
/**
|
|
2921
|
+
* Gets specific device details for the logged-in user
|
|
2922
|
+
* @param deviceId - device to query
|
|
2923
|
+
* @returns Promise which resolves: result object
|
|
2924
|
+
* @returns Rejects: with an error response.
|
|
2925
|
+
*/
|
|
2926
|
+
getDevice(deviceId: string): Promise<IMyDevice>;
|
|
2927
|
+
/**
|
|
2928
|
+
* Update the given device
|
|
2929
|
+
*
|
|
2930
|
+
* @param deviceId - device to update
|
|
2931
|
+
* @param body - body of request
|
|
2932
|
+
* @returns Promise which resolves: to an empty object `{}`
|
|
2933
|
+
* @returns Rejects: with an error response.
|
|
2934
|
+
*/
|
|
2935
|
+
setDeviceDetails(deviceId: string, body: {
|
|
2936
|
+
display_name: string;
|
|
2937
|
+
}): Promise<EmptyObject>;
|
|
2938
|
+
/**
|
|
2939
|
+
* Delete the given device
|
|
2940
|
+
*
|
|
2941
|
+
* @param deviceId - device to delete
|
|
2942
|
+
* @param auth - Optional. Auth data to supply for User-Interactive auth.
|
|
2943
|
+
* @returns Promise which resolves: result object
|
|
2944
|
+
* @returns Rejects: with an error response.
|
|
2945
|
+
*/
|
|
2946
|
+
deleteDevice(deviceId: string, auth?: AuthDict): Promise<EmptyObject>;
|
|
2947
|
+
/**
|
|
2948
|
+
* Delete multiple device
|
|
2949
|
+
*
|
|
2950
|
+
* @param devices - IDs of the devices to delete
|
|
2951
|
+
* @param auth - Optional. Auth data to supply for User-Interactive auth.
|
|
2952
|
+
* @returns Promise which resolves: result object
|
|
2953
|
+
* @returns Rejects: with an error response.
|
|
2954
|
+
*/
|
|
2955
|
+
deleteMultipleDevices(devices: string[], auth?: AuthDict): Promise<EmptyObject>;
|
|
2956
|
+
/**
|
|
2957
|
+
* Gets all pushers registered for the logged-in user
|
|
2958
|
+
*
|
|
2959
|
+
* @returns Promise which resolves: Array of objects representing pushers
|
|
2960
|
+
* @returns Rejects: with an error response.
|
|
2961
|
+
*/
|
|
2962
|
+
getPushers(): Promise<{
|
|
2963
|
+
pushers: IPusher[];
|
|
2964
|
+
}>;
|
|
2965
|
+
/**
|
|
2966
|
+
* Adds a new pusher or updates an existing pusher
|
|
2967
|
+
*
|
|
2968
|
+
* @param pusher - Object representing a pusher
|
|
2969
|
+
* @returns Promise which resolves: Empty json object on success
|
|
2970
|
+
* @returns Rejects: with an error response.
|
|
2971
|
+
*/
|
|
2972
|
+
setPusher(pusher: IPusherRequest): Promise<EmptyObject>;
|
|
2973
|
+
/**
|
|
2974
|
+
* Removes an existing pusher
|
|
2975
|
+
* @param pushKey - pushkey of pusher to remove
|
|
2976
|
+
* @param appId - app_id of pusher to remove
|
|
2977
|
+
* @returns Promise which resolves: Empty json object on success
|
|
2978
|
+
* @returns Rejects: with an error response.
|
|
2979
|
+
*/
|
|
2980
|
+
removePusher(pushKey: string, appId: string): Promise<EmptyObject>;
|
|
2981
|
+
/**
|
|
2982
|
+
* Persists local notification settings
|
|
2983
|
+
* @returns Promise which resolves: an empty object
|
|
2984
|
+
* @returns Rejects: with an error response.
|
|
2985
|
+
*/
|
|
2986
|
+
setLocalNotificationSettings(deviceId: string, notificationSettings: LocalNotificationSettings): Promise<EmptyObject>;
|
|
2987
|
+
/**
|
|
2988
|
+
* Get the push rules for the account from the server.
|
|
2989
|
+
* @returns Promise which resolves to the push rules.
|
|
2990
|
+
* @returns Rejects: with an error response.
|
|
2991
|
+
*/
|
|
2992
|
+
getPushRules(): Promise<IPushRules>;
|
|
2993
|
+
/**
|
|
2994
|
+
* Update the push rules for the account. This should be called whenever
|
|
2995
|
+
* updated push rules are available.
|
|
2996
|
+
*/
|
|
2997
|
+
setPushRules(rules: IPushRules): void;
|
|
2998
|
+
/**
|
|
2999
|
+
* @returns Promise which resolves: an empty object `{}`
|
|
3000
|
+
* @returns Rejects: with an error response.
|
|
3001
|
+
*/
|
|
3002
|
+
addPushRule(scope: string, kind: PushRuleKind, ruleId: Exclude<string, RuleId>, body: Pick<IPushRule, "actions" | "conditions" | "pattern">): Promise<EmptyObject>;
|
|
3003
|
+
/**
|
|
3004
|
+
* @returns Promise which resolves: an empty object `{}`
|
|
3005
|
+
* @returns Rejects: with an error response.
|
|
3006
|
+
*/
|
|
3007
|
+
deletePushRule(scope: string, kind: PushRuleKind, ruleId: Exclude<string, RuleId>): Promise<EmptyObject>;
|
|
3008
|
+
/**
|
|
3009
|
+
* Enable or disable a push notification rule.
|
|
3010
|
+
* @returns Promise which resolves: to an empty object `{}`
|
|
3011
|
+
* @returns Rejects: with an error response.
|
|
3012
|
+
*/
|
|
3013
|
+
setPushRuleEnabled(scope: string, kind: PushRuleKind, ruleId: RuleId | string, enabled: boolean): Promise<EmptyObject>;
|
|
3014
|
+
/**
|
|
3015
|
+
* Set the actions for a push notification rule.
|
|
3016
|
+
* @returns Promise which resolves: to an empty object `{}`
|
|
3017
|
+
* @returns Rejects: with an error response.
|
|
3018
|
+
*/
|
|
3019
|
+
setPushRuleActions(scope: string, kind: PushRuleKind, ruleId: RuleId | string, actions: PushRuleAction[]): Promise<EmptyObject>;
|
|
3020
|
+
/**
|
|
3021
|
+
* Perform a server-side search.
|
|
3022
|
+
* @param params
|
|
3023
|
+
* @param params.next_batch - the batch token to pass in the query string
|
|
3024
|
+
* @param params.body - the JSON object to pass to the request body.
|
|
3025
|
+
* @param abortSignal - optional signal used to cancel the http request.
|
|
3026
|
+
* @returns Promise which resolves to the search response object.
|
|
3027
|
+
* @returns Rejects: with an error response.
|
|
3028
|
+
*/
|
|
3029
|
+
search({ body, next_batch: nextBatch }: {
|
|
3030
|
+
body: ISearchRequestBody;
|
|
3031
|
+
next_batch?: string;
|
|
3032
|
+
}, abortSignal?: AbortSignal): Promise<ISearchResponse>;
|
|
3033
|
+
/**
|
|
3034
|
+
* Upload keys
|
|
3035
|
+
*
|
|
3036
|
+
* @param content - body of upload request
|
|
3037
|
+
*
|
|
3038
|
+
* @param opts - this method no longer takes any opts,
|
|
3039
|
+
* used to take opts.device_id but this was not removed from the spec as a redundant parameter
|
|
3040
|
+
*
|
|
3041
|
+
* @returns Promise which resolves: result object. Rejects: with
|
|
3042
|
+
* an error response ({@link BriijError}).
|
|
3043
|
+
*/
|
|
3044
|
+
uploadKeysRequest(content: IUploadKeysRequest, opts?: void): Promise<IKeysUploadResponse>;
|
|
3045
|
+
uploadKeySignatures(content: KeySignatures): Promise<IUploadKeySignaturesResponse>;
|
|
3046
|
+
/**
|
|
3047
|
+
* Download device keys
|
|
3048
|
+
*
|
|
3049
|
+
* @param userIds - list of users to get keys for
|
|
3050
|
+
*
|
|
3051
|
+
* @param token - sync token to pass in the query request, to help
|
|
3052
|
+
* the HS give the most recent results
|
|
3053
|
+
*
|
|
3054
|
+
* @returns Promise which resolves: result object. Rejects: with
|
|
3055
|
+
* an error response ({@link BriijError}).
|
|
3056
|
+
*/
|
|
3057
|
+
downloadKeysForUsers(userIds: string[], { token }?: {
|
|
3058
|
+
token?: string;
|
|
3059
|
+
}): Promise<IDownloadKeyResult>;
|
|
3060
|
+
/**
|
|
3061
|
+
* Claim one-time keys
|
|
3062
|
+
*
|
|
3063
|
+
* @param devices - a list of [userId, deviceId] pairs
|
|
3064
|
+
*
|
|
3065
|
+
* @param keyAlgorithm - desired key type
|
|
3066
|
+
*
|
|
3067
|
+
* @param timeout - the time (in milliseconds) to wait for keys from remote
|
|
3068
|
+
* servers
|
|
3069
|
+
*
|
|
3070
|
+
* @returns Promise which resolves: result object. Rejects: with
|
|
3071
|
+
* an error response ({@link BriijError}).
|
|
3072
|
+
*/
|
|
3073
|
+
claimOneTimeKeys(devices: [string, string][], keyAlgorithm?: string, timeout?: number): Promise<IClaimOTKsResult>;
|
|
3074
|
+
/**
|
|
3075
|
+
* Ask the server for a list of users who have changed their device lists
|
|
3076
|
+
* between a pair of sync tokens
|
|
3077
|
+
*
|
|
3078
|
+
*
|
|
3079
|
+
* @returns Promise which resolves: result object. Rejects: with
|
|
3080
|
+
* an error response ({@link BriijError}).
|
|
3081
|
+
*/
|
|
3082
|
+
getKeyChanges(oldToken: string, newToken: string): Promise<{
|
|
3083
|
+
changed: string[];
|
|
3084
|
+
left: string[];
|
|
3085
|
+
}>;
|
|
3086
|
+
uploadDeviceSigningKeys(auth?: AuthDict, keys?: CrossSigningKeys): Promise<EmptyObject>;
|
|
3087
|
+
/**
|
|
3088
|
+
* Register with an identity server using the OpenID token from the user's
|
|
3089
|
+
* Homeserver, which can be retrieved via
|
|
3090
|
+
* {@link BriijClient#getOpenIdToken}.
|
|
3091
|
+
*
|
|
3092
|
+
* Note that the `/account/register` endpoint (as well as IS authentication in
|
|
3093
|
+
* general) was added as part of the v2 API version.
|
|
3094
|
+
*
|
|
3095
|
+
* @returns Promise which resolves: with object containing an Identity
|
|
3096
|
+
* Server access token.
|
|
3097
|
+
* @returns Rejects: with an error response.
|
|
3098
|
+
*/
|
|
3099
|
+
registerWithIdentityServer(hsOpenIdToken: IOpenIDToken): Promise<{
|
|
3100
|
+
access_token: string;
|
|
3101
|
+
token: string;
|
|
3102
|
+
}>;
|
|
3103
|
+
/**
|
|
3104
|
+
* Requests an email verification token directly from an identity server.
|
|
3105
|
+
*
|
|
3106
|
+
* This API is used as part of binding an email for discovery on an identity
|
|
3107
|
+
* server. The validation data that results should be passed to the
|
|
3108
|
+
* `bindThreePid` method to complete the binding process.
|
|
3109
|
+
*
|
|
3110
|
+
* @param email - The email address to request a token for
|
|
3111
|
+
* @param clientSecret - A secret binary string generated by the client.
|
|
3112
|
+
* It is recommended this be around 16 ASCII characters.
|
|
3113
|
+
* @param sendAttempt - If an identity server sees a duplicate request
|
|
3114
|
+
* with the same sendAttempt, it will not send another email.
|
|
3115
|
+
* To request another email to be sent, use a larger value for
|
|
3116
|
+
* the sendAttempt param as was used in the previous request.
|
|
3117
|
+
* @param nextLink - Optional If specified, the client will be redirected
|
|
3118
|
+
* to this link after validation.
|
|
3119
|
+
* @param identityAccessToken - The `access_token` field of the identity
|
|
3120
|
+
* server `/account/register` response (see {@link registerWithIdentityServer}).
|
|
3121
|
+
*
|
|
3122
|
+
* @returns Promise which resolves: TODO
|
|
3123
|
+
* @returns Rejects: with an error response.
|
|
3124
|
+
* @throws Error if no identity server is set
|
|
3125
|
+
*/
|
|
3126
|
+
requestEmailToken(email: string, clientSecret: string, sendAttempt: number, nextLink?: string, identityAccessToken?: string): Promise<IRequestTokenResponse>;
|
|
3127
|
+
/**
|
|
3128
|
+
* Requests a MSISDN verification token directly from an identity server.
|
|
3129
|
+
*
|
|
3130
|
+
* This API is used as part of binding a MSISDN for discovery on an identity
|
|
3131
|
+
* server. The validation data that results should be passed to the
|
|
3132
|
+
* `bindThreePid` method to complete the binding process.
|
|
3133
|
+
*
|
|
3134
|
+
* @param phoneCountry - The ISO 3166-1 alpha-2 code for the country in
|
|
3135
|
+
* which phoneNumber should be parsed relative to.
|
|
3136
|
+
* @param phoneNumber - The phone number, in national or international
|
|
3137
|
+
* format
|
|
3138
|
+
* @param clientSecret - A secret binary string generated by the client.
|
|
3139
|
+
* It is recommended this be around 16 ASCII characters.
|
|
3140
|
+
* @param sendAttempt - If an identity server sees a duplicate request
|
|
3141
|
+
* with the same sendAttempt, it will not send another SMS.
|
|
3142
|
+
* To request another SMS to be sent, use a larger value for
|
|
3143
|
+
* the sendAttempt param as was used in the previous request.
|
|
3144
|
+
* @param nextLink - Optional If specified, the client will be redirected
|
|
3145
|
+
* to this link after validation.
|
|
3146
|
+
* @param identityAccessToken - The `access_token` field of the Identity
|
|
3147
|
+
* Server `/account/register` response (see {@link registerWithIdentityServer}).
|
|
3148
|
+
*
|
|
3149
|
+
* @returns Promise which resolves to an object with a sid string
|
|
3150
|
+
* @returns Rejects: with an error response.
|
|
3151
|
+
* @throws Error if no identity server is set
|
|
3152
|
+
*/
|
|
3153
|
+
requestMsisdnToken(phoneCountry: string, phoneNumber: string, clientSecret: string, sendAttempt: number, nextLink?: string, identityAccessToken?: string): Promise<IRequestMsisdnTokenResponse>;
|
|
3154
|
+
/**
|
|
3155
|
+
* Submits a MSISDN token to the identity server
|
|
3156
|
+
*
|
|
3157
|
+
* This is used when submitting the code sent by SMS to a phone number.
|
|
3158
|
+
* The identity server has an equivalent API for email but the js-sdk does
|
|
3159
|
+
* not expose this, since email is normally validated by the user clicking
|
|
3160
|
+
* a link rather than entering a code.
|
|
3161
|
+
*
|
|
3162
|
+
* @param sid - The sid given in the response to requestToken
|
|
3163
|
+
* @param clientSecret - A secret binary string generated by the client.
|
|
3164
|
+
* This must be the same value submitted in the requestToken call.
|
|
3165
|
+
* @param msisdnToken - The MSISDN token, as entered by the user.
|
|
3166
|
+
* @param identityAccessToken - The `access_token` field of the Identity
|
|
3167
|
+
* Server `/account/register` response (see {@link registerWithIdentityServer}).
|
|
3168
|
+
* Some legacy identity servers had no authentication here.
|
|
3169
|
+
*
|
|
3170
|
+
* @returns Promise which resolves: Object, containing success boolean.
|
|
3171
|
+
* @returns Rejects: with an error response.
|
|
3172
|
+
* @throws Error if No identity server is set
|
|
3173
|
+
*/
|
|
3174
|
+
submitMsisdnToken(sid: string, clientSecret: string, msisdnToken: string, identityAccessToken: string | null): Promise<{
|
|
3175
|
+
success: boolean;
|
|
3176
|
+
}>;
|
|
3177
|
+
/**
|
|
3178
|
+
* Submits a MSISDN token to an arbitrary URL.
|
|
3179
|
+
*
|
|
3180
|
+
* This is used when submitting the code sent by SMS to a phone number in the
|
|
3181
|
+
* newer 3PID flow where the homeserver validates 3PID ownership (as part of
|
|
3182
|
+
* `requestAdd3pidMsisdnToken`). The homeserver response may include a
|
|
3183
|
+
* `submit_url` to specify where the token should be sent, and this helper can
|
|
3184
|
+
* be used to pass the token to this URL.
|
|
3185
|
+
*
|
|
3186
|
+
* @param url - The URL to submit the token to
|
|
3187
|
+
* @param sid - The sid given in the response to requestToken
|
|
3188
|
+
* @param clientSecret - A secret binary string generated by the client.
|
|
3189
|
+
* This must be the same value submitted in the requestToken call.
|
|
3190
|
+
* @param msisdnToken - The MSISDN token, as entered by the user.
|
|
3191
|
+
*
|
|
3192
|
+
* @returns Promise which resolves: Object, containing success boolean.
|
|
3193
|
+
* @returns Rejects: with an error response.
|
|
3194
|
+
*/
|
|
3195
|
+
submitMsisdnTokenOtherUrl(url: string, sid: string, clientSecret: string, msisdnToken: string): Promise<{
|
|
3196
|
+
success: boolean;
|
|
3197
|
+
}>;
|
|
3198
|
+
/**
|
|
3199
|
+
* Gets the V2 hashing information from the identity server. Primarily useful for
|
|
3200
|
+
* lookups.
|
|
3201
|
+
* @param identityAccessToken - The access token for the identity server.
|
|
3202
|
+
* @returns The hashing information for the identity server.
|
|
3203
|
+
*/
|
|
3204
|
+
getIdentityHashDetails(identityAccessToken: string): Promise<{
|
|
3205
|
+
/**
|
|
3206
|
+
* The algorithms the server supports. Must contain at least sha256.
|
|
3207
|
+
*/
|
|
3208
|
+
algorithms: string[];
|
|
3209
|
+
/**
|
|
3210
|
+
* The pepper the client MUST use in hashing identifiers,
|
|
3211
|
+
* and MUST supply to the /lookup endpoint when performing lookups.
|
|
3212
|
+
*/
|
|
3213
|
+
lookup_pepper: string;
|
|
3214
|
+
}>;
|
|
3215
|
+
/**
|
|
3216
|
+
* Performs a hashed lookup of addresses against the identity server. This is
|
|
3217
|
+
* only supported on identity servers which have at least the version 2 API.
|
|
3218
|
+
* @param addressPairs - An array of 2 element arrays.
|
|
3219
|
+
* The first element of each pair is the address, the second is the 3PID medium.
|
|
3220
|
+
* Eg: `["email@example.org", "email"]`
|
|
3221
|
+
* @param identityAccessToken - The access token for the identity server.
|
|
3222
|
+
* @returns A collection of address mappings to
|
|
3223
|
+
* found MXIDs. Results where no user could be found will not be listed.
|
|
3224
|
+
*/
|
|
3225
|
+
identityHashedLookup(addressPairs: [string, string][], identityAccessToken: string): Promise<{
|
|
3226
|
+
address: string;
|
|
3227
|
+
mxid: string;
|
|
3228
|
+
}[]>;
|
|
3229
|
+
/**
|
|
3230
|
+
* Looks up the public Matrix ID mapping for a given 3rd party
|
|
3231
|
+
* identifier from the identity server
|
|
3232
|
+
*
|
|
3233
|
+
* @param medium - The medium of the threepid, eg. 'email'
|
|
3234
|
+
* @param address - The textual address of the threepid
|
|
3235
|
+
* @param identityAccessToken - The `access_token` field of the Identity
|
|
3236
|
+
* Server `/account/register` response (see {@link registerWithIdentityServer}).
|
|
3237
|
+
*
|
|
3238
|
+
* @returns Promise which resolves: A threepid mapping
|
|
3239
|
+
* object or the empty object if no mapping
|
|
3240
|
+
* exists
|
|
3241
|
+
* @returns Rejects: with an error response.
|
|
3242
|
+
*/
|
|
3243
|
+
lookupThreePid(medium: string, address: string, identityAccessToken: string): Promise<{
|
|
3244
|
+
address: string;
|
|
3245
|
+
medium: string;
|
|
3246
|
+
mxid: string;
|
|
3247
|
+
} | EmptyObject>;
|
|
3248
|
+
/**
|
|
3249
|
+
* Looks up the public Matrix ID mappings for multiple 3PIDs.
|
|
3250
|
+
*
|
|
3251
|
+
* @param query - Array of arrays containing
|
|
3252
|
+
* [medium, address]
|
|
3253
|
+
* @param identityAccessToken - The `access_token` field of the Identity
|
|
3254
|
+
* Server `/account/register` response (see {@link registerWithIdentityServer}).
|
|
3255
|
+
*
|
|
3256
|
+
* @returns Promise which resolves: Lookup results from IS.
|
|
3257
|
+
* @returns Rejects: with an error response.
|
|
3258
|
+
*/
|
|
3259
|
+
bulkLookupThreePids(query: [string, string][], identityAccessToken: string): Promise<{
|
|
3260
|
+
threepids: [medium: string, address: string, mxid: string][];
|
|
3261
|
+
}>;
|
|
3262
|
+
/**
|
|
3263
|
+
* Get account info from the identity server. This is useful as a neutral check
|
|
3264
|
+
* to verify that other APIs are likely to approve access by testing that the
|
|
3265
|
+
* token is valid, terms have been agreed, etc.
|
|
3266
|
+
*
|
|
3267
|
+
* @param identityAccessToken - The `access_token` field of the Identity
|
|
3268
|
+
* Server `/account/register` response (see {@link registerWithIdentityServer}).
|
|
3269
|
+
*
|
|
3270
|
+
* @returns Promise which resolves: an object with account info.
|
|
3271
|
+
* @returns Rejects: with an error response.
|
|
3272
|
+
*/
|
|
3273
|
+
getIdentityAccount(identityAccessToken: string): Promise<{
|
|
3274
|
+
user_id: string;
|
|
3275
|
+
}>;
|
|
3276
|
+
/**
|
|
3277
|
+
* Send an event to a specific list of devices.
|
|
3278
|
+
* This is a low-level API that simply wraps the HTTP API
|
|
3279
|
+
* call to send to-device messages. We recommend using
|
|
3280
|
+
* queueToDevice() which is a higher level API.
|
|
3281
|
+
*
|
|
3282
|
+
* @param eventType - type of event to send
|
|
3283
|
+
* content to send. Map from user_id to device_id to content object.
|
|
3284
|
+
* @param txnId - transaction id. One will be made up if not
|
|
3285
|
+
* supplied.
|
|
3286
|
+
* @returns Promise which resolves: to an empty object `{}`
|
|
3287
|
+
*/
|
|
3288
|
+
sendToDevice(eventType: string, contentMap: SendToDeviceContentMap, txnId?: string): Promise<EmptyObject>;
|
|
3289
|
+
/**
|
|
3290
|
+
* This will encrypt the payload for all devices in the list and will queue it.
|
|
3291
|
+
* The type of the sent to-device message will be `m.room.encrypted`.
|
|
3292
|
+
* @param eventType - The type of event to send
|
|
3293
|
+
* @param devices - The list of devices to send the event to.
|
|
3294
|
+
* @param payload - The payload to send. This will be encrypted.
|
|
3295
|
+
* @returns Promise which resolves once queued there is no error feedback when sending fails.
|
|
3296
|
+
*/
|
|
3297
|
+
encryptAndSendToDevice(eventType: string, devices: {
|
|
3298
|
+
userId: string;
|
|
3299
|
+
deviceId: string;
|
|
3300
|
+
}[], payload: ToDevicePayload): Promise<void>;
|
|
3301
|
+
/**
|
|
3302
|
+
* Sends events directly to specific devices using Matrix's to-device
|
|
3303
|
+
* messaging system. The batch will be split up into appropriately sized
|
|
3304
|
+
* batches for sending and stored in the store so they can be retried
|
|
3305
|
+
* later if they fail to send. Retries will happen automatically.
|
|
3306
|
+
* @param batch - The to-device messages to send
|
|
3307
|
+
*/
|
|
3308
|
+
queueToDevice(batch: ToDeviceBatch): Promise<void>;
|
|
3309
|
+
/**
|
|
3310
|
+
* Get the third party protocols that can be reached using
|
|
3311
|
+
* this HS
|
|
3312
|
+
* @returns Promise which resolves to the result object
|
|
3313
|
+
*/
|
|
3314
|
+
getThirdpartyProtocols(): Promise<{
|
|
3315
|
+
[protocol: string]: IProtocol;
|
|
3316
|
+
}>;
|
|
3317
|
+
/**
|
|
3318
|
+
* Get information on how a specific place on a third party protocol
|
|
3319
|
+
* may be reached.
|
|
3320
|
+
* @param protocol - The protocol given in getThirdpartyProtocols()
|
|
3321
|
+
* @param params - Protocol-specific parameters, as given in the
|
|
3322
|
+
* response to getThirdpartyProtocols()
|
|
3323
|
+
* @returns Promise which resolves to the result object
|
|
3324
|
+
*/
|
|
3325
|
+
getThirdpartyLocation(protocol: string, params: {
|
|
3326
|
+
searchFields?: string[];
|
|
3327
|
+
}): Promise<IThirdPartyLocation[]>;
|
|
3328
|
+
/**
|
|
3329
|
+
* Get information on how a specific user on a third party protocol
|
|
3330
|
+
* may be reached.
|
|
3331
|
+
* @param protocol - The protocol given in getThirdpartyProtocols()
|
|
3332
|
+
* @param params - Protocol-specific parameters, as given in the
|
|
3333
|
+
* response to getThirdpartyProtocols()
|
|
3334
|
+
* @returns Promise which resolves to the result object
|
|
3335
|
+
*/
|
|
3336
|
+
getThirdpartyUser(protocol: string, params?: QueryDict): Promise<IThirdPartyUser[]>;
|
|
3337
|
+
getTerms(serviceType: SERVICE_TYPES, baseUrl: string): Promise<Terms>;
|
|
3338
|
+
agreeToTerms(serviceType: SERVICE_TYPES, baseUrl: string, accessToken: string, termsUrls: string[]): Promise<EmptyObject>;
|
|
3339
|
+
/**
|
|
3340
|
+
* Reports an event as inappropriate to the server, which may then notify the appropriate people.
|
|
3341
|
+
* @param roomId - The room in which the event being reported is located.
|
|
3342
|
+
* @param eventId - The event to report.
|
|
3343
|
+
* @param score - The score to rate this content as where -100 is most offensive and 0 is inoffensive.
|
|
3344
|
+
* @param reason - The reason the content is being reported. May be blank.
|
|
3345
|
+
* @returns Promise which resolves to an empty object if successful
|
|
3346
|
+
*/
|
|
3347
|
+
reportEvent(roomId: string, eventId: string, score: number, reason: string): Promise<EmptyObject>;
|
|
3348
|
+
/**
|
|
3349
|
+
* Reports a room as inappropriate to the server, which may then notify the appropriate people.
|
|
3350
|
+
*
|
|
3351
|
+
* This API was introduced in Matrix v1.13.
|
|
3352
|
+
*
|
|
3353
|
+
* @param roomId - The room being reported.
|
|
3354
|
+
* @param reason - The reason the room is being reported. May be blank.
|
|
3355
|
+
* @returns Promise which resolves to an empty object if successful
|
|
3356
|
+
*/
|
|
3357
|
+
reportRoom(roomId: string, reason: string): Promise<EmptyObject>;
|
|
3358
|
+
/**
|
|
3359
|
+
* Fetches or paginates a room hierarchy asbriij-js-sdk/spec/unit/matrix-client.spec.ts defined by MSC2946.
|
|
3360
|
+
* Falls back gracefully to sourcing its data from `getSpaceSummary` if this API is not yet supported by the server.
|
|
3361
|
+
* @param roomId - The ID of the space-room to use as the root of the summary.
|
|
3362
|
+
* @param limit - The maximum number of rooms to return per page.
|
|
3363
|
+
* @param maxDepth - The maximum depth in the tree from the root room to return.
|
|
3364
|
+
* @param suggestedOnly - Whether to only return rooms with suggested=true.
|
|
3365
|
+
* @param fromToken - The opaque token to paginate a previous request.
|
|
3366
|
+
* @returns the response, with next_batch & rooms fields.
|
|
3367
|
+
*/
|
|
3368
|
+
getRoomHierarchy(roomId: string, limit?: number, maxDepth?: number, suggestedOnly?: boolean, fromToken?: string): Promise<IRoomHierarchy>;
|
|
3369
|
+
/**
|
|
3370
|
+
* Creates a new file tree space with the given name. The client will pick
|
|
3371
|
+
* defaults for how it expects to be able to support the remaining API offered
|
|
3372
|
+
* by the returned class.
|
|
3373
|
+
*
|
|
3374
|
+
* Note that this is UNSTABLE and may have breaking changes without notice.
|
|
3375
|
+
* @param name - The name of the tree space.
|
|
3376
|
+
* @returns Promise which resolves to the created space.
|
|
3377
|
+
*/
|
|
3378
|
+
unstableCreateFileTree(name: string): Promise<MSC3089TreeSpace>;
|
|
3379
|
+
/**
|
|
3380
|
+
* Gets a reference to a tree space, if the room ID given is a tree space. If the room
|
|
3381
|
+
* does not appear to be a tree space then null is returned.
|
|
3382
|
+
*
|
|
3383
|
+
* Note that this is UNSTABLE and may have breaking changes without notice.
|
|
3384
|
+
* @param roomId - The room ID to get a tree space reference for.
|
|
3385
|
+
* @returns The tree space, or null if not a tree space.
|
|
3386
|
+
*/
|
|
3387
|
+
unstableGetFileTreeSpace(roomId: string): MSC3089TreeSpace | null;
|
|
3388
|
+
/**
|
|
3389
|
+
* Perform a single MSC3575 sliding sync request.
|
|
3390
|
+
* @param req - The request to make.
|
|
3391
|
+
* @param proxyBaseUrl - The base URL for the sliding sync proxy.
|
|
3392
|
+
* @param abortSignal - Optional signal to abort request mid-flight.
|
|
3393
|
+
* @returns The sliding sync response, or a standard error.
|
|
3394
|
+
* @throws on non 2xx status codes with an object with a field "httpStatus":number.
|
|
3395
|
+
*/
|
|
3396
|
+
slidingSync(req: MSC3575SlidingSyncRequest, proxyBaseUrl?: string, abortSignal?: AbortSignal): Promise<MSC3575SlidingSyncResponse>;
|
|
3397
|
+
/**
|
|
3398
|
+
* A helper to determine thread support
|
|
3399
|
+
* @returns a boolean to determine if threads are enabled
|
|
3400
|
+
*/
|
|
3401
|
+
supportsThreads(): boolean;
|
|
3402
|
+
/**
|
|
3403
|
+
* A helper to determine intentional mentions support
|
|
3404
|
+
* @returns a boolean to determine if intentional mentions are enabled on the server
|
|
3405
|
+
* @experimental
|
|
3406
|
+
*/
|
|
3407
|
+
supportsIntentionalMentions(): boolean;
|
|
3408
|
+
/**
|
|
3409
|
+
* Fetches the summary of a room as defined by an initial version of MSC3266 and implemented in Synapse
|
|
3410
|
+
* Proposed at https://github.com/matrix-org/matrix-doc/pull/3266
|
|
3411
|
+
* @param roomIdOrAlias - The ID or alias of the room to get the summary of.
|
|
3412
|
+
* @param via - The list of servers which know about the room if only an ID was provided.
|
|
3413
|
+
*/
|
|
3414
|
+
getRoomSummary(roomIdOrAlias: string, via?: string[]): Promise<RoomSummary>;
|
|
3415
|
+
/**
|
|
3416
|
+
* Processes a list of threaded events and adds them to their respective timelines
|
|
3417
|
+
* @param room - the room the adds the threaded events
|
|
3418
|
+
* @param threadedEvents - an array of the threaded events
|
|
3419
|
+
* @param toStartOfTimeline - the direction in which we want to add the events
|
|
3420
|
+
*/
|
|
3421
|
+
processThreadEvents(room: Room, threadedEvents: BriijEvent[], toStartOfTimeline: boolean): void;
|
|
3422
|
+
/**
|
|
3423
|
+
* Processes a list of thread roots and creates a thread model
|
|
3424
|
+
* @param room - the room to create the threads in
|
|
3425
|
+
* @param threadedEvents - an array of thread roots
|
|
3426
|
+
* @param toStartOfTimeline - the direction
|
|
3427
|
+
*/
|
|
3428
|
+
processThreadRoots(room: Room, threadedEvents: BriijEvent[], toStartOfTimeline: boolean): void;
|
|
3429
|
+
processBeaconEvents(room?: Room, events?: BriijEvent[]): void;
|
|
3430
|
+
/**
|
|
3431
|
+
* Calls aggregation functions for event types that are aggregated
|
|
3432
|
+
* Polls and location beacons
|
|
3433
|
+
* @param room - room the events belong to
|
|
3434
|
+
* @param events - timeline events to be processed
|
|
3435
|
+
* @returns
|
|
3436
|
+
*/
|
|
3437
|
+
processAggregatedTimelineEvents(room?: Room, events?: BriijEvent[]): void;
|
|
3438
|
+
/**
|
|
3439
|
+
* Fetches information about the user for the configured access token.
|
|
3440
|
+
*/
|
|
3441
|
+
whoami(): Promise<IWhoamiResponse>;
|
|
3442
|
+
/**
|
|
3443
|
+
* Find the event_id closest to the given timestamp in the given direction.
|
|
3444
|
+
* @returns Resolves: A promise of an object containing the event_id and
|
|
3445
|
+
* origin_server_ts of the closest event to the timestamp in the given direction
|
|
3446
|
+
* @returns Rejects: when the request fails (module:http-api.BriijError)
|
|
3447
|
+
*/
|
|
3448
|
+
timestampToEvent(roomId: string, timestamp: number, dir: Direction): Promise<TimestampToEventResponse>;
|
|
3449
|
+
/**
|
|
3450
|
+
* Discover and validate the auth metadata for the OAuth 2.0 API.
|
|
3451
|
+
*
|
|
3452
|
+
* Fetches /auth_metadata falling back to legacy implementation using /auth_issuer followed by
|
|
3453
|
+
* https://oidc-issuer.example.com/.well-known/openid-configuration and other files linked therein.
|
|
3454
|
+
* When successful, validated metadata is returned.
|
|
3455
|
+
*
|
|
3456
|
+
* @returns validated authentication metadata and optionally signing keys
|
|
3457
|
+
* @throws when delegated auth config is invalid or unreachable
|
|
3458
|
+
*/
|
|
3459
|
+
getAuthMetadata(): Promise<OidcClientConfig>;
|
|
3460
|
+
}
|
|
3461
|
+
/**
|
|
3462
|
+
* recalculates an accurate notifications count on event decryption.
|
|
3463
|
+
* Servers do not have enough knowledge about encrypted events to calculate an
|
|
3464
|
+
* accurate notification_count
|
|
3465
|
+
*/
|
|
3466
|
+
export declare function fixNotificationCountOnDecryption(cli: BriijClient, event: BriijEvent): void;
|
|
3467
|
+
/**
|
|
3468
|
+
* Given an event, figure out the thread ID we should use for it in a receipt.
|
|
3469
|
+
*
|
|
3470
|
+
* This will either be "main", or event.threadRootId. For the thread root, or
|
|
3471
|
+
* e.g. reactions to the thread root, this will be main. For events inside the
|
|
3472
|
+
* thread, or e.g. reactions to them, this will be event.threadRootId.
|
|
3473
|
+
*
|
|
3474
|
+
* (Exported for test.)
|
|
3475
|
+
*/
|
|
3476
|
+
export declare function threadIdForReceipt(event: BriijEvent): string;
|
|
3477
|
+
/**
|
|
3478
|
+
* a) True for non-threaded messages, thread roots and non-thread relations to thread roots.
|
|
3479
|
+
* b) False for messages with thread relations to the thread root.
|
|
3480
|
+
* c) False for messages with any kind of relation to a message from case b.
|
|
3481
|
+
*
|
|
3482
|
+
* Note: true for redactions of messages that are in threads. Redacted messages
|
|
3483
|
+
* are not really in threads (because their relations are gone), so if they look
|
|
3484
|
+
* like they are in threads, that is a sign of a bug elsewhere. (At time of
|
|
3485
|
+
* writing, this bug definitely exists - messages are not moved to another
|
|
3486
|
+
* thread when they are redacted.)
|
|
3487
|
+
*
|
|
3488
|
+
* @returns true if this event is considered to be in the main timeline as far
|
|
3489
|
+
* as receipts are concerned.
|
|
3490
|
+
*/
|
|
3491
|
+
export declare function inMainTimelineForReceipt(event: BriijEvent): boolean;
|
|
3492
|
+
export {};
|
|
3493
|
+
//# sourceMappingURL=client.d.ts.map
|