@openclaw/matrix 2026.7.1-beta.2 → 2026.7.1-beta.5

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 (1070) hide show
  1. package/dist/{account-selection-Bv_ZuOu4.js → account-selection-5e4mHR1m.js} +1 -1
  2. package/dist/api.js +5 -5
  3. package/dist/{approval-handler.runtime-DzpLXVdc.js → approval-handler.runtime-DI5x9r8I.js} +5 -5
  4. package/dist/{approval-ids-R834n6m3.js → approval-ids-ZgqbspmS.js} +1 -1
  5. package/dist/{approval-reaction-auth-eAqCXUFG.js → approval-reaction-auth-D9LijQhr.js} +2 -2
  6. package/dist/{approval-reactions-BRGQgOu2.js → approval-reactions-BdUaUXVw.js} +24 -73
  7. package/dist/auth-presence.js +1 -1
  8. package/dist/{channel-KcNo9qtl.js → channel-jUTBsjHU.js} +20 -18
  9. package/dist/channel-plugin-api.js +1 -1
  10. package/dist/{channel.runtime-DtsGVgZj.js → channel.runtime-DO1Nv9ed.js} +25 -13
  11. package/dist/{cli-Clvpw_8I.js → cli-CEfWwCKx.js} +9 -9
  12. package/dist/{cli-metadata-D3N0Avnt.js → cli-metadata-CfiEO-CE.js} +1 -1
  13. package/dist/cli-metadata.js +1 -1
  14. package/dist/{client-BQz5GcYr.js → client-FRuyCNju.js} +2 -2
  15. package/dist/{client-bootstrap-CBJciU5u.js → client-bootstrap-DjFJ7e0N.js} +1 -2
  16. package/dist/{client-D-5GVz_D.js → client-tgnlQJk4.js} +2 -2
  17. package/dist/{config-schema-Dn-fHID8.js → config-schema-DtnhNYd-.js} +1 -1
  18. package/dist/contract-api.js +2 -2
  19. package/dist/{create-client-DhGid8FE.js → create-client-CNakT7zF.js} +3 -3
  20. package/dist/{credentials-G8lNmiME.js → credentials-Ds9V1mn2.js} +1 -1
  21. package/dist/{credentials-read-TzTOQPOM.js → credentials-read-BlkvsNFg.js} +1 -1
  22. package/dist/{credentials-write.runtime-5PDPPG9f.js → credentials-write.runtime-CTqqxcut.js} +1 -1
  23. package/dist/{crypto-runtime-B7kyrTL0.js → crypto-runtime-B74cTS6A.js} +4 -4
  24. package/dist/{crypto-state-store-DK2tcEyP.js → crypto-state-store-Jy3qwhdy.js} +1 -1
  25. package/dist/{deps-D3bkh48_.js → deps-CdjHvnmh.js} +20 -2
  26. package/dist/{directory-live-Ctu4whZK.js → directory-live-Ufd4qSpX.js} +2 -2
  27. package/dist/{doctor-BRSDNU5C.js → doctor-DfaOqFtr.js} +3 -3
  28. package/dist/{doctor-contract-Dq8OZWHF.js → doctor-contract-BAja_fmb.js} +1 -1
  29. package/dist/doctor-contract-api.js +8 -14
  30. package/dist/{draft-stream-j71tSUu-.js → draft-stream-D4EH25gv.js} +1 -1
  31. package/dist/{encryption-guidance-Bg3IRYoX.js → encryption-guidance-D8walY04.js} +1 -1
  32. package/dist/{file-sync-store-BWLVB01Y.js → file-sync-store-DVm0ACml.js} +3 -3
  33. package/dist/helper-api.js +1 -1
  34. package/dist/{idb-persistence-BGY1CJ7J.js → idb-persistence-BHm97th-.js} +1 -1
  35. package/dist/index.js +1 -1
  36. package/dist/{legacy-crypto-inspector-D_8iylBq.js → legacy-crypto-inspector-vzXSkm18.js} +1 -1
  37. package/dist/{legacy-crypto-restore-B0gcIEkE.js → legacy-crypto-restore-CIBfOmLn.js} +2 -2
  38. package/dist/{matrix-migration.runtime-Ctlb_rZl.js → matrix-migration.runtime-BMCyrANT.js} +3 -3
  39. package/dist/{media-text-XO4VaezT.js → media-text-p-LP21qs.js} +1 -1
  40. package/dist/{messages-nQLGGa1r.js → messages-DRKkiEY-.js} +6 -5
  41. package/dist/{monitor-k3Sko8qt.js → monitor-CsGOGdwu.js} +71 -71
  42. package/dist/plugin-entry.handlers.runtime.js +1 -1
  43. package/dist/probe.runtime-2MZLc6ng.js +3 -0
  44. package/dist/{profile-update-DIOAhezh.js → profile-update-Ucc8RrJL.js} +2 -2
  45. package/dist/{reaction-events-BDsbR82F.js → reaction-events-DentrVii.js} +3 -3
  46. package/dist/{recovery-key-store-BGk8c_gf.js → recovery-key-store-DSeLFvNx.js} +1 -1
  47. package/dist/{resolve-targets-BbrinjHd.js → resolve-targets-DcV_KfgX.js} +1 -1
  48. package/dist/{resolver.runtime-B3N7k_6-.js → resolver.runtime-Hr6bO5zl.js} +1 -1
  49. package/dist/runtime-api.js +2 -2
  50. package/dist/runtime-heavy-api.js +1 -1
  51. package/dist/{sdk-eyqOqjmn.js → sdk-AZYVl34z.js} +8 -6
  52. package/dist/{send-D0hpevF-.js → send-D92v6Yy0.js} +21 -8
  53. package/dist/session-binding-contract-api.js +1 -1
  54. package/dist/{setup-bootstrap-Ihb_DM2a.js → setup-bootstrap-Da564w5f.js} +2 -2
  55. package/dist/{setup-core-D2BQs8w1.js → setup-core-BGgbrdaJ.js} +5 -8
  56. package/dist/setup-plugin-api.js +3 -3
  57. package/dist/{setup-surface-1qf1LZIP.js → setup-surface-iJ6pd-t5.js} +6 -6
  58. package/dist/{shared-BGcaBMK3.js → shared-DkFfq7mH.js} +6 -6
  59. package/dist/{startup-verification-Bd31KqLv.js → startup-verification-BKMAXvcV.js} +2 -2
  60. package/dist/{storage-t5S-5c_5.js → storage-CQdyKcGg.js} +5 -5
  61. package/dist/{thread-bindings-BnuBS0VH.js → thread-bindings-BX5nmWpw.js} +3 -3
  62. package/dist/{tool-actions.runtime-BeUveYxV.js → tool-actions.runtime-C1d5fxE_.js} +12 -12
  63. package/dist/{verification-CNw2K4uT.js → verification-BGCMiO1p.js} +2 -2
  64. package/node_modules/@babel/runtime/package.json +468 -1089
  65. package/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/.cargo/config.toml +2 -0
  66. package/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/CHANGELOG.md +12 -3
  67. package/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/README.md +17 -0
  68. package/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/download-lib.js +10 -2
  69. package/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/package.json +1 -1
  70. package/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/xtask/.idea/modules.xml +8 -0
  71. package/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/xtask/.idea/vcs.xml +6 -0
  72. package/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/xtask/.idea/xtask.iml +11 -0
  73. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/package.json +1 -1
  74. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.cjs +28 -28
  75. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.js +24 -24
  76. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm +0 -0
  77. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm.d.ts +58 -58
  78. package/node_modules/content-type/README.md +32 -57
  79. package/node_modules/content-type/dist/index.d.ts +26 -0
  80. package/node_modules/content-type/dist/index.js +170 -0
  81. package/node_modules/content-type/dist/index.js.map +1 -0
  82. package/node_modules/content-type/package.json +35 -25
  83. package/node_modules/linkify-it/README.md +3 -4
  84. package/node_modules/linkify-it/build/index.cjs.js +44 -41
  85. package/node_modules/linkify-it/index.mjs +10 -11
  86. package/node_modules/linkify-it/lib/re.mjs +34 -30
  87. package/node_modules/linkify-it/package.json +10 -15
  88. package/node_modules/markdown-it/dist/index.cjs.js +3652 -5378
  89. package/node_modules/markdown-it/dist/index.cjs.js.map +1 -0
  90. package/node_modules/markdown-it/dist/markdown-it.js +1399 -4479
  91. package/node_modules/markdown-it/dist/markdown-it.js.map +1 -0
  92. package/node_modules/markdown-it/dist/markdown-it.min.js +3 -2
  93. package/node_modules/markdown-it/dist/markdown-it.min.js.map +1 -0
  94. package/node_modules/markdown-it/lib/common/html_re.mjs +9 -9
  95. package/node_modules/markdown-it/lib/common/utils.mjs +2 -11
  96. package/node_modules/markdown-it/lib/parser_block.mjs +9 -9
  97. package/node_modules/markdown-it/lib/parser_core.mjs +7 -7
  98. package/node_modules/markdown-it/lib/parser_inline.mjs +16 -16
  99. package/node_modules/markdown-it/lib/renderer.mjs +2 -2
  100. package/node_modules/markdown-it/lib/rules_block/blockquote.mjs +6 -6
  101. package/node_modules/markdown-it/lib/rules_block/code.mjs +2 -2
  102. package/node_modules/markdown-it/lib/rules_block/fence.mjs +4 -4
  103. package/node_modules/markdown-it/lib/rules_block/heading.mjs +7 -7
  104. package/node_modules/markdown-it/lib/rules_block/hr.mjs +2 -2
  105. package/node_modules/markdown-it/lib/rules_block/html_block.mjs +6 -6
  106. package/node_modules/markdown-it/lib/rules_block/lheading.mjs +8 -8
  107. package/node_modules/markdown-it/lib/rules_block/list.mjs +6 -6
  108. package/node_modules/markdown-it/lib/rules_block/paragraph.mjs +5 -5
  109. package/node_modules/markdown-it/lib/rules_block/reference.mjs +1 -1
  110. package/node_modules/markdown-it/lib/rules_block/state_block.mjs +6 -6
  111. package/node_modules/markdown-it/lib/rules_block/table.mjs +4 -4
  112. package/node_modules/markdown-it/lib/rules_core/block.mjs +3 -3
  113. package/node_modules/markdown-it/lib/rules_core/linkify.mjs +15 -15
  114. package/node_modules/markdown-it/lib/rules_core/normalize.mjs +2 -2
  115. package/node_modules/markdown-it/lib/rules_inline/autolink.mjs +17 -17
  116. package/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs +2 -2
  117. package/node_modules/markdown-it/lib/rules_inline/emphasis.mjs +8 -8
  118. package/node_modules/markdown-it/lib/rules_inline/entity.mjs +7 -7
  119. package/node_modules/markdown-it/lib/rules_inline/escape.mjs +15 -1
  120. package/node_modules/markdown-it/lib/rules_inline/html_inline.mjs +1 -1
  121. package/node_modules/markdown-it/lib/rules_inline/link.mjs +1 -1
  122. package/node_modules/markdown-it/lib/rules_inline/state_inline.mjs +2 -2
  123. package/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs +10 -10
  124. package/node_modules/markdown-it/lib/token.mjs +12 -12
  125. package/node_modules/markdown-it/package.json +25 -34
  126. package/node_modules/matrix-js-sdk/CHANGELOG.md +24 -0
  127. package/node_modules/matrix-js-sdk/README.md +1 -1
  128. package/node_modules/matrix-js-sdk/lib/@types/AESEncryptedSecretStoragePayload.js +3 -1
  129. package/node_modules/matrix-js-sdk/lib/@types/IIdentityServerProvider.js +3 -1
  130. package/node_modules/matrix-js-sdk/lib/@types/PushRules.js +7 -7
  131. package/node_modules/matrix-js-sdk/lib/@types/PushRules.js.map +1 -1
  132. package/node_modules/matrix-js-sdk/lib/@types/auth.js +4 -4
  133. package/node_modules/matrix-js-sdk/lib/@types/auth.js.map +1 -1
  134. package/node_modules/matrix-js-sdk/lib/@types/beacon.js +2 -2
  135. package/node_modules/matrix-js-sdk/lib/@types/beacon.js.map +1 -1
  136. package/node_modules/matrix-js-sdk/lib/@types/common.js +3 -1
  137. package/node_modules/matrix-js-sdk/lib/@types/crypto.js +3 -1
  138. package/node_modules/matrix-js-sdk/lib/@types/event.d.ts +6 -1
  139. package/node_modules/matrix-js-sdk/lib/@types/event.d.ts.map +1 -1
  140. package/node_modules/matrix-js-sdk/lib/@types/event.js +23 -20
  141. package/node_modules/matrix-js-sdk/lib/@types/event.js.map +1 -1
  142. package/node_modules/matrix-js-sdk/lib/@types/events.js +3 -1
  143. package/node_modules/matrix-js-sdk/lib/@types/extensible_events.js +6 -6
  144. package/node_modules/matrix-js-sdk/lib/@types/extensible_events.js.map +1 -1
  145. package/node_modules/matrix-js-sdk/lib/@types/global.d.js.map +1 -1
  146. package/node_modules/matrix-js-sdk/lib/@types/json.js +3 -1
  147. package/node_modules/matrix-js-sdk/lib/@types/local_notifications.js +3 -1
  148. package/node_modules/matrix-js-sdk/lib/@types/location.js +4 -4
  149. package/node_modules/matrix-js-sdk/lib/@types/location.js.map +1 -1
  150. package/node_modules/matrix-js-sdk/lib/@types/matrix-sdk-crypto-wasm.d.js +3 -1
  151. package/node_modules/matrix-js-sdk/lib/@types/media.js +3 -1
  152. package/node_modules/matrix-js-sdk/lib/@types/membership.js +1 -1
  153. package/node_modules/matrix-js-sdk/lib/@types/membership.js.map +1 -1
  154. package/node_modules/matrix-js-sdk/lib/@types/partials.js +6 -6
  155. package/node_modules/matrix-js-sdk/lib/@types/partials.js.map +1 -1
  156. package/node_modules/matrix-js-sdk/lib/@types/polls.js +5 -5
  157. package/node_modules/matrix-js-sdk/lib/@types/polls.js.map +1 -1
  158. package/node_modules/matrix-js-sdk/lib/@types/read_receipts.js +2 -2
  159. package/node_modules/matrix-js-sdk/lib/@types/read_receipts.js.map +1 -1
  160. package/node_modules/matrix-js-sdk/lib/@types/registration.js +3 -1
  161. package/node_modules/matrix-js-sdk/lib/@types/requests.js +1 -1
  162. package/node_modules/matrix-js-sdk/lib/@types/requests.js.map +1 -1
  163. package/node_modules/matrix-js-sdk/lib/@types/retention.d.ts +15 -0
  164. package/node_modules/matrix-js-sdk/lib/@types/retention.d.ts.map +1 -0
  165. package/node_modules/matrix-js-sdk/lib/@types/retention.js +13 -0
  166. package/node_modules/matrix-js-sdk/lib/@types/retention.js.map +1 -0
  167. package/node_modules/matrix-js-sdk/lib/@types/search.js +1 -1
  168. package/node_modules/matrix-js-sdk/lib/@types/search.js.map +1 -1
  169. package/node_modules/matrix-js-sdk/lib/@types/signed.js +3 -1
  170. package/node_modules/matrix-js-sdk/lib/@types/spaces.js +3 -1
  171. package/node_modules/matrix-js-sdk/lib/@types/state_events.js +3 -1
  172. package/node_modules/matrix-js-sdk/lib/@types/synapse.js +3 -1
  173. package/node_modules/matrix-js-sdk/lib/@types/sync.js +1 -1
  174. package/node_modules/matrix-js-sdk/lib/@types/sync.js.map +1 -1
  175. package/node_modules/matrix-js-sdk/lib/@types/threepids.js +1 -1
  176. package/node_modules/matrix-js-sdk/lib/@types/threepids.js.map +1 -1
  177. package/node_modules/matrix-js-sdk/lib/@types/topic.js +1 -1
  178. package/node_modules/matrix-js-sdk/lib/@types/topic.js.map +1 -1
  179. package/node_modules/matrix-js-sdk/lib/@types/uia.js +3 -1
  180. package/node_modules/matrix-js-sdk/lib/NamespacedValue.js +8 -8
  181. package/node_modules/matrix-js-sdk/lib/NamespacedValue.js.map +1 -1
  182. package/node_modules/matrix-js-sdk/lib/ReEmitter.js +8 -15
  183. package/node_modules/matrix-js-sdk/lib/ReEmitter.js.map +1 -1
  184. package/node_modules/matrix-js-sdk/lib/ToDeviceMessageQueue.js +47 -55
  185. package/node_modules/matrix-js-sdk/lib/ToDeviceMessageQueue.js.map +1 -1
  186. package/node_modules/matrix-js-sdk/lib/autodiscovery.js +233 -247
  187. package/node_modules/matrix-js-sdk/lib/autodiscovery.js.map +1 -1
  188. package/node_modules/matrix-js-sdk/lib/base64.js +1 -1
  189. package/node_modules/matrix-js-sdk/lib/base64.js.map +1 -1
  190. package/node_modules/matrix-js-sdk/lib/browser-index.d.ts +2 -2
  191. package/node_modules/matrix-js-sdk/lib/browser-index.d.ts.map +1 -1
  192. package/node_modules/matrix-js-sdk/lib/browser-index.js +5 -5
  193. package/node_modules/matrix-js-sdk/lib/browser-index.js.map +1 -1
  194. package/node_modules/matrix-js-sdk/lib/capabilityPoller.d.ts +38 -0
  195. package/node_modules/matrix-js-sdk/lib/capabilityPoller.d.ts.map +1 -0
  196. package/node_modules/matrix-js-sdk/lib/capabilityPoller.js +93 -0
  197. package/node_modules/matrix-js-sdk/lib/capabilityPoller.js.map +1 -0
  198. package/node_modules/matrix-js-sdk/lib/client.d.ts +9 -8
  199. package/node_modules/matrix-js-sdk/lib/client.d.ts.map +1 -1
  200. package/node_modules/matrix-js-sdk/lib/client.js +2123 -2483
  201. package/node_modules/matrix-js-sdk/lib/client.js.map +1 -1
  202. package/node_modules/matrix-js-sdk/lib/common-crypto/CryptoBackend.js +3 -1
  203. package/node_modules/matrix-js-sdk/lib/common-crypto/CryptoBackend.js.map +1 -1
  204. package/node_modules/matrix-js-sdk/lib/common-crypto/key-passphrase.js.map +1 -1
  205. package/node_modules/matrix-js-sdk/lib/content-helpers.js +43 -48
  206. package/node_modules/matrix-js-sdk/lib/content-helpers.js.map +1 -1
  207. package/node_modules/matrix-js-sdk/lib/content-repo.js +14 -24
  208. package/node_modules/matrix-js-sdk/lib/content-repo.js.map +1 -1
  209. package/node_modules/matrix-js-sdk/lib/crypto/store/base.js +6 -6
  210. package/node_modules/matrix-js-sdk/lib/crypto/store/base.js.map +1 -1
  211. package/node_modules/matrix-js-sdk/lib/crypto/store/indexeddb-crypto-store-backend.js +189 -237
  212. package/node_modules/matrix-js-sdk/lib/crypto/store/indexeddb-crypto-store-backend.js.map +1 -1
  213. package/node_modules/matrix-js-sdk/lib/crypto/store/indexeddb-crypto-store.js +25 -28
  214. package/node_modules/matrix-js-sdk/lib/crypto/store/indexeddb-crypto-store.js.map +1 -1
  215. package/node_modules/matrix-js-sdk/lib/crypto/store/localStorage-crypto-store.js +113 -145
  216. package/node_modules/matrix-js-sdk/lib/crypto/store/localStorage-crypto-store.js.map +1 -1
  217. package/node_modules/matrix-js-sdk/lib/crypto/store/memory-crypto-store.js +74 -105
  218. package/node_modules/matrix-js-sdk/lib/crypto/store/memory-crypto-store.js.map +1 -1
  219. package/node_modules/matrix-js-sdk/lib/crypto-api/CryptoEvent.js +1 -1
  220. package/node_modules/matrix-js-sdk/lib/crypto-api/CryptoEvent.js.map +1 -1
  221. package/node_modules/matrix-js-sdk/lib/crypto-api/CryptoEventHandlerMap.js +3 -1
  222. package/node_modules/matrix-js-sdk/lib/crypto-api/index.d.ts +15 -6
  223. package/node_modules/matrix-js-sdk/lib/crypto-api/index.d.ts.map +1 -1
  224. package/node_modules/matrix-js-sdk/lib/crypto-api/index.js +76 -76
  225. package/node_modules/matrix-js-sdk/lib/crypto-api/index.js.map +1 -1
  226. package/node_modules/matrix-js-sdk/lib/crypto-api/key-passphrase.js +15 -23
  227. package/node_modules/matrix-js-sdk/lib/crypto-api/key-passphrase.js.map +1 -1
  228. package/node_modules/matrix-js-sdk/lib/crypto-api/keybackup.js +3 -1
  229. package/node_modules/matrix-js-sdk/lib/crypto-api/recovery-key.js +11 -12
  230. package/node_modules/matrix-js-sdk/lib/crypto-api/recovery-key.js.map +1 -1
  231. package/node_modules/matrix-js-sdk/lib/crypto-api/verification.js +3 -3
  232. package/node_modules/matrix-js-sdk/lib/crypto-api/verification.js.map +1 -1
  233. package/node_modules/matrix-js-sdk/lib/digest.js +7 -14
  234. package/node_modules/matrix-js-sdk/lib/digest.js.map +1 -1
  235. package/node_modules/matrix-js-sdk/lib/embedded.d.ts.map +1 -1
  236. package/node_modules/matrix-js-sdk/lib/embedded.js +379 -500
  237. package/node_modules/matrix-js-sdk/lib/embedded.js.map +1 -1
  238. package/node_modules/matrix-js-sdk/lib/errors.js +2 -2
  239. package/node_modules/matrix-js-sdk/lib/errors.js.map +1 -1
  240. package/node_modules/matrix-js-sdk/lib/event-mapper.js +10 -12
  241. package/node_modules/matrix-js-sdk/lib/event-mapper.js.map +1 -1
  242. package/node_modules/matrix-js-sdk/lib/extensible_events_v1/ExtensibleEvent.js.map +1 -1
  243. package/node_modules/matrix-js-sdk/lib/extensible_events_v1/InvalidEventError.js.map +1 -1
  244. package/node_modules/matrix-js-sdk/lib/extensible_events_v1/MessageEvent.js +26 -28
  245. package/node_modules/matrix-js-sdk/lib/extensible_events_v1/MessageEvent.js.map +1 -1
  246. package/node_modules/matrix-js-sdk/lib/extensible_events_v1/PollEndEvent.js +11 -12
  247. package/node_modules/matrix-js-sdk/lib/extensible_events_v1/PollEndEvent.js.map +1 -1
  248. package/node_modules/matrix-js-sdk/lib/extensible_events_v1/PollResponseEvent.js +6 -6
  249. package/node_modules/matrix-js-sdk/lib/extensible_events_v1/PollResponseEvent.js.map +1 -1
  250. package/node_modules/matrix-js-sdk/lib/extensible_events_v1/PollStartEvent.js +36 -38
  251. package/node_modules/matrix-js-sdk/lib/extensible_events_v1/PollStartEvent.js.map +1 -1
  252. package/node_modules/matrix-js-sdk/lib/extensible_events_v1/utilities.js.map +1 -1
  253. package/node_modules/matrix-js-sdk/lib/feature.js +18 -31
  254. package/node_modules/matrix-js-sdk/lib/feature.js.map +1 -1
  255. package/node_modules/matrix-js-sdk/lib/filter-component.d.ts.map +1 -1
  256. package/node_modules/matrix-js-sdk/lib/filter-component.js +20 -26
  257. package/node_modules/matrix-js-sdk/lib/filter-component.js.map +1 -1
  258. package/node_modules/matrix-js-sdk/lib/filter.js +14 -15
  259. package/node_modules/matrix-js-sdk/lib/filter.js.map +1 -1
  260. package/node_modules/matrix-js-sdk/lib/http-api/errors.js +41 -56
  261. package/node_modules/matrix-js-sdk/lib/http-api/errors.js.map +1 -1
  262. package/node_modules/matrix-js-sdk/lib/http-api/fetch.js +140 -157
  263. package/node_modules/matrix-js-sdk/lib/http-api/fetch.js.map +1 -1
  264. package/node_modules/matrix-js-sdk/lib/http-api/index.js +17 -20
  265. package/node_modules/matrix-js-sdk/lib/http-api/index.js.map +1 -1
  266. package/node_modules/matrix-js-sdk/lib/http-api/interface.js +1 -1
  267. package/node_modules/matrix-js-sdk/lib/http-api/interface.js.map +1 -1
  268. package/node_modules/matrix-js-sdk/lib/http-api/method.js +1 -1
  269. package/node_modules/matrix-js-sdk/lib/http-api/method.js.map +1 -1
  270. package/node_modules/matrix-js-sdk/lib/http-api/prefix.js +3 -3
  271. package/node_modules/matrix-js-sdk/lib/http-api/prefix.js.map +1 -1
  272. package/node_modules/matrix-js-sdk/lib/http-api/refresh.js +80 -99
  273. package/node_modules/matrix-js-sdk/lib/http-api/refresh.js.map +1 -1
  274. package/node_modules/matrix-js-sdk/lib/http-api/utils.d.ts +1 -1
  275. package/node_modules/matrix-js-sdk/lib/http-api/utils.d.ts.map +1 -1
  276. package/node_modules/matrix-js-sdk/lib/http-api/utils.js +35 -47
  277. package/node_modules/matrix-js-sdk/lib/http-api/utils.js.map +1 -1
  278. package/node_modules/matrix-js-sdk/lib/index.js.map +1 -1
  279. package/node_modules/matrix-js-sdk/lib/indexeddb-helpers.js +3 -3
  280. package/node_modules/matrix-js-sdk/lib/indexeddb-helpers.js.map +1 -1
  281. package/node_modules/matrix-js-sdk/lib/indexeddb-worker.js.map +1 -1
  282. package/node_modules/matrix-js-sdk/lib/interactive-auth.d.ts +5 -5
  283. package/node_modules/matrix-js-sdk/lib/interactive-auth.d.ts.map +1 -1
  284. package/node_modules/matrix-js-sdk/lib/interactive-auth.js +181 -203
  285. package/node_modules/matrix-js-sdk/lib/interactive-auth.js.map +1 -1
  286. package/node_modules/matrix-js-sdk/lib/logger.js +22 -56
  287. package/node_modules/matrix-js-sdk/lib/logger.js.map +1 -1
  288. package/node_modules/matrix-js-sdk/lib/matrix.d.ts +1 -0
  289. package/node_modules/matrix-js-sdk/lib/matrix.d.ts.map +1 -1
  290. package/node_modules/matrix-js-sdk/lib/matrix.js +8 -11
  291. package/node_modules/matrix-js-sdk/lib/matrix.js.map +1 -1
  292. package/node_modules/matrix-js-sdk/lib/matrixrtc/CallMembership.js +83 -76
  293. package/node_modules/matrix-js-sdk/lib/matrixrtc/CallMembership.js.map +1 -1
  294. package/node_modules/matrix-js-sdk/lib/matrixrtc/EncryptionManager.js +1 -1
  295. package/node_modules/matrix-js-sdk/lib/matrixrtc/EncryptionManager.js.map +1 -1
  296. package/node_modules/matrix-js-sdk/lib/matrixrtc/IKeyTransport.js +1 -1
  297. package/node_modules/matrix-js-sdk/lib/matrixrtc/IKeyTransport.js.map +1 -1
  298. package/node_modules/matrix-js-sdk/lib/matrixrtc/IMembershipManager.js +1 -1
  299. package/node_modules/matrix-js-sdk/lib/matrixrtc/IMembershipManager.js.map +1 -1
  300. package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.d.ts +1 -1
  301. package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.js +4 -4
  302. package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.js.map +1 -1
  303. package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.d.ts.map +1 -1
  304. package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.js +144 -184
  305. package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.js.map +1 -1
  306. package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSessionManager.js +35 -39
  307. package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSessionManager.js.map +1 -1
  308. package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.d.ts +2 -0
  309. package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.d.ts.map +1 -1
  310. package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.js +346 -383
  311. package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.js.map +1 -1
  312. package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManagerActionScheduler.d.ts.map +1 -1
  313. package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManagerActionScheduler.js +54 -59
  314. package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManagerActionScheduler.js.map +1 -1
  315. package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.js +117 -139
  316. package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.js.map +1 -1
  317. package/node_modules/matrix-js-sdk/lib/matrixrtc/ToDeviceKeyTransport.js +49 -54
  318. package/node_modules/matrix-js-sdk/lib/matrixrtc/ToDeviceKeyTransport.js.map +1 -1
  319. package/node_modules/matrix-js-sdk/lib/matrixrtc/index.js.map +1 -1
  320. package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/common.js +1 -1
  321. package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/common.js.map +1 -1
  322. package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/index.js.map +1 -1
  323. package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/rtc.js +15 -23
  324. package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/rtc.js.map +1 -1
  325. package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/session.js +4 -5
  326. package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/session.js.map +1 -1
  327. package/node_modules/matrix-js-sdk/lib/matrixrtc/types.js +4 -6
  328. package/node_modules/matrix-js-sdk/lib/matrixrtc/types.js.map +1 -1
  329. package/node_modules/matrix-js-sdk/lib/matrixrtc/utils.js +4 -11
  330. package/node_modules/matrix-js-sdk/lib/matrixrtc/utils.js.map +1 -1
  331. package/node_modules/matrix-js-sdk/lib/models/MSC3089Branch.js +91 -116
  332. package/node_modules/matrix-js-sdk/lib/models/MSC3089Branch.js.map +1 -1
  333. package/node_modules/matrix-js-sdk/lib/models/MSC3089TreeSpace.js +209 -244
  334. package/node_modules/matrix-js-sdk/lib/models/MSC3089TreeSpace.js.map +1 -1
  335. package/node_modules/matrix-js-sdk/lib/models/ToDeviceMessage.js +3 -1
  336. package/node_modules/matrix-js-sdk/lib/models/beacon.js +20 -15
  337. package/node_modules/matrix-js-sdk/lib/models/beacon.js.map +1 -1
  338. package/node_modules/matrix-js-sdk/lib/models/compare-event-ordering.js +13 -13
  339. package/node_modules/matrix-js-sdk/lib/models/compare-event-ordering.js.map +1 -1
  340. package/node_modules/matrix-js-sdk/lib/models/device.js +10 -3
  341. package/node_modules/matrix-js-sdk/lib/models/device.js.map +1 -1
  342. package/node_modules/matrix-js-sdk/lib/models/event-context.js +5 -7
  343. package/node_modules/matrix-js-sdk/lib/models/event-context.js.map +1 -1
  344. package/node_modules/matrix-js-sdk/lib/models/event-status.js +1 -1
  345. package/node_modules/matrix-js-sdk/lib/models/event-status.js.map +1 -1
  346. package/node_modules/matrix-js-sdk/lib/models/event-timeline-set.js +91 -91
  347. package/node_modules/matrix-js-sdk/lib/models/event-timeline-set.js.map +1 -1
  348. package/node_modules/matrix-js-sdk/lib/models/event-timeline.js +31 -29
  349. package/node_modules/matrix-js-sdk/lib/models/event-timeline.js.map +1 -1
  350. package/node_modules/matrix-js-sdk/lib/models/event.js +215 -235
  351. package/node_modules/matrix-js-sdk/lib/models/event.js.map +1 -1
  352. package/node_modules/matrix-js-sdk/lib/models/invites-ignorer-types.js +4 -4
  353. package/node_modules/matrix-js-sdk/lib/models/invites-ignorer-types.js.map +1 -1
  354. package/node_modules/matrix-js-sdk/lib/models/invites-ignorer.js +159 -179
  355. package/node_modules/matrix-js-sdk/lib/models/invites-ignorer.js.map +1 -1
  356. package/node_modules/matrix-js-sdk/lib/models/poll.js +72 -78
  357. package/node_modules/matrix-js-sdk/lib/models/poll.js.map +1 -1
  358. package/node_modules/matrix-js-sdk/lib/models/profile-keys.js +2 -2
  359. package/node_modules/matrix-js-sdk/lib/models/profile-keys.js.map +1 -1
  360. package/node_modules/matrix-js-sdk/lib/models/read-receipt.js +40 -56
  361. package/node_modules/matrix-js-sdk/lib/models/read-receipt.js.map +1 -1
  362. package/node_modules/matrix-js-sdk/lib/models/related-relations.js +2 -0
  363. package/node_modules/matrix-js-sdk/lib/models/related-relations.js.map +1 -1
  364. package/node_modules/matrix-js-sdk/lib/models/relations-container.js +20 -21
  365. package/node_modules/matrix-js-sdk/lib/models/relations-container.js.map +1 -1
  366. package/node_modules/matrix-js-sdk/lib/models/relations.js +131 -156
  367. package/node_modules/matrix-js-sdk/lib/models/relations.js.map +1 -1
  368. package/node_modules/matrix-js-sdk/lib/models/room-member.js +44 -27
  369. package/node_modules/matrix-js-sdk/lib/models/room-member.js.map +1 -1
  370. package/node_modules/matrix-js-sdk/lib/models/room-receipts.js +48 -55
  371. package/node_modules/matrix-js-sdk/lib/models/room-receipts.js.map +1 -1
  372. package/node_modules/matrix-js-sdk/lib/models/room-retention.d.ts +28 -0
  373. package/node_modules/matrix-js-sdk/lib/models/room-retention.d.ts.map +1 -0
  374. package/node_modules/matrix-js-sdk/lib/models/room-retention.js +192 -0
  375. package/node_modules/matrix-js-sdk/lib/models/room-retention.js.map +1 -0
  376. package/node_modules/matrix-js-sdk/lib/models/room-state.js +141 -170
  377. package/node_modules/matrix-js-sdk/lib/models/room-state.js.map +1 -1
  378. package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.d.ts +1 -0
  379. package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.d.ts.map +1 -1
  380. package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.js +46 -65
  381. package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.js.map +1 -1
  382. package/node_modules/matrix-js-sdk/lib/models/room-summary.js.map +1 -1
  383. package/node_modules/matrix-js-sdk/lib/models/room.d.ts +2 -1
  384. package/node_modules/matrix-js-sdk/lib/models/room.d.ts.map +1 -1
  385. package/node_modules/matrix-js-sdk/lib/models/room.js +800 -887
  386. package/node_modules/matrix-js-sdk/lib/models/room.js.map +1 -1
  387. package/node_modules/matrix-js-sdk/lib/models/search-result.js +5 -5
  388. package/node_modules/matrix-js-sdk/lib/models/search-result.js.map +1 -1
  389. package/node_modules/matrix-js-sdk/lib/models/thread.js +267 -283
  390. package/node_modules/matrix-js-sdk/lib/models/thread.js.map +1 -1
  391. package/node_modules/matrix-js-sdk/lib/models/typed-event-emitter.js +7 -18
  392. package/node_modules/matrix-js-sdk/lib/models/typed-event-emitter.js.map +1 -1
  393. package/node_modules/matrix-js-sdk/lib/models/user.js +26 -7
  394. package/node_modules/matrix-js-sdk/lib/models/user.js.map +1 -1
  395. package/node_modules/matrix-js-sdk/lib/oidc/authorize.js +208 -241
  396. package/node_modules/matrix-js-sdk/lib/oidc/authorize.js.map +1 -1
  397. package/node_modules/matrix-js-sdk/lib/oidc/discovery.js +23 -36
  398. package/node_modules/matrix-js-sdk/lib/oidc/discovery.js.map +1 -1
  399. package/node_modules/matrix-js-sdk/lib/oidc/error.js +1 -1
  400. package/node_modules/matrix-js-sdk/lib/oidc/error.js.map +1 -1
  401. package/node_modules/matrix-js-sdk/lib/oidc/index.js +1 -0
  402. package/node_modules/matrix-js-sdk/lib/oidc/index.js.map +1 -1
  403. package/node_modules/matrix-js-sdk/lib/oidc/register.js +60 -66
  404. package/node_modules/matrix-js-sdk/lib/oidc/register.js.map +1 -1
  405. package/node_modules/matrix-js-sdk/lib/oidc/tokenRefresher.js +83 -94
  406. package/node_modules/matrix-js-sdk/lib/oidc/tokenRefresher.js.map +1 -1
  407. package/node_modules/matrix-js-sdk/lib/oidc/validate.js +18 -18
  408. package/node_modules/matrix-js-sdk/lib/oidc/validate.js.map +1 -1
  409. package/node_modules/matrix-js-sdk/lib/pushprocessor.js +70 -81
  410. package/node_modules/matrix-js-sdk/lib/pushprocessor.js.map +1 -1
  411. package/node_modules/matrix-js-sdk/lib/randomstring.js +9 -9
  412. package/node_modules/matrix-js-sdk/lib/randomstring.js.map +1 -1
  413. package/node_modules/matrix-js-sdk/lib/realtime-callbacks.js +25 -28
  414. package/node_modules/matrix-js-sdk/lib/realtime-callbacks.js.map +1 -1
  415. package/node_modules/matrix-js-sdk/lib/receipt-accumulator.d.ts +2 -0
  416. package/node_modules/matrix-js-sdk/lib/receipt-accumulator.d.ts.map +1 -1
  417. package/node_modules/matrix-js-sdk/lib/receipt-accumulator.js +14 -22
  418. package/node_modules/matrix-js-sdk/lib/receipt-accumulator.js.map +1 -1
  419. package/node_modules/matrix-js-sdk/lib/rendezvous/MSC4108SignInWithQR.js +272 -298
  420. package/node_modules/matrix-js-sdk/lib/rendezvous/MSC4108SignInWithQR.js.map +1 -1
  421. package/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousChannel.js +3 -1
  422. package/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousCode.js +3 -1
  423. package/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousError.js.map +1 -1
  424. package/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousFailureReason.js +2 -2
  425. package/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousFailureReason.js.map +1 -1
  426. package/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousIntent.js +1 -1
  427. package/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousIntent.js.map +1 -1
  428. package/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousTransport.js +3 -1
  429. package/node_modules/matrix-js-sdk/lib/rendezvous/channels/MSC4108SecureChannel.js +122 -144
  430. package/node_modules/matrix-js-sdk/lib/rendezvous/channels/MSC4108SecureChannel.js.map +1 -1
  431. package/node_modules/matrix-js-sdk/lib/rendezvous/index.js +44 -69
  432. package/node_modules/matrix-js-sdk/lib/rendezvous/index.js.map +1 -1
  433. package/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts +1 -1
  434. package/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC4108RendezvousSession.js +142 -152
  435. package/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC4108RendezvousSession.js.map +1 -1
  436. package/node_modules/matrix-js-sdk/lib/retentionPolicy.d.ts +33 -0
  437. package/node_modules/matrix-js-sdk/lib/retentionPolicy.d.ts.map +1 -0
  438. package/node_modules/matrix-js-sdk/lib/retentionPolicy.js +39 -0
  439. package/node_modules/matrix-js-sdk/lib/retentionPolicy.js.map +1 -0
  440. package/node_modules/matrix-js-sdk/lib/room-hierarchy.js +52 -56
  441. package/node_modules/matrix-js-sdk/lib/room-hierarchy.js.map +1 -1
  442. package/node_modules/matrix-js-sdk/lib/rust-crypto/CrossSigningIdentity.js +94 -104
  443. package/node_modules/matrix-js-sdk/lib/rust-crypto/CrossSigningIdentity.js.map +1 -1
  444. package/node_modules/matrix-js-sdk/lib/rust-crypto/DehydratedDeviceManager.js +158 -190
  445. package/node_modules/matrix-js-sdk/lib/rust-crypto/DehydratedDeviceManager.js.map +1 -1
  446. package/node_modules/matrix-js-sdk/lib/rust-crypto/KeyClaimManager.js +17 -20
  447. package/node_modules/matrix-js-sdk/lib/rust-crypto/KeyClaimManager.js.map +1 -1
  448. package/node_modules/matrix-js-sdk/lib/rust-crypto/OutgoingRequestProcessor.js +109 -139
  449. package/node_modules/matrix-js-sdk/lib/rust-crypto/OutgoingRequestProcessor.js.map +1 -1
  450. package/node_modules/matrix-js-sdk/lib/rust-crypto/OutgoingRequestsManager.js +72 -86
  451. package/node_modules/matrix-js-sdk/lib/rust-crypto/OutgoingRequestsManager.js.map +1 -1
  452. package/node_modules/matrix-js-sdk/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts +1 -1
  453. package/node_modules/matrix-js-sdk/lib/rust-crypto/PerSessionKeyBackupDownloader.js +195 -221
  454. package/node_modules/matrix-js-sdk/lib/rust-crypto/PerSessionKeyBackupDownloader.js.map +1 -1
  455. package/node_modules/matrix-js-sdk/lib/rust-crypto/RoomEncryptor.js +121 -137
  456. package/node_modules/matrix-js-sdk/lib/rust-crypto/RoomEncryptor.js.map +1 -1
  457. package/node_modules/matrix-js-sdk/lib/rust-crypto/backup.d.ts +7 -2
  458. package/node_modules/matrix-js-sdk/lib/rust-crypto/backup.d.ts.map +1 -1
  459. package/node_modules/matrix-js-sdk/lib/rust-crypto/backup.js +459 -544
  460. package/node_modules/matrix-js-sdk/lib/rust-crypto/backup.js.map +1 -1
  461. package/node_modules/matrix-js-sdk/lib/rust-crypto/constants.js +1 -1
  462. package/node_modules/matrix-js-sdk/lib/rust-crypto/constants.js.map +1 -1
  463. package/node_modules/matrix-js-sdk/lib/rust-crypto/device-converter.js +15 -28
  464. package/node_modules/matrix-js-sdk/lib/rust-crypto/device-converter.js.map +1 -1
  465. package/node_modules/matrix-js-sdk/lib/rust-crypto/index.js +103 -116
  466. package/node_modules/matrix-js-sdk/lib/rust-crypto/index.js.map +1 -1
  467. package/node_modules/matrix-js-sdk/lib/rust-crypto/libolm_migration.js +303 -365
  468. package/node_modules/matrix-js-sdk/lib/rust-crypto/libolm_migration.js.map +1 -1
  469. package/node_modules/matrix-js-sdk/lib/rust-crypto/rust-crypto.d.ts +5 -1
  470. package/node_modules/matrix-js-sdk/lib/rust-crypto/rust-crypto.d.ts.map +1 -1
  471. package/node_modules/matrix-js-sdk/lib/rust-crypto/rust-crypto.js +1065 -1322
  472. package/node_modules/matrix-js-sdk/lib/rust-crypto/rust-crypto.js.map +1 -1
  473. package/node_modules/matrix-js-sdk/lib/rust-crypto/secret-storage.js +12 -25
  474. package/node_modules/matrix-js-sdk/lib/rust-crypto/secret-storage.js.map +1 -1
  475. package/node_modules/matrix-js-sdk/lib/rust-crypto/verification.js +134 -184
  476. package/node_modules/matrix-js-sdk/lib/rust-crypto/verification.js.map +1 -1
  477. package/node_modules/matrix-js-sdk/lib/scheduler.js +42 -17
  478. package/node_modules/matrix-js-sdk/lib/scheduler.js.map +1 -1
  479. package/node_modules/matrix-js-sdk/lib/secret-storage.js +179 -213
  480. package/node_modules/matrix-js-sdk/lib/secret-storage.js.map +1 -1
  481. package/node_modules/matrix-js-sdk/lib/serverCapabilities.d.ts +4 -23
  482. package/node_modules/matrix-js-sdk/lib/serverCapabilities.d.ts.map +1 -1
  483. package/node_modules/matrix-js-sdk/lib/serverCapabilities.js +9 -62
  484. package/node_modules/matrix-js-sdk/lib/serverCapabilities.js.map +1 -1
  485. package/node_modules/matrix-js-sdk/lib/service-types.js +1 -1
  486. package/node_modules/matrix-js-sdk/lib/service-types.js.map +1 -1
  487. package/node_modules/matrix-js-sdk/lib/sliding-sync-sdk.d.ts.map +1 -1
  488. package/node_modules/matrix-js-sdk/lib/sliding-sync-sdk.js +368 -421
  489. package/node_modules/matrix-js-sdk/lib/sliding-sync-sdk.js.map +1 -1
  490. package/node_modules/matrix-js-sdk/lib/sliding-sync.js +136 -167
  491. package/node_modules/matrix-js-sdk/lib/sliding-sync.js.map +1 -1
  492. package/node_modules/matrix-js-sdk/lib/store/index.d.ts +7 -0
  493. package/node_modules/matrix-js-sdk/lib/store/index.d.ts.map +1 -1
  494. package/node_modules/matrix-js-sdk/lib/store/index.js +3 -1
  495. package/node_modules/matrix-js-sdk/lib/store/index.js.map +1 -1
  496. package/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.js +3 -1
  497. package/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.d.ts +1 -0
  498. package/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.d.ts.map +1 -1
  499. package/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.js +197 -240
  500. package/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.js.map +1 -1
  501. package/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.d.ts +3 -1
  502. package/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.d.ts.map +1 -1
  503. package/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.js +51 -59
  504. package/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.js.map +1 -1
  505. package/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.js +22 -22
  506. package/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.js.map +1 -1
  507. package/node_modules/matrix-js-sdk/lib/store/indexeddb.d.ts +7 -5
  508. package/node_modules/matrix-js-sdk/lib/store/indexeddb.d.ts.map +1 -1
  509. package/node_modules/matrix-js-sdk/lib/store/indexeddb.js +63 -79
  510. package/node_modules/matrix-js-sdk/lib/store/indexeddb.js.map +1 -1
  511. package/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.js +2 -2
  512. package/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.js.map +1 -1
  513. package/node_modules/matrix-js-sdk/lib/store/memory.d.ts +1 -0
  514. package/node_modules/matrix-js-sdk/lib/store/memory.d.ts.map +1 -1
  515. package/node_modules/matrix-js-sdk/lib/store/memory.js +38 -54
  516. package/node_modules/matrix-js-sdk/lib/store/memory.js.map +1 -1
  517. package/node_modules/matrix-js-sdk/lib/store/stub.d.ts +1 -0
  518. package/node_modules/matrix-js-sdk/lib/store/stub.d.ts.map +1 -1
  519. package/node_modules/matrix-js-sdk/lib/store/stub.js +22 -32
  520. package/node_modules/matrix-js-sdk/lib/store/stub.js.map +1 -1
  521. package/node_modules/matrix-js-sdk/lib/sync-accumulator.d.ts +1 -0
  522. package/node_modules/matrix-js-sdk/lib/sync-accumulator.d.ts.map +1 -1
  523. package/node_modules/matrix-js-sdk/lib/sync-accumulator.js +57 -65
  524. package/node_modules/matrix-js-sdk/lib/sync-accumulator.js.map +1 -1
  525. package/node_modules/matrix-js-sdk/lib/sync.d.ts.map +1 -1
  526. package/node_modules/matrix-js-sdk/lib/sync.js +914 -991
  527. package/node_modules/matrix-js-sdk/lib/sync.js.map +1 -1
  528. package/node_modules/matrix-js-sdk/lib/testing.js +63 -105
  529. package/node_modules/matrix-js-sdk/lib/testing.js.map +1 -1
  530. package/node_modules/matrix-js-sdk/lib/thread-utils.js +1 -4
  531. package/node_modules/matrix-js-sdk/lib/thread-utils.js.map +1 -1
  532. package/node_modules/matrix-js-sdk/lib/timeline-window.js +90 -99
  533. package/node_modules/matrix-js-sdk/lib/timeline-window.js.map +1 -1
  534. package/node_modules/matrix-js-sdk/lib/types.js +1 -1
  535. package/node_modules/matrix-js-sdk/lib/types.js.map +1 -1
  536. package/node_modules/matrix-js-sdk/lib/utils/decryptAESSecretStorageItem.js +14 -25
  537. package/node_modules/matrix-js-sdk/lib/utils/decryptAESSecretStorageItem.js.map +1 -1
  538. package/node_modules/matrix-js-sdk/lib/utils/encryptAESSecretStorageItem.js +27 -38
  539. package/node_modules/matrix-js-sdk/lib/utils/encryptAESSecretStorageItem.js.map +1 -1
  540. package/node_modules/matrix-js-sdk/lib/utils/internal/deriveKeys.js +25 -32
  541. package/node_modules/matrix-js-sdk/lib/utils/internal/deriveKeys.js.map +1 -1
  542. package/node_modules/matrix-js-sdk/lib/utils/roomVersion.js +1 -1
  543. package/node_modules/matrix-js-sdk/lib/utils/roomVersion.js.map +1 -1
  544. package/node_modules/matrix-js-sdk/lib/utils.js +83 -135
  545. package/node_modules/matrix-js-sdk/lib/utils.js.map +1 -1
  546. package/node_modules/matrix-js-sdk/lib/version-support.js +3 -3
  547. package/node_modules/matrix-js-sdk/lib/version-support.js.map +1 -1
  548. package/node_modules/matrix-js-sdk/lib/webrtc/audioContext.js +5 -6
  549. package/node_modules/matrix-js-sdk/lib/webrtc/audioContext.js.map +1 -1
  550. package/node_modules/matrix-js-sdk/lib/webrtc/call.js +1123 -1256
  551. package/node_modules/matrix-js-sdk/lib/webrtc/call.js.map +1 -1
  552. package/node_modules/matrix-js-sdk/lib/webrtc/callEventHandler.js +207 -214
  553. package/node_modules/matrix-js-sdk/lib/webrtc/callEventHandler.js.map +1 -1
  554. package/node_modules/matrix-js-sdk/lib/webrtc/callEventTypes.js +2 -2
  555. package/node_modules/matrix-js-sdk/lib/webrtc/callEventTypes.js.map +1 -1
  556. package/node_modules/matrix-js-sdk/lib/webrtc/callFeed.js +33 -20
  557. package/node_modules/matrix-js-sdk/lib/webrtc/callFeed.js.map +1 -1
  558. package/node_modules/matrix-js-sdk/lib/webrtc/groupCall.js +521 -594
  559. package/node_modules/matrix-js-sdk/lib/webrtc/groupCall.js.map +1 -1
  560. package/node_modules/matrix-js-sdk/lib/webrtc/groupCallEventHandler.js +58 -61
  561. package/node_modules/matrix-js-sdk/lib/webrtc/groupCallEventHandler.js.map +1 -1
  562. package/node_modules/matrix-js-sdk/lib/webrtc/mediaHandler.js +203 -233
  563. package/node_modules/matrix-js-sdk/lib/webrtc/mediaHandler.js.map +1 -1
  564. package/node_modules/matrix-js-sdk/lib/webrtc/stats/callFeedStatsReporter.js +16 -20
  565. package/node_modules/matrix-js-sdk/lib/webrtc/stats/callFeedStatsReporter.js.map +1 -1
  566. package/node_modules/matrix-js-sdk/lib/webrtc/stats/callStatsReportGatherer.js +65 -70
  567. package/node_modules/matrix-js-sdk/lib/webrtc/stats/callStatsReportGatherer.js.map +1 -1
  568. package/node_modules/matrix-js-sdk/lib/webrtc/stats/callStatsReportSummary.js +3 -1
  569. package/node_modules/matrix-js-sdk/lib/webrtc/stats/connectionStats.js.map +1 -1
  570. package/node_modules/matrix-js-sdk/lib/webrtc/stats/connectionStatsBuilder.js +2 -2
  571. package/node_modules/matrix-js-sdk/lib/webrtc/stats/connectionStatsBuilder.js.map +1 -1
  572. package/node_modules/matrix-js-sdk/lib/webrtc/stats/connectionStatsReportBuilder.js +20 -24
  573. package/node_modules/matrix-js-sdk/lib/webrtc/stats/connectionStatsReportBuilder.js.map +1 -1
  574. package/node_modules/matrix-js-sdk/lib/webrtc/stats/groupCallStats.js +4 -5
  575. package/node_modules/matrix-js-sdk/lib/webrtc/stats/groupCallStats.js.map +1 -1
  576. package/node_modules/matrix-js-sdk/lib/webrtc/stats/media/mediaSsrcHandler.js +7 -8
  577. package/node_modules/matrix-js-sdk/lib/webrtc/stats/media/mediaSsrcHandler.js.map +1 -1
  578. package/node_modules/matrix-js-sdk/lib/webrtc/stats/media/mediaTrackHandler.js +7 -9
  579. package/node_modules/matrix-js-sdk/lib/webrtc/stats/media/mediaTrackHandler.js.map +1 -1
  580. package/node_modules/matrix-js-sdk/lib/webrtc/stats/media/mediaTrackStats.js.map +1 -1
  581. package/node_modules/matrix-js-sdk/lib/webrtc/stats/media/mediaTrackStatsHandler.js +6 -6
  582. package/node_modules/matrix-js-sdk/lib/webrtc/stats/media/mediaTrackStatsHandler.js.map +1 -1
  583. package/node_modules/matrix-js-sdk/lib/webrtc/stats/statsReport.js +1 -1
  584. package/node_modules/matrix-js-sdk/lib/webrtc/stats/statsReport.js.map +1 -1
  585. package/node_modules/matrix-js-sdk/lib/webrtc/stats/statsReportEmitter.js.map +1 -1
  586. package/node_modules/matrix-js-sdk/lib/webrtc/stats/summaryStatsReportGatherer.js +14 -14
  587. package/node_modules/matrix-js-sdk/lib/webrtc/stats/summaryStatsReportGatherer.js.map +1 -1
  588. package/node_modules/matrix-js-sdk/lib/webrtc/stats/trackStatsBuilder.js +32 -34
  589. package/node_modules/matrix-js-sdk/lib/webrtc/stats/trackStatsBuilder.js.map +1 -1
  590. package/node_modules/matrix-js-sdk/lib/webrtc/stats/transportStats.js +3 -1
  591. package/node_modules/matrix-js-sdk/lib/webrtc/stats/transportStatsBuilder.js +9 -9
  592. package/node_modules/matrix-js-sdk/lib/webrtc/stats/transportStatsBuilder.js.map +1 -1
  593. package/node_modules/matrix-js-sdk/lib/webrtc/stats/valueFormatter.js +1 -1
  594. package/node_modules/matrix-js-sdk/lib/webrtc/stats/valueFormatter.js.map +1 -1
  595. package/node_modules/matrix-js-sdk/package.json +110 -138
  596. package/node_modules/matrix-js-sdk/src/@types/event.ts +9 -0
  597. package/node_modules/matrix-js-sdk/src/@types/global.d.ts +2 -2
  598. package/node_modules/matrix-js-sdk/src/@types/retention.ts +16 -0
  599. package/node_modules/matrix-js-sdk/src/ToDeviceMessageQueue.ts +2 -2
  600. package/node_modules/matrix-js-sdk/src/browser-index.ts +4 -4
  601. package/node_modules/matrix-js-sdk/src/capabilityPoller.ts +102 -0
  602. package/node_modules/matrix-js-sdk/src/client.ts +37 -25
  603. package/node_modules/matrix-js-sdk/src/crypto-api/index.ts +17 -6
  604. package/node_modules/matrix-js-sdk/src/embedded.ts +4 -6
  605. package/node_modules/matrix-js-sdk/src/filter-component.ts +1 -0
  606. package/node_modules/matrix-js-sdk/src/http-api/utils.ts +5 -10
  607. package/node_modules/matrix-js-sdk/src/interactive-auth.ts +11 -5
  608. package/node_modules/matrix-js-sdk/src/matrix.ts +1 -0
  609. package/node_modules/matrix-js-sdk/src/matrixrtc/LivekitTransport.ts +1 -1
  610. package/node_modules/matrix-js-sdk/src/matrixrtc/MatrixRTCSession.ts +5 -4
  611. package/node_modules/matrix-js-sdk/src/matrixrtc/MembershipManager.ts +2 -0
  612. package/node_modules/matrix-js-sdk/src/matrixrtc/MembershipManagerActionScheduler.ts +4 -1
  613. package/node_modules/matrix-js-sdk/src/models/MSC3089Branch.ts +1 -1
  614. package/node_modules/matrix-js-sdk/src/models/room-retention.ts +230 -0
  615. package/node_modules/matrix-js-sdk/src/models/room-sticky-events.ts +1 -0
  616. package/node_modules/matrix-js-sdk/src/models/room.ts +26 -12
  617. package/node_modules/matrix-js-sdk/src/receipt-accumulator.ts +2 -0
  618. package/node_modules/matrix-js-sdk/src/rendezvous/index.ts +1 -1
  619. package/node_modules/matrix-js-sdk/src/rendezvous/transports/MSC4108RendezvousSession.ts +2 -2
  620. package/node_modules/matrix-js-sdk/src/retentionPolicy.ts +65 -0
  621. package/node_modules/matrix-js-sdk/src/rust-crypto/PerSessionKeyBackupDownloader.ts +1 -1
  622. package/node_modules/matrix-js-sdk/src/rust-crypto/backup.ts +15 -4
  623. package/node_modules/matrix-js-sdk/src/rust-crypto/index.ts +6 -6
  624. package/node_modules/matrix-js-sdk/src/rust-crypto/rust-crypto.ts +31 -7
  625. package/node_modules/matrix-js-sdk/src/rust-crypto/verification.ts +1 -1
  626. package/node_modules/matrix-js-sdk/src/serverCapabilities.ts +8 -67
  627. package/node_modules/matrix-js-sdk/src/sliding-sync-sdk.ts +5 -7
  628. package/node_modules/matrix-js-sdk/src/store/index.ts +8 -0
  629. package/node_modules/matrix-js-sdk/src/store/indexeddb-local-backend.ts +12 -2
  630. package/node_modules/matrix-js-sdk/src/store/indexeddb-remote-backend.ts +24 -5
  631. package/node_modules/matrix-js-sdk/src/store/indexeddb.ts +20 -8
  632. package/node_modules/matrix-js-sdk/src/store/memory.ts +4 -0
  633. package/node_modules/matrix-js-sdk/src/store/stub.ts +3 -0
  634. package/node_modules/matrix-js-sdk/src/sync-accumulator.ts +9 -0
  635. package/node_modules/matrix-js-sdk/src/sync.ts +11 -9
  636. package/node_modules/media-typer/README.md +19 -33
  637. package/node_modules/media-typer/dist/index.d.ts +29 -0
  638. package/node_modules/media-typer/dist/index.js +64 -0
  639. package/node_modules/media-typer/dist/index.js.map +1 -0
  640. package/node_modules/media-typer/package.json +37 -22
  641. package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.js +2 -2
  642. package/node_modules/music-metadata/lib/mp4/AtomToken.js +65 -13
  643. package/node_modules/music-metadata/lib/wav/WaveChunk.d.ts +10 -0
  644. package/node_modules/music-metadata/lib/wav/WaveChunk.js +13 -3
  645. package/node_modules/music-metadata/lib/wav/WaveParser.d.ts +1 -0
  646. package/node_modules/music-metadata/lib/wav/WaveParser.js +6 -5
  647. package/node_modules/music-metadata/package.json +5 -5
  648. package/node_modules/typebox/build/compile/validator.d.mts +2 -7
  649. package/node_modules/typebox/build/compile/validator.mjs +6 -36
  650. package/node_modules/typebox/build/error/errors.d.mts +1 -7
  651. package/node_modules/typebox/build/format/_idna.mjs +36 -6
  652. package/node_modules/typebox/build/format/_puny.mjs +4 -1
  653. package/node_modules/typebox/build/format/uuid.d.mts +2 -2
  654. package/node_modules/typebox/build/format/uuid.mjs +3 -3
  655. package/node_modules/typebox/build/guard/emit.d.mts +0 -4
  656. package/node_modules/typebox/build/guard/emit.mjs +0 -8
  657. package/node_modules/typebox/build/guard/guard.d.mts +4 -8
  658. package/node_modules/typebox/build/guard/guard.mjs +5 -13
  659. package/node_modules/typebox/build/schema/engine/boolean.d.mts +3 -3
  660. package/node_modules/typebox/build/schema/engine/boolean.mjs +4 -4
  661. package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
  662. package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
  663. package/node_modules/typebox/build/schema/engine/schema.mjs +5 -10
  664. package/node_modules/typebox/build/schema/engine/type.mjs +14 -18
  665. package/node_modules/typebox/build/schema/types/dependencies.mjs +1 -1
  666. package/node_modules/typebox/build/schema/types/index.d.mts +0 -1
  667. package/node_modules/typebox/build/schema/types/index.mjs +0 -1
  668. package/node_modules/typebox/build/schema/types/schema.d.mts +1 -1
  669. package/node_modules/typebox/build/schema/types/schema.mjs +2 -2
  670. package/node_modules/typebox/build/system/locale/ar_001.mjs +0 -1
  671. package/node_modules/typebox/build/system/locale/bn_BD.mjs +0 -1
  672. package/node_modules/typebox/build/system/locale/cs_CZ.mjs +0 -1
  673. package/node_modules/typebox/build/system/locale/de_DE.mjs +0 -1
  674. package/node_modules/typebox/build/system/locale/el_GR.mjs +0 -1
  675. package/node_modules/typebox/build/system/locale/en_US.mjs +0 -1
  676. package/node_modules/typebox/build/system/locale/es_419.mjs +0 -1
  677. package/node_modules/typebox/build/system/locale/es_AR.mjs +0 -1
  678. package/node_modules/typebox/build/system/locale/es_ES.mjs +0 -1
  679. package/node_modules/typebox/build/system/locale/es_MX.mjs +0 -1
  680. package/node_modules/typebox/build/system/locale/fa_IR.mjs +0 -1
  681. package/node_modules/typebox/build/system/locale/fil_PH.mjs +0 -1
  682. package/node_modules/typebox/build/system/locale/fr_CA.mjs +0 -1
  683. package/node_modules/typebox/build/system/locale/fr_FR.mjs +0 -1
  684. package/node_modules/typebox/build/system/locale/ha_NG.mjs +0 -1
  685. package/node_modules/typebox/build/system/locale/hi_IN.mjs +0 -1
  686. package/node_modules/typebox/build/system/locale/hu_HU.mjs +0 -1
  687. package/node_modules/typebox/build/system/locale/id_ID.mjs +0 -1
  688. package/node_modules/typebox/build/system/locale/it_IT.mjs +0 -1
  689. package/node_modules/typebox/build/system/locale/ja_JP.mjs +0 -1
  690. package/node_modules/typebox/build/system/locale/ko_KR.mjs +0 -1
  691. package/node_modules/typebox/build/system/locale/ms_MY.mjs +0 -1
  692. package/node_modules/typebox/build/system/locale/nl_NL.mjs +0 -1
  693. package/node_modules/typebox/build/system/locale/pl_PL.mjs +0 -1
  694. package/node_modules/typebox/build/system/locale/pt_BR.mjs +0 -1
  695. package/node_modules/typebox/build/system/locale/pt_PT.mjs +0 -1
  696. package/node_modules/typebox/build/system/locale/ro_RO.mjs +0 -1
  697. package/node_modules/typebox/build/system/locale/ru_RU.mjs +0 -1
  698. package/node_modules/typebox/build/system/locale/sv_SE.mjs +0 -1
  699. package/node_modules/typebox/build/system/locale/sw_TZ.mjs +0 -1
  700. package/node_modules/typebox/build/system/locale/th_TH.mjs +0 -1
  701. package/node_modules/typebox/build/system/locale/tr_TR.mjs +0 -1
  702. package/node_modules/typebox/build/system/locale/uk_UA.mjs +0 -1
  703. package/node_modules/typebox/build/system/locale/ur_PK.mjs +0 -1
  704. package/node_modules/typebox/build/system/locale/vi_VN.mjs +0 -1
  705. package/node_modules/typebox/build/system/locale/yo_NG.mjs +0 -1
  706. package/node_modules/typebox/build/system/locale/zh_Hans.mjs +0 -1
  707. package/node_modules/typebox/build/system/locale/zh_Hant.mjs +0 -1
  708. package/node_modules/typebox/build/system/memory/clone.d.mts +2 -3
  709. package/node_modules/typebox/build/system/memory/clone.mjs +73 -26
  710. package/node_modules/typebox/build/system/settings/settings.d.mts +15 -0
  711. package/node_modules/typebox/build/system/settings/settings.mjs +3 -1
  712. package/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
  713. package/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
  714. package/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
  715. package/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
  716. package/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
  717. package/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
  718. package/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
  719. package/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
  720. package/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
  721. package/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
  722. package/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
  723. package/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
  724. package/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
  725. package/node_modules/typebox/build/type/action/conditional.mjs +2 -1
  726. package/node_modules/typebox/build/type/action/index.d.mts +7 -4
  727. package/node_modules/typebox/build/type/action/index.mjs +7 -4
  728. package/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
  729. package/node_modules/typebox/build/type/action/mapped.mjs +2 -1
  730. package/node_modules/typebox/build/type/action/module.d.mts +8 -7
  731. package/node_modules/typebox/build/type/action/module.mjs +7 -6
  732. package/node_modules/typebox/build/type/action/readonly_object.d.mts +0 -5
  733. package/node_modules/typebox/build/type/action/readonly_object.mjs +0 -5
  734. package/node_modules/typebox/build/type/action/with.d.mts +11 -0
  735. package/node_modules/typebox/build/type/action/with.mjs +11 -0
  736. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +1 -1
  737. package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
  738. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
  739. package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +2 -2
  740. package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
  741. package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
  742. package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +2 -3
  743. package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +3 -6
  744. package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +6 -9
  745. package/node_modules/typebox/build/type/engine/cyclic/check.mjs +10 -16
  746. package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +1 -4
  747. package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +9 -15
  748. package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +1 -4
  749. package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +8 -14
  750. package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
  751. package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
  752. package/node_modules/typebox/build/type/engine/enum/index.d.mts +0 -1
  753. package/node_modules/typebox/build/type/engine/enum/index.mjs +0 -1
  754. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +1 -2
  755. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +2 -6
  756. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +10 -6
  757. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +10 -6
  758. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +2 -1
  759. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +3 -3
  760. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +17 -5
  761. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +34 -8
  762. package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +5 -6
  763. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +11 -12
  764. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +5 -6
  765. package/node_modules/typebox/build/type/engine/extract/operation.mjs +11 -12
  766. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
  767. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
  768. package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
  769. package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
  770. package/node_modules/typebox/build/type/engine/index.d.mts +2 -2
  771. package/node_modules/typebox/build/type/engine/index.mjs +2 -2
  772. package/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
  773. package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +8 -0
  774. package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +3 -3
  775. package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +4 -4
  776. package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +2 -2
  777. package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +3 -3
  778. package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +3 -1
  779. package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +9 -6
  780. package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +2 -1
  781. package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +5 -2
  782. package/node_modules/typebox/build/type/engine/instantiate.d.mts +44 -31
  783. package/node_modules/typebox/build/type/engine/instantiate.mjs +82 -83
  784. package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
  785. package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +2 -2
  786. package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +3 -3
  787. package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +2 -1
  788. package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +5 -1
  789. package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +4 -4
  790. package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +3 -3
  791. package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +5 -4
  792. package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +10 -5
  793. package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +7 -9
  794. package/node_modules/typebox/build/type/engine/module/instantiate.mjs +17 -15
  795. package/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
  796. package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +8 -0
  797. package/node_modules/typebox/build/type/engine/object/from_type.d.mts +3 -1
  798. package/node_modules/typebox/build/type/engine/object/from_type.mjs +8 -5
  799. package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
  800. package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
  801. package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
  802. package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
  803. package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
  804. package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
  805. package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
  806. package/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
  807. package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +8 -0
  808. package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +1 -1
  809. package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +3 -2
  810. package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +2 -2
  811. package/node_modules/typebox/build/type/engine/partial/from_object.mjs +2 -2
  812. package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +3 -1
  813. package/node_modules/typebox/build/type/engine/partial/from_type.mjs +7 -4
  814. package/node_modules/typebox/build/type/engine/priority/index.d.mts +1 -0
  815. package/node_modules/typebox/build/type/engine/priority/index.mjs +1 -0
  816. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +20 -0
  817. package/node_modules/typebox/build/type/engine/priority/priority.mjs +28 -0
  818. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
  819. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
  820. package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
  821. package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
  822. package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +2 -2
  823. package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +2 -2
  824. package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
  825. package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +8 -0
  826. package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +1 -1
  827. package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +3 -2
  828. package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +2 -2
  829. package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +2 -2
  830. package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
  831. package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +2 -2
  832. package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +3 -1
  833. package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +8 -5
  834. package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +2 -2
  835. package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +2 -2
  836. package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +2 -2
  837. package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +2 -2
  838. package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
  839. package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
  840. package/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
  841. package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +8 -0
  842. package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +1 -1
  843. package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +3 -2
  844. package/node_modules/typebox/build/type/engine/required/from_object.d.mts +2 -2
  845. package/node_modules/typebox/build/type/engine/required/from_object.mjs +2 -2
  846. package/node_modules/typebox/build/type/engine/required/from_type.d.mts +3 -1
  847. package/node_modules/typebox/build/type/engine/required/from_type.mjs +7 -4
  848. package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +3 -3
  849. package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +2 -2
  850. package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +6 -6
  851. package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +1 -1
  852. package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +1 -0
  853. package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +1 -4
  854. package/node_modules/typebox/build/type/engine/this/expand_this.mjs +7 -13
  855. package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
  856. package/node_modules/typebox/build/type/engine/{options → with}/instantiate.mjs +5 -5
  857. package/node_modules/typebox/build/type/extends/dependent.d.mts +6 -0
  858. package/node_modules/typebox/build/type/extends/dependent.mjs +6 -0
  859. package/node_modules/typebox/build/type/extends/enum.d.mts +4 -4
  860. package/node_modules/typebox/build/type/extends/enum.mjs +3 -2
  861. package/node_modules/typebox/build/type/extends/extends_left.d.mts +5 -7
  862. package/node_modules/typebox/build/type/extends/extends_left.mjs +24 -27
  863. package/node_modules/typebox/build/type/extends/extends_right.d.mts +7 -5
  864. package/node_modules/typebox/build/type/extends/extends_right.mjs +20 -15
  865. package/node_modules/typebox/build/type/extends/inference.mjs +1 -1
  866. package/node_modules/typebox/build/type/extends/object.d.mts +8 -1
  867. package/node_modules/typebox/build/type/extends/object.mjs +25 -3
  868. package/node_modules/typebox/build/type/extends/parameters.mjs +2 -2
  869. package/node_modules/typebox/build/type/extends/record.d.mts +13 -0
  870. package/node_modules/typebox/build/type/extends/record.mjs +23 -0
  871. package/node_modules/typebox/build/type/extends/template_literal.d.mts +3 -3
  872. package/node_modules/typebox/build/type/extends/template_literal.mjs +3 -3
  873. package/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
  874. package/node_modules/typebox/build/type/extends/tuple.mjs +6 -5
  875. package/node_modules/typebox/build/type/extends/union.mjs +2 -2
  876. package/node_modules/typebox/build/type/script/mapping.d.mts +84 -99
  877. package/node_modules/typebox/build/type/script/mapping.mjs +81 -85
  878. package/node_modules/typebox/build/type/script/parser.d.mts +40 -40
  879. package/node_modules/typebox/build/type/script/parser.mjs +22 -22
  880. package/node_modules/typebox/build/type/script/script.d.mts +3 -4
  881. package/node_modules/typebox/build/type/script/script.mjs +3 -2
  882. package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -1
  883. package/node_modules/typebox/build/type/script/token/internal/guard.mjs +1 -1
  884. package/node_modules/typebox/build/type/script/token/internal/take.mjs +1 -1
  885. package/node_modules/typebox/build/type/script/token/until.mjs +2 -2
  886. package/node_modules/typebox/build/type/types/_codec.d.mts +12 -12
  887. package/node_modules/typebox/build/type/types/_codec.mjs +0 -1
  888. package/node_modules/typebox/build/type/types/_immutable.d.mts +2 -9
  889. package/node_modules/typebox/build/type/types/_immutable.mjs +2 -10
  890. package/node_modules/typebox/build/type/types/_optional.d.mts +2 -9
  891. package/node_modules/typebox/build/type/types/_optional.mjs +2 -11
  892. package/node_modules/typebox/build/type/types/_readonly.d.mts +2 -9
  893. package/node_modules/typebox/build/type/types/_readonly.mjs +2 -10
  894. package/node_modules/typebox/build/type/types/_refine.d.mts +8 -10
  895. package/node_modules/typebox/build/type/types/_refine.mjs +1 -2
  896. package/node_modules/typebox/build/type/types/call.d.mts +3 -3
  897. package/node_modules/typebox/build/type/types/call.mjs +3 -2
  898. package/node_modules/typebox/build/type/types/deferred.d.mts +1 -0
  899. package/node_modules/typebox/build/type/types/deferred.mjs +1 -1
  900. package/node_modules/typebox/build/type/types/dependent.d.mts +17 -0
  901. package/node_modules/typebox/build/type/types/dependent.mjs +24 -0
  902. package/node_modules/typebox/build/type/types/enum.d.mts +3 -1
  903. package/node_modules/typebox/build/type/types/enum.mjs +5 -0
  904. package/node_modules/typebox/build/type/types/index.d.mts +1 -4
  905. package/node_modules/typebox/build/type/types/index.mjs +1 -4
  906. package/node_modules/typebox/build/type/types/number.d.mts +1 -1
  907. package/node_modules/typebox/build/type/types/number.mjs +1 -1
  908. package/node_modules/typebox/build/type/types/record.d.mts +13 -7
  909. package/node_modules/typebox/build/type/types/record.mjs +15 -9
  910. package/node_modules/typebox/build/type/types/static.d.mts +2 -5
  911. package/node_modules/typebox/build/typebox.d.mts +4 -8
  912. package/node_modules/typebox/build/typebox.mjs +4 -8
  913. package/node_modules/typebox/build/value/clean/clean.mjs +4 -2
  914. package/node_modules/typebox/build/value/clean/from_intersect.mjs +2 -2
  915. package/node_modules/typebox/build/value/clean/from_type.mjs +8 -10
  916. package/node_modules/typebox/build/value/clean/from_union.d.mts +1 -1
  917. package/node_modules/typebox/build/value/clean/from_union.mjs +1 -2
  918. package/node_modules/typebox/build/value/clone/clone.mjs +2 -73
  919. package/node_modules/typebox/build/value/codec/decode.mjs +4 -2
  920. package/node_modules/typebox/build/value/codec/encode.mjs +4 -2
  921. package/node_modules/typebox/build/value/codec/from_array.mjs +1 -4
  922. package/node_modules/typebox/build/value/codec/from_object.mjs +1 -4
  923. package/node_modules/typebox/build/value/codec/from_record.mjs +2 -7
  924. package/node_modules/typebox/build/value/codec/from_tuple.mjs +1 -4
  925. package/node_modules/typebox/build/value/codec/from_union.mjs +2 -3
  926. package/node_modules/typebox/build/value/convert/from_enum.mjs +3 -4
  927. package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +1 -1
  928. package/node_modules/typebox/build/value/convert/from_template_literal.mjs +2 -3
  929. package/node_modules/typebox/build/value/convert/from_type.mjs +19 -21
  930. package/node_modules/typebox/build/value/create/from_enum.mjs +2 -2
  931. package/node_modules/typebox/build/value/create/from_type.mjs +23 -31
  932. package/node_modules/typebox/build/value/default/from_object.mjs +1 -1
  933. package/node_modules/typebox/build/value/default/from_type.mjs +8 -10
  934. package/node_modules/typebox/build/value/index.d.mts +0 -1
  935. package/node_modules/typebox/build/value/index.mjs +0 -1
  936. package/node_modules/typebox/build/value/repair/from_enum.mjs +2 -3
  937. package/node_modules/typebox/build/value/repair/from_type.mjs +24 -22
  938. package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +6 -2
  939. package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +62 -26
  940. package/node_modules/typebox/build/value/value.d.mts +0 -1
  941. package/node_modules/typebox/build/value/value.mjs +0 -1
  942. package/node_modules/typebox/package.json +25 -25
  943. package/node_modules/typebox/readme.md +97 -80
  944. package/npm-shrinkwrap.json +59 -54
  945. package/package.json +10 -10
  946. package/dist/probe.runtime-BED7DXis.js +0 -3
  947. package/node_modules/@babel/runtime/helpers/AwaitValue.js +0 -4
  948. package/node_modules/@babel/runtime/helpers/applyDecs.js +0 -236
  949. package/node_modules/@babel/runtime/helpers/applyDecs2203.js +0 -184
  950. package/node_modules/@babel/runtime/helpers/applyDecs2203R.js +0 -191
  951. package/node_modules/@babel/runtime/helpers/applyDecs2301.js +0 -222
  952. package/node_modules/@babel/runtime/helpers/applyDecs2305.js +0 -133
  953. package/node_modules/@babel/runtime/helpers/classApplyDescriptorDestructureSet.js +0 -10
  954. package/node_modules/@babel/runtime/helpers/classApplyDescriptorGet.js +0 -4
  955. package/node_modules/@babel/runtime/helpers/classApplyDescriptorSet.js +0 -7
  956. package/node_modules/@babel/runtime/helpers/classCheckPrivateStaticAccess.js +0 -5
  957. package/node_modules/@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor.js +0 -4
  958. package/node_modules/@babel/runtime/helpers/classExtractFieldDescriptor.js +0 -5
  959. package/node_modules/@babel/runtime/helpers/classPrivateFieldDestructureSet.js +0 -7
  960. package/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js +0 -7
  961. package/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js +0 -7
  962. package/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js +0 -5
  963. package/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js +0 -4
  964. package/node_modules/@babel/runtime/helpers/classStaticPrivateFieldDestructureSet.js +0 -7
  965. package/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js +0 -7
  966. package/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js +0 -7
  967. package/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js +0 -4
  968. package/node_modules/@babel/runtime/helpers/decorate.js +0 -250
  969. package/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js +0 -12
  970. package/node_modules/@babel/runtime/helpers/dispose.js +0 -28
  971. package/node_modules/@babel/runtime/helpers/esm/AwaitValue.js +0 -4
  972. package/node_modules/@babel/runtime/helpers/esm/applyDecs.js +0 -236
  973. package/node_modules/@babel/runtime/helpers/esm/applyDecs2203.js +0 -184
  974. package/node_modules/@babel/runtime/helpers/esm/applyDecs2203R.js +0 -191
  975. package/node_modules/@babel/runtime/helpers/esm/applyDecs2301.js +0 -222
  976. package/node_modules/@babel/runtime/helpers/esm/applyDecs2305.js +0 -133
  977. package/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorDestructureSet.js +0 -10
  978. package/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorGet.js +0 -4
  979. package/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorSet.js +0 -7
  980. package/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticAccess.js +0 -5
  981. package/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticFieldDescriptor.js +0 -4
  982. package/node_modules/@babel/runtime/helpers/esm/classExtractFieldDescriptor.js +0 -5
  983. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js +0 -7
  984. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js +0 -7
  985. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js +0 -7
  986. package/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js +0 -5
  987. package/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js +0 -4
  988. package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldDestructureSet.js +0 -7
  989. package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js +0 -7
  990. package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js +0 -7
  991. package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js +0 -4
  992. package/node_modules/@babel/runtime/helpers/esm/decorate.js +0 -250
  993. package/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js +0 -12
  994. package/node_modules/@babel/runtime/helpers/esm/dispose.js +0 -28
  995. package/node_modules/@babel/runtime/helpers/esm/objectSpread.js +0 -14
  996. package/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js +0 -77
  997. package/node_modules/@babel/runtime/helpers/esm/using.js +0 -12
  998. package/node_modules/@babel/runtime/helpers/objectSpread.js +0 -14
  999. package/node_modules/@babel/runtime/helpers/regeneratorRuntime.js +0 -77
  1000. package/node_modules/@babel/runtime/helpers/using.js +0 -12
  1001. package/node_modules/@babel/runtime/regenerator/index.js +0 -15
  1002. package/node_modules/content-type/HISTORY.md +0 -29
  1003. package/node_modules/content-type/index.js +0 -225
  1004. package/node_modules/media-typer/HISTORY.md +0 -50
  1005. package/node_modules/media-typer/index.js +0 -143
  1006. package/node_modules/typebox/build/schema/engine/_guard.d.mts +0 -6
  1007. package/node_modules/typebox/build/schema/engine/_guard.mjs +0 -26
  1008. package/node_modules/typebox/build/schema/types/_guard.d.mts +0 -10
  1009. package/node_modules/typebox/build/schema/types/_guard.mjs +0 -16
  1010. package/node_modules/typebox/build/type/action/_optional.d.mts +0 -19
  1011. package/node_modules/typebox/build/type/action/_optional.mjs +0 -40
  1012. package/node_modules/typebox/build/type/action/_readonly.d.mts +0 -19
  1013. package/node_modules/typebox/build/type/action/_readonly.mjs +0 -40
  1014. package/node_modules/typebox/build/type/action/awaited.d.mts +0 -15
  1015. package/node_modules/typebox/build/type/action/awaited.mjs +0 -15
  1016. package/node_modules/typebox/build/type/action/options.d.mts +0 -11
  1017. package/node_modules/typebox/build/type/action/options.mjs +0 -11
  1018. package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +0 -11
  1019. package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +0 -20
  1020. package/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +0 -14
  1021. package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +0 -24
  1022. package/node_modules/typebox/build/type/engine/options/index.d.mts +0 -1
  1023. package/node_modules/typebox/build/type/engine/options/index.mjs +0 -1
  1024. package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +0 -8
  1025. package/node_modules/typebox/build/type/extends/async_iterator.d.mts +0 -7
  1026. package/node_modules/typebox/build/type/extends/async_iterator.mjs +0 -9
  1027. package/node_modules/typebox/build/type/extends/iterator.d.mts +0 -7
  1028. package/node_modules/typebox/build/type/extends/iterator.mjs +0 -9
  1029. package/node_modules/typebox/build/type/extends/promise.d.mts +0 -7
  1030. package/node_modules/typebox/build/type/extends/promise.mjs +0 -9
  1031. package/node_modules/typebox/build/type/types/async_iterator.d.mts +0 -20
  1032. package/node_modules/typebox/build/type/types/async_iterator.mjs +0 -28
  1033. package/node_modules/typebox/build/type/types/base.d.mts +0 -50
  1034. package/node_modules/typebox/build/type/types/base.mjs +0 -84
  1035. package/node_modules/typebox/build/type/types/iterator.d.mts +0 -20
  1036. package/node_modules/typebox/build/type/types/iterator.mjs +0 -28
  1037. package/node_modules/typebox/build/type/types/promise.d.mts +0 -21
  1038. package/node_modules/typebox/build/type/types/promise.mjs +0 -29
  1039. package/node_modules/typebox/build/value/clean/from_base.d.mts +0 -2
  1040. package/node_modules/typebox/build/value/clean/from_base.mjs +0 -4
  1041. package/node_modules/typebox/build/value/convert/from_base.d.mts +0 -2
  1042. package/node_modules/typebox/build/value/convert/from_base.mjs +0 -4
  1043. package/node_modules/typebox/build/value/create/from_async_iterator.d.mts +0 -2
  1044. package/node_modules/typebox/build/value/create/from_async_iterator.mjs +0 -5
  1045. package/node_modules/typebox/build/value/create/from_base.d.mts +0 -2
  1046. package/node_modules/typebox/build/value/create/from_base.mjs +0 -4
  1047. package/node_modules/typebox/build/value/create/from_iterator.d.mts +0 -2
  1048. package/node_modules/typebox/build/value/create/from_iterator.mjs +0 -5
  1049. package/node_modules/typebox/build/value/create/from_promise.d.mts +0 -2
  1050. package/node_modules/typebox/build/value/create/from_promise.mjs +0 -5
  1051. package/node_modules/typebox/build/value/default/from_base.d.mts +0 -2
  1052. package/node_modules/typebox/build/value/default/from_base.mjs +0 -5
  1053. package/node_modules/typebox/build/value/mutate/error.d.mts +0 -3
  1054. package/node_modules/typebox/build/value/mutate/error.mjs +0 -6
  1055. package/node_modules/typebox/build/value/mutate/from_array.d.mts +0 -2
  1056. package/node_modules/typebox/build/value/mutate/from_array.mjs +0 -16
  1057. package/node_modules/typebox/build/value/mutate/from_object.d.mts +0 -2
  1058. package/node_modules/typebox/build/value/mutate/from_object.mjs +0 -40
  1059. package/node_modules/typebox/build/value/mutate/from_unknown.d.mts +0 -2
  1060. package/node_modules/typebox/build/value/mutate/from_unknown.mjs +0 -7
  1061. package/node_modules/typebox/build/value/mutate/from_value.d.mts +0 -2
  1062. package/node_modules/typebox/build/value/mutate/from_value.mjs +0 -12
  1063. package/node_modules/typebox/build/value/mutate/index.d.mts +0 -1
  1064. package/node_modules/typebox/build/value/mutate/index.mjs +0 -1
  1065. package/node_modules/typebox/build/value/mutate/mutate.d.mts +0 -11
  1066. package/node_modules/typebox/build/value/mutate/mutate.mjs +0 -41
  1067. package/node_modules/typebox/build/value/repair/from_base.d.mts +0 -2
  1068. package/node_modules/typebox/build/value/repair/from_base.mjs +0 -8
  1069. /package/node_modules/typebox/build/type/engine/{awaited → with}/index.d.mts +0 -0
  1070. /package/node_modules/typebox/build/type/engine/{awaited → with}/index.mjs +0 -0
