(READ ONLY) Margin is an open annotation layer for the internet. Powered by the AT Protocol.
margin.at
extension
web
atproto
comments
1export interface UserProfile {
2 did: string;
3 handle: string;
4 displayName?: string;
5 description?: string;
6 avatar?: string;
7 banner?: string;
8 website?: string;
9 links?: string[];
10 followersCount?: number;
11 followsCount?: number;
12 postsCount?: number;
13 labels?: ContentLabel[];
14}
15
16export interface Selector {
17 type?: string;
18 exact: string;
19 prefix?: string;
20 suffix?: string;
21 start?: number;
22 end?: number;
23}
24
25export interface Target {
26 source: string;
27 title?: string;
28 selector?: Selector;
29}
30
31export interface AnnotationBody {
32 type: "TextualBody";
33 value: string;
34 format: "text/plain";
35}
36
37export interface Param {
38 id: string;
39 value: string;
40}
41
42export interface AnnotationItem {
43 uri: string;
44 id?: string;
45 cid: string;
46 author: UserProfile;
47 creator?: UserProfile;
48 target?: Target;
49 source?: string;
50 body?: AnnotationBody;
51 motivation: "highlighting" | "commenting" | "bookmarking" | string;
52 type?: string;
53 createdAt: string;
54 text?: string;
55 title?: string;
56 description?: string;
57 color?: string;
58 tags?: string[];
59 likeCount?: number;
60 replyCount?: number;
61 repostCount?: number;
62 children?: AnnotationItem[];
63 viewer?: {
64 like?: string;
65 };
66 collection?: {
67 uri: string;
68 name: string;
69 icon?: string;
70 };
71 addedBy?: UserProfile;
72 collectionItemUri?: string;
73 reply?: {
74 parent?: {
75 uri: string;
76 cid: string;
77 };
78 root?: {
79 uri: string;
80 cid: string;
81 };
82 };
83 parentUri?: string;
84 labels?: ContentLabel[];
85}
86
87export type ActorSearchItem = UserProfile;
88
89export interface FeedResponse {
90 cursor?: string;
91 items: AnnotationItem[];
92}
93
94export interface NotificationItem {
95 id: number;
96 recipient: UserProfile;
97 actor: UserProfile;
98 type:
99 | "reply"
100 | "quote"
101 | "highlight"
102 | "bookmark"
103 | "annotation"
104 | "like"
105 | "follow";
106 subjectUri: string;
107 subject?: AnnotationItem | unknown;
108 createdAt: string;
109 readAt?: string;
110}
111
112export interface Collection {
113 id: string;
114 uri: string;
115 name: string;
116 description?: string;
117 icon?: string;
118 creator: UserProfile;
119 createdAt: string;
120 itemCount: number;
121 items?: AnnotationItem[];
122}
123
124export interface CollectionItem {
125 id: string;
126 collectionId: string;
127 subjectUri: string;
128 createdAt: string;
129 annotation?: AnnotationItem;
130}
131
132export interface EditHistoryItem {
133 uri: string;
134 cid: string;
135 author: UserProfile;
136 text: string;
137 createdAt: string;
138}
139
140export interface ModerationRelationship {
141 blocking: boolean;
142 muting: boolean;
143 blockedBy: boolean;
144}
145
146export interface BlockedUser {
147 did: string;
148 author: UserProfile;
149 createdAt: string;
150}
151
152export interface MutedUser {
153 did: string;
154 author: UserProfile;
155 createdAt: string;
156}
157
158export interface ModerationReport {
159 id: number;
160 reporter: UserProfile;
161 subject: UserProfile;
162 subjectUri?: string;
163 reasonType: string;
164 reasonText?: string;
165 status: string;
166 createdAt: string;
167 resolvedAt?: string;
168 resolvedBy?: string;
169}
170
171export type ReportReasonType =
172 | "spam"
173 | "violation"
174 | "misleading"
175 | "sexual"
176 | "rude"
177 | "other";
178
179export interface ContentLabel {
180 val: string;
181 src: string;
182 scope?: "account" | "content";
183}
184
185export type ContentLabelValue =
186 | "sexual"
187 | "nudity"
188 | "violence"
189 | "gore"
190 | "spam"
191 | "misleading";
192
193export type LabelVisibility = "hide" | "warn" | "ignore";
194
195export interface LabelerSubscription {
196 did: string;
197}
198
199export interface LabelPreference {
200 labelerDid: string;
201 label: string;
202 visibility: LabelVisibility;
203}
204
205export interface LabelDefinition {
206 identifier: string;
207 severity: string;
208 blurs: string;
209 description: string;
210}
211
212export interface LabelerInfo {
213 did: string;
214 name: string;
215 labels: LabelDefinition[];
216}
217
218export interface HydratedLabel {
219 id: number;
220 src: string;
221 uri: string;
222 val: string;
223 createdBy: {
224 did: string;
225 handle: string;
226 displayName?: string;
227 avatar?: string;
228 };
229 createdAt: string;
230 subject?: {
231 did: string;
232 handle: string;
233 displayName?: string;
234 avatar?: string;
235 };
236}