@unwanted/matrix-sdk-mini 34.12.0 → 36.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.
Files changed (759) hide show
  1. package/git-revision.txt +1 -1
  2. package/lib/@types/event.d.ts +25 -19
  3. package/lib/@types/event.d.ts.map +1 -1
  4. package/lib/@types/event.js +5 -0
  5. package/lib/@types/event.js.map +1 -1
  6. package/lib/@types/global.d.js +0 -2
  7. package/lib/@types/global.d.js.map +1 -1
  8. package/lib/autodiscovery.d.ts +1 -1
  9. package/lib/autodiscovery.d.ts.map +1 -1
  10. package/lib/autodiscovery.js.map +1 -1
  11. package/lib/base64.d.ts +3 -6
  12. package/lib/base64.d.ts.map +1 -1
  13. package/lib/base64.js +43 -36
  14. package/lib/base64.js.map +1 -1
  15. package/lib/browser-index.d.ts.map +1 -1
  16. package/lib/browser-index.js +0 -11
  17. package/lib/browser-index.js.map +1 -1
  18. package/lib/client.d.ts +45 -1306
  19. package/lib/client.d.ts.map +1 -1
  20. package/lib/client.js +406 -2963
  21. package/lib/client.js.map +1 -1
  22. package/lib/digest.d.ts +2 -2
  23. package/lib/digest.d.ts.map +1 -1
  24. package/lib/digest.js +2 -2
  25. package/lib/digest.js.map +1 -1
  26. package/lib/embedded.d.ts +2 -23
  27. package/lib/embedded.d.ts.map +1 -1
  28. package/lib/embedded.js +82 -209
  29. package/lib/embedded.js.map +1 -1
  30. package/lib/event-mapper.d.ts.map +1 -1
  31. package/lib/event-mapper.js +0 -4
  32. package/lib/event-mapper.js.map +1 -1
  33. package/lib/feature.d.ts.map +1 -1
  34. package/lib/feature.js +2 -1
  35. package/lib/feature.js.map +1 -1
  36. package/lib/http-api/errors.d.ts +3 -3
  37. package/lib/http-api/errors.js +3 -3
  38. package/lib/http-api/errors.js.map +1 -1
  39. package/lib/http-api/utils.js +2 -2
  40. package/lib/http-api/utils.js.map +1 -1
  41. package/lib/matrix.d.ts +0 -25
  42. package/lib/matrix.d.ts.map +1 -1
  43. package/lib/matrix.js +1 -30
  44. package/lib/matrix.js.map +1 -1
  45. package/lib/models/MSC3089Branch.d.ts.map +1 -1
  46. package/lib/models/MSC3089Branch.js +0 -3
  47. package/lib/models/MSC3089Branch.js.map +1 -1
  48. package/lib/models/event-timeline-set.d.ts +6 -10
  49. package/lib/models/event-timeline-set.d.ts.map +1 -1
  50. package/lib/models/event-timeline-set.js +28 -36
  51. package/lib/models/event-timeline-set.js.map +1 -1
  52. package/lib/models/event-timeline.d.ts +7 -2
  53. package/lib/models/event-timeline.d.ts.map +1 -1
  54. package/lib/models/event-timeline.js +9 -30
  55. package/lib/models/event-timeline.js.map +1 -1
  56. package/lib/models/event.d.ts +12 -96
  57. package/lib/models/event.d.ts.map +1 -1
  58. package/lib/models/event.js +59 -286
  59. package/lib/models/event.js.map +1 -1
  60. package/lib/models/invites-ignorer-types.d.ts +27 -0
  61. package/lib/models/invites-ignorer-types.d.ts.map +1 -0
  62. package/lib/models/invites-ignorer-types.js +36 -0
  63. package/lib/models/invites-ignorer-types.js.map +1 -0
  64. package/lib/models/invites-ignorer.d.ts +2 -26
  65. package/lib/models/invites-ignorer.d.ts.map +1 -1
  66. package/lib/models/invites-ignorer.js +2 -27
  67. package/lib/models/invites-ignorer.js.map +1 -1
  68. package/lib/models/poll.d.ts.map +1 -1
  69. package/lib/models/poll.js +1 -5
  70. package/lib/models/poll.js.map +1 -1
  71. package/lib/models/relations-container.d.ts.map +1 -1
  72. package/lib/models/relations-container.js +1 -7
  73. package/lib/models/relations-container.js.map +1 -1
  74. package/lib/models/relations.d.ts +0 -1
  75. package/lib/models/relations.d.ts.map +1 -1
  76. package/lib/models/relations.js +0 -8
  77. package/lib/models/relations.js.map +1 -1
  78. package/lib/models/room-member.d.ts +6 -1
  79. package/lib/models/room-member.d.ts.map +1 -1
  80. package/lib/models/room-member.js +7 -1
  81. package/lib/models/room-member.js.map +1 -1
  82. package/lib/models/room-state.d.ts +2 -13
  83. package/lib/models/room-state.d.ts.map +1 -1
  84. package/lib/models/room-state.js +12 -56
  85. package/lib/models/room-state.js.map +1 -1
  86. package/lib/models/room.d.ts +8 -21
  87. package/lib/models/room.d.ts.map +1 -1
  88. package/lib/models/room.js +128 -163
  89. package/lib/models/room.js.map +1 -1
  90. package/lib/models/thread.d.ts.map +1 -1
  91. package/lib/models/thread.js +5 -4
  92. package/lib/models/thread.js.map +1 -1
  93. package/lib/oidc/authorize.d.ts +2 -2
  94. package/lib/oidc/authorize.d.ts.map +1 -1
  95. package/lib/oidc/authorize.js +5 -5
  96. package/lib/oidc/authorize.js.map +1 -1
  97. package/lib/oidc/discovery.d.ts +8 -0
  98. package/lib/oidc/discovery.d.ts.map +1 -1
  99. package/lib/oidc/discovery.js +22 -11
  100. package/lib/oidc/discovery.js.map +1 -1
  101. package/lib/oidc/index.d.ts +3 -4
  102. package/lib/oidc/index.d.ts.map +1 -1
  103. package/lib/oidc/index.js.map +1 -1
  104. package/lib/oidc/register.js +3 -3
  105. package/lib/oidc/register.js.map +1 -1
  106. package/lib/oidc/tokenRefresher.d.ts.map +1 -1
  107. package/lib/oidc/tokenRefresher.js +6 -5
  108. package/lib/oidc/tokenRefresher.js.map +1 -1
  109. package/lib/oidc/validate.d.ts +9 -23
  110. package/lib/oidc/validate.d.ts.map +1 -1
  111. package/lib/oidc/validate.js +13 -28
  112. package/lib/oidc/validate.js.map +1 -1
  113. package/lib/randomstring.d.ts +30 -3
  114. package/lib/randomstring.d.ts.map +1 -1
  115. package/lib/randomstring.js +68 -16
  116. package/lib/randomstring.js.map +1 -1
  117. package/lib/sliding-sync-sdk.d.ts +3 -4
  118. package/lib/sliding-sync-sdk.d.ts.map +1 -1
  119. package/lib/sliding-sync-sdk.js +55 -102
  120. package/lib/sliding-sync-sdk.js.map +1 -1
  121. package/lib/sliding-sync.js +9 -6
  122. package/lib/sliding-sync.js.map +1 -1
  123. package/lib/store/indexeddb-local-backend.js +4 -2
  124. package/lib/store/indexeddb-local-backend.js.map +1 -1
  125. package/lib/store/indexeddb.d.ts +1 -1
  126. package/lib/store/indexeddb.d.ts.map +1 -1
  127. package/lib/store/indexeddb.js.map +1 -1
  128. package/lib/sync-accumulator.d.ts +6 -4
  129. package/lib/sync-accumulator.d.ts.map +1 -1
  130. package/lib/sync-accumulator.js +23 -12
  131. package/lib/sync-accumulator.js.map +1 -1
  132. package/lib/sync.d.ts +10 -13
  133. package/lib/sync.d.ts.map +1 -1
  134. package/lib/sync.js +94 -115
  135. package/lib/sync.js.map +1 -1
  136. package/lib/testing.d.ts +13 -44
  137. package/lib/testing.d.ts.map +1 -1
  138. package/lib/testing.js +36 -99
  139. package/lib/testing.js.map +1 -1
  140. package/lib/types.d.ts +0 -1
  141. package/lib/types.d.ts.map +1 -1
  142. package/lib/types.js.map +1 -1
  143. package/package.json +14 -15
  144. package/src/@types/event.ts +19 -36
  145. package/src/@types/global.d.ts +21 -4
  146. package/src/autodiscovery.ts +1 -1
  147. package/src/base64.ts +38 -40
  148. package/src/browser-index.ts +0 -11
  149. package/src/client.ts +175 -3136
  150. package/src/digest.ts +3 -3
  151. package/src/embedded.ts +43 -149
  152. package/src/event-mapper.ts +0 -4
  153. package/src/feature.ts +1 -0
  154. package/src/http-api/errors.ts +3 -3
  155. package/src/http-api/utils.ts +2 -2
  156. package/src/matrix.ts +0 -41
  157. package/src/models/MSC3089Branch.ts +0 -3
  158. package/src/models/event-timeline-set.ts +17 -38
  159. package/src/models/event-timeline.ts +11 -26
  160. package/src/models/event.ts +54 -295
  161. package/src/models/invites-ignorer-types.ts +48 -0
  162. package/src/models/invites-ignorer.ts +7 -42
  163. package/src/models/poll.ts +0 -6
  164. package/src/models/relations-container.ts +1 -8
  165. package/src/models/relations.ts +0 -8
  166. package/src/models/room-member.ts +16 -1
  167. package/src/models/room-state.ts +4 -37
  168. package/src/models/room.ts +34 -69
  169. package/src/models/thread.ts +4 -3
  170. package/src/oidc/authorize.ts +7 -7
  171. package/src/oidc/discovery.ts +16 -10
  172. package/src/oidc/index.ts +3 -4
  173. package/src/oidc/register.ts +3 -3
  174. package/src/oidc/tokenRefresher.ts +3 -2
  175. package/src/oidc/validate.ts +40 -63
  176. package/src/randomstring.ts +65 -19
  177. package/src/sliding-sync-sdk.ts +10 -83
  178. package/src/sliding-sync.ts +6 -6
  179. package/src/store/indexeddb-local-backend.ts +2 -2
  180. package/src/store/indexeddb.ts +1 -1
  181. package/src/sync-accumulator.ts +33 -16
  182. package/src/sync.ts +112 -143
  183. package/src/testing.ts +36 -103
  184. package/src/types.ts +0 -1
  185. package/CHANGELOG.md +0 -5910
  186. package/lib/@types/AESEncryptedSecretStoragePayload.d.ts +0 -14
  187. package/lib/@types/AESEncryptedSecretStoragePayload.d.ts.map +0 -1
  188. package/lib/@types/AESEncryptedSecretStoragePayload.js +0 -1
  189. package/lib/@types/AESEncryptedSecretStoragePayload.js.map +0 -1
  190. package/lib/@types/crypto.d.ts +0 -47
  191. package/lib/@types/crypto.d.ts.map +0 -1
  192. package/lib/@types/crypto.js +0 -1
  193. package/lib/@types/crypto.js.map +0 -1
  194. package/lib/@types/matrix-sdk-crypto-wasm.d.js +0 -1
  195. package/lib/@types/matrix-sdk-crypto-wasm.d.js.map +0 -1
  196. package/lib/common-crypto/CryptoBackend.d.ts +0 -240
  197. package/lib/common-crypto/CryptoBackend.d.ts.map +0 -1
  198. package/lib/common-crypto/CryptoBackend.js +0 -73
  199. package/lib/common-crypto/CryptoBackend.js.map +0 -1
  200. package/lib/common-crypto/key-passphrase.d.ts +0 -14
  201. package/lib/common-crypto/key-passphrase.d.ts.map +0 -1
  202. package/lib/common-crypto/key-passphrase.js +0 -33
  203. package/lib/common-crypto/key-passphrase.js.map +0 -1
  204. package/lib/crypto/CrossSigning.d.ts +0 -184
  205. package/lib/crypto/CrossSigning.d.ts.map +0 -1
  206. package/lib/crypto/CrossSigning.js +0 -718
  207. package/lib/crypto/CrossSigning.js.map +0 -1
  208. package/lib/crypto/DeviceList.d.ts +0 -216
  209. package/lib/crypto/DeviceList.d.ts.map +0 -1
  210. package/lib/crypto/DeviceList.js +0 -892
  211. package/lib/crypto/DeviceList.js.map +0 -1
  212. package/lib/crypto/EncryptionSetup.d.ts +0 -152
  213. package/lib/crypto/EncryptionSetup.d.ts.map +0 -1
  214. package/lib/crypto/EncryptionSetup.js +0 -356
  215. package/lib/crypto/EncryptionSetup.js.map +0 -1
  216. package/lib/crypto/OlmDevice.d.ts +0 -457
  217. package/lib/crypto/OlmDevice.d.ts.map +0 -1
  218. package/lib/crypto/OlmDevice.js +0 -1241
  219. package/lib/crypto/OlmDevice.js.map +0 -1
  220. package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts +0 -109
  221. package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts.map +0 -1
  222. package/lib/crypto/OutgoingRoomKeyRequestManager.js +0 -415
  223. package/lib/crypto/OutgoingRoomKeyRequestManager.js.map +0 -1
  224. package/lib/crypto/RoomList.d.ts +0 -26
  225. package/lib/crypto/RoomList.d.ts.map +0 -1
  226. package/lib/crypto/RoomList.js +0 -71
  227. package/lib/crypto/RoomList.js.map +0 -1
  228. package/lib/crypto/SecretSharing.d.ts +0 -24
  229. package/lib/crypto/SecretSharing.d.ts.map +0 -1
  230. package/lib/crypto/SecretSharing.js +0 -194
  231. package/lib/crypto/SecretSharing.js.map +0 -1
  232. package/lib/crypto/SecretStorage.d.ts +0 -55
  233. package/lib/crypto/SecretStorage.d.ts.map +0 -1
  234. package/lib/crypto/SecretStorage.js +0 -118
  235. package/lib/crypto/SecretStorage.js.map +0 -1
  236. package/lib/crypto/aes.d.ts +0 -6
  237. package/lib/crypto/aes.d.ts.map +0 -1
  238. package/lib/crypto/aes.js +0 -24
  239. package/lib/crypto/aes.js.map +0 -1
  240. package/lib/crypto/algorithms/base.d.ts +0 -156
  241. package/lib/crypto/algorithms/base.d.ts.map +0 -1
  242. package/lib/crypto/algorithms/base.js +0 -187
  243. package/lib/crypto/algorithms/base.js.map +0 -1
  244. package/lib/crypto/algorithms/index.d.ts +0 -4
  245. package/lib/crypto/algorithms/index.d.ts.map +0 -1
  246. package/lib/crypto/algorithms/index.js +0 -20
  247. package/lib/crypto/algorithms/index.js.map +0 -1
  248. package/lib/crypto/algorithms/megolm.d.ts +0 -385
  249. package/lib/crypto/algorithms/megolm.d.ts.map +0 -1
  250. package/lib/crypto/algorithms/megolm.js +0 -1822
  251. package/lib/crypto/algorithms/megolm.js.map +0 -1
  252. package/lib/crypto/algorithms/olm.d.ts +0 -5
  253. package/lib/crypto/algorithms/olm.d.ts.map +0 -1
  254. package/lib/crypto/algorithms/olm.js +0 -299
  255. package/lib/crypto/algorithms/olm.js.map +0 -1
  256. package/lib/crypto/api.d.ts +0 -32
  257. package/lib/crypto/api.d.ts.map +0 -1
  258. package/lib/crypto/api.js +0 -22
  259. package/lib/crypto/api.js.map +0 -1
  260. package/lib/crypto/backup.d.ts +0 -227
  261. package/lib/crypto/backup.d.ts.map +0 -1
  262. package/lib/crypto/backup.js +0 -824
  263. package/lib/crypto/backup.js.map +0 -1
  264. package/lib/crypto/crypto.d.ts +0 -3
  265. package/lib/crypto/crypto.d.ts.map +0 -1
  266. package/lib/crypto/crypto.js +0 -19
  267. package/lib/crypto/crypto.js.map +0 -1
  268. package/lib/crypto/dehydration.d.ts +0 -34
  269. package/lib/crypto/dehydration.d.ts.map +0 -1
  270. package/lib/crypto/dehydration.js +0 -252
  271. package/lib/crypto/dehydration.js.map +0 -1
  272. package/lib/crypto/device-converter.d.ts +0 -9
  273. package/lib/crypto/device-converter.d.ts.map +0 -1
  274. package/lib/crypto/device-converter.js +0 -42
  275. package/lib/crypto/device-converter.js.map +0 -1
  276. package/lib/crypto/deviceinfo.d.ts +0 -99
  277. package/lib/crypto/deviceinfo.d.ts.map +0 -1
  278. package/lib/crypto/deviceinfo.js +0 -148
  279. package/lib/crypto/deviceinfo.js.map +0 -1
  280. package/lib/crypto/index.d.ts +0 -1210
  281. package/lib/crypto/index.d.ts.map +0 -1
  282. package/lib/crypto/index.js +0 -4101
  283. package/lib/crypto/index.js.map +0 -1
  284. package/lib/crypto/key_passphrase.d.ts +0 -14
  285. package/lib/crypto/key_passphrase.d.ts.map +0 -1
  286. package/lib/crypto/key_passphrase.js +0 -44
  287. package/lib/crypto/key_passphrase.js.map +0 -1
  288. package/lib/crypto/keybackup.d.ts +0 -18
  289. package/lib/crypto/keybackup.d.ts.map +0 -1
  290. package/lib/crypto/keybackup.js +0 -1
  291. package/lib/crypto/keybackup.js.map +0 -1
  292. package/lib/crypto/olmlib.d.ts +0 -129
  293. package/lib/crypto/olmlib.d.ts.map +0 -1
  294. package/lib/crypto/olmlib.js +0 -492
  295. package/lib/crypto/olmlib.js.map +0 -1
  296. package/lib/crypto/recoverykey.d.ts +0 -2
  297. package/lib/crypto/recoverykey.d.ts.map +0 -1
  298. package/lib/crypto/recoverykey.js +0 -19
  299. package/lib/crypto/recoverykey.js.map +0 -1
  300. package/lib/crypto/store/base.d.ts +0 -252
  301. package/lib/crypto/store/base.d.ts.map +0 -1
  302. package/lib/crypto/store/base.js +0 -64
  303. package/lib/crypto/store/base.js.map +0 -1
  304. package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts +0 -187
  305. package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts.map +0 -1
  306. package/lib/crypto/store/indexeddb-crypto-store-backend.js +0 -1145
  307. package/lib/crypto/store/indexeddb-crypto-store-backend.js.map +0 -1
  308. package/lib/crypto/store/indexeddb-crypto-store.d.ts +0 -432
  309. package/lib/crypto/store/indexeddb-crypto-store.d.ts.map +0 -1
  310. package/lib/crypto/store/indexeddb-crypto-store.js +0 -728
  311. package/lib/crypto/store/indexeddb-crypto-store.js.map +0 -1
  312. package/lib/crypto/store/localStorage-crypto-store.d.ts +0 -119
  313. package/lib/crypto/store/localStorage-crypto-store.d.ts.map +0 -1
  314. package/lib/crypto/store/localStorage-crypto-store.js +0 -531
  315. package/lib/crypto/store/localStorage-crypto-store.js.map +0 -1
  316. package/lib/crypto/store/memory-crypto-store.d.ts +0 -215
  317. package/lib/crypto/store/memory-crypto-store.d.ts.map +0 -1
  318. package/lib/crypto/store/memory-crypto-store.js +0 -622
  319. package/lib/crypto/store/memory-crypto-store.js.map +0 -1
  320. package/lib/crypto/verification/Base.d.ts +0 -105
  321. package/lib/crypto/verification/Base.d.ts.map +0 -1
  322. package/lib/crypto/verification/Base.js +0 -372
  323. package/lib/crypto/verification/Base.js.map +0 -1
  324. package/lib/crypto/verification/Error.d.ts +0 -35
  325. package/lib/crypto/verification/Error.d.ts.map +0 -1
  326. package/lib/crypto/verification/Error.js +0 -86
  327. package/lib/crypto/verification/Error.js.map +0 -1
  328. package/lib/crypto/verification/IllegalMethod.d.ts +0 -15
  329. package/lib/crypto/verification/IllegalMethod.d.ts.map +0 -1
  330. package/lib/crypto/verification/IllegalMethod.js +0 -43
  331. package/lib/crypto/verification/IllegalMethod.js.map +0 -1
  332. package/lib/crypto/verification/QRCode.d.ts +0 -51
  333. package/lib/crypto/verification/QRCode.d.ts.map +0 -1
  334. package/lib/crypto/verification/QRCode.js +0 -277
  335. package/lib/crypto/verification/QRCode.js.map +0 -1
  336. package/lib/crypto/verification/SAS.d.ts +0 -27
  337. package/lib/crypto/verification/SAS.d.ts.map +0 -1
  338. package/lib/crypto/verification/SAS.js +0 -485
  339. package/lib/crypto/verification/SAS.js.map +0 -1
  340. package/lib/crypto/verification/SASDecimal.d.ts +0 -8
  341. package/lib/crypto/verification/SASDecimal.d.ts.map +0 -1
  342. package/lib/crypto/verification/SASDecimal.js +0 -34
  343. package/lib/crypto/verification/SASDecimal.js.map +0 -1
  344. package/lib/crypto/verification/request/Channel.d.ts +0 -18
  345. package/lib/crypto/verification/request/Channel.d.ts.map +0 -1
  346. package/lib/crypto/verification/request/Channel.js +0 -1
  347. package/lib/crypto/verification/request/Channel.js.map +0 -1
  348. package/lib/crypto/verification/request/InRoomChannel.d.ts +0 -113
  349. package/lib/crypto/verification/request/InRoomChannel.d.ts.map +0 -1
  350. package/lib/crypto/verification/request/InRoomChannel.js +0 -351
  351. package/lib/crypto/verification/request/InRoomChannel.js.map +0 -1
  352. package/lib/crypto/verification/request/ToDeviceChannel.d.ts +0 -105
  353. package/lib/crypto/verification/request/ToDeviceChannel.d.ts.map +0 -1
  354. package/lib/crypto/verification/request/ToDeviceChannel.js +0 -328
  355. package/lib/crypto/verification/request/ToDeviceChannel.js.map +0 -1
  356. package/lib/crypto/verification/request/VerificationRequest.d.ts +0 -227
  357. package/lib/crypto/verification/request/VerificationRequest.d.ts.map +0 -1
  358. package/lib/crypto/verification/request/VerificationRequest.js +0 -937
  359. package/lib/crypto/verification/request/VerificationRequest.js.map +0 -1
  360. package/lib/crypto-api/CryptoEvent.d.ts +0 -69
  361. package/lib/crypto-api/CryptoEvent.d.ts.map +0 -1
  362. package/lib/crypto-api/CryptoEvent.js +0 -33
  363. package/lib/crypto-api/CryptoEvent.js.map +0 -1
  364. package/lib/crypto-api/CryptoEventHandlerMap.d.ts +0 -16
  365. package/lib/crypto-api/CryptoEventHandlerMap.d.ts.map +0 -1
  366. package/lib/crypto-api/CryptoEventHandlerMap.js +0 -22
  367. package/lib/crypto-api/CryptoEventHandlerMap.js.map +0 -1
  368. package/lib/crypto-api/index.d.ts +0 -978
  369. package/lib/crypto-api/index.d.ts.map +0 -1
  370. package/lib/crypto-api/index.js +0 -304
  371. package/lib/crypto-api/index.js.map +0 -1
  372. package/lib/crypto-api/key-passphrase.d.ts +0 -11
  373. package/lib/crypto-api/key-passphrase.d.ts.map +0 -1
  374. package/lib/crypto-api/key-passphrase.js +0 -51
  375. package/lib/crypto-api/key-passphrase.js.map +0 -1
  376. package/lib/crypto-api/keybackup.d.ts +0 -88
  377. package/lib/crypto-api/keybackup.d.ts.map +0 -1
  378. package/lib/crypto-api/keybackup.js +0 -1
  379. package/lib/crypto-api/keybackup.js.map +0 -1
  380. package/lib/crypto-api/recovery-key.d.ts +0 -11
  381. package/lib/crypto-api/recovery-key.d.ts.map +0 -1
  382. package/lib/crypto-api/recovery-key.js +0 -65
  383. package/lib/crypto-api/recovery-key.js.map +0 -1
  384. package/lib/crypto-api/verification.d.ts +0 -344
  385. package/lib/crypto-api/verification.d.ts.map +0 -1
  386. package/lib/crypto-api/verification.js +0 -91
  387. package/lib/crypto-api/verification.js.map +0 -1
  388. package/lib/matrixrtc/CallMembership.d.ts +0 -66
  389. package/lib/matrixrtc/CallMembership.d.ts.map +0 -1
  390. package/lib/matrixrtc/CallMembership.js +0 -197
  391. package/lib/matrixrtc/CallMembership.js.map +0 -1
  392. package/lib/matrixrtc/LivekitFocus.d.ts +0 -16
  393. package/lib/matrixrtc/LivekitFocus.d.ts.map +0 -1
  394. package/lib/matrixrtc/LivekitFocus.js +0 -20
  395. package/lib/matrixrtc/LivekitFocus.js.map +0 -1
  396. package/lib/matrixrtc/MatrixRTCSession.d.ts +0 -295
  397. package/lib/matrixrtc/MatrixRTCSession.d.ts.map +0 -1
  398. package/lib/matrixrtc/MatrixRTCSession.js +0 -1043
  399. package/lib/matrixrtc/MatrixRTCSession.js.map +0 -1
  400. package/lib/matrixrtc/MatrixRTCSessionManager.d.ts +0 -40
  401. package/lib/matrixrtc/MatrixRTCSessionManager.d.ts.map +0 -1
  402. package/lib/matrixrtc/MatrixRTCSessionManager.js +0 -146
  403. package/lib/matrixrtc/MatrixRTCSessionManager.js.map +0 -1
  404. package/lib/matrixrtc/focus.d.ts +0 -10
  405. package/lib/matrixrtc/focus.d.ts.map +0 -1
  406. package/lib/matrixrtc/focus.js +0 -1
  407. package/lib/matrixrtc/focus.js.map +0 -1
  408. package/lib/matrixrtc/index.d.ts +0 -7
  409. package/lib/matrixrtc/index.d.ts.map +0 -1
  410. package/lib/matrixrtc/index.js +0 -21
  411. package/lib/matrixrtc/index.js.map +0 -1
  412. package/lib/matrixrtc/types.d.ts +0 -19
  413. package/lib/matrixrtc/types.d.ts.map +0 -1
  414. package/lib/matrixrtc/types.js +0 -1
  415. package/lib/matrixrtc/types.js.map +0 -1
  416. package/lib/rendezvous/MSC4108SignInWithQR.d.ts +0 -112
  417. package/lib/rendezvous/MSC4108SignInWithQR.d.ts.map +0 -1
  418. package/lib/rendezvous/MSC4108SignInWithQR.js +0 -392
  419. package/lib/rendezvous/MSC4108SignInWithQR.js.map +0 -1
  420. package/lib/rendezvous/RendezvousChannel.d.ts +0 -27
  421. package/lib/rendezvous/RendezvousChannel.d.ts.map +0 -1
  422. package/lib/rendezvous/RendezvousChannel.js +0 -1
  423. package/lib/rendezvous/RendezvousChannel.js.map +0 -1
  424. package/lib/rendezvous/RendezvousCode.d.ts +0 -9
  425. package/lib/rendezvous/RendezvousCode.d.ts.map +0 -1
  426. package/lib/rendezvous/RendezvousCode.js +0 -1
  427. package/lib/rendezvous/RendezvousCode.js.map +0 -1
  428. package/lib/rendezvous/RendezvousError.d.ts +0 -6
  429. package/lib/rendezvous/RendezvousError.d.ts.map +0 -1
  430. package/lib/rendezvous/RendezvousError.js +0 -23
  431. package/lib/rendezvous/RendezvousError.js.map +0 -1
  432. package/lib/rendezvous/RendezvousFailureReason.d.ts +0 -31
  433. package/lib/rendezvous/RendezvousFailureReason.d.ts.map +0 -1
  434. package/lib/rendezvous/RendezvousFailureReason.js +0 -38
  435. package/lib/rendezvous/RendezvousFailureReason.js.map +0 -1
  436. package/lib/rendezvous/RendezvousIntent.d.ts +0 -5
  437. package/lib/rendezvous/RendezvousIntent.d.ts.map +0 -1
  438. package/lib/rendezvous/RendezvousIntent.js +0 -22
  439. package/lib/rendezvous/RendezvousIntent.js.map +0 -1
  440. package/lib/rendezvous/RendezvousTransport.d.ts +0 -36
  441. package/lib/rendezvous/RendezvousTransport.d.ts.map +0 -1
  442. package/lib/rendezvous/RendezvousTransport.js +0 -1
  443. package/lib/rendezvous/RendezvousTransport.js.map +0 -1
  444. package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts +0 -58
  445. package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts.map +0 -1
  446. package/lib/rendezvous/channels/MSC4108SecureChannel.js +0 -246
  447. package/lib/rendezvous/channels/MSC4108SecureChannel.js.map +0 -1
  448. package/lib/rendezvous/channels/index.d.ts +0 -2
  449. package/lib/rendezvous/channels/index.d.ts.map +0 -1
  450. package/lib/rendezvous/channels/index.js +0 -18
  451. package/lib/rendezvous/channels/index.js.map +0 -1
  452. package/lib/rendezvous/index.d.ts +0 -10
  453. package/lib/rendezvous/index.d.ts.map +0 -1
  454. package/lib/rendezvous/index.js +0 -23
  455. package/lib/rendezvous/index.js.map +0 -1
  456. package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts +0 -61
  457. package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts.map +0 -1
  458. package/lib/rendezvous/transports/MSC4108RendezvousSession.js +0 -253
  459. package/lib/rendezvous/transports/MSC4108RendezvousSession.js.map +0 -1
  460. package/lib/rendezvous/transports/index.d.ts +0 -2
  461. package/lib/rendezvous/transports/index.d.ts.map +0 -1
  462. package/lib/rendezvous/transports/index.js +0 -18
  463. package/lib/rendezvous/transports/index.js.map +0 -1
  464. package/lib/rust-crypto/CrossSigningIdentity.d.ts +0 -33
  465. package/lib/rust-crypto/CrossSigningIdentity.d.ts.map +0 -1
  466. package/lib/rust-crypto/CrossSigningIdentity.js +0 -157
  467. package/lib/rust-crypto/CrossSigningIdentity.js.map +0 -1
  468. package/lib/rust-crypto/DehydratedDeviceManager.d.ts +0 -98
  469. package/lib/rust-crypto/DehydratedDeviceManager.d.ts.map +0 -1
  470. package/lib/rust-crypto/DehydratedDeviceManager.js +0 -285
  471. package/lib/rust-crypto/DehydratedDeviceManager.js.map +0 -1
  472. package/lib/rust-crypto/KeyClaimManager.d.ts +0 -33
  473. package/lib/rust-crypto/KeyClaimManager.d.ts.map +0 -1
  474. package/lib/rust-crypto/KeyClaimManager.js +0 -82
  475. package/lib/rust-crypto/KeyClaimManager.js.map +0 -1
  476. package/lib/rust-crypto/OutgoingRequestProcessor.d.ts +0 -43
  477. package/lib/rust-crypto/OutgoingRequestProcessor.d.ts.map +0 -1
  478. package/lib/rust-crypto/OutgoingRequestProcessor.js +0 -195
  479. package/lib/rust-crypto/OutgoingRequestProcessor.js.map +0 -1
  480. package/lib/rust-crypto/OutgoingRequestsManager.d.ts +0 -47
  481. package/lib/rust-crypto/OutgoingRequestsManager.d.ts.map +0 -1
  482. package/lib/rust-crypto/OutgoingRequestsManager.js +0 -148
  483. package/lib/rust-crypto/OutgoingRequestsManager.js.map +0 -1
  484. package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts +0 -120
  485. package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts.map +0 -1
  486. package/lib/rust-crypto/PerSessionKeyBackupDownloader.js +0 -467
  487. package/lib/rust-crypto/PerSessionKeyBackupDownloader.js.map +0 -1
  488. package/lib/rust-crypto/RoomEncryptor.d.ts +0 -98
  489. package/lib/rust-crypto/RoomEncryptor.d.ts.map +0 -1
  490. package/lib/rust-crypto/RoomEncryptor.js +0 -299
  491. package/lib/rust-crypto/RoomEncryptor.js.map +0 -1
  492. package/lib/rust-crypto/backup.d.ts +0 -254
  493. package/lib/rust-crypto/backup.d.ts.map +0 -1
  494. package/lib/rust-crypto/backup.js +0 -837
  495. package/lib/rust-crypto/backup.js.map +0 -1
  496. package/lib/rust-crypto/constants.d.ts +0 -3
  497. package/lib/rust-crypto/constants.d.ts.map +0 -1
  498. package/lib/rust-crypto/constants.js +0 -19
  499. package/lib/rust-crypto/constants.js.map +0 -1
  500. package/lib/rust-crypto/device-converter.d.ts +0 -28
  501. package/lib/rust-crypto/device-converter.d.ts.map +0 -1
  502. package/lib/rust-crypto/device-converter.js +0 -123
  503. package/lib/rust-crypto/device-converter.js.map +0 -1
  504. package/lib/rust-crypto/index.d.ts +0 -61
  505. package/lib/rust-crypto/index.d.ts.map +0 -1
  506. package/lib/rust-crypto/index.js +0 -152
  507. package/lib/rust-crypto/index.js.map +0 -1
  508. package/lib/rust-crypto/libolm_migration.d.ts +0 -81
  509. package/lib/rust-crypto/libolm_migration.d.ts.map +0 -1
  510. package/lib/rust-crypto/libolm_migration.js +0 -459
  511. package/lib/rust-crypto/libolm_migration.js.map +0 -1
  512. package/lib/rust-crypto/rust-crypto.d.ts +0 -556
  513. package/lib/rust-crypto/rust-crypto.d.ts.map +0 -1
  514. package/lib/rust-crypto/rust-crypto.js +0 -2016
  515. package/lib/rust-crypto/rust-crypto.js.map +0 -1
  516. package/lib/rust-crypto/secret-storage.d.ts +0 -22
  517. package/lib/rust-crypto/secret-storage.d.ts.map +0 -1
  518. package/lib/rust-crypto/secret-storage.js +0 -63
  519. package/lib/rust-crypto/secret-storage.js.map +0 -1
  520. package/lib/rust-crypto/verification.d.ts +0 -319
  521. package/lib/rust-crypto/verification.d.ts.map +0 -1
  522. package/lib/rust-crypto/verification.js +0 -816
  523. package/lib/rust-crypto/verification.js.map +0 -1
  524. package/lib/secret-storage.d.ts +0 -370
  525. package/lib/secret-storage.d.ts.map +0 -1
  526. package/lib/secret-storage.js +0 -466
  527. package/lib/secret-storage.js.map +0 -1
  528. package/lib/utils/decryptAESSecretStorageItem.d.ts +0 -12
  529. package/lib/utils/decryptAESSecretStorageItem.d.ts.map +0 -1
  530. package/lib/utils/decryptAESSecretStorageItem.js +0 -50
  531. package/lib/utils/decryptAESSecretStorageItem.js.map +0 -1
  532. package/lib/utils/encryptAESSecretStorageItem.d.ts +0 -16
  533. package/lib/utils/encryptAESSecretStorageItem.d.ts.map +0 -1
  534. package/lib/utils/encryptAESSecretStorageItem.js +0 -68
  535. package/lib/utils/encryptAESSecretStorageItem.js.map +0 -1
  536. package/lib/utils/internal/deriveKeys.d.ts +0 -10
  537. package/lib/utils/internal/deriveKeys.d.ts.map +0 -1
  538. package/lib/utils/internal/deriveKeys.js +0 -60
  539. package/lib/utils/internal/deriveKeys.js.map +0 -1
  540. package/lib/webrtc/audioContext.d.ts +0 -15
  541. package/lib/webrtc/audioContext.d.ts.map +0 -1
  542. package/lib/webrtc/audioContext.js +0 -46
  543. package/lib/webrtc/audioContext.js.map +0 -1
  544. package/lib/webrtc/call.d.ts +0 -560
  545. package/lib/webrtc/call.d.ts.map +0 -1
  546. package/lib/webrtc/call.js +0 -2541
  547. package/lib/webrtc/call.js.map +0 -1
  548. package/lib/webrtc/callEventHandler.d.ts +0 -37
  549. package/lib/webrtc/callEventHandler.d.ts.map +0 -1
  550. package/lib/webrtc/callEventHandler.js +0 -344
  551. package/lib/webrtc/callEventHandler.js.map +0 -1
  552. package/lib/webrtc/callEventTypes.d.ts +0 -73
  553. package/lib/webrtc/callEventTypes.d.ts.map +0 -1
  554. package/lib/webrtc/callEventTypes.js +0 -13
  555. package/lib/webrtc/callEventTypes.js.map +0 -1
  556. package/lib/webrtc/callFeed.d.ts +0 -128
  557. package/lib/webrtc/callFeed.d.ts.map +0 -1
  558. package/lib/webrtc/callFeed.js +0 -289
  559. package/lib/webrtc/callFeed.js.map +0 -1
  560. package/lib/webrtc/groupCall.d.ts +0 -323
  561. package/lib/webrtc/groupCall.d.ts.map +0 -1
  562. package/lib/webrtc/groupCall.js +0 -1337
  563. package/lib/webrtc/groupCall.js.map +0 -1
  564. package/lib/webrtc/groupCallEventHandler.d.ts +0 -31
  565. package/lib/webrtc/groupCallEventHandler.d.ts.map +0 -1
  566. package/lib/webrtc/groupCallEventHandler.js +0 -178
  567. package/lib/webrtc/groupCallEventHandler.js.map +0 -1
  568. package/lib/webrtc/mediaHandler.d.ts +0 -89
  569. package/lib/webrtc/mediaHandler.d.ts.map +0 -1
  570. package/lib/webrtc/mediaHandler.js +0 -437
  571. package/lib/webrtc/mediaHandler.js.map +0 -1
  572. package/lib/webrtc/stats/callFeedStatsReporter.d.ts +0 -8
  573. package/lib/webrtc/stats/callFeedStatsReporter.d.ts.map +0 -1
  574. package/lib/webrtc/stats/callFeedStatsReporter.js +0 -82
  575. package/lib/webrtc/stats/callFeedStatsReporter.js.map +0 -1
  576. package/lib/webrtc/stats/callStatsReportGatherer.d.ts +0 -25
  577. package/lib/webrtc/stats/callStatsReportGatherer.d.ts.map +0 -1
  578. package/lib/webrtc/stats/callStatsReportGatherer.js +0 -199
  579. package/lib/webrtc/stats/callStatsReportGatherer.js.map +0 -1
  580. package/lib/webrtc/stats/callStatsReportSummary.d.ts +0 -17
  581. package/lib/webrtc/stats/callStatsReportSummary.d.ts.map +0 -1
  582. package/lib/webrtc/stats/callStatsReportSummary.js +0 -1
  583. package/lib/webrtc/stats/callStatsReportSummary.js.map +0 -1
  584. package/lib/webrtc/stats/connectionStats.d.ts +0 -28
  585. package/lib/webrtc/stats/connectionStats.d.ts.map +0 -1
  586. package/lib/webrtc/stats/connectionStats.js +0 -26
  587. package/lib/webrtc/stats/connectionStats.js.map +0 -1
  588. package/lib/webrtc/stats/connectionStatsBuilder.d.ts +0 -5
  589. package/lib/webrtc/stats/connectionStatsBuilder.d.ts.map +0 -1
  590. package/lib/webrtc/stats/connectionStatsBuilder.js +0 -27
  591. package/lib/webrtc/stats/connectionStatsBuilder.js.map +0 -1
  592. package/lib/webrtc/stats/connectionStatsReportBuilder.d.ts +0 -7
  593. package/lib/webrtc/stats/connectionStatsReportBuilder.d.ts.map +0 -1
  594. package/lib/webrtc/stats/connectionStatsReportBuilder.js +0 -121
  595. package/lib/webrtc/stats/connectionStatsReportBuilder.js.map +0 -1
  596. package/lib/webrtc/stats/groupCallStats.d.ts +0 -22
  597. package/lib/webrtc/stats/groupCallStats.d.ts.map +0 -1
  598. package/lib/webrtc/stats/groupCallStats.js +0 -78
  599. package/lib/webrtc/stats/groupCallStats.js.map +0 -1
  600. package/lib/webrtc/stats/media/mediaSsrcHandler.d.ts +0 -10
  601. package/lib/webrtc/stats/media/mediaSsrcHandler.d.ts.map +0 -1
  602. package/lib/webrtc/stats/media/mediaSsrcHandler.js +0 -57
  603. package/lib/webrtc/stats/media/mediaSsrcHandler.js.map +0 -1
  604. package/lib/webrtc/stats/media/mediaTrackHandler.d.ts +0 -12
  605. package/lib/webrtc/stats/media/mediaTrackHandler.d.ts.map +0 -1
  606. package/lib/webrtc/stats/media/mediaTrackHandler.js +0 -62
  607. package/lib/webrtc/stats/media/mediaTrackHandler.js.map +0 -1
  608. package/lib/webrtc/stats/media/mediaTrackStats.d.ts +0 -86
  609. package/lib/webrtc/stats/media/mediaTrackStats.d.ts.map +0 -1
  610. package/lib/webrtc/stats/media/mediaTrackStats.js +0 -142
  611. package/lib/webrtc/stats/media/mediaTrackStats.js.map +0 -1
  612. package/lib/webrtc/stats/media/mediaTrackStatsHandler.d.ts +0 -22
  613. package/lib/webrtc/stats/media/mediaTrackStatsHandler.d.ts.map +0 -1
  614. package/lib/webrtc/stats/media/mediaTrackStatsHandler.js +0 -76
  615. package/lib/webrtc/stats/media/mediaTrackStatsHandler.js.map +0 -1
  616. package/lib/webrtc/stats/statsReport.d.ts +0 -99
  617. package/lib/webrtc/stats/statsReport.d.ts.map +0 -1
  618. package/lib/webrtc/stats/statsReport.js +0 -32
  619. package/lib/webrtc/stats/statsReport.js.map +0 -1
  620. package/lib/webrtc/stats/statsReportEmitter.d.ts +0 -15
  621. package/lib/webrtc/stats/statsReportEmitter.d.ts.map +0 -1
  622. package/lib/webrtc/stats/statsReportEmitter.js +0 -33
  623. package/lib/webrtc/stats/statsReportEmitter.js.map +0 -1
  624. package/lib/webrtc/stats/summaryStatsReportGatherer.d.ts +0 -16
  625. package/lib/webrtc/stats/summaryStatsReportGatherer.d.ts.map +0 -1
  626. package/lib/webrtc/stats/summaryStatsReportGatherer.js +0 -116
  627. package/lib/webrtc/stats/summaryStatsReportGatherer.js.map +0 -1
  628. package/lib/webrtc/stats/trackStatsBuilder.d.ts +0 -19
  629. package/lib/webrtc/stats/trackStatsBuilder.d.ts.map +0 -1
  630. package/lib/webrtc/stats/trackStatsBuilder.js +0 -168
  631. package/lib/webrtc/stats/trackStatsBuilder.js.map +0 -1
  632. package/lib/webrtc/stats/transportStats.d.ts +0 -11
  633. package/lib/webrtc/stats/transportStats.d.ts.map +0 -1
  634. package/lib/webrtc/stats/transportStats.js +0 -1
  635. package/lib/webrtc/stats/transportStats.js.map +0 -1
  636. package/lib/webrtc/stats/transportStatsBuilder.d.ts +0 -5
  637. package/lib/webrtc/stats/transportStatsBuilder.d.ts.map +0 -1
  638. package/lib/webrtc/stats/transportStatsBuilder.js +0 -34
  639. package/lib/webrtc/stats/transportStatsBuilder.js.map +0 -1
  640. package/lib/webrtc/stats/valueFormatter.d.ts +0 -4
  641. package/lib/webrtc/stats/valueFormatter.d.ts.map +0 -1
  642. package/lib/webrtc/stats/valueFormatter.js +0 -25
  643. package/lib/webrtc/stats/valueFormatter.js.map +0 -1
  644. package/src/@types/AESEncryptedSecretStoragePayload.ts +0 -29
  645. package/src/@types/crypto.ts +0 -73
  646. package/src/@types/matrix-sdk-crypto-wasm.d.ts +0 -44
  647. package/src/common-crypto/CryptoBackend.ts +0 -302
  648. package/src/common-crypto/README.md +0 -4
  649. package/src/common-crypto/key-passphrase.ts +0 -43
  650. package/src/crypto/CrossSigning.ts +0 -773
  651. package/src/crypto/DeviceList.ts +0 -989
  652. package/src/crypto/EncryptionSetup.ts +0 -351
  653. package/src/crypto/OlmDevice.ts +0 -1500
  654. package/src/crypto/OutgoingRoomKeyRequestManager.ts +0 -485
  655. package/src/crypto/RoomList.ts +0 -70
  656. package/src/crypto/SecretSharing.ts +0 -240
  657. package/src/crypto/SecretStorage.ts +0 -136
  658. package/src/crypto/aes.ts +0 -23
  659. package/src/crypto/algorithms/base.ts +0 -236
  660. package/src/crypto/algorithms/index.ts +0 -20
  661. package/src/crypto/algorithms/megolm.ts +0 -2216
  662. package/src/crypto/algorithms/olm.ts +0 -381
  663. package/src/crypto/api.ts +0 -70
  664. package/src/crypto/backup.ts +0 -922
  665. package/src/crypto/crypto.ts +0 -18
  666. package/src/crypto/dehydration.ts +0 -272
  667. package/src/crypto/device-converter.ts +0 -45
  668. package/src/crypto/deviceinfo.ts +0 -158
  669. package/src/crypto/index.ts +0 -4418
  670. package/src/crypto/key_passphrase.ts +0 -42
  671. package/src/crypto/keybackup.ts +0 -47
  672. package/src/crypto/olmlib.ts +0 -539
  673. package/src/crypto/recoverykey.ts +0 -18
  674. package/src/crypto/store/base.ts +0 -348
  675. package/src/crypto/store/indexeddb-crypto-store-backend.ts +0 -1250
  676. package/src/crypto/store/indexeddb-crypto-store.ts +0 -845
  677. package/src/crypto/store/localStorage-crypto-store.ts +0 -579
  678. package/src/crypto/store/memory-crypto-store.ts +0 -680
  679. package/src/crypto/verification/Base.ts +0 -409
  680. package/src/crypto/verification/Error.ts +0 -76
  681. package/src/crypto/verification/IllegalMethod.ts +0 -50
  682. package/src/crypto/verification/QRCode.ts +0 -310
  683. package/src/crypto/verification/SAS.ts +0 -494
  684. package/src/crypto/verification/SASDecimal.ts +0 -37
  685. package/src/crypto/verification/request/Channel.ts +0 -34
  686. package/src/crypto/verification/request/InRoomChannel.ts +0 -371
  687. package/src/crypto/verification/request/ToDeviceChannel.ts +0 -354
  688. package/src/crypto/verification/request/VerificationRequest.ts +0 -976
  689. package/src/crypto-api/CryptoEvent.ts +0 -93
  690. package/src/crypto-api/CryptoEventHandlerMap.ts +0 -32
  691. package/src/crypto-api/index.ts +0 -1175
  692. package/src/crypto-api/key-passphrase.ts +0 -58
  693. package/src/crypto-api/keybackup.ts +0 -115
  694. package/src/crypto-api/recovery-key.ts +0 -69
  695. package/src/crypto-api/verification.ts +0 -408
  696. package/src/matrixrtc/CallMembership.ts +0 -247
  697. package/src/matrixrtc/LivekitFocus.ts +0 -39
  698. package/src/matrixrtc/MatrixRTCSession.ts +0 -1319
  699. package/src/matrixrtc/MatrixRTCSessionManager.ts +0 -166
  700. package/src/matrixrtc/focus.ts +0 -25
  701. package/src/matrixrtc/index.ts +0 -22
  702. package/src/matrixrtc/types.ts +0 -36
  703. package/src/rendezvous/MSC4108SignInWithQR.ts +0 -444
  704. package/src/rendezvous/RendezvousChannel.ts +0 -48
  705. package/src/rendezvous/RendezvousCode.ts +0 -25
  706. package/src/rendezvous/RendezvousError.ts +0 -26
  707. package/src/rendezvous/RendezvousFailureReason.ts +0 -49
  708. package/src/rendezvous/RendezvousIntent.ts +0 -20
  709. package/src/rendezvous/RendezvousTransport.ts +0 -58
  710. package/src/rendezvous/channels/MSC4108SecureChannel.ts +0 -270
  711. package/src/rendezvous/channels/index.ts +0 -17
  712. package/src/rendezvous/index.ts +0 -25
  713. package/src/rendezvous/transports/MSC4108RendezvousSession.ts +0 -270
  714. package/src/rendezvous/transports/index.ts +0 -17
  715. package/src/rust-crypto/CrossSigningIdentity.ts +0 -183
  716. package/src/rust-crypto/DehydratedDeviceManager.ts +0 -306
  717. package/src/rust-crypto/KeyClaimManager.ts +0 -86
  718. package/src/rust-crypto/OutgoingRequestProcessor.ts +0 -236
  719. package/src/rust-crypto/OutgoingRequestsManager.ts +0 -143
  720. package/src/rust-crypto/PerSessionKeyBackupDownloader.ts +0 -501
  721. package/src/rust-crypto/RoomEncryptor.ts +0 -352
  722. package/src/rust-crypto/backup.ts +0 -881
  723. package/src/rust-crypto/constants.ts +0 -18
  724. package/src/rust-crypto/device-converter.ts +0 -128
  725. package/src/rust-crypto/index.ts +0 -237
  726. package/src/rust-crypto/libolm_migration.ts +0 -530
  727. package/src/rust-crypto/rust-crypto.ts +0 -2205
  728. package/src/rust-crypto/secret-storage.ts +0 -60
  729. package/src/rust-crypto/verification.ts +0 -830
  730. package/src/secret-storage.ts +0 -693
  731. package/src/utils/decryptAESSecretStorageItem.ts +0 -54
  732. package/src/utils/encryptAESSecretStorageItem.ts +0 -73
  733. package/src/utils/internal/deriveKeys.ts +0 -63
  734. package/src/webrtc/audioContext.ts +0 -44
  735. package/src/webrtc/call.ts +0 -3074
  736. package/src/webrtc/callEventHandler.ts +0 -425
  737. package/src/webrtc/callEventTypes.ts +0 -93
  738. package/src/webrtc/callFeed.ts +0 -364
  739. package/src/webrtc/groupCall.ts +0 -1735
  740. package/src/webrtc/groupCallEventHandler.ts +0 -234
  741. package/src/webrtc/mediaHandler.ts +0 -484
  742. package/src/webrtc/stats/callFeedStatsReporter.ts +0 -94
  743. package/src/webrtc/stats/callStatsReportGatherer.ts +0 -219
  744. package/src/webrtc/stats/callStatsReportSummary.ts +0 -30
  745. package/src/webrtc/stats/connectionStats.ts +0 -47
  746. package/src/webrtc/stats/connectionStatsBuilder.ts +0 -28
  747. package/src/webrtc/stats/connectionStatsReportBuilder.ts +0 -140
  748. package/src/webrtc/stats/groupCallStats.ts +0 -93
  749. package/src/webrtc/stats/media/mediaSsrcHandler.ts +0 -57
  750. package/src/webrtc/stats/media/mediaTrackHandler.ts +0 -76
  751. package/src/webrtc/stats/media/mediaTrackStats.ts +0 -176
  752. package/src/webrtc/stats/media/mediaTrackStatsHandler.ts +0 -90
  753. package/src/webrtc/stats/statsReport.ts +0 -133
  754. package/src/webrtc/stats/statsReportEmitter.ts +0 -49
  755. package/src/webrtc/stats/summaryStatsReportGatherer.ts +0 -148
  756. package/src/webrtc/stats/trackStatsBuilder.ts +0 -207
  757. package/src/webrtc/stats/transportStats.ts +0 -26
  758. package/src/webrtc/stats/transportStatsBuilder.ts +0 -48
  759. 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 ArrayBuffer containing the SHA-256 hash of the input string
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<ArrayBuffer>;
9
+ export declare function sha256(plaintext: string): Promise<Uint8Array>;
10
10
  //# sourceMappingURL=digest.d.ts.map