@@ -1,5 +1,3 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
2
  /*
5
3
  Copyright 2023 - 2024 The Matrix.org Foundation C.I.C.
@@ -51,11 +49,13 @@ export class RustBackupManager extends TypedEventEmitter {
51
49
  _defineProperty(this, "stopped", false);
52
50
  /** whether {@link backupKeysLoop} is currently running */
53
51
  _defineProperty(this, "backupKeysLoopRunning", false);
52
+ /** The logger to use */
53
+ _defineProperty(this, "logger", void 0);
54
54
  _defineProperty(this, "keyBackupCheckInProgress", null);
55
- this.logger = logger;
56
55
  this.olmMachine = olmMachine;
57
56
  this.http = http;
58
57
  this.outgoingRequestProcessor = outgoingRequestProcessor;
58
+ this.logger = logger.getChild("[RustBackupManager]");
59
59
  }
60
60
 
61
61
  /**
@@ -70,12 +70,9 @@ export class RustBackupManager extends TypedEventEmitter {
70
70
  /**
71
71
  * Get the backup version we are currently backing up to, if any
72
72
  */
73
- getActiveBackupVersion() {
74
- var _this = this;
75
- return _asyncToGenerator(function* () {
76
- if (!(yield _this.olmMachine.isBackupEnabled())) return null;
77
- return _this.activeBackupVersion;
78
- })();
73
+ async getActiveBackupVersion() {
74
+ if (!(await this.olmMachine.isBackupEnabled())) return null;
75
+ return this.activeBackupVersion;
79
76
  }
80
77
 
81
78
  /**
@@ -86,14 +83,11 @@ export class RustBackupManager extends TypedEventEmitter {
86
83
  *
87
84
  * If there was no backup on the server, `null`. If our attempt to check resulted in an error, `undefined`.
88
85
  */
89
- getServerBackupInfo() {
90
- var _this2 = this;
91
- return _asyncToGenerator(function* () {
92
- // Do a validity check if we haven't already done one. The check is likely to fail if we don't yet have the
93
- // backup keys -- but as a side-effect, it will populate `serverBackupInfo`.
94
- yield _this2.checkKeyBackupAndEnable(false);
95
- return _this2.serverBackupInfo;
96
- })();
86
+ async getServerBackupInfo() {
87
+ // Do a validity check if we haven't already done one. The check is likely to fail if we don't yet have the
88
+ // backup keys -- but as a side-effect, it will populate `serverBackupInfo`.
89
+ await this.checkKeyBackupAndEnable(false);
90
+ return this.serverBackupInfo;
97
91
  }
98
92
 
99
93
  /**
@@ -101,24 +95,22 @@ export class RustBackupManager extends TypedEventEmitter {
101
95
  *
102
96
  * @param info - key backup info dict from {@link CryptoApi.getKeyBackupInfo}.
103
97
  */
104
- isKeyBackupTrusted(info) {
105
- var _this3 = this;
106
- return _asyncToGenerator(function* () {
107
- var signatureVerification = yield _this3.olmMachine.verifyBackup(info);
108
- var backupKeys = yield _this3.olmMachine.getBackupKeys();
109
- var decryptionKey = backupKeys === null || backupKeys === void 0 ? void 0 : backupKeys.decryptionKey;
110
- var backupMatchesSavedPrivateKey = !!decryptionKey && _this3.backupInfoMatchesBackupDecryptionKey(info, decryptionKey);
111
- return {
112
- matchesDecryptionKey: backupMatchesSavedPrivateKey,
113
- trusted: signatureVerification.trusted()
114
- };
115
- })();
98
+ async isKeyBackupTrusted(info) {
99
+ const signatureVerification = await this.olmMachine.verifyBackup(info);
100
+ const backupKeys = await this.olmMachine.getBackupKeys();
101
+ const decryptionKey = backupKeys?.decryptionKey;
102
+ const backupMatchesSavedPrivateKey = !!decryptionKey && this.backupInfoMatchesBackupDecryptionKey(info, decryptionKey);
103
+ return {
104
+ matchesDecryptionKey: backupMatchesSavedPrivateKey,
105
+ trusted: signatureVerification.trusted()
106
+ };
116
107
  }
117
108
 
118
109
  /**
119
110
  * Re-check the key backup and enable/disable it as appropriate.
120
111
  *
121
- * @param force - whether we should force a re-check even if one has already happened.
112
+ * @param force - whether we should force a re-check even if one has already happened. If this is
113
+ * `false`, and we have already done a check, `null` is returned rather than the actual info on the key backup.
122
114
  */
123
115
  checkKeyBackupAndEnable(force) {
124
116
  if (!force && this.checkedForBackup) {
@@ -137,69 +129,68 @@ export class RustBackupManager extends TypedEventEmitter {
137
129
  /**
138
130
  * Handles a backup secret received event and store it if it matches the current backup version.
139
131
  *
132
+ * Also enables key backup upload if it was not previously enabled, and the encryption key matches the received
133
+ * decryption key.
134
+ *
140
135
  * @param secret - The secret as received from a `m.secret.send` or `io.element.msc4385.secret.push` event for secret `m.megolm_backup.v1`.
141
136
  * @returns true if the secret is valid and has been stored, false otherwise.
142
137
  */
143
- handleBackupSecretReceived(secret) {
144
- var _this4 = this;
145
- return _asyncToGenerator(function* () {
146
- var _latestBackupInfo;
147
- // Currently we only receive the decryption key without any key backup version. It is important to
148
- // check that the secret is valid for the current version before storing it.
149
- // We force a check to ensure to have the latest version.
150
- var latestBackupInfo;
151
- try {
152
- latestBackupInfo = yield _this4.requestKeyBackupVersion();
153
- } catch (e) {
154
- _this4.logger.warn("handleBackupSecretReceived: Error checking for latest key backup", e);
155
- return false;
156
- }
157
- if (!((_latestBackupInfo = latestBackupInfo) !== null && _latestBackupInfo !== void 0 && _latestBackupInfo.version)) {
158
- // There is no server-side key backup.
159
- // This decryption key is useless to us.
160
- _this4.logger.warn("handleBackupSecretReceived: Received a backup decryption key, but there is no server-side key backup");
161
- return false;
162
- }
163
- var backupDecryptionKey;
164
- try {
165
- backupDecryptionKey = RustSdkCryptoJs.BackupDecryptionKey.fromBase64(secret);
166
- } catch (e) {
167
- _this4.logger.warn("handleBackupSecretReceived: Invalid backup decryption key", e);
138
+ async handleBackupSecretReceived(secret) {
139
+ // Currently we only receive the decryption key without any key backup version. It is important to
140
+ // check that the secret is valid for the current version before storing it.
141
+ // We force a check to ensure to have the latest version.
142
+ let latestBackupInfo;
143
+ try {
144
+ latestBackupInfo = await this.requestKeyBackupVersion();
145
+ } catch (e) {
146
+ this.logger.warn("handleBackupSecretReceived: Error checking for latest key backup", e);
147
+ return false;
148
+ }
149
+ if (!latestBackupInfo?.version) {
150
+ // There is no server-side key backup.
151
+ // This decryption key is useless to us.
152
+ this.logger.warn("handleBackupSecretReceived: Received a backup decryption key, but there is no server-side key backup");
153
+ return false;
154
+ }
155
+ let backupDecryptionKey;
156
+ try {
157
+ backupDecryptionKey = RustSdkCryptoJs.BackupDecryptionKey.fromBase64(secret);
158
+ } catch (e) {
159
+ this.logger.warn("handleBackupSecretReceived: Invalid backup decryption key", e);
160
+ return false;
161
+ }
162
+ try {
163
+ const privateKeyMatches = this.backupInfoMatchesBackupDecryptionKey(latestBackupInfo, backupDecryptionKey);
164
+ if (!privateKeyMatches) {
165
+ this.logger.warn(`handleBackupSecretReceived: Private decryption key does not match the public key of the current server-side backup version (${latestBackupInfo.version})`);
166
+ // just ignore the secret
168
167
  return false;
169
168
  }
170
- try {
171
- var privateKeyMatches = _this4.backupInfoMatchesBackupDecryptionKey(latestBackupInfo, backupDecryptionKey);
172
- if (!privateKeyMatches) {
173
- _this4.logger.warn("handleBackupSecretReceived: Private decryption key does not match the public key of the current server-side backup version (".concat(latestBackupInfo.version, ")"));
174
- // just ignore the secret
175
- return false;
176
- }
177
- _this4.logger.info("handleBackupSecretReceived: Valid decryption key for the current server-side backup version (".concat(latestBackupInfo.version, ") received"));
178
- yield _this4.saveBackupDecryptionKey(backupDecryptionKey, latestBackupInfo.version);
179
- // Check if the backup should be enabled (e.g. if it's properly
180
- // signed), and enable it if it should
181
- if (_this4.keyBackupCheckInProgress) {
182
- yield _this4.keyBackupCheckInProgress;
183
- }
184
- _this4.keyBackupCheckInProgress = _this4.doCheckKeyBackup(latestBackupInfo).finally(() => {
185
- _this4.keyBackupCheckInProgress = null;
186
- });
187
- yield _this4.keyBackupCheckInProgress;
188
- return true;
189
- } catch (e) {
190
- _this4.logger.warn("handleBackupSecretReceived: Unable to validate backup decryption key", e);
169
+ this.logger.info(`handleBackupSecretReceived: Valid decryption key for the current server-side backup version (${latestBackupInfo.version}) received`);
170
+ await this.saveBackupDecryptionKey(backupDecryptionKey, latestBackupInfo.version);
171
+
172
+ // Check if backup upload should be enabled (e.g. the encryption key matches the decryption key),
173
+ // and enable it if so.
174
+ if (this.keyBackupCheckInProgress) {
175
+ this.logger.debug("handleBackupSecretReceived: waiting for ongoing keybackup check to complete");
176
+ await this.keyBackupCheckInProgress;
191
177
  }
192
- return false;
193
- })();
178
+ this.logger.debug("handleBackupSecretReceived: checking if we can enable keybackup upload");
179
+ this.keyBackupCheckInProgress = this.doCheckKeyBackup(latestBackupInfo).finally(() => {
180
+ this.keyBackupCheckInProgress = null;
181
+ });
182
+ await this.keyBackupCheckInProgress;
183
+ return true;
184
+ } catch (e) {
185
+ this.logger.warn("handleBackupSecretReceived: Unable to validate backup decryption key", e);
186
+ }
187
+ return false;
194
188
  }
195
- saveBackupDecryptionKey(backupDecryptionKey, version) {
196
- var _this5 = this;
197
- return _asyncToGenerator(function* () {
198
- yield _this5.olmMachine.saveBackupDecryptionKey(backupDecryptionKey, version);
199
- // Emit an event that we have a new backup decryption key, so that the sdk can start
200
- // importing keys from backup if needed.
201
- _this5.emit(CryptoEvent.KeyBackupDecryptionKeyCached, version);
202
- })();
189
+ async saveBackupDecryptionKey(backupDecryptionKey, version) {
190
+ await this.olmMachine.saveBackupDecryptionKey(backupDecryptionKey, version);
191
+ // Emit an event that we have a new backup decryption key, so that the sdk can start
192
+ // importing keys from backup if needed.
193
+ this.emit(CryptoEvent.KeyBackupDecryptionKeyCached, version);
203
194
  }
204
195
 
205
196
  /**
@@ -209,11 +200,8 @@ export class RustBackupManager extends TypedEventEmitter {
209
200
  * @param opts - options object
210
201
  * @returns a promise which resolves once the keys have been imported
211
202
  */
212
- importRoomKeys(keys, opts) {
213
- var _this6 = this;
214
- return _asyncToGenerator(function* () {
215
- yield _this6.importRoomKeysAsJson(JSON.stringify(keys), opts);
216
- })();
203
+ async importRoomKeys(keys, opts) {
204
+ await this.importRoomKeysAsJson(JSON.stringify(keys), opts);
217
205
  }
218
206
 
219
207
  /**
@@ -224,125 +212,111 @@ export class RustBackupManager extends TypedEventEmitter {
224
212
  * @param opts - options object
225
213
  * @returns a promise which resolves once the keys have been imported
226
214
  */
227
- importRoomKeysAsJson(jsonKeys, opts) {
228
- var _this7 = this;
229
- return _asyncToGenerator(function* () {
230
- yield _this7.olmMachine.importExportedRoomKeys(jsonKeys, (progress, total) => {
231
- var _opts$progressCallbac;
232
- var importOpt = {
233
- total: Number(total),
234
- successes: Number(progress),
235
- stage: ImportRoomKeyStage.LoadKeys,
236
- failures: 0
237
- };
238
- opts === null || opts === void 0 || (_opts$progressCallbac = opts.progressCallback) === null || _opts$progressCallbac === void 0 || _opts$progressCallbac.call(opts, importOpt);
239
- });
240
- })();
215
+ async importRoomKeysAsJson(jsonKeys, opts) {
216
+ await this.olmMachine.importExportedRoomKeys(jsonKeys, (progress, total) => {
217
+ const importOpt = {
218
+ total: Number(total),
219
+ successes: Number(progress),
220
+ stage: ImportRoomKeyStage.LoadKeys,
221
+ failures: 0
222
+ };
223
+ opts?.progressCallback?.(importOpt);
224
+ });
241
225
  }
242
226
 
243
227
  /**
244
228
  * Implementation of {@link CryptoBackend#importBackedUpRoomKeys}.
245
229
  */
246
- importBackedUpRoomKeys(keys, backupVersion, opts) {
247
- var _this8 = this;
248
- return _asyncToGenerator(function* () {
249
- var keysByRoom = new Map();
250
- for (var key of keys) {
251
- var roomId = new RustSdkCryptoJs.RoomId(key.room_id);
252
- if (!keysByRoom.has(roomId)) {
253
- keysByRoom.set(roomId, new Map());
254
- }
255
- keysByRoom.get(roomId).set(key.session_id, key);
230
+ async importBackedUpRoomKeys(keys, backupVersion, opts) {
231
+ const keysByRoom = new Map();
232
+ for (const key of keys) {
233
+ const roomId = new RustSdkCryptoJs.RoomId(key.room_id);
234
+ if (!keysByRoom.has(roomId)) {
235
+ keysByRoom.set(roomId, new Map());
256
236
  }
257
- yield _this8.olmMachine.importBackedUpRoomKeys(keysByRoom, (progress, total, failures) => {
258
- var _opts$progressCallbac2;
259
- var importOpt = {
260
- total: Number(total),
261
- successes: Number(progress),
262
- stage: ImportRoomKeyStage.LoadKeys,
263
- failures: Number(failures)
264
- };
265
- opts === null || opts === void 0 || (_opts$progressCallbac2 = opts.progressCallback) === null || _opts$progressCallbac2 === void 0 || _opts$progressCallbac2.call(opts, importOpt);
266
- }, backupVersion);
267
- })();
237
+ keysByRoom.get(roomId).set(key.session_id, key);
238
+ }
239
+ await this.olmMachine.importBackedUpRoomKeys(keysByRoom, (progress, total, failures) => {
240
+ const importOpt = {
241
+ total: Number(total),
242
+ successes: Number(progress),
243
+ stage: ImportRoomKeyStage.LoadKeys,
244
+ failures: Number(failures)
245
+ };
246
+ opts?.progressCallback?.(importOpt);
247
+ }, backupVersion);
268
248
  }
269
249
  /** Helper to check the key backup status, and enable/disable it as appropriate
270
250
  *
271
251
  * A KeyBackupInfo can be passed if it was fetched recently, to avoid trying to
272
252
  * re-fetch it from the server.
273
253
  */
274
- doCheckKeyBackup(backupInfo) {
275
- var _this9 = this;
276
- return _asyncToGenerator(function* () {
277
- _this9.logger.debug("Checking key backup status...");
278
- try {
279
- if (!backupInfo) {
280
- backupInfo = yield _this9.requestKeyBackupVersion();
281
- }
282
- } catch (e) {
283
- _this9.logger.warn("Error checking for active key backup", e);
284
- _this9.serverBackupInfo = undefined;
285
- return null;
254
+ async doCheckKeyBackup(backupInfo) {
255
+ this.logger.debug("Checking key backup status...");
256
+ try {
257
+ if (!backupInfo) {
258
+ backupInfo = await this.requestKeyBackupVersion();
286
259
  }
287
- _this9.checkedForBackup = true;
288
- if (backupInfo && !backupInfo.version) {
289
- _this9.logger.warn("active backup lacks a useful 'version'; ignoring it");
290
- backupInfo = undefined;
260
+ } catch (e) {
261
+ this.logger.warn("Error checking for active key backup", e);
262
+ this.serverBackupInfo = undefined;
263
+ return null;
264
+ }
265
+ this.checkedForBackup = true;
266
+ if (backupInfo && !backupInfo.version) {
267
+ this.logger.warn("active backup lacks a useful 'version'; ignoring it");
268
+ backupInfo = undefined;
269
+ }
270
+ this.serverBackupInfo = backupInfo;
271
+ const activeVersion = await this.getActiveBackupVersion();
272
+ if (!backupInfo) {
273
+ if (activeVersion !== null) {
274
+ this.logger.debug("No key backup present on server: disabling key backup");
275
+ await this.disableKeyBackup();
276
+ } else {
277
+ this.logger.debug("No key backup present on server: not enabling key backup");
291
278
  }
292
- _this9.serverBackupInfo = backupInfo;
293
- var activeVersion = yield _this9.getActiveBackupVersion();
294
- if (!backupInfo) {
295
- if (activeVersion !== null) {
296
- _this9.logger.debug("No key backup present on server: disabling key backup");
297
- yield _this9.disableKeyBackup();
298
- } else {
299
- _this9.logger.debug("No key backup present on server: not enabling key backup");
300
- }
301
- return null;
279
+ return null;
280
+ }
281
+ const trustInfo = await this.isKeyBackupTrusted(backupInfo);
282
+
283
+ // Per the spec, we should enable key upload if either (a) the backup is signed by a trusted key, or
284
+ // (b) the public key matches the private decryption key that we have received from 4S.
285
+ if (!trustInfo.matchesDecryptionKey && !trustInfo.trusted) {
286
+ if (activeVersion !== null) {
287
+ this.logger.debug("Key backup present on server but not trusted: disabling key backup");
288
+ await this.disableKeyBackup();
289
+ } else {
290
+ this.logger.debug("Key backup present on server but not trusted: not enabling key backup");
302
291
  }
303
- var trustInfo = yield _this9.isKeyBackupTrusted(backupInfo);
304
-
305
- // Per the spec, we should enable key upload if either (a) the backup is signed by a trusted key, or
306
- // (b) the public key matches the private decryption key that we have received from 4S.
307
- if (!trustInfo.matchesDecryptionKey && !trustInfo.trusted) {
308
- if (activeVersion !== null) {
309
- _this9.logger.debug("Key backup present on server but not trusted: disabling key backup");
310
- yield _this9.disableKeyBackup();
311
- } else {
312
- _this9.logger.debug("Key backup present on server but not trusted: not enabling key backup");
313
- }
292
+ } else {
293
+ if (activeVersion === null) {
294
+ this.logger.debug(`Found usable key backup v${backupInfo.version}: enabling key backups`);
295
+ await this.enableKeyBackup(backupInfo);
296
+ } else if (activeVersion !== backupInfo.version) {
297
+ this.logger.debug(`On backup version ${activeVersion} but found version ${backupInfo.version}: switching.`);
298
+ // This will remove any pending backup request, remove the backup key and reset the backup state of each room key we have.
299
+ await this.disableKeyBackup();
300
+ // Enabling will now trigger re-upload of all the keys
301
+ await this.enableKeyBackup(backupInfo);
314
302
  } else {
315
- if (activeVersion === null) {
316
- _this9.logger.debug("Found usable key backup v".concat(backupInfo.version, ": enabling key backups"));
317
- yield _this9.enableKeyBackup(backupInfo);
318
- } else if (activeVersion !== backupInfo.version) {
319
- _this9.logger.debug("On backup version ".concat(activeVersion, " but found version ").concat(backupInfo.version, ": switching."));
320
- // This will remove any pending backup request, remove the backup key and reset the backup state of each room key we have.
321
- yield _this9.disableKeyBackup();
322
- // Enabling will now trigger re-upload of all the keys
323
- yield _this9.enableKeyBackup(backupInfo);
324
- } else {
325
- _this9.logger.debug("Backup version ".concat(backupInfo.version, " still current"));
326
- }
303
+ this.logger.debug(`Backup version ${backupInfo.version} still current`);
327
304
  }
328
- return {
329
- backupInfo,
330
- trustInfo
331
- };
332
- })();
333
- }
334
- enableKeyBackup(backupInfo) {
335
- var _this0 = this;
336
- return _asyncToGenerator(function* () {
337
- // we know for certain it must be a Curve25519 key, because we have verified it and only Curve25519
338
- // keys can be verified.
339
- //
340
- // we also checked it has a valid `version`.
341
- yield _this0.olmMachine.enableBackupV1(backupInfo.auth_data.public_key, backupInfo.version);
342
- _this0.activeBackupVersion = backupInfo.version;
343
- _this0.emit(CryptoEvent.KeyBackupStatus, true);
344
- _this0.backupKeysLoop();
345
- })();
305
+ }
306
+ return {
307
+ backupInfo,
308
+ trustInfo
309
+ };
310
+ }
311
+ async enableKeyBackup(backupInfo) {
312
+ // we know for certain it must be a Curve25519 key, because we have verified it and only Curve25519
313
+ // keys can be verified.
314
+ //
315
+ // we also checked it has a valid `version`.
316
+ await this.olmMachine.enableBackupV1(backupInfo.auth_data.public_key, backupInfo.version);
317
+ this.activeBackupVersion = backupInfo.version;
318
+ this.emit(CryptoEvent.KeyBackupStatus, true);
319
+ this.backupKeysLoop();
346
320
  }
347
321
 
348
322
  /**
@@ -350,139 +324,128 @@ export class RustBackupManager extends TypedEventEmitter {
350
324
  * Doesn't try to check the backup server side. To be called when a new
351
325
  * megolm key is known locally.
352
326
  */
353
- maybeUploadKey() {
354
- var _this1 = this;
355
- return _asyncToGenerator(function* () {
356
- if (_this1.activeBackupVersion != null) {
357
- _this1.backupKeysLoop();
358
- }
359
- })();
360
- }
361
- disableKeyBackup() {
362
- var _this10 = this;
363
- return _asyncToGenerator(function* () {
364
- yield _this10.olmMachine.disableBackup();
365
- _this10.activeBackupVersion = null;
366
- _this10.emit(CryptoEvent.KeyBackupStatus, false);
367
- })();
368
- }
369
- backupKeysLoop() {
370
- var _arguments = arguments,
371
- _this11 = this;
372
- return _asyncToGenerator(function* () {
373
- var maxDelay = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : 10000;
374
- if (_this11.backupKeysLoopRunning) {
375
- _this11.logger.debug("Backup loop already running");
376
- return;
377
- }
378
- _this11.backupKeysLoopRunning = true;
379
- _this11.logger.debug("Backup: Starting keys upload loop for backup version:".concat(_this11.activeBackupVersion, "."));
380
-
381
- // wait between 0 and `maxDelay` seconds, to avoid backup
382
- // requests from different clients hitting the server all at
383
- // the same time when a new key is sent
384
- var delay = Math.random() * maxDelay;
385
- yield sleep(delay);
386
- try {
387
- // number of consecutive network failures for exponential backoff
388
- var numFailures = 0;
389
- // The number of keys left to back up. (Populated lazily: see more comments below.)
390
- var remainingToUploadCount = null;
391
- // To avoid computing the key when only a few keys were added (after a sync for example),
392
- // we compute the count only when at least two iterations are needed.
393
- var isFirstIteration = true;
394
- while (!_this11.stopped) {
395
- // Get a batch of room keys to upload
396
- var request = undefined;
397
- try {
398
- request = yield logDuration(_this11.logger, "BackupRoomKeys: Get keys to backup from rust crypto-sdk", /*#__PURE__*/_asyncToGenerator(function* () {
399
- return yield _this11.olmMachine.backupRoomKeys();
400
- }));
401
- } catch (err) {
402
- _this11.logger.error("Backup: Failed to get keys to backup from rust crypto-sdk", err);
327
+ async maybeUploadKey() {
328
+ if (this.activeBackupVersion != null) {
329
+ this.backupKeysLoop();
330
+ }
331
+ }
332
+ async disableKeyBackup() {
333
+ await this.olmMachine.disableBackup();
334
+ this.activeBackupVersion = null;
335
+ this.emit(CryptoEvent.KeyBackupStatus, false);
336
+ }
337
+ async backupKeysLoop(maxDelay = 10000) {
338
+ if (this.backupKeysLoopRunning) {
339
+ this.logger.debug(`Backup loop already running`);
340
+ return;
341
+ }
342
+ this.backupKeysLoopRunning = true;
343
+ this.logger.debug(`Backup: Starting keys upload loop for backup version:${this.activeBackupVersion}.`);
344
+
345
+ // wait between 0 and `maxDelay` seconds, to avoid backup
346
+ // requests from different clients hitting the server all at
347
+ // the same time when a new key is sent
348
+ const delay = Math.random() * maxDelay;
349
+ await sleep(delay);
350
+ try {
351
+ // number of consecutive network failures for exponential backoff
352
+ let numFailures = 0;
353
+ // The number of keys left to back up. (Populated lazily: see more comments below.)
354
+ let remainingToUploadCount = null;
355
+ // To avoid computing the key when only a few keys were added (after a sync for example),
356
+ // we compute the count only when at least two iterations are needed.
357
+ let isFirstIteration = true;
358
+ while (!this.stopped) {
359
+ // Get a batch of room keys to upload
360
+ let request = undefined;
361
+ try {
362
+ request = await logDuration(this.logger, "BackupRoomKeys: Get keys to backup from rust crypto-sdk", async () => {
363
+ return await this.olmMachine.backupRoomKeys();
364
+ });
365
+ } catch (err) {
366
+ this.logger.error("Backup: Failed to get keys to backup from rust crypto-sdk", err);
367
+ }
368
+ if (!request || this.stopped || !this.activeBackupVersion) {
369
+ this.logger.debug(`Backup: Ending loop for version ${this.activeBackupVersion}.`);
370
+ if (!request) {
371
+ // nothing more to upload
372
+ this.emit(CryptoEvent.KeyBackupSessionsRemaining, 0);
403
373
  }
404
- if (!request || _this11.stopped || !_this11.activeBackupVersion) {
405
- _this11.logger.debug("Backup: Ending loop for version ".concat(_this11.activeBackupVersion, "."));
406
- if (!request) {
407
- // nothing more to upload
408
- _this11.emit(CryptoEvent.KeyBackupSessionsRemaining, 0);
374
+ return;
375
+ }
376
+ try {
377
+ await this.outgoingRequestProcessor.makeOutgoingRequest(request);
378
+ numFailures = 0;
379
+ if (this.stopped) break;
380
+
381
+ // Key count performance (`olmMachine.roomKeyCounts()`) can be pretty bad on some configurations.
382
+ // In particular, we detected on some M1 macs that when the object store reaches a threshold, the count
383
+ // performance stops growing in O(n) and suddenly becomes very slow (40s, 60s or more).
384
+ // For reference, the performance drop occurs around 300-400k keys on the platforms where this issue is observed.
385
+ // Even on other configurations, the count can take several seconds.
386
+ // This will block other operations on the database, like sending messages.
387
+ //
388
+ // This is a workaround to avoid calling `olmMachine.roomKeyCounts()` too often, and only when necessary.
389
+ // We don't call it on the first loop because there could be only a few keys to upload, and we don't want to wait for the count.
390
+ if (!isFirstIteration && remainingToUploadCount === null) {
391
+ try {
392
+ const keyCount = await this.olmMachine.roomKeyCounts();
393
+ remainingToUploadCount = keyCount.total - keyCount.backedUp;
394
+ } catch (err) {
395
+ this.logger.error("Backup: Failed to get key counts from rust crypto-sdk", err);
409
396
  }
410
- return;
411
397
  }
412
- try {
413
- yield _this11.outgoingRequestProcessor.makeOutgoingRequest(request);
414
- numFailures = 0;
415
- if (_this11.stopped) break;
416
-
417
- // Key count performance (`olmMachine.roomKeyCounts()`) can be pretty bad on some configurations.
418
- // In particular, we detected on some M1 macs that when the object store reaches a threshold, the count
419
- // performance stops growing in O(n) and suddenly becomes very slow (40s, 60s or more).
420
- // For reference, the performance drop occurs around 300-400k keys on the platforms where this issue is observed.
421
- // Even on other configurations, the count can take several seconds.
422
- // This will block other operations on the database, like sending messages.
423
- //
424
- // This is a workaround to avoid calling `olmMachine.roomKeyCounts()` too often, and only when necessary.
425
- // We don't call it on the first loop because there could be only a few keys to upload, and we don't want to wait for the count.
426
- if (!isFirstIteration && remainingToUploadCount === null) {
398
+ if (remainingToUploadCount !== null) {
399
+ this.emit(CryptoEvent.KeyBackupSessionsRemaining, remainingToUploadCount);
400
+ const keysCountInBatch = this.keysCountInBatch(request);
401
+ // `OlmMachine.roomKeyCounts` is called only once for the current backupKeysLoop. But new
402
+ // keys could be added during the current loop (after a sync for example).
403
+ // So the count can get out of sync with the real number of remaining keys to upload.
404
+ // Depending on the number of new keys imported and the time to complete the loop,
405
+ // this could result in multiple events being emitted with a remaining key count of 0.
406
+ remainingToUploadCount = Math.max(remainingToUploadCount - keysCountInBatch, 0);
407
+ }
408
+ } catch (err) {
409
+ numFailures++;
410
+ this.logger.error("Backup: Error processing backup request for rust crypto-sdk", err);
411
+ if (err instanceof MatrixError) {
412
+ const errCode = err.data.errcode;
413
+ if (errCode == "M_NOT_FOUND" || errCode == "M_WRONG_ROOM_KEYS_VERSION") {
414
+ this.logger.debug(`Backup: Failed to upload keys to current vesion: ${errCode}.`);
427
415
  try {
428
- var keyCount = yield _this11.olmMachine.roomKeyCounts();
429
- remainingToUploadCount = keyCount.total - keyCount.backedUp;
430
- } catch (err) {
431
- _this11.logger.error("Backup: Failed to get key counts from rust crypto-sdk", err);
416
+ await this.disableKeyBackup();
417
+ } catch (error) {
418
+ this.logger.error("Backup: An error occurred while disabling key backup:", error);
432
419
  }
433
- }
434
- if (remainingToUploadCount !== null) {
435
- _this11.emit(CryptoEvent.KeyBackupSessionsRemaining, remainingToUploadCount);
436
- var keysCountInBatch = _this11.keysCountInBatch(request);
437
- // `OlmMachine.roomKeyCounts` is called only once for the current backupKeysLoop. But new
438
- // keys could be added during the current loop (after a sync for example).
439
- // So the count can get out of sync with the real number of remaining keys to upload.
440
- // Depending on the number of new keys imported and the time to complete the loop,
441
- // this could result in multiple events being emitted with a remaining key count of 0.
442
- remainingToUploadCount = Math.max(remainingToUploadCount - keysCountInBatch, 0);
443
- }
444
- } catch (err) {
445
- numFailures++;
446
- _this11.logger.error("Backup: Error processing backup request for rust crypto-sdk", err);
447
- if (err instanceof MatrixError) {
448
- var errCode = err.data.errcode;
449
- if (errCode == "M_NOT_FOUND" || errCode == "M_WRONG_ROOM_KEYS_VERSION") {
450
- _this11.logger.debug("Backup: Failed to upload keys to current vesion: ".concat(errCode, "."));
451
- try {
452
- yield _this11.disableKeyBackup();
453
- } catch (error) {
454
- _this11.logger.error("Backup: An error occurred while disabling key backup:", error);
420
+ this.emit(CryptoEvent.KeyBackupFailed, err.data.errcode);
421
+ // There was an active backup and we are out of sync with the server
422
+ // force a check server side
423
+ this.backupKeysLoopRunning = false;
424
+ this.checkKeyBackupAndEnable(true);
425
+ return;
426
+ } else if (err.isRateLimitError()) {
427
+ // wait for that and then continue?
428
+ try {
429
+ const waitTime = err.getRetryAfterMs();
430
+ if (waitTime && waitTime > 0) {
431
+ await sleep(waitTime);
432
+ continue;
455
433
  }
456
- _this11.emit(CryptoEvent.KeyBackupFailed, err.data.errcode);
457
- // There was an active backup and we are out of sync with the server
458
- // force a check server side
459
- _this11.backupKeysLoopRunning = false;
460
- _this11.checkKeyBackupAndEnable(true);
461
- return;
462
- } else if (err.isRateLimitError()) {
463
- // wait for that and then continue?
464
- try {
465
- var waitTime = err.getRetryAfterMs();
466
- if (waitTime && waitTime > 0) {
467
- yield sleep(waitTime);
468
- continue;
469
- }
470
- } catch (error) {
471
- _this11.logger.warn("Backup: An error occurred while retrieving a rate-limit retry delay", error);
472
- } // else go to the normal backoff
473
- }
434
+ } catch (error) {
435
+ this.logger.warn("Backup: An error occurred while retrieving a rate-limit retry delay", error);
436
+ } // else go to the normal backoff
474
437
  }
475
-
476
- // Some other errors (mx, network, or CORS or invalid urls?) anyhow backoff
477
- // exponential backoff if we have failures
478
- yield sleep(1000 * Math.pow(2, Math.min(numFailures - 1, 4)));
479
438
  }
480
- isFirstIteration = false;
439
+
440
+ // Some other errors (mx, network, or CORS or invalid urls?) anyhow backoff
441
+ // exponential backoff if we have failures
442
+ await sleep(1000 * Math.pow(2, Math.min(numFailures - 1, 4)));
481
443
  }
482
- } finally {
483
- _this11.backupKeysLoopRunning = false;
444
+ isFirstIteration = false;
484
445
  }
485
- })();
446
+ } finally {
447
+ this.backupKeysLoopRunning = false;
448
+ }
486
449
  }
487
450
 
488
451
  /**
@@ -494,7 +457,7 @@ export class RustBackupManager extends TypedEventEmitter {
494
457
  * @returns The number of keys in the backup request.
495
458
  */
496
459
  keysCountInBatch(batch) {
497
- var parsedBody = JSON.parse(batch.body);
460
+ const parsedBody = JSON.parse(batch.body);
498
461
  return countKeysInBackup(parsedBody);
499
462
  }
500
463
 
@@ -506,11 +469,8 @@ export class RustBackupManager extends TypedEventEmitter {
506
469
  * @param version - The version of the backup to get information about.
507
470
  * @returns Information object from API or null if there is no active backup.
508
471
  */
509
- requestKeyBackupVersion(version) {
510
- var _this12 = this;
511
- return _asyncToGenerator(function* () {
512
- return yield requestKeyBackupVersion(_this12.http, version);
513
- })();
472
+ async requestKeyBackupVersion(version) {
473
+ return await requestKeyBackupVersion(this.http, version);
514
474
  }
515
475
 
516
476
  /**
@@ -523,31 +483,28 @@ export class RustBackupManager extends TypedEventEmitter {
523
483
  * existing identity.
524
484
  * @returns a KeyBackupCreationInfo - All information related to the backup.
525
485
  */
526
- setupKeyBackup(signObject) {
527
- var _this13 = this;
528
- return _asyncToGenerator(function* () {
529
- // Clean up any existing backup
530
- yield _this13.deleteAllKeyBackupVersions();
531
- var randomKey = RustSdkCryptoJs.BackupDecryptionKey.createRandomKey();
532
- var pubKey = randomKey.megolmV1PublicKey;
533
- var authData = {
534
- public_key: pubKey.publicKeyBase64
535
- };
536
- yield signObject(authData);
537
- var res = yield _this13.http.authedRequest(Method.Post, "/room_keys/version", undefined, {
538
- algorithm: pubKey.algorithm,
539
- auth_data: authData
540
- }, {
541
- prefix: ClientPrefix.V3
542
- });
543
- yield _this13.saveBackupDecryptionKey(randomKey, res.version);
544
- return {
545
- version: res.version,
546
- algorithm: pubKey.algorithm,
547
- authData: authData,
548
- decryptionKey: randomKey
549
- };
550
- })();
486
+ async setupKeyBackup(signObject) {
487
+ // Clean up any existing backup
488
+ await this.deleteAllKeyBackupVersions();
489
+ const randomKey = RustSdkCryptoJs.BackupDecryptionKey.createRandomKey();
490
+ const pubKey = randomKey.megolmV1PublicKey;
491
+ const authData = {
492
+ public_key: pubKey.publicKeyBase64
493
+ };
494
+ await signObject(authData);
495
+ const res = await this.http.authedRequest(Method.Post, "/room_keys/version", undefined, {
496
+ algorithm: pubKey.algorithm,
497
+ auth_data: authData
498
+ }, {
499
+ prefix: ClientPrefix.V3
500
+ });
501
+ await this.saveBackupDecryptionKey(randomKey, res.version);
502
+ return {
503
+ version: res.version,
504
+ algorithm: pubKey.algorithm,
505
+ authData: authData,
506
+ decryptionKey: randomKey
507
+ };
551
508
  }
552
509
 
553
510
  /**
@@ -555,20 +512,15 @@ export class RustBackupManager extends TypedEventEmitter {
555
512
  *
556
513
  * Will call the API to delete active backup until there is no more present.
557
514
  */
558
- deleteAllKeyBackupVersions() {
559
- var _this14 = this;
560
- return _asyncToGenerator(function* () {
561
- var _yield$_this14$reques, _yield$_this14$reques2;
562
- // there could be several backup versions. Delete all to be safe.
563
- var current = (_yield$_this14$reques = (_yield$_this14$reques2 = yield _this14.requestKeyBackupVersion()) === null || _yield$_this14$reques2 === void 0 ? void 0 : _yield$_this14$reques2.version) !== null && _yield$_this14$reques !== void 0 ? _yield$_this14$reques : null;
564
- while (current != null) {
565
- var _yield$_this14$reques3, _yield$_this14$reques4;
566
- yield _this14.deleteKeyBackupVersion(current);
567
- current = (_yield$_this14$reques3 = (_yield$_this14$reques4 = yield _this14.requestKeyBackupVersion()) === null || _yield$_this14$reques4 === void 0 ? void 0 : _yield$_this14$reques4.version) !== null && _yield$_this14$reques3 !== void 0 ? _yield$_this14$reques3 : null;
568
- }
515
+ async deleteAllKeyBackupVersions() {
516
+ // there could be several backup versions. Delete all to be safe.
517
+ let current = (await this.requestKeyBackupVersion())?.version ?? null;
518
+ while (current != null) {
519
+ await this.deleteKeyBackupVersion(current);
520
+ current = (await this.requestKeyBackupVersion())?.version ?? null;
521
+ }
569
522
 
570
- // XXX: Should this also update Secret Storage and delete any existing keys?
571
- })();
523
+ // XXX: Should this also update Secret Storage and delete any existing keys?
572
524
  }
573
525
 
574
526
  /**
@@ -576,22 +528,19 @@ export class RustBackupManager extends TypedEventEmitter {
576
528
  *
577
529
  * @param version - The backup version to delete.
578
530
  */
579
- deleteKeyBackupVersion(version) {
580
- var _this15 = this;
581
- return _asyncToGenerator(function* () {
582
- _this15.logger.debug("deleteKeyBackupVersion v:".concat(version));
583
- var path = encodeUri("/room_keys/version/$version", {
584
- $version: version
585
- });
586
- yield _this15.http.authedRequest(Method.Delete, path, undefined, undefined, {
587
- prefix: ClientPrefix.V3
588
- });
589
- // If the backup we are deleting is the active one, we need to disable the key backup and to have the local properties reset
590
- if (_this15.activeBackupVersion === version) {
591
- _this15.serverBackupInfo = null;
592
- yield _this15.disableKeyBackup();
593
- }
594
- })();
531
+ async deleteKeyBackupVersion(version) {
532
+ this.logger.debug(`deleteKeyBackupVersion v:${version}`);
533
+ const path = encodeUri("/room_keys/version/$version", {
534
+ $version: version
535
+ });
536
+ await this.http.authedRequest(Method.Delete, path, undefined, undefined, {
537
+ prefix: ClientPrefix.V3
538
+ });
539
+ // If the backup we are deleting is the active one, we need to disable the key backup and to have the local properties reset
540
+ if (this.activeBackupVersion === version) {
541
+ this.serverBackupInfo = null;
542
+ await this.disableKeyBackup();
543
+ }
595
544
  }
596
545
 
597
546
  /**
@@ -610,12 +559,9 @@ export class RustBackupManager extends TypedEventEmitter {
610
559
  * @param opts - Options for the restore.
611
560
  * @returns The total number of keys and the total imported.
612
561
  */
613
- restoreKeyBackup(backupVersion, backupDecryptor, opts) {
614
- var _this16 = this;
615
- return _asyncToGenerator(function* () {
616
- var keyBackup = yield _this16.downloadKeyBackup(backupVersion);
617
- return _this16.importKeyBackup(keyBackup, backupVersion, backupDecryptor, opts);
618
- })();
562
+ async restoreKeyBackup(backupVersion, backupDecryptor, opts) {
563
+ const keyBackup = await this.downloadKeyBackup(backupVersion);
564
+ return this.importKeyBackup(keyBackup, backupVersion, backupDecryptor, opts);
619
565
  }
620
566
 
621
567
  /**
@@ -623,26 +569,24 @@ export class RustBackupManager extends TypedEventEmitter {
623
569
  *
624
570
  * @param roomId - The room in question.
625
571
  */
626
- downloadLatestRoomKeyBackup(roomId) {
627
- var _this17 = this;
628
- return _asyncToGenerator(function* () {
629
- var _yield$_this17$olmMac = yield _this17.olmMachine.getBackupKeys(),
630
- backupVersion = _yield$_this17$olmMac.backupVersion,
631
- decryptionKey = _yield$_this17$olmMac.decryptionKey;
632
- if (!backupVersion || !decryptionKey) {
633
- _this17.logger.warn("downloadLatestRoomKeyBackup: Could not download backup (backupVersion=".concat(backupVersion, ", hasDecryptionKey=").concat(!!decryptionKey, ")"));
634
- return;
635
- }
636
- var sessions = yield _this17.downloadRoomKeyBackup(backupVersion, roomId);
637
- var backupDecryptor = _this17.createBackupDecryptor(decryptionKey);
638
- _this17.importKeyBackup({
639
- rooms: {
640
- [roomId]: {
641
- sessions
642
- }
572
+ async downloadLatestRoomKeyBackup(roomId) {
573
+ const {
574
+ backupVersion,
575
+ decryptionKey
576
+ } = await this.olmMachine.getBackupKeys();
577
+ if (!backupVersion || !decryptionKey) {
578
+ this.logger.warn(`downloadLatestRoomKeyBackup: Could not download backup (backupVersion=${backupVersion}, hasDecryptionKey=${!!decryptionKey})`);
579
+ return;
580
+ }
581
+ const sessions = await this.downloadRoomKeyBackup(backupVersion, roomId);
582
+ const backupDecryptor = this.createBackupDecryptor(decryptionKey);
583
+ this.importKeyBackup({
584
+ rooms: {
585
+ [roomId]: {
586
+ sessions
643
587
  }
644
- }, backupVersion, backupDecryptor);
645
- })();
588
+ }
589
+ }, backupVersion, backupDecryptor);
646
590
  }
647
591
 
648
592
  /**
@@ -667,7 +611,7 @@ export class RustBackupManager extends TypedEventEmitter {
667
611
  * @returns The key backup response.
668
612
  */
669
613
  downloadRoomKeyBackup(backupVersion, roomId) {
670
- var path = encodeUri("/room_keys/keys/$roomId", {
614
+ const path = encodeUri("/room_keys/keys/$roomId", {
671
615
  $roomId: roomId
672
616
  });
673
617
  return this.http.authedRequest(Method.Get, path, {
@@ -690,112 +634,93 @@ export class RustBackupManager extends TypedEventEmitter {
690
634
  *
691
635
  * @private
692
636
  */
693
- importKeyBackup(keyBackup, backupVersion, backupDecryptor, opts) {
694
- var _this18 = this;
695
- return _asyncToGenerator(function* () {
696
- var _opts$progressCallbac3;
697
- // We have a full backup here, it can get quite big, so we need to decrypt and import it in chunks.
698
-
699
- var CHUNK_SIZE = 200;
700
- // Get the total count as a first pass
701
- var totalKeyCount = countKeysInBackup(keyBackup);
702
- var totalImported = 0;
703
- var totalFailures = 0;
704
- opts === null || opts === void 0 || (_opts$progressCallbac3 = opts.progressCallback) === null || _opts$progressCallbac3 === void 0 || _opts$progressCallbac3.call(opts, {
637
+ async importKeyBackup(keyBackup, backupVersion, backupDecryptor, opts) {
638
+ // We have a full backup here, it can get quite big, so we need to decrypt and import it in chunks.
639
+
640
+ const CHUNK_SIZE = 200;
641
+ // Get the total count as a first pass
642
+ const totalKeyCount = countKeysInBackup(keyBackup);
643
+ let totalImported = 0;
644
+ let totalFailures = 0;
645
+ opts?.progressCallback?.({
646
+ total: totalKeyCount,
647
+ successes: totalImported,
648
+ stage: ImportRoomKeyStage.LoadKeys,
649
+ failures: totalFailures
650
+ });
651
+
652
+ /**
653
+ * This method is called when we have enough chunks to decrypt.
654
+ * It will decrypt the chunks and try to import the room keys.
655
+ * @param roomChunks
656
+ */
657
+ const handleChunkCallback = async roomChunks => {
658
+ const currentChunk = [];
659
+ for (const roomId of roomChunks.keys()) {
660
+ // Decrypt the sessions for the given room
661
+ const decryptedSessions = await backupDecryptor.decryptSessions(roomChunks.get(roomId));
662
+ // Add the decrypted sessions to the current chunk
663
+ decryptedSessions.forEach(session => {
664
+ // We set the room_id for each session
665
+ session.room_id = roomId;
666
+ currentChunk.push(session);
667
+ });
668
+ }
669
+
670
+ // We have a chunk of decrypted keys: import them
671
+ try {
672
+ await this.importBackedUpRoomKeys(currentChunk, backupVersion);
673
+ totalImported += currentChunk.length;
674
+ } catch (e) {
675
+ totalFailures += currentChunk.length;
676
+ // We failed to import some keys, but we should still try to import the rest?
677
+ // Log the error and continue
678
+ this.logger.error("Error importing keys from backup", e);
679
+ }
680
+ opts?.progressCallback?.({
705
681
  total: totalKeyCount,
706
682
  successes: totalImported,
707
683
  stage: ImportRoomKeyStage.LoadKeys,
708
684
  failures: totalFailures
709
685
  });
710
-
711
- /**
712
- * This method is called when we have enough chunks to decrypt.
713
- * It will decrypt the chunks and try to import the room keys.
714
- * @param roomChunks
715
- */
716
- var handleChunkCallback = /*#__PURE__*/function () {
717
- var _ref2 = _asyncToGenerator(function* (roomChunks) {
718
- var _opts$progressCallbac4;
719
- var currentChunk = [];
720
- var _loop = function* _loop(roomId) {
721
- // Decrypt the sessions for the given room
722
- var decryptedSessions = yield backupDecryptor.decryptSessions(roomChunks.get(roomId));
723
- // Add the decrypted sessions to the current chunk
724
- decryptedSessions.forEach(session => {
725
- // We set the room_id for each session
726
- session.room_id = roomId;
727
- currentChunk.push(session);
728
- });
729
- };
730
- for (var roomId of roomChunks.keys()) {
731
- yield* _loop(roomId);
732
- }
733
-
734
- // We have a chunk of decrypted keys: import them
735
- try {
736
- yield _this18.importBackedUpRoomKeys(currentChunk, backupVersion);
737
- totalImported += currentChunk.length;
738
- } catch (e) {
739
- totalFailures += currentChunk.length;
740
- // We failed to import some keys, but we should still try to import the rest?
741
- // Log the error and continue
742
- _this18.logger.error("Error importing keys from backup", e);
743
- }
744
- opts === null || opts === void 0 || (_opts$progressCallbac4 = opts.progressCallback) === null || _opts$progressCallbac4 === void 0 || _opts$progressCallbac4.call(opts, {
745
- total: totalKeyCount,
746
- successes: totalImported,
747
- stage: ImportRoomKeyStage.LoadKeys,
748
- failures: totalFailures
749
- });
750
- });
751
- return function handleChunkCallback(_x) {
752
- return _ref2.apply(this, arguments);
753
- };
754
- }();
755
- var groupChunkCount = 0;
756
- var chunkGroupByRoom = new Map();
757
-
758
- // Iterate over the rooms and sessions to group them in chunks
759
- // And we call the handleChunkCallback when we have enough chunks to decrypt
760
- for (var _ref5 of Object.entries(keyBackup.rooms)) {
761
- var _ref4 = _slicedToArray(_ref5, 2);
762
- var roomId = _ref4[0];
763
- var roomData = _ref4[1];
764
- // If there are no sessions for the room, skip it
765
- if (!roomData.sessions) continue;
766
-
767
- // Initialize a new chunk group for the current room
768
- chunkGroupByRoom.set(roomId, {});
769
- for (var _ref8 of Object.entries(roomData.sessions)) {
770
- var _ref7 = _slicedToArray(_ref8, 2);
771
- var sessionId = _ref7[0];
772
- var session = _ref7[1];
773
- // We set previously the chunk group for the current room, so we can safely get it
774
- var sessionsForRoom = chunkGroupByRoom.get(roomId);
775
- sessionsForRoom[sessionId] = session;
776
- groupChunkCount += 1;
777
- // If we have enough chunks to decrypt, call the block callback
778
- if (groupChunkCount >= CHUNK_SIZE) {
779
- // We have enough chunks to decrypt
780
- yield handleChunkCallback(chunkGroupByRoom);
781
- // Reset the chunk group
782
- chunkGroupByRoom = new Map();
783
- // There might be remaining keys for that room, so add back an entry for the current room.
784
- chunkGroupByRoom.set(roomId, {});
785
- groupChunkCount = 0;
786
- }
686
+ };
687
+ let groupChunkCount = 0;
688
+ let chunkGroupByRoom = new Map();
689
+
690
+ // Iterate over the rooms and sessions to group them in chunks
691
+ // And we call the handleChunkCallback when we have enough chunks to decrypt
692
+ for (const [roomId, roomData] of Object.entries(keyBackup.rooms)) {
693
+ // If there are no sessions for the room, skip it
694
+ if (!roomData.sessions) continue;
695
+
696
+ // Initialize a new chunk group for the current room
697
+ chunkGroupByRoom.set(roomId, {});
698
+ for (const [sessionId, session] of Object.entries(roomData.sessions)) {
699
+ // We set previously the chunk group for the current room, so we can safely get it
700
+ const sessionsForRoom = chunkGroupByRoom.get(roomId);
701
+ sessionsForRoom[sessionId] = session;
702
+ groupChunkCount += 1;
703
+ // If we have enough chunks to decrypt, call the block callback
704
+ if (groupChunkCount >= CHUNK_SIZE) {
705
+ // We have enough chunks to decrypt
706
+ await handleChunkCallback(chunkGroupByRoom);
707
+ // Reset the chunk group
708
+ chunkGroupByRoom = new Map();
709
+ // There might be remaining keys for that room, so add back an entry for the current room.
710
+ chunkGroupByRoom.set(roomId, {});
711
+ groupChunkCount = 0;
787
712
  }
788
713
  }
714
+ }
789
715
 
790
- // Handle remaining chunk if needed
791
- if (groupChunkCount > 0) {
792
- yield handleChunkCallback(chunkGroupByRoom);
793
- }
794
- return {
795
- total: totalKeyCount,
796
- imported: totalImported
797
- };
798
- })();
716
+ // Handle remaining chunk if needed
717
+ if (groupChunkCount > 0) {
718
+ await handleChunkCallback(chunkGroupByRoom);
719
+ }
720
+ return {
721
+ total: totalKeyCount,
722
+ imported: totalImported
723
+ };
799
724
  }
800
725
 
801
726
  /**
@@ -806,12 +731,11 @@ export class RustBackupManager extends TypedEventEmitter {
806
731
  * @returns `true` if the private key can decrypt the backup, `false` otherwise.
807
732
  */
808
733
  backupInfoMatchesBackupDecryptionKey(info, backupDecryptionKey) {
809
- var _info$auth_data;
810
734
  if (info.algorithm !== "m.megolm_backup.v1.curve25519-aes-sha2") {
811
735
  this.logger.warn("backupMatchesPrivateKey: Unsupported backup algorithm", info.algorithm);
812
736
  return false;
813
737
  }
814
- return ((_info$auth_data = info.auth_data) === null || _info$auth_data === void 0 ? void 0 : _info$auth_data.public_key) === backupDecryptionKey.megolmV1PublicKey.publicKeyBase64;
738
+ return info.auth_data?.public_key === backupDecryptionKey.megolmV1PublicKey.publicKeyBase64;
815
739
  }
816
740
  }
817
741
  /**
@@ -819,6 +743,8 @@ export class RustBackupManager extends TypedEventEmitter {
819
743
  */
820
744
  export class RustBackupDecryptor {
821
745
  constructor(logger, decryptionKey) {
746
+ _defineProperty(this, "decryptionKey", void 0);
747
+ _defineProperty(this, "sourceTrusted", void 0);
822
748
  this.logger = logger;
823
749
  this.decryptionKey = decryptionKey;
824
750
  this.sourceTrusted = false;
@@ -827,24 +753,18 @@ export class RustBackupDecryptor {
827
753
  /**
828
754
  * Implements {@link BackupDecryptor#decryptSessions}
829
755
  */
830
- decryptSessions(ciphertexts) {
831
- var _this19 = this;
832
- return _asyncToGenerator(function* () {
833
- var keys = [];
834
- for (var _ref1 of Object.entries(ciphertexts)) {
835
- var _ref0 = _slicedToArray(_ref1, 2);
836
- var sessionId = _ref0[0];
837
- var sessionData = _ref0[1];
838
- try {
839
- var decrypted = JSON.parse(_this19.decryptionKey.decryptV1(sessionData.session_data.ephemeral, sessionData.session_data.mac, sessionData.session_data.ciphertext));
840
- decrypted.session_id = sessionId;
841
- keys.push(decrypted);
842
- } catch (e) {
843
- _this19.logger.debug("Failed to decrypt megolm session from backup", e, sessionData);
844
- }
756
+ async decryptSessions(ciphertexts) {
757
+ const keys = [];
758
+ for (const [sessionId, sessionData] of Object.entries(ciphertexts)) {
759
+ try {
760
+ const decrypted = JSON.parse(this.decryptionKey.decryptV1(sessionData.session_data.ephemeral, sessionData.session_data.mac, sessionData.session_data.ciphertext));
761
+ decrypted.session_id = sessionId;
762
+ keys.push(decrypted);
763
+ } catch (e) {
764
+ this.logger.debug("Failed to decrypt megolm session from backup", e, sessionData);
845
765
  }
846
- return keys;
847
- })();
766
+ }
767
+ return keys;
848
768
  }
849
769
 
850
770
  /**
@@ -868,8 +788,21 @@ export class RustBackupDecryptor {
868
788
  * @param version - the specific version of the backup info to fetch
869
789
  * @returns The key backup info or null if there is no backup.
870
790
  */
871
- export function requestKeyBackupVersion(_x2, _x3) {
872
- return _requestKeyBackupVersion.apply(this, arguments);
791
+ export async function requestKeyBackupVersion(http, version) {
792
+ try {
793
+ const path = version ? encodeUri("/room_keys/version/$version", {
794
+ $version: version
795
+ }) : "/room_keys/version";
796
+ return await http.authedRequest(Method.Get, path, undefined, undefined, {
797
+ prefix: ClientPrefix.V3
798
+ });
799
+ } catch (e) {
800
+ if (e.errcode === "M_NOT_FOUND") {
801
+ return null;
802
+ } else {
803
+ throw e;
804
+ }
805
+ }
873
806
  }
874
807
 
875
808
  /**
@@ -879,27 +812,8 @@ export function requestKeyBackupVersion(_x2, _x3) {
879
812
  * @param keyBackupInfo - The key backup info to check against.
880
813
  * @returns `true` if the decryption key matches the key backup info, `false` otherwise.
881
814
  */
882
- function _requestKeyBackupVersion() {
883
- _requestKeyBackupVersion = _asyncToGenerator(function* (http, version) {
884
- try {
885
- var path = version ? encodeUri("/room_keys/version/$version", {
886
- $version: version
887
- }) : "/room_keys/version";
888
- return yield http.authedRequest(Method.Get, path, undefined, undefined, {
889
- prefix: ClientPrefix.V3
890
- });
891
- } catch (e) {
892
- if (e.errcode === "M_NOT_FOUND") {
893
- return null;
894
- } else {
895
- throw e;
896
- }
897
- }
898
- });
899
- return _requestKeyBackupVersion.apply(this, arguments);
900
- }
901
815
  export function decryptionKeyMatchesKeyBackupInfo(decryptionKey, keyBackupInfo) {
902
- var authData = keyBackupInfo.auth_data;
816
+ const authData = keyBackupInfo.auth_data;
903
817
  return authData.public_key === decryptionKey.megolmV1PublicKey.publicKeyBase64;
904
818
  }
905
819
 
@@ -909,9 +823,10 @@ export function decryptionKeyMatchesKeyBackupInfo(decryptionKey, keyBackupInfo)
909
823
  * @returns The total number of keys in the backup.
910
824
  */
911
825
  function countKeysInBackup(keyBackup) {
912
- var count = 0;
913
- for (var _ref11 of Object.values(keyBackup.rooms)) {
914
- var sessions = _ref11.sessions;
826
+ let count = 0;
827
+ for (const {
828
+ sessions
829
+ } of Object.values(keyBackup.rooms)) {
915
830
  count += Object.keys(sessions).length;
916
831
  }
917
832
  return count;