-
Notifications
You must be signed in to change notification settings - Fork 355
/
revision.ts
113 lines (97 loc) · 2.33 KB
/
revision.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import { EncodedCommentActionCounts } from "coral-server/models/action/comment";
export interface RevisionMetadata {
/**
* akismet is true when it was determined to be spam.
*/
akismet?: boolean;
/**
* linkCount is the number of links in a revision body that was detected.
*/
linkCount?: number;
/**
* perspective stores the detected properties from checking with the
* perspective model.
*/
perspective?: {
/**
* score is the percentage likelihood (in decimal form) that the comment
* matches the selected model.
*/
score: number;
/**
* model is the perspective model used to determine the above score.
*/
model: string;
};
/**
* wordList metadata stores extra status details about what occurred during
* word list analysis of this comment revision.
*/
wordList?: {
/**
* timedOut is whether the wordlist analysis timed out when this revision
* of the comment was sent through the moderation phases.
*/
timedOut?: boolean;
};
/**
* nudge when true indicates that the comment was written on the first try
* without a warning.
*/
nudge?: boolean;
}
export interface GiphyMedia {
type: "giphy";
id: string;
url: string;
original: string;
still: string;
video: string;
width?: number;
height?: number;
title?: string;
}
export interface TwitterMedia {
type: "twitter";
url: string;
width?: number;
}
export interface YouTubeMedia {
type: "youtube";
url: string;
still: string;
title?: string;
width?: number;
height?: number;
}
export type CommentMedia = GiphyMedia | TwitterMedia | YouTubeMedia;
/**
* Revision stores a Comment's body for a specific edit. Actions can be tied to
* a Revision, as can moderation actions.
*/
export interface Revision {
/**
* id identifies this Revision.
*/
readonly id: string;
/**
* body is the body text for this revision.
*/
body: string;
/**
* actionCounts is the cached action counts on this revision.
*/
actionCounts: EncodedCommentActionCounts;
/**
* metadata stores properties on this revision.
*/
metadata: RevisionMetadata;
/**
* createdAt is the date that this revision was created at.
*/
createdAt: Date;
/**
* media is the optional media object attached to this revision.
*/
media?: CommentMedia;
}