@openclaw/matrix 2026.7.1-beta.2 → 2026.7.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{account-selection-Bv_ZuOu4.js → account-selection-5e4mHR1m.js} +1 -1
- package/dist/api.js +5 -5
- package/dist/{approval-handler.runtime-DzpLXVdc.js → approval-handler.runtime-DI5x9r8I.js} +5 -5
- package/dist/{approval-ids-R834n6m3.js → approval-ids-ZgqbspmS.js} +1 -1
- package/dist/{approval-reaction-auth-eAqCXUFG.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-KcNo9qtl.js → channel-jUTBsjHU.js} +20 -18
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-DtsGVgZj.js → channel.runtime-DO1Nv9ed.js} +25 -13
- package/dist/{cli-Clvpw_8I.js → cli-CEfWwCKx.js} +9 -9
- package/dist/{cli-metadata-D3N0Avnt.js → cli-metadata-CfiEO-CE.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{client-BQz5GcYr.js → client-FRuyCNju.js} +2 -2
- package/dist/{client-bootstrap-CBJciU5u.js → client-bootstrap-DjFJ7e0N.js} +1 -2
- package/dist/{client-D-5GVz_D.js → client-tgnlQJk4.js} +2 -2
- package/dist/{config-schema-Dn-fHID8.js → config-schema-DtnhNYd-.js} +1 -1
- package/dist/contract-api.js +2 -2
- package/dist/{create-client-DhGid8FE.js → create-client-CNakT7zF.js} +3 -3
- 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-5PDPPG9f.js → credentials-write.runtime-CTqqxcut.js} +1 -1
- package/dist/{crypto-runtime-B7kyrTL0.js → crypto-runtime-B74cTS6A.js} +4 -4
- 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-Ctu4whZK.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-j71tSUu-.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 +1 -1
- 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-XO4VaezT.js → media-text-p-LP21qs.js} +1 -1
- package/dist/{messages-nQLGGa1r.js → messages-DRKkiEY-.js} +6 -5
- package/dist/{monitor-k3Sko8qt.js → monitor-CsGOGdwu.js} +71 -71
- package/dist/plugin-entry.handlers.runtime.js +1 -1
- package/dist/probe.runtime-2MZLc6ng.js +3 -0
- package/dist/{profile-update-DIOAhezh.js → profile-update-Ucc8RrJL.js} +2 -2
- package/dist/{reaction-events-BDsbR82F.js → reaction-events-DentrVii.js} +3 -3
- package/dist/{recovery-key-store-BGk8c_gf.js → recovery-key-store-DSeLFvNx.js} +1 -1
- package/dist/{resolve-targets-BbrinjHd.js → resolve-targets-DcV_KfgX.js} +1 -1
- package/dist/{resolver.runtime-B3N7k_6-.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-eyqOqjmn.js → sdk-AZYVl34z.js} +8 -6
- package/dist/{send-D0hpevF-.js → send-D92v6Yy0.js} +21 -8
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/{setup-bootstrap-Ihb_DM2a.js → setup-bootstrap-Da564w5f.js} +2 -2
- package/dist/{setup-core-D2BQs8w1.js → setup-core-BGgbrdaJ.js} +5 -8
- package/dist/setup-plugin-api.js +3 -3
- package/dist/{setup-surface-1qf1LZIP.js → setup-surface-iJ6pd-t5.js} +6 -6
- package/dist/{shared-BGcaBMK3.js → shared-DkFfq7mH.js} +6 -6
- 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/{thread-bindings-BnuBS0VH.js → thread-bindings-BX5nmWpw.js} +3 -3
- package/dist/{tool-actions.runtime-BeUveYxV.js → tool-actions.runtime-C1d5fxE_.js} +12 -12
- package/dist/{verification-CNw2K4uT.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-BED7DXis.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,4 +1,3 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
1
|
/*
|
|
3
2
|
Copyright 2016 - 2021 The Matrix.org Foundation C.I.C.
|
|
4
3
|
|
|
@@ -26,7 +25,7 @@ import { FILTER_RELATED_BY_REL_TYPES, FILTER_RELATED_BY_SENDERS, THREAD_RELATION
|
|
|
26
25
|
*/
|
|
27
26
|
function matchesWildcard(actualValue, filterValue) {
|
|
28
27
|
if (filterValue.endsWith("*")) {
|
|
29
|
-
|
|
28
|
+
const typePrefix = filterValue.slice(0, -1);
|
|
30
29
|
return actualValue.slice(0, typePrefix.length) === typePrefix;
|
|
31
30
|
} else {
|
|
32
31
|
return actualValue === filterValue;
|
|
@@ -57,16 +56,15 @@ export class FilterComponent {
|
|
|
57
56
|
* @returns true if the event matches the filter
|
|
58
57
|
*/
|
|
59
58
|
check(event) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var relations = Object.keys(bundledRelationships);
|
|
59
|
+
const bundledRelationships = event.getUnsigned()?.["m.relations"] || {};
|
|
60
|
+
const relations = Object.keys(bundledRelationships);
|
|
63
61
|
// Relation senders allows in theory a look-up of any senders
|
|
64
62
|
// however clients can only know about the current user participation status
|
|
65
63
|
// as sending a whole list of participants could be proven problematic in terms
|
|
66
64
|
// of performance
|
|
67
65
|
// This should be improved when bundled relationships solve that problem
|
|
68
|
-
|
|
69
|
-
if (this.userId && bundledRelationships
|
|
66
|
+
const relationSenders = [];
|
|
67
|
+
if (this.userId && bundledRelationships?.[THREAD_RELATION_TYPE.name]?.current_user_participated) {
|
|
70
68
|
relationSenders.push(this.userId);
|
|
71
69
|
}
|
|
72
70
|
return this.checkFields(event.getRoomId(), event.getSender(), event.getType(), event.getContent() ? event.getContent().url !== undefined : false, relations, relationSenders);
|
|
@@ -86,12 +84,7 @@ export class FilterComponent {
|
|
|
86
84
|
contains_url: this.filterJson.contains_url,
|
|
87
85
|
[FILTER_RELATED_BY_SENDERS.name]: this.filterJson[FILTER_RELATED_BY_SENDERS.name],
|
|
88
86
|
[FILTER_RELATED_BY_REL_TYPES.name]: this.filterJson[FILTER_RELATED_BY_REL_TYPES.name]
|
|
89
|
-
}).filter(
|
|
90
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
91
|
-
_key = _ref2[0],
|
|
92
|
-
value = _ref2[1];
|
|
93
|
-
return value;
|
|
94
|
-
}));
|
|
87
|
+
}).filter(([_key, value]) => value));
|
|
95
88
|
}
|
|
96
89
|
|
|
97
90
|
/**
|
|
@@ -105,40 +98,40 @@ export class FilterComponent {
|
|
|
105
98
|
* @returns true if the event fields match the filter
|
|
106
99
|
*/
|
|
107
100
|
checkFields(roomId, sender, eventType, containsUrl, relationTypes, relationSenders) {
|
|
108
|
-
|
|
109
|
-
rooms: function
|
|
101
|
+
const literalKeys = {
|
|
102
|
+
rooms: function (v) {
|
|
110
103
|
return roomId === v;
|
|
111
104
|
},
|
|
112
|
-
senders: function
|
|
105
|
+
senders: function (v) {
|
|
113
106
|
return sender === v;
|
|
114
107
|
},
|
|
115
|
-
types: function
|
|
108
|
+
types: function (v) {
|
|
116
109
|
return matchesWildcard(eventType, v);
|
|
117
110
|
}
|
|
118
111
|
};
|
|
119
|
-
for (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (disallowedValues
|
|
112
|
+
for (const name in literalKeys) {
|
|
113
|
+
const matchFunc = literalKeys[name];
|
|
114
|
+
const notName = "not_" + name;
|
|
115
|
+
const disallowedValues = this.filterJson[notName];
|
|
116
|
+
if (disallowedValues?.some(matchFunc)) {
|
|
124
117
|
return false;
|
|
125
118
|
}
|
|
126
|
-
|
|
119
|
+
const allowedValues = this.filterJson[name];
|
|
127
120
|
if (allowedValues && !allowedValues.some(matchFunc)) {
|
|
128
121
|
return false;
|
|
129
122
|
}
|
|
130
123
|
}
|
|
131
|
-
|
|
124
|
+
const containsUrlFilter = this.filterJson.contains_url;
|
|
132
125
|
if (containsUrlFilter !== undefined && containsUrlFilter !== containsUrl) {
|
|
133
126
|
return false;
|
|
134
127
|
}
|
|
135
|
-
|
|
128
|
+
const relationTypesFilter = this.filterJson[FILTER_RELATED_BY_REL_TYPES.name];
|
|
136
129
|
if (relationTypesFilter !== undefined) {
|
|
137
130
|
if (!this.arrayMatchesFilter(relationTypesFilter, relationTypes)) {
|
|
138
131
|
return false;
|
|
139
132
|
}
|
|
140
133
|
}
|
|
141
|
-
|
|
134
|
+
const relationSendersFilter = this.filterJson[FILTER_RELATED_BY_SENDERS.name];
|
|
142
135
|
if (relationSendersFilter !== undefined) {
|
|
143
136
|
if (!this.arrayMatchesFilter(relationSendersFilter, relationSenders)) {
|
|
144
137
|
return false;
|
|
@@ -158,6 +151,7 @@ export class FilterComponent {
|
|
|
158
151
|
* @returns events which matched the filter component
|
|
159
152
|
*/
|
|
160
153
|
filter(events) {
|
|
154
|
+
// oxlint-disable-next-line typescript/unbound-method
|
|
161
155
|
return events.filter(this.check, this);
|
|
162
156
|
}
|
|
163
157
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-component.js","names":["FILTER_RELATED_BY_REL_TYPES","FILTER_RELATED_BY_SENDERS","THREAD_RELATION_TYPE","matchesWildcard","actualValue","filterValue","endsWith","typePrefix","slice","length","FilterComponent","constructor","filterJson","userId","check","event","_event$getUnsigned","_bundledRelationships","bundledRelationships","getUnsigned","relations","Object","keys","relationSenders","name","current_user_participated","push","checkFields","getRoomId","getSender","getType","getContent","url","undefined","toJSON","fromEntries","entries","types","not_types","rooms","not_rooms","senders","not_senders","contains_url","filter","_ref","_ref2","_slicedToArray","_key","value","roomId","sender","eventType","containsUrl","relationTypes","literalKeys","v","matchFunc","notName","disallowedValues","some","allowedValues","containsUrlFilter","relationTypesFilter","arrayMatchesFilter","relationSendersFilter","values","every","includes","events","limit"],"sources":["../src/filter-component.ts"],"sourcesContent":["/*\nCopyright 2016 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { type RelationType } from \"./@types/event.ts\";\nimport { type MatrixEvent } from \"./models/event.ts\";\nimport { FILTER_RELATED_BY_REL_TYPES, FILTER_RELATED_BY_SENDERS, THREAD_RELATION_TYPE } from \"./models/thread.ts\";\n\n/**\n * Checks if a value matches a given field value, which may be a * terminated\n * wildcard pattern.\n * @param actualValue - The value to be compared\n * @param filterValue - The filter pattern to be compared\n * @returns true if the actualValue matches the filterValue\n */\nfunction matchesWildcard(actualValue: string, filterValue: string): boolean {\n if (filterValue.endsWith(\"*\")) {\n const typePrefix = filterValue.slice(0, -1);\n return actualValue.slice(0, typePrefix.length) === typePrefix;\n } else {\n return actualValue === filterValue;\n }\n}\n\n/* eslint-disable camelcase */\nexport interface IFilterComponent {\n \"types\"?: string[];\n \"not_types\"?: string[];\n \"rooms\"?: string[];\n \"not_rooms\"?: string[];\n \"senders\"?: string[];\n \"not_senders\"?: string[];\n \"contains_url\"?: boolean;\n \"limit\"?: number;\n \"related_by_senders\"?: Array<RelationType | string>;\n \"related_by_rel_types\"?: string[];\n\n // Unstable values\n \"io.element.relation_senders\"?: Array<RelationType | string>;\n \"io.element.relation_types\"?: string[];\n}\n/* eslint-enable camelcase */\n\n/**\n * FilterComponent is a section of a Filter definition which defines the\n * types, rooms, senders filters etc to be applied to a particular type of resource.\n * This is all ported over from synapse's Filter object.\n *\n * N.B. that synapse refers to these as 'Filters', and what js-sdk refers to as\n * 'Filters' are referred to as 'FilterCollections'.\n */\nexport class FilterComponent {\n public constructor(\n private filterJson: IFilterComponent,\n public readonly userId?: string | undefined | null,\n ) {}\n\n /**\n * Checks with the filter component matches the given event\n * @param event - event to be checked against the filter\n * @returns true if the event matches the filter\n */\n public check(event: MatrixEvent): boolean {\n const bundledRelationships = event.getUnsigned()?.[\"m.relations\"] || {};\n const relations: Array<string | RelationType> = Object.keys(bundledRelationships);\n // Relation senders allows in theory a look-up of any senders\n // however clients can only know about the current user participation status\n // as sending a whole list of participants could be proven problematic in terms\n // of performance\n // This should be improved when bundled relationships solve that problem\n const relationSenders: string[] = [];\n if (this.userId && bundledRelationships?.[THREAD_RELATION_TYPE.name]?.current_user_participated) {\n relationSenders.push(this.userId);\n }\n\n return this.checkFields(\n event.getRoomId(),\n event.getSender(),\n event.getType(),\n event.getContent() ? event.getContent().url !== undefined : false,\n relations,\n relationSenders,\n );\n }\n\n /**\n * Converts the filter component into the form expected over the wire\n */\n public toJSON(): object {\n return Object.fromEntries(\n Object.entries({\n types: this.filterJson.types,\n not_types: this.filterJson.not_types,\n rooms: this.filterJson.rooms,\n not_rooms: this.filterJson.not_rooms,\n senders: this.filterJson.senders,\n not_senders: this.filterJson.not_senders,\n contains_url: this.filterJson.contains_url,\n [FILTER_RELATED_BY_SENDERS.name]: this.filterJson[FILTER_RELATED_BY_SENDERS.name],\n [FILTER_RELATED_BY_REL_TYPES.name]: this.filterJson[FILTER_RELATED_BY_REL_TYPES.name],\n }).filter(([_key, value]) => value),\n );\n }\n\n /**\n * Checks whether the filter component matches the given event fields.\n * @param roomId - the roomId for the event being checked\n * @param sender - the sender of the event being checked\n * @param eventType - the type of the event being checked\n * @param containsUrl - whether the event contains a content.url field\n * @param relationTypes - whether has aggregated relation of the given type\n * @param relationSenders - whether one of the relation is sent by the user listed\n * @returns true if the event fields match the filter\n */\n private checkFields(\n roomId: string | undefined,\n sender: string | undefined,\n eventType: string,\n containsUrl: boolean,\n relationTypes: Array<RelationType | string>,\n relationSenders: string[],\n ): boolean {\n const literalKeys = {\n rooms: function (v: string): boolean {\n return roomId === v;\n },\n senders: function (v: string): boolean {\n return sender === v;\n },\n types: function (v: string): boolean {\n return matchesWildcard(eventType, v);\n },\n } as const;\n\n for (const name in literalKeys) {\n const matchFunc = literalKeys[<keyof typeof literalKeys>name];\n const notName = \"not_\" + name;\n const disallowedValues = this.filterJson[<`not_${keyof typeof literalKeys}`>notName];\n if (disallowedValues?.some(matchFunc)) {\n return false;\n }\n\n const allowedValues = this.filterJson[name as keyof typeof literalKeys];\n if (allowedValues && !allowedValues.some(matchFunc)) {\n return false;\n }\n }\n\n const containsUrlFilter = this.filterJson.contains_url;\n if (containsUrlFilter !== undefined && containsUrlFilter !== containsUrl) {\n return false;\n }\n\n const relationTypesFilter = this.filterJson[FILTER_RELATED_BY_REL_TYPES.name];\n if (relationTypesFilter !== undefined) {\n if (!this.arrayMatchesFilter(relationTypesFilter, relationTypes)) {\n return false;\n }\n }\n\n const relationSendersFilter = this.filterJson[FILTER_RELATED_BY_SENDERS.name];\n if (relationSendersFilter !== undefined) {\n if (!this.arrayMatchesFilter(relationSendersFilter, relationSenders)) {\n return false;\n }\n }\n\n return true;\n }\n\n private arrayMatchesFilter(filter: any[], values: any[]): boolean {\n return (\n values.length > 0 &&\n filter.every((value) => {\n return values.includes(value);\n })\n );\n }\n\n /**\n * Filters a list of events down to those which match this filter component\n * @param events - Events to be checked against the filter component\n * @returns events which matched the filter component\n */\n public filter(events: MatrixEvent[]): MatrixEvent[] {\n return events.filter(this.check, this);\n }\n\n /**\n * Returns the limit field for a given filter component, providing a default of\n * 10 if none is otherwise specified. Cargo-culted from Synapse.\n * @returns the limit for this filter component.\n */\n public limit(): number {\n return this.filterJson.limit !== undefined ? this.filterJson.limit : 10;\n }\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,2BAA2B,EAAEC,yBAAyB,EAAEC,oBAAoB,QAAQ,oBAAoB;;AAEjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CAACC,WAAmB,EAAEC,WAAmB,EAAW;EACxE,IAAIA,WAAW,CAACC,QAAQ,CAAC,GAAG,CAAC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AC;IAC7E,IAAIyC,qBAAqB,KAAKhC,SAAS,EAAE;MACrC,IAAI,CAAC,IAAI,CAAC+B,kBAAkB,CAACC,qBAAqB,EAAE1C,eAAe,CAAC,EAAE;QAClE,OAAO,KAAK;MAChB;IACJ;IAEA,OAAO,IAAI;EACf;EAEQyC,kBAAkBA,CAACpB,MAAa,EAAEsB,MAAa,EAAW;IAC9D,OACIA,MAAM,CAACzD,MAAM,GAAG,CAAC,IACjBmC,MAAM,CAACuB,KAAK,CAAElB,KAAK,IAAK;MACpB,OAAOiB,MAAM,CAACE,QAAQ,CAACnB,KAAK,CAAC;IACjC,CAAC,CAAC;EAEV;;EAEA;AACJ;AACA;AACA;AACA;EACWL,MAAMA,CAACyB,MAAqB,EAAiB;IAChD,OAAOA,MAAM,CAACzB,MAAM,CAAC,IAAI,CAAC9B,KAAK,EAAE,IAAI,CAAC;EAC1C;;EAEA;AACJ;AACA;AACA;AACA;EACWwD,KAAKA,CAAA,EAAW;IACnB,OAAO,IAAI,CAAC1D,UAAU,CAAC0D,KAAK,KAAKrC,SAAS,GAAG,IAAI,CAACrB,UAAU,CAAC0D,KAAK,GAAG,EAAE;EAC3E;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"filter-component.js","names":[],"sources":["../src/filter-component.ts"],"sourcesContent":["/*\nCopyright 2016 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { type RelationType } from \"./@types/event.ts\";\nimport { type MatrixEvent } from \"./models/event.ts\";\nimport { FILTER_RELATED_BY_REL_TYPES, FILTER_RELATED_BY_SENDERS, THREAD_RELATION_TYPE } from \"./models/thread.ts\";\n\n/**\n * Checks if a value matches a given field value, which may be a * terminated\n * wildcard pattern.\n * @param actualValue - The value to be compared\n * @param filterValue - The filter pattern to be compared\n * @returns true if the actualValue matches the filterValue\n */\nfunction matchesWildcard(actualValue: string, filterValue: string): boolean {\n if (filterValue.endsWith(\"*\")) {\n const typePrefix = filterValue.slice(0, -1);\n return actualValue.slice(0, typePrefix.length) === typePrefix;\n } else {\n return actualValue === filterValue;\n }\n}\n\n/* eslint-disable camelcase */\nexport interface IFilterComponent {\n \"types\"?: string[];\n \"not_types\"?: string[];\n \"rooms\"?: string[];\n \"not_rooms\"?: string[];\n \"senders\"?: string[];\n \"not_senders\"?: string[];\n \"contains_url\"?: boolean;\n \"limit\"?: number;\n \"related_by_senders\"?: Array<RelationType | string>;\n \"related_by_rel_types\"?: string[];\n\n // Unstable values\n \"io.element.relation_senders\"?: Array<RelationType | string>;\n \"io.element.relation_types\"?: string[];\n}\n/* eslint-enable camelcase */\n\n/**\n * FilterComponent is a section of a Filter definition which defines the\n * types, rooms, senders filters etc to be applied to a particular type of resource.\n * This is all ported over from synapse's Filter object.\n *\n * N.B. that synapse refers to these as 'Filters', and what js-sdk refers to as\n * 'Filters' are referred to as 'FilterCollections'.\n */\nexport class FilterComponent {\n public constructor(\n private filterJson: IFilterComponent,\n public readonly userId?: string | undefined | null,\n ) {}\n\n /**\n * Checks with the filter component matches the given event\n * @param event - event to be checked against the filter\n * @returns true if the event matches the filter\n */\n public check(event: MatrixEvent): boolean {\n const bundledRelationships = event.getUnsigned()?.[\"m.relations\"] || {};\n const relations: Array<string | RelationType> = Object.keys(bundledRelationships);\n // Relation senders allows in theory a look-up of any senders\n // however clients can only know about the current user participation status\n // as sending a whole list of participants could be proven problematic in terms\n // of performance\n // This should be improved when bundled relationships solve that problem\n const relationSenders: string[] = [];\n if (this.userId && bundledRelationships?.[THREAD_RELATION_TYPE.name]?.current_user_participated) {\n relationSenders.push(this.userId);\n }\n\n return this.checkFields(\n event.getRoomId(),\n event.getSender(),\n event.getType(),\n event.getContent() ? event.getContent().url !== undefined : false,\n relations,\n relationSenders,\n );\n }\n\n /**\n * Converts the filter component into the form expected over the wire\n */\n public toJSON(): object {\n return Object.fromEntries(\n Object.entries({\n types: this.filterJson.types,\n not_types: this.filterJson.not_types,\n rooms: this.filterJson.rooms,\n not_rooms: this.filterJson.not_rooms,\n senders: this.filterJson.senders,\n not_senders: this.filterJson.not_senders,\n contains_url: this.filterJson.contains_url,\n [FILTER_RELATED_BY_SENDERS.name]: this.filterJson[FILTER_RELATED_BY_SENDERS.name],\n [FILTER_RELATED_BY_REL_TYPES.name]: this.filterJson[FILTER_RELATED_BY_REL_TYPES.name],\n }).filter(([_key, value]) => value),\n );\n }\n\n /**\n * Checks whether the filter component matches the given event fields.\n * @param roomId - the roomId for the event being checked\n * @param sender - the sender of the event being checked\n * @param eventType - the type of the event being checked\n * @param containsUrl - whether the event contains a content.url field\n * @param relationTypes - whether has aggregated relation of the given type\n * @param relationSenders - whether one of the relation is sent by the user listed\n * @returns true if the event fields match the filter\n */\n private checkFields(\n roomId: string | undefined,\n sender: string | undefined,\n eventType: string,\n containsUrl: boolean,\n relationTypes: Array<RelationType | string>,\n relationSenders: string[],\n ): boolean {\n const literalKeys = {\n rooms: function (v: string): boolean {\n return roomId === v;\n },\n senders: function (v: string): boolean {\n return sender === v;\n },\n types: function (v: string): boolean {\n return matchesWildcard(eventType, v);\n },\n } as const;\n\n for (const name in literalKeys) {\n const matchFunc = literalKeys[<keyof typeof literalKeys>name];\n const notName = \"not_\" + name;\n const disallowedValues = this.filterJson[<`not_${keyof typeof literalKeys}`>notName];\n if (disallowedValues?.some(matchFunc)) {\n return false;\n }\n\n const allowedValues = this.filterJson[name as keyof typeof literalKeys];\n if (allowedValues && !allowedValues.some(matchFunc)) {\n return false;\n }\n }\n\n const containsUrlFilter = this.filterJson.contains_url;\n if (containsUrlFilter !== undefined && containsUrlFilter !== containsUrl) {\n return false;\n }\n\n const relationTypesFilter = this.filterJson[FILTER_RELATED_BY_REL_TYPES.name];\n if (relationTypesFilter !== undefined) {\n if (!this.arrayMatchesFilter(relationTypesFilter, relationTypes)) {\n return false;\n }\n }\n\n const relationSendersFilter = this.filterJson[FILTER_RELATED_BY_SENDERS.name];\n if (relationSendersFilter !== undefined) {\n if (!this.arrayMatchesFilter(relationSendersFilter, relationSenders)) {\n return false;\n }\n }\n\n return true;\n }\n\n private arrayMatchesFilter(filter: any[], values: any[]): boolean {\n return (\n values.length > 0 &&\n filter.every((value) => {\n return values.includes(value);\n })\n );\n }\n\n /**\n * Filters a list of events down to those which match this filter component\n * @param events - Events to be checked against the filter component\n * @returns events which matched the filter component\n */\n public filter(events: MatrixEvent[]): MatrixEvent[] {\n // oxlint-disable-next-line typescript/unbound-method\n return events.filter(this.check, this);\n }\n\n /**\n * Returns the limit field for a given filter component, providing a default of\n * 10 if none is otherwise specified. Cargo-culted from Synapse.\n * @returns the limit for this filter component.\n */\n public limit(): number {\n return this.filterJson.limit !== undefined ? this.filterJson.limit : 10;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAAS,2BAA2B,EAAE,yBAAyB,EAAE,oBAAoB,QAAQ,oBAAoB;;AAEjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,eAAe,CAAC,WAAmB,EAAE,WAAmB,EAAW;EACxE,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;IAC3B,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3C,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK,UAAU;EACjE,CAAC,MAAM;IACH,OAAO,WAAW,KAAK,WAAW;EACtC;AACJ;;AAEA;;AAiBA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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CAAC,UAAU,CAAC,YAAY;IACtD,IAAI,iBAAiB,KAAK,SAAS,IAAI,iBAAiB,KAAK,WAAW,EAAE;MACtE,OAAO,KAAK;IAChB;IAEA,MAAM,mBAAmB,GAAG,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC,IAAI,CAAC;IAC7E,IAAI,mBAAmB,KAAK,SAAS,EAAE;MACnC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,EAAE,aAAa,CAAC,EAAE;QAC9D,OAAO,KAAK;MAChB;IACJ;IAEA,MAAM,qBAAqB,GAAG,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC,IAAI,CAAC;IAC7E,IAAI,qBAAqB,KAAK,SAAS,EAAE;MACrC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,qBAAqB,EAAE,eAAe,CAAC,EAAE;QAClE,OAAO,KAAK;MAChB;IACJ;IAEA,OAAO,IAAI;EACf;EAEQ,kBAAkB,CAAC,MAAa,EAAE,MAAa,EAAW;IAC9D,OACI,MAAM,CAAC,MAAM,GAAG,CAAC,IACjB,MAAM,CAAC,KAAK,CAAE,KAAK,IAAK;MACpB,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;IACjC,CAAC,CAAC;EAEV;;EAEA;AACJ;AACA;AACA;AACA;EACW,MAAM,CAAC,MAAqB,EAAiB;IAChD;IACA,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC;EAC1C;;EAEA;AACJ;AACA;AACA;AACA;EACW,KAAK,GAAW;IACnB,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,KAAK,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE;EAC3E;AACJ","ignoreList":[]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
3
|
/*
|
|
5
4
|
Copyright 2015 - 2021 Matrix.org Foundation C.I.C.
|
|
6
5
|
|
|
@@ -20,14 +19,14 @@ limitations under the License.
|
|
|
20
19
|
import { UNREAD_THREAD_NOTIFICATIONS } from "./@types/sync.js";
|
|
21
20
|
import { FilterComponent } from "./filter-component.js";
|
|
22
21
|
import { NamespacedValue } from "./NamespacedValue.js";
|
|
23
|
-
|
|
22
|
+
const profileFieldsFilterName = new NamespacedValue("profile_fields", "org.matrix.msc4429.profile_fields");
|
|
24
23
|
|
|
25
24
|
/**
|
|
26
25
|
*/
|
|
27
26
|
function setProp(obj, keyNesting, val) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
for (
|
|
27
|
+
const nestedKeys = keyNesting.split(".");
|
|
28
|
+
let currentObj = obj;
|
|
29
|
+
for (let i = 0; i < nestedKeys.length - 1; i++) {
|
|
31
30
|
if (!currentObj[nestedKeys[i]]) {
|
|
32
31
|
currentObj[nestedKeys[i]] = {};
|
|
33
32
|
}
|
|
@@ -49,7 +48,7 @@ export class Filter {
|
|
|
49
48
|
* Create a filter from existing data.
|
|
50
49
|
*/
|
|
51
50
|
static fromJson(userId, filterId, jsonObj) {
|
|
52
|
-
|
|
51
|
+
const filter = new Filter(userId, filterId);
|
|
53
52
|
filter.setDefinition(jsonObj);
|
|
54
53
|
return filter;
|
|
55
54
|
}
|
|
@@ -60,6 +59,8 @@ export class Filter {
|
|
|
60
59
|
*/
|
|
61
60
|
constructor(userId, filterId) {
|
|
62
61
|
_defineProperty(this, "definition", {});
|
|
62
|
+
_defineProperty(this, "roomFilter", void 0);
|
|
63
|
+
_defineProperty(this, "roomTimelineFilter", void 0);
|
|
63
64
|
this.userId = userId;
|
|
64
65
|
this.filterId = filterId;
|
|
65
66
|
}
|
|
@@ -120,10 +121,10 @@ export class Filter {
|
|
|
120
121
|
// "event_fields": ["type", "content", "sender"]
|
|
121
122
|
// }
|
|
122
123
|
|
|
123
|
-
|
|
124
|
+
const roomFilterJson = definition.room;
|
|
124
125
|
|
|
125
126
|
// consider the top level rooms/not_rooms filter
|
|
126
|
-
|
|
127
|
+
const roomFilterFields = {};
|
|
127
128
|
if (roomFilterJson) {
|
|
128
129
|
if (roomFilterJson.rooms) {
|
|
129
130
|
roomFilterFields.rooms = roomFilterJson.rooms;
|
|
@@ -133,7 +134,7 @@ export class Filter {
|
|
|
133
134
|
}
|
|
134
135
|
}
|
|
135
136
|
this.roomFilter = new FilterComponent(roomFilterFields, this.userId);
|
|
136
|
-
this.roomTimelineFilter = new FilterComponent(
|
|
137
|
+
this.roomTimelineFilter = new FilterComponent(roomFilterJson?.timeline || {}, this.userId);
|
|
137
138
|
|
|
138
139
|
// don't bother porting this from synapse yet:
|
|
139
140
|
// this._room_state_filter =
|
|
@@ -184,10 +185,9 @@ export class Filter {
|
|
|
184
185
|
* Enable threads unread notification
|
|
185
186
|
*/
|
|
186
187
|
setUnreadThreadNotifications(enabled) {
|
|
187
|
-
var _this$definition, _this$definition2;
|
|
188
188
|
this.definition = _objectSpread(_objectSpread({}, this.definition), {}, {
|
|
189
|
-
room: _objectSpread(_objectSpread({},
|
|
190
|
-
timeline: _objectSpread(_objectSpread({},
|
|
189
|
+
room: _objectSpread(_objectSpread({}, this.definition?.room), {}, {
|
|
190
|
+
timeline: _objectSpread(_objectSpread({}, this.definition?.room?.timeline), {}, {
|
|
191
191
|
[UNREAD_THREAD_NOTIFICATIONS.name]: enabled
|
|
192
192
|
})
|
|
193
193
|
})
|
|
@@ -213,8 +213,7 @@ export class Filter {
|
|
|
213
213
|
* @experimental
|
|
214
214
|
*/
|
|
215
215
|
setUnstableMSC4429SyncUserProfiles(ids, stable) {
|
|
216
|
-
|
|
217
|
-
var field = stable ? profileFieldsFilterName.name : (_profileFieldsFilterN = profileFieldsFilterName.unstable) !== null && _profileFieldsFilterN !== void 0 ? _profileFieldsFilterN : profileFieldsFilterName.name;
|
|
216
|
+
const field = stable ? profileFieldsFilterName.name : profileFieldsFilterName.unstable ?? profileFieldsFilterName.name;
|
|
218
217
|
this.definition[field] = {
|
|
219
218
|
ids
|
|
220
219
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.js","names":["UNREAD_THREAD_NOTIFICATIONS","FilterComponent","NamespacedValue","profileFieldsFilterName","setProp","obj","keyNesting","val","nestedKeys","split","currentObj","i","length","Filter","fromJson","userId","filterId","jsonObj","filter","setDefinition","constructor","_defineProperty","getFilterId","getDefinition","definition","roomFilterJson","room","roomFilterFields","rooms","not_rooms","roomFilter","roomTimelineFilter","timeline","getRoomTimelineFilterComponent","filterRoomTimeline","events","setTimelineLimit","limit","setUnreadThreadNotifications","enabled","_this$definition","_this$definition2","_objectSpread","name","setLazyLoadMembers","setIncludeLeaveRooms","includeLeave","setUnstableMSC4429SyncUserProfiles","ids","stable","_profileFieldsFilterN","field","unstable","lazy_load_members"],"sources":["../src/filter.ts"],"sourcesContent":["/*\nCopyright 2015 - 2021 Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { type EventType, type RelationType } from \"./@types/event.ts\";\nimport { UNREAD_THREAD_NOTIFICATIONS } from \"./@types/sync.ts\";\nimport { FilterComponent, type IFilterComponent } from \"./filter-component.ts\";\nimport { type MatrixEvent } from \"./models/event.ts\";\nimport { NamespacedValue } from \"./NamespacedValue.ts\";\n\nconst profileFieldsFilterName = new NamespacedValue(\"profile_fields\", \"org.matrix.msc4429.profile_fields\");\n\n/**\n */\nfunction setProp(obj: Record<string, any>, keyNesting: string, val: any): void {\n const nestedKeys = keyNesting.split(\".\") as [keyof typeof obj];\n let currentObj = obj;\n for (let i = 0; i < nestedKeys.length - 1; i++) {\n if (!currentObj[nestedKeys[i]]) {\n currentObj[nestedKeys[i]] = {};\n }\n currentObj = currentObj[nestedKeys[i]];\n }\n currentObj[nestedKeys[nestedKeys.length - 1]] = val;\n}\n\n/* eslint-disable camelcase */\nexport interface IFilterDefinition {\n \"event_fields\"?: string[];\n \"event_format\"?: \"client\" | \"federation\";\n \"presence\"?: IFilterComponent;\n \"account_data\"?: IFilterComponent;\n \"room\"?: IRoomFilter;\n \"profile_fields\"?: ProfileFieldsFilter;\n \"org.matrix.msc4429.profile_fields\"?: ProfileFieldsFilter;\n}\n\nexport interface IRoomEventFilter extends IFilterComponent {\n \"lazy_load_members\"?: boolean;\n \"include_redundant_members\"?: boolean;\n \"types\"?: Array<EventType | string>;\n \"related_by_senders\"?: Array<RelationType | string>;\n \"related_by_rel_types\"?: string[];\n \"unread_thread_notifications\"?: boolean;\n \"org.matrix.msc3773.unread_thread_notifications\"?: boolean;\n\n // Unstable values\n \"io.element.relation_senders\"?: Array<RelationType | string>;\n \"io.element.relation_types\"?: string[];\n}\n\ninterface IStateFilter extends IRoomEventFilter {}\n\ninterface IRoomFilter {\n not_rooms?: string[];\n rooms?: string[];\n ephemeral?: IRoomEventFilter;\n include_leave?: boolean;\n state?: IStateFilter;\n timeline?: IRoomEventFilter;\n account_data?: IRoomEventFilter;\n}\n\n/**\n * Filter section used for requesting a set of extended profile fields that will be sent down the sync stream.\n */\ninterface ProfileFieldsFilter {\n ids: string[];\n}\n\n/* eslint-enable camelcase */\n\nexport class Filter {\n public static LAZY_LOADING_MESSAGES_FILTER = {\n lazy_load_members: true,\n };\n\n /**\n * Create a filter from existing data.\n */\n public static fromJson(userId: string | undefined | null, filterId: string, jsonObj: IFilterDefinition): Filter {\n const filter = new Filter(userId, filterId);\n filter.setDefinition(jsonObj);\n return filter;\n }\n\n private definition: IFilterDefinition = {};\n private roomFilter?: FilterComponent;\n private roomTimelineFilter?: FilterComponent;\n\n /**\n * Construct a new Filter.\n * @param userId - The user ID for this filter.\n * @param filterId - The filter ID if known.\n */\n public constructor(\n public readonly userId: string | undefined | null,\n public filterId?: string,\n ) {}\n\n /**\n * Get the ID of this filter on your homeserver (if known)\n * @returns The filter ID\n */\n public getFilterId(): string | undefined {\n return this.filterId;\n }\n\n /**\n * Get the JSON body of the filter.\n * @returns The filter definition\n */\n public getDefinition(): IFilterDefinition {\n return this.definition;\n }\n\n /**\n * Set the JSON body of the filter\n * @param definition - The filter definition\n */\n public setDefinition(definition: IFilterDefinition): void {\n this.definition = definition;\n\n // This is all ported from synapse's FilterCollection()\n\n // definitions look something like:\n // {\n // \"room\": {\n // \"rooms\": [\"!abcde:example.com\"],\n // \"not_rooms\": [\"!123456:example.com\"],\n // \"state\": {\n // \"types\": [\"m.room.*\"],\n // \"not_rooms\": [\"!726s6s6q:example.com\"],\n // \"lazy_load_members\": true,\n // },\n // \"timeline\": {\n // \"limit\": 10,\n // \"types\": [\"m.room.message\"],\n // \"not_rooms\": [\"!726s6s6q:example.com\"],\n // \"not_senders\": [\"@spam:example.com\"]\n // \"contains_url\": true\n // },\n // \"ephemeral\": {\n // \"types\": [\"m.receipt\", \"m.typing\"],\n // \"not_rooms\": [\"!726s6s6q:example.com\"],\n // \"not_senders\": [\"@spam:example.com\"]\n // }\n // },\n // \"presence\": {\n // \"types\": [\"m.presence\"],\n // \"not_senders\": [\"@alice:example.com\"]\n // },\n // \"event_format\": \"client\",\n // \"event_fields\": [\"type\", \"content\", \"sender\"]\n // }\n\n const roomFilterJson = definition.room;\n\n // consider the top level rooms/not_rooms filter\n const roomFilterFields: IRoomFilter = {};\n if (roomFilterJson) {\n if (roomFilterJson.rooms) {\n roomFilterFields.rooms = roomFilterJson.rooms;\n }\n if (roomFilterJson.rooms) {\n roomFilterFields.not_rooms = roomFilterJson.not_rooms;\n }\n }\n\n this.roomFilter = new FilterComponent(roomFilterFields, this.userId);\n this.roomTimelineFilter = new FilterComponent(roomFilterJson?.timeline || {}, this.userId);\n\n // don't bother porting this from synapse yet:\n // this._room_state_filter =\n // new FilterComponent(roomFilterJson.state || {});\n // this._room_ephemeral_filter =\n // new FilterComponent(roomFilterJson.ephemeral || {});\n // this._room_account_data_filter =\n // new FilterComponent(roomFilterJson.account_data || {});\n // this._presence_filter =\n // new FilterComponent(definition.presence || {});\n // this._account_data_filter =\n // new FilterComponent(definition.account_data || {});\n }\n\n /**\n * Get the room.timeline filter component of the filter\n * @returns room timeline filter component\n */\n public getRoomTimelineFilterComponent(): FilterComponent | undefined {\n return this.roomTimelineFilter;\n }\n\n /**\n * Filter the list of events based on whether they are allowed in a timeline\n * based on this filter\n * @param events - the list of events being filtered\n * @returns the list of events which match the filter\n */\n public filterRoomTimeline(events: MatrixEvent[]): MatrixEvent[] {\n if (this.roomFilter) {\n events = this.roomFilter.filter(events);\n }\n if (this.roomTimelineFilter) {\n events = this.roomTimelineFilter.filter(events);\n }\n return events;\n }\n\n /**\n * Set the max number of events to return for each room's timeline.\n * @param limit - The max number of events to return for each room.\n */\n public setTimelineLimit(limit: number): void {\n setProp(this.definition, \"room.timeline.limit\", limit);\n }\n\n /**\n * Enable threads unread notification\n */\n public setUnreadThreadNotifications(enabled: boolean): void {\n this.definition = {\n ...this.definition,\n room: {\n ...this.definition?.room,\n timeline: {\n ...this.definition?.room?.timeline,\n [UNREAD_THREAD_NOTIFICATIONS.name]: enabled,\n },\n },\n };\n }\n\n public setLazyLoadMembers(enabled: boolean): void {\n setProp(this.definition, \"room.state.lazy_load_members\", enabled);\n }\n\n /**\n * Control whether left rooms should be included in responses.\n * @param includeLeave - True to make rooms the user has left appear\n * in responses.\n */\n public setIncludeLeaveRooms(includeLeave: boolean): void {\n setProp(this.definition, \"room.include_leave\", includeLeave);\n }\n\n /**\n * Set the list of fields to be included in the profile information sent down the sync stream.\n * @param ids The field IDs to sync.\n * @param stable Whether to use the stable or unstable versions of this filter.\n * @experimental\n */\n public setUnstableMSC4429SyncUserProfiles(ids: string[], stable: boolean): void {\n const field = stable\n ? profileFieldsFilterName.name\n : (profileFieldsFilterName.unstable ?? profileFieldsFilterName.name);\n this.definition[field] = { ids };\n }\n}\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,2BAA2B,QAAQ,kBAAkB;AAC9D,SAASC,eAAe,QAA+B,uBAAuB;AAE9E,SAASC,eAAe,QAAQ,sBAAsB;AAEtD,IAAMC,uBAAuB,GAAG,IAAID,eAAe,CAAC,gBAAgB,EAAE,mCAAmC,CAAC;;AAE1G;AACA;AACA,SAASE,OAAOA,CAACC,GAAwB,EAAEC,UAAkB,EAAEC,GAAQ,EAAQ;EAC3E,IAAMC,UAAU,GAAGF,UAAU,CAACG,KAAK,CAAC,GAAG,CAAuB;EAC9D,IAAIC,UAAU,GAAGL,GAAG;EACpB,KAAK,IAAIM,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,UAAU,CAACI,MAAM,GAAG,CAAC,EAAED,CAAC,EAAE,EAAE;IAC5C,IAAI,CAACD,UAAU,CAACF,UAAU,CAACG,CAAC,CAAC,CAAC,EAAE;MAC5BD,UAAU,CAACF,UAAU,CAACG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAClC;IACAD,UAAU,GAAGA,UA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AChB,UAAU,cAAAgB,gBAAA,uBAAfA,gBAAA,CAAiBd,IAAI;QACxBM,QAAQ,EAAAU,aAAA,CAAAA,aAAA,MAAAD,iBAAA,GACD,IAAI,CAACjB,UAAU,cAAAiB,iBAAA,gBAAAA,iBAAA,GAAfA,iBAAA,CAAiBf,IAAI,cAAAe,iBAAA,uBAArBA,iBAAA,CAAuBT,QAAQ;UAClC,CAAChC,2BAA2B,CAAC2C,IAAI,GAAGJ;QAAO;MAC9C;IACJ,EACJ;EACL;EAEOK,kBAAkBA,CAACL,OAAgB,EAAQ;IAC9CnC,OAAO,CAAC,IAAI,CAACoB,UAAU,EAAE,8BAA8B,EAAEe,OAAO,CAAC;EACrE;;EAEA;AACJ;AACA;AACA;AACA;EACWM,oBAAoBA,CAACC,YAAqB,EAAQ;IACrD1C,OAAO,CAAC,IAAI,CAACoB,UAAU,EAAE,oBAAoB,EAAEsB,YAAY,CAAC;EAChE;;EAEA;AACJ;AACA;AACA;AACA;AACA;EACWC,kCAAkCA,CAACC,GAAa,EAAEC,MAAe,EAAQ;IAAA,IAAAC,qBAAA;IAC5E,IAAMC,KAAK,GAAGF,MAAM,GACd9C,uBAAuB,CAACwC,IAAI,IAAAO,qBAAA,GAC3B/C,uBAAuB,CAACiD,QAAQ,cAAAF,qBAAA,cAAAA,qBAAA,GAAI/C,uBAAuB,CAACwC,IAAK;IACxE,IAAI,CAACnB,UAAU,CAAC2B,KAAK,CAAC,GAAG;MAAEH;IAAI,CAAC;EACpC;AACJ;AAAC3B,eAAA,CA1LYR,MAAM,kCAC8B;EACzCwC,iBAAiB,EAAE;AACvB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"filter.js","names":[],"sources":["../src/filter.ts"],"sourcesContent":["/*\nCopyright 2015 - 2021 Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { type EventType, type RelationType } from \"./@types/event.ts\";\nimport { UNREAD_THREAD_NOTIFICATIONS } from \"./@types/sync.ts\";\nimport { FilterComponent, type IFilterComponent } from \"./filter-component.ts\";\nimport { type MatrixEvent } from \"./models/event.ts\";\nimport { NamespacedValue } from \"./NamespacedValue.ts\";\n\nconst profileFieldsFilterName = new NamespacedValue(\"profile_fields\", \"org.matrix.msc4429.profile_fields\");\n\n/**\n */\nfunction setProp(obj: Record<string, any>, keyNesting: string, val: any): void {\n const nestedKeys = keyNesting.split(\".\") as [keyof typeof obj];\n let currentObj = obj;\n for (let i = 0; i < nestedKeys.length - 1; i++) {\n if (!currentObj[nestedKeys[i]]) {\n currentObj[nestedKeys[i]] = {};\n }\n currentObj = currentObj[nestedKeys[i]];\n }\n currentObj[nestedKeys[nestedKeys.length - 1]] = val;\n}\n\n/* eslint-disable camelcase */\nexport interface IFilterDefinition {\n \"event_fields\"?: string[];\n \"event_format\"?: \"client\" | \"federation\";\n \"presence\"?: IFilterComponent;\n \"account_data\"?: IFilterComponent;\n \"room\"?: IRoomFilter;\n \"profile_fields\"?: ProfileFieldsFilter;\n \"org.matrix.msc4429.profile_fields\"?: ProfileFieldsFilter;\n}\n\nexport interface IRoomEventFilter extends IFilterComponent {\n \"lazy_load_members\"?: boolean;\n \"include_redundant_members\"?: boolean;\n \"types\"?: Array<EventType | string>;\n \"related_by_senders\"?: Array<RelationType | string>;\n \"related_by_rel_types\"?: string[];\n \"unread_thread_notifications\"?: boolean;\n \"org.matrix.msc3773.unread_thread_notifications\"?: boolean;\n\n // Unstable values\n \"io.element.relation_senders\"?: Array<RelationType | string>;\n \"io.element.relation_types\"?: string[];\n}\n\ninterface IStateFilter extends IRoomEventFilter {}\n\ninterface IRoomFilter {\n not_rooms?: string[];\n rooms?: string[];\n ephemeral?: IRoomEventFilter;\n include_leave?: boolean;\n state?: IStateFilter;\n timeline?: IRoomEventFilter;\n account_data?: IRoomEventFilter;\n}\n\n/**\n * Filter section used for requesting a set of extended profile fields that will be sent down the sync stream.\n */\ninterface ProfileFieldsFilter {\n ids: string[];\n}\n\n/* eslint-enable camelcase */\n\nexport class Filter {\n public static LAZY_LOADING_MESSAGES_FILTER = {\n lazy_load_members: true,\n };\n\n /**\n * Create a filter from existing data.\n */\n public static fromJson(userId: string | undefined | null, filterId: string, jsonObj: IFilterDefinition): Filter {\n const filter = new Filter(userId, filterId);\n filter.setDefinition(jsonObj);\n return filter;\n }\n\n private definition: IFilterDefinition = {};\n private roomFilter?: FilterComponent;\n private roomTimelineFilter?: FilterComponent;\n\n /**\n * Construct a new Filter.\n * @param userId - The user ID for this filter.\n * @param filterId - The filter ID if known.\n */\n public constructor(\n public readonly userId: string | undefined | null,\n public filterId?: string,\n ) {}\n\n /**\n * Get the ID of this filter on your homeserver (if known)\n * @returns The filter ID\n */\n public getFilterId(): string | undefined {\n return this.filterId;\n }\n\n /**\n * Get the JSON body of the filter.\n * @returns The filter definition\n */\n public getDefinition(): IFilterDefinition {\n return this.definition;\n }\n\n /**\n * Set the JSON body of the filter\n * @param definition - The filter definition\n */\n public setDefinition(definition: IFilterDefinition): void {\n this.definition = definition;\n\n // This is all ported from synapse's FilterCollection()\n\n // definitions look something like:\n // {\n // \"room\": {\n // \"rooms\": [\"!abcde:example.com\"],\n // \"not_rooms\": [\"!123456:example.com\"],\n // \"state\": {\n // \"types\": [\"m.room.*\"],\n // \"not_rooms\": [\"!726s6s6q:example.com\"],\n // \"lazy_load_members\": true,\n // },\n // \"timeline\": {\n // \"limit\": 10,\n // \"types\": [\"m.room.message\"],\n // \"not_rooms\": [\"!726s6s6q:example.com\"],\n // \"not_senders\": [\"@spam:example.com\"]\n // \"contains_url\": true\n // },\n // \"ephemeral\": {\n // \"types\": [\"m.receipt\", \"m.typing\"],\n // \"not_rooms\": [\"!726s6s6q:example.com\"],\n // \"not_senders\": [\"@spam:example.com\"]\n // }\n // },\n // \"presence\": {\n // \"types\": [\"m.presence\"],\n // \"not_senders\": [\"@alice:example.com\"]\n // },\n // \"event_format\": \"client\",\n // \"event_fields\": [\"type\", \"content\", \"sender\"]\n // }\n\n const roomFilterJson = definition.room;\n\n // consider the top level rooms/not_rooms filter\n const roomFilterFields: IRoomFilter = {};\n if (roomFilterJson) {\n if (roomFilterJson.rooms) {\n roomFilterFields.rooms = roomFilterJson.rooms;\n }\n if (roomFilterJson.rooms) {\n roomFilterFields.not_rooms = roomFilterJson.not_rooms;\n }\n }\n\n this.roomFilter = new FilterComponent(roomFilterFields, this.userId);\n this.roomTimelineFilter = new FilterComponent(roomFilterJson?.timeline || {}, this.userId);\n\n // don't bother porting this from synapse yet:\n // this._room_state_filter =\n // new FilterComponent(roomFilterJson.state || {});\n // this._room_ephemeral_filter =\n // new FilterComponent(roomFilterJson.ephemeral || {});\n // this._room_account_data_filter =\n // new FilterComponent(roomFilterJson.account_data || {});\n // this._presence_filter =\n // new FilterComponent(definition.presence || {});\n // this._account_data_filter =\n // new FilterComponent(definition.account_data || {});\n }\n\n /**\n * Get the room.timeline filter component of the filter\n * @returns room timeline filter component\n */\n public getRoomTimelineFilterComponent(): FilterComponent | undefined {\n return this.roomTimelineFilter;\n }\n\n /**\n * Filter the list of events based on whether they are allowed in a timeline\n * based on this filter\n * @param events - the list of events being filtered\n * @returns the list of events which match the filter\n */\n public filterRoomTimeline(events: MatrixEvent[]): MatrixEvent[] {\n if (this.roomFilter) {\n events = this.roomFilter.filter(events);\n }\n if (this.roomTimelineFilter) {\n events = this.roomTimelineFilter.filter(events);\n }\n return events;\n }\n\n /**\n * Set the max number of events to return for each room's timeline.\n * @param limit - The max number of events to return for each room.\n */\n public setTimelineLimit(limit: number): void {\n setProp(this.definition, \"room.timeline.limit\", limit);\n }\n\n /**\n * Enable threads unread notification\n */\n public setUnreadThreadNotifications(enabled: boolean): void {\n this.definition = {\n ...this.definition,\n room: {\n ...this.definition?.room,\n timeline: {\n ...this.definition?.room?.timeline,\n [UNREAD_THREAD_NOTIFICATIONS.name]: enabled,\n },\n },\n };\n }\n\n public setLazyLoadMembers(enabled: boolean): void {\n setProp(this.definition, \"room.state.lazy_load_members\", enabled);\n }\n\n /**\n * Control whether left rooms should be included in responses.\n * @param includeLeave - True to make rooms the user has left appear\n * in responses.\n */\n public setIncludeLeaveRooms(includeLeave: boolean): void {\n setProp(this.definition, \"room.include_leave\", includeLeave);\n }\n\n /**\n * Set the list of fields to be included in the profile information sent down the sync stream.\n * @param ids The field IDs to sync.\n * @param stable Whether to use the stable or unstable versions of this filter.\n * @experimental\n */\n public setUnstableMSC4429SyncUserProfiles(ids: string[], stable: boolean): void {\n const field = stable\n ? profileFieldsFilterName.name\n : (profileFieldsFilterName.unstable ?? profileFieldsFilterName.name);\n this.definition[field] = { ids };\n }\n}\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAAS,2BAA2B,QAAQ,kBAAkB;AAC9D,SAAS,eAAe,QAA+B,uBAAuB;AAE9E,SAAS,eAAe,QAAQ,sBAAsB;AAEtD,MAAM,uBAAuB,GAAG,IAAI,eAAe,CAAC,gBAAgB,EAAE,mCAAmC,CAAC;;AAE1G;AACA;AACA,SAAS,OAAO,CAAC,GAAwB,EAAE,UAAkB,EAAE,GAAQ,EAAQ;EAC3E,MAAM,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAuB;EAC9D,IAAI,UAAU,GAAG,GAAG;EACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5C,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE;MAC5B,UAAU,CAAC,UAAU,CAA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OAAgB,EAAQ;IAC9C,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,8BAA8B,EAAE,OAAO,CAAC;EACrE;;EAEA;AACJ;AACA;AACA;AACA;EACW,oBAAoB,CAAC,YAAqB,EAAQ;IACrD,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,oBAAoB,EAAE,YAAY,CAAC;EAChE;;EAEA;AACJ;AACA;AACA;AACA;AACA;EACW,kCAAkC,CAAC,GAAa,EAAE,MAAe,EAAQ;IAC5E,MAAM,KAAK,GAAG,MAAM,GACd,uBAAuB,CAAC,IAAI,GAC3B,uBAAuB,CAAC,QAAQ,IAAI,uBAAuB,CAAC,IAAK;IACxE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG;MAAE;IAAI,CAAC;EACpC;AACJ;AAAC,gBA1LY,MAAM,kCAC8B;EACzC,iBAAiB,EAAE;AACvB,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
3
|
/*
|
|
6
4
|
Copyright 2022 - 2024 The Matrix.org Foundation C.I.C.
|
|
7
5
|
|
|
@@ -52,17 +50,16 @@ export class HTTPError extends Error {
|
|
|
52
50
|
* @see {@link safeGetRetryAfterMs} for a version of this check that doesn't throw.
|
|
53
51
|
*/
|
|
54
52
|
getRetryAfterMs() {
|
|
55
|
-
|
|
56
|
-
var retryAfter = (_this$httpHeaders = this.httpHeaders) === null || _this$httpHeaders === void 0 ? void 0 : _this$httpHeaders.get("Retry-After");
|
|
53
|
+
const retryAfter = this.httpHeaders?.get("Retry-After");
|
|
57
54
|
if (retryAfter != null) {
|
|
58
55
|
if (/^\d+$/.test(retryAfter)) {
|
|
59
|
-
|
|
56
|
+
const ms = Number.parseInt(retryAfter) * 1000;
|
|
60
57
|
if (!Number.isFinite(ms)) {
|
|
61
58
|
throw new Error("Retry-After header integer value is too large");
|
|
62
59
|
}
|
|
63
60
|
return ms;
|
|
64
61
|
}
|
|
65
|
-
|
|
62
|
+
const date = new Date(retryAfter);
|
|
66
63
|
if (date.toUTCString() !== retryAfter) {
|
|
67
64
|
throw new Error("Retry-After header value is not a valid HTTP-date or non-negative decimal integer");
|
|
68
65
|
}
|
|
@@ -72,12 +69,6 @@ export class HTTPError extends Error {
|
|
|
72
69
|
}
|
|
73
70
|
}
|
|
74
71
|
export class MatrixError extends HTTPError {
|
|
75
|
-
// The Matrix 'errcode' value, e.g. "M_FORBIDDEN".
|
|
76
|
-
|
|
77
|
-
// The Matrix 'error' value.
|
|
78
|
-
|
|
79
|
-
// The raw Matrix error JSON used to construct this object.
|
|
80
|
-
|
|
81
72
|
/**
|
|
82
73
|
* Construct a Matrix error. This is a JavaScript Error with additional
|
|
83
74
|
* information specific to the standard Matrix error response.
|
|
@@ -85,20 +76,21 @@ export class MatrixError extends HTTPError {
|
|
|
85
76
|
* @param httpStatus - The numeric HTTP status code given
|
|
86
77
|
* @param httpHeaders - The HTTP response headers given
|
|
87
78
|
*/
|
|
88
|
-
constructor() {
|
|
89
|
-
|
|
90
|
-
var httpStatus = arguments.length > 1 ? arguments[1] : undefined;
|
|
91
|
-
var url = arguments.length > 2 ? arguments[2] : undefined;
|
|
92
|
-
var event = arguments.length > 3 ? arguments[3] : undefined;
|
|
93
|
-
var httpHeaders = arguments.length > 4 ? arguments[4] : undefined;
|
|
94
|
-
var message = errorJson.error || "Unknown message";
|
|
79
|
+
constructor(errorJson = {}, httpStatus, url, event, httpHeaders) {
|
|
80
|
+
let message = errorJson.error || "Unknown message";
|
|
95
81
|
if (httpStatus) {
|
|
96
|
-
message =
|
|
82
|
+
message = `[${httpStatus}] ${message}`;
|
|
97
83
|
}
|
|
98
84
|
if (url) {
|
|
99
|
-
message =
|
|
85
|
+
message = `${message} (${url})`;
|
|
100
86
|
}
|
|
101
|
-
super(
|
|
87
|
+
super(`MatrixError: ${message}`, httpStatus, httpHeaders);
|
|
88
|
+
// The Matrix 'errcode' value, e.g. "M_FORBIDDEN".
|
|
89
|
+
_defineProperty(this, "errcode", void 0);
|
|
90
|
+
// The Matrix 'error' value.
|
|
91
|
+
_defineProperty(this, "error", void 0);
|
|
92
|
+
// The raw Matrix error JSON used to construct this object.
|
|
93
|
+
_defineProperty(this, "data", void 0);
|
|
102
94
|
this.url = url;
|
|
103
95
|
this.event = event;
|
|
104
96
|
this.errcode = errorJson.errcode;
|
|
@@ -110,7 +102,7 @@ export class MatrixError extends HTTPError {
|
|
|
110
102
|
return this.errcode === "M_LIMIT_EXCEEDED" || (this.errcode === "M_UNKNOWN" || this.errcode === undefined) && super.isRateLimitError();
|
|
111
103
|
}
|
|
112
104
|
getRetryAfterMs() {
|
|
113
|
-
|
|
105
|
+
const headerValue = super.getRetryAfterMs();
|
|
114
106
|
if (headerValue !== null) {
|
|
115
107
|
return headerValue;
|
|
116
108
|
}
|
|
@@ -129,23 +121,19 @@ export class MatrixError extends HTTPError {
|
|
|
129
121
|
* for use by Widget API error responses.
|
|
130
122
|
*/
|
|
131
123
|
asWidgetApiErrorData() {
|
|
132
|
-
|
|
133
|
-
var headers = {};
|
|
124
|
+
const headers = {};
|
|
134
125
|
if (this.httpHeaders) {
|
|
135
|
-
for (
|
|
136
|
-
var _ref2 = _slicedToArray(_ref3, 2);
|
|
137
|
-
var name = _ref2[0];
|
|
138
|
-
var value = _ref2[1];
|
|
126
|
+
for (const [name, value] of this.httpHeaders) {
|
|
139
127
|
headers[name] = value;
|
|
140
128
|
}
|
|
141
129
|
}
|
|
142
130
|
return {
|
|
143
|
-
http_status:
|
|
131
|
+
http_status: this.httpStatus ?? 400,
|
|
144
132
|
http_headers: headers,
|
|
145
|
-
url:
|
|
133
|
+
url: this.url ?? "",
|
|
146
134
|
response: _objectSpread({
|
|
147
|
-
errcode:
|
|
148
|
-
error:
|
|
135
|
+
errcode: this.errcode ?? "M_UNKNOWN",
|
|
136
|
+
error: this.data.error ?? "Unknown message"
|
|
149
137
|
}, this.data)
|
|
150
138
|
};
|
|
151
139
|
}
|
|
@@ -169,9 +157,8 @@ export function safeGetRetryAfterMs(error, defaultMs) {
|
|
|
169
157
|
return defaultMs;
|
|
170
158
|
}
|
|
171
159
|
try {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
} catch (_unused) {
|
|
160
|
+
return error.getRetryAfterMs() ?? defaultMs;
|
|
161
|
+
} catch {
|
|
175
162
|
return defaultMs;
|
|
176
163
|
}
|
|
177
164
|
}
|
|
@@ -184,7 +171,7 @@ export function safeGetRetryAfterMs(error, defaultMs) {
|
|
|
184
171
|
*/
|
|
185
172
|
export class ConnectionError extends Error {
|
|
186
173
|
constructor(message, cause) {
|
|
187
|
-
super(message + (cause ?
|
|
174
|
+
super(message + (cause ? `: ${cause.message}` : ""));
|
|
188
175
|
}
|
|
189
176
|
get name() {
|
|
190
177
|
return "ConnectionError";
|
|
@@ -198,8 +185,7 @@ export class ConnectionError extends Error {
|
|
|
198
185
|
*/
|
|
199
186
|
export class TokenRefreshError extends Error {
|
|
200
187
|
constructor(cause) {
|
|
201
|
-
|
|
202
|
-
super((_cause$message = cause === null || cause === void 0 ? void 0 : cause.message) !== null && _cause$message !== void 0 ? _cause$message : "");
|
|
188
|
+
super(cause?.message ?? "");
|
|
203
189
|
}
|
|
204
190
|
get name() {
|
|
205
191
|
return "TokenRefreshError";
|
|
@@ -212,14 +198,13 @@ export class TokenRefreshError extends Error {
|
|
|
212
198
|
*/
|
|
213
199
|
export class TokenRefreshLogoutError extends Error {
|
|
214
200
|
constructor(cause) {
|
|
215
|
-
|
|
216
|
-
super((_cause$message2 = cause === null || cause === void 0 ? void 0 : cause.message) !== null && _cause$message2 !== void 0 ? _cause$message2 : "");
|
|
201
|
+
super(cause?.message ?? "");
|
|
217
202
|
}
|
|
218
203
|
get name() {
|
|
219
204
|
return "TokenRefreshLogoutError";
|
|
220
205
|
}
|
|
221
206
|
}
|
|
222
|
-
export
|
|
207
|
+
export const MatrixSafetyErrorCode = new NamespacedValue(null, "ORG.MATRIX.MSC4387_SAFETY");
|
|
223
208
|
|
|
224
209
|
/***
|
|
225
210
|
* This error is thrown when the homeserver refuses to handle an action due to a
|
|
@@ -227,20 +212,20 @@ export var MatrixSafetyErrorCode = new NamespacedValue(null, "ORG.MATRIX.MSC4387
|
|
|
227
212
|
* @see https://github.com/matrix-org/matrix-spec-proposals/pull/4387
|
|
228
213
|
*/
|
|
229
214
|
export class MatrixSafetyError extends MatrixError {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
215
|
+
constructor(...props) {
|
|
216
|
+
super(...props);
|
|
217
|
+
/**
|
|
218
|
+
* The kinds of harms detected by the server.
|
|
219
|
+
* @see https://github.com/matrix-org/matrix-spec-proposals/pull/4387 for a list of spec defined harms.
|
|
220
|
+
*/
|
|
221
|
+
_defineProperty(this, "harms", void 0);
|
|
222
|
+
/**
|
|
223
|
+
* The date at which a request can be reattempted.
|
|
224
|
+
*/
|
|
225
|
+
_defineProperty(this, "expiry", void 0);
|
|
226
|
+
const body = props[0];
|
|
242
227
|
this.harms = new Set(body && "harms" in body && Array.isArray(body.harms) ? body.harms : []);
|
|
243
|
-
this.message =
|
|
228
|
+
this.message = `${super.message} (${[...this.harms].join(", ")})`;
|
|
244
229
|
if (body && "expiry" in body && typeof body.expiry === "number") {
|
|
245
230
|
this.expiry = new Date(body.expiry);
|
|
246
231
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","names":["NamespacedValue","HTTPError","Error","constructor","msg","httpStatus","httpHeaders","isRateLimitError","getRetryAfterMs","_this$httpHeaders","retryAfter","get","test","ms","Number","parseInt","isFinite","date","Date","toUTCString","getTime","now","MatrixError","errorJson","arguments","length","undefined","url","event","message","error","concat","errcode","name","data","headerValue","isInteger","retry_after_ms","asWidgetApiErrorData","_this$httpStatus","_this$url","_this$errcode","_this$data$error","headers","_ref3","_ref2","_slicedToArray","value","http_status","http_headers","response","_objectSpread","fromWidgetApiErrorData","Headers","safeGetRetryAfterMs","defaultMs","_error$getRetryAfterM","_unused","ConnectionError","cause","TokenRefreshError","_cause$message","TokenRefreshLogoutError","_cause$message2","MatrixSafetyErrorCode","MatrixSafetyError","body","harms","Set","Array","isArray","join","expiry"],"sources":["../../src/http-api/errors.ts"],"sourcesContent":["/*\nCopyright 2022 - 2024 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { type IMatrixApiError as IWidgetMatrixError } from \"matrix-widget-api\";\n\nimport { type IUsageLimit } from \"../@types/partials.ts\";\nimport { type MatrixEvent } from \"../models/event.ts\";\nimport { NamespacedValue } from \"../NamespacedValue.ts\";\n\ninterface IErrorJson extends Partial<IUsageLimit> {\n [key: string]: any; // extensible\n errcode?: string;\n error?: string;\n}\n\n/**\n * Construct a generic HTTP error. This is a JavaScript Error with additional information\n * specific to HTTP responses.\n * @param msg - The error message to include.\n * @param httpStatus - The HTTP response status code.\n * @param httpHeaders - The HTTP response headers.\n */\nexport class HTTPError extends Error {\n public constructor(\n msg: string,\n public readonly httpStatus?: number,\n public readonly httpHeaders?: Headers,\n ) {\n super(msg);\n }\n\n /**\n * Check if this error was due to rate-limiting on the server side (and should therefore be retried after a delay).\n *\n * If this returns `true`, {@link getRetryAfterMs} can be called to retrieve the server-side\n * recommendation for the retry period.\n *\n * @returns Whether this error is due to rate-limiting.\n */\n public isRateLimitError(): boolean {\n return this.httpStatus === 429;\n }\n\n /**\n * @returns The recommended delay in milliseconds to wait before retrying\n * the request that triggered this error, or null if no delay is recommended.\n * @throws Error if the recommended delay is an invalid value.\n * @see {@link safeGetRetryAfterMs} for a version of this check that doesn't throw.\n */\n public getRetryAfterMs(): number | null {\n const retryAfter = this.httpHeaders?.get(\"Retry-After\");\n if (retryAfter != null) {\n if (/^\\d+$/.test(retryAfter)) {\n const ms = Number.parseInt(retryAfter) * 1000;\n if (!Number.isFinite(ms)) {\n throw new Error(\"Retry-After header integer value is too large\");\n }\n return ms;\n }\n const date = new Date(retryAfter);\n if (date.toUTCString() !== retryAfter) {\n throw new Error(\"Retry-After header value is not a valid HTTP-date or non-negative decimal integer\");\n }\n return date.getTime() - Date.now();\n }\n return null;\n }\n}\n\nexport class MatrixError extends HTTPError {\n // The Matrix 'errcode' value, e.g. \"M_FORBIDDEN\".\n public readonly errcode?: string;\n // The Matrix 'error' value.\n public readonly error?: string;\n // The raw Matrix error JSON used to construct this object.\n public data: IErrorJson;\n\n /**\n * Construct a Matrix error. This is a JavaScript Error with additional\n * information specific to the standard Matrix error response.\n * @param errorJson - The Matrix error JSON returned from the homeserver.\n * @param httpStatus - The numeric HTTP status code given\n * @param httpHeaders - The HTTP response headers given\n */\n public constructor(\n errorJson: IErrorJson = {},\n httpStatus?: number,\n public url?: string,\n public event?: MatrixEvent,\n httpHeaders?: Headers,\n ) {\n let message = errorJson.error || \"Unknown message\";\n if (httpStatus) {\n message = `[${httpStatus}] ${message}`;\n }\n if (url) {\n message = `${message} (${url})`;\n }\n super(`MatrixError: ${message}`, httpStatus, httpHeaders);\n this.errcode = errorJson.errcode;\n this.error = errorJson.error;\n this.name = errorJson.errcode || \"Unknown error code\";\n this.data = errorJson;\n }\n\n public isRateLimitError(): boolean {\n return (\n this.errcode === \"M_LIMIT_EXCEEDED\" ||\n ((this.errcode === \"M_UNKNOWN\" || this.errcode === undefined) && super.isRateLimitError())\n );\n }\n\n public getRetryAfterMs(): number | null {\n const headerValue = super.getRetryAfterMs();\n if (headerValue !== null) {\n return headerValue;\n }\n // Note: retry_after_ms is deprecated as of spec version v1.10\n if (this.errcode === \"M_LIMIT_EXCEEDED\" && \"retry_after_ms\" in this.data) {\n if (!Number.isInteger(this.data.retry_after_ms)) {\n throw new Error(\"retry_after_ms is not an integer\");\n }\n return this.data.retry_after_ms;\n }\n return null;\n }\n\n /**\n * @returns this error expressed as a JSON payload\n * for use by Widget API error responses.\n */\n public asWidgetApiErrorData(): IWidgetMatrixError {\n const headers: Record<string, string> = {};\n if (this.httpHeaders) {\n for (const [name, value] of this.httpHeaders) {\n headers[name] = value;\n }\n }\n return {\n http_status: this.httpStatus ?? 400,\n http_headers: headers,\n url: this.url ?? \"\",\n response: {\n errcode: this.errcode ?? \"M_UNKNOWN\",\n error: this.data.error ?? \"Unknown message\",\n ...this.data,\n },\n };\n }\n\n /**\n * @returns a new {@link MatrixError} from a JSON payload\n * received from Widget API error responses.\n */\n public static fromWidgetApiErrorData(data: IWidgetMatrixError): MatrixError {\n return new MatrixError(data.response, data.http_status, data.url, undefined, new Headers(data.http_headers));\n }\n}\n\n/**\n * @returns The recommended delay in milliseconds to wait before retrying the request.\n * @param error - The error to check for a retry delay.\n * @param defaultMs - The delay to use if the error was not due to rate-limiting or if no valid delay is recommended.\n */\nexport function safeGetRetryAfterMs(error: unknown, defaultMs: number): number {\n if (!(error instanceof HTTPError) || !error.isRateLimitError()) {\n return defaultMs;\n }\n try {\n return error.getRetryAfterMs() ?? defaultMs;\n } catch {\n return defaultMs;\n }\n}\n\n/**\n * Construct a ConnectionError. This is a JavaScript Error indicating\n * that a request failed because of some error with the connection, either\n * CORS was not correctly configured on the server, the server didn't response,\n * the request timed out, or the internet connection on the client side went down.\n */\nexport class ConnectionError extends Error {\n public constructor(message: string, cause?: Error) {\n super(message + (cause ? `: ${cause.message}` : \"\"));\n }\n\n public get name(): string {\n return \"ConnectionError\";\n }\n}\n\n/**\n * Construct a TokenRefreshError. This indicates that a request failed due to the token being expired,\n * and attempting to refresh said token also failed but in a way which was not indicative of token invalidation.\n * Assumed to be a temporary failure.\n */\nexport class TokenRefreshError extends Error {\n public constructor(cause?: Error) {\n super(cause?.message ?? \"\");\n }\n\n public get name(): string {\n return \"TokenRefreshError\";\n }\n}\n\n/**\n * Construct a TokenRefreshError. This indicates that a request failed due to the token being expired,\n * and attempting to refresh said token failed in a way indicative of token invalidation.\n */\nexport class TokenRefreshLogoutError extends Error {\n public constructor(cause?: Error) {\n super(cause?.message ?? \"\");\n }\n\n public get name(): string {\n return \"TokenRefreshLogoutError\";\n }\n}\n\nexport const MatrixSafetyErrorCode = new NamespacedValue(null, \"ORG.MATRIX.MSC4387_SAFETY\");\n\n/***\n * This error is thrown when the homeserver refuses to handle an action due to a\n * safety concern.\n * @see https://github.com/matrix-org/matrix-spec-proposals/pull/4387\n */\nexport class MatrixSafetyError extends MatrixError {\n /**\n * The kinds of harms detected by the server.\n * @see https://github.com/matrix-org/matrix-spec-proposals/pull/4387 for a list of spec defined harms.\n */\n public readonly harms: Set<string>;\n /**\n * The date at which a request can be reattempted.\n */\n public readonly expiry?: Date;\n public constructor(...props: ConstructorParameters<typeof MatrixError>) {\n super(...props);\n const body = props[0];\n\n this.harms = new Set(body && \"harms\" in body && Array.isArray(body.harms) ? body.harms : []);\n this.message = `${super.message} (${[...this.harms].join(\", \")})`;\n if (body && \"expiry\" in body && typeof body.expiry === \"number\") {\n this.expiry = new Date(body.expiry);\n }\n }\n}\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,SAASA,eAAe,QAAQ,uBAAuB;AAQvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,SAASC,KAAK,CAAC;EAC1BC,WAAWA,CACdC,GAAW,EACKC,UAAmB,EACnBC,WAAqB,EACvC;IACE,KAAK,CAACF,GAAG,CAAC;IAAC,KAHKC,UAAmB,GAAnBA,UAAmB;IAAA,KACnBC,WAAqB,GAArBA,WAAqB;EAGzC;;EAEA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;EACWC,gBAAgBA,CAAA,EAAY;IAC/B,OAAO,IAAI,CAACF,UAAU,KAAK,GAAG;EAClC;;EAEA;AACJ;AACA;AACA;AACA;AACA;EACWG,eAAeA,CAAA,EAAkB;IAAA,IAAAC,iBAAA;IACpC,IAAMC,UAAU,IAAAD,iBAAA,GAAG,IAAI,CAACH,WAAW,cAAAG,iBAAA,uBAAhBA,iBAAA,CAAkBE,GAAG,CAAC,aAAa,CAAC;IACvD,IAAID,UAAU,IAAI,IAAI,EAAE;MACpB,IAAI,OAAO,CAACE,IAAI,CAACF,UAAU,CAAC,EAAE;QAC1B,IAAMG,EAAE,GAAGC,MAAM,CAACC,QAAQ,CAACL,UAAU,CAAC,GAAG,IAAI;QAC7C,IAAI,CAACI,MAAM,CAACE,QAAQ,CAACH,EAAE,CAAC,EAAE;UACtB,MAAM,IAAIX,KAAK,CAAC,+CAA+C,CAAC;QACpE;QACA,OAAOW,EAAE;MACb;MACA,IAAMI,IAAI,GAAG,IAAIC,IAAI,CAACR,UAAU,CAAC;MACjC,IAAIO,IAAI,CAACE,WAAW,CAAC,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,IAAI,OAAO,IAAIA,IAAI,IAAIG,KAAK,CAACC,OAAO,CAACJ,IAAI,CAACC,KAAK,CAAC,GAAGD,IAAI,CAACC,KAAK,GAAG,EAAE,CAAC;IAC5F,IAAI,CAACtC,OAAO,MAAAE,MAAA,CAAM,KAAK,CAACF,OAAO,QAAAE,MAAA,CAAK,CAAC,GAAG,IAAI,CAACoC,KAAK,CAAC,CAACI,IAAI,CAAC,IAAI,CAAC,MAAG;IACjE,IAAIL,IAAI,IAAI,QAAQ,IAAIA,IAAI,IAAI,OAAOA,IAAI,CAACM,MAAM,KAAK,QAAQ,EAAE;MAC7D,IAAI,CAACA,MAAM,GAAG,IAAItD,IAAI,CAACgD,IAAI,CAACM,MAAM,CAAC;IACvC;EACJ;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"errors.js","names":[],"sources":["../../src/http-api/errors.ts"],"sourcesContent":["/*\nCopyright 2022 - 2024 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { type IMatrixApiError as IWidgetMatrixError } from \"matrix-widget-api\";\n\nimport { type IUsageLimit } from \"../@types/partials.ts\";\nimport { type MatrixEvent } from \"../models/event.ts\";\nimport { NamespacedValue } from \"../NamespacedValue.ts\";\n\ninterface IErrorJson extends Partial<IUsageLimit> {\n [key: string]: any; // extensible\n errcode?: string;\n error?: string;\n}\n\n/**\n * Construct a generic HTTP error. This is a JavaScript Error with additional information\n * specific to HTTP responses.\n * @param msg - The error message to include.\n * @param httpStatus - The HTTP response status code.\n * @param httpHeaders - The HTTP response headers.\n */\nexport class HTTPError extends Error {\n public constructor(\n msg: string,\n public readonly httpStatus?: number,\n public readonly httpHeaders?: Headers,\n ) {\n super(msg);\n }\n\n /**\n * Check if this error was due to rate-limiting on the server side (and should therefore be retried after a delay).\n *\n * If this returns `true`, {@link getRetryAfterMs} can be called to retrieve the server-side\n * recommendation for the retry period.\n *\n * @returns Whether this error is due to rate-limiting.\n */\n public isRateLimitError(): boolean {\n return this.httpStatus === 429;\n }\n\n /**\n * @returns The recommended delay in milliseconds to wait before retrying\n * the request that triggered this error, or null if no delay is recommended.\n * @throws Error if the recommended delay is an invalid value.\n * @see {@link safeGetRetryAfterMs} for a version of this check that doesn't throw.\n */\n public getRetryAfterMs(): number | null {\n const retryAfter = this.httpHeaders?.get(\"Retry-After\");\n if (retryAfter != null) {\n if (/^\\d+$/.test(retryAfter)) {\n const ms = Number.parseInt(retryAfter) * 1000;\n if (!Number.isFinite(ms)) {\n throw new Error(\"Retry-After header integer value is too large\");\n }\n return ms;\n }\n const date = new Date(retryAfter);\n if (date.toUTCString() !== retryAfter) {\n throw new Error(\"Retry-After header value is not a valid HTTP-date or non-negative decimal integer\");\n }\n return date.getTime() - Date.now();\n }\n return null;\n }\n}\n\nexport class MatrixError extends HTTPError {\n // The Matrix 'errcode' value, e.g. \"M_FORBIDDEN\".\n public readonly errcode?: string;\n // The Matrix 'error' value.\n public readonly error?: string;\n // The raw Matrix error JSON used to construct this object.\n public data: IErrorJson;\n\n /**\n * Construct a Matrix error. This is a JavaScript Error with additional\n * information specific to the standard Matrix error response.\n * @param errorJson - The Matrix error JSON returned from the homeserver.\n * @param httpStatus - The numeric HTTP status code given\n * @param httpHeaders - The HTTP response headers given\n */\n public constructor(\n errorJson: IErrorJson = {},\n httpStatus?: number,\n public url?: string,\n public event?: MatrixEvent,\n httpHeaders?: Headers,\n ) {\n let message = errorJson.error || \"Unknown message\";\n if (httpStatus) {\n message = `[${httpStatus}] ${message}`;\n }\n if (url) {\n message = `${message} (${url})`;\n }\n super(`MatrixError: ${message}`, httpStatus, httpHeaders);\n this.errcode = errorJson.errcode;\n this.error = errorJson.error;\n this.name = errorJson.errcode || \"Unknown error code\";\n this.data = errorJson;\n }\n\n public isRateLimitError(): boolean {\n return (\n this.errcode === \"M_LIMIT_EXCEEDED\" ||\n ((this.errcode === \"M_UNKNOWN\" || this.errcode === undefined) && super.isRateLimitError())\n );\n }\n\n public getRetryAfterMs(): number | null {\n const headerValue = super.getRetryAfterMs();\n if (headerValue !== null) {\n return headerValue;\n }\n // Note: retry_after_ms is deprecated as of spec version v1.10\n if (this.errcode === \"M_LIMIT_EXCEEDED\" && \"retry_after_ms\" in this.data) {\n if (!Number.isInteger(this.data.retry_after_ms)) {\n throw new Error(\"retry_after_ms is not an integer\");\n }\n return this.data.retry_after_ms;\n }\n return null;\n }\n\n /**\n * @returns this error expressed as a JSON payload\n * for use by Widget API error responses.\n */\n public asWidgetApiErrorData(): IWidgetMatrixError {\n const headers: Record<string, string> = {};\n if (this.httpHeaders) {\n for (const [name, value] of this.httpHeaders) {\n headers[name] = value;\n }\n }\n return {\n http_status: this.httpStatus ?? 400,\n http_headers: headers,\n url: this.url ?? \"\",\n response: {\n errcode: this.errcode ?? \"M_UNKNOWN\",\n error: this.data.error ?? \"Unknown message\",\n ...this.data,\n },\n };\n }\n\n /**\n * @returns a new {@link MatrixError} from a JSON payload\n * received from Widget API error responses.\n */\n public static fromWidgetApiErrorData(data: IWidgetMatrixError): MatrixError {\n return new MatrixError(data.response, data.http_status, data.url, undefined, new Headers(data.http_headers));\n }\n}\n\n/**\n * @returns The recommended delay in milliseconds to wait before retrying the request.\n * @param error - The error to check for a retry delay.\n * @param defaultMs - The delay to use if the error was not due to rate-limiting or if no valid delay is recommended.\n */\nexport function safeGetRetryAfterMs(error: unknown, defaultMs: number): number {\n if (!(error instanceof HTTPError) || !error.isRateLimitError()) {\n return defaultMs;\n }\n try {\n return error.getRetryAfterMs() ?? defaultMs;\n } catch {\n return defaultMs;\n }\n}\n\n/**\n * Construct a ConnectionError. This is a JavaScript Error indicating\n * that a request failed because of some error with the connection, either\n * CORS was not correctly configured on the server, the server didn't response,\n * the request timed out, or the internet connection on the client side went down.\n */\nexport class ConnectionError extends Error {\n public constructor(message: string, cause?: Error) {\n super(message + (cause ? `: ${cause.message}` : \"\"));\n }\n\n public get name(): string {\n return \"ConnectionError\";\n }\n}\n\n/**\n * Construct a TokenRefreshError. This indicates that a request failed due to the token being expired,\n * and attempting to refresh said token also failed but in a way which was not indicative of token invalidation.\n * Assumed to be a temporary failure.\n */\nexport class TokenRefreshError extends Error {\n public constructor(cause?: Error) {\n super(cause?.message ?? \"\");\n }\n\n public get name(): string {\n return \"TokenRefreshError\";\n }\n}\n\n/**\n * Construct a TokenRefreshError. This indicates that a request failed due to the token being expired,\n * and attempting to refresh said token failed in a way indicative of token invalidation.\n */\nexport class TokenRefreshLogoutError extends Error {\n public constructor(cause?: Error) {\n super(cause?.message ?? \"\");\n }\n\n public get name(): string {\n return \"TokenRefreshLogoutError\";\n }\n}\n\nexport const MatrixSafetyErrorCode = new NamespacedValue(null, \"ORG.MATRIX.MSC4387_SAFETY\");\n\n/***\n * This error is thrown when the homeserver refuses to handle an action due to a\n * safety concern.\n * @see https://github.com/matrix-org/matrix-spec-proposals/pull/4387\n */\nexport class MatrixSafetyError extends MatrixError {\n /**\n * The kinds of harms detected by the server.\n * @see https://github.com/matrix-org/matrix-spec-proposals/pull/4387 for a list of spec defined harms.\n */\n public readonly harms: Set<string>;\n /**\n * The date at which a request can be reattempted.\n */\n public readonly expiry?: Date;\n public constructor(...props: ConstructorParameters<typeof MatrixError>) {\n super(...props);\n const body = props[0];\n\n this.harms = new Set(body && \"harms\" in body && Array.isArray(body.harms) ? body.harms : []);\n this.message = `${super.message} (${[...this.harms].join(\", \")})`;\n if (body && \"expiry\" in body && typeof body.expiry === \"number\") {\n this.expiry = new Date(body.expiry);\n }\n }\n}\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA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