@@ -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,WAAW,CAAC,CASpE"}
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 ArrayBuffer containing the SHA-256 hash of the input string
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 ArrayBuffer 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<ArrayBuffer> {\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 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,EAAwB;IAClE,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,OAAOG,MAAM;EACjB,CAAC;EAAA,OAAAZ,IAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA","ignoreList":[]}
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;
@@ -78,10 +75,10 @@ export type EventHandlerMap = {
78
75
  */
79
76
  export declare class RoomWidgetClient extends MatrixClient {
80
77
  private readonly widgetApi;
81
- private readonly capabilities;
82
78
  private readonly roomId;
83
79
  private room?;
84
80
  private readonly widgetApiReady;
81
+ private readonly roomStateSynced;
85
82
  private lifecycle?;
86
83
  private syncState;
87
84
  private pendingSendingEventsTxId;
@@ -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,13 @@ 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;
119
+ private onStateUpdate;
141
120
  }
142
121
  export {};
143
122
  //# sourceMappingURL=embedded.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"embedded.d.ts","sourceRoot":"","sources":["../src/embedded.ts"],"names":[],"mappings":"AAgBA,OAAO,EACH,SAAS,EAaZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAiC,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EACH,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,EACxB,wBAAwB,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAa,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE3D,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,kBA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,YAAY;YAMN,GAAG;IAIjB,OAAO,CAAC,UAAU,CAwChB;IAEF,OAAO,CAAC,OAAO,CA0Bb;IAEF,OAAO,CAAC,UAAU,CAYhB;IAEF,OAAO,CAAC,aAAa,CAqBnB;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, EventStatus } from "./models/event.js";
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";
@@ -51,15 +48,15 @@ export class RoomWidgetClient extends MatrixClient {
51
48
  * Set to `false` if the widget uses `waitForIFrameLoad=true` (in this case the client does not expect a content loaded action at all),
52
49
  * or if the the widget wants to send the `ContentLoaded` action at a later point in time after the initial setup.
53
50
  */
54
- constructor(widgetApi, capabilities, roomId, opts, sendContentLoaded) {
55
- var _this, _capabilities$sendEve, _capabilities$receive, _capabilities$sendSta, _capabilities$receive2, _capabilities$sendEve2, _capabilities$receive3, _capabilities$sendSta2, _capabilities$receive4, _capabilities$sendToD, _capabilities$receive5, _capabilities$sendEve3, _capabilities$sendSta3;
51
+ constructor(widgetApi, /*private readonly */capabilities, roomId, opts, sendContentLoaded) {
52
+ var _this, _capabilities$receive, _capabilities$sendEve, _capabilities$receive2, _capabilities$sendSta, _capabilities$receive3, _capabilities$sendEve2, _capabilities$receive4, _capabilities$sendSta2, _capabilities$receive5, _capabilities$sendToD, _capabilities$receive6, _capabilities$sendEve3, _capabilities$sendSta3;
56
53
  super(opts);
57
54
  _this = this;
58
55
  this.widgetApi = widgetApi;
59
- this.capabilities = capabilities;
60
56
  this.roomId = roomId;
61
57
  _defineProperty(this, "room", void 0);
62
58
  _defineProperty(this, "widgetApiReady", void 0);
59
+ _defineProperty(this, "roomStateSynced", void 0);
63
60
  _defineProperty(this, "lifecycle", void 0);
64
61
  _defineProperty(this, "syncState", null);
65
62
  _defineProperty(this, "pendingSendingEventsTxId", []);
@@ -118,14 +115,19 @@ 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 _event = new MatrixEvent(ev.detail.data);
118
+ var event = new MatrixEvent(ev.detail.data);
122
119
 
123
120
  // Only inject once we have update the txId
124
- yield _this.updateTxId(_event);
125
- yield _this.syncApi.injectRoomEvents(_this.room, [], [_event]);
126
- _this.emit(ClientEvent.Event, _event);
121
+ yield _this.updateTxId(event);
122
+ if (_this.syncApi instanceof SyncApi) {
123
+ yield _this.syncApi.injectRoomEvents(_this.room, undefined, [], [event]);
124
+ } else {
125
+ // Sliding Sync
126
+ yield _this.syncApi.injectRoomEvents(_this.room, [], [event]);
127
+ }
128
+ _this.emit(ClientEvent.Event, event);
127
129
  _this.setSyncState(SyncState.Syncing);
128
- logger.info("Received event ".concat(_event.getId(), " ").concat(_event.getType(), " ").concat(_event.getStateKey()));
130
+ logger.info("Received event ".concat(event.getId(), " ").concat(event.getType()));
129
131
  } else {
130
132
  var {
131
133
  event_id: eventId,
@@ -147,8 +149,6 @@ export class RoomWidgetClient extends MatrixClient {
147
149
  sender: ev.detail.data.sender,
148
150
  content: ev.detail.data.content
149
151
  });
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
152
  _this.emit(ClientEvent.ToDeviceEvent, event);
153
153
  _this.setSyncState(SyncState.Syncing);
154
154
  yield _this.ack(ev);
@@ -157,40 +157,71 @@ export class RoomWidgetClient extends MatrixClient {
157
157
  return _ref3.apply(this, arguments);
158
158
  };
159
159
  }());
160
+ _defineProperty(this, "onStateUpdate", /*#__PURE__*/function () {
161
+ var _ref4 = _asyncToGenerator(function* (ev) {
162
+ ev.preventDefault();
163
+ for (var rawEvent of ev.detail.data.state) {
164
+ // Verify the room ID matches, since it's possible for the client to
165
+ // send us state updates from other rooms if this widget is always
166
+ // on screen
167
+ if (rawEvent.room_id === _this.roomId) {
168
+ var event = new MatrixEvent(rawEvent);
169
+ if (_this.syncApi instanceof SyncApi) {
170
+ yield _this.syncApi.injectRoomEvents(_this.room, undefined, [event]);
171
+ } else {
172
+ // Sliding Sync
173
+ yield _this.syncApi.injectRoomEvents(_this.room, [event]);
174
+ }
175
+ logger.info("Updated state entry ".concat(event.getType(), " ").concat(event.getStateKey(), " to ").concat(event.getId()));
176
+ } else {
177
+ var {
178
+ event_id: eventId,
179
+ room_id: _roomId2
180
+ } = ev.detail.data;
181
+ logger.info("Received state entry ".concat(eventId, " for a different room ").concat(_roomId2, "; discarding"));
182
+ }
183
+ }
184
+ yield _this.ack(ev);
185
+ });
186
+ return function (_x4) {
187
+ return _ref4.apply(this, arguments);
188
+ };
189
+ }());
160
190
  var transportSend = this.widgetApi.transport.send.bind(this.widgetApi.transport);
161
191
  this.widgetApi.transport.send = /*#__PURE__*/function () {
162
- var _ref4 = _asyncToGenerator(function* (action, data) {
192
+ var _ref5 = _asyncToGenerator(function* (action, data) {
163
193
  try {
164
194
  return yield transportSend(action, data);
165
195
  } catch (error) {
166
196
  processAndThrow(error);
167
197
  }
168
198
  });
169
- return function (_x4, _x5) {
170
- return _ref4.apply(this, arguments);
199
+ return function (_x5, _x6) {
200
+ return _ref5.apply(this, arguments);
171
201
  };
172
202
  }();
173
203
  var transportSendComplete = this.widgetApi.transport.sendComplete.bind(this.widgetApi.transport);
174
204
  this.widgetApi.transport.sendComplete = /*#__PURE__*/function () {
175
- var _ref5 = _asyncToGenerator(function* (action, data) {
205
+ var _ref6 = _asyncToGenerator(function* (action, data) {
176
206
  try {
177
207
  return yield transportSendComplete(action, data);
178
208
  } catch (error) {
179
209
  processAndThrow(error);
180
210
  }
181
211
  });
182
- return function (_x6, _x7) {
183
- return _ref5.apply(this, arguments);
212
+ return function (_x7, _x8) {
213
+ return _ref6.apply(this, arguments);
184
214
  };
185
215
  }();
186
216
  this.widgetApiReady = new Promise(resolve => this.widgetApi.once("ready", resolve));
217
+ this.roomStateSynced = (_capabilities$receive = capabilities.receiveState) !== null && _capabilities$receive !== void 0 && _capabilities$receive.length ? new Promise(resolve => this.widgetApi.once("action:".concat(WidgetApiToWidgetAction.UpdateState), resolve)) : Promise.resolve();
187
218
 
188
219
  // Request capabilities for the functionality this client needs to support
189
- if ((_capabilities$sendEve = capabilities.sendEvent) !== null && _capabilities$sendEve !== void 0 && _capabilities$sendEve.length || (_capabilities$receive = capabilities.receiveEvent) !== null && _capabilities$receive !== void 0 && _capabilities$receive.length || capabilities.sendMessage === true || Array.isArray(capabilities.sendMessage) && capabilities.sendMessage.length || capabilities.receiveMessage === true || Array.isArray(capabilities.receiveMessage) && capabilities.receiveMessage.length || (_capabilities$sendSta = capabilities.sendState) !== null && _capabilities$sendSta !== void 0 && _capabilities$sendSta.length || (_capabilities$receive2 = capabilities.receiveState) !== null && _capabilities$receive2 !== void 0 && _capabilities$receive2.length) {
220
+ if ((_capabilities$sendEve = capabilities.sendEvent) !== null && _capabilities$sendEve !== void 0 && _capabilities$sendEve.length || (_capabilities$receive2 = capabilities.receiveEvent) !== null && _capabilities$receive2 !== void 0 && _capabilities$receive2.length || capabilities.sendMessage === true || Array.isArray(capabilities.sendMessage) && capabilities.sendMessage.length || capabilities.receiveMessage === true || Array.isArray(capabilities.receiveMessage) && capabilities.receiveMessage.length || (_capabilities$sendSta = capabilities.sendState) !== null && _capabilities$sendSta !== void 0 && _capabilities$sendSta.length || (_capabilities$receive3 = capabilities.receiveState) !== null && _capabilities$receive3 !== void 0 && _capabilities$receive3.length) {
190
221
  widgetApi.requestCapabilityForRoomTimeline(roomId);
191
222
  }
192
223
  (_capabilities$sendEve2 = capabilities.sendEvent) === null || _capabilities$sendEve2 === void 0 || _capabilities$sendEve2.forEach(eventType => widgetApi.requestCapabilityToSendEvent(eventType));
193
- (_capabilities$receive3 = capabilities.receiveEvent) === null || _capabilities$receive3 === void 0 || _capabilities$receive3.forEach(eventType => widgetApi.requestCapabilityToReceiveEvent(eventType));
224
+ (_capabilities$receive4 = capabilities.receiveEvent) === null || _capabilities$receive4 === void 0 || _capabilities$receive4.forEach(eventType => widgetApi.requestCapabilityToReceiveEvent(eventType));
194
225
  if (capabilities.sendMessage === true) {
195
226
  widgetApi.requestCapabilityToSendMessage();
196
227
  } else if (Array.isArray(capabilities.sendMessage)) {
@@ -201,22 +232,22 @@ export class RoomWidgetClient extends MatrixClient {
201
232
  } else if (Array.isArray(capabilities.receiveMessage)) {
202
233
  capabilities.receiveMessage.forEach(msgType => widgetApi.requestCapabilityToReceiveMessage(msgType));
203
234
  }
204
- (_capabilities$sendSta2 = capabilities.sendState) === null || _capabilities$sendSta2 === void 0 || _capabilities$sendSta2.forEach(_ref6 => {
235
+ (_capabilities$sendSta2 = capabilities.sendState) === null || _capabilities$sendSta2 === void 0 || _capabilities$sendSta2.forEach(_ref7 => {
205
236
  var {
206
237
  eventType,
207
238
  stateKey
208
- } = _ref6;
239
+ } = _ref7;
209
240
  return widgetApi.requestCapabilityToSendState(eventType, stateKey);
210
241
  });
211
- (_capabilities$receive4 = capabilities.receiveState) === null || _capabilities$receive4 === void 0 || _capabilities$receive4.forEach(_ref7 => {
242
+ (_capabilities$receive5 = capabilities.receiveState) === null || _capabilities$receive5 === void 0 || _capabilities$receive5.forEach(_ref8 => {
212
243
  var {
213
244
  eventType,
214
245
  stateKey
215
- } = _ref7;
246
+ } = _ref8;
216
247
  return widgetApi.requestCapabilityToReceiveState(eventType, stateKey);
217
248
  });
218
249
  (_capabilities$sendToD = capabilities.sendToDevice) === null || _capabilities$sendToD === void 0 || _capabilities$sendToD.forEach(eventType => widgetApi.requestCapabilityToSendToDevice(eventType));
219
- (_capabilities$receive5 = capabilities.receiveToDevice) === null || _capabilities$receive5 === void 0 || _capabilities$receive5.forEach(eventType => widgetApi.requestCapabilityToReceiveToDevice(eventType));
250
+ (_capabilities$receive6 = capabilities.receiveToDevice) === null || _capabilities$receive6 === void 0 || _capabilities$receive6.forEach(eventType => widgetApi.requestCapabilityToReceiveToDevice(eventType));
220
251
  if (capabilities.sendDelayedEvents && ((_capabilities$sendEve3 = capabilities.sendEvent) !== null && _capabilities$sendEve3 !== void 0 && _capabilities$sendEve3.length || capabilities.sendMessage === true || Array.isArray(capabilities.sendMessage) && capabilities.sendMessage.length || (_capabilities$sendSta3 = capabilities.sendState) !== null && _capabilities$sendSta3 !== void 0 && _capabilities$sendSta3.length)) {
221
252
  widgetApi.requestCapability(MatrixCapabilities.MSC4157SendDelayedEvent);
222
253
  }
@@ -228,6 +259,7 @@ export class RoomWidgetClient extends MatrixClient {
228
259
  }
229
260
  widgetApi.on("action:".concat(WidgetApiToWidgetAction.SendEvent), this.onEvent);
230
261
  widgetApi.on("action:".concat(WidgetApiToWidgetAction.SendToDevice), this.onToDevice);
262
+ widgetApi.on("action:".concat(WidgetApiToWidgetAction.UpdateState), this.onStateUpdate);
231
263
 
232
264
  // Open communication with the host
233
265
  widgetApi.start();
@@ -242,7 +274,6 @@ export class RoomWidgetClient extends MatrixClient {
242
274
  var _arguments = arguments,
243
275
  _this2 = this;
244
276
  return _asyncToGenerator(function* () {
245
- var _this2$capabilities$r, _this2$capabilities$r2;
246
277
  var opts = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : {};
247
278
  _this2.lifecycle = new AbortController();
248
279
 
@@ -257,52 +288,28 @@ export class RoomWidgetClient extends MatrixClient {
257
288
  // still has some valuable helper methods that we make use of, so we
258
289
  // instantiate it anyways
259
290
  if (opts.slidingSync) {
260
- _this2.syncApi = new SlidingSyncSdk(opts.slidingSync, _this2, opts, _this2.buildSyncApiOptions());
291
+ _this2.syncApi = new SlidingSyncSdk(opts.slidingSync, _this2, opts);
261
292
  } else {
262
293
  _this2.syncApi = new SyncApi(_this2, opts, _this2.buildSyncApiOptions());
263
294
  }
264
295
  _this2.room = _this2.syncApi.createRoom(_this2.roomId);
265
296
  _this2.store.storeRoom(_this2.room);
266
297
  yield _this2.widgetApiReady;
267
-
268
- // Backfill the requested events
269
- // We only get the most recent event for every type + state key combo,
270
- // so it doesn't really matter what order we inject them in
271
- yield Promise.all((_this2$capabilities$r = (_this2$capabilities$r2 = _this2.capabilities.receiveState) === null || _this2$capabilities$r2 === void 0 ? void 0 : _this2$capabilities$r2.map(/*#__PURE__*/function () {
272
- var _ref9 = _asyncToGenerator(function* (_ref8) {
273
- var {
274
- eventType,
275
- stateKey
276
- } = _ref8;
277
- var rawEvents = yield _this2.widgetApi.readStateEvents(eventType, undefined, stateKey, [_this2.roomId]);
278
- var events = rawEvents.map(rawEvent => new MatrixEvent(rawEvent));
279
- yield _this2.syncApi.injectRoomEvents(_this2.room, [], events);
280
- events.forEach(event => {
281
- _this2.emit(ClientEvent.Event, event);
282
- logger.info("Backfilled event ".concat(event.getId(), " ").concat(event.getType(), " ").concat(event.getStateKey()));
283
- });
284
- });
285
- return function (_x8) {
286
- return _ref9.apply(this, arguments);
287
- };
288
- }())) !== null && _this2$capabilities$r !== void 0 ? _this2$capabilities$r : []);
289
298
  if (opts.clientWellKnownPollPeriod !== undefined) {
290
299
  _this2.clientWellKnownIntervalID = setInterval(() => {
291
300
  _this2.fetchClientWellKnown();
292
301
  }, 1000 * opts.clientWellKnownPollPeriod);
293
302
  _this2.fetchClientWellKnown();
294
303
  }
304
+ yield _this2.roomStateSynced;
295
305
  _this2.setSyncState(SyncState.Syncing);
296
- logger.info("Finished backfilling events");
297
- _this2.matrixRTC.start();
298
-
299
- // Watch for TURN servers, if requested
300
- if (_this2.capabilities.turnServers) _this2.watchTurnServers();
306
+ logger.info("Finished initial sync");
301
307
  })();
302
308
  }
303
309
  stopClient() {
304
310
  this.widgetApi.off("action:".concat(WidgetApiToWidgetAction.SendEvent), this.onEvent);
305
311
  this.widgetApi.off("action:".concat(WidgetApiToWidgetAction.SendToDevice), this.onToDevice);
312
+ this.widgetApi.off("action:".concat(WidgetApiToWidgetAction.UpdateState), this.onStateUpdate);
306
313
  super.stopClient();
307
314
  this.lifecycle.abort(); // Signal to other async tasks that the client has stopped
308
315
  }
@@ -313,55 +320,12 @@ export class RoomWidgetClient extends MatrixClient {
313
320
  throw new Error("Unknown room: ".concat(roomIdOrAlias));
314
321
  })();
315
322
  }
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
323
  sendStateEvent(roomId, eventType, content) {
360
324
  var _arguments2 = arguments,
361
- _this5 = this;
325
+ _this4 = this;
362
326
  return _asyncToGenerator(function* () {
363
327
  var stateKey = _arguments2.length > 3 && _arguments2[3] !== undefined ? _arguments2[3] : "";
364
- var response = yield _this5.widgetApi.sendStateEvent(eventType, stateKey, content, roomId);
328
+ var response = yield _this4.widgetApi.sendStateEvent(eventType, stateKey, content, roomId);
365
329
  if (response.event_id === undefined) {
366
330
  throw new Error("'event_id' absent from response to an event request");
367
331
  }
@@ -377,14 +341,14 @@ export class RoomWidgetClient extends MatrixClient {
377
341
  // eslint-disable-next-line
378
342
  _unstable_sendDelayedStateEvent(roomId, delayOpts, eventType, content) {
379
343
  var _arguments3 = arguments,
380
- _this6 = this;
344
+ _this5 = this;
381
345
  return _asyncToGenerator(function* () {
382
346
  var stateKey = _arguments3.length > 4 && _arguments3[4] !== undefined ? _arguments3[4] : "";
383
- if (!(yield _this6.doesServerSupportUnstableFeature(UNSTABLE_MSC4140_DELAYED_EVENTS))) {
347
+ if (!(yield _this5.doesServerSupportUnstableFeature(UNSTABLE_MSC4140_DELAYED_EVENTS))) {
384
348
  throw Error("Server does not support the delayed events API");
385
349
  }
386
- var response = yield _this6.widgetApi.sendStateEvent(eventType, stateKey, content, roomId, "delay" in delayOpts ? delayOpts.delay : undefined, "parent_delay_id" in delayOpts ? delayOpts.parent_delay_id : undefined);
387
- return _this6.validateSendDelayedEventResponse(response);
350
+ 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);
351
+ return _this5.validateSendDelayedEventResponse(response);
388
352
  })();
389
353
  }
390
354
  validateSendDelayedEventResponse(response) {
@@ -401,25 +365,25 @@ export class RoomWidgetClient extends MatrixClient {
401
365
  */
402
366
  // eslint-disable-next-line
403
367
  _unstable_updateDelayedEvent(delayId, action) {
404
- var _this7 = this;
368
+ var _this6 = this;
405
369
  return _asyncToGenerator(function* () {
406
- if (!(yield _this7.doesServerSupportUnstableFeature(UNSTABLE_MSC4140_DELAYED_EVENTS))) {
370
+ if (!(yield _this6.doesServerSupportUnstableFeature(UNSTABLE_MSC4140_DELAYED_EVENTS))) {
407
371
  throw Error("Server does not support the delayed events API");
408
372
  }
409
- return yield _this7.widgetApi.updateDelayedEvent(delayId, action);
373
+ return yield _this6.widgetApi.updateDelayedEvent(delayId, action);
410
374
  })();
411
375
  }
412
376
  sendToDevice(eventType, contentMap) {
413
- var _this8 = this;
377
+ var _this7 = this;
414
378
  return _asyncToGenerator(function* () {
415
- yield _this8.widgetApi.sendToDevice(eventType, false, recursiveMapToObject(contentMap));
379
+ yield _this7.widgetApi.sendToDevice(eventType, false, recursiveMapToObject(contentMap));
416
380
  return {};
417
381
  })();
418
382
  }
419
383
  getOpenIdToken() {
420
- var _this9 = this;
384
+ var _this8 = this;
421
385
  return _asyncToGenerator(function* () {
422
- var token = yield _this9.widgetApi.requestOpenIDConnectToken();
386
+ var token = yield _this8.widgetApi.requestOpenIDConnectToken();
423
387
  // the IOpenIDCredentials from the widget-api and IOpenIDToken form the matrix-js-sdk are compatible.
424
388
  // we still recreate the token to make this transparent and catch'able by the linter in case the types change in the future.
425
389
  return {
@@ -430,13 +394,13 @@ export class RoomWidgetClient extends MatrixClient {
430
394
  };
431
395
  })();
432
396
  }
433
- queueToDevice(_ref10) {
434
- var _this10 = this;
397
+ queueToDevice(_ref9) {
398
+ var _this9 = this;
435
399
  return _asyncToGenerator(function* () {
436
400
  var {
437
401
  eventType,
438
402
  batch
439
- } = _ref10;
403
+ } = _ref9;
440
404
  // map: user Id → device Id → payload
441
405
  var contentMap = new MapWithDefault(() => new Map());
442
406
  for (var {
@@ -446,52 +410,7 @@ export class RoomWidgetClient extends MatrixClient {
446
410
  } of batch) {
447
411
  contentMap.getOrCreate(userId).set(deviceId, payload);
448
412
  }
449
- yield _this10.widgetApi.sendToDevice(eventType, false, recursiveMapToObject(contentMap));
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;
413
+ yield _this9.widgetApi.sendToDevice(eventType, false, recursiveMapToObject(contentMap));
495
414
  })();
496
415
  }
497
416
 
@@ -505,55 +424,9 @@ export class RoomWidgetClient extends MatrixClient {
505
424
  this.emit(ClientEvent.Sync, state, oldState);
506
425
  }
507
426
  ack(ev) {
508
- var _this14 = this;
509
- return _asyncToGenerator(function* () {
510
- yield _this14.widgetApi.transport.reply(ev.detail, {});
511
- })();
512
- }
513
- watchTurnServers() {
514
- var _this15 = this;
427
+ var _this10 = this;
515
428
  return _asyncToGenerator(function* () {
516
- var servers = _this15.widgetApi.getTurnServers();
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
- }
429
+ yield _this10.widgetApi.transport.reply(ev.detail, {});
557
430
  })();
558
431
  }
559
432
  }