@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
@@ -1,299 +0,0 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- /*
4
- Copyright 2023 The Matrix.org Foundation C.I.C.
5
-
6
- Licensed under the Apache License, Version 2.0 (the "License");
7
- you may not use this file except in compliance with the License.
8
- You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing, software
13
- distributed under the License is distributed on an "AS IS" BASIS,
14
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- See the License for the specific language governing permissions and
16
- limitations under the License.
17
- */
18
-
19
- import * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-wasm";
20
- import { CollectStrategy, EncryptionAlgorithm, EncryptionSettings, HistoryVisibility as RustHistoryVisibility, RoomId, UserId } from "@matrix-org/matrix-sdk-crypto-wasm";
21
- import { EventType } from "../@types/event.js";
22
- import { logger, LogSpan } from "../logger.js";
23
- import { HistoryVisibility } from "../@types/partials.js";
24
- import { logDuration } from "../utils.js";
25
- import { KnownMembership } from "../@types/membership.js";
26
- import { DeviceIsolationModeKind } from "../crypto-api/index.js";
27
-
28
- /**
29
- * RoomEncryptor: responsible for encrypting messages to a given room
30
- *
31
- * @internal
32
- */
33
- export class RoomEncryptor {
34
- /**
35
- * @param olmMachine - The rust-sdk's OlmMachine
36
- * @param keyClaimManager - Our KeyClaimManager, which manages the queue of one-time-key claim requests
37
- * @param outgoingRequestManager - The OutgoingRequestManager, which manages the queue of outgoing requests.
38
- * @param room - The room we want to encrypt for
39
- * @param encryptionSettings - body of the m.room.encryption event currently in force in this room
40
- */
41
- constructor(olmMachine, keyClaimManager, outgoingRequestManager, room, encryptionSettings) {
42
- this.olmMachine = olmMachine;
43
- this.keyClaimManager = keyClaimManager;
44
- this.outgoingRequestManager = outgoingRequestManager;
45
- this.room = room;
46
- this.encryptionSettings = encryptionSettings;
47
- _defineProperty(this, "prefixedLogger", void 0);
48
- /** whether the room members have been loaded and tracked for the first time */
49
- _defineProperty(this, "lazyLoadedMembersResolved", false);
50
- /**
51
- * Ensures that there is only one encryption operation at a time for that room.
52
- *
53
- * An encryption operation is either a {@link prepareForEncryption} or an {@link encryptEvent} call.
54
- */
55
- _defineProperty(this, "currentEncryptionPromise", Promise.resolve());
56
- this.prefixedLogger = logger.getChild("[".concat(room.roomId, " encryption]"));
57
-
58
- // start tracking devices for any users already known to be in this room.
59
- // Do not load members here, would defeat lazy loading.
60
- var members = room.getJoinedMembers();
61
-
62
- // At this point just mark the known members as tracked, it might not be the full list of members
63
- // because of lazy loading. This is fine, because we will get a member list update when sending a message for
64
- // the first time, see `RoomEncryptor#ensureEncryptionSession`
65
- this.olmMachine.updateTrackedUsers(members.map(u => new RustSdkCryptoJs.UserId(u.userId))).catch(e => this.prefixedLogger.error("Error initializing tracked users", e));
66
- }
67
-
68
- /**
69
- * Handle a new `m.room.encryption` event in this room
70
- *
71
- * @param config - The content of the encryption event
72
- */
73
- onCryptoEvent(config) {
74
- if (JSON.stringify(this.encryptionSettings) != JSON.stringify(config)) {
75
- // This should currently be unreachable, since the Rust SDK will reject any attempts to change config.
76
- throw new Error("Cannot reconfigure an active RoomEncryptor");
77
- }
78
- }
79
-
80
- /**
81
- * Handle a new `m.room.member` event in this room
82
- *
83
- * @param member - new membership state
84
- */
85
- onRoomMembership(member) {
86
- if (member.membership == KnownMembership.Join || member.membership == KnownMembership.Invite && this.room.shouldEncryptForInvitedMembers()) {
87
- // make sure we are tracking the deviceList for this user
88
- this.olmMachine.updateTrackedUsers([new UserId(member.userId)]).catch(e => {
89
- this.prefixedLogger.error("Unable to update tracked users", e);
90
- });
91
- }
92
-
93
- // TODO: handle leaves (including our own)
94
- }
95
-
96
- /**
97
- * Prepare to encrypt events in this room.
98
- *
99
- * This ensures that we have a megolm session ready to use and that we have shared its key with all the devices
100
- * in the room.
101
- * @param globalBlacklistUnverifiedDevices - When `true`, and `deviceIsolationMode` is `AllDevicesIsolationMode`,
102
- * will not send encrypted messages to unverified devices.
103
- * Ignored when `deviceIsolationMode` is `OnlySignedDevicesIsolationMode`.
104
- * @param deviceIsolationMode - The device isolation mode. See {@link DeviceIsolationMode}.
105
- */
106
- prepareForEncryption(globalBlacklistUnverifiedDevices, deviceIsolationMode) {
107
- var _this = this;
108
- return _asyncToGenerator(function* () {
109
- // We consider a prepareForEncryption as an encryption promise as it will potentially share keys
110
- // even if it doesn't send an event.
111
- // Usually this is called when the user starts typing, so we want to make sure we have keys ready when the
112
- // message is finally sent.
113
- // If `encryptEvent` is invoked before `prepareForEncryption` has completed, the `encryptEvent` call will wait for
114
- // `prepareForEncryption` to complete before executing.
115
- // The part where `encryptEvent` shares the room key will then usually be a no-op as it was already performed by `prepareForEncryption`.
116
- yield _this.encryptEvent(null, globalBlacklistUnverifiedDevices, deviceIsolationMode);
117
- })();
118
- }
119
-
120
- /**
121
- * Encrypt an event for this room, or prepare for encryption.
122
- *
123
- * This will ensure that we have a megolm session for this room, share it with the devices in the room, and
124
- * then, if an event is provided, encrypt it using the session.
125
- *
126
- * @param event - Event to be encrypted, or null if only preparing for encryption (in which case we will pre-share the room key).
127
- * @param globalBlacklistUnverifiedDevices - When `true`, and `deviceIsolationMode` is `AllDevicesIsolationMode`,
128
- * will not send encrypted messages to unverified devices.
129
- * Ignored when `deviceIsolationMode` is `OnlySignedDevicesIsolationMode`.
130
- * @param deviceIsolationMode - The device isolation mode. See {@link DeviceIsolationMode}.
131
- */
132
- encryptEvent(event, globalBlacklistUnverifiedDevices, deviceIsolationMode) {
133
- var _event$getTxnId,
134
- _this2 = this;
135
- var logger = new LogSpan(this.prefixedLogger, event ? (_event$getTxnId = event.getTxnId()) !== null && _event$getTxnId !== void 0 ? _event$getTxnId : "" : "prepareForEncryption");
136
- // Ensure order of encryption to avoid message ordering issues, as the scheduler only ensures
137
- // events order after they have been encrypted.
138
- var prom = this.currentEncryptionPromise.catch(() => {
139
- // Any errors in the previous call will have been reported already, so there is nothing to do here.
140
- // we just throw away the error and start anew.
141
- }).then(/*#__PURE__*/_asyncToGenerator(function* () {
142
- yield logDuration(logger, "ensureEncryptionSession", /*#__PURE__*/_asyncToGenerator(function* () {
143
- yield _this2.ensureEncryptionSession(logger, globalBlacklistUnverifiedDevices, deviceIsolationMode);
144
- }));
145
- if (event) {
146
- yield logDuration(logger, "encryptEventInner", /*#__PURE__*/_asyncToGenerator(function* () {
147
- yield _this2.encryptEventInner(logger, event);
148
- }));
149
- }
150
- }));
151
- this.currentEncryptionPromise = prom;
152
- return prom;
153
- }
154
-
155
- /**
156
- * Prepare to encrypt events in this room.
157
- *
158
- * This ensures that we have a megolm session ready to use and that we have shared its key with all the devices
159
- * in the room.
160
- *
161
- * @param logger - a place to write diagnostics to
162
- * @param globalBlacklistUnverifiedDevices - When `true`, and `deviceIsolationMode` is `AllDevicesIsolationMode`,
163
- * will not send encrypted messages to unverified devices.
164
- * Ignored when `deviceIsolationMode` is `OnlySignedDevicesIsolationMode`.
165
- * @param deviceIsolationMode - The device isolation mode. See {@link DeviceIsolationMode}.
166
- */
167
- ensureEncryptionSession(logger, globalBlacklistUnverifiedDevices, deviceIsolationMode) {
168
- var _this3 = this;
169
- return _asyncToGenerator(function* () {
170
- if (_this3.encryptionSettings.algorithm !== "m.megolm.v1.aes-sha2") {
171
- throw new Error("Cannot encrypt in ".concat(_this3.room.roomId, " for unsupported algorithm '").concat(_this3.encryptionSettings.algorithm, "'"));
172
- }
173
- logger.debug("Starting encryption");
174
- var members = yield _this3.room.getEncryptionTargetMembers();
175
-
176
- // If this is the first time we are sending a message to the room, we may not yet have seen all the members
177
- // (so the Crypto SDK might not have a device list for them). So, if this is the first time we are encrypting
178
- // for this room, give the SDK the full list of members, to be on the safe side.
179
- //
180
- // This could end up being racy (if two calls to ensureEncryptionSession happen at the same time), but that's
181
- // not a particular problem, since `OlmMachine.updateTrackedUsers` just adds any users that weren't already tracked.
182
- if (!_this3.lazyLoadedMembersResolved) {
183
- yield logDuration(_this3.prefixedLogger, "loadMembersIfNeeded: updateTrackedUsers", /*#__PURE__*/_asyncToGenerator(function* () {
184
- yield _this3.olmMachine.updateTrackedUsers(members.map(u => new RustSdkCryptoJs.UserId(u.userId)));
185
- }));
186
- logger.debug("Updated tracked users");
187
- _this3.lazyLoadedMembersResolved = true;
188
-
189
- // Query keys in case we don't have them for newly tracked members.
190
- // It's important after loading members for the first time, as likely most of them won't be
191
- // known yet and will be unable to decrypt messages despite being in the room for long.
192
- // This must be done before ensuring sessions. If not the devices of these users are not
193
- // known yet and will not get the room key.
194
- // We don't have API to only get the keys queries related to this member list, so we just
195
- // process the pending requests from the olmMachine. (usually these are processed
196
- // at the end of the sync, but we can't wait for that).
197
- // XXX future improvement process only KeysQueryRequests for the users that have never been queried.
198
- logger.debug("Processing outgoing requests");
199
- yield logDuration(_this3.prefixedLogger, "doProcessOutgoingRequests", /*#__PURE__*/_asyncToGenerator(function* () {
200
- yield _this3.outgoingRequestManager.doProcessOutgoingRequests();
201
- }));
202
- } else {
203
- // If members are already loaded it's less critical to await on key queries.
204
- // We might still want to trigger a processOutgoingRequests here.
205
- // The call to `ensureSessionsForUsers` below will wait a bit on in-flight key queries we are
206
- // interested in. If a sync handling happens in the meantime, and some new members are added to the room
207
- // or have new devices it would give us a chance to query them before sending.
208
- // It's less critical due to the racy nature of this process.
209
- logger.debug("Processing outgoing requests in background");
210
- _this3.outgoingRequestManager.doProcessOutgoingRequests();
211
- }
212
- logger.debug("Encrypting for users (shouldEncryptForInvitedMembers: ".concat(_this3.room.shouldEncryptForInvitedMembers(), "):"), members.map(u => "".concat(u.userId, " (").concat(u.membership, ")")));
213
- var userList = members.map(u => new UserId(u.userId));
214
- yield logDuration(_this3.prefixedLogger, "ensureSessionsForUsers", /*#__PURE__*/_asyncToGenerator(function* () {
215
- yield _this3.keyClaimManager.ensureSessionsForUsers(logger, userList);
216
- }));
217
- var rustEncryptionSettings = new EncryptionSettings();
218
- rustEncryptionSettings.historyVisibility = toRustHistoryVisibility(_this3.room.getHistoryVisibility());
219
-
220
- // We only support megolm
221
- rustEncryptionSettings.algorithm = EncryptionAlgorithm.MegolmV1AesSha2;
222
-
223
- // We need to convert the rotation period from milliseconds to microseconds
224
- // See https://spec.matrix.org/v1.8/client-server-api/#mroomencryption and
225
- // https://matrix-org.github.io/matrix-rust-sdk-crypto-wasm/classes/EncryptionSettings.html#rotationPeriod
226
- if (typeof _this3.encryptionSettings.rotation_period_ms === "number") {
227
- rustEncryptionSettings.rotationPeriod = BigInt(_this3.encryptionSettings.rotation_period_ms * 1000);
228
- }
229
- if (typeof _this3.encryptionSettings.rotation_period_msgs === "number") {
230
- rustEncryptionSettings.rotationPeriodMessages = BigInt(_this3.encryptionSettings.rotation_period_msgs);
231
- }
232
- switch (deviceIsolationMode.kind) {
233
- case DeviceIsolationModeKind.AllDevicesIsolationMode:
234
- {
235
- var _this3$room$getBlackl;
236
- // When this.room.getBlacklistUnverifiedDevices() === null, the global settings should be used
237
- // See Room#getBlacklistUnverifiedDevices
238
- var onlyAllowTrustedDevices = (_this3$room$getBlackl = _this3.room.getBlacklistUnverifiedDevices()) !== null && _this3$room$getBlackl !== void 0 ? _this3$room$getBlackl : globalBlacklistUnverifiedDevices;
239
- rustEncryptionSettings.sharingStrategy = CollectStrategy.deviceBasedStrategy(onlyAllowTrustedDevices, deviceIsolationMode.errorOnVerifiedUserProblems);
240
- }
241
- break;
242
- case DeviceIsolationModeKind.OnlySignedDevicesIsolationMode:
243
- rustEncryptionSettings.sharingStrategy = CollectStrategy.identityBasedStrategy();
244
- break;
245
- }
246
- yield logDuration(_this3.prefixedLogger, "shareRoomKey", /*#__PURE__*/_asyncToGenerator(function* () {
247
- var shareMessages = yield _this3.olmMachine.shareRoomKey(new RoomId(_this3.room.roomId),
248
- // safe to pass without cloning, as it's not reused here (before or after)
249
- userList, rustEncryptionSettings);
250
- if (shareMessages) {
251
- for (var m of shareMessages) {
252
- yield _this3.outgoingRequestManager.outgoingRequestProcessor.makeOutgoingRequest(m);
253
- }
254
- }
255
- }));
256
- })();
257
- }
258
-
259
- /**
260
- * Discard any existing group session for this room
261
- */
262
- forceDiscardSession() {
263
- var _this4 = this;
264
- return _asyncToGenerator(function* () {
265
- var r = yield _this4.olmMachine.invalidateGroupSession(new RoomId(_this4.room.roomId));
266
- if (r) {
267
- _this4.prefixedLogger.info("Discarded existing group session");
268
- }
269
- })();
270
- }
271
- encryptEventInner(logger, event) {
272
- var _this5 = this;
273
- return _asyncToGenerator(function* () {
274
- logger.debug("Encrypting actual message content");
275
- var encryptedContent = yield _this5.olmMachine.encryptRoomEvent(new RoomId(_this5.room.roomId), event.getType(), JSON.stringify(event.getContent()));
276
- event.makeEncrypted(EventType.RoomMessageEncrypted, JSON.parse(encryptedContent), _this5.olmMachine.identityKeys.curve25519.toBase64(), _this5.olmMachine.identityKeys.ed25519.toBase64());
277
- logger.debug("Encrypted event successfully");
278
- })();
279
- }
280
- }
281
-
282
- /**
283
- * Convert a HistoryVisibility to a RustHistoryVisibility
284
- * @param visibility - HistoryVisibility enum
285
- * @returns a RustHistoryVisibility enum
286
- */
287
- export function toRustHistoryVisibility(visibility) {
288
- switch (visibility) {
289
- case HistoryVisibility.Invited:
290
- return RustHistoryVisibility.Invited;
291
- case HistoryVisibility.Joined:
292
- return RustHistoryVisibility.Joined;
293
- case HistoryVisibility.Shared:
294
- return RustHistoryVisibility.Shared;
295
- case HistoryVisibility.WorldReadable:
296
- return RustHistoryVisibility.WorldReadable;
297
- }
298
- }
299
- //# sourceMappingURL=RoomEncryptor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RoomEncryptor.js","names":["RustSdkCryptoJs","CollectStrategy","EncryptionAlgorithm","EncryptionSettings","HistoryVisibility","RustHistoryVisibility","RoomId","UserId","EventType","logger","LogSpan","logDuration","KnownMembership","DeviceIsolationModeKind","RoomEncryptor","constructor","olmMachine","keyClaimManager","outgoingRequestManager","room","encryptionSettings","_defineProperty","Promise","resolve","prefixedLogger","getChild","concat","roomId","members","getJoinedMembers","updateTrackedUsers","map","u","userId","catch","e","error","onCryptoEvent","config","JSON","stringify","Error","onRoomMembership","member","membership","Join","Invite","shouldEncryptForInvitedMembers","prepareForEncryption","globalBlacklistUnverifiedDevices","deviceIsolationMode","_this","_asyncToGenerator","encryptEvent","event","_event$getTxnId","_this2","getTxnId","prom","currentEncryptionPromise","then","ensureEncryptionSession","encryptEventInner","_this3","algorithm","debug","getEncryptionTargetMembers","lazyLoadedMembersResolved","doProcessOutgoingRequests","userList","ensureSessionsForUsers","rustEncryptionSettings","historyVisibility","toRustHistoryVisibility","getHistoryVisibility","MegolmV1AesSha2","rotation_period_ms","rotationPeriod","BigInt","rotation_period_msgs","rotationPeriodMessages","kind","AllDevicesIsolationMode","_this3$room$getBlackl","onlyAllowTrustedDevices","getBlacklistUnverifiedDevices","sharingStrategy","deviceBasedStrategy","errorOnVerifiedUserProblems","OnlySignedDevicesIsolationMode","identityBasedStrategy","shareMessages","shareRoomKey","m","outgoingRequestProcessor","makeOutgoingRequest","forceDiscardSession","_this4","r","invalidateGroupSession","info","_this5","encryptedContent","encryptRoomEvent","getType","getContent","makeEncrypted","RoomMessageEncrypted","parse","identityKeys","curve25519","toBase64","ed25519","visibility","Invited","Joined","Shared","WorldReadable"],"sources":["../../src/rust-crypto/RoomEncryptor.ts"],"sourcesContent":["/*\nCopyright 2023 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport * as RustSdkCryptoJs from \"@matrix-org/matrix-sdk-crypto-wasm\";\nimport {\n CollectStrategy,\n EncryptionAlgorithm,\n EncryptionSettings,\n HistoryVisibility as RustHistoryVisibility,\n OlmMachine,\n RoomId,\n ToDeviceRequest,\n UserId,\n} from \"@matrix-org/matrix-sdk-crypto-wasm\";\n\nimport { EventType } from \"../@types/event.ts\";\nimport { IContent, MatrixEvent } from \"../models/event.ts\";\nimport { Room } from \"../models/room.ts\";\nimport { Logger, logger, LogSpan } from \"../logger.ts\";\nimport { KeyClaimManager } from \"./KeyClaimManager.ts\";\nimport { RoomMember } from \"../models/room-member.ts\";\nimport { HistoryVisibility } from \"../@types/partials.ts\";\nimport { OutgoingRequestsManager } from \"./OutgoingRequestsManager.ts\";\nimport { logDuration } from \"../utils.ts\";\nimport { KnownMembership } from \"../@types/membership.ts\";\nimport { DeviceIsolationMode, DeviceIsolationModeKind } from \"../crypto-api/index.ts\";\n\n/**\n * RoomEncryptor: responsible for encrypting messages to a given room\n *\n * @internal\n */\nexport class RoomEncryptor {\n private readonly prefixedLogger: Logger;\n\n /** whether the room members have been loaded and tracked for the first time */\n private lazyLoadedMembersResolved = false;\n\n /**\n * Ensures that there is only one encryption operation at a time for that room.\n *\n * An encryption operation is either a {@link prepareForEncryption} or an {@link encryptEvent} call.\n */\n private currentEncryptionPromise: Promise<void> = Promise.resolve();\n\n /**\n * @param olmMachine - The rust-sdk's OlmMachine\n * @param keyClaimManager - Our KeyClaimManager, which manages the queue of one-time-key claim requests\n * @param outgoingRequestManager - The OutgoingRequestManager, which manages the queue of outgoing requests.\n * @param room - The room we want to encrypt for\n * @param encryptionSettings - body of the m.room.encryption event currently in force in this room\n */\n public constructor(\n private readonly olmMachine: OlmMachine,\n private readonly keyClaimManager: KeyClaimManager,\n private readonly outgoingRequestManager: OutgoingRequestsManager,\n private readonly room: Room,\n private encryptionSettings: IContent,\n ) {\n this.prefixedLogger = logger.getChild(`[${room.roomId} encryption]`);\n\n // start tracking devices for any users already known to be in this room.\n // Do not load members here, would defeat lazy loading.\n const members = room.getJoinedMembers();\n\n // At this point just mark the known members as tracked, it might not be the full list of members\n // because of lazy loading. This is fine, because we will get a member list update when sending a message for\n // the first time, see `RoomEncryptor#ensureEncryptionSession`\n this.olmMachine\n .updateTrackedUsers(members.map((u) => new RustSdkCryptoJs.UserId(u.userId)))\n .catch((e) => this.prefixedLogger.error(\"Error initializing tracked users\", e));\n }\n\n /**\n * Handle a new `m.room.encryption` event in this room\n *\n * @param config - The content of the encryption event\n */\n public onCryptoEvent(config: IContent): void {\n if (JSON.stringify(this.encryptionSettings) != JSON.stringify(config)) {\n // This should currently be unreachable, since the Rust SDK will reject any attempts to change config.\n throw new Error(\"Cannot reconfigure an active RoomEncryptor\");\n }\n }\n\n /**\n * Handle a new `m.room.member` event in this room\n *\n * @param member - new membership state\n */\n public onRoomMembership(member: RoomMember): void {\n if (\n member.membership == KnownMembership.Join ||\n (member.membership == KnownMembership.Invite && this.room.shouldEncryptForInvitedMembers())\n ) {\n // make sure we are tracking the deviceList for this user\n this.olmMachine.updateTrackedUsers([new UserId(member.userId)]).catch((e) => {\n this.prefixedLogger.error(\"Unable to update tracked users\", e);\n });\n }\n\n // TODO: handle leaves (including our own)\n }\n\n /**\n * Prepare to encrypt events in this room.\n *\n * This ensures that we have a megolm session ready to use and that we have shared its key with all the devices\n * in the room.\n * @param globalBlacklistUnverifiedDevices - When `true`, and `deviceIsolationMode` is `AllDevicesIsolationMode`,\n * will not send encrypted messages to unverified devices.\n * Ignored when `deviceIsolationMode` is `OnlySignedDevicesIsolationMode`.\n * @param deviceIsolationMode - The device isolation mode. See {@link DeviceIsolationMode}.\n */\n public async prepareForEncryption(\n globalBlacklistUnverifiedDevices: boolean,\n deviceIsolationMode: DeviceIsolationMode,\n ): Promise<void> {\n // We consider a prepareForEncryption as an encryption promise as it will potentially share keys\n // even if it doesn't send an event.\n // Usually this is called when the user starts typing, so we want to make sure we have keys ready when the\n // message is finally sent.\n // If `encryptEvent` is invoked before `prepareForEncryption` has completed, the `encryptEvent` call will wait for\n // `prepareForEncryption` to complete before executing.\n // The part where `encryptEvent` shares the room key will then usually be a no-op as it was already performed by `prepareForEncryption`.\n await this.encryptEvent(null, globalBlacklistUnverifiedDevices, deviceIsolationMode);\n }\n\n /**\n * Encrypt an event for this room, or prepare for encryption.\n *\n * This will ensure that we have a megolm session for this room, share it with the devices in the room, and\n * then, if an event is provided, encrypt it using the session.\n *\n * @param event - Event to be encrypted, or null if only preparing for encryption (in which case we will pre-share the room key).\n * @param globalBlacklistUnverifiedDevices - When `true`, and `deviceIsolationMode` is `AllDevicesIsolationMode`,\n * will not send encrypted messages to unverified devices.\n * Ignored when `deviceIsolationMode` is `OnlySignedDevicesIsolationMode`.\n * @param deviceIsolationMode - The device isolation mode. See {@link DeviceIsolationMode}.\n */\n public encryptEvent(\n event: MatrixEvent | null,\n globalBlacklistUnverifiedDevices: boolean,\n deviceIsolationMode: DeviceIsolationMode,\n ): Promise<void> {\n const logger = new LogSpan(this.prefixedLogger, event ? (event.getTxnId() ?? \"\") : \"prepareForEncryption\");\n // Ensure order of encryption to avoid message ordering issues, as the scheduler only ensures\n // events order after they have been encrypted.\n const prom = this.currentEncryptionPromise\n .catch(() => {\n // Any errors in the previous call will have been reported already, so there is nothing to do here.\n // we just throw away the error and start anew.\n })\n .then(async () => {\n await logDuration(logger, \"ensureEncryptionSession\", async () => {\n await this.ensureEncryptionSession(logger, globalBlacklistUnverifiedDevices, deviceIsolationMode);\n });\n if (event) {\n await logDuration(logger, \"encryptEventInner\", async () => {\n await this.encryptEventInner(logger, event);\n });\n }\n });\n\n this.currentEncryptionPromise = prom;\n return prom;\n }\n\n /**\n * Prepare to encrypt events in this room.\n *\n * This ensures that we have a megolm session ready to use and that we have shared its key with all the devices\n * in the room.\n *\n * @param logger - a place to write diagnostics to\n * @param globalBlacklistUnverifiedDevices - When `true`, and `deviceIsolationMode` is `AllDevicesIsolationMode`,\n * will not send encrypted messages to unverified devices.\n * Ignored when `deviceIsolationMode` is `OnlySignedDevicesIsolationMode`.\n * @param deviceIsolationMode - The device isolation mode. See {@link DeviceIsolationMode}.\n */\n private async ensureEncryptionSession(\n logger: LogSpan,\n globalBlacklistUnverifiedDevices: boolean,\n deviceIsolationMode: DeviceIsolationMode,\n ): Promise<void> {\n if (this.encryptionSettings.algorithm !== \"m.megolm.v1.aes-sha2\") {\n throw new Error(\n `Cannot encrypt in ${this.room.roomId} for unsupported algorithm '${this.encryptionSettings.algorithm}'`,\n );\n }\n logger.debug(\"Starting encryption\");\n\n const members = await this.room.getEncryptionTargetMembers();\n\n // If this is the first time we are sending a message to the room, we may not yet have seen all the members\n // (so the Crypto SDK might not have a device list for them). So, if this is the first time we are encrypting\n // for this room, give the SDK the full list of members, to be on the safe side.\n //\n // This could end up being racy (if two calls to ensureEncryptionSession happen at the same time), but that's\n // not a particular problem, since `OlmMachine.updateTrackedUsers` just adds any users that weren't already tracked.\n if (!this.lazyLoadedMembersResolved) {\n await logDuration(this.prefixedLogger, \"loadMembersIfNeeded: updateTrackedUsers\", async () => {\n await this.olmMachine.updateTrackedUsers(members.map((u) => new RustSdkCryptoJs.UserId(u.userId)));\n });\n logger.debug(`Updated tracked users`);\n this.lazyLoadedMembersResolved = true;\n\n // Query keys in case we don't have them for newly tracked members.\n // It's important after loading members for the first time, as likely most of them won't be\n // known yet and will be unable to decrypt messages despite being in the room for long.\n // This must be done before ensuring sessions. If not the devices of these users are not\n // known yet and will not get the room key.\n // We don't have API to only get the keys queries related to this member list, so we just\n // process the pending requests from the olmMachine. (usually these are processed\n // at the end of the sync, but we can't wait for that).\n // XXX future improvement process only KeysQueryRequests for the users that have never been queried.\n logger.debug(`Processing outgoing requests`);\n\n await logDuration(this.prefixedLogger, \"doProcessOutgoingRequests\", async () => {\n await this.outgoingRequestManager.doProcessOutgoingRequests();\n });\n } else {\n // If members are already loaded it's less critical to await on key queries.\n // We might still want to trigger a processOutgoingRequests here.\n // The call to `ensureSessionsForUsers` below will wait a bit on in-flight key queries we are\n // interested in. If a sync handling happens in the meantime, and some new members are added to the room\n // or have new devices it would give us a chance to query them before sending.\n // It's less critical due to the racy nature of this process.\n logger.debug(`Processing outgoing requests in background`);\n this.outgoingRequestManager.doProcessOutgoingRequests();\n }\n\n logger.debug(\n `Encrypting for users (shouldEncryptForInvitedMembers: ${this.room.shouldEncryptForInvitedMembers()}):`,\n members.map((u) => `${u.userId} (${u.membership})`),\n );\n\n const userList = members.map((u) => new UserId(u.userId));\n\n await logDuration(this.prefixedLogger, \"ensureSessionsForUsers\", async () => {\n await this.keyClaimManager.ensureSessionsForUsers(logger, userList);\n });\n\n const rustEncryptionSettings = new EncryptionSettings();\n rustEncryptionSettings.historyVisibility = toRustHistoryVisibility(this.room.getHistoryVisibility());\n\n // We only support megolm\n rustEncryptionSettings.algorithm = EncryptionAlgorithm.MegolmV1AesSha2;\n\n // We need to convert the rotation period from milliseconds to microseconds\n // See https://spec.matrix.org/v1.8/client-server-api/#mroomencryption and\n // https://matrix-org.github.io/matrix-rust-sdk-crypto-wasm/classes/EncryptionSettings.html#rotationPeriod\n if (typeof this.encryptionSettings.rotation_period_ms === \"number\") {\n rustEncryptionSettings.rotationPeriod = BigInt(this.encryptionSettings.rotation_period_ms * 1000);\n }\n\n if (typeof this.encryptionSettings.rotation_period_msgs === \"number\") {\n rustEncryptionSettings.rotationPeriodMessages = BigInt(this.encryptionSettings.rotation_period_msgs);\n }\n\n switch (deviceIsolationMode.kind) {\n case DeviceIsolationModeKind.AllDevicesIsolationMode:\n {\n // When this.room.getBlacklistUnverifiedDevices() === null, the global settings should be used\n // See Room#getBlacklistUnverifiedDevices\n const onlyAllowTrustedDevices =\n this.room.getBlacklistUnverifiedDevices() ?? globalBlacklistUnverifiedDevices;\n rustEncryptionSettings.sharingStrategy = CollectStrategy.deviceBasedStrategy(\n onlyAllowTrustedDevices,\n deviceIsolationMode.errorOnVerifiedUserProblems,\n );\n }\n break;\n case DeviceIsolationModeKind.OnlySignedDevicesIsolationMode:\n rustEncryptionSettings.sharingStrategy = CollectStrategy.identityBasedStrategy();\n break;\n }\n\n await logDuration(this.prefixedLogger, \"shareRoomKey\", async () => {\n const shareMessages: ToDeviceRequest[] = await this.olmMachine.shareRoomKey(\n new RoomId(this.room.roomId),\n // safe to pass without cloning, as it's not reused here (before or after)\n userList,\n rustEncryptionSettings,\n );\n if (shareMessages) {\n for (const m of shareMessages) {\n await this.outgoingRequestManager.outgoingRequestProcessor.makeOutgoingRequest(m);\n }\n }\n });\n }\n\n /**\n * Discard any existing group session for this room\n */\n public async forceDiscardSession(): Promise<void> {\n const r = await this.olmMachine.invalidateGroupSession(new RoomId(this.room.roomId));\n if (r) {\n this.prefixedLogger.info(\"Discarded existing group session\");\n }\n }\n\n private async encryptEventInner(logger: LogSpan, event: MatrixEvent): Promise<void> {\n logger.debug(\"Encrypting actual message content\");\n const encryptedContent = await this.olmMachine.encryptRoomEvent(\n new RoomId(this.room.roomId),\n event.getType(),\n JSON.stringify(event.getContent()),\n );\n\n event.makeEncrypted(\n EventType.RoomMessageEncrypted,\n JSON.parse(encryptedContent),\n this.olmMachine.identityKeys.curve25519.toBase64(),\n this.olmMachine.identityKeys.ed25519.toBase64(),\n );\n\n logger.debug(\"Encrypted event successfully\");\n }\n}\n\n/**\n * Convert a HistoryVisibility to a RustHistoryVisibility\n * @param visibility - HistoryVisibility enum\n * @returns a RustHistoryVisibility enum\n */\nexport function toRustHistoryVisibility(visibility: HistoryVisibility): RustHistoryVisibility {\n switch (visibility) {\n case HistoryVisibility.Invited:\n return RustHistoryVisibility.Invited;\n case HistoryVisibility.Joined:\n return RustHistoryVisibility.Joined;\n case HistoryVisibility.Shared:\n return RustHistoryVisibility.Shared;\n case HistoryVisibility.WorldReadable:\n return RustHistoryVisibility.WorldReadable;\n }\n}\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,eAAe,MAAM,oCAAoC;AACrE,SACIC,eAAe,EACfC,mBAAmB,EACnBC,kBAAkB,EAClBC,iBAAiB,IAAIC,qBAAqB,EAE1CC,MAAM,EAENC,MAAM,QACH,oCAAoC;AAE3C,SAASC,SAAS,QAAQ,oBAAoB;AAG9C,SAAiBC,MAAM,EAAEC,OAAO,QAAQ,cAAc;AAGtD,SAASN,iBAAiB,QAAQ,uBAAuB;AAEzD,SAASO,WAAW,QAAQ,aAAa;AACzC,SAASC,eAAe,QAAQ,yBAAyB;AACzD,SAA8BC,uBAAuB,QAAQ,wBAAwB;;AAErF;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,CAAC;EAavB;AACJ;AACA;AACA;AACA;AACA;AACA;EACWC,WAAWA,CACGC,UAAsB,EACtBC,eAAgC,EAChCC,sBAA+C,EAC/CC,IAAU,EACnBC,kBAA4B,EACtC;IAAA,KALmBJ,UAAsB,GAAtBA,UAAsB;IAAA,KACtBC,eAAgC,GAAhCA,eAAgC;IAAA,KAChCC,sBAA+C,GAA/CA,sBAA+C;IAAA,KAC/CC,IAAU,GAAV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AO/G,qBAAqB,CAAC+G,MAAM;IACvC,KAAKhH,iBAAiB,CAACiH,aAAa;MAChC,OAAOhH,qBAAqB,CAACgH,aAAa;EAClD;AACJ","ignoreList":[]}
@@ -1,254 +0,0 @@
1
- import { OlmMachine } from "@matrix-org/matrix-sdk-crypto-wasm";
2
- import * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-wasm";
3
- import { BackupTrustInfo, KeyBackupCheck, KeyBackupInfo, KeyBackupSession, Curve25519SessionData, KeyBackupRestoreOpts, KeyBackupRestoreResult, KeyBackupRoomSessions } from "../crypto-api/keybackup.ts";
4
- import { IHttpOpts, MatrixHttpApi } from "../http-api/index.ts";
5
- import { IMegolmSessionData } from "../crypto/index.ts";
6
- import { TypedEventEmitter } from "../models/typed-event-emitter.ts";
7
- import { OutgoingRequestProcessor } from "./OutgoingRequestProcessor.ts";
8
- import { BackupDecryptor } from "../common-crypto/CryptoBackend.ts";
9
- import { ImportRoomKeysOpts, CryptoEvent } from "../crypto-api/index.ts";
10
- import { AESEncryptedSecretStoragePayload } from "../@types/AESEncryptedSecretStoragePayload.ts";
11
- /** Authentification of the backup info, depends on algorithm */
12
- type AuthData = KeyBackupInfo["auth_data"];
13
- /**
14
- * Holds information of a created keybackup.
15
- * Useful to get the generated private key material and save it securely somewhere.
16
- */
17
- interface KeyBackupCreationInfo {
18
- version: string;
19
- algorithm: string;
20
- authData: AuthData;
21
- decryptionKey: RustSdkCryptoJs.BackupDecryptionKey;
22
- }
23
- /**
24
- * @internal
25
- */
26
- export declare class RustBackupManager extends TypedEventEmitter<RustBackupCryptoEvents, RustBackupCryptoEventMap> {
27
- private readonly olmMachine;
28
- private readonly http;
29
- private readonly outgoingRequestProcessor;
30
- /** Have we checked if there is a backup on the server which we can use */
31
- private checkedForBackup;
32
- /**
33
- * The latest backup version on the server, when we last checked.
34
- *
35
- * If there was no backup on the server, `null`. If our attempt to check resulted in an error, `undefined`.
36
- *
37
- * Note that the backup was not necessarily verified.
38
- */
39
- private serverBackupInfo;
40
- private activeBackupVersion;
41
- private stopped;
42
- /** whether {@link backupKeysLoop} is currently running */
43
- private backupKeysLoopRunning;
44
- constructor(olmMachine: OlmMachine, http: MatrixHttpApi<IHttpOpts & {
45
- onlyData: true;
46
- }>, outgoingRequestProcessor: OutgoingRequestProcessor);
47
- /**
48
- * Tells the RustBackupManager to stop.
49
- * The RustBackupManager is scheduling background uploads of keys to the backup, this
50
- * call allows to cancel the process when the client is stoppped.
51
- */
52
- stop(): void;
53
- /**
54
- * Get the backup version we are currently backing up to, if any
55
- */
56
- getActiveBackupVersion(): Promise<string | null>;
57
- /**
58
- * Return the details of the latest backup on the server, when we last checked.
59
- *
60
- * This normally returns a cached value, but if we haven't yet made a request to the server, it will fire one off.
61
- * It will always return the details of the active backup if key backup is enabled.
62
- *
63
- * If there was no backup on the server, `null`. If our attempt to check resulted in an error, `undefined`.
64
- */
65
- getServerBackupInfo(): Promise<KeyBackupInfo | null | undefined>;
66
- /**
67
- * Determine if a key backup can be trusted.
68
- *
69
- * @param info - key backup info dict from {@link MatrixClient#getKeyBackupVersion}.
70
- */
71
- isKeyBackupTrusted(info: KeyBackupInfo): Promise<BackupTrustInfo>;
72
- /**
73
- * Re-check the key backup and enable/disable it as appropriate.
74
- *
75
- * @param force - whether we should force a re-check even if one has already happened.
76
- */
77
- checkKeyBackupAndEnable(force: boolean): Promise<KeyBackupCheck | null>;
78
- /**
79
- * Handles a backup secret received event and store it if it matches the current backup version.
80
- *
81
- * @param secret - The secret as received from a `m.secret.send` event for secret `m.megolm_backup.v1`.
82
- * @returns true if the secret is valid and has been stored, false otherwise.
83
- */
84
- handleBackupSecretReceived(secret: string): Promise<boolean>;
85
- saveBackupDecryptionKey(backupDecryptionKey: RustSdkCryptoJs.BackupDecryptionKey, version: string): Promise<void>;
86
- /**
87
- * Import a list of room keys previously exported by exportRoomKeys
88
- *
89
- * @param keys - a list of session export objects
90
- * @param opts - options object
91
- * @returns a promise which resolves once the keys have been imported
92
- */
93
- importRoomKeys(keys: IMegolmSessionData[], opts?: ImportRoomKeysOpts): Promise<void>;
94
- /**
95
- * Import a list of room keys previously exported by exportRoomKeysAsJson
96
- *
97
- * @param jsonKeys - a JSON string encoding a list of session export objects,
98
- * each of which is an IMegolmSessionData
99
- * @param opts - options object
100
- * @returns a promise which resolves once the keys have been imported
101
- */
102
- importRoomKeysAsJson(jsonKeys: string, opts?: ImportRoomKeysOpts): Promise<void>;
103
- /**
104
- * Implementation of {@link CryptoBackend#importBackedUpRoomKeys}.
105
- */
106
- importBackedUpRoomKeys(keys: IMegolmSessionData[], backupVersion: string, opts?: ImportRoomKeysOpts): Promise<void>;
107
- private keyBackupCheckInProgress;
108
- /** Helper for `checkKeyBackup` */
109
- private doCheckKeyBackup;
110
- private enableKeyBackup;
111
- /**
112
- * Restart the backup key loop if there is an active trusted backup.
113
- * Doesn't try to check the backup server side. To be called when a new
114
- * megolm key is known locally.
115
- */
116
- maybeUploadKey(): Promise<void>;
117
- private disableKeyBackup;
118
- private backupKeysLoop;
119
- /**
120
- * Utility method to count the number of keys in a backup request, in order to update the remaining keys count.
121
- * This should be the chunk size of the backup request for all requests but the last, but we don't have access to it
122
- * (it's static in the Rust SDK).
123
- * @param batch - The backup request to count the keys from.
124
- *
125
- * @returns The number of keys in the backup request.
126
- */
127
- private keysCountInBatch;
128
- /**
129
- * Get information about a key backup from the server
130
- * - If version is provided, get information about that backup version.
131
- * - If no version is provided, get information about the latest backup.
132
- *
133
- * @param version - The version of the backup to get information about.
134
- * @returns Information object from API or null if there is no active backup.
135
- */
136
- requestKeyBackupVersion(version?: string): Promise<KeyBackupInfo | null>;
137
- /**
138
- * Creates a new key backup by generating a new random private key.
139
- *
140
- * If there is an existing backup server side it will be deleted and replaced
141
- * by the new one.
142
- *
143
- * @param signObject - Method that should sign the backup with existing device and
144
- * existing identity.
145
- * @returns a KeyBackupCreationInfo - All information related to the backup.
146
- */
147
- setupKeyBackup(signObject: (authData: AuthData) => Promise<void>): Promise<KeyBackupCreationInfo>;
148
- /**
149
- * Deletes all key backups.
150
- *
151
- * Will call the API to delete active backup until there is no more present.
152
- */
153
- deleteAllKeyBackupVersions(): Promise<void>;
154
- /**
155
- * Deletes the given key backup.
156
- *
157
- * @param version - The backup version to delete.
158
- */
159
- deleteKeyBackupVersion(version: string): Promise<void>;
160
- /**
161
- * Creates a new backup decryptor for the given private key.
162
- * @param decryptionKey - The private key to use for decryption.
163
- */
164
- createBackupDecryptor(decryptionKey: RustSdkCryptoJs.BackupDecryptionKey): BackupDecryptor;
165
- /**
166
- * Restore a key backup.
167
- *
168
- * @param backupVersion - The version of the backup to restore.
169
- * @param backupDecryptor - The backup decryptor to use to decrypt the keys.
170
- * @param opts - Options for the restore.
171
- * @returns The total number of keys and the total imported.
172
- */
173
- restoreKeyBackup(backupVersion: string, backupDecryptor: BackupDecryptor, opts?: KeyBackupRestoreOpts): Promise<KeyBackupRestoreResult>;
174
- /**
175
- * Call `/room_keys/keys` to download the key backup (room keys) for the given backup version.
176
- * https://spec.matrix.org/v1.12/client-server-api/#get_matrixclientv3room_keyskeys
177
- *
178
- * @param backupVersion
179
- * @returns The key backup response.
180
- */
181
- private downloadKeyBackup;
182
- /**
183
- * Import the room keys from a `/room_keys/keys` call.
184
- * Calls `opts.progressCallback` with the progress of the import.
185
- *
186
- * @param keyBackup - The response from the server containing the keys to import.
187
- * @param backupVersion - The version of the backup info.
188
- * @param backupDecryptor - The backup decryptor to use to decrypt the keys.
189
- * @param opts - Options for the import.
190
- *
191
- * @returns The total number of keys and the total imported.
192
- *
193
- * @private
194
- */
195
- private importKeyBackup;
196
- }
197
- /**
198
- * Implementation of {@link BackupDecryptor} for the rust crypto backend.
199
- */
200
- export declare class RustBackupDecryptor implements BackupDecryptor {
201
- private decryptionKey;
202
- sourceTrusted: boolean;
203
- constructor(decryptionKey: RustSdkCryptoJs.BackupDecryptionKey);
204
- /**
205
- * Implements {@link BackupDecryptor#decryptSessions}
206
- */
207
- decryptSessions(ciphertexts: Record<string, KeyBackupSession<Curve25519SessionData | AESEncryptedSecretStoragePayload>>): Promise<IMegolmSessionData[]>;
208
- /**
209
- * Implements {@link BackupDecryptor#free}
210
- */
211
- free(): void;
212
- }
213
- /**
214
- * Fetch a key backup info from the server.
215
- *
216
- * If `version` is provided, calls `GET /room_keys/version/$version` and gets the backup info for that version.
217
- * See https://spec.matrix.org/v1.12/client-server-api/#get_matrixclientv3room_keysversionversion.
218
- *
219
- * If not, calls `GET /room_keys/version` and gets the latest backup info.
220
- * See https://spec.matrix.org/v1.12/client-server-api/#get_matrixclientv3room_keysversion
221
- *
222
- * @param http
223
- * @param version - the specific version of the backup info to fetch
224
- * @returns The key backup info or null if there is no backup.
225
- */
226
- export declare function requestKeyBackupVersion(http: MatrixHttpApi<IHttpOpts & {
227
- onlyData: true;
228
- }>, version?: string): Promise<KeyBackupInfo | null>;
229
- /**
230
- * Checks if the provided decryption key matches the public key of the key backup info.
231
- *
232
- * @param decryptionKey - The decryption key to check.
233
- * @param keyBackupInfo - The key backup info to check against.
234
- * @returns `true` if the decryption key matches the key backup info, `false` otherwise.
235
- */
236
- export declare function decryptionKeyMatchesKeyBackupInfo(decryptionKey: RustSdkCryptoJs.BackupDecryptionKey, keyBackupInfo: KeyBackupInfo): boolean;
237
- export type RustBackupCryptoEvents = CryptoEvent.KeyBackupStatus | CryptoEvent.KeyBackupSessionsRemaining | CryptoEvent.KeyBackupFailed | CryptoEvent.KeyBackupDecryptionKeyCached;
238
- export type RustBackupCryptoEventMap = {
239
- [CryptoEvent.KeyBackupStatus]: (enabled: boolean) => void;
240
- [CryptoEvent.KeyBackupSessionsRemaining]: (remaining: number) => void;
241
- [CryptoEvent.KeyBackupFailed]: (errCode: string) => void;
242
- [CryptoEvent.KeyBackupDecryptionKeyCached]: (version: string) => void;
243
- };
244
- /**
245
- * Response from GET `/room_keys/keys` endpoint.
246
- * See https://spec.matrix.org/latest/client-server-api/#get_matrixclientv3room_keyskeys
247
- */
248
- export interface KeyBackup {
249
- rooms: Record<string, {
250
- sessions: KeyBackupRoomSessions;
251
- }>;
252
- }
253
- export {};
254
- //# sourceMappingURL=backup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"backup.d.ts","sourceRoot":"","sources":["../../src/rust-crypto/backup.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAyB,MAAM,oCAAoC,CAAC;AACvF,OAAO,KAAK,eAAe,MAAM,oCAAoC,CAAC;AAEtE,OAAO,EACH,eAAe,EAEf,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACxB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAgB,SAAS,EAAe,aAAa,EAAU,MAAM,sBAAsB,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAA6B,kBAAkB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACpG,OAAO,EAAE,gCAAgC,EAAE,MAAM,+CAA+C,CAAC;AAEjG,gEAAgE;AAChE,KAAK,QAAQ,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AAE3C;;;GAGG;AACH,UAAU,qBAAqB;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,EAAE,eAAe,CAAC,mBAAmB,CAAC;CACtD;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,iBAAiB,CAAC,sBAAsB,EAAE,wBAAwB,CAAC;IAoBlG,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,IAAI;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