From a1328d8ef70c6dba620caeab56b3c0a6867f79b4 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 9 Aug 2023 16:10:54 +0100 Subject: [PATCH] Switch to importing more things from the main js-sdk export (#11376) --- .eslintrc.js | 20 +++++++++++++++++++ src/LegacyCallHandler.tsx | 3 +-- src/Searching.ts | 3 +-- src/boundThreepids.ts | 3 +-- src/components/structures/RoomView.tsx | 2 +- src/components/structures/TimelinePanel.tsx | 4 ++-- src/components/structures/auth/SoftLogout.tsx | 2 +- .../context_menus/MessageContextMenu.tsx | 2 +- .../dialogs/MessageEditHistoryDialog.tsx | 3 +-- .../views/emojipicker/ReactionPicker.tsx | 3 +-- .../views/location/shareLocation.ts | 3 +-- .../views/messages/DateSeparator.tsx | 3 +-- src/components/views/messages/MPollBody.tsx | 4 +--- .../views/messages/MessageActionBar.tsx | 2 +- .../views/messages/ReactionsRow.tsx | 3 +-- .../polls/pollHistory/PollListItemEnded.tsx | 3 +-- src/components/views/rooms/EventTile.tsx | 2 +- .../views/rooms/PinnedEventTile.tsx | 3 +-- src/components/views/rooms/RoomPreviewBar.tsx | 11 ++++++++-- .../views/settings/Notifications.tsx | 2 +- .../views/settings/devices/DeviceDetails.tsx | 3 +-- .../settings/devices/FilteredDeviceList.tsx | 3 +-- .../views/settings/devices/useOwnDevices.ts | 2 +- .../payloads/JoinRoomErrorPayload.ts | 2 +- src/events/RelationsHelper.ts | 11 ++++++++-- src/indexing/EventIndex.ts | 2 +- src/notifications/ContentRules.ts | 2 +- src/notifications/NotificationUtils.ts | 2 +- src/notifications/PushRuleVectorState.ts | 2 +- src/notifications/StandardActions.ts | 2 +- .../VectorPushRulesDefinitions.ts | 2 +- src/rageshake/submit-rageshake.ts | 2 +- .../controllers/NotificationControllers.ts | 2 +- src/stores/RoomViewStore.tsx | 3 +-- src/utils/DecryptFile.ts | 2 +- src/utils/ErrorUtils.tsx | 2 +- src/utils/IdentityServerUtils.ts | 3 +-- src/utils/MultiInviter.ts | 3 +-- src/utils/pushRules/monitorSyncedPushRules.ts | 3 +-- test/RoomNotifs-test.ts | 3 ++- .../structures/RoomSearchView-test.tsx | 3 +-- .../structures/RoomStatusBar-test.tsx | 10 ++++++++-- .../views/messages/DateSeparator-test.tsx | 3 +-- .../views/messages/MBeaconBody-test.tsx | 10 ++++++++-- .../views/messages/MPollBody-test.tsx | 3 +-- .../discovery/EmailAddresses-test.tsx | 3 +-- test/test-utils/relations.ts | 2 +- test/utils/ErrorUtils-test.ts | 2 +- .../models/VoiceBroadcastRecording-test.ts | 2 +- 49 files changed, 100 insertions(+), 75 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 0cd94ce4f2..5d810164fd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -114,6 +114,26 @@ module.exports = { name: "matrix-js-sdk/src/client", message: "Please use matrix-js-sdk/src/matrix instead", }, + { + name: "matrix-js-sdk/src/models/search-result", + message: "Please use matrix-js-sdk/src/matrix instead", + }, + { + name: "matrix-js-sdk/src/models/poll", + message: "Please use matrix-js-sdk/src/matrix instead", + }, + { + name: "matrix-js-sdk/src/models/relations", + message: "Please use matrix-js-sdk/src/matrix instead", + }, + { + name: "matrix-js-sdk/src/http-api", + message: "Please use matrix-js-sdk/src/matrix instead", + }, + { + name: "matrix-js-sdk/src/@types/PushRules", + message: "Please use matrix-js-sdk/src/matrix instead", + }, { name: "matrix-react-sdk", message: "Please use matrix-react-sdk/src/index instead", diff --git a/src/LegacyCallHandler.tsx b/src/LegacyCallHandler.tsx index 1414fc2893..c1a19a62db 100644 --- a/src/LegacyCallHandler.tsx +++ b/src/LegacyCallHandler.tsx @@ -18,7 +18,7 @@ limitations under the License. */ import React from "react"; -import { MatrixError } from "matrix-js-sdk/src/matrix"; +import { MatrixError, RuleId, TweakName } from "matrix-js-sdk/src/matrix"; import { CallError, CallErrorCode, @@ -31,7 +31,6 @@ import { } from "matrix-js-sdk/src/webrtc/call"; import { logger } from "matrix-js-sdk/src/logger"; import EventEmitter from "events"; -import { RuleId, TweakName } from "matrix-js-sdk/src/@types/PushRules"; import { PushProcessor } from "matrix-js-sdk/src/pushprocessor"; import { SyncState } from "matrix-js-sdk/src/sync"; import { CallEventHandlerEvent } from "matrix-js-sdk/src/webrtc/callEventHandler"; diff --git a/src/Searching.ts b/src/Searching.ts index cba7b6762e..af73d0ae47 100644 --- a/src/Searching.ts +++ b/src/Searching.ts @@ -23,8 +23,7 @@ import { SearchOrderBy, } from "matrix-js-sdk/src/@types/search"; import { IRoomEventFilter } from "matrix-js-sdk/src/filter"; -import { EventType, MatrixClient } from "matrix-js-sdk/src/matrix"; -import { SearchResult } from "matrix-js-sdk/src/models/search-result"; +import { EventType, MatrixClient, SearchResult } from "matrix-js-sdk/src/matrix"; import { ISearchArgs } from "./indexing/BaseEventIndexManager"; import EventIndexPeg from "./indexing/EventIndexPeg"; diff --git a/src/boundThreepids.ts b/src/boundThreepids.ts index 5fbc3ca550..42a81876fb 100644 --- a/src/boundThreepids.ts +++ b/src/boundThreepids.ts @@ -15,8 +15,7 @@ limitations under the License. */ import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; -import { MatrixError } from "matrix-js-sdk/src/http-api"; +import { MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; import IdentityAuthClient from "./IdentityAuthClient"; diff --git a/src/components/structures/RoomView.tsx b/src/components/structures/RoomView.tsx index 0a2e06fc43..b93481f467 100644 --- a/src/components/structures/RoomView.tsx +++ b/src/components/structures/RoomView.tsx @@ -34,11 +34,11 @@ import { HistoryVisibility, JoinRule, ClientEvent, + MatrixError, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { CallState, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import { throttle } from "lodash"; -import { MatrixError } from "matrix-js-sdk/src/http-api"; import { CryptoEvent } from "matrix-js-sdk/src/crypto"; import { THREAD_RELATION_TYPE } from "matrix-js-sdk/src/models/thread"; import { ISearchResults } from "matrix-js-sdk/src/@types/search"; diff --git a/src/components/structures/TimelinePanel.tsx b/src/components/structures/TimelinePanel.tsx index e63c1beecb..7d639eceaf 100644 --- a/src/components/structures/TimelinePanel.tsx +++ b/src/components/structures/TimelinePanel.tsx @@ -31,6 +31,8 @@ import { RelationType, ClientEvent, MatrixClient, + Relations, + MatrixError, } from "matrix-js-sdk/src/matrix"; import { TimelineWindow } from "matrix-js-sdk/src/timeline-window"; import { SyncState } from "matrix-js-sdk/src/sync"; @@ -38,8 +40,6 @@ import { debounce, findLastIndex, throttle } from "lodash"; import { logger } from "matrix-js-sdk/src/logger"; import { Thread, ThreadEvent } from "matrix-js-sdk/src/models/thread"; import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts"; -import { MatrixError } from "matrix-js-sdk/src/http-api"; -import { Relations } from "matrix-js-sdk/src/models/relations"; import SettingsStore from "../../settings/SettingsStore"; import { Layout } from "../../settings/enums/Layout"; diff --git a/src/components/structures/auth/SoftLogout.tsx b/src/components/structures/auth/SoftLogout.tsx index 932cdef475..4ff18492ef 100644 --- a/src/components/structures/auth/SoftLogout.tsx +++ b/src/components/structures/auth/SoftLogout.tsx @@ -18,7 +18,7 @@ import React, { ChangeEvent, SyntheticEvent } from "react"; import { logger } from "matrix-js-sdk/src/logger"; import { Optional } from "matrix-events-sdk"; import { ISSOFlow, LoginFlow, SSOAction } from "matrix-js-sdk/src/@types/auth"; -import { MatrixError } from "matrix-js-sdk/src/http-api"; +import { MatrixError } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import dis from "../../../dispatcher/dispatcher"; diff --git a/src/components/views/context_menus/MessageContextMenu.tsx b/src/components/views/context_menus/MessageContextMenu.tsx index ffe35fa4ce..f26861dd68 100644 --- a/src/components/views/context_menus/MessageContextMenu.tsx +++ b/src/components/views/context_menus/MessageContextMenu.tsx @@ -24,8 +24,8 @@ import { RoomMemberEvent, EventType, RelationType, + Relations, } from "matrix-js-sdk/src/matrix"; -import { Relations } from "matrix-js-sdk/src/models/relations"; import { M_POLL_START } from "matrix-js-sdk/src/@types/polls"; import { Thread } from "matrix-js-sdk/src/models/thread"; diff --git a/src/components/views/dialogs/MessageEditHistoryDialog.tsx b/src/components/views/dialogs/MessageEditHistoryDialog.tsx index 02edadcc32..6737995158 100644 --- a/src/components/views/dialogs/MessageEditHistoryDialog.tsx +++ b/src/components/views/dialogs/MessageEditHistoryDialog.tsx @@ -15,10 +15,9 @@ limitations under the License. */ import React from "react"; -import { MatrixEvent, EventType, RelationType, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { MatrixEvent, EventType, RelationType, MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; import { defer } from "matrix-js-sdk/src/utils"; import { logger } from "matrix-js-sdk/src/logger"; -import { MatrixError } from "matrix-js-sdk/src/http-api"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/emojipicker/ReactionPicker.tsx b/src/components/views/emojipicker/ReactionPicker.tsx index f3ed522e57..a1c07b63d7 100644 --- a/src/components/views/emojipicker/ReactionPicker.tsx +++ b/src/components/views/emojipicker/ReactionPicker.tsx @@ -16,8 +16,7 @@ limitations under the License. */ import React from "react"; -import { MatrixEvent, EventType, RelationType } from "matrix-js-sdk/src/matrix"; -import { Relations, RelationsEvent } from "matrix-js-sdk/src/models/relations"; +import { MatrixEvent, EventType, RelationType, Relations, RelationsEvent } from "matrix-js-sdk/src/matrix"; import EmojiPicker from "./EmojiPicker"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; diff --git a/src/components/views/location/shareLocation.ts b/src/components/views/location/shareLocation.ts index e9d21473d5..3ab29b2e52 100644 --- a/src/components/views/location/shareLocation.ts +++ b/src/components/views/location/shareLocation.ts @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { MatrixClient, IContent, IEventRelation } from "matrix-js-sdk/src/matrix"; -import { MatrixError } from "matrix-js-sdk/src/http-api"; +import { MatrixClient, IContent, IEventRelation, MatrixError } from "matrix-js-sdk/src/matrix"; import { makeLocationContent, makeBeaconInfoContent } from "matrix-js-sdk/src/content-helpers"; import { logger } from "matrix-js-sdk/src/logger"; import { LocationAssetType } from "matrix-js-sdk/src/@types/location"; diff --git a/src/components/views/messages/DateSeparator.tsx b/src/components/views/messages/DateSeparator.tsx index 3f9b383200..0e6815ed36 100644 --- a/src/components/views/messages/DateSeparator.tsx +++ b/src/components/views/messages/DateSeparator.tsx @@ -16,9 +16,8 @@ limitations under the License. */ import React from "react"; -import { Direction } from "matrix-js-sdk/src/matrix"; +import { Direction, ConnectionError, MatrixError, HTTPError } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { ConnectionError, MatrixError, HTTPError } from "matrix-js-sdk/src/http-api"; import { _t } from "../../../languageHandler"; import { formatFullDateNoDay, formatFullDateNoTime } from "../../../DateUtils"; diff --git a/src/components/views/messages/MPollBody.tsx b/src/components/views/messages/MPollBody.tsx index 770b725a66..f0829ca27a 100644 --- a/src/components/views/messages/MPollBody.tsx +++ b/src/components/views/messages/MPollBody.tsx @@ -16,13 +16,11 @@ limitations under the License. import React, { ReactNode } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { MatrixEvent, MatrixClient } from "matrix-js-sdk/src/matrix"; -import { Relations } from "matrix-js-sdk/src/models/relations"; +import { MatrixEvent, MatrixClient, Relations, Poll, PollEvent } from "matrix-js-sdk/src/matrix"; import { M_POLL_KIND_DISCLOSED, M_POLL_RESPONSE, M_POLL_START } from "matrix-js-sdk/src/@types/polls"; import { RelatedRelations } from "matrix-js-sdk/src/models/related-relations"; import { PollStartEvent, PollAnswerSubevent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; import { PollResponseEvent } from "matrix-js-sdk/src/extensible_events_v1/PollResponseEvent"; -import { Poll, PollEvent } from "matrix-js-sdk/src/models/poll"; import { _t } from "../../../languageHandler"; import Modal from "../../../Modal"; diff --git a/src/components/views/messages/MessageActionBar.tsx b/src/components/views/messages/MessageActionBar.tsx index 6b727c5de7..1485b1c0bc 100644 --- a/src/components/views/messages/MessageActionBar.tsx +++ b/src/components/views/messages/MessageActionBar.tsx @@ -30,7 +30,7 @@ import { Icon as TrashcanIcon } from "../../../../res/img/element-icons/trashcan import { Icon as ReplyIcon } from "../../../../res/img/element-icons/room/message-bar/reply.svg"; import { Icon as ExpandMessageIcon } from "../../../../res/img/element-icons/expand-message.svg"; import { Icon as CollapseMessageIcon } from "../../../../res/img/element-icons/collapse-message.svg"; -import type { Relations } from "matrix-js-sdk/src/models/relations"; +import type { Relations } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import dis, { defaultDispatcher } from "../../../dispatcher/dispatcher"; import ContextMenu, { aboveLeftOf, ContextMenuTooltipButton, useContextMenu } from "../../structures/ContextMenu"; diff --git a/src/components/views/messages/ReactionsRow.tsx b/src/components/views/messages/ReactionsRow.tsx index f1049e6746..9c78d3a9ed 100644 --- a/src/components/views/messages/ReactionsRow.tsx +++ b/src/components/views/messages/ReactionsRow.tsx @@ -16,8 +16,7 @@ limitations under the License. import React, { SyntheticEvent } from "react"; import classNames from "classnames"; -import { MatrixEvent, MatrixEventEvent } from "matrix-js-sdk/src/matrix"; -import { Relations, RelationsEvent } from "matrix-js-sdk/src/models/relations"; +import { MatrixEvent, MatrixEventEvent, Relations, RelationsEvent } from "matrix-js-sdk/src/matrix"; import { uniqBy } from "lodash"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/polls/pollHistory/PollListItemEnded.tsx b/src/components/views/polls/pollHistory/PollListItemEnded.tsx index c78dd19d52..75fa79a654 100644 --- a/src/components/views/polls/pollHistory/PollListItemEnded.tsx +++ b/src/components/views/polls/pollHistory/PollListItemEnded.tsx @@ -16,8 +16,7 @@ limitations under the License. import React, { useEffect, useState } from "react"; import { PollAnswerSubevent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; -import { MatrixEvent, Poll, PollEvent } from "matrix-js-sdk/src/matrix"; -import { Relations } from "matrix-js-sdk/src/models/relations"; +import { MatrixEvent, Poll, PollEvent, Relations } from "matrix-js-sdk/src/matrix"; import { Icon as PollIcon } from "../../../../../res/img/element-icons/room/composer/poll.svg"; import { _t } from "../../../../languageHandler"; diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index c216d1335b..11bfe50f73 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -28,8 +28,8 @@ import { NotificationCountType, Room, RoomEvent, + Relations, } from "matrix-js-sdk/src/matrix"; -import { Relations } from "matrix-js-sdk/src/models/relations"; import { Thread, ThreadEvent } from "matrix-js-sdk/src/models/thread"; import { logger } from "matrix-js-sdk/src/logger"; import { CallErrorCode } from "matrix-js-sdk/src/webrtc/call"; diff --git a/src/components/views/rooms/PinnedEventTile.tsx b/src/components/views/rooms/PinnedEventTile.tsx index 6b2bdd35b4..4968948c27 100644 --- a/src/components/views/rooms/PinnedEventTile.tsx +++ b/src/components/views/rooms/PinnedEventTile.tsx @@ -16,8 +16,7 @@ limitations under the License. */ import React from "react"; -import { MatrixEvent, EventType, RelationType } from "matrix-js-sdk/src/matrix"; -import { Relations } from "matrix-js-sdk/src/models/relations"; +import { MatrixEvent, EventType, RelationType, Relations } from "matrix-js-sdk/src/matrix"; import dis from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; diff --git a/src/components/views/rooms/RoomPreviewBar.tsx b/src/components/views/rooms/RoomPreviewBar.tsx index 5a2beb7bbf..613833bd66 100644 --- a/src/components/views/rooms/RoomPreviewBar.tsx +++ b/src/components/views/rooms/RoomPreviewBar.tsx @@ -15,8 +15,15 @@ limitations under the License. */ import React, { ChangeEvent, ReactNode } from "react"; -import { Room, RoomMember, EventType, RoomType, IJoinRuleEventContent, JoinRule } from "matrix-js-sdk/src/matrix"; -import { MatrixError } from "matrix-js-sdk/src/http-api"; +import { + Room, + RoomMember, + EventType, + RoomType, + IJoinRuleEventContent, + JoinRule, + MatrixError, +} from "matrix-js-sdk/src/matrix"; import classNames from "classnames"; import { RoomPreviewOpts, RoomViewLifecycle } from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; diff --git a/src/components/views/settings/Notifications.tsx b/src/components/views/settings/Notifications.tsx index 61ff474fa0..be0ad075dd 100644 --- a/src/components/views/settings/Notifications.tsx +++ b/src/components/views/settings/Notifications.tsx @@ -15,7 +15,7 @@ limitations under the License. */ import React, { ReactNode } from "react"; -import { IAnnotatedPushRule, IPusher, PushRuleAction, PushRuleKind, RuleId } from "matrix-js-sdk/src/@types/PushRules"; +import { IAnnotatedPushRule, IPusher, PushRuleAction, PushRuleKind, RuleId } from "matrix-js-sdk/src/matrix"; import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; import { logger } from "matrix-js-sdk/src/logger"; import { LocalNotificationSettings } from "matrix-js-sdk/src/@types/local_notifications"; diff --git a/src/components/views/settings/devices/DeviceDetails.tsx b/src/components/views/settings/devices/DeviceDetails.tsx index 991e772b1f..9a26da9d47 100644 --- a/src/components/views/settings/devices/DeviceDetails.tsx +++ b/src/components/views/settings/devices/DeviceDetails.tsx @@ -16,8 +16,7 @@ limitations under the License. import React from "react"; import classNames from "classnames"; -import { IPusher } from "matrix-js-sdk/src/@types/PushRules"; -import { PUSHER_ENABLED } from "matrix-js-sdk/src/matrix"; +import { IPusher, PUSHER_ENABLED } from "matrix-js-sdk/src/matrix"; import { LocalNotificationSettings } from "matrix-js-sdk/src/@types/local_notifications"; import { formatDate } from "../../../../DateUtils"; diff --git a/src/components/views/settings/devices/FilteredDeviceList.tsx b/src/components/views/settings/devices/FilteredDeviceList.tsx index 193ee73535..b6086979bc 100644 --- a/src/components/views/settings/devices/FilteredDeviceList.tsx +++ b/src/components/views/settings/devices/FilteredDeviceList.tsx @@ -15,8 +15,7 @@ limitations under the License. */ import React, { ForwardedRef, forwardRef } from "react"; -import { IPusher } from "matrix-js-sdk/src/@types/PushRules"; -import { PUSHER_DEVICE_ID } from "matrix-js-sdk/src/matrix"; +import { IPusher, PUSHER_DEVICE_ID } from "matrix-js-sdk/src/matrix"; import { LocalNotificationSettings } from "matrix-js-sdk/src/@types/local_notifications"; import { _t } from "../../../../languageHandler"; diff --git a/src/components/views/settings/devices/useOwnDevices.ts b/src/components/views/settings/devices/useOwnDevices.ts index b7eff43f0c..7093c0544e 100644 --- a/src/components/views/settings/devices/useOwnDevices.ts +++ b/src/components/views/settings/devices/useOwnDevices.ts @@ -25,9 +25,9 @@ import { PUSHER_DEVICE_ID, PUSHER_ENABLED, UNSTABLE_MSC3852_LAST_SEEN_UA, + MatrixError, } from "matrix-js-sdk/src/matrix"; import { VerificationRequest } from "matrix-js-sdk/src/crypto-api"; -import { MatrixError } from "matrix-js-sdk/src/http-api"; import { logger } from "matrix-js-sdk/src/logger"; import { LocalNotificationSettings } from "matrix-js-sdk/src/@types/local_notifications"; import { CryptoEvent } from "matrix-js-sdk/src/crypto"; diff --git a/src/dispatcher/payloads/JoinRoomErrorPayload.ts b/src/dispatcher/payloads/JoinRoomErrorPayload.ts index a77fb43a9d..c6de3d3e58 100644 --- a/src/dispatcher/payloads/JoinRoomErrorPayload.ts +++ b/src/dispatcher/payloads/JoinRoomErrorPayload.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { MatrixError } from "matrix-js-sdk/src/http-api"; +import { MatrixError } from "matrix-js-sdk/src/matrix"; import { ActionPayload } from "../payloads"; import { Action } from "../actions"; diff --git a/src/events/RelationsHelper.ts b/src/events/RelationsHelper.ts index 9f48b17c02..fbd1271c37 100644 --- a/src/events/RelationsHelper.ts +++ b/src/events/RelationsHelper.ts @@ -14,8 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { MatrixClient, MatrixEvent, MatrixEventEvent, RelationType, TypedEventEmitter } from "matrix-js-sdk/src/matrix"; -import { Relations, RelationsEvent } from "matrix-js-sdk/src/models/relations"; +import { + MatrixClient, + MatrixEvent, + MatrixEventEvent, + RelationType, + TypedEventEmitter, + Relations, + RelationsEvent, +} from "matrix-js-sdk/src/matrix"; import { IDestroyable } from "../utils/IDestroyable"; diff --git a/src/indexing/EventIndex.ts b/src/indexing/EventIndex.ts index 8c1d82a47f..9c2e755a9f 100644 --- a/src/indexing/EventIndex.ts +++ b/src/indexing/EventIndex.ts @@ -29,13 +29,13 @@ import { EventType, ClientEvent, MatrixClient, + HTTPError, } from "matrix-js-sdk/src/matrix"; import { TimelineIndex, TimelineWindow } from "matrix-js-sdk/src/timeline-window"; import { sleep } from "matrix-js-sdk/src/utils"; import { IEventWithRoomId, IMatrixProfile, IResultRoomEvents } from "matrix-js-sdk/src/@types/search"; import { logger } from "matrix-js-sdk/src/logger"; import { ISyncStateData, SyncState } from "matrix-js-sdk/src/sync"; -import { HTTPError } from "matrix-js-sdk/src/http-api"; import PlatformPeg from "../PlatformPeg"; import { MatrixClientPeg } from "../MatrixClientPeg"; diff --git a/src/notifications/ContentRules.ts b/src/notifications/ContentRules.ts index 67833245b8..feb848d630 100644 --- a/src/notifications/ContentRules.ts +++ b/src/notifications/ContentRules.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { IAnnotatedPushRule, IPushRules, PushRuleKind, PushRuleSet } from "matrix-js-sdk/src/@types/PushRules"; +import { IAnnotatedPushRule, IPushRules, PushRuleKind, PushRuleSet } from "matrix-js-sdk/src/matrix"; import { PushRuleVectorState, VectorState } from "./PushRuleVectorState"; diff --git a/src/notifications/NotificationUtils.ts b/src/notifications/NotificationUtils.ts index 7f0088afdd..696c79dedb 100644 --- a/src/notifications/NotificationUtils.ts +++ b/src/notifications/NotificationUtils.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { PushRuleAction, PushRuleActionName, TweakHighlight, TweakSound } from "matrix-js-sdk/src/@types/PushRules"; +import { PushRuleAction, PushRuleActionName, TweakHighlight, TweakSound } from "matrix-js-sdk/src/matrix"; export interface PushRuleActions { notify: boolean; diff --git a/src/notifications/PushRuleVectorState.ts b/src/notifications/PushRuleVectorState.ts index 2be2228a72..30061c1aec 100644 --- a/src/notifications/PushRuleVectorState.ts +++ b/src/notifications/PushRuleVectorState.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { IPushRule, PushRuleAction } from "matrix-js-sdk/src/@types/PushRules"; +import { IPushRule, PushRuleAction } from "matrix-js-sdk/src/matrix"; import { StandardActions } from "./StandardActions"; import { NotificationUtils } from "./NotificationUtils"; diff --git a/src/notifications/StandardActions.ts b/src/notifications/StandardActions.ts index 3ff2300fa9..79a35ce19f 100644 --- a/src/notifications/StandardActions.ts +++ b/src/notifications/StandardActions.ts @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { PushRuleAction } from "matrix-js-sdk/src/@types/PushRules"; +import { PushRuleAction } from "matrix-js-sdk/src/matrix"; import { NotificationUtils } from "./NotificationUtils"; diff --git a/src/notifications/VectorPushRulesDefinitions.ts b/src/notifications/VectorPushRulesDefinitions.ts index cfa7734282..b9a9b33411 100644 --- a/src/notifications/VectorPushRulesDefinitions.ts +++ b/src/notifications/VectorPushRulesDefinitions.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { IAnnotatedPushRule, PushRuleAction, RuleId } from "matrix-js-sdk/src/@types/PushRules"; +import { IAnnotatedPushRule, PushRuleAction, RuleId } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { _td } from "../languageHandler"; diff --git a/src/rageshake/submit-rageshake.ts b/src/rageshake/submit-rageshake.ts index 4abaafdc64..930c81e6c8 100644 --- a/src/rageshake/submit-rageshake.ts +++ b/src/rageshake/submit-rageshake.ts @@ -17,7 +17,7 @@ limitations under the License. */ import { logger } from "matrix-js-sdk/src/logger"; -import { Method } from "matrix-js-sdk/src/http-api"; +import { Method } from "matrix-js-sdk/src/matrix"; import type * as Pako from "pako"; import { MatrixClientPeg } from "../MatrixClientPeg"; diff --git a/src/settings/controllers/NotificationControllers.ts b/src/settings/controllers/NotificationControllers.ts index 1827ab98ec..52b78a3a65 100644 --- a/src/settings/controllers/NotificationControllers.ts +++ b/src/settings/controllers/NotificationControllers.ts @@ -18,7 +18,7 @@ limitations under the License. import { logger } from "matrix-js-sdk/src/logger"; // XXX: This feels wrong. import { PushProcessor } from "matrix-js-sdk/src/pushprocessor"; -import { PushRuleActionName } from "matrix-js-sdk/src/@types/PushRules"; +import { PushRuleActionName } from "matrix-js-sdk/src/matrix"; import SettingController from "./SettingController"; import { MatrixClientPeg } from "../../MatrixClientPeg"; diff --git a/src/stores/RoomViewStore.tsx b/src/stores/RoomViewStore.tsx index 30f01bda59..53d4f0781a 100644 --- a/src/stores/RoomViewStore.tsx +++ b/src/stores/RoomViewStore.tsx @@ -18,11 +18,10 @@ limitations under the License. import React, { ReactNode } from "react"; import * as utils from "matrix-js-sdk/src/utils"; -import { MatrixError } from "matrix-js-sdk/src/http-api"; +import { MatrixError, JoinRule, Room, MatrixEvent } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { ViewRoom as ViewRoomEvent } from "@matrix-org/analytics-events/types/typescript/ViewRoom"; import { JoinedRoom as JoinedRoomEvent } from "@matrix-org/analytics-events/types/typescript/JoinedRoom"; -import { JoinRule, Room, MatrixEvent } from "matrix-js-sdk/src/matrix"; import { Optional } from "matrix-events-sdk"; import EventEmitter from "events"; diff --git a/src/utils/DecryptFile.ts b/src/utils/DecryptFile.ts index 8c9ef1d825..9b72c13bd3 100644 --- a/src/utils/DecryptFile.ts +++ b/src/utils/DecryptFile.ts @@ -16,7 +16,7 @@ limitations under the License. // Pull in the encryption lib so that we can decrypt attachments. import encrypt from "matrix-encrypt-attachment"; -import { parseErrorResponse } from "matrix-js-sdk/src/http-api"; +import { parseErrorResponse } from "matrix-js-sdk/src/matrix"; import { mediaFromContent } from "../customisations/Media"; import { EncryptedFile, IMediaEventInfo } from "../customisations/models/IMediaEventContent"; diff --git a/src/utils/ErrorUtils.tsx b/src/utils/ErrorUtils.tsx index bd37ed4427..2fe8e1da31 100644 --- a/src/utils/ErrorUtils.tsx +++ b/src/utils/ErrorUtils.tsx @@ -15,7 +15,7 @@ limitations under the License. */ import React, { ReactNode } from "react"; -import { MatrixError, ConnectionError } from "matrix-js-sdk/src/http-api"; +import { MatrixError, ConnectionError } from "matrix-js-sdk/src/matrix"; import { _t, _td, Tags, TranslatedString } from "../languageHandler"; import SdkConfig from "../SdkConfig"; diff --git a/src/utils/IdentityServerUtils.ts b/src/utils/IdentityServerUtils.ts index ca5eeee178..ada676c69f 100644 --- a/src/utils/IdentityServerUtils.ts +++ b/src/utils/IdentityServerUtils.ts @@ -16,8 +16,7 @@ limitations under the License. import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; import { logger } from "matrix-js-sdk/src/logger"; -import { HTTPError } from "matrix-js-sdk/src/http-api"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { HTTPError, MatrixClient } from "matrix-js-sdk/src/matrix"; import SdkConfig from "../SdkConfig"; import { Policies } from "../Terms"; diff --git a/src/utils/MultiInviter.ts b/src/utils/MultiInviter.ts index ce8142f6bd..edbe6c03b4 100644 --- a/src/utils/MultiInviter.ts +++ b/src/utils/MultiInviter.ts @@ -14,10 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { MatrixError } from "matrix-js-sdk/src/http-api"; +import { MatrixError, MatrixClient, EventType, HistoryVisibility } from "matrix-js-sdk/src/matrix"; import { defer, IDeferred } from "matrix-js-sdk/src/utils"; import { logger } from "matrix-js-sdk/src/logger"; -import { MatrixClient, EventType, HistoryVisibility } from "matrix-js-sdk/src/matrix"; import { AddressType, getAddressType } from "../UserAddress"; import { _t } from "../languageHandler"; diff --git a/src/utils/pushRules/monitorSyncedPushRules.ts b/src/utils/pushRules/monitorSyncedPushRules.ts index 55fcdc563b..0af5e37a33 100644 --- a/src/utils/pushRules/monitorSyncedPushRules.ts +++ b/src/utils/pushRules/monitorSyncedPushRules.ts @@ -14,9 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { MatrixClient, MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; +import { MatrixClient, MatrixEvent, EventType, RuleId, IAnnotatedPushRule } from "matrix-js-sdk/src/matrix"; import { PushProcessor } from "matrix-js-sdk/src/pushprocessor"; -import { RuleId, IAnnotatedPushRule } from "matrix-js-sdk/src/@types/PushRules"; import { logger } from "matrix-js-sdk/src/logger"; import { VectorPushRulesDefinitions, VectorPushRuleDefinition } from "../../notifications"; diff --git a/test/RoomNotifs-test.ts b/test/RoomNotifs-test.ts index 9ca72ac086..43ea09923c 100644 --- a/test/RoomNotifs-test.ts +++ b/test/RoomNotifs-test.ts @@ -15,8 +15,9 @@ limitations under the License. */ import { mocked } from "jest-mock"; -import { PushRuleActionName, TweakName } from "matrix-js-sdk/src/@types/PushRules"; import { + PushRuleActionName, + TweakName, NotificationCountType, Room, EventStatus, diff --git a/test/components/structures/RoomSearchView-test.tsx b/test/components/structures/RoomSearchView-test.tsx index 94713b6852..887d1b7e46 100644 --- a/test/components/structures/RoomSearchView-test.tsx +++ b/test/components/structures/RoomSearchView-test.tsx @@ -17,10 +17,9 @@ limitations under the License. import React from "react"; import { mocked } from "jest-mock"; import { render, screen } from "@testing-library/react"; -import { Room, MatrixClient, IEvent, MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; +import { Room, MatrixClient, IEvent, MatrixEvent, EventType, SearchResult } from "matrix-js-sdk/src/matrix"; import { ISearchResults } from "matrix-js-sdk/src/@types/search"; import { defer } from "matrix-js-sdk/src/utils"; -import { SearchResult } from "matrix-js-sdk/src/models/search-result"; import { RoomSearchView } from "../../../src/components/structures/RoomSearchView"; import { SearchScope } from "../../../src/components/views/rooms/SearchBar"; diff --git a/test/components/structures/RoomStatusBar-test.tsx b/test/components/structures/RoomStatusBar-test.tsx index efbb7f60de..1919e0aeac 100644 --- a/test/components/structures/RoomStatusBar-test.tsx +++ b/test/components/structures/RoomStatusBar-test.tsx @@ -16,8 +16,14 @@ limitations under the License. import React from "react"; import { render } from "@testing-library/react"; -import { MatrixClient, PendingEventOrdering, EventStatus, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; -import { MatrixError } from "matrix-js-sdk/src/http-api"; +import { + MatrixClient, + PendingEventOrdering, + EventStatus, + MatrixEvent, + Room, + MatrixError, +} from "matrix-js-sdk/src/matrix"; import RoomStatusBar, { getUnsentMessages } from "../../../src/components/structures/RoomStatusBar"; import MatrixClientContext from "../../../src/contexts/MatrixClientContext"; diff --git a/test/components/views/messages/DateSeparator-test.tsx b/test/components/views/messages/DateSeparator-test.tsx index fcec96faa9..8abeab0392 100644 --- a/test/components/views/messages/DateSeparator-test.tsx +++ b/test/components/views/messages/DateSeparator-test.tsx @@ -17,8 +17,7 @@ limitations under the License. import React from "react"; import { mocked } from "jest-mock"; import { fireEvent, render, screen } from "@testing-library/react"; -import { TimestampToEventResponse } from "matrix-js-sdk/src/matrix"; -import { ConnectionError, HTTPError, MatrixError } from "matrix-js-sdk/src/http-api"; +import { TimestampToEventResponse, ConnectionError, HTTPError, MatrixError } from "matrix-js-sdk/src/matrix"; import dispatcher from "../../../../src/dispatcher/dispatcher"; import { Action } from "../../../../src/dispatcher/actions"; diff --git a/test/components/views/messages/MBeaconBody-test.tsx b/test/components/views/messages/MBeaconBody-test.tsx index f93025f210..d6f9a932e8 100644 --- a/test/components/views/messages/MBeaconBody-test.tsx +++ b/test/components/views/messages/MBeaconBody-test.tsx @@ -17,8 +17,14 @@ limitations under the License. import React, { ComponentProps } from "react"; import { act, fireEvent, render } from "@testing-library/react"; import * as maplibregl from "maplibre-gl"; -import { BeaconEvent, getBeaconInfoIdentifier, RelationType, MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; -import { Relations } from "matrix-js-sdk/src/models/relations"; +import { + BeaconEvent, + getBeaconInfoIdentifier, + RelationType, + MatrixEvent, + EventType, + Relations, +} from "matrix-js-sdk/src/matrix"; import { M_BEACON } from "matrix-js-sdk/src/@types/beacon"; import MBeaconBody from "../../../../src/components/views/messages/MBeaconBody"; diff --git a/test/components/views/messages/MPollBody-test.tsx b/test/components/views/messages/MPollBody-test.tsx index f103dd707a..168476bfe0 100644 --- a/test/components/views/messages/MPollBody-test.tsx +++ b/test/components/views/messages/MPollBody-test.tsx @@ -16,8 +16,7 @@ limitations under the License. import React from "react"; import { fireEvent, render, RenderResult } from "@testing-library/react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { Relations } from "matrix-js-sdk/src/models/relations"; +import { MatrixEvent, Relations } from "matrix-js-sdk/src/matrix"; import { M_POLL_KIND_DISCLOSED, M_POLL_KIND_UNDISCLOSED, diff --git a/test/components/views/settings/discovery/EmailAddresses-test.tsx b/test/components/views/settings/discovery/EmailAddresses-test.tsx index f2465e3ca5..4b515edd77 100644 --- a/test/components/views/settings/discovery/EmailAddresses-test.tsx +++ b/test/components/views/settings/discovery/EmailAddresses-test.tsx @@ -17,8 +17,7 @@ limitations under the License. import React from "react"; import { fireEvent, render, screen } from "@testing-library/react"; import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; -import { IRequestTokenResponse } from "matrix-js-sdk/src/matrix"; -import { MatrixError } from "matrix-js-sdk/src/http-api"; +import { IRequestTokenResponse, MatrixError } from "matrix-js-sdk/src/matrix"; import { UserFriendlyError } from "../../../../../src/languageHandler"; import EmailAddresses, { EmailAddress } from "../../../../../src/components/views/settings/discovery/EmailAddresses"; diff --git a/test/test-utils/relations.ts b/test/test-utils/relations.ts index 1190528623..71410e71df 100644 --- a/test/test-utils/relations.ts +++ b/test/test-utils/relations.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { Relations } from "matrix-js-sdk/src/models/relations"; +import { Relations } from "matrix-js-sdk/src/matrix"; import { RelationsContainer } from "matrix-js-sdk/src/models/relations-container"; import { PublicInterface } from "../@types/common"; diff --git a/test/utils/ErrorUtils-test.ts b/test/utils/ErrorUtils-test.ts index 14fa70ef7e..3a68e7e73d 100644 --- a/test/utils/ErrorUtils-test.ts +++ b/test/utils/ErrorUtils-test.ts @@ -16,7 +16,7 @@ limitations under the License. import { ReactElement } from "react"; import { render } from "@testing-library/react"; -import { MatrixError, ConnectionError } from "matrix-js-sdk/src/http-api"; +import { MatrixError, ConnectionError } from "matrix-js-sdk/src/matrix"; import { adminContactStrings, diff --git a/test/voice-broadcast/models/VoiceBroadcastRecording-test.ts b/test/voice-broadcast/models/VoiceBroadcastRecording-test.ts index 0e9d1ab8df..c6b9ee8857 100644 --- a/test/voice-broadcast/models/VoiceBroadcastRecording-test.ts +++ b/test/voice-broadcast/models/VoiceBroadcastRecording-test.ts @@ -26,8 +26,8 @@ import { MsgType, RelationType, Room, + Relations, } from "matrix-js-sdk/src/matrix"; -import { Relations } from "matrix-js-sdk/src/models/relations"; import { SyncState } from "matrix-js-sdk/src/sync"; import { uploadFile } from "../../../src/ContentMessages";