@unwanted/matrix-sdk-mini 34.12.0 → 34.13.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/git-revision.txt +1 -1
- package/lib/@types/event.d.ts +0 -19
- package/lib/@types/event.d.ts.map +1 -1
- package/lib/@types/event.js.map +1 -1
- package/lib/@types/global.d.js +0 -2
- package/lib/@types/global.d.js.map +1 -1
- package/lib/autodiscovery.d.ts +1 -1
- package/lib/autodiscovery.d.ts.map +1 -1
- package/lib/autodiscovery.js.map +1 -1
- package/lib/base64.d.ts +3 -6
- package/lib/base64.d.ts.map +1 -1
- package/lib/base64.js +43 -36
- package/lib/base64.js.map +1 -1
- package/lib/browser-index.d.ts.map +1 -1
- package/lib/browser-index.js +0 -11
- package/lib/browser-index.js.map +1 -1
- package/lib/client.d.ts +2 -1298
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +348 -2967
- package/lib/client.js.map +1 -1
- package/lib/digest.d.ts +2 -2
- package/lib/digest.d.ts.map +1 -1
- package/lib/digest.js +2 -2
- package/lib/digest.js.map +1 -1
- package/lib/embedded.d.ts +0 -22
- package/lib/embedded.d.ts.map +1 -1
- package/lib/embedded.js +58 -168
- package/lib/embedded.js.map +1 -1
- package/lib/event-mapper.d.ts.map +1 -1
- package/lib/event-mapper.js +0 -4
- package/lib/event-mapper.js.map +1 -1
- package/lib/matrix.d.ts +0 -25
- package/lib/matrix.d.ts.map +1 -1
- package/lib/matrix.js +1 -30
- package/lib/matrix.js.map +1 -1
- package/lib/models/MSC3089Branch.d.ts.map +1 -1
- package/lib/models/MSC3089Branch.js +0 -3
- package/lib/models/MSC3089Branch.js.map +1 -1
- package/lib/models/event-timeline-set.d.ts +6 -10
- package/lib/models/event-timeline-set.d.ts.map +1 -1
- package/lib/models/event-timeline-set.js +28 -36
- package/lib/models/event-timeline-set.js.map +1 -1
- package/lib/models/event-timeline.d.ts +7 -2
- package/lib/models/event-timeline.d.ts.map +1 -1
- package/lib/models/event-timeline.js +8 -9
- package/lib/models/event-timeline.js.map +1 -1
- package/lib/models/event.d.ts +1 -95
- package/lib/models/event.d.ts.map +1 -1
- package/lib/models/event.js +11 -281
- package/lib/models/event.js.map +1 -1
- package/lib/models/poll.d.ts.map +1 -1
- package/lib/models/poll.js +1 -5
- package/lib/models/poll.js.map +1 -1
- package/lib/models/relations-container.d.ts.map +1 -1
- package/lib/models/relations-container.js +1 -7
- package/lib/models/relations-container.js.map +1 -1
- package/lib/models/relations.d.ts +0 -1
- package/lib/models/relations.d.ts.map +1 -1
- package/lib/models/relations.js +0 -8
- package/lib/models/relations.js.map +1 -1
- package/lib/models/room-state.d.ts +2 -13
- package/lib/models/room-state.d.ts.map +1 -1
- package/lib/models/room-state.js +12 -56
- package/lib/models/room-state.js.map +1 -1
- package/lib/models/room.d.ts +2 -20
- package/lib/models/room.d.ts.map +1 -1
- package/lib/models/room.js +121 -162
- package/lib/models/room.js.map +1 -1
- package/lib/models/thread.d.ts.map +1 -1
- package/lib/models/thread.js +5 -4
- package/lib/models/thread.js.map +1 -1
- package/lib/sliding-sync-sdk.d.ts +3 -4
- package/lib/sliding-sync-sdk.d.ts.map +1 -1
- package/lib/sliding-sync-sdk.js +55 -102
- package/lib/sliding-sync-sdk.js.map +1 -1
- package/lib/sliding-sync.js +9 -6
- package/lib/sliding-sync.js.map +1 -1
- package/lib/store/indexeddb.d.ts +1 -1
- package/lib/store/indexeddb.d.ts.map +1 -1
- package/lib/store/indexeddb.js.map +1 -1
- package/lib/sync-accumulator.d.ts +6 -4
- package/lib/sync-accumulator.d.ts.map +1 -1
- package/lib/sync-accumulator.js +23 -12
- package/lib/sync-accumulator.js.map +1 -1
- package/lib/sync.d.ts +10 -13
- package/lib/sync.d.ts.map +1 -1
- package/lib/sync.js +94 -115
- package/lib/sync.js.map +1 -1
- package/lib/testing.d.ts +0 -48
- package/lib/testing.d.ts.map +1 -1
- package/lib/testing.js +0 -105
- package/lib/testing.js.map +1 -1
- package/lib/types.d.ts +0 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/package.json +10 -11
- package/src/@types/event.ts +2 -36
- package/src/@types/global.d.ts +21 -4
- package/src/autodiscovery.ts +1 -1
- package/src/base64.ts +38 -40
- package/src/browser-index.ts +0 -11
- package/src/client.ts +68 -3087
- package/src/digest.ts +3 -3
- package/src/embedded.ts +38 -134
- package/src/event-mapper.ts +0 -4
- package/src/matrix.ts +0 -41
- package/src/models/MSC3089Branch.ts +0 -3
- package/src/models/event-timeline-set.ts +17 -38
- package/src/models/event-timeline.ts +10 -5
- package/src/models/event.ts +8 -295
- package/src/models/poll.ts +0 -6
- package/src/models/relations-container.ts +1 -8
- package/src/models/relations.ts +0 -8
- package/src/models/room-state.ts +4 -37
- package/src/models/room.ts +18 -68
- package/src/models/thread.ts +4 -3
- package/src/sliding-sync-sdk.ts +10 -83
- package/src/sliding-sync.ts +6 -6
- package/src/store/indexeddb.ts +1 -1
- package/src/sync-accumulator.ts +33 -16
- package/src/sync.ts +112 -143
- package/src/testing.ts +0 -108
- package/src/types.ts +0 -1
- package/CHANGELOG.md +0 -5910
- package/lib/@types/AESEncryptedSecretStoragePayload.d.ts +0 -14
- package/lib/@types/AESEncryptedSecretStoragePayload.d.ts.map +0 -1
- package/lib/@types/AESEncryptedSecretStoragePayload.js +0 -1
- package/lib/@types/AESEncryptedSecretStoragePayload.js.map +0 -1
- package/lib/@types/crypto.d.ts +0 -47
- package/lib/@types/crypto.d.ts.map +0 -1
- package/lib/@types/crypto.js +0 -1
- package/lib/@types/crypto.js.map +0 -1
- package/lib/@types/matrix-sdk-crypto-wasm.d.js +0 -1
- package/lib/@types/matrix-sdk-crypto-wasm.d.js.map +0 -1
- package/lib/common-crypto/CryptoBackend.d.ts +0 -240
- package/lib/common-crypto/CryptoBackend.d.ts.map +0 -1
- package/lib/common-crypto/CryptoBackend.js +0 -73
- package/lib/common-crypto/CryptoBackend.js.map +0 -1
- package/lib/common-crypto/key-passphrase.d.ts +0 -14
- package/lib/common-crypto/key-passphrase.d.ts.map +0 -1
- package/lib/common-crypto/key-passphrase.js +0 -33
- package/lib/common-crypto/key-passphrase.js.map +0 -1
- package/lib/crypto/CrossSigning.d.ts +0 -184
- package/lib/crypto/CrossSigning.d.ts.map +0 -1
- package/lib/crypto/CrossSigning.js +0 -718
- package/lib/crypto/CrossSigning.js.map +0 -1
- package/lib/crypto/DeviceList.d.ts +0 -216
- package/lib/crypto/DeviceList.d.ts.map +0 -1
- package/lib/crypto/DeviceList.js +0 -892
- package/lib/crypto/DeviceList.js.map +0 -1
- package/lib/crypto/EncryptionSetup.d.ts +0 -152
- package/lib/crypto/EncryptionSetup.d.ts.map +0 -1
- package/lib/crypto/EncryptionSetup.js +0 -356
- package/lib/crypto/EncryptionSetup.js.map +0 -1
- package/lib/crypto/OlmDevice.d.ts +0 -457
- package/lib/crypto/OlmDevice.d.ts.map +0 -1
- package/lib/crypto/OlmDevice.js +0 -1241
- package/lib/crypto/OlmDevice.js.map +0 -1
- package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts +0 -109
- package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts.map +0 -1
- package/lib/crypto/OutgoingRoomKeyRequestManager.js +0 -415
- package/lib/crypto/OutgoingRoomKeyRequestManager.js.map +0 -1
- package/lib/crypto/RoomList.d.ts +0 -26
- package/lib/crypto/RoomList.d.ts.map +0 -1
- package/lib/crypto/RoomList.js +0 -71
- package/lib/crypto/RoomList.js.map +0 -1
- package/lib/crypto/SecretSharing.d.ts +0 -24
- package/lib/crypto/SecretSharing.d.ts.map +0 -1
- package/lib/crypto/SecretSharing.js +0 -194
- package/lib/crypto/SecretSharing.js.map +0 -1
- package/lib/crypto/SecretStorage.d.ts +0 -55
- package/lib/crypto/SecretStorage.d.ts.map +0 -1
- package/lib/crypto/SecretStorage.js +0 -118
- package/lib/crypto/SecretStorage.js.map +0 -1
- package/lib/crypto/aes.d.ts +0 -6
- package/lib/crypto/aes.d.ts.map +0 -1
- package/lib/crypto/aes.js +0 -24
- package/lib/crypto/aes.js.map +0 -1
- package/lib/crypto/algorithms/base.d.ts +0 -156
- package/lib/crypto/algorithms/base.d.ts.map +0 -1
- package/lib/crypto/algorithms/base.js +0 -187
- package/lib/crypto/algorithms/base.js.map +0 -1
- package/lib/crypto/algorithms/index.d.ts +0 -4
- package/lib/crypto/algorithms/index.d.ts.map +0 -1
- package/lib/crypto/algorithms/index.js +0 -20
- package/lib/crypto/algorithms/index.js.map +0 -1
- package/lib/crypto/algorithms/megolm.d.ts +0 -385
- package/lib/crypto/algorithms/megolm.d.ts.map +0 -1
- package/lib/crypto/algorithms/megolm.js +0 -1822
- package/lib/crypto/algorithms/megolm.js.map +0 -1
- package/lib/crypto/algorithms/olm.d.ts +0 -5
- package/lib/crypto/algorithms/olm.d.ts.map +0 -1
- package/lib/crypto/algorithms/olm.js +0 -299
- package/lib/crypto/algorithms/olm.js.map +0 -1
- package/lib/crypto/api.d.ts +0 -32
- package/lib/crypto/api.d.ts.map +0 -1
- package/lib/crypto/api.js +0 -22
- package/lib/crypto/api.js.map +0 -1
- package/lib/crypto/backup.d.ts +0 -227
- package/lib/crypto/backup.d.ts.map +0 -1
- package/lib/crypto/backup.js +0 -824
- package/lib/crypto/backup.js.map +0 -1
- package/lib/crypto/crypto.d.ts +0 -3
- package/lib/crypto/crypto.d.ts.map +0 -1
- package/lib/crypto/crypto.js +0 -19
- package/lib/crypto/crypto.js.map +0 -1
- package/lib/crypto/dehydration.d.ts +0 -34
- package/lib/crypto/dehydration.d.ts.map +0 -1
- package/lib/crypto/dehydration.js +0 -252
- package/lib/crypto/dehydration.js.map +0 -1
- package/lib/crypto/device-converter.d.ts +0 -9
- package/lib/crypto/device-converter.d.ts.map +0 -1
- package/lib/crypto/device-converter.js +0 -42
- package/lib/crypto/device-converter.js.map +0 -1
- package/lib/crypto/deviceinfo.d.ts +0 -99
- package/lib/crypto/deviceinfo.d.ts.map +0 -1
- package/lib/crypto/deviceinfo.js +0 -148
- package/lib/crypto/deviceinfo.js.map +0 -1
- package/lib/crypto/index.d.ts +0 -1210
- package/lib/crypto/index.d.ts.map +0 -1
- package/lib/crypto/index.js +0 -4101
- package/lib/crypto/index.js.map +0 -1
- package/lib/crypto/key_passphrase.d.ts +0 -14
- package/lib/crypto/key_passphrase.d.ts.map +0 -1
- package/lib/crypto/key_passphrase.js +0 -44
- package/lib/crypto/key_passphrase.js.map +0 -1
- package/lib/crypto/keybackup.d.ts +0 -18
- package/lib/crypto/keybackup.d.ts.map +0 -1
- package/lib/crypto/keybackup.js +0 -1
- package/lib/crypto/keybackup.js.map +0 -1
- package/lib/crypto/olmlib.d.ts +0 -129
- package/lib/crypto/olmlib.d.ts.map +0 -1
- package/lib/crypto/olmlib.js +0 -492
- package/lib/crypto/olmlib.js.map +0 -1
- package/lib/crypto/recoverykey.d.ts +0 -2
- package/lib/crypto/recoverykey.d.ts.map +0 -1
- package/lib/crypto/recoverykey.js +0 -19
- package/lib/crypto/recoverykey.js.map +0 -1
- package/lib/crypto/store/base.d.ts +0 -252
- package/lib/crypto/store/base.d.ts.map +0 -1
- package/lib/crypto/store/base.js +0 -64
- package/lib/crypto/store/base.js.map +0 -1
- package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts +0 -187
- package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts.map +0 -1
- package/lib/crypto/store/indexeddb-crypto-store-backend.js +0 -1145
- package/lib/crypto/store/indexeddb-crypto-store-backend.js.map +0 -1
- package/lib/crypto/store/indexeddb-crypto-store.d.ts +0 -432
- package/lib/crypto/store/indexeddb-crypto-store.d.ts.map +0 -1
- package/lib/crypto/store/indexeddb-crypto-store.js +0 -728
- package/lib/crypto/store/indexeddb-crypto-store.js.map +0 -1
- package/lib/crypto/store/localStorage-crypto-store.d.ts +0 -119
- package/lib/crypto/store/localStorage-crypto-store.d.ts.map +0 -1
- package/lib/crypto/store/localStorage-crypto-store.js +0 -531
- package/lib/crypto/store/localStorage-crypto-store.js.map +0 -1
- package/lib/crypto/store/memory-crypto-store.d.ts +0 -215
- package/lib/crypto/store/memory-crypto-store.d.ts.map +0 -1
- package/lib/crypto/store/memory-crypto-store.js +0 -622
- package/lib/crypto/store/memory-crypto-store.js.map +0 -1
- package/lib/crypto/verification/Base.d.ts +0 -105
- package/lib/crypto/verification/Base.d.ts.map +0 -1
- package/lib/crypto/verification/Base.js +0 -372
- package/lib/crypto/verification/Base.js.map +0 -1
- package/lib/crypto/verification/Error.d.ts +0 -35
- package/lib/crypto/verification/Error.d.ts.map +0 -1
- package/lib/crypto/verification/Error.js +0 -86
- package/lib/crypto/verification/Error.js.map +0 -1
- package/lib/crypto/verification/IllegalMethod.d.ts +0 -15
- package/lib/crypto/verification/IllegalMethod.d.ts.map +0 -1
- package/lib/crypto/verification/IllegalMethod.js +0 -43
- package/lib/crypto/verification/IllegalMethod.js.map +0 -1
- package/lib/crypto/verification/QRCode.d.ts +0 -51
- package/lib/crypto/verification/QRCode.d.ts.map +0 -1
- package/lib/crypto/verification/QRCode.js +0 -277
- package/lib/crypto/verification/QRCode.js.map +0 -1
- package/lib/crypto/verification/SAS.d.ts +0 -27
- package/lib/crypto/verification/SAS.d.ts.map +0 -1
- package/lib/crypto/verification/SAS.js +0 -485
- package/lib/crypto/verification/SAS.js.map +0 -1
- package/lib/crypto/verification/SASDecimal.d.ts +0 -8
- package/lib/crypto/verification/SASDecimal.d.ts.map +0 -1
- package/lib/crypto/verification/SASDecimal.js +0 -34
- package/lib/crypto/verification/SASDecimal.js.map +0 -1
- package/lib/crypto/verification/request/Channel.d.ts +0 -18
- package/lib/crypto/verification/request/Channel.d.ts.map +0 -1
- package/lib/crypto/verification/request/Channel.js +0 -1
- package/lib/crypto/verification/request/Channel.js.map +0 -1
- package/lib/crypto/verification/request/InRoomChannel.d.ts +0 -113
- package/lib/crypto/verification/request/InRoomChannel.d.ts.map +0 -1
- package/lib/crypto/verification/request/InRoomChannel.js +0 -351
- package/lib/crypto/verification/request/InRoomChannel.js.map +0 -1
- package/lib/crypto/verification/request/ToDeviceChannel.d.ts +0 -105
- package/lib/crypto/verification/request/ToDeviceChannel.d.ts.map +0 -1
- package/lib/crypto/verification/request/ToDeviceChannel.js +0 -328
- package/lib/crypto/verification/request/ToDeviceChannel.js.map +0 -1
- package/lib/crypto/verification/request/VerificationRequest.d.ts +0 -227
- package/lib/crypto/verification/request/VerificationRequest.d.ts.map +0 -1
- package/lib/crypto/verification/request/VerificationRequest.js +0 -937
- package/lib/crypto/verification/request/VerificationRequest.js.map +0 -1
- package/lib/crypto-api/CryptoEvent.d.ts +0 -69
- package/lib/crypto-api/CryptoEvent.d.ts.map +0 -1
- package/lib/crypto-api/CryptoEvent.js +0 -33
- package/lib/crypto-api/CryptoEvent.js.map +0 -1
- package/lib/crypto-api/CryptoEventHandlerMap.d.ts +0 -16
- package/lib/crypto-api/CryptoEventHandlerMap.d.ts.map +0 -1
- package/lib/crypto-api/CryptoEventHandlerMap.js +0 -22
- package/lib/crypto-api/CryptoEventHandlerMap.js.map +0 -1
- package/lib/crypto-api/index.d.ts +0 -978
- package/lib/crypto-api/index.d.ts.map +0 -1
- package/lib/crypto-api/index.js +0 -304
- package/lib/crypto-api/index.js.map +0 -1
- package/lib/crypto-api/key-passphrase.d.ts +0 -11
- package/lib/crypto-api/key-passphrase.d.ts.map +0 -1
- package/lib/crypto-api/key-passphrase.js +0 -51
- package/lib/crypto-api/key-passphrase.js.map +0 -1
- package/lib/crypto-api/keybackup.d.ts +0 -88
- package/lib/crypto-api/keybackup.d.ts.map +0 -1
- package/lib/crypto-api/keybackup.js +0 -1
- package/lib/crypto-api/keybackup.js.map +0 -1
- package/lib/crypto-api/recovery-key.d.ts +0 -11
- package/lib/crypto-api/recovery-key.d.ts.map +0 -1
- package/lib/crypto-api/recovery-key.js +0 -65
- package/lib/crypto-api/recovery-key.js.map +0 -1
- package/lib/crypto-api/verification.d.ts +0 -344
- package/lib/crypto-api/verification.d.ts.map +0 -1
- package/lib/crypto-api/verification.js +0 -91
- package/lib/crypto-api/verification.js.map +0 -1
- package/lib/matrixrtc/CallMembership.d.ts +0 -66
- package/lib/matrixrtc/CallMembership.d.ts.map +0 -1
- package/lib/matrixrtc/CallMembership.js +0 -197
- package/lib/matrixrtc/CallMembership.js.map +0 -1
- package/lib/matrixrtc/LivekitFocus.d.ts +0 -16
- package/lib/matrixrtc/LivekitFocus.d.ts.map +0 -1
- package/lib/matrixrtc/LivekitFocus.js +0 -20
- package/lib/matrixrtc/LivekitFocus.js.map +0 -1
- package/lib/matrixrtc/MatrixRTCSession.d.ts +0 -295
- package/lib/matrixrtc/MatrixRTCSession.d.ts.map +0 -1
- package/lib/matrixrtc/MatrixRTCSession.js +0 -1043
- package/lib/matrixrtc/MatrixRTCSession.js.map +0 -1
- package/lib/matrixrtc/MatrixRTCSessionManager.d.ts +0 -40
- package/lib/matrixrtc/MatrixRTCSessionManager.d.ts.map +0 -1
- package/lib/matrixrtc/MatrixRTCSessionManager.js +0 -146
- package/lib/matrixrtc/MatrixRTCSessionManager.js.map +0 -1
- package/lib/matrixrtc/focus.d.ts +0 -10
- package/lib/matrixrtc/focus.d.ts.map +0 -1
- package/lib/matrixrtc/focus.js +0 -1
- package/lib/matrixrtc/focus.js.map +0 -1
- package/lib/matrixrtc/index.d.ts +0 -7
- package/lib/matrixrtc/index.d.ts.map +0 -1
- package/lib/matrixrtc/index.js +0 -21
- package/lib/matrixrtc/index.js.map +0 -1
- package/lib/matrixrtc/types.d.ts +0 -19
- package/lib/matrixrtc/types.d.ts.map +0 -1
- package/lib/matrixrtc/types.js +0 -1
- package/lib/matrixrtc/types.js.map +0 -1
- package/lib/rendezvous/MSC4108SignInWithQR.d.ts +0 -112
- package/lib/rendezvous/MSC4108SignInWithQR.d.ts.map +0 -1
- package/lib/rendezvous/MSC4108SignInWithQR.js +0 -392
- package/lib/rendezvous/MSC4108SignInWithQR.js.map +0 -1
- package/lib/rendezvous/RendezvousChannel.d.ts +0 -27
- package/lib/rendezvous/RendezvousChannel.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousChannel.js +0 -1
- package/lib/rendezvous/RendezvousChannel.js.map +0 -1
- package/lib/rendezvous/RendezvousCode.d.ts +0 -9
- package/lib/rendezvous/RendezvousCode.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousCode.js +0 -1
- package/lib/rendezvous/RendezvousCode.js.map +0 -1
- package/lib/rendezvous/RendezvousError.d.ts +0 -6
- package/lib/rendezvous/RendezvousError.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousError.js +0 -23
- package/lib/rendezvous/RendezvousError.js.map +0 -1
- package/lib/rendezvous/RendezvousFailureReason.d.ts +0 -31
- package/lib/rendezvous/RendezvousFailureReason.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousFailureReason.js +0 -38
- package/lib/rendezvous/RendezvousFailureReason.js.map +0 -1
- package/lib/rendezvous/RendezvousIntent.d.ts +0 -5
- package/lib/rendezvous/RendezvousIntent.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousIntent.js +0 -22
- package/lib/rendezvous/RendezvousIntent.js.map +0 -1
- package/lib/rendezvous/RendezvousTransport.d.ts +0 -36
- package/lib/rendezvous/RendezvousTransport.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousTransport.js +0 -1
- package/lib/rendezvous/RendezvousTransport.js.map +0 -1
- package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts +0 -58
- package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts.map +0 -1
- package/lib/rendezvous/channels/MSC4108SecureChannel.js +0 -246
- package/lib/rendezvous/channels/MSC4108SecureChannel.js.map +0 -1
- package/lib/rendezvous/channels/index.d.ts +0 -2
- package/lib/rendezvous/channels/index.d.ts.map +0 -1
- package/lib/rendezvous/channels/index.js +0 -18
- package/lib/rendezvous/channels/index.js.map +0 -1
- package/lib/rendezvous/index.d.ts +0 -10
- package/lib/rendezvous/index.d.ts.map +0 -1
- package/lib/rendezvous/index.js +0 -23
- package/lib/rendezvous/index.js.map +0 -1
- package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts +0 -61
- package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts.map +0 -1
- package/lib/rendezvous/transports/MSC4108RendezvousSession.js +0 -253
- package/lib/rendezvous/transports/MSC4108RendezvousSession.js.map +0 -1
- package/lib/rendezvous/transports/index.d.ts +0 -2
- package/lib/rendezvous/transports/index.d.ts.map +0 -1
- package/lib/rendezvous/transports/index.js +0 -18
- package/lib/rendezvous/transports/index.js.map +0 -1
- package/lib/rust-crypto/CrossSigningIdentity.d.ts +0 -33
- package/lib/rust-crypto/CrossSigningIdentity.d.ts.map +0 -1
- package/lib/rust-crypto/CrossSigningIdentity.js +0 -157
- package/lib/rust-crypto/CrossSigningIdentity.js.map +0 -1
- package/lib/rust-crypto/DehydratedDeviceManager.d.ts +0 -98
- package/lib/rust-crypto/DehydratedDeviceManager.d.ts.map +0 -1
- package/lib/rust-crypto/DehydratedDeviceManager.js +0 -285
- package/lib/rust-crypto/DehydratedDeviceManager.js.map +0 -1
- package/lib/rust-crypto/KeyClaimManager.d.ts +0 -33
- package/lib/rust-crypto/KeyClaimManager.d.ts.map +0 -1
- package/lib/rust-crypto/KeyClaimManager.js +0 -82
- package/lib/rust-crypto/KeyClaimManager.js.map +0 -1
- package/lib/rust-crypto/OutgoingRequestProcessor.d.ts +0 -43
- package/lib/rust-crypto/OutgoingRequestProcessor.d.ts.map +0 -1
- package/lib/rust-crypto/OutgoingRequestProcessor.js +0 -195
- package/lib/rust-crypto/OutgoingRequestProcessor.js.map +0 -1
- package/lib/rust-crypto/OutgoingRequestsManager.d.ts +0 -47
- package/lib/rust-crypto/OutgoingRequestsManager.d.ts.map +0 -1
- package/lib/rust-crypto/OutgoingRequestsManager.js +0 -148
- package/lib/rust-crypto/OutgoingRequestsManager.js.map +0 -1
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts +0 -120
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts.map +0 -1
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.js +0 -467
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.js.map +0 -1
- package/lib/rust-crypto/RoomEncryptor.d.ts +0 -98
- package/lib/rust-crypto/RoomEncryptor.d.ts.map +0 -1
- package/lib/rust-crypto/RoomEncryptor.js +0 -299
- package/lib/rust-crypto/RoomEncryptor.js.map +0 -1
- package/lib/rust-crypto/backup.d.ts +0 -254
- package/lib/rust-crypto/backup.d.ts.map +0 -1
- package/lib/rust-crypto/backup.js +0 -837
- package/lib/rust-crypto/backup.js.map +0 -1
- package/lib/rust-crypto/constants.d.ts +0 -3
- package/lib/rust-crypto/constants.d.ts.map +0 -1
- package/lib/rust-crypto/constants.js +0 -19
- package/lib/rust-crypto/constants.js.map +0 -1
- package/lib/rust-crypto/device-converter.d.ts +0 -28
- package/lib/rust-crypto/device-converter.d.ts.map +0 -1
- package/lib/rust-crypto/device-converter.js +0 -123
- package/lib/rust-crypto/device-converter.js.map +0 -1
- package/lib/rust-crypto/index.d.ts +0 -61
- package/lib/rust-crypto/index.d.ts.map +0 -1
- package/lib/rust-crypto/index.js +0 -152
- package/lib/rust-crypto/index.js.map +0 -1
- package/lib/rust-crypto/libolm_migration.d.ts +0 -81
- package/lib/rust-crypto/libolm_migration.d.ts.map +0 -1
- package/lib/rust-crypto/libolm_migration.js +0 -459
- package/lib/rust-crypto/libolm_migration.js.map +0 -1
- package/lib/rust-crypto/rust-crypto.d.ts +0 -556
- package/lib/rust-crypto/rust-crypto.d.ts.map +0 -1
- package/lib/rust-crypto/rust-crypto.js +0 -2016
- package/lib/rust-crypto/rust-crypto.js.map +0 -1
- package/lib/rust-crypto/secret-storage.d.ts +0 -22
- package/lib/rust-crypto/secret-storage.d.ts.map +0 -1
- package/lib/rust-crypto/secret-storage.js +0 -63
- package/lib/rust-crypto/secret-storage.js.map +0 -1
- package/lib/rust-crypto/verification.d.ts +0 -319
- package/lib/rust-crypto/verification.d.ts.map +0 -1
- package/lib/rust-crypto/verification.js +0 -816
- package/lib/rust-crypto/verification.js.map +0 -1
- package/lib/secret-storage.d.ts +0 -370
- package/lib/secret-storage.d.ts.map +0 -1
- package/lib/secret-storage.js +0 -466
- package/lib/secret-storage.js.map +0 -1
- package/lib/utils/decryptAESSecretStorageItem.d.ts +0 -12
- package/lib/utils/decryptAESSecretStorageItem.d.ts.map +0 -1
- package/lib/utils/decryptAESSecretStorageItem.js +0 -50
- package/lib/utils/decryptAESSecretStorageItem.js.map +0 -1
- package/lib/utils/encryptAESSecretStorageItem.d.ts +0 -16
- package/lib/utils/encryptAESSecretStorageItem.d.ts.map +0 -1
- package/lib/utils/encryptAESSecretStorageItem.js +0 -68
- package/lib/utils/encryptAESSecretStorageItem.js.map +0 -1
- package/lib/utils/internal/deriveKeys.d.ts +0 -10
- package/lib/utils/internal/deriveKeys.d.ts.map +0 -1
- package/lib/utils/internal/deriveKeys.js +0 -60
- package/lib/utils/internal/deriveKeys.js.map +0 -1
- package/lib/webrtc/audioContext.d.ts +0 -15
- package/lib/webrtc/audioContext.d.ts.map +0 -1
- package/lib/webrtc/audioContext.js +0 -46
- package/lib/webrtc/audioContext.js.map +0 -1
- package/lib/webrtc/call.d.ts +0 -560
- package/lib/webrtc/call.d.ts.map +0 -1
- package/lib/webrtc/call.js +0 -2541
- package/lib/webrtc/call.js.map +0 -1
- package/lib/webrtc/callEventHandler.d.ts +0 -37
- package/lib/webrtc/callEventHandler.d.ts.map +0 -1
- package/lib/webrtc/callEventHandler.js +0 -344
- package/lib/webrtc/callEventHandler.js.map +0 -1
- package/lib/webrtc/callEventTypes.d.ts +0 -73
- package/lib/webrtc/callEventTypes.d.ts.map +0 -1
- package/lib/webrtc/callEventTypes.js +0 -13
- package/lib/webrtc/callEventTypes.js.map +0 -1
- package/lib/webrtc/callFeed.d.ts +0 -128
- package/lib/webrtc/callFeed.d.ts.map +0 -1
- package/lib/webrtc/callFeed.js +0 -289
- package/lib/webrtc/callFeed.js.map +0 -1
- package/lib/webrtc/groupCall.d.ts +0 -323
- package/lib/webrtc/groupCall.d.ts.map +0 -1
- package/lib/webrtc/groupCall.js +0 -1337
- package/lib/webrtc/groupCall.js.map +0 -1
- package/lib/webrtc/groupCallEventHandler.d.ts +0 -31
- package/lib/webrtc/groupCallEventHandler.d.ts.map +0 -1
- package/lib/webrtc/groupCallEventHandler.js +0 -178
- package/lib/webrtc/groupCallEventHandler.js.map +0 -1
- package/lib/webrtc/mediaHandler.d.ts +0 -89
- package/lib/webrtc/mediaHandler.d.ts.map +0 -1
- package/lib/webrtc/mediaHandler.js +0 -437
- package/lib/webrtc/mediaHandler.js.map +0 -1
- package/lib/webrtc/stats/callFeedStatsReporter.d.ts +0 -8
- package/lib/webrtc/stats/callFeedStatsReporter.d.ts.map +0 -1
- package/lib/webrtc/stats/callFeedStatsReporter.js +0 -82
- package/lib/webrtc/stats/callFeedStatsReporter.js.map +0 -1
- package/lib/webrtc/stats/callStatsReportGatherer.d.ts +0 -25
- package/lib/webrtc/stats/callStatsReportGatherer.d.ts.map +0 -1
- package/lib/webrtc/stats/callStatsReportGatherer.js +0 -199
- package/lib/webrtc/stats/callStatsReportGatherer.js.map +0 -1
- package/lib/webrtc/stats/callStatsReportSummary.d.ts +0 -17
- package/lib/webrtc/stats/callStatsReportSummary.d.ts.map +0 -1
- package/lib/webrtc/stats/callStatsReportSummary.js +0 -1
- package/lib/webrtc/stats/callStatsReportSummary.js.map +0 -1
- package/lib/webrtc/stats/connectionStats.d.ts +0 -28
- package/lib/webrtc/stats/connectionStats.d.ts.map +0 -1
- package/lib/webrtc/stats/connectionStats.js +0 -26
- package/lib/webrtc/stats/connectionStats.js.map +0 -1
- package/lib/webrtc/stats/connectionStatsBuilder.d.ts +0 -5
- package/lib/webrtc/stats/connectionStatsBuilder.d.ts.map +0 -1
- package/lib/webrtc/stats/connectionStatsBuilder.js +0 -27
- package/lib/webrtc/stats/connectionStatsBuilder.js.map +0 -1
- package/lib/webrtc/stats/connectionStatsReportBuilder.d.ts +0 -7
- package/lib/webrtc/stats/connectionStatsReportBuilder.d.ts.map +0 -1
- package/lib/webrtc/stats/connectionStatsReportBuilder.js +0 -121
- package/lib/webrtc/stats/connectionStatsReportBuilder.js.map +0 -1
- package/lib/webrtc/stats/groupCallStats.d.ts +0 -22
- package/lib/webrtc/stats/groupCallStats.d.ts.map +0 -1
- package/lib/webrtc/stats/groupCallStats.js +0 -78
- package/lib/webrtc/stats/groupCallStats.js.map +0 -1
- package/lib/webrtc/stats/media/mediaSsrcHandler.d.ts +0 -10
- package/lib/webrtc/stats/media/mediaSsrcHandler.d.ts.map +0 -1
- package/lib/webrtc/stats/media/mediaSsrcHandler.js +0 -57
- package/lib/webrtc/stats/media/mediaSsrcHandler.js.map +0 -1
- package/lib/webrtc/stats/media/mediaTrackHandler.d.ts +0 -12
- package/lib/webrtc/stats/media/mediaTrackHandler.d.ts.map +0 -1
- package/lib/webrtc/stats/media/mediaTrackHandler.js +0 -62
- package/lib/webrtc/stats/media/mediaTrackHandler.js.map +0 -1
- package/lib/webrtc/stats/media/mediaTrackStats.d.ts +0 -86
- package/lib/webrtc/stats/media/mediaTrackStats.d.ts.map +0 -1
- package/lib/webrtc/stats/media/mediaTrackStats.js +0 -142
- package/lib/webrtc/stats/media/mediaTrackStats.js.map +0 -1
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.d.ts +0 -22
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.d.ts.map +0 -1
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.js +0 -76
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.js.map +0 -1
- package/lib/webrtc/stats/statsReport.d.ts +0 -99
- package/lib/webrtc/stats/statsReport.d.ts.map +0 -1
- package/lib/webrtc/stats/statsReport.js +0 -32
- package/lib/webrtc/stats/statsReport.js.map +0 -1
- package/lib/webrtc/stats/statsReportEmitter.d.ts +0 -15
- package/lib/webrtc/stats/statsReportEmitter.d.ts.map +0 -1
- package/lib/webrtc/stats/statsReportEmitter.js +0 -33
- package/lib/webrtc/stats/statsReportEmitter.js.map +0 -1
- package/lib/webrtc/stats/summaryStatsReportGatherer.d.ts +0 -16
- package/lib/webrtc/stats/summaryStatsReportGatherer.d.ts.map +0 -1
- package/lib/webrtc/stats/summaryStatsReportGatherer.js +0 -116
- package/lib/webrtc/stats/summaryStatsReportGatherer.js.map +0 -1
- package/lib/webrtc/stats/trackStatsBuilder.d.ts +0 -19
- package/lib/webrtc/stats/trackStatsBuilder.d.ts.map +0 -1
- package/lib/webrtc/stats/trackStatsBuilder.js +0 -168
- package/lib/webrtc/stats/trackStatsBuilder.js.map +0 -1
- package/lib/webrtc/stats/transportStats.d.ts +0 -11
- package/lib/webrtc/stats/transportStats.d.ts.map +0 -1
- package/lib/webrtc/stats/transportStats.js +0 -1
- package/lib/webrtc/stats/transportStats.js.map +0 -1
- package/lib/webrtc/stats/transportStatsBuilder.d.ts +0 -5
- package/lib/webrtc/stats/transportStatsBuilder.d.ts.map +0 -1
- package/lib/webrtc/stats/transportStatsBuilder.js +0 -34
- package/lib/webrtc/stats/transportStatsBuilder.js.map +0 -1
- package/lib/webrtc/stats/valueFormatter.d.ts +0 -4
- package/lib/webrtc/stats/valueFormatter.d.ts.map +0 -1
- package/lib/webrtc/stats/valueFormatter.js +0 -25
- package/lib/webrtc/stats/valueFormatter.js.map +0 -1
- package/src/@types/AESEncryptedSecretStoragePayload.ts +0 -29
- package/src/@types/crypto.ts +0 -73
- package/src/@types/matrix-sdk-crypto-wasm.d.ts +0 -44
- package/src/common-crypto/CryptoBackend.ts +0 -302
- package/src/common-crypto/README.md +0 -4
- package/src/common-crypto/key-passphrase.ts +0 -43
- package/src/crypto/CrossSigning.ts +0 -773
- package/src/crypto/DeviceList.ts +0 -989
- package/src/crypto/EncryptionSetup.ts +0 -351
- package/src/crypto/OlmDevice.ts +0 -1500
- package/src/crypto/OutgoingRoomKeyRequestManager.ts +0 -485
- package/src/crypto/RoomList.ts +0 -70
- package/src/crypto/SecretSharing.ts +0 -240
- package/src/crypto/SecretStorage.ts +0 -136
- package/src/crypto/aes.ts +0 -23
- package/src/crypto/algorithms/base.ts +0 -236
- package/src/crypto/algorithms/index.ts +0 -20
- package/src/crypto/algorithms/megolm.ts +0 -2216
- package/src/crypto/algorithms/olm.ts +0 -381
- package/src/crypto/api.ts +0 -70
- package/src/crypto/backup.ts +0 -922
- package/src/crypto/crypto.ts +0 -18
- package/src/crypto/dehydration.ts +0 -272
- package/src/crypto/device-converter.ts +0 -45
- package/src/crypto/deviceinfo.ts +0 -158
- package/src/crypto/index.ts +0 -4418
- package/src/crypto/key_passphrase.ts +0 -42
- package/src/crypto/keybackup.ts +0 -47
- package/src/crypto/olmlib.ts +0 -539
- package/src/crypto/recoverykey.ts +0 -18
- package/src/crypto/store/base.ts +0 -348
- package/src/crypto/store/indexeddb-crypto-store-backend.ts +0 -1250
- package/src/crypto/store/indexeddb-crypto-store.ts +0 -845
- package/src/crypto/store/localStorage-crypto-store.ts +0 -579
- package/src/crypto/store/memory-crypto-store.ts +0 -680
- package/src/crypto/verification/Base.ts +0 -409
- package/src/crypto/verification/Error.ts +0 -76
- package/src/crypto/verification/IllegalMethod.ts +0 -50
- package/src/crypto/verification/QRCode.ts +0 -310
- package/src/crypto/verification/SAS.ts +0 -494
- package/src/crypto/verification/SASDecimal.ts +0 -37
- package/src/crypto/verification/request/Channel.ts +0 -34
- package/src/crypto/verification/request/InRoomChannel.ts +0 -371
- package/src/crypto/verification/request/ToDeviceChannel.ts +0 -354
- package/src/crypto/verification/request/VerificationRequest.ts +0 -976
- package/src/crypto-api/CryptoEvent.ts +0 -93
- package/src/crypto-api/CryptoEventHandlerMap.ts +0 -32
- package/src/crypto-api/index.ts +0 -1175
- package/src/crypto-api/key-passphrase.ts +0 -58
- package/src/crypto-api/keybackup.ts +0 -115
- package/src/crypto-api/recovery-key.ts +0 -69
- package/src/crypto-api/verification.ts +0 -408
- package/src/matrixrtc/CallMembership.ts +0 -247
- package/src/matrixrtc/LivekitFocus.ts +0 -39
- package/src/matrixrtc/MatrixRTCSession.ts +0 -1319
- package/src/matrixrtc/MatrixRTCSessionManager.ts +0 -166
- package/src/matrixrtc/focus.ts +0 -25
- package/src/matrixrtc/index.ts +0 -22
- package/src/matrixrtc/types.ts +0 -36
- package/src/rendezvous/MSC4108SignInWithQR.ts +0 -444
- package/src/rendezvous/RendezvousChannel.ts +0 -48
- package/src/rendezvous/RendezvousCode.ts +0 -25
- package/src/rendezvous/RendezvousError.ts +0 -26
- package/src/rendezvous/RendezvousFailureReason.ts +0 -49
- package/src/rendezvous/RendezvousIntent.ts +0 -20
- package/src/rendezvous/RendezvousTransport.ts +0 -58
- package/src/rendezvous/channels/MSC4108SecureChannel.ts +0 -270
- package/src/rendezvous/channels/index.ts +0 -17
- package/src/rendezvous/index.ts +0 -25
- package/src/rendezvous/transports/MSC4108RendezvousSession.ts +0 -270
- package/src/rendezvous/transports/index.ts +0 -17
- package/src/rust-crypto/CrossSigningIdentity.ts +0 -183
- package/src/rust-crypto/DehydratedDeviceManager.ts +0 -306
- package/src/rust-crypto/KeyClaimManager.ts +0 -86
- package/src/rust-crypto/OutgoingRequestProcessor.ts +0 -236
- package/src/rust-crypto/OutgoingRequestsManager.ts +0 -143
- package/src/rust-crypto/PerSessionKeyBackupDownloader.ts +0 -501
- package/src/rust-crypto/RoomEncryptor.ts +0 -352
- package/src/rust-crypto/backup.ts +0 -881
- package/src/rust-crypto/constants.ts +0 -18
- package/src/rust-crypto/device-converter.ts +0 -128
- package/src/rust-crypto/index.ts +0 -237
- package/src/rust-crypto/libolm_migration.ts +0 -530
- package/src/rust-crypto/rust-crypto.ts +0 -2205
- package/src/rust-crypto/secret-storage.ts +0 -60
- package/src/rust-crypto/verification.ts +0 -830
- package/src/secret-storage.ts +0 -693
- package/src/utils/decryptAESSecretStorageItem.ts +0 -54
- package/src/utils/encryptAESSecretStorageItem.ts +0 -73
- package/src/utils/internal/deriveKeys.ts +0 -63
- package/src/webrtc/audioContext.ts +0 -44
- package/src/webrtc/call.ts +0 -3074
- package/src/webrtc/callEventHandler.ts +0 -425
- package/src/webrtc/callEventTypes.ts +0 -93
- package/src/webrtc/callFeed.ts +0 -364
- package/src/webrtc/groupCall.ts +0 -1735
- package/src/webrtc/groupCallEventHandler.ts +0 -234
- package/src/webrtc/mediaHandler.ts +0 -484
- package/src/webrtc/stats/callFeedStatsReporter.ts +0 -94
- package/src/webrtc/stats/callStatsReportGatherer.ts +0 -219
- package/src/webrtc/stats/callStatsReportSummary.ts +0 -30
- package/src/webrtc/stats/connectionStats.ts +0 -47
- package/src/webrtc/stats/connectionStatsBuilder.ts +0 -28
- package/src/webrtc/stats/connectionStatsReportBuilder.ts +0 -140
- package/src/webrtc/stats/groupCallStats.ts +0 -93
- package/src/webrtc/stats/media/mediaSsrcHandler.ts +0 -57
- package/src/webrtc/stats/media/mediaTrackHandler.ts +0 -76
- package/src/webrtc/stats/media/mediaTrackStats.ts +0 -176
- package/src/webrtc/stats/media/mediaTrackStatsHandler.ts +0 -90
- package/src/webrtc/stats/statsReport.ts +0 -133
- package/src/webrtc/stats/statsReportEmitter.ts +0 -49
- package/src/webrtc/stats/summaryStatsReportGatherer.ts +0 -148
- package/src/webrtc/stats/trackStatsBuilder.ts +0 -207
- package/src/webrtc/stats/transportStats.ts +0 -26
- package/src/webrtc/stats/transportStatsBuilder.ts +0 -48
- package/src/webrtc/stats/valueFormatter.ts +0 -27
package/lib/digest.d.ts
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
* Computes a SHA-256 hash of a string (after utf-8 encoding) and returns it as an ArrayBuffer.
|
3
3
|
*
|
4
4
|
* @param plaintext The string to hash
|
5
|
-
* @returns An
|
5
|
+
* @returns An Uint8Array containing the SHA-256 hash of the input string
|
6
6
|
* @throws If the subtle crypto API is not available, for example if the code is running
|
7
7
|
* in a web page with an insecure context (eg. served over plain HTTP).
|
8
8
|
*/
|
9
|
-
export declare function sha256(plaintext: string): Promise<
|
9
|
+
export declare function sha256(plaintext: string): Promise<Uint8Array>;
|
10
10
|
//# sourceMappingURL=digest.d.ts.map
|
package/lib/digest.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"digest.d.ts","sourceRoot":"","sources":["../src/digest.ts"],"names":[],"mappings":"AAgBA;;;;;;;GAOG;AACH,wBAAsB,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,
|
1
|
+
{"version":3,"file":"digest.d.ts","sourceRoot":"","sources":["../src/digest.ts"],"names":[],"mappings":"AAgBA;;;;;;;GAOG;AACH,wBAAsB,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CASnE"}
|
package/lib/digest.js
CHANGED
@@ -19,7 +19,7 @@ limitations under the License.
|
|
19
19
|
* Computes a SHA-256 hash of a string (after utf-8 encoding) and returns it as an ArrayBuffer.
|
20
20
|
*
|
21
21
|
* @param plaintext The string to hash
|
22
|
-
* @returns An
|
22
|
+
* @returns An Uint8Array containing the SHA-256 hash of the input string
|
23
23
|
* @throws If the subtle crypto API is not available, for example if the code is running
|
24
24
|
* in a web page with an insecure context (eg. served over plain HTTP).
|
25
25
|
*/
|
@@ -33,7 +33,7 @@ function _sha() {
|
|
33
33
|
}
|
34
34
|
var utf8 = new TextEncoder().encode(plaintext);
|
35
35
|
var digest = yield globalThis.crypto.subtle.digest("SHA-256", utf8);
|
36
|
-
return digest;
|
36
|
+
return new Uint8Array(digest);
|
37
37
|
});
|
38
38
|
return _sha.apply(this, arguments);
|
39
39
|
}
|
package/lib/digest.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"digest.js","names":["sha256","_x","_sha","apply","arguments","_asyncToGenerator","plaintext","globalThis","crypto","subtle","Error","utf8","TextEncoder","encode","digest"],"sources":["../src/digest.ts"],"sourcesContent":["/*\nCopyright 2024 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * Computes a SHA-256 hash of a string (after utf-8 encoding) and returns it as an ArrayBuffer.\n *\n * @param plaintext The string to hash\n * @returns An
|
1
|
+
{"version":3,"file":"digest.js","names":["sha256","_x","_sha","apply","arguments","_asyncToGenerator","plaintext","globalThis","crypto","subtle","Error","utf8","TextEncoder","encode","digest","Uint8Array"],"sources":["../src/digest.ts"],"sourcesContent":["/*\nCopyright 2024 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * Computes a SHA-256 hash of a string (after utf-8 encoding) and returns it as an ArrayBuffer.\n *\n * @param plaintext The string to hash\n * @returns An Uint8Array containing the SHA-256 hash of the input string\n * @throws If the subtle crypto API is not available, for example if the code is running\n * in a web page with an insecure context (eg. served over plain HTTP).\n */\nexport async function sha256(plaintext: string): Promise<Uint8Array> {\n if (!globalThis.crypto.subtle) {\n throw new Error(\"Crypto.subtle is not available: insecure context?\");\n }\n const utf8 = new TextEncoder().encode(plaintext);\n\n const digest = await globalThis.crypto.subtle.digest(\"SHA-256\", utf8);\n\n return new Uint8Array(digest);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAsBA,MAAMA,CAAAC,EAAA;EAAA,OAAAC,IAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;AAS3B,SAAAF,KAAA;EAAAA,IAAA,GAAAG,iBAAA,CATM,WAAsBC,SAAiB,EAAuB;IACjE,IAAI,CAACC,UAAU,CAACC,MAAM,CAACC,MAAM,EAAE;MAC3B,MAAM,IAAIC,KAAK,CAAC,mDAAmD,CAAC;IACxE;IACA,IAAMC,IAAI,GAAG,IAAIC,WAAW,CAAC,CAAC,CAACC,MAAM,CAACP,SAAS,CAAC;IAEhD,IAAMQ,MAAM,SAASP,UAAU,CAACC,MAAM,CAACC,MAAM,CAACK,MAAM,CAAC,SAAS,EAAEH,IAAI,CAAC;IAErE,OAAO,IAAII,UAAU,CAACD,MAAM,CAAC;EACjC,CAAC;EAAA,OAAAZ,IAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA","ignoreList":[]}
|
package/lib/embedded.d.ts
CHANGED
@@ -1,13 +1,10 @@
|
|
1
1
|
import { WidgetApi } from "matrix-widget-api";
|
2
|
-
import { MatrixEvent } from "./models/event.ts";
|
3
2
|
import { ISendEventResponse, SendDelayedEventRequestOpts, SendDelayedEventResponse, UpdateDelayedEventAction } from "./@types/requests.ts";
|
4
3
|
import { StateEvents } from "./@types/event.ts";
|
5
4
|
import { MatrixClient, IMatrixClientCreateOpts, IStartClientOpts, SendToDeviceContentMap, IOpenIDToken } from "./client.ts";
|
6
5
|
import { SyncState } from "./sync.ts";
|
7
6
|
import { Room } from "./models/room.ts";
|
8
7
|
import { ToDeviceBatch } from "./models/ToDeviceMessage.ts";
|
9
|
-
import { DeviceInfo } from "./crypto/deviceinfo.ts";
|
10
|
-
import { IOlmDevice } from "./crypto/algorithms/megolm.ts";
|
11
8
|
interface IStateEventRequest {
|
12
9
|
eventType: string;
|
13
10
|
stateKey?: string;
|
@@ -100,8 +97,6 @@ export declare class RoomWidgetClient extends MatrixClient {
|
|
100
97
|
startClient(opts?: IStartClientOpts): Promise<void>;
|
101
98
|
stopClient(): void;
|
102
99
|
joinRoom(roomIdOrAlias: string): Promise<Room>;
|
103
|
-
protected encryptAndSendEvent(room: Room, event: MatrixEvent): Promise<ISendEventResponse>;
|
104
|
-
protected encryptAndSendEvent(room: Room, event: MatrixEvent, delayOpts: SendDelayedEventRequestOpts): Promise<SendDelayedEventResponse>;
|
105
100
|
sendStateEvent(roomId: string, eventType: string, content: any, stateKey?: string): Promise<ISendEventResponse>;
|
106
101
|
/**
|
107
102
|
* @experimental This currently relies on an unstable MSC (MSC4140).
|
@@ -115,29 +110,12 @@ export declare class RoomWidgetClient extends MatrixClient {
|
|
115
110
|
sendToDevice(eventType: string, contentMap: SendToDeviceContentMap): Promise<{}>;
|
116
111
|
getOpenIdToken(): Promise<IOpenIDToken>;
|
117
112
|
queueToDevice({ eventType, batch }: ToDeviceBatch): Promise<void>;
|
118
|
-
encryptAndSendToDevices(userDeviceInfoArr: IOlmDevice<DeviceInfo>[], payload: object): Promise<void>;
|
119
|
-
/**
|
120
|
-
* Send an event to a specific list of devices via the widget API. Optionally encrypts the event.
|
121
|
-
*
|
122
|
-
* If you are using a full MatrixClient you would be calling {@link MatrixClient.getCrypto().encryptToDeviceMessages()} followed
|
123
|
-
* by {@link MatrixClient.queueToDevice}.
|
124
|
-
*
|
125
|
-
* However, this is combined into a single step when running as an embedded widget client. So, we expose this method for those
|
126
|
-
* that need it.
|
127
|
-
*
|
128
|
-
* @param eventType - Type of the event to send.
|
129
|
-
* @param encrypted - Whether the event should be encrypted.
|
130
|
-
* @param contentMap - The content to send. Map from user_id to device_id to content object.
|
131
|
-
*/
|
132
|
-
sendToDeviceViaWidgetApi(eventType: string, encrypted: boolean, contentMap: SendToDeviceContentMap): Promise<void>;
|
133
|
-
checkTurnServers(): Promise<boolean>;
|
134
113
|
getSyncState(): SyncState | null;
|
135
114
|
private setSyncState;
|
136
115
|
private ack;
|
137
116
|
private updateTxId;
|
138
117
|
private onEvent;
|
139
118
|
private onToDevice;
|
140
|
-
private watchTurnServers;
|
141
119
|
}
|
142
120
|
export {};
|
143
121
|
//# sourceMappingURL=embedded.d.ts.map
|
package/lib/embedded.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"embedded.d.ts","sourceRoot":"","sources":["../src/embedded.ts"],"names":[],"mappings":"AAgBA,OAAO,EACH,SAAS,EAaZ,MAAM,mBAAmB,CAAC;
|
1
|
+
{"version":3,"file":"embedded.d.ts","sourceRoot":"","sources":["../src/embedded.ts"],"names":[],"mappings":"AAgBA,OAAO,EACH,SAAS,EAaZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACH,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,EACxB,wBAAwB,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACH,YAAY,EAEZ,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,EAEf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAW,SAAS,EAAE,MAAM,WAAW,CAAC;AAI/C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAmB,MAAM,6BAA6B,CAAC;AAI7E,UAAU,kBAAkB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAEjC;;OAEG;IACH,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACjC;;OAEG;IACH,YAAY,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAEpC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,oBAAY,qBAAqB;IAC7B,oBAAoB,sCAAsC;CAC7D;AACD,MAAM,MAAM,eAAe,GAAG;IAAE,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAC3F;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,YAAY;IAoB1C,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM;IArB3B,OAAO,CAAC,IAAI,CAAC,CAAO;IACpB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgB;IAC/C,OAAO,CAAC,SAAS,CAAC,CAAkB;IACpC,OAAO,CAAC,SAAS,CAA0B;IAE3C,OAAO,CAAC,wBAAwB,CAAgE;IAChG,OAAO,CAAC,YAAY,CAAmE;IAEvF;;;;;;;;;OASG;gBAEkB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,aAAa,EAC3B,MAAM,EAAE,MAAM,EAC/B,IAAI,EAAE,uBAAuB,EAC7B,iBAAiB,EAAE,OAAO;IA+FjB,WAAW,CAAC,IAAI,GAAE,gBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyD7D,UAAU,IAAI,IAAI;IAQZ,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9C,cAAc,CACvB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,GAAG,EACZ,QAAQ,SAAK,GACd,OAAO,CAAC,kBAAkB,CAAC;IAQ9B;;OAEG;IAEU,+BAA+B,CAAC,CAAC,SAAS,MAAM,WAAW,EACpE,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,2BAA2B,EACtC,SAAS,EAAE,CAAC,EACZ,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,EACvB,QAAQ,SAAK,GACd,OAAO,CAAC,wBAAwB,CAAC;IAgBpC,OAAO,CAAC,gCAAgC;IAOxC;;OAEG;IAEU,4BAA4B,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,EAAE,CAAC;IAQ5F,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,sBAAsB,GAAG,OAAO,CAAC,EAAE,CAAC;IAKhF,cAAc,IAAI,OAAO,CAAC,YAAY,CAAC;IAYvC,aAAa,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAWvE,YAAY,IAAI,SAAS,GAAG,IAAI;IAIvC,OAAO,CAAC,YAAY;YAMN,GAAG;IAIjB,OAAO,CAAC,UAAU,CAwChB;IAEF,OAAO,CAAC,OAAO,CA+Cb;IAEF,OAAO,CAAC,UAAU,CAYhB;CACL"}
|
package/lib/embedded.js
CHANGED
@@ -2,8 +2,6 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
5
|
-
function _asyncIterator(r) { var n, t, o, e = 2; for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = "@@asyncIterator", o = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
|
6
|
-
function AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, return: function _return(r) { var n = this.s.return; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, throw: function _throw(r) { var n = this.s.return; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }
|
7
5
|
/*
|
8
6
|
Copyright 2022 The Matrix.org Foundation C.I.C.
|
9
7
|
|
@@ -21,8 +19,7 @@ limitations under the License.
|
|
21
19
|
*/
|
22
20
|
|
23
21
|
import { WidgetApiToWidgetAction, WidgetApiResponseError, MatrixCapabilities } from "matrix-widget-api";
|
24
|
-
import { MatrixEvent
|
25
|
-
import { EventType } from "./@types/event.js";
|
22
|
+
import { MatrixEvent } from "./models/event.js";
|
26
23
|
import { logger } from "./logger.js";
|
27
24
|
import { MatrixClient, ClientEvent, UNSTABLE_MSC4140_DELAYED_EVENTS } from "./client.js";
|
28
25
|
import { SyncApi, SyncState } from "./sync.js";
|
@@ -118,14 +115,41 @@ export class RoomWidgetClient extends MatrixClient {
|
|
118
115
|
// Verify the room ID matches, since it's possible for the client to
|
119
116
|
// send us events from other rooms if this widget is always on screen
|
120
117
|
if (ev.detail.data.room_id === _this.roomId) {
|
121
|
-
var
|
118
|
+
var event = new MatrixEvent(ev.detail.data);
|
122
119
|
|
123
120
|
// Only inject once we have update the txId
|
124
|
-
yield _this.updateTxId(
|
125
|
-
|
126
|
-
|
121
|
+
yield _this.updateTxId(event);
|
122
|
+
|
123
|
+
// The widget API does not tell us whether a state event came from `state_after` or not so we assume legacy behaviour for now.
|
124
|
+
if (_this.syncApi instanceof SyncApi) {
|
125
|
+
// The code will want to be something like:
|
126
|
+
// ```
|
127
|
+
// if (!params.addToTimeline && !params.addToState) {
|
128
|
+
// // Passing undefined for `stateAfterEventList` makes `injectRoomEvents` run in "legacy mode"
|
129
|
+
// // -> state events part of the `timelineEventList` parameter will update the state.
|
130
|
+
// this.injectRoomEvents(this.room!, [], undefined, [event]);
|
131
|
+
// } else {
|
132
|
+
// this.injectRoomEvents(this.room!, undefined, params.addToState ? [event] : [], params.addToTimeline ? [event] : []);
|
133
|
+
// }
|
134
|
+
// ```
|
135
|
+
|
136
|
+
// Passing undefined for `stateAfterEventList` allows will make `injectRoomEvents` run in legacy mode
|
137
|
+
// -> state events in `timelineEventList` will update the state.
|
138
|
+
yield _this.syncApi.injectRoomEvents(_this.room, [], undefined, [event]);
|
139
|
+
} else {
|
140
|
+
// The code will want to be something like:
|
141
|
+
// ```
|
142
|
+
// if (!params.addToTimeline && !params.addToState) {
|
143
|
+
// this.injectRoomEvents(this.room!, [], [event]);
|
144
|
+
// } else {
|
145
|
+
// this.injectRoomEvents(this.room!, params.addToState ? [event] : [], params.addToTimeline ? [event] : []);
|
146
|
+
// }
|
147
|
+
// ```
|
148
|
+
yield _this.syncApi.injectRoomEvents(_this.room, [], [event]); // Sliding Sync
|
149
|
+
}
|
150
|
+
_this.emit(ClientEvent.Event, event);
|
127
151
|
_this.setSyncState(SyncState.Syncing);
|
128
|
-
logger.info("Received event ".concat(
|
152
|
+
logger.info("Received event ".concat(event.getId(), " ").concat(event.getType(), " ").concat(event.getStateKey()));
|
129
153
|
} else {
|
130
154
|
var {
|
131
155
|
event_id: eventId,
|
@@ -147,8 +171,6 @@ export class RoomWidgetClient extends MatrixClient {
|
|
147
171
|
sender: ev.detail.data.sender,
|
148
172
|
content: ev.detail.data.content
|
149
173
|
});
|
150
|
-
// Mark the event as encrypted if it was, using fake contents and keys since those are unknown to us
|
151
|
-
if (ev.detail.data.encrypted) event.makeEncrypted(EventType.RoomMessageEncrypted, {}, "", "");
|
152
174
|
_this.emit(ClientEvent.ToDeviceEvent, event);
|
153
175
|
_this.setSyncState(SyncState.Syncing);
|
154
176
|
yield _this.ack(ev);
|
@@ -257,7 +279,7 @@ export class RoomWidgetClient extends MatrixClient {
|
|
257
279
|
// still has some valuable helper methods that we make use of, so we
|
258
280
|
// instantiate it anyways
|
259
281
|
if (opts.slidingSync) {
|
260
|
-
_this2.syncApi = new SlidingSyncSdk(opts.slidingSync, _this2, opts
|
282
|
+
_this2.syncApi = new SlidingSyncSdk(opts.slidingSync, _this2, opts);
|
261
283
|
} else {
|
262
284
|
_this2.syncApi = new SyncApi(_this2, opts, _this2.buildSyncApiOptions());
|
263
285
|
}
|
@@ -276,7 +298,13 @@ export class RoomWidgetClient extends MatrixClient {
|
|
276
298
|
} = _ref8;
|
277
299
|
var rawEvents = yield _this2.widgetApi.readStateEvents(eventType, undefined, stateKey, [_this2.roomId]);
|
278
300
|
var events = rawEvents.map(rawEvent => new MatrixEvent(rawEvent));
|
279
|
-
|
301
|
+
if (_this2.syncApi instanceof SyncApi) {
|
302
|
+
// Passing undefined for `stateAfterEventList` allows will make `injectRoomEvents` run in legacy mode
|
303
|
+
// -> state events in `timelineEventList` will update the state.
|
304
|
+
yield _this2.syncApi.injectRoomEvents(_this2.room, undefined, events);
|
305
|
+
} else {
|
306
|
+
yield _this2.syncApi.injectRoomEvents(_this2.room, events); // Sliding Sync
|
307
|
+
}
|
280
308
|
events.forEach(event => {
|
281
309
|
_this2.emit(ClientEvent.Event, event);
|
282
310
|
logger.info("Backfilled event ".concat(event.getId(), " ").concat(event.getType(), " ").concat(event.getStateKey()));
|
@@ -294,10 +322,6 @@ export class RoomWidgetClient extends MatrixClient {
|
|
294
322
|
}
|
295
323
|
_this2.setSyncState(SyncState.Syncing);
|
296
324
|
logger.info("Finished backfilling events");
|
297
|
-
_this2.matrixRTC.start();
|
298
|
-
|
299
|
-
// Watch for TURN servers, if requested
|
300
|
-
if (_this2.capabilities.turnServers) _this2.watchTurnServers();
|
301
325
|
})();
|
302
326
|
}
|
303
327
|
stopClient() {
|
@@ -313,55 +337,12 @@ export class RoomWidgetClient extends MatrixClient {
|
|
313
337
|
throw new Error("Unknown room: ".concat(roomIdOrAlias));
|
314
338
|
})();
|
315
339
|
}
|
316
|
-
encryptAndSendEvent(room, event, delayOpts) {
|
317
|
-
var _this4 = this;
|
318
|
-
return _asyncToGenerator(function* () {
|
319
|
-
// We need to extend the content with the redacts parameter
|
320
|
-
// The js sdk uses event.redacts but the widget api uses event.content.redacts
|
321
|
-
// This will be converted back to event.redacts in the widget driver.
|
322
|
-
var content = event.event.redacts ? _objectSpread(_objectSpread({}, event.getContent()), {}, {
|
323
|
-
redacts: event.event.redacts
|
324
|
-
}) : event.getContent();
|
325
|
-
|
326
|
-
// Delayed event special case.
|
327
|
-
if (delayOpts) {
|
328
|
-
// TODO: updatePendingEvent for delayed events?
|
329
|
-
var _response = yield _this4.widgetApi.sendRoomEvent(event.getType(), content, room.roomId, "delay" in delayOpts ? delayOpts.delay : undefined, "parent_delay_id" in delayOpts ? delayOpts.parent_delay_id : undefined);
|
330
|
-
return _this4.validateSendDelayedEventResponse(_response);
|
331
|
-
}
|
332
|
-
var txId = event.getTxnId();
|
333
|
-
// Add the txnId to the pending list (still with unknown evID)
|
334
|
-
if (txId) _this4.pendingSendingEventsTxId.push({
|
335
|
-
type: event.getType(),
|
336
|
-
id: undefined,
|
337
|
-
txId
|
338
|
-
});
|
339
|
-
var response;
|
340
|
-
try {
|
341
|
-
response = yield _this4.widgetApi.sendRoomEvent(event.getType(), content, room.roomId);
|
342
|
-
} catch (e) {
|
343
|
-
_this4.updatePendingEventStatus(room, event, EventStatus.NOT_SENT);
|
344
|
-
throw e;
|
345
|
-
}
|
346
|
-
// This also checks for an event id on the response
|
347
|
-
room.updatePendingEvent(event, EventStatus.SENT, response.event_id);
|
348
|
-
|
349
|
-
// Update the pending events list with the eventId
|
350
|
-
_this4.pendingSendingEventsTxId.forEach(p => {
|
351
|
-
if (p.txId === txId) p.id = response.event_id;
|
352
|
-
});
|
353
|
-
_this4.eventEmitter.emit(RoomWidgetClientEvent.PendingEventsChanged);
|
354
|
-
return {
|
355
|
-
event_id: response.event_id
|
356
|
-
};
|
357
|
-
})();
|
358
|
-
}
|
359
340
|
sendStateEvent(roomId, eventType, content) {
|
360
341
|
var _arguments2 = arguments,
|
361
|
-
|
342
|
+
_this4 = this;
|
362
343
|
return _asyncToGenerator(function* () {
|
363
344
|
var stateKey = _arguments2.length > 3 && _arguments2[3] !== undefined ? _arguments2[3] : "";
|
364
|
-
var response = yield
|
345
|
+
var response = yield _this4.widgetApi.sendStateEvent(eventType, stateKey, content, roomId);
|
365
346
|
if (response.event_id === undefined) {
|
366
347
|
throw new Error("'event_id' absent from response to an event request");
|
367
348
|
}
|
@@ -377,14 +358,14 @@ export class RoomWidgetClient extends MatrixClient {
|
|
377
358
|
// eslint-disable-next-line
|
378
359
|
_unstable_sendDelayedStateEvent(roomId, delayOpts, eventType, content) {
|
379
360
|
var _arguments3 = arguments,
|
380
|
-
|
361
|
+
_this5 = this;
|
381
362
|
return _asyncToGenerator(function* () {
|
382
363
|
var stateKey = _arguments3.length > 4 && _arguments3[4] !== undefined ? _arguments3[4] : "";
|
383
|
-
if (!(yield
|
364
|
+
if (!(yield _this5.doesServerSupportUnstableFeature(UNSTABLE_MSC4140_DELAYED_EVENTS))) {
|
384
365
|
throw Error("Server does not support the delayed events API");
|
385
366
|
}
|
386
|
-
var response = yield
|
387
|
-
return
|
367
|
+
var response = yield _this5.widgetApi.sendStateEvent(eventType, stateKey, content, roomId, "delay" in delayOpts ? delayOpts.delay : undefined, "parent_delay_id" in delayOpts ? delayOpts.parent_delay_id : undefined);
|
368
|
+
return _this5.validateSendDelayedEventResponse(response);
|
388
369
|
})();
|
389
370
|
}
|
390
371
|
validateSendDelayedEventResponse(response) {
|
@@ -401,25 +382,25 @@ export class RoomWidgetClient extends MatrixClient {
|
|
401
382
|
*/
|
402
383
|
// eslint-disable-next-line
|
403
384
|
_unstable_updateDelayedEvent(delayId, action) {
|
404
|
-
var
|
385
|
+
var _this6 = this;
|
405
386
|
return _asyncToGenerator(function* () {
|
406
|
-
if (!(yield
|
387
|
+
if (!(yield _this6.doesServerSupportUnstableFeature(UNSTABLE_MSC4140_DELAYED_EVENTS))) {
|
407
388
|
throw Error("Server does not support the delayed events API");
|
408
389
|
}
|
409
|
-
return yield
|
390
|
+
return yield _this6.widgetApi.updateDelayedEvent(delayId, action);
|
410
391
|
})();
|
411
392
|
}
|
412
393
|
sendToDevice(eventType, contentMap) {
|
413
|
-
var
|
394
|
+
var _this7 = this;
|
414
395
|
return _asyncToGenerator(function* () {
|
415
|
-
yield
|
396
|
+
yield _this7.widgetApi.sendToDevice(eventType, false, recursiveMapToObject(contentMap));
|
416
397
|
return {};
|
417
398
|
})();
|
418
399
|
}
|
419
400
|
getOpenIdToken() {
|
420
|
-
var
|
401
|
+
var _this8 = this;
|
421
402
|
return _asyncToGenerator(function* () {
|
422
|
-
var token = yield
|
403
|
+
var token = yield _this8.widgetApi.requestOpenIDConnectToken();
|
423
404
|
// the IOpenIDCredentials from the widget-api and IOpenIDToken form the matrix-js-sdk are compatible.
|
424
405
|
// we still recreate the token to make this transparent and catch'able by the linter in case the types change in the future.
|
425
406
|
return {
|
@@ -431,7 +412,7 @@ export class RoomWidgetClient extends MatrixClient {
|
|
431
412
|
})();
|
432
413
|
}
|
433
414
|
queueToDevice(_ref10) {
|
434
|
-
var
|
415
|
+
var _this9 = this;
|
435
416
|
return _asyncToGenerator(function* () {
|
436
417
|
var {
|
437
418
|
eventType,
|
@@ -446,52 +427,7 @@ export class RoomWidgetClient extends MatrixClient {
|
|
446
427
|
} of batch) {
|
447
428
|
contentMap.getOrCreate(userId).set(deviceId, payload);
|
448
429
|
}
|
449
|
-
yield
|
450
|
-
})();
|
451
|
-
}
|
452
|
-
encryptAndSendToDevices(userDeviceInfoArr, payload) {
|
453
|
-
var _this11 = this;
|
454
|
-
return _asyncToGenerator(function* () {
|
455
|
-
// map: user Id → device Id → payload
|
456
|
-
var contentMap = new MapWithDefault(() => new Map());
|
457
|
-
for (var {
|
458
|
-
userId,
|
459
|
-
deviceInfo: {
|
460
|
-
deviceId
|
461
|
-
}
|
462
|
-
} of userDeviceInfoArr) {
|
463
|
-
contentMap.getOrCreate(userId).set(deviceId, payload);
|
464
|
-
}
|
465
|
-
yield _this11.widgetApi.sendToDevice(payload.type, true, recursiveMapToObject(contentMap));
|
466
|
-
})();
|
467
|
-
}
|
468
|
-
|
469
|
-
/**
|
470
|
-
* Send an event to a specific list of devices via the widget API. Optionally encrypts the event.
|
471
|
-
*
|
472
|
-
* If you are using a full MatrixClient you would be calling {@link MatrixClient.getCrypto().encryptToDeviceMessages()} followed
|
473
|
-
* by {@link MatrixClient.queueToDevice}.
|
474
|
-
*
|
475
|
-
* However, this is combined into a single step when running as an embedded widget client. So, we expose this method for those
|
476
|
-
* that need it.
|
477
|
-
*
|
478
|
-
* @param eventType - Type of the event to send.
|
479
|
-
* @param encrypted - Whether the event should be encrypted.
|
480
|
-
* @param contentMap - The content to send. Map from user_id to device_id to content object.
|
481
|
-
*/
|
482
|
-
sendToDeviceViaWidgetApi(eventType, encrypted, contentMap) {
|
483
|
-
var _this12 = this;
|
484
|
-
return _asyncToGenerator(function* () {
|
485
|
-
yield _this12.widgetApi.sendToDevice(eventType, encrypted, recursiveMapToObject(contentMap));
|
486
|
-
})();
|
487
|
-
}
|
488
|
-
|
489
|
-
// Overridden since we get TURN servers automatically over the widget API,
|
490
|
-
// and this method would otherwise complain about missing an access token
|
491
|
-
checkTurnServers() {
|
492
|
-
var _this13 = this;
|
493
|
-
return _asyncToGenerator(function* () {
|
494
|
-
return _this13.turnServers.length > 0;
|
430
|
+
yield _this9.widgetApi.sendToDevice(eventType, false, recursiveMapToObject(contentMap));
|
495
431
|
})();
|
496
432
|
}
|
497
433
|
|
@@ -505,55 +441,9 @@ export class RoomWidgetClient extends MatrixClient {
|
|
505
441
|
this.emit(ClientEvent.Sync, state, oldState);
|
506
442
|
}
|
507
443
|
ack(ev) {
|
508
|
-
var
|
509
|
-
return _asyncToGenerator(function* () {
|
510
|
-
yield _this14.widgetApi.transport.reply(ev.detail, {});
|
511
|
-
})();
|
512
|
-
}
|
513
|
-
watchTurnServers() {
|
514
|
-
var _this15 = this;
|
444
|
+
var _this10 = this;
|
515
445
|
return _asyncToGenerator(function* () {
|
516
|
-
|
517
|
-
var onClientStopped = () => {
|
518
|
-
servers.return(undefined);
|
519
|
-
};
|
520
|
-
_this15.lifecycle.signal.addEventListener("abort", onClientStopped);
|
521
|
-
try {
|
522
|
-
var _iteratorAbruptCompletion = false;
|
523
|
-
var _didIteratorError = false;
|
524
|
-
var _iteratorError;
|
525
|
-
try {
|
526
|
-
for (var _iterator = _asyncIterator(servers), _step; _iteratorAbruptCompletion = !(_step = yield _iterator.next()).done; _iteratorAbruptCompletion = false) {
|
527
|
-
var server = _step.value;
|
528
|
-
{
|
529
|
-
_this15.turnServers = [{
|
530
|
-
urls: server.uris,
|
531
|
-
username: server.username,
|
532
|
-
credential: server.password
|
533
|
-
}];
|
534
|
-
_this15.emit(ClientEvent.TurnServers, _this15.turnServers);
|
535
|
-
logger.log("Received TURN server: ".concat(server.uris));
|
536
|
-
}
|
537
|
-
}
|
538
|
-
} catch (err) {
|
539
|
-
_didIteratorError = true;
|
540
|
-
_iteratorError = err;
|
541
|
-
} finally {
|
542
|
-
try {
|
543
|
-
if (_iteratorAbruptCompletion && _iterator.return != null) {
|
544
|
-
yield _iterator.return();
|
545
|
-
}
|
546
|
-
} finally {
|
547
|
-
if (_didIteratorError) {
|
548
|
-
throw _iteratorError;
|
549
|
-
}
|
550
|
-
}
|
551
|
-
}
|
552
|
-
} catch (e) {
|
553
|
-
logger.warn("Error watching TURN servers", e);
|
554
|
-
} finally {
|
555
|
-
_this15.lifecycle.signal.removeEventListener("abort", onClientStopped);
|
556
|
-
}
|
446
|
+
yield _this10.widgetApi.transport.reply(ev.detail, {});
|
557
447
|
})();
|
558
448
|
}
|
559
449
|
}
|