Write on the margins of the internet. Powered by the AT Protocol. margin.at
extension web atproto comments
at main 252 lines 4.4 kB view raw
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 editedAt?: string; 60 likeCount?: number; 61 replyCount?: number; 62 repostCount?: number; 63 children?: AnnotationItem[]; 64 inReplyTo?: string; 65 viewer?: { 66 like?: string; 67 }; 68 collection?: { 69 uri: string; 70 name: string; 71 icon?: string; 72 }; 73 context?: { 74 uri: string; 75 name: string; 76 icon?: string; 77 }[]; 78 addedBy?: UserProfile; 79 collectionItemUri?: string; 80 reply?: { 81 parent?: { 82 uri: string; 83 cid: string; 84 }; 85 root?: { 86 uri: string; 87 cid: string; 88 }; 89 }; 90 parentUri?: string; 91 labels?: ContentLabel[]; 92} 93 94export type ActorSearchItem = UserProfile; 95 96export interface FeedResponse { 97 items: AnnotationItem[]; 98 hasMore: boolean; 99 fetchedCount: number; 100} 101 102export interface NotificationItem { 103 id: number; 104 recipient: UserProfile; 105 actor: UserProfile; 106 type: 107 | "reply" 108 | "quote" 109 | "highlight" 110 | "bookmark" 111 | "annotation" 112 | "like" 113 | "follow"; 114 subjectUri: string; 115 subject?: AnnotationItem | unknown; 116 createdAt: string; 117 readAt?: string; 118} 119 120export interface Collection { 121 id: string; 122 uri: string; 123 name: string; 124 description?: string; 125 icon?: string; 126 creator: UserProfile; 127 createdAt: string; 128 itemCount: number; 129 items?: AnnotationItem[]; 130} 131 132export interface CollectionItem { 133 id: string; 134 collectionId: string; 135 subjectUri: string; 136 createdAt: string; 137 annotation?: AnnotationItem; 138} 139 140export interface EditHistoryItem { 141 uri: string; 142 cid: string; 143 author: UserProfile; 144 text: string; 145 createdAt: string; 146} 147 148export interface ModerationRelationship { 149 blocking: boolean; 150 muting: boolean; 151 blockedBy: boolean; 152} 153 154export interface BlockedUser { 155 did: string; 156 author: UserProfile; 157 createdAt: string; 158} 159 160export interface MutedUser { 161 did: string; 162 author: UserProfile; 163 createdAt: string; 164} 165 166export interface ModerationReport { 167 id: number; 168 reporter: UserProfile; 169 subject: UserProfile; 170 subjectUri?: string; 171 reasonType: string; 172 reasonText?: string; 173 status: string; 174 createdAt: string; 175 resolvedAt?: string; 176 resolvedBy?: string; 177} 178 179export type ReportReasonType = 180 | "spam" 181 | "violation" 182 | "misleading" 183 | "sexual" 184 | "rude" 185 | "other"; 186 187export interface ContentLabel { 188 val: string; 189 src: string; 190 scope?: "account" | "content"; 191} 192 193export type ContentLabelValue = 194 | "sexual" 195 | "nudity" 196 | "violence" 197 | "gore" 198 | "spam" 199 | "misleading"; 200 201export type LabelVisibility = "hide" | "warn" | "ignore"; 202 203export interface LabelerSubscription { 204 did: string; 205} 206 207export interface LabelPreference { 208 labelerDid: string; 209 label: string; 210 visibility: LabelVisibility; 211} 212 213export interface LabelDefinition { 214 identifier: string; 215 severity: string; 216 blurs: string; 217 description: string; 218} 219 220export interface LabelerInfo { 221 did: string; 222 name: string; 223 labels: LabelDefinition[]; 224} 225 226export interface HydratedLabel { 227 id: number; 228 src: string; 229 uri: string; 230 val: string; 231 createdBy: { 232 did: string; 233 handle: string; 234 displayName?: string; 235 avatar?: string; 236 }; 237 createdAt: string; 238 subject?: { 239 did: string; 240 handle: string; 241 displayName?: string; 242 avatar?: string; 243 }; 244} 245export interface EditHistoryItem { 246 id: number; 247 uri: string; 248 recordType: string; 249 previousContent: string; 250 previousCid?: string; 251 editedAt: string; 252}