diff --git a/lib/types/account-types.js b/lib/types/account-types.js --- a/lib/types/account-types.js +++ b/lib/types/account-types.js @@ -15,7 +15,7 @@ type GenericMessagesResult, } from './message-types.js'; import type { PreRequestUserState } from './session-types.js'; -import { type LegacyRawThreadInfos } from './thread-types.js'; +import { type RawThreadInfos } from './thread-types.js'; import { type UserInfo, type LoggedOutUserInfo, @@ -69,7 +69,7 @@ rawMessageInfos: $ReadOnlyArray, currentUserInfo: LoggedInUserInfo, cookieChange: { - threadInfos: LegacyRawThreadInfos, + threadInfos: RawThreadInfos, userInfos: $ReadOnlyArray, }, }; @@ -77,7 +77,7 @@ export type RegisterResult = { +currentUserInfo: LoggedInUserInfo, +rawMessageInfos: $ReadOnlyArray, - +threadInfos: LegacyRawThreadInfos, + +threadInfos: RawThreadInfos, +userInfos: $ReadOnlyArray, +calendarQuery: CalendarQuery, }; @@ -142,14 +142,14 @@ +rawEntryInfos?: ?$ReadOnlyArray, +serverTime: number, +cookieChange: { - +threadInfos: LegacyRawThreadInfos, + +threadInfos: RawThreadInfos, +userInfos: $ReadOnlyArray, }, +notAcknowledgedPolicies?: $ReadOnlyArray, }; export type LogInResult = { - +threadInfos: LegacyRawThreadInfos, + +threadInfos: RawThreadInfos, +currentUserInfo: LoggedInUserInfo, +messagesResult: GenericMessagesResult, +userInfos: $ReadOnlyArray, diff --git a/lib/types/request-types.js b/lib/types/request-types.js --- a/lib/types/request-types.js +++ b/lib/types/request-types.js @@ -19,8 +19,8 @@ ClientEntryInconsistencyReportShape, } from './report-types.js'; import { - type LegacyRawThreadInfo, legacyRawThreadInfoValidator, + type RawThreadInfo, } from './thread-types.js'; import { type CurrentUserInfo, @@ -105,7 +105,7 @@ }>; type StateChanges = Partial<{ - +rawThreadInfos: LegacyRawThreadInfo[], + +rawThreadInfos: RawThreadInfo[], +rawEntryInfos: RawEntryInfo[], +currentUserInfo: CurrentUserInfo, +userInfos: AccountUserInfo[], @@ -230,7 +230,7 @@ +userInfos: boolean, }>, +stateChanges?: Partial<{ - +rawThreadInfos: LegacyRawThreadInfo[], + +rawThreadInfos: RawThreadInfo[], +rawEntryInfos: RawEntryInfo[], +currentUserInfo: CurrentUserInfo, +userInfos: AccountUserInfo[], diff --git a/lib/types/session-types.js b/lib/types/session-types.js --- a/lib/types/session-types.js +++ b/lib/types/session-types.js @@ -4,7 +4,7 @@ import type { LogInActionSource } from './account-types.js'; import type { CalendarQuery } from './entry-types.js'; -import type { LegacyRawThreadInfos } from './thread-types.js'; +import type { RawThreadInfos } from './thread-types.js'; import { type UserInfo, type CurrentUserInfo, @@ -37,14 +37,14 @@ export type ServerSessionChange = | { cookieInvalidated: false, - threadInfos: LegacyRawThreadInfos, + threadInfos: RawThreadInfos, userInfos: $ReadOnlyArray, sessionID?: null | string, cookie?: string, } | { cookieInvalidated: true, - threadInfos: LegacyRawThreadInfos, + threadInfos: RawThreadInfos, userInfos: $ReadOnlyArray, currentUserInfo: LoggedOutUserInfo, sessionID?: null | string, diff --git a/lib/types/socket-types.js b/lib/types/socket-types.js --- a/lib/types/socket-types.js +++ b/lib/types/socket-types.js @@ -34,8 +34,8 @@ } from './request-types.js'; import type { SessionState, SessionIdentification } from './session-types.js'; import { + type RawThreadInfos, legacyRawThreadInfoValidator, - type LegacyRawThreadInfos, } from './thread-types.js'; import { type ClientUpdatesResult, @@ -186,7 +186,7 @@ export const fullStateSyncActionType = 'FULL_STATE_SYNC'; export type BaseFullStateSync = { +messagesResult: MessagesResponse, - +threadInfos: LegacyRawThreadInfos, + +threadInfos: RawThreadInfos, +rawEntryInfos: $ReadOnlyArray, +userInfos: $ReadOnlyArray, +updatesCurrentAsOf: number, diff --git a/lib/types/thread-types.js b/lib/types/thread-types.js --- a/lib/types/thread-types.js +++ b/lib/types/thread-types.js @@ -148,6 +148,9 @@ export type RawThreadInfos = { +[id: string]: RawThreadInfo, }; +export type MinimallyEncodedRawThreadInfos = { + +[id: string]: MinimallyEncodedRawThreadInfo, +}; export type LegacyThreadInfo = { +id: string, @@ -244,7 +247,7 @@ }; export type ThreadStore = { - +threadInfos: LegacyRawThreadInfos, + +threadInfos: RawThreadInfos, }; export const threadStoreValidator: TInterface = tShape({ diff --git a/lib/types/update-types.js b/lib/types/update-types.js --- a/lib/types/update-types.js +++ b/lib/types/update-types.js @@ -7,7 +7,7 @@ type RawMessageInfo, type MessageTruncationStatus, } from './message-types.js'; -import { type LegacyRawThreadInfo } from './thread-types.js'; +import type { RawThreadInfo } from './thread-types.js'; import { type UserInfo, userInfoValidator, @@ -183,7 +183,7 @@ +type: 1, +id: string, +time: number, - +threadInfo: LegacyRawThreadInfo, + +threadInfo: RawThreadInfo, }; export type ThreadReadStatusUpdateInfo = { @@ -205,7 +205,7 @@ +type: 4, +id: string, +time: number, - +threadInfo: LegacyRawThreadInfo, + +threadInfo: RawThreadInfo, +rawMessageInfos: $ReadOnlyArray, +truncationStatus: MessageTruncationStatus, +rawEntryInfos: $ReadOnlyArray,