@openclaw/matrix 2026.7.1-beta.1 → 2026.7.1-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{account-selection-Bv_ZuOu4.js → account-selection-5e4mHR1m.js} +1 -1
- package/dist/api.js +5 -5
- package/dist/{approval-handler.runtime-GpL8SxX2.js → approval-handler.runtime-DI5x9r8I.js} +5 -5
- package/dist/{approval-ids-DIKCZewR.js → approval-ids-ZgqbspmS.js} +1 -1
- package/dist/{approval-reaction-auth-DhBxqiQQ.js → approval-reaction-auth-D9LijQhr.js} +2 -2
- package/dist/{approval-reactions-BRGQgOu2.js → approval-reactions-BdUaUXVw.js} +24 -73
- package/dist/auth-presence.js +1 -1
- package/dist/{channel-CGc6D4tf.js → channel-jUTBsjHU.js} +21 -23
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-CPu_uwsn.js → channel.runtime-DO1Nv9ed.js} +26 -17
- package/dist/{cli-BfwYmyEc.js → cli-CEfWwCKx.js} +10 -17
- package/dist/{cli-metadata-FO-fJqf0.js → cli-metadata-CfiEO-CE.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{client-CVluBRDh.js → client-FRuyCNju.js} +2 -2
- package/dist/{client-bootstrap-1cbA9aSs.js → client-bootstrap-DjFJ7e0N.js} +6 -10
- package/dist/{client-Cb5ILtpE.js → client-tgnlQJk4.js} +2 -2
- package/dist/{config-schema-DFRmUTAG.js → config-schema-DtnhNYd-.js} +1 -1
- package/dist/contract-api.js +2 -2
- package/dist/{create-client-8YNurIAr.js → create-client-CNakT7zF.js} +7 -10
- package/dist/{credentials-G8lNmiME.js → credentials-Ds9V1mn2.js} +1 -1
- package/dist/{credentials-read-TzTOQPOM.js → credentials-read-BlkvsNFg.js} +1 -1
- package/dist/{credentials-write.runtime-cZhhyGAZ.js → credentials-write.runtime-CTqqxcut.js} +2 -5
- package/dist/{crypto-runtime-hMMmqNr1.js → crypto-runtime-B74cTS6A.js} +11 -9
- package/dist/{crypto-state-store-DK2tcEyP.js → crypto-state-store-Jy3qwhdy.js} +1 -1
- package/dist/{deps-D3bkh48_.js → deps-CdjHvnmh.js} +20 -2
- package/dist/{directory-live-pjbvjDz2.js → directory-live-Ufd4qSpX.js} +2 -2
- package/dist/{doctor-BRSDNU5C.js → doctor-DfaOqFtr.js} +3 -3
- package/dist/{doctor-contract-Dq8OZWHF.js → doctor-contract-BAja_fmb.js} +1 -1
- package/dist/doctor-contract-api.js +8 -14
- package/dist/{draft-stream-Djasj65z.js → draft-stream-D4EH25gv.js} +1 -1
- package/dist/{encryption-guidance-Bg3IRYoX.js → encryption-guidance-D8walY04.js} +1 -1
- package/dist/{file-sync-store-BWLVB01Y.js → file-sync-store-DVm0ACml.js} +3 -3
- package/dist/helper-api.js +1 -1
- package/dist/{idb-persistence-BGY1CJ7J.js → idb-persistence-BHm97th-.js} +1 -1
- package/dist/index.js +3 -6
- package/dist/{legacy-crypto-inspector-D_8iylBq.js → legacy-crypto-inspector-vzXSkm18.js} +1 -1
- package/dist/{legacy-crypto-restore-B0gcIEkE.js → legacy-crypto-restore-CIBfOmLn.js} +2 -2
- package/dist/{matrix-migration.runtime-Ctlb_rZl.js → matrix-migration.runtime-BMCyrANT.js} +3 -3
- package/dist/{media-text-CUFW_BP5.js → media-text-p-LP21qs.js} +1 -1
- package/dist/{messages-C1dIZHKy.js → messages-DRKkiEY-.js} +6 -5
- package/dist/{monitor-BMGnvIbg.js → monitor-CsGOGdwu.js} +89 -119
- package/dist/plugin-entry.handlers.runtime.js +2 -5
- package/dist/probe.runtime-2MZLc6ng.js +3 -0
- package/dist/{profile-update-BaEk4COs.js → profile-update-Ucc8RrJL.js} +2 -2
- package/dist/{reaction-events-n69MjKzG.js → reaction-events-DentrVii.js} +5 -12
- package/dist/{recovery-key-store-BGk8c_gf.js → recovery-key-store-DSeLFvNx.js} +1 -1
- package/dist/{resolve-targets-DyGW9WzC.js → resolve-targets-DcV_KfgX.js} +1 -1
- package/dist/{resolver.runtime-DhZV369r.js → resolver.runtime-Hr6bO5zl.js} +1 -1
- package/dist/runtime-api.js +2 -2
- package/dist/runtime-heavy-api.js +1 -1
- package/dist/{sdk-DOxaiBRE.js → sdk-AZYVl34z.js} +12 -13
- package/dist/{send-C0NwpZ-c.js → send-D92v6Yy0.js} +22 -12
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/{setup-bootstrap-DbWPVINS.js → setup-bootstrap-Da564w5f.js} +2 -2
- package/dist/{setup-core-DVkrIoax.js → setup-core-BGgbrdaJ.js} +5 -8
- package/dist/setup-plugin-api.js +3 -3
- package/dist/{setup-surface-CN7DEvpg.js → setup-surface-iJ6pd-t5.js} +6 -6
- package/dist/{shared-iLI-9tb9.js → shared-DkFfq7mH.js} +16 -32
- package/dist/{startup-verification-Bd31KqLv.js → startup-verification-BKMAXvcV.js} +2 -2
- package/dist/{storage-t5S-5c_5.js → storage-CQdyKcGg.js} +5 -5
- package/dist/subagent-hooks-api.js +2 -5
- package/dist/{thread-bindings-D73QFTXW.js → thread-bindings-BX5nmWpw.js} +3 -3
- package/dist/{tool-actions.runtime-BCCPq_aO.js → tool-actions.runtime-C1d5fxE_.js} +12 -12
- package/dist/{verification-C0KvXyHK.js → verification-BGCMiO1p.js} +2 -2
- package/node_modules/@babel/runtime/package.json +468 -1089
- package/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/.cargo/config.toml +2 -0
- package/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/CHANGELOG.md +12 -3
- package/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/README.md +17 -0
- package/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/download-lib.js +10 -2
- package/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/package.json +1 -1
- package/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/xtask/.idea/modules.xml +8 -0
- package/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/xtask/.idea/vcs.xml +6 -0
- package/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/xtask/.idea/xtask.iml +11 -0
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/package.json +1 -1
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.cjs +28 -28
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.js +24 -24
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm +0 -0
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm.d.ts +58 -58
- package/node_modules/content-type/README.md +32 -57
- package/node_modules/content-type/dist/index.d.ts +26 -0
- package/node_modules/content-type/dist/index.js +170 -0
- package/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/content-type/package.json +35 -25
- package/node_modules/linkify-it/README.md +3 -4
- package/node_modules/linkify-it/build/index.cjs.js +44 -41
- package/node_modules/linkify-it/index.mjs +10 -11
- package/node_modules/linkify-it/lib/re.mjs +34 -30
- package/node_modules/linkify-it/package.json +10 -15
- package/node_modules/markdown-it/dist/index.cjs.js +3652 -5378
- package/node_modules/markdown-it/dist/index.cjs.js.map +1 -0
- package/node_modules/markdown-it/dist/markdown-it.js +1399 -4479
- package/node_modules/markdown-it/dist/markdown-it.js.map +1 -0
- package/node_modules/markdown-it/dist/markdown-it.min.js +3 -2
- package/node_modules/markdown-it/dist/markdown-it.min.js.map +1 -0
- package/node_modules/markdown-it/lib/common/html_re.mjs +9 -9
- package/node_modules/markdown-it/lib/common/utils.mjs +2 -11
- package/node_modules/markdown-it/lib/parser_block.mjs +9 -9
- package/node_modules/markdown-it/lib/parser_core.mjs +7 -7
- package/node_modules/markdown-it/lib/parser_inline.mjs +16 -16
- package/node_modules/markdown-it/lib/renderer.mjs +2 -2
- package/node_modules/markdown-it/lib/rules_block/blockquote.mjs +6 -6
- package/node_modules/markdown-it/lib/rules_block/code.mjs +2 -2
- package/node_modules/markdown-it/lib/rules_block/fence.mjs +4 -4
- package/node_modules/markdown-it/lib/rules_block/heading.mjs +7 -7
- package/node_modules/markdown-it/lib/rules_block/hr.mjs +2 -2
- package/node_modules/markdown-it/lib/rules_block/html_block.mjs +6 -6
- package/node_modules/markdown-it/lib/rules_block/lheading.mjs +8 -8
- package/node_modules/markdown-it/lib/rules_block/list.mjs +6 -6
- package/node_modules/markdown-it/lib/rules_block/paragraph.mjs +5 -5
- package/node_modules/markdown-it/lib/rules_block/reference.mjs +1 -1
- package/node_modules/markdown-it/lib/rules_block/state_block.mjs +6 -6
- package/node_modules/markdown-it/lib/rules_block/table.mjs +4 -4
- package/node_modules/markdown-it/lib/rules_core/block.mjs +3 -3
- package/node_modules/markdown-it/lib/rules_core/linkify.mjs +15 -15
- package/node_modules/markdown-it/lib/rules_core/normalize.mjs +2 -2
- package/node_modules/markdown-it/lib/rules_inline/autolink.mjs +17 -17
- package/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs +2 -2
- package/node_modules/markdown-it/lib/rules_inline/emphasis.mjs +8 -8
- package/node_modules/markdown-it/lib/rules_inline/entity.mjs +7 -7
- package/node_modules/markdown-it/lib/rules_inline/escape.mjs +15 -1
- package/node_modules/markdown-it/lib/rules_inline/html_inline.mjs +1 -1
- package/node_modules/markdown-it/lib/rules_inline/link.mjs +1 -1
- package/node_modules/markdown-it/lib/rules_inline/state_inline.mjs +2 -2
- package/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs +10 -10
- package/node_modules/markdown-it/lib/token.mjs +12 -12
- package/node_modules/markdown-it/package.json +25 -34
- package/node_modules/matrix-js-sdk/CHANGELOG.md +24 -0
- package/node_modules/matrix-js-sdk/README.md +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/AESEncryptedSecretStoragePayload.js +3 -1
- package/node_modules/matrix-js-sdk/lib/@types/IIdentityServerProvider.js +3 -1
- package/node_modules/matrix-js-sdk/lib/@types/PushRules.js +7 -7
- package/node_modules/matrix-js-sdk/lib/@types/PushRules.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/auth.js +4 -4
- package/node_modules/matrix-js-sdk/lib/@types/auth.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/beacon.js +2 -2
- package/node_modules/matrix-js-sdk/lib/@types/beacon.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/common.js +3 -1
- package/node_modules/matrix-js-sdk/lib/@types/crypto.js +3 -1
- package/node_modules/matrix-js-sdk/lib/@types/event.d.ts +6 -1
- package/node_modules/matrix-js-sdk/lib/@types/event.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/event.js +23 -20
- package/node_modules/matrix-js-sdk/lib/@types/event.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/events.js +3 -1
- package/node_modules/matrix-js-sdk/lib/@types/extensible_events.js +6 -6
- package/node_modules/matrix-js-sdk/lib/@types/extensible_events.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/global.d.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/json.js +3 -1
- package/node_modules/matrix-js-sdk/lib/@types/local_notifications.js +3 -1
- package/node_modules/matrix-js-sdk/lib/@types/location.js +4 -4
- package/node_modules/matrix-js-sdk/lib/@types/location.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/matrix-sdk-crypto-wasm.d.js +3 -1
- package/node_modules/matrix-js-sdk/lib/@types/media.js +3 -1
- package/node_modules/matrix-js-sdk/lib/@types/membership.js +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/membership.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/partials.js +6 -6
- package/node_modules/matrix-js-sdk/lib/@types/partials.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/polls.js +5 -5
- package/node_modules/matrix-js-sdk/lib/@types/polls.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/read_receipts.js +2 -2
- package/node_modules/matrix-js-sdk/lib/@types/read_receipts.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/registration.js +3 -1
- package/node_modules/matrix-js-sdk/lib/@types/requests.js +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/requests.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/retention.d.ts +15 -0
- package/node_modules/matrix-js-sdk/lib/@types/retention.d.ts.map +1 -0
- package/node_modules/matrix-js-sdk/lib/@types/retention.js +13 -0
- package/node_modules/matrix-js-sdk/lib/@types/retention.js.map +1 -0
- package/node_modules/matrix-js-sdk/lib/@types/search.js +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/search.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/signed.js +3 -1
- package/node_modules/matrix-js-sdk/lib/@types/spaces.js +3 -1
- package/node_modules/matrix-js-sdk/lib/@types/state_events.js +3 -1
- package/node_modules/matrix-js-sdk/lib/@types/synapse.js +3 -1
- package/node_modules/matrix-js-sdk/lib/@types/sync.js +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/sync.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/threepids.js +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/threepids.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/topic.js +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/topic.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/@types/uia.js +3 -1
- package/node_modules/matrix-js-sdk/lib/NamespacedValue.js +8 -8
- package/node_modules/matrix-js-sdk/lib/NamespacedValue.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/ReEmitter.js +8 -15
- package/node_modules/matrix-js-sdk/lib/ReEmitter.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/ToDeviceMessageQueue.js +47 -55
- package/node_modules/matrix-js-sdk/lib/ToDeviceMessageQueue.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/autodiscovery.js +233 -247
- package/node_modules/matrix-js-sdk/lib/autodiscovery.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/base64.js +1 -1
- package/node_modules/matrix-js-sdk/lib/base64.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/browser-index.d.ts +2 -2
- package/node_modules/matrix-js-sdk/lib/browser-index.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/browser-index.js +5 -5
- package/node_modules/matrix-js-sdk/lib/browser-index.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/capabilityPoller.d.ts +38 -0
- package/node_modules/matrix-js-sdk/lib/capabilityPoller.d.ts.map +1 -0
- package/node_modules/matrix-js-sdk/lib/capabilityPoller.js +93 -0
- package/node_modules/matrix-js-sdk/lib/capabilityPoller.js.map +1 -0
- package/node_modules/matrix-js-sdk/lib/client.d.ts +9 -8
- package/node_modules/matrix-js-sdk/lib/client.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/client.js +2123 -2483
- package/node_modules/matrix-js-sdk/lib/client.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/common-crypto/CryptoBackend.js +3 -1
- package/node_modules/matrix-js-sdk/lib/common-crypto/CryptoBackend.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/common-crypto/key-passphrase.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/content-helpers.js +43 -48
- package/node_modules/matrix-js-sdk/lib/content-helpers.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/content-repo.js +14 -24
- package/node_modules/matrix-js-sdk/lib/content-repo.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/crypto/store/base.js +6 -6
- package/node_modules/matrix-js-sdk/lib/crypto/store/base.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/crypto/store/indexeddb-crypto-store-backend.js +189 -237
- package/node_modules/matrix-js-sdk/lib/crypto/store/indexeddb-crypto-store-backend.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/crypto/store/indexeddb-crypto-store.js +25 -28
- package/node_modules/matrix-js-sdk/lib/crypto/store/indexeddb-crypto-store.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/crypto/store/localStorage-crypto-store.js +113 -145
- package/node_modules/matrix-js-sdk/lib/crypto/store/localStorage-crypto-store.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/crypto/store/memory-crypto-store.js +74 -105
- package/node_modules/matrix-js-sdk/lib/crypto/store/memory-crypto-store.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/crypto-api/CryptoEvent.js +1 -1
- package/node_modules/matrix-js-sdk/lib/crypto-api/CryptoEvent.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/crypto-api/CryptoEventHandlerMap.js +3 -1
- package/node_modules/matrix-js-sdk/lib/crypto-api/index.d.ts +15 -6
- package/node_modules/matrix-js-sdk/lib/crypto-api/index.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/crypto-api/index.js +76 -76
- package/node_modules/matrix-js-sdk/lib/crypto-api/index.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/crypto-api/key-passphrase.js +15 -23
- package/node_modules/matrix-js-sdk/lib/crypto-api/key-passphrase.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/crypto-api/keybackup.js +3 -1
- package/node_modules/matrix-js-sdk/lib/crypto-api/recovery-key.js +11 -12
- package/node_modules/matrix-js-sdk/lib/crypto-api/recovery-key.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/crypto-api/verification.js +3 -3
- package/node_modules/matrix-js-sdk/lib/crypto-api/verification.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/digest.js +7 -14
- package/node_modules/matrix-js-sdk/lib/digest.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/embedded.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/embedded.js +379 -500
- package/node_modules/matrix-js-sdk/lib/embedded.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/errors.js +2 -2
- package/node_modules/matrix-js-sdk/lib/errors.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/event-mapper.js +10 -12
- package/node_modules/matrix-js-sdk/lib/event-mapper.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/extensible_events_v1/ExtensibleEvent.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/extensible_events_v1/InvalidEventError.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/extensible_events_v1/MessageEvent.js +26 -28
- package/node_modules/matrix-js-sdk/lib/extensible_events_v1/MessageEvent.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/extensible_events_v1/PollEndEvent.js +11 -12
- package/node_modules/matrix-js-sdk/lib/extensible_events_v1/PollEndEvent.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/extensible_events_v1/PollResponseEvent.js +6 -6
- package/node_modules/matrix-js-sdk/lib/extensible_events_v1/PollResponseEvent.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/extensible_events_v1/PollStartEvent.js +36 -38
- package/node_modules/matrix-js-sdk/lib/extensible_events_v1/PollStartEvent.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/extensible_events_v1/utilities.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/feature.js +18 -31
- package/node_modules/matrix-js-sdk/lib/feature.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/filter-component.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/filter-component.js +20 -26
- package/node_modules/matrix-js-sdk/lib/filter-component.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/filter.js +14 -15
- package/node_modules/matrix-js-sdk/lib/filter.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/http-api/errors.js +41 -56
- package/node_modules/matrix-js-sdk/lib/http-api/errors.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/http-api/fetch.js +140 -157
- package/node_modules/matrix-js-sdk/lib/http-api/fetch.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/http-api/index.js +17 -20
- package/node_modules/matrix-js-sdk/lib/http-api/index.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/http-api/interface.js +1 -1
- package/node_modules/matrix-js-sdk/lib/http-api/interface.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/http-api/method.js +1 -1
- package/node_modules/matrix-js-sdk/lib/http-api/method.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/http-api/prefix.js +3 -3
- package/node_modules/matrix-js-sdk/lib/http-api/prefix.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/http-api/refresh.js +80 -99
- package/node_modules/matrix-js-sdk/lib/http-api/refresh.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/http-api/utils.d.ts +1 -1
- package/node_modules/matrix-js-sdk/lib/http-api/utils.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/http-api/utils.js +35 -47
- package/node_modules/matrix-js-sdk/lib/http-api/utils.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/index.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/indexeddb-helpers.js +3 -3
- package/node_modules/matrix-js-sdk/lib/indexeddb-helpers.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/indexeddb-worker.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/interactive-auth.d.ts +5 -5
- package/node_modules/matrix-js-sdk/lib/interactive-auth.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/interactive-auth.js +181 -203
- package/node_modules/matrix-js-sdk/lib/interactive-auth.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/logger.js +22 -56
- package/node_modules/matrix-js-sdk/lib/logger.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrix.d.ts +1 -0
- package/node_modules/matrix-js-sdk/lib/matrix.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrix.js +8 -11
- package/node_modules/matrix-js-sdk/lib/matrix.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/CallMembership.js +83 -76
- package/node_modules/matrix-js-sdk/lib/matrixrtc/CallMembership.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/EncryptionManager.js +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/EncryptionManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/IKeyTransport.js +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/IKeyTransport.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/IMembershipManager.js +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/IMembershipManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.d.ts +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.js +4 -4
- package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.js +144 -184
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSessionManager.js +35 -39
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSessionManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.d.ts +2 -0
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.js +346 -383
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManagerActionScheduler.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManagerActionScheduler.js +54 -59
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManagerActionScheduler.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.js +117 -139
- package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/ToDeviceKeyTransport.js +49 -54
- package/node_modules/matrix-js-sdk/lib/matrixrtc/ToDeviceKeyTransport.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/index.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/common.js +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/common.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/index.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/rtc.js +15 -23
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/rtc.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/session.js +4 -5
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/session.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/types.js +4 -6
- package/node_modules/matrix-js-sdk/lib/matrixrtc/types.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/utils.js +4 -11
- package/node_modules/matrix-js-sdk/lib/matrixrtc/utils.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/MSC3089Branch.js +91 -116
- package/node_modules/matrix-js-sdk/lib/models/MSC3089Branch.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/MSC3089TreeSpace.js +209 -244
- package/node_modules/matrix-js-sdk/lib/models/MSC3089TreeSpace.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/ToDeviceMessage.js +3 -1
- package/node_modules/matrix-js-sdk/lib/models/beacon.js +20 -15
- package/node_modules/matrix-js-sdk/lib/models/beacon.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/compare-event-ordering.js +13 -13
- package/node_modules/matrix-js-sdk/lib/models/compare-event-ordering.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/device.js +10 -3
- package/node_modules/matrix-js-sdk/lib/models/device.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/event-context.js +5 -7
- package/node_modules/matrix-js-sdk/lib/models/event-context.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/event-status.js +1 -1
- package/node_modules/matrix-js-sdk/lib/models/event-status.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/event-timeline-set.js +91 -91
- package/node_modules/matrix-js-sdk/lib/models/event-timeline-set.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/event-timeline.js +31 -29
- package/node_modules/matrix-js-sdk/lib/models/event-timeline.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/event.js +215 -235
- package/node_modules/matrix-js-sdk/lib/models/event.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/invites-ignorer-types.js +4 -4
- package/node_modules/matrix-js-sdk/lib/models/invites-ignorer-types.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/invites-ignorer.js +159 -179
- package/node_modules/matrix-js-sdk/lib/models/invites-ignorer.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/poll.js +72 -78
- package/node_modules/matrix-js-sdk/lib/models/poll.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/profile-keys.js +2 -2
- package/node_modules/matrix-js-sdk/lib/models/profile-keys.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/read-receipt.js +40 -56
- package/node_modules/matrix-js-sdk/lib/models/read-receipt.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/related-relations.js +2 -0
- package/node_modules/matrix-js-sdk/lib/models/related-relations.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/relations-container.js +20 -21
- package/node_modules/matrix-js-sdk/lib/models/relations-container.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/relations.js +131 -156
- package/node_modules/matrix-js-sdk/lib/models/relations.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room-member.js +44 -27
- package/node_modules/matrix-js-sdk/lib/models/room-member.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room-receipts.js +48 -55
- package/node_modules/matrix-js-sdk/lib/models/room-receipts.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room-retention.d.ts +28 -0
- package/node_modules/matrix-js-sdk/lib/models/room-retention.d.ts.map +1 -0
- package/node_modules/matrix-js-sdk/lib/models/room-retention.js +192 -0
- package/node_modules/matrix-js-sdk/lib/models/room-retention.js.map +1 -0
- package/node_modules/matrix-js-sdk/lib/models/room-state.js +141 -170
- package/node_modules/matrix-js-sdk/lib/models/room-state.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.d.ts +1 -0
- package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.js +46 -65
- package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room-summary.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room.d.ts +2 -1
- package/node_modules/matrix-js-sdk/lib/models/room.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room.js +800 -887
- package/node_modules/matrix-js-sdk/lib/models/room.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/search-result.js +5 -5
- package/node_modules/matrix-js-sdk/lib/models/search-result.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/thread.js +267 -283
- package/node_modules/matrix-js-sdk/lib/models/thread.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/typed-event-emitter.js +7 -18
- package/node_modules/matrix-js-sdk/lib/models/typed-event-emitter.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/user.js +26 -7
- package/node_modules/matrix-js-sdk/lib/models/user.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/oidc/authorize.js +208 -241
- package/node_modules/matrix-js-sdk/lib/oidc/authorize.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/oidc/discovery.js +23 -36
- package/node_modules/matrix-js-sdk/lib/oidc/discovery.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/oidc/error.js +1 -1
- package/node_modules/matrix-js-sdk/lib/oidc/error.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/oidc/index.js +1 -0
- package/node_modules/matrix-js-sdk/lib/oidc/index.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/oidc/register.js +60 -66
- package/node_modules/matrix-js-sdk/lib/oidc/register.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/oidc/tokenRefresher.js +83 -94
- package/node_modules/matrix-js-sdk/lib/oidc/tokenRefresher.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/oidc/validate.js +18 -18
- package/node_modules/matrix-js-sdk/lib/oidc/validate.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/pushprocessor.js +70 -81
- package/node_modules/matrix-js-sdk/lib/pushprocessor.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/randomstring.js +9 -9
- package/node_modules/matrix-js-sdk/lib/randomstring.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/realtime-callbacks.js +25 -28
- package/node_modules/matrix-js-sdk/lib/realtime-callbacks.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/receipt-accumulator.d.ts +2 -0
- package/node_modules/matrix-js-sdk/lib/receipt-accumulator.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/receipt-accumulator.js +14 -22
- package/node_modules/matrix-js-sdk/lib/receipt-accumulator.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/MSC4108SignInWithQR.js +272 -298
- package/node_modules/matrix-js-sdk/lib/rendezvous/MSC4108SignInWithQR.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousChannel.js +3 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousCode.js +3 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousError.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousFailureReason.js +2 -2
- package/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousFailureReason.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousIntent.js +1 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousIntent.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousTransport.js +3 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/channels/MSC4108SecureChannel.js +122 -144
- package/node_modules/matrix-js-sdk/lib/rendezvous/channels/MSC4108SecureChannel.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/index.js +44 -69
- package/node_modules/matrix-js-sdk/lib/rendezvous/index.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts +1 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC4108RendezvousSession.js +142 -152
- package/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC4108RendezvousSession.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/retentionPolicy.d.ts +33 -0
- package/node_modules/matrix-js-sdk/lib/retentionPolicy.d.ts.map +1 -0
- package/node_modules/matrix-js-sdk/lib/retentionPolicy.js +39 -0
- package/node_modules/matrix-js-sdk/lib/retentionPolicy.js.map +1 -0
- package/node_modules/matrix-js-sdk/lib/room-hierarchy.js +52 -56
- package/node_modules/matrix-js-sdk/lib/room-hierarchy.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/CrossSigningIdentity.js +94 -104
- package/node_modules/matrix-js-sdk/lib/rust-crypto/CrossSigningIdentity.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/DehydratedDeviceManager.js +158 -190
- package/node_modules/matrix-js-sdk/lib/rust-crypto/DehydratedDeviceManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/KeyClaimManager.js +17 -20
- package/node_modules/matrix-js-sdk/lib/rust-crypto/KeyClaimManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/OutgoingRequestProcessor.js +109 -139
- package/node_modules/matrix-js-sdk/lib/rust-crypto/OutgoingRequestProcessor.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/OutgoingRequestsManager.js +72 -86
- package/node_modules/matrix-js-sdk/lib/rust-crypto/OutgoingRequestsManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/PerSessionKeyBackupDownloader.js +195 -221
- package/node_modules/matrix-js-sdk/lib/rust-crypto/PerSessionKeyBackupDownloader.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/RoomEncryptor.js +121 -137
- package/node_modules/matrix-js-sdk/lib/rust-crypto/RoomEncryptor.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/backup.d.ts +7 -2
- package/node_modules/matrix-js-sdk/lib/rust-crypto/backup.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/backup.js +459 -544
- package/node_modules/matrix-js-sdk/lib/rust-crypto/backup.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/constants.js +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/constants.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/device-converter.js +15 -28
- package/node_modules/matrix-js-sdk/lib/rust-crypto/device-converter.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/index.js +103 -116
- package/node_modules/matrix-js-sdk/lib/rust-crypto/index.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/libolm_migration.js +303 -365
- package/node_modules/matrix-js-sdk/lib/rust-crypto/libolm_migration.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/rust-crypto.d.ts +5 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/rust-crypto.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/rust-crypto.js +1065 -1322
- package/node_modules/matrix-js-sdk/lib/rust-crypto/rust-crypto.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/secret-storage.js +12 -25
- package/node_modules/matrix-js-sdk/lib/rust-crypto/secret-storage.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/verification.js +134 -184
- package/node_modules/matrix-js-sdk/lib/rust-crypto/verification.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/scheduler.js +42 -17
- package/node_modules/matrix-js-sdk/lib/scheduler.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/secret-storage.js +179 -213
- package/node_modules/matrix-js-sdk/lib/secret-storage.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/serverCapabilities.d.ts +4 -23
- package/node_modules/matrix-js-sdk/lib/serverCapabilities.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/serverCapabilities.js +9 -62
- package/node_modules/matrix-js-sdk/lib/serverCapabilities.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/service-types.js +1 -1
- package/node_modules/matrix-js-sdk/lib/service-types.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/sliding-sync-sdk.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/sliding-sync-sdk.js +368 -421
- package/node_modules/matrix-js-sdk/lib/sliding-sync-sdk.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/sliding-sync.js +136 -167
- package/node_modules/matrix-js-sdk/lib/sliding-sync.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/store/index.d.ts +7 -0
- package/node_modules/matrix-js-sdk/lib/store/index.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/store/index.js +3 -1
- package/node_modules/matrix-js-sdk/lib/store/index.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.js +3 -1
- package/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.d.ts +1 -0
- package/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.js +197 -240
- package/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.d.ts +3 -1
- package/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.js +51 -59
- package/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.js +22 -22
- package/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/store/indexeddb.d.ts +7 -5
- package/node_modules/matrix-js-sdk/lib/store/indexeddb.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/store/indexeddb.js +63 -79
- package/node_modules/matrix-js-sdk/lib/store/indexeddb.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.js +2 -2
- package/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/store/memory.d.ts +1 -0
- package/node_modules/matrix-js-sdk/lib/store/memory.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/store/memory.js +38 -54
- package/node_modules/matrix-js-sdk/lib/store/memory.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/store/stub.d.ts +1 -0
- package/node_modules/matrix-js-sdk/lib/store/stub.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/store/stub.js +22 -32
- package/node_modules/matrix-js-sdk/lib/store/stub.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/sync-accumulator.d.ts +1 -0
- package/node_modules/matrix-js-sdk/lib/sync-accumulator.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/sync-accumulator.js +57 -65
- package/node_modules/matrix-js-sdk/lib/sync-accumulator.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/sync.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/sync.js +914 -991
- package/node_modules/matrix-js-sdk/lib/sync.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/testing.js +63 -105
- package/node_modules/matrix-js-sdk/lib/testing.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/thread-utils.js +1 -4
- package/node_modules/matrix-js-sdk/lib/thread-utils.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/timeline-window.js +90 -99
- package/node_modules/matrix-js-sdk/lib/timeline-window.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/types.js +1 -1
- package/node_modules/matrix-js-sdk/lib/types.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/utils/decryptAESSecretStorageItem.js +14 -25
- package/node_modules/matrix-js-sdk/lib/utils/decryptAESSecretStorageItem.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/utils/encryptAESSecretStorageItem.js +27 -38
- package/node_modules/matrix-js-sdk/lib/utils/encryptAESSecretStorageItem.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/utils/internal/deriveKeys.js +25 -32
- package/node_modules/matrix-js-sdk/lib/utils/internal/deriveKeys.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/utils/roomVersion.js +1 -1
- package/node_modules/matrix-js-sdk/lib/utils/roomVersion.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/utils.js +83 -135
- package/node_modules/matrix-js-sdk/lib/utils.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/version-support.js +3 -3
- package/node_modules/matrix-js-sdk/lib/version-support.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/audioContext.js +5 -6
- package/node_modules/matrix-js-sdk/lib/webrtc/audioContext.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/call.js +1123 -1256
- package/node_modules/matrix-js-sdk/lib/webrtc/call.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/callEventHandler.js +207 -214
- package/node_modules/matrix-js-sdk/lib/webrtc/callEventHandler.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/callEventTypes.js +2 -2
- package/node_modules/matrix-js-sdk/lib/webrtc/callEventTypes.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/callFeed.js +33 -20
- package/node_modules/matrix-js-sdk/lib/webrtc/callFeed.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/groupCall.js +521 -594
- package/node_modules/matrix-js-sdk/lib/webrtc/groupCall.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/groupCallEventHandler.js +58 -61
- package/node_modules/matrix-js-sdk/lib/webrtc/groupCallEventHandler.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/mediaHandler.js +203 -233
- package/node_modules/matrix-js-sdk/lib/webrtc/mediaHandler.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/callFeedStatsReporter.js +16 -20
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/callFeedStatsReporter.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/callStatsReportGatherer.js +65 -70
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/callStatsReportGatherer.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/callStatsReportSummary.js +3 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/connectionStats.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/connectionStatsBuilder.js +2 -2
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/connectionStatsBuilder.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/connectionStatsReportBuilder.js +20 -24
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/connectionStatsReportBuilder.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/groupCallStats.js +4 -5
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/groupCallStats.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/media/mediaSsrcHandler.js +7 -8
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/media/mediaSsrcHandler.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/media/mediaTrackHandler.js +7 -9
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/media/mediaTrackHandler.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/media/mediaTrackStats.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/media/mediaTrackStatsHandler.js +6 -6
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/media/mediaTrackStatsHandler.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/statsReport.js +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/statsReport.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/statsReportEmitter.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/summaryStatsReportGatherer.js +14 -14
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/summaryStatsReportGatherer.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/trackStatsBuilder.js +32 -34
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/trackStatsBuilder.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/transportStats.js +3 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/transportStatsBuilder.js +9 -9
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/transportStatsBuilder.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/valueFormatter.js +1 -1
- package/node_modules/matrix-js-sdk/lib/webrtc/stats/valueFormatter.js.map +1 -1
- package/node_modules/matrix-js-sdk/package.json +110 -138
- package/node_modules/matrix-js-sdk/src/@types/event.ts +9 -0
- package/node_modules/matrix-js-sdk/src/@types/global.d.ts +2 -2
- package/node_modules/matrix-js-sdk/src/@types/retention.ts +16 -0
- package/node_modules/matrix-js-sdk/src/ToDeviceMessageQueue.ts +2 -2
- package/node_modules/matrix-js-sdk/src/browser-index.ts +4 -4
- package/node_modules/matrix-js-sdk/src/capabilityPoller.ts +102 -0
- package/node_modules/matrix-js-sdk/src/client.ts +37 -25
- package/node_modules/matrix-js-sdk/src/crypto-api/index.ts +17 -6
- package/node_modules/matrix-js-sdk/src/embedded.ts +4 -6
- package/node_modules/matrix-js-sdk/src/filter-component.ts +1 -0
- package/node_modules/matrix-js-sdk/src/http-api/utils.ts +5 -10
- package/node_modules/matrix-js-sdk/src/interactive-auth.ts +11 -5
- package/node_modules/matrix-js-sdk/src/matrix.ts +1 -0
- package/node_modules/matrix-js-sdk/src/matrixrtc/LivekitTransport.ts +1 -1
- package/node_modules/matrix-js-sdk/src/matrixrtc/MatrixRTCSession.ts +5 -4
- package/node_modules/matrix-js-sdk/src/matrixrtc/MembershipManager.ts +2 -0
- package/node_modules/matrix-js-sdk/src/matrixrtc/MembershipManagerActionScheduler.ts +4 -1
- package/node_modules/matrix-js-sdk/src/models/MSC3089Branch.ts +1 -1
- package/node_modules/matrix-js-sdk/src/models/room-retention.ts +230 -0
- package/node_modules/matrix-js-sdk/src/models/room-sticky-events.ts +1 -0
- package/node_modules/matrix-js-sdk/src/models/room.ts +26 -12
- package/node_modules/matrix-js-sdk/src/receipt-accumulator.ts +2 -0
- package/node_modules/matrix-js-sdk/src/rendezvous/index.ts +1 -1
- package/node_modules/matrix-js-sdk/src/rendezvous/transports/MSC4108RendezvousSession.ts +2 -2
- package/node_modules/matrix-js-sdk/src/retentionPolicy.ts +65 -0
- package/node_modules/matrix-js-sdk/src/rust-crypto/PerSessionKeyBackupDownloader.ts +1 -1
- package/node_modules/matrix-js-sdk/src/rust-crypto/backup.ts +15 -4
- package/node_modules/matrix-js-sdk/src/rust-crypto/index.ts +6 -6
- package/node_modules/matrix-js-sdk/src/rust-crypto/rust-crypto.ts +31 -7
- package/node_modules/matrix-js-sdk/src/rust-crypto/verification.ts +1 -1
- package/node_modules/matrix-js-sdk/src/serverCapabilities.ts +8 -67
- package/node_modules/matrix-js-sdk/src/sliding-sync-sdk.ts +5 -7
- package/node_modules/matrix-js-sdk/src/store/index.ts +8 -0
- package/node_modules/matrix-js-sdk/src/store/indexeddb-local-backend.ts +12 -2
- package/node_modules/matrix-js-sdk/src/store/indexeddb-remote-backend.ts +24 -5
- package/node_modules/matrix-js-sdk/src/store/indexeddb.ts +20 -8
- package/node_modules/matrix-js-sdk/src/store/memory.ts +4 -0
- package/node_modules/matrix-js-sdk/src/store/stub.ts +3 -0
- package/node_modules/matrix-js-sdk/src/sync-accumulator.ts +9 -0
- package/node_modules/matrix-js-sdk/src/sync.ts +11 -9
- package/node_modules/media-typer/README.md +19 -33
- package/node_modules/media-typer/dist/index.d.ts +29 -0
- package/node_modules/media-typer/dist/index.js +64 -0
- package/node_modules/media-typer/dist/index.js.map +1 -0
- package/node_modules/media-typer/package.json +37 -22
- package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.js +2 -2
- package/node_modules/music-metadata/lib/mp4/AtomToken.js +65 -13
- package/node_modules/music-metadata/lib/wav/WaveChunk.d.ts +10 -0
- package/node_modules/music-metadata/lib/wav/WaveChunk.js +13 -3
- package/node_modules/music-metadata/lib/wav/WaveParser.d.ts +1 -0
- package/node_modules/music-metadata/lib/wav/WaveParser.js +6 -5
- package/node_modules/music-metadata/package.json +5 -5
- package/node_modules/typebox/build/compile/validator.d.mts +2 -7
- package/node_modules/typebox/build/compile/validator.mjs +6 -36
- package/node_modules/typebox/build/error/errors.d.mts +1 -7
- package/node_modules/typebox/build/format/_idna.mjs +36 -6
- package/node_modules/typebox/build/format/_puny.mjs +4 -1
- package/node_modules/typebox/build/format/uuid.d.mts +2 -2
- package/node_modules/typebox/build/format/uuid.mjs +3 -3
- package/node_modules/typebox/build/guard/emit.d.mts +0 -4
- package/node_modules/typebox/build/guard/emit.mjs +0 -8
- package/node_modules/typebox/build/guard/guard.d.mts +4 -8
- package/node_modules/typebox/build/guard/guard.mjs +5 -13
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +3 -3
- package/node_modules/typebox/build/schema/engine/boolean.mjs +4 -4
- package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
- package/node_modules/typebox/build/schema/engine/schema.mjs +5 -10
- package/node_modules/typebox/build/schema/engine/type.mjs +14 -18
- package/node_modules/typebox/build/schema/types/dependencies.mjs +1 -1
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/types/index.mjs +0 -1
- package/node_modules/typebox/build/schema/types/schema.d.mts +1 -1
- package/node_modules/typebox/build/schema/types/schema.mjs +2 -2
- package/node_modules/typebox/build/system/locale/ar_001.mjs +0 -1
- package/node_modules/typebox/build/system/locale/bn_BD.mjs +0 -1
- package/node_modules/typebox/build/system/locale/cs_CZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/de_DE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/el_GR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/en_US.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_419.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_AR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_ES.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_MX.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fa_IR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fil_PH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_CA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_FR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ha_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hi_IN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hu_HU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/id_ID.mjs +0 -1
- package/node_modules/typebox/build/system/locale/it_IT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ja_JP.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ko_KR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ms_MY.mjs +0 -1
- package/node_modules/typebox/build/system/locale/nl_NL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pl_PL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_BR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_PT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ro_RO.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ru_RU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sv_SE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sw_TZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/th_TH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/tr_TR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/uk_UA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ur_PK.mjs +0 -1
- package/node_modules/typebox/build/system/locale/vi_VN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/yo_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hans.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hant.mjs +0 -1
- package/node_modules/typebox/build/system/memory/clone.d.mts +2 -3
- package/node_modules/typebox/build/system/memory/clone.mjs +73 -26
- package/node_modules/typebox/build/system/settings/settings.d.mts +15 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +3 -1
- package/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
- package/node_modules/typebox/build/type/action/conditional.mjs +2 -1
- package/node_modules/typebox/build/type/action/index.d.mts +7 -4
- package/node_modules/typebox/build/type/action/index.mjs +7 -4
- package/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
- package/node_modules/typebox/build/type/action/mapped.mjs +2 -1
- package/node_modules/typebox/build/type/action/module.d.mts +8 -7
- package/node_modules/typebox/build/type/action/module.mjs +7 -6
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +0 -5
- package/node_modules/typebox/build/type/action/readonly_object.mjs +0 -5
- package/node_modules/typebox/build/type/action/with.d.mts +11 -0
- package/node_modules/typebox/build/type/action/with.mjs +11 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +1 -1
- package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +2 -2
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +2 -3
- package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +3 -6
- package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +6 -9
- package/node_modules/typebox/build/type/engine/cyclic/check.mjs +10 -16
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +9 -15
- package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +8 -14
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/enum/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/enum/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +1 -2
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +2 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +3 -3
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +17 -5
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +34 -8
- package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/index.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/index.mjs +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +4 -4
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +9 -6
- package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +5 -2
- package/node_modules/typebox/build/type/engine/instantiate.d.mts +44 -31
- package/node_modules/typebox/build/type/engine/instantiate.mjs +82 -83
- package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +5 -1
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +3 -3
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +5 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +10 -5
- package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +7 -9
- package/node_modules/typebox/build/type/engine/module/instantiate.mjs +17 -15
- package/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/partial/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/priority/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/priority/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +20 -0
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +28 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +2 -2
- package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
- package/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/required/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/required/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/required/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/required/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +3 -3
- package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +6 -6
- package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +1 -1
- package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +1 -0
- package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/this/expand_this.mjs +7 -13
- package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/{options → with}/instantiate.mjs +5 -5
- package/node_modules/typebox/build/type/extends/dependent.d.mts +6 -0
- package/node_modules/typebox/build/type/extends/dependent.mjs +6 -0
- package/node_modules/typebox/build/type/extends/enum.d.mts +4 -4
- package/node_modules/typebox/build/type/extends/enum.mjs +3 -2
- package/node_modules/typebox/build/type/extends/extends_left.d.mts +5 -7
- package/node_modules/typebox/build/type/extends/extends_left.mjs +24 -27
- package/node_modules/typebox/build/type/extends/extends_right.d.mts +7 -5
- package/node_modules/typebox/build/type/extends/extends_right.mjs +20 -15
- package/node_modules/typebox/build/type/extends/inference.mjs +1 -1
- package/node_modules/typebox/build/type/extends/object.d.mts +8 -1
- package/node_modules/typebox/build/type/extends/object.mjs +25 -3
- package/node_modules/typebox/build/type/extends/parameters.mjs +2 -2
- package/node_modules/typebox/build/type/extends/record.d.mts +13 -0
- package/node_modules/typebox/build/type/extends/record.mjs +23 -0
- package/node_modules/typebox/build/type/extends/template_literal.d.mts +3 -3
- package/node_modules/typebox/build/type/extends/template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
- package/node_modules/typebox/build/type/extends/tuple.mjs +6 -5
- package/node_modules/typebox/build/type/extends/union.mjs +2 -2
- package/node_modules/typebox/build/type/script/mapping.d.mts +84 -99
- package/node_modules/typebox/build/type/script/mapping.mjs +81 -85
- package/node_modules/typebox/build/type/script/parser.d.mts +40 -40
- package/node_modules/typebox/build/type/script/parser.mjs +22 -22
- package/node_modules/typebox/build/type/script/script.d.mts +3 -4
- package/node_modules/typebox/build/type/script/script.mjs +3 -2
- package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -1
- package/node_modules/typebox/build/type/script/token/internal/guard.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/internal/take.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/until.mjs +2 -2
- package/node_modules/typebox/build/type/types/_codec.d.mts +12 -12
- package/node_modules/typebox/build/type/types/_codec.mjs +0 -1
- package/node_modules/typebox/build/type/types/_immutable.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_immutable.mjs +2 -10
- package/node_modules/typebox/build/type/types/_optional.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_optional.mjs +2 -11
- package/node_modules/typebox/build/type/types/_readonly.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_readonly.mjs +2 -10
- package/node_modules/typebox/build/type/types/_refine.d.mts +8 -10
- package/node_modules/typebox/build/type/types/_refine.mjs +1 -2
- package/node_modules/typebox/build/type/types/call.d.mts +3 -3
- package/node_modules/typebox/build/type/types/call.mjs +3 -2
- package/node_modules/typebox/build/type/types/deferred.d.mts +1 -0
- package/node_modules/typebox/build/type/types/deferred.mjs +1 -1
- package/node_modules/typebox/build/type/types/dependent.d.mts +17 -0
- package/node_modules/typebox/build/type/types/dependent.mjs +24 -0
- package/node_modules/typebox/build/type/types/enum.d.mts +3 -1
- package/node_modules/typebox/build/type/types/enum.mjs +5 -0
- package/node_modules/typebox/build/type/types/index.d.mts +1 -4
- package/node_modules/typebox/build/type/types/index.mjs +1 -4
- package/node_modules/typebox/build/type/types/number.d.mts +1 -1
- package/node_modules/typebox/build/type/types/number.mjs +1 -1
- package/node_modules/typebox/build/type/types/record.d.mts +13 -7
- package/node_modules/typebox/build/type/types/record.mjs +15 -9
- package/node_modules/typebox/build/type/types/static.d.mts +2 -5
- package/node_modules/typebox/build/typebox.d.mts +4 -8
- package/node_modules/typebox/build/typebox.mjs +4 -8
- package/node_modules/typebox/build/value/clean/clean.mjs +4 -2
- package/node_modules/typebox/build/value/clean/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/value/clean/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/clean/from_union.d.mts +1 -1
- package/node_modules/typebox/build/value/clean/from_union.mjs +1 -2
- package/node_modules/typebox/build/value/clone/clone.mjs +2 -73
- package/node_modules/typebox/build/value/codec/decode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/encode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/from_array.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_object.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_record.mjs +2 -7
- package/node_modules/typebox/build/value/codec/from_tuple.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_union.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_enum.mjs +3 -4
- package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +1 -1
- package/node_modules/typebox/build/value/convert/from_template_literal.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_type.mjs +19 -21
- package/node_modules/typebox/build/value/create/from_enum.mjs +2 -2
- package/node_modules/typebox/build/value/create/from_type.mjs +23 -31
- package/node_modules/typebox/build/value/default/from_object.mjs +1 -1
- package/node_modules/typebox/build/value/default/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/index.d.mts +0 -1
- package/node_modules/typebox/build/value/index.mjs +0 -1
- package/node_modules/typebox/build/value/repair/from_enum.mjs +2 -3
- package/node_modules/typebox/build/value/repair/from_type.mjs +24 -22
- package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +6 -2
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +62 -26
- package/node_modules/typebox/build/value/value.d.mts +0 -1
- package/node_modules/typebox/build/value/value.mjs +0 -1
- package/node_modules/typebox/package.json +25 -25
- package/node_modules/typebox/readme.md +97 -80
- package/npm-shrinkwrap.json +59 -54
- package/package.json +10 -10
- package/dist/probe.runtime-DFt7PIoE.js +0 -3
- package/node_modules/@babel/runtime/helpers/AwaitValue.js +0 -4
- package/node_modules/@babel/runtime/helpers/applyDecs.js +0 -236
- package/node_modules/@babel/runtime/helpers/applyDecs2203.js +0 -184
- package/node_modules/@babel/runtime/helpers/applyDecs2203R.js +0 -191
- package/node_modules/@babel/runtime/helpers/applyDecs2301.js +0 -222
- package/node_modules/@babel/runtime/helpers/applyDecs2305.js +0 -133
- package/node_modules/@babel/runtime/helpers/classApplyDescriptorDestructureSet.js +0 -10
- package/node_modules/@babel/runtime/helpers/classApplyDescriptorGet.js +0 -4
- package/node_modules/@babel/runtime/helpers/classApplyDescriptorSet.js +0 -7
- package/node_modules/@babel/runtime/helpers/classCheckPrivateStaticAccess.js +0 -5
- package/node_modules/@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor.js +0 -4
- package/node_modules/@babel/runtime/helpers/classExtractFieldDescriptor.js +0 -5
- package/node_modules/@babel/runtime/helpers/classPrivateFieldDestructureSet.js +0 -7
- package/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js +0 -7
- package/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js +0 -7
- package/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js +0 -5
- package/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js +0 -4
- package/node_modules/@babel/runtime/helpers/classStaticPrivateFieldDestructureSet.js +0 -7
- package/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js +0 -7
- package/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js +0 -7
- package/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js +0 -4
- package/node_modules/@babel/runtime/helpers/decorate.js +0 -250
- package/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js +0 -12
- package/node_modules/@babel/runtime/helpers/dispose.js +0 -28
- package/node_modules/@babel/runtime/helpers/esm/AwaitValue.js +0 -4
- package/node_modules/@babel/runtime/helpers/esm/applyDecs.js +0 -236
- package/node_modules/@babel/runtime/helpers/esm/applyDecs2203.js +0 -184
- package/node_modules/@babel/runtime/helpers/esm/applyDecs2203R.js +0 -191
- package/node_modules/@babel/runtime/helpers/esm/applyDecs2301.js +0 -222
- package/node_modules/@babel/runtime/helpers/esm/applyDecs2305.js +0 -133
- package/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorDestructureSet.js +0 -10
- package/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorGet.js +0 -4
- package/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorSet.js +0 -7
- package/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticAccess.js +0 -5
- package/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticFieldDescriptor.js +0 -4
- package/node_modules/@babel/runtime/helpers/esm/classExtractFieldDescriptor.js +0 -5
- package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js +0 -7
- package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js +0 -7
- package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js +0 -7
- package/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js +0 -5
- package/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js +0 -4
- package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldDestructureSet.js +0 -7
- package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js +0 -7
- package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js +0 -7
- package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js +0 -4
- package/node_modules/@babel/runtime/helpers/esm/decorate.js +0 -250
- package/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js +0 -12
- package/node_modules/@babel/runtime/helpers/esm/dispose.js +0 -28
- package/node_modules/@babel/runtime/helpers/esm/objectSpread.js +0 -14
- package/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js +0 -77
- package/node_modules/@babel/runtime/helpers/esm/using.js +0 -12
- package/node_modules/@babel/runtime/helpers/objectSpread.js +0 -14
- package/node_modules/@babel/runtime/helpers/regeneratorRuntime.js +0 -77
- package/node_modules/@babel/runtime/helpers/using.js +0 -12
- package/node_modules/@babel/runtime/regenerator/index.js +0 -15
- package/node_modules/content-type/HISTORY.md +0 -29
- package/node_modules/content-type/index.js +0 -225
- package/node_modules/media-typer/HISTORY.md +0 -50
- package/node_modules/media-typer/index.js +0 -143
- package/node_modules/typebox/build/schema/engine/_guard.d.mts +0 -6
- package/node_modules/typebox/build/schema/engine/_guard.mjs +0 -26
- package/node_modules/typebox/build/schema/types/_guard.d.mts +0 -10
- package/node_modules/typebox/build/schema/types/_guard.mjs +0 -16
- package/node_modules/typebox/build/type/action/_optional.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_optional.mjs +0 -40
- package/node_modules/typebox/build/type/action/_readonly.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_readonly.mjs +0 -40
- package/node_modules/typebox/build/type/action/awaited.d.mts +0 -15
- package/node_modules/typebox/build/type/action/awaited.mjs +0 -15
- package/node_modules/typebox/build/type/action/options.d.mts +0 -11
- package/node_modules/typebox/build/type/action/options.mjs +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +0 -20
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +0 -14
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +0 -24
- package/node_modules/typebox/build/type/engine/options/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/options/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +0 -8
- package/node_modules/typebox/build/type/extends/async_iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/async_iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/promise.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/promise.mjs +0 -9
- package/node_modules/typebox/build/type/types/async_iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/async_iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/base.d.mts +0 -50
- package/node_modules/typebox/build/type/types/base.mjs +0 -84
- package/node_modules/typebox/build/type/types/iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/promise.d.mts +0 -21
- package/node_modules/typebox/build/type/types/promise.mjs +0 -29
- package/node_modules/typebox/build/value/clean/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/clean/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/convert/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/convert/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_async_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_async_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_promise.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_promise.mjs +0 -5
- package/node_modules/typebox/build/value/default/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/default/from_base.mjs +0 -5
- package/node_modules/typebox/build/value/mutate/error.d.mts +0 -3
- package/node_modules/typebox/build/value/mutate/error.mjs +0 -6
- package/node_modules/typebox/build/value/mutate/from_array.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_array.mjs +0 -16
- package/node_modules/typebox/build/value/mutate/from_object.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_object.mjs +0 -40
- package/node_modules/typebox/build/value/mutate/from_unknown.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_unknown.mjs +0 -7
- package/node_modules/typebox/build/value/mutate/from_value.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_value.mjs +0 -12
- package/node_modules/typebox/build/value/mutate/index.d.mts +0 -1
- package/node_modules/typebox/build/value/mutate/index.mjs +0 -1
- package/node_modules/typebox/build/value/mutate/mutate.d.mts +0 -11
- package/node_modules/typebox/build/value/mutate/mutate.mjs +0 -41
- package/node_modules/typebox/build/value/repair/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/repair/from_base.mjs +0 -8
- /package/node_modules/typebox/build/type/engine/{awaited → with}/index.d.mts +0 -0
- /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
|
-
|
|
75
|
-
return
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
-
|
|
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
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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
|
-
|
|
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
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
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
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
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
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
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
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
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
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
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
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
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
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
if (
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
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
|
-
|
|
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
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
enableKeyBackup(backupInfo) {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
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
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
//
|
|
382
|
-
//
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
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
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
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
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
//
|
|
418
|
-
//
|
|
419
|
-
//
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
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
|
-
|
|
429
|
-
|
|
430
|
-
|
|
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
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
//
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
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
|
-
|
|
457
|
-
|
|
458
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
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
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
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
|
-
|
|
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
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
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
|
-
|
|
615
|
-
return
|
|
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
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
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
|
-
}
|
|
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
|
-
|
|
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
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
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
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
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
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
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
|
|
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
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
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
|
-
|
|
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(
|
|
872
|
-
|
|
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
|
-
|
|
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
|
-
|
|
913
|
-
for (
|
|
914
|
-
|
|
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;
|