Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3524421
D12827.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12827.id.diff
View Options
diff --git a/lib/types/message-types.js b/lib/types/message-types.js
--- a/lib/types/message-types.js
+++ b/lib/types/message-types.js
@@ -564,39 +564,35 @@
+newerThan?: ?number,
};
+export type SimpleMessagesPayload = {
+ +rawMessageInfos: $ReadOnlyArray<RawMessageInfo>,
+ +truncationStatuses: MessageTruncationStatuses,
+};
+
export type FetchMessageInfosRequest = {
+cursors: ThreadCursors,
+numberPerThread?: ?number,
};
-export type FetchMessageInfosResponse = {
- +rawMessageInfos: $ReadOnlyArray<RawMessageInfo>,
- +truncationStatuses: MessageTruncationStatuses,
+export type FetchMessageInfosResponse = $ReadOnly<{
+ ...SimpleMessagesPayload,
+userInfos: UserInfos,
-};
-export type FetchMessageInfosResult = {
- +rawMessageInfos: $ReadOnlyArray<RawMessageInfo>,
- +truncationStatuses: MessageTruncationStatuses,
-};
+}>;
+export type FetchMessageInfosResult = SimpleMessagesPayload;
export type FetchMessageInfosPayload = {
+threadID: string,
+rawMessageInfos: $ReadOnlyArray<RawMessageInfo>,
+truncationStatus: MessageTruncationStatus,
};
-export type MessagesResponse = {
- +rawMessageInfos: $ReadOnlyArray<RawMessageInfo>,
- +truncationStatuses: MessageTruncationStatuses,
+export type MessagesResponse = $ReadOnly<{
+ ...SimpleMessagesPayload,
+currentAsOf: number,
-};
+}>;
export const messagesResponseValidator: TInterface<MessagesResponse> =
tShape<MessagesResponse>({
rawMessageInfos: t.list(rawMessageInfoValidator),
truncationStatuses: messageTruncationStatusesValidator,
currentAsOf: t.Number,
});
-export type SimpleMessagesPayload = {
- +rawMessageInfos: $ReadOnlyArray<RawMessageInfo>,
- +truncationStatuses: MessageTruncationStatuses,
-};
export const defaultNumberPerThread = 20;
export const defaultMaxMessageAge = 14 * 24 * 60 * 60 * 1000; // 2 weeks
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 12:39 PM (7 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2700035
Default Alt Text
D12827.id.diff (1 KB)
Attached To
Mode
D12827: [lib] Reduce duplication in message-types.js
Attached
Detach File
Event Timeline
Log In to Comment