diff --git a/keyserver/src/responders/redux-state-responders.js b/keyserver/src/responders/redux-state-responders.js --- a/keyserver/src/responders/redux-state-responders.js +++ b/keyserver/src/responders/redux-state-responders.js @@ -28,6 +28,10 @@ type MessageStore, } from 'lib/types/message-types.js'; import { webNavInfoValidator } from 'lib/types/nav-types.js'; +import type { + WebInitialKeyserverInfo, + WebInitialReduxStateResponse, +} from 'lib/types/redux-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; import { type ThreadStore } from 'lib/types/thread-types.js'; @@ -42,8 +46,6 @@ import { urlInfoValidator } from 'lib/utils/url-utils.js'; import { tShape, ashoatKeyserverID, tID } from 'lib/utils/validation-utils.js'; import type { - WebInitialReduxStateResponse, - WebInitialKeyserverInfo, InitialReduxStateRequest, ExcludedData, } from 'web/types/redux-types.js'; diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js --- a/lib/types/redux-types.js +++ b/lib/types/redux-types.js @@ -1,14 +1,14 @@ // @flow import type { - LogOutResult, + ClaimUsernameResponse, + DefaultNotificationPayload, + KeyserverAuthResult, KeyserverLogOutResult, - LogInStartingPayload, LogInResult, + LogInStartingPayload, + LogOutResult, RegisterResult, - DefaultNotificationPayload, - ClaimUsernameResponse, - KeyserverAuthResult, } from './account-types.js'; import type { ActivityUpdateSuccessPayload, @@ -27,17 +27,17 @@ import type { DraftStore } from './draft-types.js'; import type { EnabledApps, SupportedApps } from './enabled-apps.js'; import type { - RawEntryInfo, - EntryStore, - SaveEntryPayload, + CalendarQuery, + CalendarQueryUpdateResult, + CalendarQueryUpdateStartingPayload, CreateEntryPayload, DeleteEntryResult, - RestoreEntryPayload, + EntryStore, FetchEntryInfosResult, - CalendarQueryUpdateResult, - CalendarQueryUpdateStartingPayload, - CalendarQuery, FetchRevisionsForEntryPayload, + RawEntryInfo, + RestoreEntryPayload, + SaveEntryPayload, } from './entry-types.js'; import type { CalendarFilter, @@ -47,38 +47,38 @@ import type { IdentityAuthResult } from './identity-service-types.js'; import type { IntegrityStore } from './integrity-types.js'; import type { - KeyserverStore, AddKeyserverPayload, + KeyserverStore, RemoveKeyserverPayload, } from './keyserver-types.js'; import type { LifecycleState } from './lifecycle-state-types.js'; import type { + DisableInviteLinkPayload, FetchInviteLinksResponse, InviteLink, InviteLinksStore, InviteLinkVerificationResponse, - DisableInviteLinkPayload, } from './link-types.js'; -import type { LoadingStatus, LoadingInfo } from './loading-types.js'; +import type { LoadingInfo, LoadingStatus } from './loading-types.js'; import type { UpdateMultimediaMessageMediaPayload } from './media-types.js'; import type { MessageReportCreationResult } from './message-report-types.js'; import type { + EditMessagePayload, + FetchMessageInfosPayload, + FetchPinnedMessagesResult, + LocallyComposedMessageInfo, MessageStore, + MessageStorePrunePayload, + NewMessagesPayload, RawMultimediaMessageInfo, - FetchMessageInfosPayload, - SendMessagePayload, - EditMessagePayload, SaveMessagesPayload, - NewMessagesPayload, - MessageStorePrunePayload, - LocallyComposedMessageInfo, - SimpleMessagesPayload, - FetchPinnedMessagesResult, SearchMessagesResponse, + SendMessagePayload, + SimpleMessagesPayload, } from './message-types.js'; import type { RawReactionMessageInfo } from './messages/reaction.js'; import type { RawTextMessageInfo } from './messages/text.js'; -import type { BaseNavInfo } from './nav-types.js'; +import type { BaseNavInfo, WebNavInfo } from './nav-types.js'; import { type ForcePolicyAcknowledgmentPayload, type PolicyAcknowledgmentPayload, @@ -86,26 +86,26 @@ } from './policy-types.js'; import type { RelationshipErrors } from './relationship-types.js'; import type { - EnabledReports, ClearDeliveredReportsPayload, + EnabledReports, QueueReportsPayload, ReportStore, } from './report-types.js'; import type { - ProcessServerRequestAction, GetOlmSessionInitializationDataResponse, + ProcessServerRequestAction, } from './request-types.js'; import type { - UserSearchResult, ExactUserSearchResult, + UserSearchResult, } from './search-types.js'; import type { SetSessionPayload } from './session-types.js'; import type { ConnectionIssue, + SetLateResponsePayload, StateSyncFullActionPayload, StateSyncIncrementalActionPayload, UpdateConnectionStatusPayload, - SetLateResponsePayload, UpdateKeyserverReachabilityPayload, } from './socket-types.js'; import { type ClientStore } from './store-ops-types.js'; @@ -113,17 +113,18 @@ import type { GlobalThemeInfo } from './theme-types.js'; import type { ThreadActivityStore } from './thread-activity-types.js'; import type { - ThreadStore, ChangeThreadSettingsPayload, LeaveThreadPayload, + LegacyThreadStore, NewThreadResult, + RoleDeletionPayload, + RoleModificationPayload, ThreadJoinPayload, + ThreadStore, ToggleMessagePinResult, - RoleModificationPayload, - RoleDeletionPayload, } from './thread-types.js'; import type { ClientUpdatesResultWithUserInfos } from './update-types.js'; -import type { CurrentUserInfo, UserStore } from './user-types.js'; +import type { CurrentUserInfo, UserInfos, UserStore } from './user-types.js'; import type { SetDeviceTokenActionPayload } from '../actions/device-actions.js'; import type { NotifPermissionAlertInfo } from '../utils/push-alerts.js'; @@ -164,6 +165,23 @@ }; export type AppState = NativeAppState | WebAppState; +export type WebInitialReduxStateResponse = { + +navInfo: WebNavInfo, + +currentUserInfo: CurrentUserInfo, + +entryStore: EntryStore, + +threadStore: LegacyThreadStore, + +userInfos: UserInfos, + +messageStore: MessageStore, + +pushApiPublicKey: ?string, + +commServicesAccessToken: null, + +inviteLinksStore: InviteLinksStore, + +keyserverInfo: WebInitialKeyserverInfo, +}; +export type WebInitialKeyserverInfo = { + +sessionID: ?string, + +updatesCurrentAsOf: number, +}; + export type BaseAction = | { +type: '@@redux/INIT', diff --git a/web/redux/action-types.js b/web/redux/action-types.js --- a/web/redux/action-types.js +++ b/web/redux/action-types.js @@ -3,6 +3,10 @@ import { extractKeyserverIDFromID } from 'lib/keyserver-conn/keyserver-call-utils.js'; import type { CallKeyserverEndpoint } from 'lib/keyserver-conn/keyserver-conn-types.js'; import { defaultCalendarFilters } from 'lib/types/filter-types.js'; +import type { + WebInitialKeyserverInfo, + WebInitialReduxStateResponse, +} from 'lib/types/redux-types.js'; import { useKeyserverCall } from 'lib/utils/keyserver-call.js'; import type { URLInfo } from 'lib/utils/url-utils.js'; import { ashoatKeyserverID } from 'lib/utils/validation-utils.js'; @@ -10,8 +14,6 @@ import type { ExcludedData, InitialReduxState, - WebInitialReduxStateResponse, - WebInitialKeyserverInfo, InitialReduxStateRequest, } from '../types/redux-types.js'; diff --git a/web/types/redux-types.js b/web/types/redux-types.js --- a/web/types/redux-types.js +++ b/web/types/redux-types.js @@ -1,26 +1,14 @@ // @flow -import type { EntryStore, CalendarQuery } from 'lib/types/entry-types.js'; +import type { CalendarQuery, EntryStore } from 'lib/types/entry-types.js'; import type { InviteLinksStore } from 'lib/types/link-types.js'; import type { MessageStore } from 'lib/types/message-types.js'; import type { WebNavInfo } from 'lib/types/nav-types.js'; -import type { LegacyThreadStore, ThreadStore } from 'lib/types/thread-types.js'; +import type { WebInitialKeyserverInfo } from 'lib/types/redux-types.js'; +import type { ThreadStore } from 'lib/types/thread-types.js'; import type { CurrentUserInfo, UserInfos } from 'lib/types/user-types.js'; import type { URLInfo } from 'lib/utils/url-utils.js'; -export type WebInitialReduxStateResponse = { - +navInfo: WebNavInfo, - +currentUserInfo: CurrentUserInfo, - +entryStore: EntryStore, - +threadStore: LegacyThreadStore, - +userInfos: UserInfos, - +messageStore: MessageStore, - +pushApiPublicKey: ?string, - +commServicesAccessToken: null, - +inviteLinksStore: InviteLinksStore, - +keyserverInfo: WebInitialKeyserverInfo, -}; - export type InitialReduxState = { +navInfo: WebNavInfo, +currentUserInfo: CurrentUserInfo, @@ -36,11 +24,6 @@ +keyserverInfos: { +[keyserverID: string]: WebInitialKeyserverInfo }, }; -export type WebInitialKeyserverInfo = { - +sessionID: ?string, - +updatesCurrentAsOf: number, -}; - export type ExcludedData = { +threadStore?: boolean, };