a collection of lightweight TypeScript packages for AT Protocol, the protocol powering Bluesky
atproto bluesky typescript npm

initial commit

Changed files
+12554
.vscode
lexicons
app
chat
com
atproto
admin
identity
label
moderation
repo
server
sync
temp
tools
packages
scripts
+13
.gitignore
··· 1 + node_modules/ 2 + dist/ 3 + 4 + .npm-*.log 5 + .pnpm-*.log 6 + .yarn-*.log 7 + npm-*.log 8 + pnpm-*.log 9 + yarn-*.log 10 + 11 + *.local 12 + 13 + tsconfig.tsbuildinfo
+1
.npmrc
··· 1 + @jsr:registry=https://npm.jsr.io
+1
.prettierignore
··· 1 + pnpm-lock.yaml
+17
.prettierrc
··· 1 + { 2 + "trailingComma": "all", 3 + "useTabs": true, 4 + "tabWidth": 2, 5 + "printWidth": 110, 6 + "semi": true, 7 + "singleQuote": true, 8 + "bracketSpacing": true, 9 + "overrides": [ 10 + { 11 + "files": ["tsconfig.json", "jsconfig.json"], 12 + "options": { 13 + "parser": "jsonc" 14 + } 15 + } 16 + ] 17 + }
+4
.vscode/settings.json
··· 1 + { 2 + "editor.defaultFormatter": "esbenp.prettier-vscode", 3 + "typescript.tsdk": "node_modules/typescript/lib" 4 + }
+1
lexicons/README.md
··· 1 + https://github.com/bluesky-social/atproto/tree/dc471da267955d0962a8affaf983df60d962d97c/lexicons
+434
lexicons/app/bsky/actor/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.actor.defs", 4 + "defs": { 5 + "profileViewBasic": { 6 + "type": "object", 7 + "required": ["did", "handle"], 8 + "properties": { 9 + "did": { "type": "string", "format": "did" }, 10 + "handle": { "type": "string", "format": "handle" }, 11 + "displayName": { 12 + "type": "string", 13 + "maxGraphemes": 64, 14 + "maxLength": 640 15 + }, 16 + "avatar": { "type": "string", "format": "uri" }, 17 + "associated": { 18 + "type": "ref", 19 + "ref": "#profileAssociated" 20 + }, 21 + "viewer": { "type": "ref", "ref": "#viewerState" }, 22 + "labels": { 23 + "type": "array", 24 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 25 + }, 26 + "createdAt": { "type": "string", "format": "datetime" } 27 + } 28 + }, 29 + "profileView": { 30 + "type": "object", 31 + "required": ["did", "handle"], 32 + "properties": { 33 + "did": { "type": "string", "format": "did" }, 34 + "handle": { "type": "string", "format": "handle" }, 35 + "displayName": { 36 + "type": "string", 37 + "maxGraphemes": 64, 38 + "maxLength": 640 39 + }, 40 + "description": { 41 + "type": "string", 42 + "maxGraphemes": 256, 43 + "maxLength": 2560 44 + }, 45 + "avatar": { "type": "string", "format": "uri" }, 46 + "associated": { 47 + "type": "ref", 48 + "ref": "#profileAssociated" 49 + }, 50 + "indexedAt": { "type": "string", "format": "datetime" }, 51 + "createdAt": { "type": "string", "format": "datetime" }, 52 + "viewer": { "type": "ref", "ref": "#viewerState" }, 53 + "labels": { 54 + "type": "array", 55 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 56 + } 57 + } 58 + }, 59 + "profileViewDetailed": { 60 + "type": "object", 61 + "required": ["did", "handle"], 62 + "properties": { 63 + "did": { "type": "string", "format": "did" }, 64 + "handle": { "type": "string", "format": "handle" }, 65 + "displayName": { 66 + "type": "string", 67 + "maxGraphemes": 64, 68 + "maxLength": 640 69 + }, 70 + "description": { 71 + "type": "string", 72 + "maxGraphemes": 256, 73 + "maxLength": 2560 74 + }, 75 + "avatar": { "type": "string", "format": "uri" }, 76 + "banner": { "type": "string", "format": "uri" }, 77 + "followersCount": { "type": "integer" }, 78 + "followsCount": { "type": "integer" }, 79 + "postsCount": { "type": "integer" }, 80 + "associated": { 81 + "type": "ref", 82 + "ref": "#profileAssociated" 83 + }, 84 + "joinedViaStarterPack": { 85 + "type": "ref", 86 + "ref": "app.bsky.graph.defs#starterPackViewBasic" 87 + }, 88 + "indexedAt": { "type": "string", "format": "datetime" }, 89 + "createdAt": { "type": "string", "format": "datetime" }, 90 + "viewer": { "type": "ref", "ref": "#viewerState" }, 91 + "labels": { 92 + "type": "array", 93 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 94 + } 95 + } 96 + }, 97 + "profileAssociated": { 98 + "type": "object", 99 + "properties": { 100 + "lists": { "type": "integer" }, 101 + "feedgens": { "type": "integer" }, 102 + "starterPacks": { "type": "integer" }, 103 + "labeler": { "type": "boolean" }, 104 + "chat": { "type": "ref", "ref": "#profileAssociatedChat" } 105 + } 106 + }, 107 + "profileAssociatedChat": { 108 + "type": "object", 109 + "required": ["allowIncoming"], 110 + "properties": { 111 + "allowIncoming": { 112 + "type": "string", 113 + "knownValues": ["all", "none", "following"] 114 + } 115 + } 116 + }, 117 + "viewerState": { 118 + "type": "object", 119 + "description": "Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.", 120 + "properties": { 121 + "muted": { "type": "boolean" }, 122 + "mutedByList": { 123 + "type": "ref", 124 + "ref": "app.bsky.graph.defs#listViewBasic" 125 + }, 126 + "blockedBy": { "type": "boolean" }, 127 + "blocking": { "type": "string", "format": "at-uri" }, 128 + "blockingByList": { 129 + "type": "ref", 130 + "ref": "app.bsky.graph.defs#listViewBasic" 131 + }, 132 + "following": { "type": "string", "format": "at-uri" }, 133 + "followedBy": { "type": "string", "format": "at-uri" }, 134 + "knownFollowers": { 135 + "type": "ref", 136 + "ref": "#knownFollowers" 137 + } 138 + } 139 + }, 140 + "knownFollowers": { 141 + "type": "object", 142 + "description": "The subject's followers whom you also follow", 143 + "required": ["count", "followers"], 144 + "properties": { 145 + "count": { "type": "integer" }, 146 + "followers": { 147 + "type": "array", 148 + "minLength": 0, 149 + "maxLength": 5, 150 + "items": { 151 + "type": "ref", 152 + "ref": "#profileViewBasic" 153 + } 154 + } 155 + } 156 + }, 157 + "preferences": { 158 + "type": "array", 159 + "items": { 160 + "type": "union", 161 + "refs": [ 162 + "#adultContentPref", 163 + "#contentLabelPref", 164 + "#savedFeedsPref", 165 + "#savedFeedsPrefV2", 166 + "#personalDetailsPref", 167 + "#feedViewPref", 168 + "#threadViewPref", 169 + "#interestsPref", 170 + "#mutedWordsPref", 171 + "#hiddenPostsPref", 172 + "#bskyAppStatePref", 173 + "#labelersPref" 174 + ] 175 + } 176 + }, 177 + "adultContentPref": { 178 + "type": "object", 179 + "required": ["enabled"], 180 + "properties": { 181 + "enabled": { "type": "boolean", "default": false } 182 + } 183 + }, 184 + "contentLabelPref": { 185 + "type": "object", 186 + "required": ["label", "visibility"], 187 + "properties": { 188 + "labelerDid": { 189 + "type": "string", 190 + "description": "Which labeler does this preference apply to? If undefined, applies globally.", 191 + "format": "did" 192 + }, 193 + "label": { "type": "string" }, 194 + "visibility": { 195 + "type": "string", 196 + "knownValues": ["ignore", "show", "warn", "hide"] 197 + } 198 + } 199 + }, 200 + "savedFeed": { 201 + "type": "object", 202 + "required": ["id", "type", "value", "pinned"], 203 + "properties": { 204 + "id": { 205 + "type": "string" 206 + }, 207 + "type": { 208 + "type": "string", 209 + "knownValues": ["feed", "list", "timeline"] 210 + }, 211 + "value": { 212 + "type": "string" 213 + }, 214 + "pinned": { 215 + "type": "boolean" 216 + } 217 + } 218 + }, 219 + "savedFeedsPrefV2": { 220 + "type": "object", 221 + "required": ["items"], 222 + "properties": { 223 + "items": { 224 + "type": "array", 225 + "items": { 226 + "type": "ref", 227 + "ref": "app.bsky.actor.defs#savedFeed" 228 + } 229 + } 230 + } 231 + }, 232 + "savedFeedsPref": { 233 + "type": "object", 234 + "required": ["pinned", "saved"], 235 + "properties": { 236 + "pinned": { 237 + "type": "array", 238 + "items": { 239 + "type": "string", 240 + "format": "at-uri" 241 + } 242 + }, 243 + "saved": { 244 + "type": "array", 245 + "items": { 246 + "type": "string", 247 + "format": "at-uri" 248 + } 249 + }, 250 + "timelineIndex": { 251 + "type": "integer" 252 + } 253 + } 254 + }, 255 + "personalDetailsPref": { 256 + "type": "object", 257 + "properties": { 258 + "birthDate": { 259 + "type": "string", 260 + "format": "datetime", 261 + "description": "The birth date of account owner." 262 + } 263 + } 264 + }, 265 + "feedViewPref": { 266 + "type": "object", 267 + "required": ["feed"], 268 + "properties": { 269 + "feed": { 270 + "type": "string", 271 + "description": "The URI of the feed, or an identifier which describes the feed." 272 + }, 273 + "hideReplies": { 274 + "type": "boolean", 275 + "description": "Hide replies in the feed." 276 + }, 277 + "hideRepliesByUnfollowed": { 278 + "type": "boolean", 279 + "description": "Hide replies in the feed if they are not by followed users.", 280 + "default": true 281 + }, 282 + "hideRepliesByLikeCount": { 283 + "type": "integer", 284 + "description": "Hide replies in the feed if they do not have this number of likes." 285 + }, 286 + "hideReposts": { 287 + "type": "boolean", 288 + "description": "Hide reposts in the feed." 289 + }, 290 + "hideQuotePosts": { 291 + "type": "boolean", 292 + "description": "Hide quote posts in the feed." 293 + } 294 + } 295 + }, 296 + "threadViewPref": { 297 + "type": "object", 298 + "properties": { 299 + "sort": { 300 + "type": "string", 301 + "description": "Sorting mode for threads.", 302 + "knownValues": ["oldest", "newest", "most-likes", "random"] 303 + }, 304 + "prioritizeFollowedUsers": { 305 + "type": "boolean", 306 + "description": "Show followed users at the top of all replies." 307 + } 308 + } 309 + }, 310 + "interestsPref": { 311 + "type": "object", 312 + "required": ["tags"], 313 + "properties": { 314 + "tags": { 315 + "type": "array", 316 + "maxLength": 100, 317 + "items": { "type": "string", "maxLength": 640, "maxGraphemes": 64 }, 318 + "description": "A list of tags which describe the account owner's interests gathered during onboarding." 319 + } 320 + } 321 + }, 322 + "mutedWordTarget": { 323 + "type": "string", 324 + "knownValues": ["content", "tag"], 325 + "maxLength": 640, 326 + "maxGraphemes": 64 327 + }, 328 + "mutedWord": { 329 + "type": "object", 330 + "description": "A word that the account owner has muted.", 331 + "required": ["value", "targets"], 332 + "properties": { 333 + "id": { "type": "string" }, 334 + "value": { 335 + "type": "string", 336 + "description": "The muted word itself.", 337 + "maxLength": 10000, 338 + "maxGraphemes": 1000 339 + }, 340 + "targets": { 341 + "type": "array", 342 + "description": "The intended targets of the muted word.", 343 + "items": { 344 + "type": "ref", 345 + "ref": "app.bsky.actor.defs#mutedWordTarget" 346 + } 347 + }, 348 + "actorTarget": { 349 + "type": "string", 350 + "description": "Groups of users to apply the muted word to. If undefined, applies to all users.", 351 + "knownValues": ["all", "exclude-following"], 352 + "default": "all" 353 + }, 354 + "expiresAt": { 355 + "type": "string", 356 + "format": "datetime", 357 + "description": "The date and time at which the muted word will expire and no longer be applied." 358 + } 359 + } 360 + }, 361 + "mutedWordsPref": { 362 + "type": "object", 363 + "required": ["items"], 364 + "properties": { 365 + "items": { 366 + "type": "array", 367 + "items": { 368 + "type": "ref", 369 + "ref": "app.bsky.actor.defs#mutedWord" 370 + }, 371 + "description": "A list of words the account owner has muted." 372 + } 373 + } 374 + }, 375 + "hiddenPostsPref": { 376 + "type": "object", 377 + "required": ["items"], 378 + "properties": { 379 + "items": { 380 + "type": "array", 381 + "items": { "type": "string", "format": "at-uri" }, 382 + "description": "A list of URIs of posts the account owner has hidden." 383 + } 384 + } 385 + }, 386 + "labelersPref": { 387 + "type": "object", 388 + "required": ["labelers"], 389 + "properties": { 390 + "labelers": { 391 + "type": "array", 392 + "items": { 393 + "type": "ref", 394 + "ref": "#labelerPrefItem" 395 + } 396 + } 397 + } 398 + }, 399 + "labelerPrefItem": { 400 + "type": "object", 401 + "required": ["did"], 402 + "properties": { 403 + "did": { 404 + "type": "string", 405 + "format": "did" 406 + } 407 + } 408 + }, 409 + "bskyAppStatePref": { 410 + "description": "A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this.", 411 + "type": "object", 412 + "properties": { 413 + "activeProgressGuide": { 414 + "type": "ref", 415 + "ref": "#bskyAppProgressGuide" 416 + }, 417 + "queuedNudges": { 418 + "description": "An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user.", 419 + "type": "array", 420 + "maxLength": 1000, 421 + "items": { "type": "string", "maxLength": 100 } 422 + } 423 + } 424 + }, 425 + "bskyAppProgressGuide": { 426 + "description": "If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress.", 427 + "type": "object", 428 + "required": ["guide"], 429 + "properties": { 430 + "guide": { "type": "string", "maxLength": 100 } 431 + } 432 + } 433 + } 434 + }
+27
lexicons/app/bsky/actor/getPreferences.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.actor.getPreferences", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get private preferences attached to the current account. Expected use is synchronization between multiple devices, and import/export during account migration. Requires auth.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": {} 11 + }, 12 + "output": { 13 + "encoding": "application/json", 14 + "schema": { 15 + "type": "object", 16 + "required": ["preferences"], 17 + "properties": { 18 + "preferences": { 19 + "type": "ref", 20 + "ref": "app.bsky.actor.defs#preferences" 21 + } 22 + } 23 + } 24 + } 25 + } 26 + } 27 + }
+28
lexicons/app/bsky/actor/getProfile.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.actor.getProfile", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get detailed profile view of an actor. Does not require auth, but contains relevant metadata with auth.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["actor"], 11 + "properties": { 12 + "actor": { 13 + "type": "string", 14 + "format": "at-identifier", 15 + "description": "Handle or DID of account to fetch profile of." 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "ref", 23 + "ref": "app.bsky.actor.defs#profileViewDetailed" 24 + } 25 + } 26 + } 27 + } 28 + }
+37
lexicons/app/bsky/actor/getProfiles.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.actor.getProfiles", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get detailed profile views of multiple actors.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["actors"], 11 + "properties": { 12 + "actors": { 13 + "type": "array", 14 + "items": { "type": "string", "format": "at-identifier" }, 15 + "maxLength": 25 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "object", 23 + "required": ["profiles"], 24 + "properties": { 25 + "profiles": { 26 + "type": "array", 27 + "items": { 28 + "type": "ref", 29 + "ref": "app.bsky.actor.defs#profileViewDetailed" 30 + } 31 + } 32 + } 33 + } 34 + } 35 + } 36 + } 37 + }
+39
lexicons/app/bsky/actor/getSuggestions.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.actor.getSuggestions", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a list of suggested actors. Expected use is discovery of accounts to follow during new account onboarding.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "limit": { 12 + "type": "integer", 13 + "minimum": 1, 14 + "maximum": 100, 15 + "default": 50 16 + }, 17 + "cursor": { "type": "string" } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "object", 24 + "required": ["actors"], 25 + "properties": { 26 + "cursor": { "type": "string" }, 27 + "actors": { 28 + "type": "array", 29 + "items": { 30 + "type": "ref", 31 + "ref": "app.bsky.actor.defs#profileView" 32 + } 33 + } 34 + } 35 + } 36 + } 37 + } 38 + } 39 + }
+49
lexicons/app/bsky/actor/profile.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.actor.profile", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "A declaration of a Bluesky account profile.", 8 + "key": "literal:self", 9 + "record": { 10 + "type": "object", 11 + "properties": { 12 + "displayName": { 13 + "type": "string", 14 + "maxGraphemes": 64, 15 + "maxLength": 640 16 + }, 17 + "description": { 18 + "type": "string", 19 + "description": "Free-form profile description text.", 20 + "maxGraphemes": 256, 21 + "maxLength": 2560 22 + }, 23 + "avatar": { 24 + "type": "blob", 25 + "description": "Small image to be displayed next to posts from account. AKA, 'profile picture'", 26 + "accept": ["image/png", "image/jpeg"], 27 + "maxSize": 1000000 28 + }, 29 + "banner": { 30 + "type": "blob", 31 + "description": "Larger horizontal image to display behind profile view.", 32 + "accept": ["image/png", "image/jpeg"], 33 + "maxSize": 1000000 34 + }, 35 + "labels": { 36 + "type": "union", 37 + "description": "Self-label values, specific to the Bluesky application, on the overall account.", 38 + "refs": ["com.atproto.label.defs#selfLabels"] 39 + }, 40 + "joinedViaStarterPack": { 41 + "type": "ref", 42 + "ref": "com.atproto.repo.strongRef" 43 + }, 44 + "createdAt": { "type": "string", "format": "datetime" } 45 + } 46 + } 47 + } 48 + } 49 + }
+23
lexicons/app/bsky/actor/putPreferences.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.actor.putPreferences", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Set the private preferences attached to the account.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["preferences"], 13 + "properties": { 14 + "preferences": { 15 + "type": "ref", 16 + "ref": "app.bsky.actor.defs#preferences" 17 + } 18 + } 19 + } 20 + } 21 + } 22 + } 23 + }
+47
lexicons/app/bsky/actor/searchActors.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.actor.searchActors", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Find actors (profiles) matching search criteria. Does not require auth.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "term": { 12 + "type": "string", 13 + "description": "DEPRECATED: use 'q' instead." 14 + }, 15 + "q": { 16 + "type": "string", 17 + "description": "Search query string. Syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended." 18 + }, 19 + "limit": { 20 + "type": "integer", 21 + "minimum": 1, 22 + "maximum": 100, 23 + "default": 25 24 + }, 25 + "cursor": { "type": "string" } 26 + } 27 + }, 28 + "output": { 29 + "encoding": "application/json", 30 + "schema": { 31 + "type": "object", 32 + "required": ["actors"], 33 + "properties": { 34 + "cursor": { "type": "string" }, 35 + "actors": { 36 + "type": "array", 37 + "items": { 38 + "type": "ref", 39 + "ref": "app.bsky.actor.defs#profileView" 40 + } 41 + } 42 + } 43 + } 44 + } 45 + } 46 + } 47 + }
+45
lexicons/app/bsky/actor/searchActorsTypeahead.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.actor.searchActorsTypeahead", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Find actor suggestions for a prefix search term. Expected use is for auto-completion during text field entry. Does not require auth.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "term": { 12 + "type": "string", 13 + "description": "DEPRECATED: use 'q' instead." 14 + }, 15 + "q": { 16 + "type": "string", 17 + "description": "Search query prefix; not a full query string." 18 + }, 19 + "limit": { 20 + "type": "integer", 21 + "minimum": 1, 22 + "maximum": 100, 23 + "default": 10 24 + } 25 + } 26 + }, 27 + "output": { 28 + "encoding": "application/json", 29 + "schema": { 30 + "type": "object", 31 + "required": ["actors"], 32 + "properties": { 33 + "actors": { 34 + "type": "array", 35 + "items": { 36 + "type": "ref", 37 + "ref": "app.bsky.actor.defs#profileViewBasic" 38 + } 39 + } 40 + } 41 + } 42 + } 43 + } 44 + } 45 + }
+51
lexicons/app/bsky/embed/external.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.embed.external", 4 + "defs": { 5 + "main": { 6 + "type": "object", 7 + "description": "A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post).", 8 + "required": ["external"], 9 + "properties": { 10 + "external": { 11 + "type": "ref", 12 + "ref": "#external" 13 + } 14 + } 15 + }, 16 + "external": { 17 + "type": "object", 18 + "required": ["uri", "title", "description"], 19 + "properties": { 20 + "uri": { "type": "string", "format": "uri" }, 21 + "title": { "type": "string" }, 22 + "description": { "type": "string" }, 23 + "thumb": { 24 + "type": "blob", 25 + "accept": ["image/*"], 26 + "maxSize": 1000000 27 + } 28 + } 29 + }, 30 + "view": { 31 + "type": "object", 32 + "required": ["external"], 33 + "properties": { 34 + "external": { 35 + "type": "ref", 36 + "ref": "#viewExternal" 37 + } 38 + } 39 + }, 40 + "viewExternal": { 41 + "type": "object", 42 + "required": ["uri", "title", "description"], 43 + "properties": { 44 + "uri": { "type": "string", "format": "uri" }, 45 + "title": { "type": "string" }, 46 + "description": { "type": "string" }, 47 + "thumb": { "type": "string", "format": "uri" } 48 + } 49 + } 50 + } 51 + }
+75
lexicons/app/bsky/embed/images.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.embed.images", 4 + "description": "A set of images embedded in a Bluesky record (eg, a post).", 5 + "defs": { 6 + "main": { 7 + "type": "object", 8 + "required": ["images"], 9 + "properties": { 10 + "images": { 11 + "type": "array", 12 + "items": { "type": "ref", "ref": "#image" }, 13 + "maxLength": 4 14 + } 15 + } 16 + }, 17 + "image": { 18 + "type": "object", 19 + "required": ["image", "alt"], 20 + "properties": { 21 + "image": { 22 + "type": "blob", 23 + "accept": ["image/*"], 24 + "maxSize": 1000000 25 + }, 26 + "alt": { 27 + "type": "string", 28 + "description": "Alt text description of the image, for accessibility." 29 + }, 30 + "aspectRatio": { "type": "ref", "ref": "#aspectRatio" } 31 + } 32 + }, 33 + "aspectRatio": { 34 + "type": "object", 35 + "description": "width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.", 36 + "required": ["width", "height"], 37 + "properties": { 38 + "width": { "type": "integer", "minimum": 1 }, 39 + "height": { "type": "integer", "minimum": 1 } 40 + } 41 + }, 42 + "view": { 43 + "type": "object", 44 + "required": ["images"], 45 + "properties": { 46 + "images": { 47 + "type": "array", 48 + "items": { "type": "ref", "ref": "#viewImage" }, 49 + "maxLength": 4 50 + } 51 + } 52 + }, 53 + "viewImage": { 54 + "type": "object", 55 + "required": ["thumb", "fullsize", "alt"], 56 + "properties": { 57 + "thumb": { 58 + "type": "string", 59 + "format": "uri", 60 + "description": "Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View." 61 + }, 62 + "fullsize": { 63 + "type": "string", 64 + "format": "uri", 65 + "description": "Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View." 66 + }, 67 + "alt": { 68 + "type": "string", 69 + "description": "Alt text description of the image, for accessibility." 70 + }, 71 + "aspectRatio": { "type": "ref", "ref": "#aspectRatio" } 72 + } 73 + } 74 + } 75 + }
+85
lexicons/app/bsky/embed/record.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.embed.record", 4 + "description": "A representation of a record embedded in a Bluesky record (eg, a post). For example, a quote-post, or sharing a feed generator record.", 5 + "defs": { 6 + "main": { 7 + "type": "object", 8 + "required": ["record"], 9 + "properties": { 10 + "record": { "type": "ref", "ref": "com.atproto.repo.strongRef" } 11 + } 12 + }, 13 + "view": { 14 + "type": "object", 15 + "required": ["record"], 16 + "properties": { 17 + "record": { 18 + "type": "union", 19 + "refs": [ 20 + "#viewRecord", 21 + "#viewNotFound", 22 + "#viewBlocked", 23 + "app.bsky.feed.defs#generatorView", 24 + "app.bsky.graph.defs#listView", 25 + "app.bsky.labeler.defs#labelerView", 26 + "app.bsky.graph.defs#starterPackViewBasic" 27 + ] 28 + } 29 + } 30 + }, 31 + "viewRecord": { 32 + "type": "object", 33 + "required": ["uri", "cid", "author", "value", "indexedAt"], 34 + "properties": { 35 + "uri": { "type": "string", "format": "at-uri" }, 36 + "cid": { "type": "string", "format": "cid" }, 37 + "author": { 38 + "type": "ref", 39 + "ref": "app.bsky.actor.defs#profileViewBasic" 40 + }, 41 + "value": { 42 + "type": "unknown", 43 + "description": "The record data itself." 44 + }, 45 + "labels": { 46 + "type": "array", 47 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 48 + }, 49 + "replyCount": { "type": "integer" }, 50 + "repostCount": { "type": "integer" }, 51 + "likeCount": { "type": "integer" }, 52 + "embeds": { 53 + "type": "array", 54 + "items": { 55 + "type": "union", 56 + "refs": [ 57 + "app.bsky.embed.images#view", 58 + "app.bsky.embed.external#view", 59 + "app.bsky.embed.record#view", 60 + "app.bsky.embed.recordWithMedia#view" 61 + ] 62 + } 63 + }, 64 + "indexedAt": { "type": "string", "format": "datetime" } 65 + } 66 + }, 67 + "viewNotFound": { 68 + "type": "object", 69 + "required": ["uri", "notFound"], 70 + "properties": { 71 + "uri": { "type": "string", "format": "at-uri" }, 72 + "notFound": { "type": "boolean", "const": true } 73 + } 74 + }, 75 + "viewBlocked": { 76 + "type": "object", 77 + "required": ["uri", "blocked", "author"], 78 + "properties": { 79 + "uri": { "type": "string", "format": "at-uri" }, 80 + "blocked": { "type": "boolean", "const": true }, 81 + "author": { "type": "ref", "ref": "app.bsky.feed.defs#blockedAuthor" } 82 + } 83 + } 84 + } 85 + }
+35
lexicons/app/bsky/embed/recordWithMedia.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.embed.recordWithMedia", 4 + "description": "A representation of a record embedded in a Bluesky record (eg, a post), alongside other compatible embeds. For example, a quote post and image, or a quote post and external URL card.", 5 + "defs": { 6 + "main": { 7 + "type": "object", 8 + "required": ["record", "media"], 9 + "properties": { 10 + "record": { 11 + "type": "ref", 12 + "ref": "app.bsky.embed.record" 13 + }, 14 + "media": { 15 + "type": "union", 16 + "refs": ["app.bsky.embed.images", "app.bsky.embed.external"] 17 + } 18 + } 19 + }, 20 + "view": { 21 + "type": "object", 22 + "required": ["record", "media"], 23 + "properties": { 24 + "record": { 25 + "type": "ref", 26 + "ref": "app.bsky.embed.record#view" 27 + }, 28 + "media": { 29 + "type": "union", 30 + "refs": ["app.bsky.embed.images#view", "app.bsky.embed.external#view"] 31 + } 32 + } 33 + } 34 + } 35 + }
+275
lexicons/app/bsky/feed/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.defs", 4 + "defs": { 5 + "postView": { 6 + "type": "object", 7 + "required": ["uri", "cid", "author", "record", "indexedAt"], 8 + "properties": { 9 + "uri": { "type": "string", "format": "at-uri" }, 10 + "cid": { "type": "string", "format": "cid" }, 11 + "author": { 12 + "type": "ref", 13 + "ref": "app.bsky.actor.defs#profileViewBasic" 14 + }, 15 + "record": { "type": "unknown" }, 16 + "embed": { 17 + "type": "union", 18 + "refs": [ 19 + "app.bsky.embed.images#view", 20 + "app.bsky.embed.external#view", 21 + "app.bsky.embed.record#view", 22 + "app.bsky.embed.recordWithMedia#view" 23 + ] 24 + }, 25 + "replyCount": { "type": "integer" }, 26 + "repostCount": { "type": "integer" }, 27 + "likeCount": { "type": "integer" }, 28 + "indexedAt": { "type": "string", "format": "datetime" }, 29 + "viewer": { "type": "ref", "ref": "#viewerState" }, 30 + "labels": { 31 + "type": "array", 32 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 33 + }, 34 + "threadgate": { "type": "ref", "ref": "#threadgateView" } 35 + } 36 + }, 37 + "viewerState": { 38 + "type": "object", 39 + "description": "Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.", 40 + "properties": { 41 + "repost": { "type": "string", "format": "at-uri" }, 42 + "like": { "type": "string", "format": "at-uri" }, 43 + "threadMuted": { "type": "boolean" }, 44 + "replyDisabled": { "type": "boolean" } 45 + } 46 + }, 47 + "feedViewPost": { 48 + "type": "object", 49 + "required": ["post"], 50 + "properties": { 51 + "post": { "type": "ref", "ref": "#postView" }, 52 + "reply": { "type": "ref", "ref": "#replyRef" }, 53 + "reason": { "type": "union", "refs": ["#reasonRepost"] }, 54 + "feedContext": { 55 + "type": "string", 56 + "description": "Context provided by feed generator that may be passed back alongside interactions.", 57 + "maxLength": 2000 58 + } 59 + } 60 + }, 61 + "replyRef": { 62 + "type": "object", 63 + "required": ["root", "parent"], 64 + "properties": { 65 + "root": { 66 + "type": "union", 67 + "refs": ["#postView", "#notFoundPost", "#blockedPost"] 68 + }, 69 + "parent": { 70 + "type": "union", 71 + "refs": ["#postView", "#notFoundPost", "#blockedPost"] 72 + }, 73 + "grandparentAuthor": { 74 + "type": "ref", 75 + "ref": "app.bsky.actor.defs#profileViewBasic", 76 + "description": "When parent is a reply to another post, this is the author of that post." 77 + } 78 + } 79 + }, 80 + "reasonRepost": { 81 + "type": "object", 82 + "required": ["by", "indexedAt"], 83 + "properties": { 84 + "by": { "type": "ref", "ref": "app.bsky.actor.defs#profileViewBasic" }, 85 + "indexedAt": { "type": "string", "format": "datetime" } 86 + } 87 + }, 88 + "threadViewPost": { 89 + "type": "object", 90 + "required": ["post"], 91 + "properties": { 92 + "post": { "type": "ref", "ref": "#postView" }, 93 + "parent": { 94 + "type": "union", 95 + "refs": ["#threadViewPost", "#notFoundPost", "#blockedPost"] 96 + }, 97 + "replies": { 98 + "type": "array", 99 + "items": { 100 + "type": "union", 101 + "refs": ["#threadViewPost", "#notFoundPost", "#blockedPost"] 102 + } 103 + } 104 + } 105 + }, 106 + "notFoundPost": { 107 + "type": "object", 108 + "required": ["uri", "notFound"], 109 + "properties": { 110 + "uri": { "type": "string", "format": "at-uri" }, 111 + "notFound": { "type": "boolean", "const": true } 112 + } 113 + }, 114 + "blockedPost": { 115 + "type": "object", 116 + "required": ["uri", "blocked", "author"], 117 + "properties": { 118 + "uri": { "type": "string", "format": "at-uri" }, 119 + "blocked": { "type": "boolean", "const": true }, 120 + "author": { "type": "ref", "ref": "#blockedAuthor" } 121 + } 122 + }, 123 + "blockedAuthor": { 124 + "type": "object", 125 + "required": ["did"], 126 + "properties": { 127 + "did": { "type": "string", "format": "did" }, 128 + "viewer": { "type": "ref", "ref": "app.bsky.actor.defs#viewerState" } 129 + } 130 + }, 131 + "generatorView": { 132 + "type": "object", 133 + "required": ["uri", "cid", "did", "creator", "displayName", "indexedAt"], 134 + "properties": { 135 + "uri": { "type": "string", "format": "at-uri" }, 136 + "cid": { "type": "string", "format": "cid" }, 137 + "did": { "type": "string", "format": "did" }, 138 + "creator": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" }, 139 + "displayName": { "type": "string" }, 140 + "description": { 141 + "type": "string", 142 + "maxGraphemes": 300, 143 + "maxLength": 3000 144 + }, 145 + "descriptionFacets": { 146 + "type": "array", 147 + "items": { "type": "ref", "ref": "app.bsky.richtext.facet" } 148 + }, 149 + "avatar": { "type": "string", "format": "uri" }, 150 + "likeCount": { "type": "integer", "minimum": 0 }, 151 + "acceptsInteractions": { "type": "boolean" }, 152 + "labels": { 153 + "type": "array", 154 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 155 + }, 156 + "viewer": { "type": "ref", "ref": "#generatorViewerState" }, 157 + "indexedAt": { "type": "string", "format": "datetime" } 158 + } 159 + }, 160 + "generatorViewerState": { 161 + "type": "object", 162 + "properties": { 163 + "like": { "type": "string", "format": "at-uri" } 164 + } 165 + }, 166 + "skeletonFeedPost": { 167 + "type": "object", 168 + "required": ["post"], 169 + "properties": { 170 + "post": { "type": "string", "format": "at-uri" }, 171 + "reason": { "type": "union", "refs": ["#skeletonReasonRepost"] }, 172 + "feedContext": { 173 + "type": "string", 174 + "description": "Context that will be passed through to client and may be passed to feed generator back alongside interactions.", 175 + "maxLength": 2000 176 + } 177 + } 178 + }, 179 + "skeletonReasonRepost": { 180 + "type": "object", 181 + "required": ["repost"], 182 + "properties": { 183 + "repost": { "type": "string", "format": "at-uri" } 184 + } 185 + }, 186 + "threadgateView": { 187 + "type": "object", 188 + "properties": { 189 + "uri": { "type": "string", "format": "at-uri" }, 190 + "cid": { "type": "string", "format": "cid" }, 191 + "record": { "type": "unknown" }, 192 + "lists": { 193 + "type": "array", 194 + "items": { "type": "ref", "ref": "app.bsky.graph.defs#listViewBasic" } 195 + } 196 + } 197 + }, 198 + "interaction": { 199 + "type": "object", 200 + "properties": { 201 + "item": { "type": "string", "format": "at-uri" }, 202 + "event": { 203 + "type": "string", 204 + "knownValues": [ 205 + "app.bsky.feed.defs#requestLess", 206 + "app.bsky.feed.defs#requestMore", 207 + "app.bsky.feed.defs#clickthroughItem", 208 + "app.bsky.feed.defs#clickthroughAuthor", 209 + "app.bsky.feed.defs#clickthroughReposter", 210 + "app.bsky.feed.defs#clickthroughEmbed", 211 + "app.bsky.feed.defs#interactionSeen", 212 + "app.bsky.feed.defs#interactionLike", 213 + "app.bsky.feed.defs#interactionRepost", 214 + "app.bsky.feed.defs#interactionReply", 215 + "app.bsky.feed.defs#interactionQuote", 216 + "app.bsky.feed.defs#interactionShare" 217 + ] 218 + }, 219 + "feedContext": { 220 + "type": "string", 221 + "description": "Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.", 222 + "maxLength": 2000 223 + } 224 + } 225 + }, 226 + "requestLess": { 227 + "type": "token", 228 + "description": "Request that less content like the given feed item be shown in the feed" 229 + }, 230 + "requestMore": { 231 + "type": "token", 232 + "description": "Request that more content like the given feed item be shown in the feed" 233 + }, 234 + "clickthroughItem": { 235 + "type": "token", 236 + "description": "User clicked through to the feed item" 237 + }, 238 + "clickthroughAuthor": { 239 + "type": "token", 240 + "description": "User clicked through to the author of the feed item" 241 + }, 242 + "clickthroughReposter": { 243 + "type": "token", 244 + "description": "User clicked through to the reposter of the feed item" 245 + }, 246 + "clickthroughEmbed": { 247 + "type": "token", 248 + "description": "User clicked through to the embedded content of the feed item" 249 + }, 250 + "interactionSeen": { 251 + "type": "token", 252 + "description": "Feed item was seen by user" 253 + }, 254 + "interactionLike": { 255 + "type": "token", 256 + "description": "User liked the feed item" 257 + }, 258 + "interactionRepost": { 259 + "type": "token", 260 + "description": "User reposted the feed item" 261 + }, 262 + "interactionReply": { 263 + "type": "token", 264 + "description": "User replied to the feed item" 265 + }, 266 + "interactionQuote": { 267 + "type": "token", 268 + "description": "User quoted the feed item" 269 + }, 270 + "interactionShare": { 271 + "type": "token", 272 + "description": "User shared the feed item" 273 + } 274 + } 275 + }
+39
lexicons/app/bsky/feed/describeFeedGenerator.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.describeFeedGenerator", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get information about a feed generator, including policies and offered feed URIs. Does not require auth; implemented by Feed Generator services (not App View).", 8 + "output": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["did", "feeds"], 13 + "properties": { 14 + "did": { "type": "string", "format": "did" }, 15 + "feeds": { 16 + "type": "array", 17 + "items": { "type": "ref", "ref": "#feed" } 18 + }, 19 + "links": { "type": "ref", "ref": "#links" } 20 + } 21 + } 22 + } 23 + }, 24 + "feed": { 25 + "type": "object", 26 + "required": ["uri"], 27 + "properties": { 28 + "uri": { "type": "string", "format": "at-uri" } 29 + } 30 + }, 31 + "links": { 32 + "type": "object", 33 + "properties": { 34 + "privacyPolicy": { "type": "string" }, 35 + "termsOfService": { "type": "string" } 36 + } 37 + } 38 + } 39 + }
+47
lexicons/app/bsky/feed/generator.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.generator", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Record declaring of the existence of a feed generator, and containing metadata about it. The record can exist in any repository.", 8 + "key": "any", 9 + "record": { 10 + "type": "object", 11 + "required": ["did", "displayName", "createdAt"], 12 + "properties": { 13 + "did": { "type": "string", "format": "did" }, 14 + "displayName": { 15 + "type": "string", 16 + "maxGraphemes": 24, 17 + "maxLength": 240 18 + }, 19 + "description": { 20 + "type": "string", 21 + "maxGraphemes": 300, 22 + "maxLength": 3000 23 + }, 24 + "descriptionFacets": { 25 + "type": "array", 26 + "items": { "type": "ref", "ref": "app.bsky.richtext.facet" } 27 + }, 28 + "avatar": { 29 + "type": "blob", 30 + "accept": ["image/png", "image/jpeg"], 31 + "maxSize": 1000000 32 + }, 33 + "acceptsInteractions": { 34 + "type": "boolean", 35 + "description": "Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions" 36 + }, 37 + "labels": { 38 + "type": "union", 39 + "description": "Self-label values", 40 + "refs": ["com.atproto.label.defs#selfLabels"] 41 + }, 42 + "createdAt": { "type": "string", "format": "datetime" } 43 + } 44 + } 45 + } 46 + } 47 + }
+41
lexicons/app/bsky/feed/getActorFeeds.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.getActorFeeds", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a list of feeds (feed generator records) created by the actor (in the actor's repo).", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["actor"], 11 + "properties": { 12 + "actor": { "type": "string", "format": "at-identifier" }, 13 + "limit": { 14 + "type": "integer", 15 + "minimum": 1, 16 + "maximum": 100, 17 + "default": 50 18 + }, 19 + "cursor": { "type": "string" } 20 + } 21 + }, 22 + "output": { 23 + "encoding": "application/json", 24 + "schema": { 25 + "type": "object", 26 + "required": ["feeds"], 27 + "properties": { 28 + "cursor": { "type": "string" }, 29 + "feeds": { 30 + "type": "array", 31 + "items": { 32 + "type": "ref", 33 + "ref": "app.bsky.feed.defs#generatorView" 34 + } 35 + } 36 + } 37 + } 38 + } 39 + } 40 + } 41 + }
+42
lexicons/app/bsky/feed/getActorLikes.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.getActorLikes", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a list of posts liked by an actor. Does not require auth.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["actor"], 11 + "properties": { 12 + "actor": { "type": "string", "format": "at-identifier" }, 13 + "limit": { 14 + "type": "integer", 15 + "minimum": 1, 16 + "maximum": 100, 17 + "default": 50 18 + }, 19 + "cursor": { "type": "string" } 20 + } 21 + }, 22 + "output": { 23 + "encoding": "application/json", 24 + "schema": { 25 + "type": "object", 26 + "required": ["feed"], 27 + "properties": { 28 + "cursor": { "type": "string" }, 29 + "feed": { 30 + "type": "array", 31 + "items": { 32 + "type": "ref", 33 + "ref": "app.bsky.feed.defs#feedViewPost" 34 + } 35 + } 36 + } 37 + } 38 + }, 39 + "errors": [{ "name": "BlockedActor" }, { "name": "BlockedByActor" }] 40 + } 41 + } 42 + }
+53
lexicons/app/bsky/feed/getAuthorFeed.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.getAuthorFeed", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a view of an actor's 'author feed' (post and reposts by the author). Does not require auth.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["actor"], 11 + "properties": { 12 + "actor": { "type": "string", "format": "at-identifier" }, 13 + "limit": { 14 + "type": "integer", 15 + "minimum": 1, 16 + "maximum": 100, 17 + "default": 50 18 + }, 19 + "cursor": { "type": "string" }, 20 + "filter": { 21 + "type": "string", 22 + "description": "Combinations of post/repost types to include in response.", 23 + "knownValues": [ 24 + "posts_with_replies", 25 + "posts_no_replies", 26 + "posts_with_media", 27 + "posts_and_author_threads" 28 + ], 29 + "default": "posts_with_replies" 30 + } 31 + } 32 + }, 33 + "output": { 34 + "encoding": "application/json", 35 + "schema": { 36 + "type": "object", 37 + "required": ["feed"], 38 + "properties": { 39 + "cursor": { "type": "string" }, 40 + "feed": { 41 + "type": "array", 42 + "items": { 43 + "type": "ref", 44 + "ref": "app.bsky.feed.defs#feedViewPost" 45 + } 46 + } 47 + } 48 + } 49 + }, 50 + "errors": [{ "name": "BlockedActor" }, { "name": "BlockedByActor" }] 51 + } 52 + } 53 + }
+42
lexicons/app/bsky/feed/getFeed.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.getFeed", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a hydrated feed from an actor's selected feed generator. Implemented by App View.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["feed"], 11 + "properties": { 12 + "feed": { "type": "string", "format": "at-uri" }, 13 + "limit": { 14 + "type": "integer", 15 + "minimum": 1, 16 + "maximum": 100, 17 + "default": 50 18 + }, 19 + "cursor": { "type": "string" } 20 + } 21 + }, 22 + "output": { 23 + "encoding": "application/json", 24 + "schema": { 25 + "type": "object", 26 + "required": ["feed"], 27 + "properties": { 28 + "cursor": { "type": "string" }, 29 + "feed": { 30 + "type": "array", 31 + "items": { 32 + "type": "ref", 33 + "ref": "app.bsky.feed.defs#feedViewPost" 34 + } 35 + } 36 + } 37 + } 38 + }, 39 + "errors": [{ "name": "UnknownFeed" }] 40 + } 41 + } 42 + }
+42
lexicons/app/bsky/feed/getFeedGenerator.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.getFeedGenerator", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get information about a feed generator. Implemented by AppView.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["feed"], 11 + "properties": { 12 + "feed": { 13 + "type": "string", 14 + "format": "at-uri", 15 + "description": "AT-URI of the feed generator record." 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "object", 23 + "required": ["view", "isOnline", "isValid"], 24 + "properties": { 25 + "view": { 26 + "type": "ref", 27 + "ref": "app.bsky.feed.defs#generatorView" 28 + }, 29 + "isOnline": { 30 + "type": "boolean", 31 + "description": "Indicates whether the feed generator service has been online recently, or else seems to be inactive." 32 + }, 33 + "isValid": { 34 + "type": "boolean", 35 + "description": "Indicates whether the feed generator service is compatible with the record declaration." 36 + } 37 + } 38 + } 39 + } 40 + } 41 + } 42 + }
+36
lexicons/app/bsky/feed/getFeedGenerators.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.getFeedGenerators", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get information about a list of feed generators.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["feeds"], 11 + "properties": { 12 + "feeds": { 13 + "type": "array", 14 + "items": { "type": "string", "format": "at-uri" } 15 + } 16 + } 17 + }, 18 + "output": { 19 + "encoding": "application/json", 20 + "schema": { 21 + "type": "object", 22 + "required": ["feeds"], 23 + "properties": { 24 + "feeds": { 25 + "type": "array", 26 + "items": { 27 + "type": "ref", 28 + "ref": "app.bsky.feed.defs#generatorView" 29 + } 30 + } 31 + } 32 + } 33 + } 34 + } 35 + } 36 + }
+46
lexicons/app/bsky/feed/getFeedSkeleton.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.getFeedSkeleton", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a skeleton of a feed provided by a feed generator. Auth is optional, depending on provider requirements, and provides the DID of the requester. Implemented by Feed Generator Service.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["feed"], 11 + "properties": { 12 + "feed": { 13 + "type": "string", 14 + "format": "at-uri", 15 + "description": "Reference to feed generator record describing the specific feed being requested." 16 + }, 17 + "limit": { 18 + "type": "integer", 19 + "minimum": 1, 20 + "maximum": 100, 21 + "default": 50 22 + }, 23 + "cursor": { "type": "string" } 24 + } 25 + }, 26 + "output": { 27 + "encoding": "application/json", 28 + "schema": { 29 + "type": "object", 30 + "required": ["feed"], 31 + "properties": { 32 + "cursor": { "type": "string" }, 33 + "feed": { 34 + "type": "array", 35 + "items": { 36 + "type": "ref", 37 + "ref": "app.bsky.feed.defs#skeletonFeedPost" 38 + } 39 + } 40 + } 41 + } 42 + }, 43 + "errors": [{ "name": "UnknownFeed" }] 44 + } 45 + } 46 + }
+58
lexicons/app/bsky/feed/getLikes.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.getLikes", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get like records which reference a subject (by AT-URI and CID).", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["uri"], 11 + "properties": { 12 + "uri": { 13 + "type": "string", 14 + "format": "at-uri", 15 + "description": "AT-URI of the subject (eg, a post record)." 16 + }, 17 + "cid": { 18 + "type": "string", 19 + "format": "cid", 20 + "description": "CID of the subject record (aka, specific version of record), to filter likes." 21 + }, 22 + "limit": { 23 + "type": "integer", 24 + "minimum": 1, 25 + "maximum": 100, 26 + "default": 50 27 + }, 28 + "cursor": { "type": "string" } 29 + } 30 + }, 31 + "output": { 32 + "encoding": "application/json", 33 + "schema": { 34 + "type": "object", 35 + "required": ["uri", "likes"], 36 + "properties": { 37 + "uri": { "type": "string", "format": "at-uri" }, 38 + "cid": { "type": "string", "format": "cid" }, 39 + "cursor": { "type": "string" }, 40 + "likes": { 41 + "type": "array", 42 + "items": { "type": "ref", "ref": "#like" } 43 + } 44 + } 45 + } 46 + } 47 + }, 48 + "like": { 49 + "type": "object", 50 + "required": ["indexedAt", "createdAt", "actor"], 51 + "properties": { 52 + "indexedAt": { "type": "string", "format": "datetime" }, 53 + "createdAt": { "type": "string", "format": "datetime" }, 54 + "actor": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" } 55 + } 56 + } 57 + } 58 + }
+46
lexicons/app/bsky/feed/getListFeed.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.getListFeed", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a feed of recent posts from a list (posts and reposts from any actors on the list). Does not require auth.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["list"], 11 + "properties": { 12 + "list": { 13 + "type": "string", 14 + "format": "at-uri", 15 + "description": "Reference (AT-URI) to the list record." 16 + }, 17 + "limit": { 18 + "type": "integer", 19 + "minimum": 1, 20 + "maximum": 100, 21 + "default": 50 22 + }, 23 + "cursor": { "type": "string" } 24 + } 25 + }, 26 + "output": { 27 + "encoding": "application/json", 28 + "schema": { 29 + "type": "object", 30 + "required": ["feed"], 31 + "properties": { 32 + "cursor": { "type": "string" }, 33 + "feed": { 34 + "type": "array", 35 + "items": { 36 + "type": "ref", 37 + "ref": "app.bsky.feed.defs#feedViewPost" 38 + } 39 + } 40 + } 41 + } 42 + }, 43 + "errors": [{ "name": "UnknownList" }] 44 + } 45 + } 46 + }
+53
lexicons/app/bsky/feed/getPostThread.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.getPostThread", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get posts in a thread. Does not require auth, but additional metadata and filtering will be applied for authed requests.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["uri"], 11 + "properties": { 12 + "uri": { 13 + "type": "string", 14 + "format": "at-uri", 15 + "description": "Reference (AT-URI) to post record." 16 + }, 17 + "depth": { 18 + "type": "integer", 19 + "description": "How many levels of reply depth should be included in response.", 20 + "default": 6, 21 + "minimum": 0, 22 + "maximum": 1000 23 + }, 24 + "parentHeight": { 25 + "type": "integer", 26 + "description": "How many levels of parent (and grandparent, etc) post to include.", 27 + "default": 80, 28 + "minimum": 0, 29 + "maximum": 1000 30 + } 31 + } 32 + }, 33 + "output": { 34 + "encoding": "application/json", 35 + "schema": { 36 + "type": "object", 37 + "required": ["thread"], 38 + "properties": { 39 + "thread": { 40 + "type": "union", 41 + "refs": [ 42 + "app.bsky.feed.defs#threadViewPost", 43 + "app.bsky.feed.defs#notFoundPost", 44 + "app.bsky.feed.defs#blockedPost" 45 + ] 46 + } 47 + } 48 + } 49 + }, 50 + "errors": [{ "name": "NotFound" }] 51 + } 52 + } 53 + }
+35
lexicons/app/bsky/feed/getPosts.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.getPosts", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["uris"], 11 + "properties": { 12 + "uris": { 13 + "type": "array", 14 + "description": "List of post AT-URIs to return hydrated views for.", 15 + "items": { "type": "string", "format": "at-uri" }, 16 + "maxLength": 25 17 + } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "object", 24 + "required": ["posts"], 25 + "properties": { 26 + "posts": { 27 + "type": "array", 28 + "items": { "type": "ref", "ref": "app.bsky.feed.defs#postView" } 29 + } 30 + } 31 + } 32 + } 33 + } 34 + } 35 + }
+52
lexicons/app/bsky/feed/getRepostedBy.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.getRepostedBy", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a list of reposts for a given post.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["uri"], 11 + "properties": { 12 + "uri": { 13 + "type": "string", 14 + "format": "at-uri", 15 + "description": "Reference (AT-URI) of post record" 16 + }, 17 + "cid": { 18 + "type": "string", 19 + "format": "cid", 20 + "description": "If supplied, filters to reposts of specific version (by CID) of the post record." 21 + }, 22 + "limit": { 23 + "type": "integer", 24 + "minimum": 1, 25 + "maximum": 100, 26 + "default": 50 27 + }, 28 + "cursor": { "type": "string" } 29 + } 30 + }, 31 + "output": { 32 + "encoding": "application/json", 33 + "schema": { 34 + "type": "object", 35 + "required": ["uri", "repostedBy"], 36 + "properties": { 37 + "uri": { "type": "string", "format": "at-uri" }, 38 + "cid": { "type": "string", "format": "cid" }, 39 + "cursor": { "type": "string" }, 40 + "repostedBy": { 41 + "type": "array", 42 + "items": { 43 + "type": "ref", 44 + "ref": "app.bsky.actor.defs#profileView" 45 + } 46 + } 47 + } 48 + } 49 + } 50 + } 51 + } 52 + }
+39
lexicons/app/bsky/feed/getSuggestedFeeds.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.getSuggestedFeeds", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a list of suggested feeds (feed generators) for the requesting account.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "limit": { 12 + "type": "integer", 13 + "minimum": 1, 14 + "maximum": 100, 15 + "default": 50 16 + }, 17 + "cursor": { "type": "string" } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "object", 24 + "required": ["feeds"], 25 + "properties": { 26 + "cursor": { "type": "string" }, 27 + "feeds": { 28 + "type": "array", 29 + "items": { 30 + "type": "ref", 31 + "ref": "app.bsky.feed.defs#generatorView" 32 + } 33 + } 34 + } 35 + } 36 + } 37 + } 38 + } 39 + }
+43
lexicons/app/bsky/feed/getTimeline.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.getTimeline", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a view of the requesting account's home timeline. This is expected to be some form of reverse-chronological feed.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "algorithm": { 12 + "type": "string", 13 + "description": "Variant 'algorithm' for timeline. Implementation-specific. NOTE: most feed flexibility has been moved to feed generator mechanism." 14 + }, 15 + "limit": { 16 + "type": "integer", 17 + "minimum": 1, 18 + "maximum": 100, 19 + "default": 50 20 + }, 21 + "cursor": { "type": "string" } 22 + } 23 + }, 24 + "output": { 25 + "encoding": "application/json", 26 + "schema": { 27 + "type": "object", 28 + "required": ["feed"], 29 + "properties": { 30 + "cursor": { "type": "string" }, 31 + "feed": { 32 + "type": "array", 33 + "items": { 34 + "type": "ref", 35 + "ref": "app.bsky.feed.defs#feedViewPost" 36 + } 37 + } 38 + } 39 + } 40 + } 41 + } 42 + } 43 + }
+19
lexicons/app/bsky/feed/like.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.like", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Record declaring a 'like' of a piece of subject content.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": ["subject", "createdAt"], 12 + "properties": { 13 + "subject": { "type": "ref", "ref": "com.atproto.repo.strongRef" }, 14 + "createdAt": { "type": "string", "format": "datetime" } 15 + } 16 + } 17 + } 18 + } 19 + }
+95
lexicons/app/bsky/feed/post.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.post", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Record containing a Bluesky post.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": ["text", "createdAt"], 12 + "properties": { 13 + "text": { 14 + "type": "string", 15 + "maxLength": 3000, 16 + "maxGraphemes": 300, 17 + "description": "The primary post content. May be an empty string, if there are embeds." 18 + }, 19 + "entities": { 20 + "type": "array", 21 + "description": "DEPRECATED: replaced by app.bsky.richtext.facet.", 22 + "items": { "type": "ref", "ref": "#entity" } 23 + }, 24 + "facets": { 25 + "type": "array", 26 + "description": "Annotations of text (mentions, URLs, hashtags, etc)", 27 + "items": { "type": "ref", "ref": "app.bsky.richtext.facet" } 28 + }, 29 + "reply": { "type": "ref", "ref": "#replyRef" }, 30 + "embed": { 31 + "type": "union", 32 + "refs": [ 33 + "app.bsky.embed.images", 34 + "app.bsky.embed.external", 35 + "app.bsky.embed.record", 36 + "app.bsky.embed.recordWithMedia" 37 + ] 38 + }, 39 + "langs": { 40 + "type": "array", 41 + "description": "Indicates human language of post primary text content.", 42 + "maxLength": 3, 43 + "items": { "type": "string", "format": "language" } 44 + }, 45 + "labels": { 46 + "type": "union", 47 + "description": "Self-label values for this post. Effectively content warnings.", 48 + "refs": ["com.atproto.label.defs#selfLabels"] 49 + }, 50 + "tags": { 51 + "type": "array", 52 + "description": "Additional hashtags, in addition to any included in post text and facets.", 53 + "maxLength": 8, 54 + "items": { "type": "string", "maxLength": 640, "maxGraphemes": 64 } 55 + }, 56 + "createdAt": { 57 + "type": "string", 58 + "format": "datetime", 59 + "description": "Client-declared timestamp when this post was originally created." 60 + } 61 + } 62 + } 63 + }, 64 + "replyRef": { 65 + "type": "object", 66 + "required": ["root", "parent"], 67 + "properties": { 68 + "root": { "type": "ref", "ref": "com.atproto.repo.strongRef" }, 69 + "parent": { "type": "ref", "ref": "com.atproto.repo.strongRef" } 70 + } 71 + }, 72 + "entity": { 73 + "type": "object", 74 + "description": "Deprecated: use facets instead.", 75 + "required": ["index", "type", "value"], 76 + "properties": { 77 + "index": { "type": "ref", "ref": "#textSlice" }, 78 + "type": { 79 + "type": "string", 80 + "description": "Expected values are 'mention' and 'link'." 81 + }, 82 + "value": { "type": "string" } 83 + } 84 + }, 85 + "textSlice": { 86 + "type": "object", 87 + "description": "Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings.", 88 + "required": ["start", "end"], 89 + "properties": { 90 + "start": { "type": "integer", "minimum": 0 }, 91 + "end": { "type": "integer", "minimum": 0 } 92 + } 93 + } 94 + } 95 + }
+19
lexicons/app/bsky/feed/repost.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.repost", 4 + "defs": { 5 + "main": { 6 + "description": "Record representing a 'repost' of an existing Bluesky post.", 7 + "type": "record", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": ["subject", "createdAt"], 12 + "properties": { 13 + "subject": { "type": "ref", "ref": "com.atproto.repo.strongRef" }, 14 + "createdAt": { "type": "string", "format": "datetime" } 15 + } 16 + } 17 + } 18 + } 19 + }
+99
lexicons/app/bsky/feed/searchPosts.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.searchPosts", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Find posts matching search criteria, returning views of those posts.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["q"], 11 + "properties": { 12 + "q": { 13 + "type": "string", 14 + "description": "Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended." 15 + }, 16 + "sort": { 17 + "type": "string", 18 + "knownValues": ["top", "latest"], 19 + "default": "latest", 20 + "description": "Specifies the ranking order of results." 21 + }, 22 + "since": { 23 + "type": "string", 24 + "description": "Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD)." 25 + }, 26 + "until": { 27 + "type": "string", 28 + "description": "Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD)." 29 + }, 30 + "mentions": { 31 + "type": "string", 32 + "format": "at-identifier", 33 + "description": "Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions." 34 + }, 35 + "author": { 36 + "type": "string", 37 + "format": "at-identifier", 38 + "description": "Filter to posts by the given account. Handles are resolved to DID before query-time." 39 + }, 40 + "lang": { 41 + "type": "string", 42 + "format": "language", 43 + "description": "Filter to posts in the given language. Expected to be based on post language field, though server may override language detection." 44 + }, 45 + "domain": { 46 + "type": "string", 47 + "description": "Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization." 48 + }, 49 + "url": { 50 + "type": "string", 51 + "format": "uri", 52 + "description": "Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching." 53 + }, 54 + "tag": { 55 + "type": "array", 56 + "items": { 57 + "type": "string", 58 + "maxLength": 640, 59 + "maxGraphemes": 64 60 + }, 61 + "description": "Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching." 62 + }, 63 + "limit": { 64 + "type": "integer", 65 + "minimum": 1, 66 + "maximum": 100, 67 + "default": 25 68 + }, 69 + "cursor": { 70 + "type": "string", 71 + "description": "Optional pagination mechanism; may not necessarily allow scrolling through entire result set." 72 + } 73 + } 74 + }, 75 + "output": { 76 + "encoding": "application/json", 77 + "schema": { 78 + "type": "object", 79 + "required": ["posts"], 80 + "properties": { 81 + "cursor": { "type": "string" }, 82 + "hitsTotal": { 83 + "type": "integer", 84 + "description": "Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits." 85 + }, 86 + "posts": { 87 + "type": "array", 88 + "items": { 89 + "type": "ref", 90 + "ref": "app.bsky.feed.defs#postView" 91 + } 92 + } 93 + } 94 + } 95 + }, 96 + "errors": [{ "name": "BadQueryString" }] 97 + } 98 + } 99 + }
+33
lexicons/app/bsky/feed/sendInteractions.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.sendInteractions", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Send information about interactions with feed items back to the feed generator that served them.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["interactions"], 13 + "properties": { 14 + "interactions": { 15 + "type": "array", 16 + "items": { 17 + "type": "ref", 18 + "ref": "app.bsky.feed.defs#interaction" 19 + } 20 + } 21 + } 22 + } 23 + }, 24 + "output": { 25 + "encoding": "application/json", 26 + "schema": { 27 + "type": "object", 28 + "properties": {} 29 + } 30 + } 31 + } 32 + } 33 + }
+49
lexicons/app/bsky/feed/threadgate.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.feed.threadgate", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "key": "tid", 8 + "description": "Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository..", 9 + "record": { 10 + "type": "object", 11 + "required": ["post", "createdAt"], 12 + "properties": { 13 + "post": { 14 + "type": "string", 15 + "format": "at-uri", 16 + "description": "Reference (AT-URI) to the post record." 17 + }, 18 + "allow": { 19 + "type": "array", 20 + "maxLength": 5, 21 + "items": { 22 + "type": "union", 23 + "refs": ["#mentionRule", "#followingRule", "#listRule"] 24 + } 25 + }, 26 + "createdAt": { "type": "string", "format": "datetime" } 27 + } 28 + } 29 + }, 30 + "mentionRule": { 31 + "type": "object", 32 + "description": "Allow replies from actors mentioned in your post.", 33 + "properties": {} 34 + }, 35 + "followingRule": { 36 + "type": "object", 37 + "description": "Allow replies from actors you follow.", 38 + "properties": {} 39 + }, 40 + "listRule": { 41 + "type": "object", 42 + "description": "Allow replies from actors on a list.", 43 + "required": ["list"], 44 + "properties": { 45 + "list": { "type": "string", "format": "at-uri" } 46 + } 47 + } 48 + } 49 + }
+23
lexicons/app/bsky/graph/block.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.block", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Record declaring a 'block' relationship against another account. NOTE: blocks are public in Bluesky; see blog posts for details.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": ["subject", "createdAt"], 12 + "properties": { 13 + "subject": { 14 + "type": "string", 15 + "format": "did", 16 + "description": "DID of the account to be blocked." 17 + }, 18 + "createdAt": { "type": "string", "format": "datetime" } 19 + } 20 + } 21 + } 22 + } 23 + }
+166
lexicons/app/bsky/graph/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.defs", 4 + "defs": { 5 + "listViewBasic": { 6 + "type": "object", 7 + "required": ["uri", "cid", "name", "purpose"], 8 + "properties": { 9 + "uri": { "type": "string", "format": "at-uri" }, 10 + "cid": { "type": "string", "format": "cid" }, 11 + "name": { "type": "string", "maxLength": 64, "minLength": 1 }, 12 + "purpose": { "type": "ref", "ref": "#listPurpose" }, 13 + "avatar": { "type": "string", "format": "uri" }, 14 + "listItemCount": { "type": "integer", "minimum": 0 }, 15 + "labels": { 16 + "type": "array", 17 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 18 + }, 19 + "viewer": { "type": "ref", "ref": "#listViewerState" }, 20 + "indexedAt": { "type": "string", "format": "datetime" } 21 + } 22 + }, 23 + "listView": { 24 + "type": "object", 25 + "required": ["uri", "cid", "creator", "name", "purpose", "indexedAt"], 26 + "properties": { 27 + "uri": { "type": "string", "format": "at-uri" }, 28 + "cid": { "type": "string", "format": "cid" }, 29 + "creator": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" }, 30 + "name": { "type": "string", "maxLength": 64, "minLength": 1 }, 31 + "purpose": { "type": "ref", "ref": "#listPurpose" }, 32 + "description": { 33 + "type": "string", 34 + "maxGraphemes": 300, 35 + "maxLength": 3000 36 + }, 37 + "descriptionFacets": { 38 + "type": "array", 39 + "items": { "type": "ref", "ref": "app.bsky.richtext.facet" } 40 + }, 41 + "avatar": { "type": "string", "format": "uri" }, 42 + "listItemCount": { "type": "integer", "minimum": 0 }, 43 + "labels": { 44 + "type": "array", 45 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 46 + }, 47 + "viewer": { "type": "ref", "ref": "#listViewerState" }, 48 + "indexedAt": { "type": "string", "format": "datetime" } 49 + } 50 + }, 51 + "listItemView": { 52 + "type": "object", 53 + "required": ["uri", "subject"], 54 + "properties": { 55 + "uri": { "type": "string", "format": "at-uri" }, 56 + "subject": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" } 57 + } 58 + }, 59 + "starterPackView": { 60 + "type": "object", 61 + "required": ["uri", "cid", "record", "creator", "indexedAt"], 62 + "properties": { 63 + "uri": { "type": "string", "format": "at-uri" }, 64 + "cid": { "type": "string", "format": "cid" }, 65 + "record": { "type": "unknown" }, 66 + "creator": { 67 + "type": "ref", 68 + "ref": "app.bsky.actor.defs#profileViewBasic" 69 + }, 70 + "list": { "type": "ref", "ref": "#listViewBasic" }, 71 + "listItemsSample": { 72 + "type": "array", 73 + "maxLength": 12, 74 + "items": { "type": "ref", "ref": "#listItemView" } 75 + }, 76 + "feeds": { 77 + "type": "array", 78 + "maxLength": 3, 79 + "items": { "type": "ref", "ref": "app.bsky.feed.defs#generatorView" } 80 + }, 81 + "joinedWeekCount": { "type": "integer", "minimum": 0 }, 82 + "joinedAllTimeCount": { "type": "integer", "minimum": 0 }, 83 + "labels": { 84 + "type": "array", 85 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 86 + }, 87 + "indexedAt": { "type": "string", "format": "datetime" } 88 + } 89 + }, 90 + "starterPackViewBasic": { 91 + "type": "object", 92 + "required": ["uri", "cid", "record", "creator", "indexedAt"], 93 + "properties": { 94 + "uri": { "type": "string", "format": "at-uri" }, 95 + "cid": { "type": "string", "format": "cid" }, 96 + "record": { "type": "unknown" }, 97 + "creator": { 98 + "type": "ref", 99 + "ref": "app.bsky.actor.defs#profileViewBasic" 100 + }, 101 + "listItemCount": { "type": "integer", "minimum": 0 }, 102 + "joinedWeekCount": { "type": "integer", "minimum": 0 }, 103 + "joinedAllTimeCount": { "type": "integer", "minimum": 0 }, 104 + "labels": { 105 + "type": "array", 106 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 107 + }, 108 + "indexedAt": { "type": "string", "format": "datetime" } 109 + } 110 + }, 111 + "listPurpose": { 112 + "type": "string", 113 + "knownValues": [ 114 + "app.bsky.graph.defs#modlist", 115 + "app.bsky.graph.defs#curatelist", 116 + "app.bsky.graph.defs#referencelist" 117 + ] 118 + }, 119 + "modlist": { 120 + "type": "token", 121 + "description": "A list of actors to apply an aggregate moderation action (mute/block) on." 122 + }, 123 + "curatelist": { 124 + "type": "token", 125 + "description": "A list of actors used for curation purposes such as list feeds or interaction gating." 126 + }, 127 + "referencelist": { 128 + "type": "token", 129 + "description": "A list of actors used for only for reference purposes such as within a starter pack." 130 + }, 131 + "listViewerState": { 132 + "type": "object", 133 + "properties": { 134 + "muted": { "type": "boolean" }, 135 + "blocked": { "type": "string", "format": "at-uri" } 136 + } 137 + }, 138 + "notFoundActor": { 139 + "type": "object", 140 + "description": "indicates that a handle or DID could not be resolved", 141 + "required": ["actor", "notFound"], 142 + "properties": { 143 + "actor": { "type": "string", "format": "at-identifier" }, 144 + "notFound": { "type": "boolean", "const": true } 145 + } 146 + }, 147 + "relationship": { 148 + "type": "object", 149 + "description": "lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object)", 150 + "required": ["did"], 151 + "properties": { 152 + "did": { "type": "string", "format": "did" }, 153 + "following": { 154 + "type": "string", 155 + "format": "at-uri", 156 + "description": "if the actor follows this DID, this is the AT-URI of the follow record" 157 + }, 158 + "followedBy": { 159 + "type": "string", 160 + "format": "at-uri", 161 + "description": "if the actor is followed by this DID, contains the AT-URI of the follow record" 162 + } 163 + } 164 + } 165 + } 166 + }
+19
lexicons/app/bsky/graph/follow.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.follow", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Record declaring a social 'follow' relationship of another account. Duplicate follows will be ignored by the AppView.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": ["subject", "createdAt"], 12 + "properties": { 13 + "subject": { "type": "string", "format": "did" }, 14 + "createdAt": { "type": "string", "format": "datetime" } 15 + } 16 + } 17 + } 18 + } 19 + }
+41
lexicons/app/bsky/graph/getActorStarterPacks.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.getActorStarterPacks", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a list of starter packs created by the actor.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["actor"], 11 + "properties": { 12 + "actor": { "type": "string", "format": "at-identifier" }, 13 + "limit": { 14 + "type": "integer", 15 + "minimum": 1, 16 + "maximum": 100, 17 + "default": 50 18 + }, 19 + "cursor": { "type": "string" } 20 + } 21 + }, 22 + "output": { 23 + "encoding": "application/json", 24 + "schema": { 25 + "type": "object", 26 + "required": ["starterPacks"], 27 + "properties": { 28 + "cursor": { "type": "string" }, 29 + "starterPacks": { 30 + "type": "array", 31 + "items": { 32 + "type": "ref", 33 + "ref": "app.bsky.graph.defs#starterPackViewBasic" 34 + } 35 + } 36 + } 37 + } 38 + } 39 + } 40 + } 41 + }
+39
lexicons/app/bsky/graph/getBlocks.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.getBlocks", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Enumerates which accounts the requesting account is currently blocking. Requires auth.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "limit": { 12 + "type": "integer", 13 + "minimum": 1, 14 + "maximum": 100, 15 + "default": 50 16 + }, 17 + "cursor": { "type": "string" } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "object", 24 + "required": ["blocks"], 25 + "properties": { 26 + "cursor": { "type": "string" }, 27 + "blocks": { 28 + "type": "array", 29 + "items": { 30 + "type": "ref", 31 + "ref": "app.bsky.actor.defs#profileView" 32 + } 33 + } 34 + } 35 + } 36 + } 37 + } 38 + } 39 + }
+45
lexicons/app/bsky/graph/getFollowers.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.getFollowers", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Enumerates accounts which follow a specified account (actor).", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["actor"], 11 + "properties": { 12 + "actor": { "type": "string", "format": "at-identifier" }, 13 + "limit": { 14 + "type": "integer", 15 + "minimum": 1, 16 + "maximum": 100, 17 + "default": 50 18 + }, 19 + "cursor": { "type": "string" } 20 + } 21 + }, 22 + "output": { 23 + "encoding": "application/json", 24 + "schema": { 25 + "type": "object", 26 + "required": ["subject", "followers"], 27 + "properties": { 28 + "subject": { 29 + "type": "ref", 30 + "ref": "app.bsky.actor.defs#profileView" 31 + }, 32 + "cursor": { "type": "string" }, 33 + "followers": { 34 + "type": "array", 35 + "items": { 36 + "type": "ref", 37 + "ref": "app.bsky.actor.defs#profileView" 38 + } 39 + } 40 + } 41 + } 42 + } 43 + } 44 + } 45 + }
+45
lexicons/app/bsky/graph/getFollows.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.getFollows", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Enumerates accounts which a specified account (actor) follows.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["actor"], 11 + "properties": { 12 + "actor": { "type": "string", "format": "at-identifier" }, 13 + "limit": { 14 + "type": "integer", 15 + "minimum": 1, 16 + "maximum": 100, 17 + "default": 50 18 + }, 19 + "cursor": { "type": "string" } 20 + } 21 + }, 22 + "output": { 23 + "encoding": "application/json", 24 + "schema": { 25 + "type": "object", 26 + "required": ["subject", "follows"], 27 + "properties": { 28 + "subject": { 29 + "type": "ref", 30 + "ref": "app.bsky.actor.defs#profileView" 31 + }, 32 + "cursor": { "type": "string" }, 33 + "follows": { 34 + "type": "array", 35 + "items": { 36 + "type": "ref", 37 + "ref": "app.bsky.actor.defs#profileView" 38 + } 39 + } 40 + } 41 + } 42 + } 43 + } 44 + } 45 + }
+45
lexicons/app/bsky/graph/getKnownFollowers.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.getKnownFollowers", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Enumerates accounts which follow a specified account (actor) and are followed by the viewer.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["actor"], 11 + "properties": { 12 + "actor": { "type": "string", "format": "at-identifier" }, 13 + "limit": { 14 + "type": "integer", 15 + "minimum": 1, 16 + "maximum": 100, 17 + "default": 50 18 + }, 19 + "cursor": { "type": "string" } 20 + } 21 + }, 22 + "output": { 23 + "encoding": "application/json", 24 + "schema": { 25 + "type": "object", 26 + "required": ["subject", "followers"], 27 + "properties": { 28 + "subject": { 29 + "type": "ref", 30 + "ref": "app.bsky.actor.defs#profileView" 31 + }, 32 + "cursor": { "type": "string" }, 33 + "followers": { 34 + "type": "array", 35 + "items": { 36 + "type": "ref", 37 + "ref": "app.bsky.actor.defs#profileView" 38 + } 39 + } 40 + } 41 + } 42 + } 43 + } 44 + } 45 + }
+46
lexicons/app/bsky/graph/getList.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.getList", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Gets a 'view' (with additional context) of a specified list.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["list"], 11 + "properties": { 12 + "list": { 13 + "type": "string", 14 + "format": "at-uri", 15 + "description": "Reference (AT-URI) of the list record to hydrate." 16 + }, 17 + "limit": { 18 + "type": "integer", 19 + "minimum": 1, 20 + "maximum": 100, 21 + "default": 50 22 + }, 23 + "cursor": { "type": "string" } 24 + } 25 + }, 26 + "output": { 27 + "encoding": "application/json", 28 + "schema": { 29 + "type": "object", 30 + "required": ["list", "items"], 31 + "properties": { 32 + "cursor": { "type": "string" }, 33 + "list": { "type": "ref", "ref": "app.bsky.graph.defs#listView" }, 34 + "items": { 35 + "type": "array", 36 + "items": { 37 + "type": "ref", 38 + "ref": "app.bsky.graph.defs#listItemView" 39 + } 40 + } 41 + } 42 + } 43 + } 44 + } 45 + } 46 + }
+36
lexicons/app/bsky/graph/getListBlocks.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.getListBlocks", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get mod lists that the requesting account (actor) is blocking. Requires auth.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "limit": { 12 + "type": "integer", 13 + "minimum": 1, 14 + "maximum": 100, 15 + "default": 50 16 + }, 17 + "cursor": { "type": "string" } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "object", 24 + "required": ["lists"], 25 + "properties": { 26 + "cursor": { "type": "string" }, 27 + "lists": { 28 + "type": "array", 29 + "items": { "type": "ref", "ref": "app.bsky.graph.defs#listView" } 30 + } 31 + } 32 + } 33 + } 34 + } 35 + } 36 + }
+36
lexicons/app/bsky/graph/getListMutes.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.getListMutes", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Enumerates mod lists that the requesting account (actor) currently has muted. Requires auth.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "limit": { 12 + "type": "integer", 13 + "minimum": 1, 14 + "maximum": 100, 15 + "default": 50 16 + }, 17 + "cursor": { "type": "string" } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "object", 24 + "required": ["lists"], 25 + "properties": { 26 + "cursor": { "type": "string" }, 27 + "lists": { 28 + "type": "array", 29 + "items": { "type": "ref", "ref": "app.bsky.graph.defs#listView" } 30 + } 31 + } 32 + } 33 + } 34 + } 35 + } 36 + }
+42
lexicons/app/bsky/graph/getLists.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.getLists", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Enumerates the lists created by a specified account (actor).", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["actor"], 11 + "properties": { 12 + "actor": { 13 + "type": "string", 14 + "format": "at-identifier", 15 + "description": "The account (actor) to enumerate lists from." 16 + }, 17 + "limit": { 18 + "type": "integer", 19 + "minimum": 1, 20 + "maximum": 100, 21 + "default": 50 22 + }, 23 + "cursor": { "type": "string" } 24 + } 25 + }, 26 + "output": { 27 + "encoding": "application/json", 28 + "schema": { 29 + "type": "object", 30 + "required": ["lists"], 31 + "properties": { 32 + "cursor": { "type": "string" }, 33 + "lists": { 34 + "type": "array", 35 + "items": { "type": "ref", "ref": "app.bsky.graph.defs#listView" } 36 + } 37 + } 38 + } 39 + } 40 + } 41 + } 42 + }
+39
lexicons/app/bsky/graph/getMutes.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.getMutes", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Enumerates accounts that the requesting account (actor) currently has muted. Requires auth.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "limit": { 12 + "type": "integer", 13 + "minimum": 1, 14 + "maximum": 100, 15 + "default": 50 16 + }, 17 + "cursor": { "type": "string" } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "object", 24 + "required": ["mutes"], 25 + "properties": { 26 + "cursor": { "type": "string" }, 27 + "mutes": { 28 + "type": "array", 29 + "items": { 30 + "type": "ref", 31 + "ref": "app.bsky.actor.defs#profileView" 32 + } 33 + } 34 + } 35 + } 36 + } 37 + } 38 + } 39 + }
+53
lexicons/app/bsky/graph/getRelationships.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.getRelationships", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Enumerates public relationships between one account, and a list of other accounts. Does not require auth.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["actor"], 11 + "properties": { 12 + "actor": { 13 + "type": "string", 14 + "format": "at-identifier", 15 + "description": "Primary account requesting relationships for." 16 + }, 17 + "others": { 18 + "type": "array", 19 + "description": "List of 'other' accounts to be related back to the primary.", 20 + "maxLength": 30, 21 + "items": { 22 + "type": "string", 23 + "format": "at-identifier" 24 + } 25 + } 26 + } 27 + }, 28 + "output": { 29 + "encoding": "application/json", 30 + "schema": { 31 + "type": "object", 32 + "required": ["relationships"], 33 + "properties": { 34 + "actor": { "type": "string", "format": "did" }, 35 + "relationships": { 36 + "type": "array", 37 + "items": { 38 + "type": "union", 39 + "refs": ["app.bsky.graph.defs#relationship", "app.bsky.graph.defs#notFoundActor"] 40 + } 41 + } 42 + } 43 + } 44 + }, 45 + "errors": [ 46 + { 47 + "name": "ActorNotFound", 48 + "description": "the primary actor at-identifier could not be resolved" 49 + } 50 + ] 51 + } 52 + } 53 + }
+34
lexicons/app/bsky/graph/getStarterPack.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.getStarterPack", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Gets a view of a starter pack.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["starterPack"], 11 + "properties": { 12 + "starterPack": { 13 + "type": "string", 14 + "format": "at-uri", 15 + "description": "Reference (AT-URI) of the starter pack record." 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "object", 23 + "required": ["starterPack"], 24 + "properties": { 25 + "starterPack": { 26 + "type": "ref", 27 + "ref": "app.bsky.graph.defs#starterPackView" 28 + } 29 + } 30 + } 31 + } 32 + } 33 + } 34 + }
+37
lexicons/app/bsky/graph/getStarterPacks.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.getStarterPacks", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get views for a list of starter packs.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["uris"], 11 + "properties": { 12 + "uris": { 13 + "type": "array", 14 + "items": { "type": "string", "format": "at-uri" }, 15 + "maxLength": 25 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "object", 23 + "required": ["starterPacks"], 24 + "properties": { 25 + "starterPacks": { 26 + "type": "array", 27 + "items": { 28 + "type": "ref", 29 + "ref": "app.bsky.graph.defs#starterPackViewBasic" 30 + } 31 + } 32 + } 33 + } 34 + } 35 + } 36 + } 37 + }
+33
lexicons/app/bsky/graph/getSuggestedFollowsByActor.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.getSuggestedFollowsByActor", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Enumerates follows similar to a given account (actor). Expected use is to recommend additional accounts immediately after following one account.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["actor"], 11 + "properties": { 12 + "actor": { "type": "string", "format": "at-identifier" } 13 + } 14 + }, 15 + "output": { 16 + "encoding": "application/json", 17 + "schema": { 18 + "type": "object", 19 + "required": ["suggestions"], 20 + "properties": { 21 + "suggestions": { 22 + "type": "array", 23 + "items": { 24 + "type": "ref", 25 + "ref": "app.bsky.actor.defs#profileView" 26 + } 27 + } 28 + } 29 + } 30 + } 31 + } 32 + } 33 + }
+47
lexicons/app/bsky/graph/list.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.list", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Record representing a list of accounts (actors). Scope includes both moderation-oriented lists and curration-oriented lists.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": ["name", "purpose", "createdAt"], 12 + "properties": { 13 + "purpose": { 14 + "type": "ref", 15 + "description": "Defines the purpose of the list (aka, moderation-oriented or curration-oriented)", 16 + "ref": "app.bsky.graph.defs#listPurpose" 17 + }, 18 + "name": { 19 + "type": "string", 20 + "maxLength": 64, 21 + "minLength": 1, 22 + "description": "Display name for list; can not be empty." 23 + }, 24 + "description": { 25 + "type": "string", 26 + "maxGraphemes": 300, 27 + "maxLength": 3000 28 + }, 29 + "descriptionFacets": { 30 + "type": "array", 31 + "items": { "type": "ref", "ref": "app.bsky.richtext.facet" } 32 + }, 33 + "avatar": { 34 + "type": "blob", 35 + "accept": ["image/png", "image/jpeg"], 36 + "maxSize": 1000000 37 + }, 38 + "labels": { 39 + "type": "union", 40 + "refs": ["com.atproto.label.defs#selfLabels"] 41 + }, 42 + "createdAt": { "type": "string", "format": "datetime" } 43 + } 44 + } 45 + } 46 + } 47 + }
+23
lexicons/app/bsky/graph/listblock.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.listblock", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Record representing a block relationship against an entire an entire list of accounts (actors).", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": ["subject", "createdAt"], 12 + "properties": { 13 + "subject": { 14 + "type": "string", 15 + "format": "at-uri", 16 + "description": "Reference (AT-URI) to the mod list record." 17 + }, 18 + "createdAt": { "type": "string", "format": "datetime" } 19 + } 20 + } 21 + } 22 + } 23 + }
+28
lexicons/app/bsky/graph/listitem.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.listitem", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Record representing an account's inclusion on a specific list. The AppView will ignore duplicate listitem records.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": ["subject", "list", "createdAt"], 12 + "properties": { 13 + "subject": { 14 + "type": "string", 15 + "format": "did", 16 + "description": "The account which is included on the list." 17 + }, 18 + "list": { 19 + "type": "string", 20 + "format": "at-uri", 21 + "description": "Reference (AT-URI) to the list record (app.bsky.graph.list)." 22 + }, 23 + "createdAt": { "type": "string", "format": "datetime" } 24 + } 25 + } 26 + } 27 + } 28 + }
+20
lexicons/app/bsky/graph/muteActor.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.muteActor", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Creates a mute relationship for the specified account. Mutes are private in Bluesky. Requires auth.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["actor"], 13 + "properties": { 14 + "actor": { "type": "string", "format": "at-identifier" } 15 + } 16 + } 17 + } 18 + } 19 + } 20 + }
+20
lexicons/app/bsky/graph/muteActorList.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.muteActorList", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Creates a mute relationship for the specified list of accounts. Mutes are private in Bluesky. Requires auth.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["list"], 13 + "properties": { 14 + "list": { "type": "string", "format": "at-uri" } 15 + } 16 + } 17 + } 18 + } 19 + } 20 + }
+20
lexicons/app/bsky/graph/muteThread.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.muteThread", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Mutes a thread preventing notifications from the thread and any of its children. Mutes are private in Bluesky. Requires auth.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["root"], 13 + "properties": { 14 + "root": { "type": "string", "format": "at-uri" } 15 + } 16 + } 17 + } 18 + } 19 + } 20 + }
+51
lexicons/app/bsky/graph/starterpack.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.starterpack", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Record defining a starter pack of actors and feeds for new users.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": ["name", "list", "createdAt"], 12 + "properties": { 13 + "name": { 14 + "type": "string", 15 + "maxGraphemes": 50, 16 + "maxLength": 500, 17 + "minLength": 1, 18 + "description": "Display name for starter pack; can not be empty." 19 + }, 20 + "description": { 21 + "type": "string", 22 + "maxGraphemes": 300, 23 + "maxLength": 3000 24 + }, 25 + "descriptionFacets": { 26 + "type": "array", 27 + "items": { "type": "ref", "ref": "app.bsky.richtext.facet" } 28 + }, 29 + "list": { 30 + "type": "string", 31 + "format": "at-uri", 32 + "description": "Reference (AT-URI) to the list record." 33 + }, 34 + "feeds": { 35 + "type": "array", 36 + "maxLength": 3, 37 + "items": { "type": "ref", "ref": "#feedItem" } 38 + }, 39 + "createdAt": { "type": "string", "format": "datetime" } 40 + } 41 + } 42 + }, 43 + "feedItem": { 44 + "type": "object", 45 + "required": ["uri"], 46 + "properties": { 47 + "uri": { "type": "string", "format": "at-uri" } 48 + } 49 + } 50 + } 51 + }
+20
lexicons/app/bsky/graph/unmuteActor.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.unmuteActor", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Unmutes the specified account. Requires auth.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["actor"], 13 + "properties": { 14 + "actor": { "type": "string", "format": "at-identifier" } 15 + } 16 + } 17 + } 18 + } 19 + } 20 + }
+20
lexicons/app/bsky/graph/unmuteActorList.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.unmuteActorList", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Unmutes the specified list of accounts. Requires auth.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["list"], 13 + "properties": { 14 + "list": { "type": "string", "format": "at-uri" } 15 + } 16 + } 17 + } 18 + } 19 + } 20 + }
+20
lexicons/app/bsky/graph/unmuteThread.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.graph.unmuteThread", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Unmutes the specified thread. Requires auth.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["root"], 13 + "properties": { 14 + "root": { "type": "string", "format": "at-uri" } 15 + } 16 + } 17 + } 18 + } 19 + } 20 + }
+70
lexicons/app/bsky/labeler/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.labeler.defs", 4 + "defs": { 5 + "labelerView": { 6 + "type": "object", 7 + "required": ["uri", "cid", "creator", "indexedAt"], 8 + "properties": { 9 + "uri": { "type": "string", "format": "at-uri" }, 10 + "cid": { "type": "string", "format": "cid" }, 11 + "creator": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" }, 12 + "likeCount": { "type": "integer", "minimum": 0 }, 13 + "viewer": { "type": "ref", "ref": "#labelerViewerState" }, 14 + "indexedAt": { "type": "string", "format": "datetime" }, 15 + "labels": { 16 + "type": "array", 17 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 18 + } 19 + } 20 + }, 21 + "labelerViewDetailed": { 22 + "type": "object", 23 + "required": ["uri", "cid", "creator", "policies", "indexedAt"], 24 + "properties": { 25 + "uri": { "type": "string", "format": "at-uri" }, 26 + "cid": { "type": "string", "format": "cid" }, 27 + "creator": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" }, 28 + "policies": { 29 + "type": "ref", 30 + "ref": "app.bsky.labeler.defs#labelerPolicies" 31 + }, 32 + "likeCount": { "type": "integer", "minimum": 0 }, 33 + "viewer": { "type": "ref", "ref": "#labelerViewerState" }, 34 + "indexedAt": { "type": "string", "format": "datetime" }, 35 + "labels": { 36 + "type": "array", 37 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 38 + } 39 + } 40 + }, 41 + "labelerViewerState": { 42 + "type": "object", 43 + "properties": { 44 + "like": { "type": "string", "format": "at-uri" } 45 + } 46 + }, 47 + "labelerPolicies": { 48 + "type": "object", 49 + "required": ["labelValues"], 50 + "properties": { 51 + "labelValues": { 52 + "type": "array", 53 + "description": "The label values which this labeler publishes. May include global or custom labels.", 54 + "items": { 55 + "type": "ref", 56 + "ref": "com.atproto.label.defs#labelValue" 57 + } 58 + }, 59 + "labelValueDefinitions": { 60 + "type": "array", 61 + "description": "Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler.", 62 + "items": { 63 + "type": "ref", 64 + "ref": "com.atproto.label.defs#labelValueDefinition" 65 + } 66 + } 67 + } 68 + } 69 + } 70 + }
+40
lexicons/app/bsky/labeler/getServices.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.labeler.getServices", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get information about a list of labeler services.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["dids"], 11 + "properties": { 12 + "dids": { 13 + "type": "array", 14 + "items": { "type": "string", "format": "did" } 15 + }, 16 + "detailed": { 17 + "type": "boolean", 18 + "default": false 19 + } 20 + } 21 + }, 22 + "output": { 23 + "encoding": "application/json", 24 + "schema": { 25 + "type": "object", 26 + "required": ["views"], 27 + "properties": { 28 + "views": { 29 + "type": "array", 30 + "items": { 31 + "type": "union", 32 + "refs": ["app.bsky.labeler.defs#labelerView", "app.bsky.labeler.defs#labelerViewDetailed"] 33 + } 34 + } 35 + } 36 + } 37 + } 38 + } 39 + } 40 + }
+26
lexicons/app/bsky/labeler/service.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.labeler.service", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "A declaration of the existence of labeler service.", 8 + "key": "literal:self", 9 + "record": { 10 + "type": "object", 11 + "required": ["policies", "createdAt"], 12 + "properties": { 13 + "policies": { 14 + "type": "ref", 15 + "ref": "app.bsky.labeler.defs#labelerPolicies" 16 + }, 17 + "labels": { 18 + "type": "union", 19 + "refs": ["com.atproto.label.defs#selfLabels"] 20 + }, 21 + "createdAt": { "type": "string", "format": "datetime" } 22 + } 23 + } 24 + } 25 + } 26 + }
+27
lexicons/app/bsky/notification/getUnreadCount.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.notification.getUnreadCount", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Count the number of unread notifications for the requesting account. Requires auth.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "priority": { "type": "boolean" }, 12 + "seenAt": { "type": "string", "format": "datetime" } 13 + } 14 + }, 15 + "output": { 16 + "encoding": "application/json", 17 + "schema": { 18 + "type": "object", 19 + "required": ["count"], 20 + "properties": { 21 + "count": { "type": "integer" } 22 + } 23 + } 24 + } 25 + } 26 + } 27 + }
+62
lexicons/app/bsky/notification/listNotifications.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.notification.listNotifications", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Enumerate notifications for the requesting account. Requires auth.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "limit": { 12 + "type": "integer", 13 + "minimum": 1, 14 + "maximum": 100, 15 + "default": 50 16 + }, 17 + "priority": { "type": "boolean" }, 18 + "cursor": { "type": "string" }, 19 + "seenAt": { "type": "string", "format": "datetime" } 20 + } 21 + }, 22 + "output": { 23 + "encoding": "application/json", 24 + "schema": { 25 + "type": "object", 26 + "required": ["notifications"], 27 + "properties": { 28 + "cursor": { "type": "string" }, 29 + "notifications": { 30 + "type": "array", 31 + "items": { "type": "ref", "ref": "#notification" } 32 + }, 33 + "priority": { "type": "boolean" }, 34 + "seenAt": { "type": "string", "format": "datetime" } 35 + } 36 + } 37 + } 38 + }, 39 + "notification": { 40 + "type": "object", 41 + "required": ["uri", "cid", "author", "reason", "record", "isRead", "indexedAt"], 42 + "properties": { 43 + "uri": { "type": "string", "format": "at-uri" }, 44 + "cid": { "type": "string", "format": "cid" }, 45 + "author": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" }, 46 + "reason": { 47 + "type": "string", 48 + "description": "Expected values are 'like', 'repost', 'follow', 'mention', 'reply', 'quote', and 'starterpack-joined'.", 49 + "knownValues": ["like", "repost", "follow", "mention", "reply", "quote", "starterpack-joined"] 50 + }, 51 + "reasonSubject": { "type": "string", "format": "at-uri" }, 52 + "record": { "type": "unknown" }, 53 + "isRead": { "type": "boolean" }, 54 + "indexedAt": { "type": "string", "format": "datetime" }, 55 + "labels": { 56 + "type": "array", 57 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 58 + } 59 + } 60 + } 61 + } 62 + }
+20
lexicons/app/bsky/notification/putPreferences.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.notification.putPreferences", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Set notification-related preferences for an account. Requires auth.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["priority"], 13 + "properties": { 14 + "priority": { "type": "boolean" } 15 + } 16 + } 17 + } 18 + } 19 + } 20 + }
+26
lexicons/app/bsky/notification/registerPush.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.notification.registerPush", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Register to receive push notifications, via a specified service, for the requesting account. Requires auth.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["serviceDid", "token", "platform", "appId"], 13 + "properties": { 14 + "serviceDid": { "type": "string", "format": "did" }, 15 + "token": { "type": "string" }, 16 + "platform": { 17 + "type": "string", 18 + "knownValues": ["ios", "android", "web"] 19 + }, 20 + "appId": { "type": "string" } 21 + } 22 + } 23 + } 24 + } 25 + } 26 + }
+20
lexicons/app/bsky/notification/updateSeen.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.notification.updateSeen", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Notify server that the requesting account has seen notifications. Requires auth.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["seenAt"], 13 + "properties": { 14 + "seenAt": { "type": "string", "format": "datetime" } 15 + } 16 + } 17 + } 18 + } 19 + } 20 + }
+51
lexicons/app/bsky/richtext/facet.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.richtext.facet", 4 + "defs": { 5 + "main": { 6 + "type": "object", 7 + "description": "Annotation of a sub-string within rich text.", 8 + "required": ["index", "features"], 9 + "properties": { 10 + "index": { "type": "ref", "ref": "#byteSlice" }, 11 + "features": { 12 + "type": "array", 13 + "items": { "type": "union", "refs": ["#mention", "#link", "#tag"] } 14 + } 15 + } 16 + }, 17 + "mention": { 18 + "type": "object", 19 + "description": "Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID.", 20 + "required": ["did"], 21 + "properties": { 22 + "did": { "type": "string", "format": "did" } 23 + } 24 + }, 25 + "link": { 26 + "type": "object", 27 + "description": "Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.", 28 + "required": ["uri"], 29 + "properties": { 30 + "uri": { "type": "string", "format": "uri" } 31 + } 32 + }, 33 + "tag": { 34 + "type": "object", 35 + "description": "Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags').", 36 + "required": ["tag"], 37 + "properties": { 38 + "tag": { "type": "string", "maxLength": 640, "maxGraphemes": 64 } 39 + } 40 + }, 41 + "byteSlice": { 42 + "type": "object", 43 + "description": "Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets.", 44 + "required": ["byteStart", "byteEnd"], 45 + "properties": { 46 + "byteStart": { "type": "integer", "minimum": 0 }, 47 + "byteEnd": { "type": "integer", "minimum": 0 } 48 + } 49 + } 50 + } 51 + }
+20
lexicons/app/bsky/unspecced/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.unspecced.defs", 4 + "defs": { 5 + "skeletonSearchPost": { 6 + "type": "object", 7 + "required": ["uri"], 8 + "properties": { 9 + "uri": { "type": "string", "format": "at-uri" } 10 + } 11 + }, 12 + "skeletonSearchActor": { 13 + "type": "object", 14 + "required": ["did"], 15 + "properties": { 16 + "did": { "type": "string", "format": "did" } 17 + } 18 + } 19 + } 20 + }
+40
lexicons/app/bsky/unspecced/getPopularFeedGenerators.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.unspecced.getPopularFeedGenerators", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "An unspecced view of globally popular feed generators.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "limit": { 12 + "type": "integer", 13 + "minimum": 1, 14 + "maximum": 100, 15 + "default": 50 16 + }, 17 + "cursor": { "type": "string" }, 18 + "query": { "type": "string" } 19 + } 20 + }, 21 + "output": { 22 + "encoding": "application/json", 23 + "schema": { 24 + "type": "object", 25 + "required": ["feeds"], 26 + "properties": { 27 + "cursor": { "type": "string" }, 28 + "feeds": { 29 + "type": "array", 30 + "items": { 31 + "type": "ref", 32 + "ref": "app.bsky.feed.defs#generatorView" 33 + } 34 + } 35 + } 36 + } 37 + } 38 + } 39 + } 40 + }
+49
lexicons/app/bsky/unspecced/getSuggestionsSkeleton.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.unspecced.getSuggestionsSkeleton", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a skeleton of suggested actors. Intended to be called and then hydrated through app.bsky.actor.getSuggestions", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "viewer": { 12 + "type": "string", 13 + "format": "did", 14 + "description": "DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking." 15 + }, 16 + "limit": { 17 + "type": "integer", 18 + "minimum": 1, 19 + "maximum": 100, 20 + "default": 50 21 + }, 22 + "cursor": { "type": "string" }, 23 + "relativeToDid": { 24 + "type": "string", 25 + "format": "did", 26 + "description": "DID of the account to get suggestions relative to. If not provided, suggestions will be based on the viewer." 27 + } 28 + } 29 + }, 30 + "output": { 31 + "encoding": "application/json", 32 + "schema": { 33 + "type": "object", 34 + "required": ["actors"], 35 + "properties": { 36 + "cursor": { "type": "string" }, 37 + "actors": { 38 + "type": "array", 39 + "items": { 40 + "type": "ref", 41 + "ref": "app.bsky.unspecced.defs#skeletonSearchActor" 42 + } 43 + } 44 + } 45 + } 46 + } 47 + } 48 + } 49 + }
+42
lexicons/app/bsky/unspecced/getTaggedSuggestions.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.unspecced.getTaggedSuggestions", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a list of suggestions (feeds and users) tagged with categories", 8 + "parameters": { 9 + "type": "params", 10 + "properties": {} 11 + }, 12 + "output": { 13 + "encoding": "application/json", 14 + "schema": { 15 + "type": "object", 16 + "required": ["suggestions"], 17 + "properties": { 18 + "suggestions": { 19 + "type": "array", 20 + "items": { 21 + "type": "ref", 22 + "ref": "#suggestion" 23 + } 24 + } 25 + } 26 + } 27 + } 28 + }, 29 + "suggestion": { 30 + "type": "object", 31 + "required": ["tag", "subjectType", "subject"], 32 + "properties": { 33 + "tag": { "type": "string" }, 34 + "subjectType": { 35 + "type": "string", 36 + "knownValues": ["actor", "feed"] 37 + }, 38 + "subject": { "type": "string", "format": "uri" } 39 + } 40 + } 41 + } 42 + }
+61
lexicons/app/bsky/unspecced/searchActorsSkeleton.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.unspecced.searchActorsSkeleton", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Backend Actors (profile) search, returns only skeleton.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["q"], 11 + "properties": { 12 + "q": { 13 + "type": "string", 14 + "description": "Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. For typeahead search, only simple term match is supported, not full syntax." 15 + }, 16 + "viewer": { 17 + "type": "string", 18 + "format": "did", 19 + "description": "DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking." 20 + }, 21 + "typeahead": { 22 + "type": "boolean", 23 + "description": "If true, acts as fast/simple 'typeahead' query." 24 + }, 25 + "limit": { 26 + "type": "integer", 27 + "minimum": 1, 28 + "maximum": 100, 29 + "default": 25 30 + }, 31 + "cursor": { 32 + "type": "string", 33 + "description": "Optional pagination mechanism; may not necessarily allow scrolling through entire result set." 34 + } 35 + } 36 + }, 37 + "output": { 38 + "encoding": "application/json", 39 + "schema": { 40 + "type": "object", 41 + "required": ["actors"], 42 + "properties": { 43 + "cursor": { "type": "string" }, 44 + "hitsTotal": { 45 + "type": "integer", 46 + "description": "Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits." 47 + }, 48 + "actors": { 49 + "type": "array", 50 + "items": { 51 + "type": "ref", 52 + "ref": "app.bsky.unspecced.defs#skeletonSearchActor" 53 + } 54 + } 55 + } 56 + } 57 + }, 58 + "errors": [{ "name": "BadQueryString" }] 59 + } 60 + } 61 + }
+104
lexicons/app/bsky/unspecced/searchPostsSkeleton.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.unspecced.searchPostsSkeleton", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Backend Posts search, returns only skeleton", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["q"], 11 + "properties": { 12 + "q": { 13 + "type": "string", 14 + "description": "Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended." 15 + }, 16 + "sort": { 17 + "type": "string", 18 + "knownValues": ["top", "latest"], 19 + "default": "latest", 20 + "description": "Specifies the ranking order of results." 21 + }, 22 + "since": { 23 + "type": "string", 24 + "description": "Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD)." 25 + }, 26 + "until": { 27 + "type": "string", 28 + "description": "Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD)." 29 + }, 30 + "mentions": { 31 + "type": "string", 32 + "format": "at-identifier", 33 + "description": "Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions." 34 + }, 35 + "author": { 36 + "type": "string", 37 + "format": "at-identifier", 38 + "description": "Filter to posts by the given account. Handles are resolved to DID before query-time." 39 + }, 40 + "lang": { 41 + "type": "string", 42 + "format": "language", 43 + "description": "Filter to posts in the given language. Expected to be based on post language field, though server may override language detection." 44 + }, 45 + "domain": { 46 + "type": "string", 47 + "description": "Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization." 48 + }, 49 + "url": { 50 + "type": "string", 51 + "format": "uri", 52 + "description": "Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching." 53 + }, 54 + "tag": { 55 + "type": "array", 56 + "items": { 57 + "type": "string", 58 + "maxLength": 640, 59 + "maxGraphemes": 64 60 + }, 61 + "description": "Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching." 62 + }, 63 + "viewer": { 64 + "type": "string", 65 + "format": "did", 66 + "description": "DID of the account making the request (not included for public/unauthenticated queries). Used for 'from:me' queries." 67 + }, 68 + "limit": { 69 + "type": "integer", 70 + "minimum": 1, 71 + "maximum": 100, 72 + "default": 25 73 + }, 74 + "cursor": { 75 + "type": "string", 76 + "description": "Optional pagination mechanism; may not necessarily allow scrolling through entire result set." 77 + } 78 + } 79 + }, 80 + "output": { 81 + "encoding": "application/json", 82 + "schema": { 83 + "type": "object", 84 + "required": ["posts"], 85 + "properties": { 86 + "cursor": { "type": "string" }, 87 + "hitsTotal": { 88 + "type": "integer", 89 + "description": "Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits." 90 + }, 91 + "posts": { 92 + "type": "array", 93 + "items": { 94 + "type": "ref", 95 + "ref": "app.bsky.unspecced.defs#skeletonSearchPost" 96 + } 97 + } 98 + } 99 + } 100 + }, 101 + "errors": [{ "name": "BadQueryString" }] 102 + } 103 + } 104 + }
+21
lexicons/chat/bsky/actor/declaration.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.actor.declaration", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "A declaration of a Bluesky chat account.", 8 + "key": "literal:self", 9 + "record": { 10 + "type": "object", 11 + "required": ["allowIncoming"], 12 + "properties": { 13 + "allowIncoming": { 14 + "type": "string", 15 + "knownValues": ["all", "none", "following"] 16 + } 17 + } 18 + } 19 + } 20 + } 21 + }
+33
lexicons/chat/bsky/actor/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.actor.defs", 4 + "defs": { 5 + "profileViewBasic": { 6 + "type": "object", 7 + "required": ["did", "handle"], 8 + "properties": { 9 + "did": { "type": "string", "format": "did" }, 10 + "handle": { "type": "string", "format": "handle" }, 11 + "displayName": { 12 + "type": "string", 13 + "maxGraphemes": 64, 14 + "maxLength": 640 15 + }, 16 + "avatar": { "type": "string", "format": "uri" }, 17 + "associated": { 18 + "type": "ref", 19 + "ref": "app.bsky.actor.defs#profileAssociated" 20 + }, 21 + "viewer": { "type": "ref", "ref": "app.bsky.actor.defs#viewerState" }, 22 + "labels": { 23 + "type": "array", 24 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 25 + }, 26 + "chatDisabled": { 27 + "type": "boolean", 28 + "description": "Set to true when the actor cannot actively participate in converations" 29 + } 30 + } 31 + } 32 + } 33 + }
+16
lexicons/chat/bsky/actor/deleteAccount.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.actor.deleteAccount", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "output": { 8 + "encoding": "application/json", 9 + "schema": { 10 + "type": "object", 11 + "properties": {} 12 + } 13 + } 14 + } 15 + } 16 + }
+12
lexicons/chat/bsky/actor/exportAccountData.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.actor.exportAccountData", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "output": { 8 + "encoding": "application/jsonl" 9 + } 10 + } 11 + } 12 + }
+137
lexicons/chat/bsky/convo/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.convo.defs", 4 + "defs": { 5 + "messageRef": { 6 + "type": "object", 7 + "required": ["did", "messageId", "convoId"], 8 + "properties": { 9 + "did": { "type": "string", "format": "did" }, 10 + "convoId": { "type": "string" }, 11 + "messageId": { "type": "string" } 12 + } 13 + }, 14 + "messageInput": { 15 + "type": "object", 16 + "required": ["text"], 17 + "properties": { 18 + "text": { 19 + "type": "string", 20 + "maxLength": 10000, 21 + "maxGraphemes": 1000 22 + }, 23 + "facets": { 24 + "type": "array", 25 + "description": "Annotations of text (mentions, URLs, hashtags, etc)", 26 + "items": { "type": "ref", "ref": "app.bsky.richtext.facet" } 27 + }, 28 + "embed": { 29 + "type": "union", 30 + "refs": ["app.bsky.embed.record"] 31 + } 32 + } 33 + }, 34 + "messageView": { 35 + "type": "object", 36 + "required": ["id", "rev", "text", "sender", "sentAt"], 37 + "properties": { 38 + "id": { "type": "string" }, 39 + "rev": { "type": "string" }, 40 + "text": { 41 + "type": "string", 42 + "maxLength": 10000, 43 + "maxGraphemes": 1000 44 + }, 45 + "facets": { 46 + "type": "array", 47 + "description": "Annotations of text (mentions, URLs, hashtags, etc)", 48 + "items": { "type": "ref", "ref": "app.bsky.richtext.facet" } 49 + }, 50 + "embed": { 51 + "type": "union", 52 + "refs": ["app.bsky.embed.record#view"] 53 + }, 54 + "sender": { "type": "ref", "ref": "#messageViewSender" }, 55 + "sentAt": { "type": "string", "format": "datetime" } 56 + } 57 + }, 58 + "deletedMessageView": { 59 + "type": "object", 60 + "required": ["id", "rev", "sender", "sentAt"], 61 + "properties": { 62 + "id": { "type": "string" }, 63 + "rev": { "type": "string" }, 64 + "sender": { "type": "ref", "ref": "#messageViewSender" }, 65 + "sentAt": { "type": "string", "format": "datetime" } 66 + } 67 + }, 68 + "messageViewSender": { 69 + "type": "object", 70 + "required": ["did"], 71 + "properties": { 72 + "did": { "type": "string", "format": "did" } 73 + } 74 + }, 75 + "convoView": { 76 + "type": "object", 77 + "required": ["id", "rev", "members", "muted", "unreadCount"], 78 + "properties": { 79 + "id": { "type": "string" }, 80 + "rev": { "type": "string" }, 81 + "members": { 82 + "type": "array", 83 + "items": { 84 + "type": "ref", 85 + "ref": "chat.bsky.actor.defs#profileViewBasic" 86 + } 87 + }, 88 + "lastMessage": { 89 + "type": "union", 90 + "refs": ["#messageView", "#deletedMessageView"] 91 + }, 92 + "muted": { "type": "boolean" }, 93 + "unreadCount": { "type": "integer" } 94 + } 95 + }, 96 + "logBeginConvo": { 97 + "type": "object", 98 + "required": ["rev", "convoId"], 99 + "properties": { 100 + "rev": { "type": "string" }, 101 + "convoId": { "type": "string" } 102 + } 103 + }, 104 + "logLeaveConvo": { 105 + "type": "object", 106 + "required": ["rev", "convoId"], 107 + "properties": { 108 + "rev": { "type": "string" }, 109 + "convoId": { "type": "string" } 110 + } 111 + }, 112 + "logCreateMessage": { 113 + "type": "object", 114 + "required": ["rev", "convoId", "message"], 115 + "properties": { 116 + "rev": { "type": "string" }, 117 + "convoId": { "type": "string" }, 118 + "message": { 119 + "type": "union", 120 + "refs": ["#messageView", "#deletedMessageView"] 121 + } 122 + } 123 + }, 124 + "logDeleteMessage": { 125 + "type": "object", 126 + "required": ["rev", "convoId", "message"], 127 + "properties": { 128 + "rev": { "type": "string" }, 129 + "convoId": { "type": "string" }, 130 + "message": { 131 + "type": "union", 132 + "refs": ["#messageView", "#deletedMessageView"] 133 + } 134 + } 135 + } 136 + } 137 + }
+27
lexicons/chat/bsky/convo/deleteMessageForSelf.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.convo.deleteMessageForSelf", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "input": { 8 + "encoding": "application/json", 9 + "schema": { 10 + "type": "object", 11 + "required": ["convoId", "messageId"], 12 + "properties": { 13 + "convoId": { "type": "string" }, 14 + "messageId": { "type": "string" } 15 + } 16 + } 17 + }, 18 + "output": { 19 + "encoding": "application/json", 20 + "schema": { 21 + "type": "ref", 22 + "ref": "chat.bsky.convo.defs#deletedMessageView" 23 + } 24 + } 25 + } 26 + } 27 + }
+29
lexicons/chat/bsky/convo/getConvo.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.convo.getConvo", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "parameters": { 8 + "type": "params", 9 + "required": ["convoId"], 10 + "properties": { 11 + "convoId": { "type": "string" } 12 + } 13 + }, 14 + "output": { 15 + "encoding": "application/json", 16 + "schema": { 17 + "type": "object", 18 + "required": ["convo"], 19 + "properties": { 20 + "convo": { 21 + "type": "ref", 22 + "ref": "chat.bsky.convo.defs#convoView" 23 + } 24 + } 25 + } 26 + } 27 + } 28 + } 29 + }
+37
lexicons/chat/bsky/convo/getConvoForMembers.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.convo.getConvoForMembers", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "parameters": { 8 + "type": "params", 9 + "required": ["members"], 10 + "properties": { 11 + "members": { 12 + "type": "array", 13 + "minLength": 1, 14 + "maxLength": 10, 15 + "items": { 16 + "type": "string", 17 + "format": "did" 18 + } 19 + } 20 + } 21 + }, 22 + "output": { 23 + "encoding": "application/json", 24 + "schema": { 25 + "type": "object", 26 + "required": ["convo"], 27 + "properties": { 28 + "convo": { 29 + "type": "ref", 30 + "ref": "chat.bsky.convo.defs#convoView" 31 + } 32 + } 33 + } 34 + } 35 + } 36 + } 37 + }
+38
lexicons/chat/bsky/convo/getLog.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.convo.getLog", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "parameters": { 8 + "type": "params", 9 + "required": [], 10 + "properties": { 11 + "cursor": { "type": "string" } 12 + } 13 + }, 14 + "output": { 15 + "encoding": "application/json", 16 + "schema": { 17 + "type": "object", 18 + "required": ["logs"], 19 + "properties": { 20 + "cursor": { "type": "string" }, 21 + "logs": { 22 + "type": "array", 23 + "items": { 24 + "type": "union", 25 + "refs": [ 26 + "chat.bsky.convo.defs#logBeginConvo", 27 + "chat.bsky.convo.defs#logLeaveConvo", 28 + "chat.bsky.convo.defs#logCreateMessage", 29 + "chat.bsky.convo.defs#logDeleteMessage" 30 + ] 31 + } 32 + } 33 + } 34 + } 35 + } 36 + } 37 + } 38 + }
+40
lexicons/chat/bsky/convo/getMessages.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.convo.getMessages", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "parameters": { 8 + "type": "params", 9 + "required": ["convoId"], 10 + "properties": { 11 + "convoId": { "type": "string" }, 12 + "limit": { 13 + "type": "integer", 14 + "minimum": 1, 15 + "maximum": 100, 16 + "default": 50 17 + }, 18 + "cursor": { "type": "string" } 19 + } 20 + }, 21 + "output": { 22 + "encoding": "application/json", 23 + "schema": { 24 + "type": "object", 25 + "required": ["messages"], 26 + "properties": { 27 + "cursor": { "type": "string" }, 28 + "messages": { 29 + "type": "array", 30 + "items": { 31 + "type": "union", 32 + "refs": ["chat.bsky.convo.defs#messageView", "chat.bsky.convo.defs#deletedMessageView"] 33 + } 34 + } 35 + } 36 + } 37 + } 38 + } 39 + } 40 + }
+30
lexicons/chat/bsky/convo/leaveConvo.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.convo.leaveConvo", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "input": { 8 + "encoding": "application/json", 9 + "schema": { 10 + "type": "object", 11 + "required": ["convoId"], 12 + "properties": { 13 + "convoId": { "type": "string" } 14 + } 15 + } 16 + }, 17 + "output": { 18 + "encoding": "application/json", 19 + "schema": { 20 + "type": "object", 21 + "required": ["convoId", "rev"], 22 + "properties": { 23 + "convoId": { "type": "string" }, 24 + "rev": { "type": "string" } 25 + } 26 + } 27 + } 28 + } 29 + } 30 + }
+38
lexicons/chat/bsky/convo/listConvos.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.convo.listConvos", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "parameters": { 8 + "type": "params", 9 + "properties": { 10 + "limit": { 11 + "type": "integer", 12 + "minimum": 1, 13 + "maximum": 100, 14 + "default": 50 15 + }, 16 + "cursor": { "type": "string" } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "object", 23 + "required": ["convos"], 24 + "properties": { 25 + "cursor": { "type": "string" }, 26 + "convos": { 27 + "type": "array", 28 + "items": { 29 + "type": "ref", 30 + "ref": "chat.bsky.convo.defs#convoView" 31 + } 32 + } 33 + } 34 + } 35 + } 36 + } 37 + } 38 + }
+32
lexicons/chat/bsky/convo/muteConvo.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.convo.muteConvo", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "input": { 8 + "encoding": "application/json", 9 + "schema": { 10 + "type": "object", 11 + "required": ["convoId"], 12 + "properties": { 13 + "convoId": { "type": "string" } 14 + } 15 + } 16 + }, 17 + "output": { 18 + "encoding": "application/json", 19 + "schema": { 20 + "type": "object", 21 + "required": ["convo"], 22 + "properties": { 23 + "convo": { 24 + "type": "ref", 25 + "ref": "chat.bsky.convo.defs#convoView" 26 + } 27 + } 28 + } 29 + } 30 + } 31 + } 32 + }
+30
lexicons/chat/bsky/convo/sendMessage.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.convo.sendMessage", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "input": { 8 + "encoding": "application/json", 9 + "schema": { 10 + "type": "object", 11 + "required": ["convoId", "message"], 12 + "properties": { 13 + "convoId": { "type": "string" }, 14 + "message": { 15 + "type": "ref", 16 + "ref": "chat.bsky.convo.defs#messageInput" 17 + } 18 + } 19 + } 20 + }, 21 + "output": { 22 + "encoding": "application/json", 23 + "schema": { 24 + "type": "ref", 25 + "ref": "chat.bsky.convo.defs#messageView" 26 + } 27 + } 28 + } 29 + } 30 + }
+53
lexicons/chat/bsky/convo/sendMessageBatch.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.convo.sendMessageBatch", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "input": { 8 + "encoding": "application/json", 9 + "schema": { 10 + "type": "object", 11 + "required": ["items"], 12 + "properties": { 13 + "items": { 14 + "type": "array", 15 + "maxLength": 100, 16 + "items": { 17 + "type": "ref", 18 + "ref": "#batchItem" 19 + } 20 + } 21 + } 22 + } 23 + }, 24 + "output": { 25 + "encoding": "application/json", 26 + "schema": { 27 + "type": "object", 28 + "required": ["items"], 29 + "properties": { 30 + "items": { 31 + "type": "array", 32 + "items": { 33 + "type": "ref", 34 + "ref": "chat.bsky.convo.defs#messageView" 35 + } 36 + } 37 + } 38 + } 39 + } 40 + }, 41 + "batchItem": { 42 + "type": "object", 43 + "required": ["convoId", "message"], 44 + "properties": { 45 + "convoId": { "type": "string" }, 46 + "message": { 47 + "type": "ref", 48 + "ref": "chat.bsky.convo.defs#messageInput" 49 + } 50 + } 51 + } 52 + } 53 + }
+32
lexicons/chat/bsky/convo/unmuteConvo.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.convo.unmuteConvo", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "input": { 8 + "encoding": "application/json", 9 + "schema": { 10 + "type": "object", 11 + "required": ["convoId"], 12 + "properties": { 13 + "convoId": { "type": "string" } 14 + } 15 + } 16 + }, 17 + "output": { 18 + "encoding": "application/json", 19 + "schema": { 20 + "type": "object", 21 + "required": ["convo"], 22 + "properties": { 23 + "convo": { 24 + "type": "ref", 25 + "ref": "chat.bsky.convo.defs#convoView" 26 + } 27 + } 28 + } 29 + } 30 + } 31 + } 32 + }
+33
lexicons/chat/bsky/convo/updateRead.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.convo.updateRead", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "input": { 8 + "encoding": "application/json", 9 + "schema": { 10 + "type": "object", 11 + "required": ["convoId"], 12 + "properties": { 13 + "convoId": { "type": "string" }, 14 + "messageId": { "type": "string" } 15 + } 16 + } 17 + }, 18 + "output": { 19 + "encoding": "application/json", 20 + "schema": { 21 + "type": "object", 22 + "required": ["convo"], 23 + "properties": { 24 + "convo": { 25 + "type": "ref", 26 + "ref": "chat.bsky.convo.defs#convoView" 27 + } 28 + } 29 + } 30 + } 31 + } 32 + } 33 + }
+38
lexicons/chat/bsky/moderation/getActorMetadata.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.moderation.getActorMetadata", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "parameters": { 8 + "type": "params", 9 + "required": ["actor"], 10 + "properties": { 11 + "actor": { "type": "string", "format": "did" } 12 + } 13 + }, 14 + "output": { 15 + "encoding": "application/json", 16 + "schema": { 17 + "type": "object", 18 + "required": ["day", "month", "all"], 19 + "properties": { 20 + "day": { "type": "ref", "ref": "#metadata" }, 21 + "month": { "type": "ref", "ref": "#metadata" }, 22 + "all": { "type": "ref", "ref": "#metadata" } 23 + } 24 + } 25 + } 26 + }, 27 + "metadata": { 28 + "type": "object", 29 + "required": ["messagesSent", "messagesReceived", "convos", "convosStarted"], 30 + "properties": { 31 + "messagesSent": { "type": "integer" }, 32 + "messagesReceived": { "type": "integer" }, 33 + "convos": { "type": "integer" }, 34 + "convosStarted": { "type": "integer" } 35 + } 36 + } 37 + } 38 + }
+38
lexicons/chat/bsky/moderation/getMessageContext.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.moderation.getMessageContext", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "parameters": { 8 + "type": "params", 9 + "required": ["messageId"], 10 + "properties": { 11 + "convoId": { 12 + "type": "string", 13 + "description": "Conversation that the message is from. NOTE: this field will eventually be required." 14 + }, 15 + "messageId": { "type": "string" }, 16 + "before": { "type": "integer", "default": 5 }, 17 + "after": { "type": "integer", "default": 5 } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "object", 24 + "required": ["messages"], 25 + "properties": { 26 + "messages": { 27 + "type": "array", 28 + "items": { 29 + "type": "union", 30 + "refs": ["chat.bsky.convo.defs#messageView", "chat.bsky.convo.defs#deletedMessageView"] 31 + } 32 + } 33 + } 34 + } 35 + } 36 + } 37 + } 38 + }
+21
lexicons/chat/bsky/moderation/updateActorAccess.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "chat.bsky.moderation.updateActorAccess", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "input": { 8 + "encoding": "application/json", 9 + "schema": { 10 + "type": "object", 11 + "required": ["actor", "allowAccess"], 12 + "properties": { 13 + "actor": { "type": "string", "format": "did" }, 14 + "allowAccess": { "type": "boolean" }, 15 + "ref": { "type": "string" } 16 + } 17 + } 18 + } 19 + } 20 + } 21 + }
+56
lexicons/com/atproto/admin/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.admin.defs", 4 + "defs": { 5 + "statusAttr": { 6 + "type": "object", 7 + "required": ["applied"], 8 + "properties": { 9 + "applied": { "type": "boolean" }, 10 + "ref": { "type": "string" } 11 + } 12 + }, 13 + "accountView": { 14 + "type": "object", 15 + "required": ["did", "handle", "indexedAt"], 16 + "properties": { 17 + "did": { "type": "string", "format": "did" }, 18 + "handle": { "type": "string", "format": "handle" }, 19 + "email": { "type": "string" }, 20 + "relatedRecords": { "type": "array", "items": { "type": "unknown" } }, 21 + "indexedAt": { "type": "string", "format": "datetime" }, 22 + "invitedBy": { 23 + "type": "ref", 24 + "ref": "com.atproto.server.defs#inviteCode" 25 + }, 26 + "invites": { 27 + "type": "array", 28 + "items": { 29 + "type": "ref", 30 + "ref": "com.atproto.server.defs#inviteCode" 31 + } 32 + }, 33 + "invitesDisabled": { "type": "boolean" }, 34 + "emailConfirmedAt": { "type": "string", "format": "datetime" }, 35 + "inviteNote": { "type": "string" }, 36 + "deactivatedAt": { "type": "string", "format": "datetime" } 37 + } 38 + }, 39 + "repoRef": { 40 + "type": "object", 41 + "required": ["did"], 42 + "properties": { 43 + "did": { "type": "string", "format": "did" } 44 + } 45 + }, 46 + "repoBlobRef": { 47 + "type": "object", 48 + "required": ["did", "cid"], 49 + "properties": { 50 + "did": { "type": "string", "format": "did" }, 51 + "cid": { "type": "string", "format": "cid" }, 52 + "recordUri": { "type": "string", "format": "at-uri" } 53 + } 54 + } 55 + } 56 + }
+20
lexicons/com/atproto/admin/deleteAccount.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.admin.deleteAccount", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Delete a user account as an administrator.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["did"], 13 + "properties": { 14 + "did": { "type": "string", "format": "did" } 15 + } 16 + } 17 + } 18 + } 19 + } 20 + }
+24
lexicons/com/atproto/admin/disableAccountInvites.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.admin.disableAccountInvites", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Disable an account from receiving new invite codes, but does not invalidate existing codes.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["account"], 13 + "properties": { 14 + "account": { "type": "string", "format": "did" }, 15 + "note": { 16 + "type": "string", 17 + "description": "Optional reason for disabled invites." 18 + } 19 + } 20 + } 21 + } 22 + } 23 + } 24 + }
+26
lexicons/com/atproto/admin/disableInviteCodes.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.admin.disableInviteCodes", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Disable some set of codes and/or all codes associated with a set of users.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "properties": { 13 + "codes": { 14 + "type": "array", 15 + "items": { "type": "string" } 16 + }, 17 + "accounts": { 18 + "type": "array", 19 + "items": { "type": "string" } 20 + } 21 + } 22 + } 23 + } 24 + } 25 + } 26 + }
+24
lexicons/com/atproto/admin/enableAccountInvites.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.admin.enableAccountInvites", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Re-enable an account's ability to receive invite codes.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["account"], 13 + "properties": { 14 + "account": { "type": "string", "format": "did" }, 15 + "note": { 16 + "type": "string", 17 + "description": "Optional reason for enabled invites." 18 + } 19 + } 20 + } 21 + } 22 + } 23 + } 24 + }
+24
lexicons/com/atproto/admin/getAccountInfo.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.admin.getAccountInfo", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get details about an account.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["did"], 11 + "properties": { 12 + "did": { "type": "string", "format": "did" } 13 + } 14 + }, 15 + "output": { 16 + "encoding": "application/json", 17 + "schema": { 18 + "type": "ref", 19 + "ref": "com.atproto.admin.defs#accountView" 20 + } 21 + } 22 + } 23 + } 24 + }
+36
lexicons/com/atproto/admin/getAccountInfos.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.admin.getAccountInfos", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get details about some accounts.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["dids"], 11 + "properties": { 12 + "dids": { 13 + "type": "array", 14 + "items": { "type": "string", "format": "did" } 15 + } 16 + } 17 + }, 18 + "output": { 19 + "encoding": "application/json", 20 + "schema": { 21 + "type": "object", 22 + "required": ["infos"], 23 + "properties": { 24 + "infos": { 25 + "type": "array", 26 + "items": { 27 + "type": "ref", 28 + "ref": "com.atproto.admin.defs#accountView" 29 + } 30 + } 31 + } 32 + } 33 + } 34 + } 35 + } 36 + }
+44
lexicons/com/atproto/admin/getInviteCodes.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.admin.getInviteCodes", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get an admin view of invite codes.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "sort": { 12 + "type": "string", 13 + "knownValues": ["recent", "usage"], 14 + "default": "recent" 15 + }, 16 + "limit": { 17 + "type": "integer", 18 + "minimum": 1, 19 + "maximum": 500, 20 + "default": 100 21 + }, 22 + "cursor": { "type": "string" } 23 + } 24 + }, 25 + "output": { 26 + "encoding": "application/json", 27 + "schema": { 28 + "type": "object", 29 + "required": ["codes"], 30 + "properties": { 31 + "cursor": { "type": "string" }, 32 + "codes": { 33 + "type": "array", 34 + "items": { 35 + "type": "ref", 36 + "ref": "com.atproto.server.defs#inviteCode" 37 + } 38 + } 39 + } 40 + } 41 + } 42 + } 43 + } 44 + }
+43
lexicons/com/atproto/admin/getSubjectStatus.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.admin.getSubjectStatus", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get the service-specific admin status of a subject (account, record, or blob).", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "did": { "type": "string", "format": "did" }, 12 + "uri": { "type": "string", "format": "at-uri" }, 13 + "blob": { "type": "string", "format": "cid" } 14 + } 15 + }, 16 + "output": { 17 + "encoding": "application/json", 18 + "schema": { 19 + "type": "object", 20 + "required": ["subject"], 21 + "properties": { 22 + "subject": { 23 + "type": "union", 24 + "refs": [ 25 + "com.atproto.admin.defs#repoRef", 26 + "com.atproto.repo.strongRef", 27 + "com.atproto.admin.defs#repoBlobRef" 28 + ] 29 + }, 30 + "takedown": { 31 + "type": "ref", 32 + "ref": "com.atproto.admin.defs#statusAttr" 33 + }, 34 + "deactivated": { 35 + "type": "ref", 36 + "ref": "com.atproto.admin.defs#statusAttr" 37 + } 38 + } 39 + } 40 + } 41 + } 42 + } 43 + }
+40
lexicons/com/atproto/admin/searchAccounts.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.admin.searchAccounts", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get list of accounts that matches your search query.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "email": { "type": "string" }, 12 + "cursor": { "type": "string" }, 13 + "limit": { 14 + "type": "integer", 15 + "minimum": 1, 16 + "maximum": 100, 17 + "default": 50 18 + } 19 + } 20 + }, 21 + "output": { 22 + "encoding": "application/json", 23 + "schema": { 24 + "type": "object", 25 + "required": ["accounts"], 26 + "properties": { 27 + "cursor": { "type": "string" }, 28 + "accounts": { 29 + "type": "array", 30 + "items": { 31 + "type": "ref", 32 + "ref": "com.atproto.admin.defs#accountView" 33 + } 34 + } 35 + } 36 + } 37 + } 38 + } 39 + } 40 + }
+37
lexicons/com/atproto/admin/sendEmail.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.admin.sendEmail", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Send email to a user's account email address.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["recipientDid", "content", "senderDid"], 13 + "properties": { 14 + "recipientDid": { "type": "string", "format": "did" }, 15 + "content": { "type": "string" }, 16 + "subject": { "type": "string" }, 17 + "senderDid": { "type": "string", "format": "did" }, 18 + "comment": { 19 + "type": "string", 20 + "description": "Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers" 21 + } 22 + } 23 + } 24 + }, 25 + "output": { 26 + "encoding": "application/json", 27 + "schema": { 28 + "type": "object", 29 + "required": ["sent"], 30 + "properties": { 31 + "sent": { "type": "boolean" } 32 + } 33 + } 34 + } 35 + } 36 + } 37 + }
+25
lexicons/com/atproto/admin/updateAccountEmail.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.admin.updateAccountEmail", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Administrative action to update an account's email.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["account", "email"], 13 + "properties": { 14 + "account": { 15 + "type": "string", 16 + "format": "at-identifier", 17 + "description": "The handle or DID of the repo." 18 + }, 19 + "email": { "type": "string" } 20 + } 21 + } 22 + } 23 + } 24 + } 25 + }
+21
lexicons/com/atproto/admin/updateAccountHandle.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.admin.updateAccountHandle", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Administrative action to update an account's handle.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["did", "handle"], 13 + "properties": { 14 + "did": { "type": "string", "format": "did" }, 15 + "handle": { "type": "string", "format": "handle" } 16 + } 17 + } 18 + } 19 + } 20 + } 21 + }
+21
lexicons/com/atproto/admin/updateAccountPassword.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.admin.updateAccountPassword", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Update the password for a user account as an administrator.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["did", "password"], 13 + "properties": { 14 + "did": { "type": "string", "format": "did" }, 15 + "password": { "type": "string" } 16 + } 17 + } 18 + } 19 + } 20 + } 21 + }
+56
lexicons/com/atproto/admin/updateSubjectStatus.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.admin.updateSubjectStatus", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Update the service-specific admin status of a subject (account, record, or blob).", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["subject"], 13 + "properties": { 14 + "subject": { 15 + "type": "union", 16 + "refs": [ 17 + "com.atproto.admin.defs#repoRef", 18 + "com.atproto.repo.strongRef", 19 + "com.atproto.admin.defs#repoBlobRef" 20 + ] 21 + }, 22 + "takedown": { 23 + "type": "ref", 24 + "ref": "com.atproto.admin.defs#statusAttr" 25 + }, 26 + "deactivated": { 27 + "type": "ref", 28 + "ref": "com.atproto.admin.defs#statusAttr" 29 + } 30 + } 31 + } 32 + }, 33 + "output": { 34 + "encoding": "application/json", 35 + "schema": { 36 + "type": "object", 37 + "required": ["subject"], 38 + "properties": { 39 + "subject": { 40 + "type": "union", 41 + "refs": [ 42 + "com.atproto.admin.defs#repoRef", 43 + "com.atproto.repo.strongRef", 44 + "com.atproto.admin.defs#repoBlobRef" 45 + ] 46 + }, 47 + "takedown": { 48 + "type": "ref", 49 + "ref": "com.atproto.admin.defs#statusAttr" 50 + } 51 + } 52 + } 53 + } 54 + } 55 + } 56 + }
+29
lexicons/com/atproto/identity/getRecommendedDidCredentials.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.identity.getRecommendedDidCredentials", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Describe the credentials that should be included in the DID doc of an account that is migrating to this service.", 8 + "output": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "properties": { 13 + "rotationKeys": { 14 + "description": "Recommended rotation keys for PLC dids. Should be undefined (or ignored) for did:webs.", 15 + "type": "array", 16 + "items": { "type": "string" } 17 + }, 18 + "alsoKnownAs": { 19 + "type": "array", 20 + "items": { "type": "string" } 21 + }, 22 + "verificationMethods": { "type": "unknown" }, 23 + "services": { "type": "unknown" } 24 + } 25 + } 26 + } 27 + } 28 + } 29 + }
+10
lexicons/com/atproto/identity/requestPlcOperationSignature.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.identity.requestPlcOperationSignature", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Request an email with a code to in order to request a signed PLC operation. Requires Auth." 8 + } 9 + } 10 + }
+31
lexicons/com/atproto/identity/resolveHandle.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.identity.resolveHandle", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Resolves a handle (domain name) to a DID.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["handle"], 11 + "properties": { 12 + "handle": { 13 + "type": "string", 14 + "format": "handle", 15 + "description": "The handle to resolve." 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "object", 23 + "required": ["did"], 24 + "properties": { 25 + "did": { "type": "string", "format": "did" } 26 + } 27 + } 28 + } 29 + } 30 + } 31 + }
+45
lexicons/com/atproto/identity/signPlcOperation.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.identity.signPlcOperation", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Signs a PLC operation to update some value(s) in the requesting DID's document.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "properties": { 13 + "token": { 14 + "description": "A token received through com.atproto.identity.requestPlcOperationSignature", 15 + "type": "string" 16 + }, 17 + "rotationKeys": { 18 + "type": "array", 19 + "items": { "type": "string" } 20 + }, 21 + "alsoKnownAs": { 22 + "type": "array", 23 + "items": { "type": "string" } 24 + }, 25 + "verificationMethods": { "type": "unknown" }, 26 + "services": { "type": "unknown" } 27 + } 28 + } 29 + }, 30 + "output": { 31 + "encoding": "application/json", 32 + "schema": { 33 + "type": "object", 34 + "required": ["operation"], 35 + "properties": { 36 + "operation": { 37 + "type": "unknown", 38 + "description": "A signed DID PLC operation." 39 + } 40 + } 41 + } 42 + } 43 + } 44 + } 45 + }
+20
lexicons/com/atproto/identity/submitPlcOperation.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.identity.submitPlcOperation", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Validates a PLC operation to ensure that it doesn't violate a service's constraints or get the identity into a bad state, then submits it to the PLC registry", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["operation"], 13 + "properties": { 14 + "operation": { "type": "unknown" } 15 + } 16 + } 17 + } 18 + } 19 + } 20 + }
+24
lexicons/com/atproto/identity/updateHandle.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.identity.updateHandle", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Updates the current account's handle. Verifies handle validity, and updates did:plc document if necessary. Implemented by PDS, and requires auth.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["handle"], 13 + "properties": { 14 + "handle": { 15 + "type": "string", 16 + "format": "handle", 17 + "description": "The new handle." 18 + } 19 + } 20 + } 21 + } 22 + } 23 + } 24 + }
+156
lexicons/com/atproto/label/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.label.defs", 4 + "defs": { 5 + "label": { 6 + "type": "object", 7 + "description": "Metadata tag on an atproto resource (eg, repo or record).", 8 + "required": ["src", "uri", "val", "cts"], 9 + "properties": { 10 + "ver": { 11 + "type": "integer", 12 + "description": "The AT Protocol version of the label object." 13 + }, 14 + "src": { 15 + "type": "string", 16 + "format": "did", 17 + "description": "DID of the actor who created this label." 18 + }, 19 + "uri": { 20 + "type": "string", 21 + "format": "uri", 22 + "description": "AT URI of the record, repository (account), or other resource that this label applies to." 23 + }, 24 + "cid": { 25 + "type": "string", 26 + "format": "cid", 27 + "description": "Optionally, CID specifying the specific version of 'uri' resource this label applies to." 28 + }, 29 + "val": { 30 + "type": "string", 31 + "maxLength": 128, 32 + "description": "The short string name of the value or type of this label." 33 + }, 34 + "neg": { 35 + "type": "boolean", 36 + "description": "If true, this is a negation label, overwriting a previous label." 37 + }, 38 + "cts": { 39 + "type": "string", 40 + "format": "datetime", 41 + "description": "Timestamp when this label was created." 42 + }, 43 + "exp": { 44 + "type": "string", 45 + "format": "datetime", 46 + "description": "Timestamp at which this label expires (no longer applies)." 47 + }, 48 + "sig": { 49 + "type": "bytes", 50 + "description": "Signature of dag-cbor encoded label." 51 + } 52 + } 53 + }, 54 + "selfLabels": { 55 + "type": "object", 56 + "description": "Metadata tags on an atproto record, published by the author within the record.", 57 + "required": ["values"], 58 + "properties": { 59 + "values": { 60 + "type": "array", 61 + "items": { "type": "ref", "ref": "#selfLabel" }, 62 + "maxLength": 10 63 + } 64 + } 65 + }, 66 + "selfLabel": { 67 + "type": "object", 68 + "description": "Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel.", 69 + "required": ["val"], 70 + "properties": { 71 + "val": { 72 + "type": "string", 73 + "maxLength": 128, 74 + "description": "The short string name of the value or type of this label." 75 + } 76 + } 77 + }, 78 + "labelValueDefinition": { 79 + "type": "object", 80 + "description": "Declares a label value and its expected interpretations and behaviors.", 81 + "required": ["identifier", "severity", "blurs", "locales"], 82 + "properties": { 83 + "identifier": { 84 + "type": "string", 85 + "description": "The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).", 86 + "maxLength": 100, 87 + "maxGraphemes": 100 88 + }, 89 + "severity": { 90 + "type": "string", 91 + "description": "How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.", 92 + "knownValues": ["inform", "alert", "none"] 93 + }, 94 + "blurs": { 95 + "type": "string", 96 + "description": "What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.", 97 + "knownValues": ["content", "media", "none"] 98 + }, 99 + "defaultSetting": { 100 + "type": "string", 101 + "description": "The default setting for this label.", 102 + "knownValues": ["ignore", "warn", "hide"], 103 + "default": "warn" 104 + }, 105 + "adultOnly": { 106 + "type": "boolean", 107 + "description": "Does the user need to have adult content enabled in order to configure this label?" 108 + }, 109 + "locales": { 110 + "type": "array", 111 + "items": { "type": "ref", "ref": "#labelValueDefinitionStrings" } 112 + } 113 + } 114 + }, 115 + "labelValueDefinitionStrings": { 116 + "type": "object", 117 + "description": "Strings which describe the label in the UI, localized into a specific language.", 118 + "required": ["lang", "name", "description"], 119 + "properties": { 120 + "lang": { 121 + "type": "string", 122 + "description": "The code of the language these strings are written in.", 123 + "format": "language" 124 + }, 125 + "name": { 126 + "type": "string", 127 + "description": "A short human-readable name for the label.", 128 + "maxGraphemes": 64, 129 + "maxLength": 640 130 + }, 131 + "description": { 132 + "type": "string", 133 + "description": "A longer description of what the label means and why it might be applied.", 134 + "maxGraphemes": 10000, 135 + "maxLength": 100000 136 + } 137 + } 138 + }, 139 + "labelValue": { 140 + "type": "string", 141 + "knownValues": [ 142 + "!hide", 143 + "!no-promote", 144 + "!warn", 145 + "!no-unauthenticated", 146 + "dmca-violation", 147 + "doxxing", 148 + "porn", 149 + "sexual", 150 + "nudity", 151 + "nsfl", 152 + "gore" 153 + ] 154 + } 155 + } 156 + }
+47
lexicons/com/atproto/label/queryLabels.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.label.queryLabels", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Find labels relevant to the provided AT-URI patterns. Public endpoint for moderation services, though may return different or additional results with auth.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["uriPatterns"], 11 + "properties": { 12 + "uriPatterns": { 13 + "type": "array", 14 + "items": { "type": "string" }, 15 + "description": "List of AT URI patterns to match (boolean 'OR'). Each may be a prefix (ending with '*'; will match inclusive of the string leading to '*'), or a full URI." 16 + }, 17 + "sources": { 18 + "type": "array", 19 + "items": { "type": "string", "format": "did" }, 20 + "description": "Optional list of label sources (DIDs) to filter on." 21 + }, 22 + "limit": { 23 + "type": "integer", 24 + "minimum": 1, 25 + "maximum": 250, 26 + "default": 50 27 + }, 28 + "cursor": { "type": "string" } 29 + } 30 + }, 31 + "output": { 32 + "encoding": "application/json", 33 + "schema": { 34 + "type": "object", 35 + "required": ["labels"], 36 + "properties": { 37 + "cursor": { "type": "string" }, 38 + "labels": { 39 + "type": "array", 40 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 41 + } 42 + } 43 + } 44 + } 45 + } 46 + } 47 + }
+50
lexicons/com/atproto/label/subscribeLabels.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.label.subscribeLabels", 4 + "defs": { 5 + "main": { 6 + "type": "subscription", 7 + "description": "Subscribe to stream of labels (and negations). Public endpoint implemented by mod services. Uses same sequencing scheme as repo event stream.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "cursor": { 12 + "type": "integer", 13 + "description": "The last known event seq number to backfill from." 14 + } 15 + } 16 + }, 17 + "message": { 18 + "schema": { 19 + "type": "union", 20 + "refs": ["#labels", "#info"] 21 + } 22 + }, 23 + "errors": [{ "name": "FutureCursor" }] 24 + }, 25 + "labels": { 26 + "type": "object", 27 + "required": ["seq", "labels"], 28 + "properties": { 29 + "seq": { "type": "integer" }, 30 + "labels": { 31 + "type": "array", 32 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 33 + } 34 + } 35 + }, 36 + "info": { 37 + "type": "object", 38 + "required": ["name"], 39 + "properties": { 40 + "name": { 41 + "type": "string", 42 + "knownValues": ["OutdatedCursor"] 43 + }, 44 + "message": { 45 + "type": "string" 46 + } 47 + } 48 + } 49 + } 50 + }
+59
lexicons/com/atproto/moderation/createReport.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.moderation.createReport", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["reasonType", "subject"], 13 + "properties": { 14 + "reasonType": { 15 + "type": "ref", 16 + "description": "Indicates the broad category of violation the report is for.", 17 + "ref": "com.atproto.moderation.defs#reasonType" 18 + }, 19 + "reason": { 20 + "type": "string", 21 + "maxGraphemes": 2000, 22 + "maxLength": 20000, 23 + "description": "Additional context about the content and violation." 24 + }, 25 + "subject": { 26 + "type": "union", 27 + "refs": ["com.atproto.admin.defs#repoRef", "com.atproto.repo.strongRef"] 28 + } 29 + } 30 + } 31 + }, 32 + "output": { 33 + "encoding": "application/json", 34 + "schema": { 35 + "type": "object", 36 + "required": ["id", "reasonType", "subject", "reportedBy", "createdAt"], 37 + "properties": { 38 + "id": { "type": "integer" }, 39 + "reasonType": { 40 + "type": "ref", 41 + "ref": "com.atproto.moderation.defs#reasonType" 42 + }, 43 + "reason": { 44 + "type": "string", 45 + "maxGraphemes": 2000, 46 + "maxLength": 20000 47 + }, 48 + "subject": { 49 + "type": "union", 50 + "refs": ["com.atproto.admin.defs#repoRef", "com.atproto.repo.strongRef"] 51 + }, 52 + "reportedBy": { "type": "string", "format": "did" }, 53 + "createdAt": { "type": "string", "format": "datetime" } 54 + } 55 + } 56 + } 57 + } 58 + } 59 + }
+46
lexicons/com/atproto/moderation/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.moderation.defs", 4 + "defs": { 5 + "reasonType": { 6 + "type": "string", 7 + "knownValues": [ 8 + "com.atproto.moderation.defs#reasonSpam", 9 + "com.atproto.moderation.defs#reasonViolation", 10 + "com.atproto.moderation.defs#reasonMisleading", 11 + "com.atproto.moderation.defs#reasonSexual", 12 + "com.atproto.moderation.defs#reasonRude", 13 + "com.atproto.moderation.defs#reasonOther", 14 + "com.atproto.moderation.defs#reasonAppeal" 15 + ] 16 + }, 17 + "reasonSpam": { 18 + "type": "token", 19 + "description": "Spam: frequent unwanted promotion, replies, mentions" 20 + }, 21 + "reasonViolation": { 22 + "type": "token", 23 + "description": "Direct violation of server rules, laws, terms of service" 24 + }, 25 + "reasonMisleading": { 26 + "type": "token", 27 + "description": "Misleading identity, affiliation, or content" 28 + }, 29 + "reasonSexual": { 30 + "type": "token", 31 + "description": "Unwanted or mislabeled sexual content" 32 + }, 33 + "reasonRude": { 34 + "type": "token", 35 + "description": "Rude, harassing, explicit, or otherwise unwelcoming behavior" 36 + }, 37 + "reasonOther": { 38 + "type": "token", 39 + "description": "Other: reports not falling under another report category" 40 + }, 41 + "reasonAppeal": { 42 + "type": "token", 43 + "description": "Appeal: appeal a previously taken moderation action" 44 + } 45 + } 46 + }
+77
lexicons/com/atproto/repo/applyWrites.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.applyWrites", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["repo", "writes"], 13 + "properties": { 14 + "repo": { 15 + "type": "string", 16 + "format": "at-identifier", 17 + "description": "The handle or DID of the repo (aka, current account)." 18 + }, 19 + "validate": { 20 + "type": "boolean", 21 + "default": true, 22 + "description": "Can be set to 'false' to skip Lexicon schema validation of record data, for all operations." 23 + }, 24 + "writes": { 25 + "type": "array", 26 + "items": { 27 + "type": "union", 28 + "refs": ["#create", "#update", "#delete"], 29 + "closed": true 30 + } 31 + }, 32 + "swapCommit": { 33 + "type": "string", 34 + "description": "If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations.", 35 + "format": "cid" 36 + } 37 + } 38 + } 39 + }, 40 + "errors": [ 41 + { 42 + "name": "InvalidSwap", 43 + "description": "Indicates that the 'swapCommit' parameter did not match current commit." 44 + } 45 + ] 46 + }, 47 + "create": { 48 + "type": "object", 49 + "description": "Operation which creates a new record.", 50 + "required": ["collection", "value"], 51 + "properties": { 52 + "collection": { "type": "string", "format": "nsid" }, 53 + "rkey": { "type": "string", "maxLength": 15 }, 54 + "value": { "type": "unknown" } 55 + } 56 + }, 57 + "update": { 58 + "type": "object", 59 + "description": "Operation which updates an existing record.", 60 + "required": ["collection", "rkey", "value"], 61 + "properties": { 62 + "collection": { "type": "string", "format": "nsid" }, 63 + "rkey": { "type": "string" }, 64 + "value": { "type": "unknown" } 65 + } 66 + }, 67 + "delete": { 68 + "type": "object", 69 + "description": "Operation which deletes an existing record.", 70 + "required": ["collection", "rkey"], 71 + "properties": { 72 + "collection": { "type": "string", "format": "nsid" }, 73 + "rkey": { "type": "string" } 74 + } 75 + } 76 + } 77 + }
+65
lexicons/com/atproto/repo/createRecord.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.createRecord", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Create a single new repository record. Requires auth, implemented by PDS.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["repo", "collection", "record"], 13 + "properties": { 14 + "repo": { 15 + "type": "string", 16 + "format": "at-identifier", 17 + "description": "The handle or DID of the repo (aka, current account)." 18 + }, 19 + "collection": { 20 + "type": "string", 21 + "format": "nsid", 22 + "description": "The NSID of the record collection." 23 + }, 24 + "rkey": { 25 + "type": "string", 26 + "description": "The Record Key.", 27 + "maxLength": 15 28 + }, 29 + "validate": { 30 + "type": "boolean", 31 + "default": true, 32 + "description": "Can be set to 'false' to skip Lexicon schema validation of record data." 33 + }, 34 + "record": { 35 + "type": "unknown", 36 + "description": "The record itself. Must contain a $type field." 37 + }, 38 + "swapCommit": { 39 + "type": "string", 40 + "format": "cid", 41 + "description": "Compare and swap with the previous commit by CID." 42 + } 43 + } 44 + } 45 + }, 46 + "output": { 47 + "encoding": "application/json", 48 + "schema": { 49 + "type": "object", 50 + "required": ["uri", "cid"], 51 + "properties": { 52 + "uri": { "type": "string", "format": "at-uri" }, 53 + "cid": { "type": "string", "format": "cid" } 54 + } 55 + } 56 + }, 57 + "errors": [ 58 + { 59 + "name": "InvalidSwap", 60 + "description": "Indicates that 'swapCommit' didn't match current repo commit." 61 + } 62 + ] 63 + } 64 + } 65 + }
+44
lexicons/com/atproto/repo/deleteRecord.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.deleteRecord", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["repo", "collection", "rkey"], 13 + "properties": { 14 + "repo": { 15 + "type": "string", 16 + "format": "at-identifier", 17 + "description": "The handle or DID of the repo (aka, current account)." 18 + }, 19 + "collection": { 20 + "type": "string", 21 + "format": "nsid", 22 + "description": "The NSID of the record collection." 23 + }, 24 + "rkey": { 25 + "type": "string", 26 + "description": "The Record Key." 27 + }, 28 + "swapRecord": { 29 + "type": "string", 30 + "format": "cid", 31 + "description": "Compare and swap with the previous record by CID." 32 + }, 33 + "swapCommit": { 34 + "type": "string", 35 + "format": "cid", 36 + "description": "Compare and swap with the previous commit by CID." 37 + } 38 + } 39 + } 40 + }, 41 + "errors": [{ "name": "InvalidSwap" }] 42 + } 43 + } 44 + }
+45
lexicons/com/atproto/repo/describeRepo.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.describeRepo", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get information about an account and repository, including the list of collections. Does not require auth.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["repo"], 11 + "properties": { 12 + "repo": { 13 + "type": "string", 14 + "format": "at-identifier", 15 + "description": "The handle or DID of the repo." 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "object", 23 + "required": ["handle", "did", "didDoc", "collections", "handleIsCorrect"], 24 + "properties": { 25 + "handle": { "type": "string", "format": "handle" }, 26 + "did": { "type": "string", "format": "did" }, 27 + "didDoc": { 28 + "type": "unknown", 29 + "description": "The complete DID document for this account." 30 + }, 31 + "collections": { 32 + "type": "array", 33 + "description": "List of all the collections (NSIDs) for which this repo contains at least one record.", 34 + "items": { "type": "string", "format": "nsid" } 35 + }, 36 + "handleIsCorrect": { 37 + "type": "boolean", 38 + "description": "Indicates if handle is currently valid (resolves bi-directionally)" 39 + } 40 + } 41 + } 42 + } 43 + } 44 + } 45 + }
+44
lexicons/com/atproto/repo/getRecord.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.getRecord", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a single record from a repository. Does not require auth.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["repo", "collection", "rkey"], 11 + "properties": { 12 + "repo": { 13 + "type": "string", 14 + "format": "at-identifier", 15 + "description": "The handle or DID of the repo." 16 + }, 17 + "collection": { 18 + "type": "string", 19 + "format": "nsid", 20 + "description": "The NSID of the record collection." 21 + }, 22 + "rkey": { "type": "string", "description": "The Record Key." }, 23 + "cid": { 24 + "type": "string", 25 + "format": "cid", 26 + "description": "The CID of the version of the record. If not specified, then return the most recent version." 27 + } 28 + } 29 + }, 30 + "output": { 31 + "encoding": "application/json", 32 + "schema": { 33 + "type": "object", 34 + "required": ["uri", "value"], 35 + "properties": { 36 + "uri": { "type": "string", "format": "at-uri" }, 37 + "cid": { "type": "string", "format": "cid" }, 38 + "value": { "type": "unknown" } 39 + } 40 + } 41 + } 42 + } 43 + } 44 + }
+13
lexicons/com/atproto/repo/importRepo.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.importRepo", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Import a repo in the form of a CAR file. Requires Content-Length HTTP header to be set.", 8 + "input": { 9 + "encoding": "application/vnd.ipld.car" 10 + } 11 + } 12 + } 13 + }
+44
lexicons/com/atproto/repo/listMissingBlobs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.listMissingBlobs", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Returns a list of missing blobs for the requesting account. Intended to be used in the account migration flow.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "limit": { 12 + "type": "integer", 13 + "minimum": 1, 14 + "maximum": 1000, 15 + "default": 500 16 + }, 17 + "cursor": { "type": "string" } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "object", 24 + "required": ["blobs"], 25 + "properties": { 26 + "cursor": { "type": "string" }, 27 + "blobs": { 28 + "type": "array", 29 + "items": { "type": "ref", "ref": "#recordBlob" } 30 + } 31 + } 32 + } 33 + } 34 + }, 35 + "recordBlob": { 36 + "type": "object", 37 + "required": ["cid", "recordUri"], 38 + "properties": { 39 + "cid": { "type": "string", "format": "cid" }, 40 + "recordUri": { "type": "string", "format": "at-uri" } 41 + } 42 + } 43 + } 44 + }
+69
lexicons/com/atproto/repo/listRecords.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.listRecords", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "List a range of records in a repository, matching a specific collection. Does not require auth.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["repo", "collection"], 11 + "properties": { 12 + "repo": { 13 + "type": "string", 14 + "format": "at-identifier", 15 + "description": "The handle or DID of the repo." 16 + }, 17 + "collection": { 18 + "type": "string", 19 + "format": "nsid", 20 + "description": "The NSID of the record type." 21 + }, 22 + "limit": { 23 + "type": "integer", 24 + "minimum": 1, 25 + "maximum": 100, 26 + "default": 50, 27 + "description": "The number of records to return." 28 + }, 29 + "cursor": { "type": "string" }, 30 + "rkeyStart": { 31 + "type": "string", 32 + "description": "DEPRECATED: The lowest sort-ordered rkey to start from (exclusive)" 33 + }, 34 + "rkeyEnd": { 35 + "type": "string", 36 + "description": "DEPRECATED: The highest sort-ordered rkey to stop at (exclusive)" 37 + }, 38 + "reverse": { 39 + "type": "boolean", 40 + "description": "Flag to reverse the order of the returned records." 41 + } 42 + } 43 + }, 44 + "output": { 45 + "encoding": "application/json", 46 + "schema": { 47 + "type": "object", 48 + "required": ["records"], 49 + "properties": { 50 + "cursor": { "type": "string" }, 51 + "records": { 52 + "type": "array", 53 + "items": { "type": "ref", "ref": "#record" } 54 + } 55 + } 56 + } 57 + } 58 + }, 59 + "record": { 60 + "type": "object", 61 + "required": ["uri", "cid", "value"], 62 + "properties": { 63 + "uri": { "type": "string", "format": "at-uri" }, 64 + "cid": { "type": "string", "format": "cid" }, 65 + "value": { "type": "unknown" } 66 + } 67 + } 68 + } 69 + }
+66
lexicons/com/atproto/repo/putRecord.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.putRecord", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["repo", "collection", "rkey", "record"], 13 + "nullable": ["swapRecord"], 14 + "properties": { 15 + "repo": { 16 + "type": "string", 17 + "format": "at-identifier", 18 + "description": "The handle or DID of the repo (aka, current account)." 19 + }, 20 + "collection": { 21 + "type": "string", 22 + "format": "nsid", 23 + "description": "The NSID of the record collection." 24 + }, 25 + "rkey": { 26 + "type": "string", 27 + "description": "The Record Key.", 28 + "maxLength": 15 29 + }, 30 + "validate": { 31 + "type": "boolean", 32 + "default": true, 33 + "description": "Can be set to 'false' to skip Lexicon schema validation of record data." 34 + }, 35 + "record": { 36 + "type": "unknown", 37 + "description": "The record to write." 38 + }, 39 + "swapRecord": { 40 + "type": "string", 41 + "format": "cid", 42 + "description": "Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation" 43 + }, 44 + "swapCommit": { 45 + "type": "string", 46 + "format": "cid", 47 + "description": "Compare and swap with the previous commit by CID." 48 + } 49 + } 50 + } 51 + }, 52 + "output": { 53 + "encoding": "application/json", 54 + "schema": { 55 + "type": "object", 56 + "required": ["uri", "cid"], 57 + "properties": { 58 + "uri": { "type": "string", "format": "at-uri" }, 59 + "cid": { "type": "string", "format": "cid" } 60 + } 61 + } 62 + }, 63 + "errors": [{ "name": "InvalidSwap" }] 64 + } 65 + } 66 + }
+15
lexicons/com/atproto/repo/strongRef.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.strongRef", 4 + "description": "A URI with a content-hash fingerprint.", 5 + "defs": { 6 + "main": { 7 + "type": "object", 8 + "required": ["uri", "cid"], 9 + "properties": { 10 + "uri": { "type": "string", "format": "at-uri" }, 11 + "cid": { "type": "string", "format": "cid" } 12 + } 13 + } 14 + } 15 + }
+23
lexicons/com/atproto/repo/uploadBlob.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.uploadBlob", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Upload a new blob, to be referenced from a repository record. The blob will be deleted if it is not referenced within a time window (eg, minutes). Blob restrictions (mimetype, size, etc) are enforced when the reference is created. Requires auth, implemented by PDS.", 8 + "input": { 9 + "encoding": "*/*" 10 + }, 11 + "output": { 12 + "encoding": "application/json", 13 + "schema": { 14 + "type": "object", 15 + "required": ["blob"], 16 + "properties": { 17 + "blob": { "type": "blob" } 18 + } 19 + } 20 + } 21 + } 22 + } 23 + }
+10
lexicons/com/atproto/server/activateAccount.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.activateAccount", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Activates a currently deactivated account. Used to finalize account migration after the account's repo is imported and identity is setup." 8 + } 9 + } 10 + }
+38
lexicons/com/atproto/server/checkAccountStatus.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.checkAccountStatus", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Returns the status of an account, especially as pertaining to import or recovery. Can be called many times over the course of an account migration. Requires auth and can only be called pertaining to oneself.", 8 + "output": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": [ 13 + "activated", 14 + "validDid", 15 + "repoCommit", 16 + "repoRev", 17 + "repoBlocks", 18 + "indexedRecords", 19 + "privateStateValues", 20 + "expectedBlobs", 21 + "importedBlobs" 22 + ], 23 + "properties": { 24 + "activated": { "type": "boolean" }, 25 + "validDid": { "type": "boolean" }, 26 + "repoCommit": { "type": "string", "format": "cid" }, 27 + "repoRev": { "type": "string" }, 28 + "repoBlocks": { "type": "integer" }, 29 + "indexedRecords": { "type": "integer" }, 30 + "privateStateValues": { "type": "integer" }, 31 + "expectedBlobs": { "type": "integer" }, 32 + "importedBlobs": { "type": "integer" } 33 + } 34 + } 35 + } 36 + } 37 + } 38 + }
+27
lexicons/com/atproto/server/confirmEmail.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.confirmEmail", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Confirm an email using a token from com.atproto.server.requestEmailConfirmation.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["email", "token"], 13 + "properties": { 14 + "email": { "type": "string" }, 15 + "token": { "type": "string" } 16 + } 17 + } 18 + }, 19 + "errors": [ 20 + { "name": "AccountNotFound" }, 21 + { "name": "ExpiredToken" }, 22 + { "name": "InvalidToken" }, 23 + { "name": "InvalidEmail" } 24 + ] 25 + } 26 + } 27 + }
+76
lexicons/com/atproto/server/createAccount.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.createAccount", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Create an account. Implemented by PDS.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["handle"], 13 + "properties": { 14 + "email": { "type": "string" }, 15 + "handle": { 16 + "type": "string", 17 + "format": "handle", 18 + "description": "Requested handle for the account." 19 + }, 20 + "did": { 21 + "type": "string", 22 + "format": "did", 23 + "description": "Pre-existing atproto DID, being imported to a new account." 24 + }, 25 + "inviteCode": { "type": "string" }, 26 + "verificationCode": { "type": "string" }, 27 + "verificationPhone": { "type": "string" }, 28 + "password": { 29 + "type": "string", 30 + "description": "Initial account password. May need to meet instance-specific password strength requirements." 31 + }, 32 + "recoveryKey": { 33 + "type": "string", 34 + "description": "DID PLC rotation key (aka, recovery key) to be included in PLC creation operation." 35 + }, 36 + "plcOp": { 37 + "type": "unknown", 38 + "description": "A signed DID PLC operation to be submitted as part of importing an existing account to this instance. NOTE: this optional field may be updated when full account migration is implemented." 39 + } 40 + } 41 + } 42 + }, 43 + "output": { 44 + "encoding": "application/json", 45 + "schema": { 46 + "type": "object", 47 + "description": "Account login session returned on successful account creation.", 48 + "required": ["accessJwt", "refreshJwt", "handle", "did"], 49 + "properties": { 50 + "accessJwt": { "type": "string" }, 51 + "refreshJwt": { "type": "string" }, 52 + "handle": { "type": "string", "format": "handle" }, 53 + "did": { 54 + "type": "string", 55 + "format": "did", 56 + "description": "The DID of the new account." 57 + }, 58 + "didDoc": { 59 + "type": "unknown", 60 + "description": "Complete DID document." 61 + } 62 + } 63 + } 64 + }, 65 + "errors": [ 66 + { "name": "InvalidHandle" }, 67 + { "name": "InvalidPassword" }, 68 + { "name": "InvalidInviteCode" }, 69 + { "name": "HandleNotAvailable" }, 70 + { "name": "UnsupportedDomain" }, 71 + { "name": "UnresolvableDid" }, 72 + { "name": "IncompatibleDidDoc" } 73 + ] 74 + } 75 + } 76 + }
+45
lexicons/com/atproto/server/createAppPassword.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.createAppPassword", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Create an App Password.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["name"], 13 + "properties": { 14 + "name": { 15 + "type": "string", 16 + "description": "A short name for the App Password, to help distinguish them." 17 + }, 18 + "privileged": { 19 + "type": "boolean", 20 + "description": "If an app password has 'privileged' access to possibly sensitive account state. Meant for use with trusted clients." 21 + } 22 + } 23 + } 24 + }, 25 + "output": { 26 + "encoding": "application/json", 27 + "schema": { 28 + "type": "ref", 29 + "ref": "#appPassword" 30 + } 31 + }, 32 + "errors": [{ "name": "AccountTakedown" }] 33 + }, 34 + "appPassword": { 35 + "type": "object", 36 + "required": ["name", "password", "createdAt"], 37 + "properties": { 38 + "name": { "type": "string" }, 39 + "password": { "type": "string" }, 40 + "createdAt": { "type": "string", "format": "datetime" }, 41 + "privileged": { "type": "boolean" } 42 + } 43 + } 44 + } 45 + }
+31
lexicons/com/atproto/server/createInviteCode.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.createInviteCode", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Create an invite code.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["useCount"], 13 + "properties": { 14 + "useCount": { "type": "integer" }, 15 + "forAccount": { "type": "string", "format": "did" } 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "object", 23 + "required": ["code"], 24 + "properties": { 25 + "code": { "type": "string" } 26 + } 27 + } 28 + } 29 + } 30 + } 31 + }
+49
lexicons/com/atproto/server/createInviteCodes.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.createInviteCodes", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Create invite codes.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["codeCount", "useCount"], 13 + "properties": { 14 + "codeCount": { "type": "integer", "default": 1 }, 15 + "useCount": { "type": "integer" }, 16 + "forAccounts": { 17 + "type": "array", 18 + "items": { "type": "string", "format": "did" } 19 + } 20 + } 21 + } 22 + }, 23 + "output": { 24 + "encoding": "application/json", 25 + "schema": { 26 + "type": "object", 27 + "required": ["codes"], 28 + "properties": { 29 + "codes": { 30 + "type": "array", 31 + "items": { "type": "ref", "ref": "#accountCodes" } 32 + } 33 + } 34 + } 35 + } 36 + }, 37 + "accountCodes": { 38 + "type": "object", 39 + "required": ["account", "codes"], 40 + "properties": { 41 + "account": { "type": "string" }, 42 + "codes": { 43 + "type": "array", 44 + "items": { "type": "string" } 45 + } 46 + } 47 + } 48 + } 49 + }
+49
lexicons/com/atproto/server/createSession.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.createSession", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Create an authentication session.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["identifier", "password"], 13 + "properties": { 14 + "identifier": { 15 + "type": "string", 16 + "description": "Handle or other identifier supported by the server for the authenticating user." 17 + }, 18 + "password": { "type": "string" }, 19 + "authFactorToken": { "type": "string" } 20 + } 21 + } 22 + }, 23 + "output": { 24 + "encoding": "application/json", 25 + "schema": { 26 + "type": "object", 27 + "required": ["accessJwt", "refreshJwt", "handle", "did"], 28 + "properties": { 29 + "accessJwt": { "type": "string" }, 30 + "refreshJwt": { "type": "string" }, 31 + "handle": { "type": "string", "format": "handle" }, 32 + "did": { "type": "string", "format": "did" }, 33 + "didDoc": { "type": "unknown" }, 34 + "email": { "type": "string" }, 35 + "emailConfirmed": { "type": "boolean" }, 36 + "emailAuthFactor": { "type": "boolean" }, 37 + "active": { "type": "boolean" }, 38 + "status": { 39 + "type": "string", 40 + "description": "If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.", 41 + "knownValues": ["takendown", "suspended", "deactivated"] 42 + } 43 + } 44 + } 45 + }, 46 + "errors": [{ "name": "AccountTakedown" }, { "name": "AuthFactorTokenRequired" }] 47 + } 48 + } 49 + }
+23
lexicons/com/atproto/server/deactivateAccount.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.deactivateAccount", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Deactivates a currently active account. Stops serving of repo, and future writes to repo until reactivated. Used to finalize account migration with the old host after the account has been activated on the new host.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "properties": { 13 + "deleteAfter": { 14 + "type": "string", 15 + "format": "datetime", 16 + "description": "A recommendation to server as to how long they should hold onto the deactivated account before deleting." 17 + } 18 + } 19 + } 20 + } 21 + } 22 + } 23 + }
+30
lexicons/com/atproto/server/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.defs", 4 + "defs": { 5 + "inviteCode": { 6 + "type": "object", 7 + "required": ["code", "available", "disabled", "forAccount", "createdBy", "createdAt", "uses"], 8 + "properties": { 9 + "code": { "type": "string" }, 10 + "available": { "type": "integer" }, 11 + "disabled": { "type": "boolean" }, 12 + "forAccount": { "type": "string" }, 13 + "createdBy": { "type": "string" }, 14 + "createdAt": { "type": "string", "format": "datetime" }, 15 + "uses": { 16 + "type": "array", 17 + "items": { "type": "ref", "ref": "#inviteCodeUse" } 18 + } 19 + } 20 + }, 21 + "inviteCodeUse": { 22 + "type": "object", 23 + "required": ["usedBy", "usedAt"], 24 + "properties": { 25 + "usedBy": { "type": "string", "format": "did" }, 26 + "usedAt": { "type": "string", "format": "datetime" } 27 + } 28 + } 29 + } 30 + }
+23
lexicons/com/atproto/server/deleteAccount.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.deleteAccount", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Delete an actor's account with a token and password. Can only be called after requesting a deletion token. Requires auth.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["did", "password", "token"], 13 + "properties": { 14 + "did": { "type": "string", "format": "did" }, 15 + "password": { "type": "string" }, 16 + "token": { "type": "string" } 17 + } 18 + } 19 + }, 20 + "errors": [{ "name": "ExpiredToken" }, { "name": "InvalidToken" }] 21 + } 22 + } 23 + }
+10
lexicons/com/atproto/server/deleteSession.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.deleteSession", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Delete the current session. Requires auth." 8 + } 9 + } 10 + }
+59
lexicons/com/atproto/server/describeServer.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.describeServer", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Describes the server's account creation requirements and capabilities. Implemented by PDS.", 8 + "output": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["did", "availableUserDomains"], 13 + "properties": { 14 + "inviteCodeRequired": { 15 + "type": "boolean", 16 + "description": "If true, an invite code must be supplied to create an account on this instance." 17 + }, 18 + "phoneVerificationRequired": { 19 + "type": "boolean", 20 + "description": "If true, a phone verification token must be supplied to create an account on this instance." 21 + }, 22 + "availableUserDomains": { 23 + "type": "array", 24 + "description": "List of domain suffixes that can be used in account handles.", 25 + "items": { "type": "string" } 26 + }, 27 + "links": { 28 + "type": "ref", 29 + "description": "URLs of service policy documents.", 30 + "ref": "#links" 31 + }, 32 + "contact": { 33 + "type": "ref", 34 + "description": "Contact information", 35 + "ref": "#contact" 36 + }, 37 + "did": { 38 + "type": "string", 39 + "format": "did" 40 + } 41 + } 42 + } 43 + } 44 + }, 45 + "links": { 46 + "type": "object", 47 + "properties": { 48 + "privacyPolicy": { "type": "string", "format": "uri" }, 49 + "termsOfService": { "type": "string", "format": "uri" } 50 + } 51 + }, 52 + "contact": { 53 + "type": "object", 54 + "properties": { 55 + "email": { "type": "string" } 56 + } 57 + } 58 + } 59 + }
+38
lexicons/com/atproto/server/getAccountInviteCodes.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.getAccountInviteCodes", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get all invite codes for the current account. Requires auth.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "includeUsed": { "type": "boolean", "default": true }, 12 + "createAvailable": { 13 + "type": "boolean", 14 + "default": true, 15 + "description": "Controls whether any new 'earned' but not 'created' invites should be created." 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "object", 23 + "required": ["codes"], 24 + "properties": { 25 + "codes": { 26 + "type": "array", 27 + "items": { 28 + "type": "ref", 29 + "ref": "com.atproto.server.defs#inviteCode" 30 + } 31 + } 32 + } 33 + } 34 + }, 35 + "errors": [{ "name": "DuplicateCreate" }] 36 + } 37 + } 38 + }
+48
lexicons/com/atproto/server/getServiceAuth.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.getServiceAuth", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a signed token on behalf of the requesting DID for the requested service.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["aud"], 11 + "properties": { 12 + "aud": { 13 + "type": "string", 14 + "format": "did", 15 + "description": "The DID of the service that the token will be used to authenticate with" 16 + }, 17 + "exp": { 18 + "type": "integer", 19 + "description": "The time in Unix Epoch seconds that the JWT expires. Defaults to 60 seconds in the future. The service may enforce certain time bounds on tokens depending on the requested scope." 20 + }, 21 + "lxm": { 22 + "type": "string", 23 + "format": "nsid", 24 + "description": "Lexicon (XRPC) method to bind the requested token to" 25 + } 26 + } 27 + }, 28 + "output": { 29 + "encoding": "application/json", 30 + "schema": { 31 + "type": "object", 32 + "required": ["token"], 33 + "properties": { 34 + "token": { 35 + "type": "string" 36 + } 37 + } 38 + } 39 + }, 40 + "errors": [ 41 + { 42 + "name": "BadExpiration", 43 + "description": "Indicates that the requested expiration date is not a valid. May be in the past or may be reliant on the requested scopes." 44 + } 45 + ] 46 + } 47 + } 48 + }
+31
lexicons/com/atproto/server/getSession.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.getSession", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get information about the current auth session. Requires auth.", 8 + "output": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["handle", "did"], 13 + "properties": { 14 + "handle": { "type": "string", "format": "handle" }, 15 + "did": { "type": "string", "format": "did" }, 16 + "email": { "type": "string" }, 17 + "emailConfirmed": { "type": "boolean" }, 18 + "emailAuthFactor": { "type": "boolean" }, 19 + "didDoc": { "type": "unknown" }, 20 + "active": { "type": "boolean" }, 21 + "status": { 22 + "type": "string", 23 + "description": "If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.", 24 + "knownValues": ["takendown", "suspended", "deactivated"] 25 + } 26 + } 27 + } 28 + } 29 + } 30 + } 31 + }
+33
lexicons/com/atproto/server/listAppPasswords.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.listAppPasswords", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "List all App Passwords.", 8 + "output": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["passwords"], 13 + "properties": { 14 + "passwords": { 15 + "type": "array", 16 + "items": { "type": "ref", "ref": "#appPassword" } 17 + } 18 + } 19 + } 20 + }, 21 + "errors": [{ "name": "AccountTakedown" }] 22 + }, 23 + "appPassword": { 24 + "type": "object", 25 + "required": ["name", "createdAt"], 26 + "properties": { 27 + "name": { "type": "string" }, 28 + "createdAt": { "type": "string", "format": "datetime" }, 29 + "privileged": { "type": "boolean" } 30 + } 31 + } 32 + } 33 + }
+31
lexicons/com/atproto/server/refreshSession.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.refreshSession", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Refresh an authentication session. Requires auth using the 'refreshJwt' (not the 'accessJwt').", 8 + "output": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["accessJwt", "refreshJwt", "handle", "did"], 13 + "properties": { 14 + "accessJwt": { "type": "string" }, 15 + "refreshJwt": { "type": "string" }, 16 + "handle": { "type": "string", "format": "handle" }, 17 + "did": { "type": "string", "format": "did" }, 18 + "didDoc": { "type": "unknown" }, 19 + "active": { "type": "boolean" }, 20 + "status": { 21 + "type": "string", 22 + "description": "Hosting status of the account. If not specified, then assume 'active'.", 23 + "knownValues": ["takendown", "suspended", "deactivated"] 24 + } 25 + } 26 + } 27 + }, 28 + "errors": [{ "name": "AccountTakedown" }] 29 + } 30 + } 31 + }
+10
lexicons/com/atproto/server/requestAccountDelete.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.requestAccountDelete", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Initiate a user account deletion via email." 8 + } 9 + } 10 + }
+10
lexicons/com/atproto/server/requestEmailConfirmation.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.requestEmailConfirmation", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Request an email with a code to confirm ownership of email." 8 + } 9 + } 10 + }
+20
lexicons/com/atproto/server/requestEmailUpdate.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.requestEmailUpdate", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Request a token in order to update email.", 8 + "output": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["tokenRequired"], 13 + "properties": { 14 + "tokenRequired": { "type": "boolean" } 15 + } 16 + } 17 + } 18 + } 19 + } 20 + }
+20
lexicons/com/atproto/server/requestPasswordReset.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.requestPasswordReset", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Initiate a user account password reset via email.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["email"], 13 + "properties": { 14 + "email": { "type": "string" } 15 + } 16 + } 17 + } 18 + } 19 + } 20 + }
+36
lexicons/com/atproto/server/reserveSigningKey.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.reserveSigningKey", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Reserve a repo signing key, for use with account creation. Necessary so that a DID PLC update operation can be constructed during an account migraiton. Public and does not require auth; implemented by PDS. NOTE: this endpoint may change when full account migration is implemented.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "properties": { 13 + "did": { 14 + "type": "string", 15 + "format": "did", 16 + "description": "The DID to reserve a key for." 17 + } 18 + } 19 + } 20 + }, 21 + "output": { 22 + "encoding": "application/json", 23 + "schema": { 24 + "type": "object", 25 + "required": ["signingKey"], 26 + "properties": { 27 + "signingKey": { 28 + "type": "string", 29 + "description": "The public key for the reserved signing key, in did:key serialization." 30 + } 31 + } 32 + } 33 + } 34 + } 35 + } 36 + }
+22
lexicons/com/atproto/server/resetPassword.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.resetPassword", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Reset a user account password using a token.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["token", "password"], 13 + "properties": { 14 + "token": { "type": "string" }, 15 + "password": { "type": "string" } 16 + } 17 + } 18 + }, 19 + "errors": [{ "name": "ExpiredToken" }, { "name": "InvalidToken" }] 20 + } 21 + } 22 + }
+20
lexicons/com/atproto/server/revokeAppPassword.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.revokeAppPassword", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Revoke an App Password by name.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["name"], 13 + "properties": { 14 + "name": { "type": "string" } 15 + } 16 + } 17 + } 18 + } 19 + } 20 + }
+26
lexicons/com/atproto/server/updateEmail.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.updateEmail", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Update an account's email.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["email"], 13 + "properties": { 14 + "email": { "type": "string" }, 15 + "emailAuthFactor": { "type": "boolean" }, 16 + "token": { 17 + "type": "string", 18 + "description": "Requires a token from com.atproto.sever.requestEmailUpdate if the account's email has been confirmed." 19 + } 20 + } 21 + } 22 + }, 23 + "errors": [{ "name": "ExpiredToken" }, { "name": "InvalidToken" }, { "name": "TokenRequired" }] 24 + } 25 + } 26 + }
+36
lexicons/com/atproto/sync/getBlob.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.sync.getBlob", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a blob associated with a given account. Returns the full blob as originally uploaded. Does not require auth; implemented by PDS.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["did", "cid"], 11 + "properties": { 12 + "did": { 13 + "type": "string", 14 + "format": "did", 15 + "description": "The DID of the account." 16 + }, 17 + "cid": { 18 + "type": "string", 19 + "format": "cid", 20 + "description": "The CID of the blob to fetch" 21 + } 22 + } 23 + }, 24 + "output": { 25 + "encoding": "*/*" 26 + }, 27 + "errors": [ 28 + { "name": "BlobNotFound" }, 29 + { "name": "RepoNotFound" }, 30 + { "name": "RepoTakendown" }, 31 + { "name": "RepoSuspended" }, 32 + { "name": "RepoDeactivated" } 33 + ] 34 + } 35 + } 36 + }
+35
lexicons/com/atproto/sync/getBlocks.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.sync.getBlocks", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get data blocks from a given repo, by CID. For example, intermediate MST nodes, or records. Does not require auth; implemented by PDS.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["did", "cids"], 11 + "properties": { 12 + "did": { 13 + "type": "string", 14 + "format": "did", 15 + "description": "The DID of the repo." 16 + }, 17 + "cids": { 18 + "type": "array", 19 + "items": { "type": "string", "format": "cid" } 20 + } 21 + } 22 + }, 23 + "output": { 24 + "encoding": "application/vnd.ipld.car" 25 + }, 26 + "errors": [ 27 + { "name": "BlockNotFound" }, 28 + { "name": "RepoNotFound" }, 29 + { "name": "RepoTakendown" }, 30 + { "name": "RepoSuspended" }, 31 + { "name": "RepoDeactivated" } 32 + ] 33 + } 34 + } 35 + }
+24
lexicons/com/atproto/sync/getCheckout.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.sync.getCheckout", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "DEPRECATED - please use com.atproto.sync.getRepo instead", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["did"], 11 + "properties": { 12 + "did": { 13 + "type": "string", 14 + "format": "did", 15 + "description": "The DID of the repo." 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/vnd.ipld.car" 21 + } 22 + } 23 + } 24 + }
+32
lexicons/com/atproto/sync/getHead.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.sync.getHead", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "DEPRECATED - please use com.atproto.sync.getLatestCommit instead", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["did"], 11 + "properties": { 12 + "did": { 13 + "type": "string", 14 + "format": "did", 15 + "description": "The DID of the repo." 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "object", 23 + "required": ["root"], 24 + "properties": { 25 + "root": { "type": "string", "format": "cid" } 26 + } 27 + } 28 + }, 29 + "errors": [{ "name": "HeadNotFound" }] 30 + } 31 + } 32 + }
+38
lexicons/com/atproto/sync/getLatestCommit.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.sync.getLatestCommit", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get the current commit CID & revision of the specified repo. Does not require auth.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["did"], 11 + "properties": { 12 + "did": { 13 + "type": "string", 14 + "format": "did", 15 + "description": "The DID of the repo." 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "object", 23 + "required": ["cid", "rev"], 24 + "properties": { 25 + "cid": { "type": "string", "format": "cid" }, 26 + "rev": { "type": "string" } 27 + } 28 + } 29 + }, 30 + "errors": [ 31 + { "name": "RepoNotFound" }, 32 + { "name": "RepoTakendown" }, 33 + { "name": "RepoSuspended" }, 34 + { "name": "RepoDeactivated" } 35 + ] 36 + } 37 + } 38 + }
+38
lexicons/com/atproto/sync/getRecord.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.sync.getRecord", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get data blocks needed to prove the existence or non-existence of record in the current version of repo. Does not require auth.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["did", "collection", "rkey"], 11 + "properties": { 12 + "did": { 13 + "type": "string", 14 + "format": "did", 15 + "description": "The DID of the repo." 16 + }, 17 + "collection": { "type": "string", "format": "nsid" }, 18 + "rkey": { "type": "string", "description": "Record Key" }, 19 + "commit": { 20 + "type": "string", 21 + "format": "cid", 22 + "description": "DEPRECATED: referenced a repo commit by CID, and retrieved record as of that commit" 23 + } 24 + } 25 + }, 26 + "output": { 27 + "encoding": "application/vnd.ipld.car" 28 + }, 29 + "errors": [ 30 + { "name": "RecordNotFound" }, 31 + { "name": "RepoNotFound" }, 32 + { "name": "RepoTakendown" }, 33 + { "name": "RepoSuspended" }, 34 + { "name": "RepoDeactivated" } 35 + ] 36 + } 37 + } 38 + }
+34
lexicons/com/atproto/sync/getRepo.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.sync.getRepo", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Download a repository export as CAR file. Optionally only a 'diff' since a previous revision. Does not require auth; implemented by PDS.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["did"], 11 + "properties": { 12 + "did": { 13 + "type": "string", 14 + "format": "did", 15 + "description": "The DID of the repo." 16 + }, 17 + "since": { 18 + "type": "string", 19 + "description": "The revision ('rev') of the repo to create a diff from." 20 + } 21 + } 22 + }, 23 + "output": { 24 + "encoding": "application/vnd.ipld.car" 25 + }, 26 + "errors": [ 27 + { "name": "RepoNotFound" }, 28 + { "name": "RepoTakendown" }, 29 + { "name": "RepoSuspended" }, 30 + { "name": "RepoDeactivated" } 31 + ] 32 + } 33 + } 34 + }
+42
lexicons/com/atproto/sync/getRepoStatus.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.sync.getRepoStatus", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get the hosting status for a repository, on this server. Expected to be implemented by PDS and Relay.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["did"], 11 + "properties": { 12 + "did": { 13 + "type": "string", 14 + "format": "did", 15 + "description": "The DID of the repo." 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "object", 23 + "required": ["did", "active"], 24 + "properties": { 25 + "did": { "type": "string", "format": "did" }, 26 + "active": { "type": "boolean" }, 27 + "status": { 28 + "type": "string", 29 + "description": "If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.", 30 + "knownValues": ["takendown", "suspended", "deactivated"] 31 + }, 32 + "rev": { 33 + "type": "string", 34 + "description": "Optional field, the current rev of the repo, if active=true" 35 + } 36 + } 37 + } 38 + }, 39 + "errors": [{ "name": "RepoNotFound" }] 40 + } 41 + } 42 + }
+52
lexicons/com/atproto/sync/listBlobs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.sync.listBlobs", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "List blob CIDs for an account, since some repo revision. Does not require auth; implemented by PDS.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["did"], 11 + "properties": { 12 + "did": { 13 + "type": "string", 14 + "format": "did", 15 + "description": "The DID of the repo." 16 + }, 17 + "since": { 18 + "type": "string", 19 + "description": "Optional revision of the repo to list blobs since." 20 + }, 21 + "limit": { 22 + "type": "integer", 23 + "minimum": 1, 24 + "maximum": 1000, 25 + "default": 500 26 + }, 27 + "cursor": { "type": "string" } 28 + } 29 + }, 30 + "output": { 31 + "encoding": "application/json", 32 + "schema": { 33 + "type": "object", 34 + "required": ["cids"], 35 + "properties": { 36 + "cursor": { "type": "string" }, 37 + "cids": { 38 + "type": "array", 39 + "items": { "type": "string", "format": "cid" } 40 + } 41 + } 42 + } 43 + }, 44 + "errors": [ 45 + { "name": "RepoNotFound" }, 46 + { "name": "RepoTakendown" }, 47 + { "name": "RepoSuspended" }, 48 + { "name": "RepoDeactivated" } 49 + ] 50 + } 51 + } 52 + }
+55
lexicons/com/atproto/sync/listRepos.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.sync.listRepos", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Enumerates all the DID, rev, and commit CID for all repos hosted by this service. Does not require auth; implemented by PDS and Relay.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "limit": { 12 + "type": "integer", 13 + "minimum": 1, 14 + "maximum": 1000, 15 + "default": 500 16 + }, 17 + "cursor": { "type": "string" } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "object", 24 + "required": ["repos"], 25 + "properties": { 26 + "cursor": { "type": "string" }, 27 + "repos": { 28 + "type": "array", 29 + "items": { "type": "ref", "ref": "#repo" } 30 + } 31 + } 32 + } 33 + } 34 + }, 35 + "repo": { 36 + "type": "object", 37 + "required": ["did", "head", "rev"], 38 + "properties": { 39 + "did": { "type": "string", "format": "did" }, 40 + "head": { 41 + "type": "string", 42 + "format": "cid", 43 + "description": "Current repo commit CID" 44 + }, 45 + "rev": { "type": "string" }, 46 + "active": { "type": "boolean" }, 47 + "status": { 48 + "type": "string", 49 + "description": "If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.", 50 + "knownValues": ["takendown", "suspended", "deactivated"] 51 + } 52 + } 53 + } 54 + } 55 + }
+23
lexicons/com/atproto/sync/notifyOfUpdate.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.sync.notifyOfUpdate", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Notify a crawling service of a recent update, and that crawling should resume. Intended use is after a gap between repo stream events caused the crawling service to disconnect. Does not require auth; implemented by Relay.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["hostname"], 13 + "properties": { 14 + "hostname": { 15 + "type": "string", 16 + "description": "Hostname of the current service (usually a PDS) that is notifying of update." 17 + } 18 + } 19 + } 20 + } 21 + } 22 + } 23 + }
+23
lexicons/com/atproto/sync/requestCrawl.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.sync.requestCrawl", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Request a service to persistently crawl hosted repos. Expected use is new PDS instances declaring their existence to Relays. Does not require auth.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["hostname"], 13 + "properties": { 14 + "hostname": { 15 + "type": "string", 16 + "description": "Hostname of the current service (eg, PDS) that is requesting to be crawled." 17 + } 18 + } 19 + } 20 + } 21 + } 22 + } 23 + }
+205
lexicons/com/atproto/sync/subscribeRepos.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.sync.subscribeRepos", 4 + "defs": { 5 + "main": { 6 + "type": "subscription", 7 + "description": "Repository event stream, aka Firehose endpoint. Outputs repo commits with diff data, and identity update events, for all repositories on the current server. See the atproto specifications for details around stream sequencing, repo versioning, CAR diff format, and more. Public and does not require auth; implemented by PDS and Relay.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "cursor": { 12 + "type": "integer", 13 + "description": "The last known event seq number to backfill from." 14 + } 15 + } 16 + }, 17 + "message": { 18 + "schema": { 19 + "type": "union", 20 + "refs": ["#commit", "#identity", "#account", "#handle", "#migrate", "#tombstone", "#info"] 21 + } 22 + }, 23 + "errors": [ 24 + { "name": "FutureCursor" }, 25 + { 26 + "name": "ConsumerTooSlow", 27 + "description": "If the consumer of the stream can not keep up with events, and a backlog gets too large, the server will drop the connection." 28 + } 29 + ] 30 + }, 31 + "commit": { 32 + "type": "object", 33 + "description": "Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature.", 34 + "required": [ 35 + "seq", 36 + "rebase", 37 + "tooBig", 38 + "repo", 39 + "commit", 40 + "rev", 41 + "since", 42 + "blocks", 43 + "ops", 44 + "blobs", 45 + "time" 46 + ], 47 + "nullable": ["prev", "since"], 48 + "properties": { 49 + "seq": { 50 + "type": "integer", 51 + "description": "The stream sequence number of this message." 52 + }, 53 + "rebase": { "type": "boolean", "description": "DEPRECATED -- unused" }, 54 + "tooBig": { 55 + "type": "boolean", 56 + "description": "Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data." 57 + }, 58 + "repo": { 59 + "type": "string", 60 + "format": "did", 61 + "description": "The repo this event comes from." 62 + }, 63 + "commit": { 64 + "type": "cid-link", 65 + "description": "Repo commit object CID." 66 + }, 67 + "prev": { 68 + "type": "cid-link", 69 + "description": "DEPRECATED -- unused. WARNING -- nullable and optional; stick with optional to ensure golang interoperability." 70 + }, 71 + "rev": { 72 + "type": "string", 73 + "description": "The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event." 74 + }, 75 + "since": { 76 + "type": "string", 77 + "description": "The rev of the last emitted commit from this repo (if any)." 78 + }, 79 + "blocks": { 80 + "type": "bytes", 81 + "description": "CAR file containing relevant blocks, as a diff since the previous repo state.", 82 + "maxLength": 1000000 83 + }, 84 + "ops": { 85 + "type": "array", 86 + "items": { 87 + "type": "ref", 88 + "ref": "#repoOp", 89 + "description": "List of repo mutation operations in this commit (eg, records created, updated, or deleted)." 90 + }, 91 + "maxLength": 200 92 + }, 93 + "blobs": { 94 + "type": "array", 95 + "items": { 96 + "type": "cid-link", 97 + "description": "List of new blobs (by CID) referenced by records in this commit." 98 + } 99 + }, 100 + "time": { 101 + "type": "string", 102 + "format": "datetime", 103 + "description": "Timestamp of when this message was originally broadcast." 104 + } 105 + } 106 + }, 107 + "identity": { 108 + "type": "object", 109 + "description": "Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache.", 110 + "required": ["seq", "did", "time"], 111 + "properties": { 112 + "seq": { "type": "integer" }, 113 + "did": { "type": "string", "format": "did" }, 114 + "time": { "type": "string", "format": "datetime" }, 115 + "handle": { 116 + "type": "string", 117 + "format": "handle", 118 + "description": "The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details." 119 + } 120 + } 121 + }, 122 + "account": { 123 + "type": "object", 124 + "description": "Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active.", 125 + "required": ["seq", "did", "time", "active"], 126 + "properties": { 127 + "seq": { "type": "integer" }, 128 + "did": { "type": "string", "format": "did" }, 129 + "time": { "type": "string", "format": "datetime" }, 130 + "active": { 131 + "type": "boolean", 132 + "description": "Indicates that the account has a repository which can be fetched from the host that emitted this event." 133 + }, 134 + "status": { 135 + "type": "string", 136 + "description": "If active=false, this optional field indicates a reason for why the account is not active.", 137 + "knownValues": ["takendown", "suspended", "deleted", "deactivated"] 138 + } 139 + } 140 + }, 141 + "handle": { 142 + "type": "object", 143 + "description": "DEPRECATED -- Use #identity event instead", 144 + "required": ["seq", "did", "handle", "time"], 145 + "properties": { 146 + "seq": { "type": "integer" }, 147 + "did": { "type": "string", "format": "did" }, 148 + "handle": { "type": "string", "format": "handle" }, 149 + "time": { "type": "string", "format": "datetime" } 150 + } 151 + }, 152 + "migrate": { 153 + "type": "object", 154 + "description": "DEPRECATED -- Use #account event instead", 155 + "required": ["seq", "did", "migrateTo", "time"], 156 + "nullable": ["migrateTo"], 157 + "properties": { 158 + "seq": { "type": "integer" }, 159 + "did": { "type": "string", "format": "did" }, 160 + "migrateTo": { "type": "string" }, 161 + "time": { "type": "string", "format": "datetime" } 162 + } 163 + }, 164 + "tombstone": { 165 + "type": "object", 166 + "description": "DEPRECATED -- Use #account event instead", 167 + "required": ["seq", "did", "time"], 168 + "properties": { 169 + "seq": { "type": "integer" }, 170 + "did": { "type": "string", "format": "did" }, 171 + "time": { "type": "string", "format": "datetime" } 172 + } 173 + }, 174 + "info": { 175 + "type": "object", 176 + "required": ["name"], 177 + "properties": { 178 + "name": { 179 + "type": "string", 180 + "knownValues": ["OutdatedCursor"] 181 + }, 182 + "message": { 183 + "type": "string" 184 + } 185 + } 186 + }, 187 + "repoOp": { 188 + "type": "object", 189 + "description": "A repo operation, ie a mutation of a single record.", 190 + "required": ["action", "path", "cid"], 191 + "nullable": ["cid"], 192 + "properties": { 193 + "action": { 194 + "type": "string", 195 + "knownValues": ["create", "update", "delete"] 196 + }, 197 + "path": { "type": "string" }, 198 + "cid": { 199 + "type": "cid-link", 200 + "description": "For creates and updates, the new record CID. For deletions, null." 201 + } 202 + } 203 + } 204 + } 205 + }
+22
lexicons/com/atproto/temp/checkSignupQueue.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.temp.checkSignupQueue", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Check accounts location in signup queue.", 8 + "output": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["activated"], 13 + "properties": { 14 + "activated": { "type": "boolean" }, 15 + "placeInQueue": { "type": "integer" }, 16 + "estimatedTimeMs": { "type": "integer" } 17 + } 18 + } 19 + } 20 + } 21 + } 22 + }
+35
lexicons/com/atproto/temp/fetchLabels.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.temp.fetchLabels", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "DEPRECATED: use queryLabels or subscribeLabels instead -- Fetch all labels from a labeler created after a certain date.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "since": { "type": "integer" }, 12 + "limit": { 13 + "type": "integer", 14 + "minimum": 1, 15 + "maximum": 250, 16 + "default": 50 17 + } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "object", 24 + "required": ["labels"], 25 + "properties": { 26 + "labels": { 27 + "type": "array", 28 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 29 + } 30 + } 31 + } 32 + } 33 + } 34 + } 35 + }
+20
lexicons/com/atproto/temp/requestPhoneVerification.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.temp.requestPhoneVerification", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Request a verification code to be sent to the supplied phone number", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["phoneNumber"], 13 + "properties": { 14 + "phoneNumber": { "type": "string" } 15 + } 16 + } 17 + } 18 + } 19 + } 20 + }
+43
lexicons/tools/ozone/communication/createTemplate.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.communication.createTemplate", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Administrative action to create a new, re-usable communication (email for now) template.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["subject", "contentMarkdown", "name"], 13 + "properties": { 14 + "name": { 15 + "type": "string", 16 + "description": "Name of the template." 17 + }, 18 + "contentMarkdown": { 19 + "type": "string", 20 + "description": "Content of the template, markdown supported, can contain variable placeholders." 21 + }, 22 + "subject": { 23 + "type": "string", 24 + "description": "Subject of the message, used in emails." 25 + }, 26 + "createdBy": { 27 + "type": "string", 28 + "format": "did", 29 + "description": "DID of the user who is creating the template." 30 + } 31 + } 32 + } 33 + }, 34 + "output": { 35 + "encoding": "application/json", 36 + "schema": { 37 + "type": "ref", 38 + "ref": "tools.ozone.communication.defs#templateView" 39 + } 40 + } 41 + } 42 + } 43 + }
+30
lexicons/tools/ozone/communication/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.communication.defs", 4 + "defs": { 5 + "templateView": { 6 + "type": "object", 7 + "required": ["id", "name", "contentMarkdown", "disabled", "lastUpdatedBy", "createdAt", "updatedAt"], 8 + "properties": { 9 + "id": { "type": "string" }, 10 + "name": { "type": "string", "description": "Name of the template." }, 11 + "subject": { 12 + "type": "string", 13 + "description": "Content of the template, can contain markdown and variable placeholders." 14 + }, 15 + "contentMarkdown": { 16 + "type": "string", 17 + "description": "Subject of the message, used in emails." 18 + }, 19 + "disabled": { "type": "boolean" }, 20 + "lastUpdatedBy": { 21 + "type": "string", 22 + "format": "did", 23 + "description": "DID of the user who last updated the template." 24 + }, 25 + "createdAt": { "type": "string", "format": "datetime" }, 26 + "updatedAt": { "type": "string", "format": "datetime" } 27 + } 28 + } 29 + } 30 + }
+20
lexicons/tools/ozone/communication/deleteTemplate.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.communication.deleteTemplate", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Delete a communication template.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["id"], 13 + "properties": { 14 + "id": { "type": "string" } 15 + } 16 + } 17 + } 18 + } 19 + } 20 + }
+26
lexicons/tools/ozone/communication/listTemplates.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.communication.listTemplates", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get list of all communication templates.", 8 + "output": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["communicationTemplates"], 13 + "properties": { 14 + "communicationTemplates": { 15 + "type": "array", 16 + "items": { 17 + "type": "ref", 18 + "ref": "tools.ozone.communication.defs#templateView" 19 + } 20 + } 21 + } 22 + } 23 + } 24 + } 25 + } 26 + }
+50
lexicons/tools/ozone/communication/updateTemplate.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.communication.updateTemplate", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Administrative action to update an existing communication template. Allows passing partial fields to patch specific fields only.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["id"], 13 + "properties": { 14 + "id": { 15 + "type": "string", 16 + "description": "ID of the template to be updated." 17 + }, 18 + "name": { 19 + "type": "string", 20 + "description": "Name of the template." 21 + }, 22 + "contentMarkdown": { 23 + "type": "string", 24 + "description": "Content of the template, markdown supported, can contain variable placeholders." 25 + }, 26 + "subject": { 27 + "type": "string", 28 + "description": "Subject of the message, used in emails." 29 + }, 30 + "updatedBy": { 31 + "type": "string", 32 + "format": "did", 33 + "description": "DID of the user who is updating the template." 34 + }, 35 + "disabled": { 36 + "type": "boolean" 37 + } 38 + } 39 + } 40 + }, 41 + "output": { 42 + "encoding": "application/json", 43 + "schema": { 44 + "type": "ref", 45 + "ref": "tools.ozone.communication.defs#templateView" 46 + } 47 + } 48 + } 49 + } 50 + }
+510
lexicons/tools/ozone/moderation/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.moderation.defs", 4 + "defs": { 5 + "modEventView": { 6 + "type": "object", 7 + "required": ["id", "event", "subject", "subjectBlobCids", "createdBy", "createdAt"], 8 + "properties": { 9 + "id": { "type": "integer" }, 10 + "event": { 11 + "type": "union", 12 + "refs": [ 13 + "#modEventTakedown", 14 + "#modEventReverseTakedown", 15 + "#modEventComment", 16 + "#modEventReport", 17 + "#modEventLabel", 18 + "#modEventAcknowledge", 19 + "#modEventEscalate", 20 + "#modEventMute", 21 + "#modEventUnmute", 22 + "#modEventMuteReporter", 23 + "#modEventUnmuteReporter", 24 + "#modEventEmail", 25 + "#modEventResolveAppeal", 26 + "#modEventDivert", 27 + "#modEventTag" 28 + ] 29 + }, 30 + "subject": { 31 + "type": "union", 32 + "refs": [ 33 + "com.atproto.admin.defs#repoRef", 34 + "com.atproto.repo.strongRef", 35 + "chat.bsky.convo.defs#messageRef" 36 + ] 37 + }, 38 + "subjectBlobCids": { "type": "array", "items": { "type": "string" } }, 39 + "createdBy": { "type": "string", "format": "did" }, 40 + "createdAt": { "type": "string", "format": "datetime" }, 41 + "creatorHandle": { "type": "string" }, 42 + "subjectHandle": { "type": "string" } 43 + } 44 + }, 45 + "modEventViewDetail": { 46 + "type": "object", 47 + "required": ["id", "event", "subject", "subjectBlobs", "createdBy", "createdAt"], 48 + "properties": { 49 + "id": { "type": "integer" }, 50 + "event": { 51 + "type": "union", 52 + "refs": [ 53 + "#modEventTakedown", 54 + "#modEventReverseTakedown", 55 + "#modEventComment", 56 + "#modEventReport", 57 + "#modEventLabel", 58 + "#modEventAcknowledge", 59 + "#modEventEscalate", 60 + "#modEventMute", 61 + "#modEventUnmute", 62 + "#modEventMuteReporter", 63 + "#modEventUnmuteReporter", 64 + "#modEventEmail", 65 + "#modEventResolveAppeal", 66 + "#modEventDivert", 67 + "#modEventTag" 68 + ] 69 + }, 70 + "subject": { 71 + "type": "union", 72 + "refs": ["#repoView", "#repoViewNotFound", "#recordView", "#recordViewNotFound"] 73 + }, 74 + "subjectBlobs": { 75 + "type": "array", 76 + "items": { "type": "ref", "ref": "#blobView" } 77 + }, 78 + "createdBy": { "type": "string", "format": "did" }, 79 + "createdAt": { "type": "string", "format": "datetime" } 80 + } 81 + }, 82 + "subjectStatusView": { 83 + "type": "object", 84 + "required": ["id", "subject", "createdAt", "updatedAt", "reviewState"], 85 + "properties": { 86 + "id": { "type": "integer" }, 87 + "subject": { 88 + "type": "union", 89 + "refs": ["com.atproto.admin.defs#repoRef", "com.atproto.repo.strongRef"] 90 + }, 91 + "subjectBlobCids": { 92 + "type": "array", 93 + "items": { "type": "string", "format": "cid" } 94 + }, 95 + "subjectRepoHandle": { "type": "string" }, 96 + "updatedAt": { 97 + "type": "string", 98 + "format": "datetime", 99 + "description": "Timestamp referencing when the last update was made to the moderation status of the subject" 100 + }, 101 + "createdAt": { 102 + "type": "string", 103 + "format": "datetime", 104 + "description": "Timestamp referencing the first moderation status impacting event was emitted on the subject" 105 + }, 106 + "reviewState": { 107 + "type": "ref", 108 + "ref": "#subjectReviewState" 109 + }, 110 + "comment": { 111 + "type": "string", 112 + "description": "Sticky comment on the subject." 113 + }, 114 + "muteUntil": { 115 + "type": "string", 116 + "format": "datetime" 117 + }, 118 + "muteReportingUntil": { 119 + "type": "string", 120 + "format": "datetime" 121 + }, 122 + "lastReviewedBy": { 123 + "type": "string", 124 + "format": "did" 125 + }, 126 + "lastReviewedAt": { 127 + "type": "string", 128 + "format": "datetime" 129 + }, 130 + "lastReportedAt": { 131 + "type": "string", 132 + "format": "datetime" 133 + }, 134 + "lastAppealedAt": { 135 + "type": "string", 136 + "format": "datetime", 137 + "description": "Timestamp referencing when the author of the subject appealed a moderation action" 138 + }, 139 + "takendown": { 140 + "type": "boolean" 141 + }, 142 + "appealed": { 143 + "type": "boolean", 144 + "description": "True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators." 145 + }, 146 + "suspendUntil": { 147 + "type": "string", 148 + "format": "datetime" 149 + }, 150 + "tags": { 151 + "type": "array", 152 + "items": { "type": "string" } 153 + } 154 + } 155 + }, 156 + "subjectReviewState": { 157 + "type": "string", 158 + "knownValues": ["#reviewOpen", "#reviewEscalated", "#reviewClosed", "#reviewNone"] 159 + }, 160 + "reviewOpen": { 161 + "type": "token", 162 + "description": "Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator" 163 + }, 164 + "reviewEscalated": { 165 + "type": "token", 166 + "description": "Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator" 167 + }, 168 + "reviewClosed": { 169 + "type": "token", 170 + "description": "Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator" 171 + }, 172 + "reviewNone": { 173 + "type": "token", 174 + "description": "Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it" 175 + }, 176 + "modEventTakedown": { 177 + "type": "object", 178 + "description": "Take down a subject permanently or temporarily", 179 + "properties": { 180 + "comment": { 181 + "type": "string" 182 + }, 183 + "durationInHours": { 184 + "type": "integer", 185 + "description": "Indicates how long the takedown should be in effect before automatically expiring." 186 + } 187 + } 188 + }, 189 + "modEventReverseTakedown": { 190 + "type": "object", 191 + "description": "Revert take down action on a subject", 192 + "properties": { 193 + "comment": { 194 + "type": "string", 195 + "description": "Describe reasoning behind the reversal." 196 + } 197 + } 198 + }, 199 + "modEventResolveAppeal": { 200 + "type": "object", 201 + "description": "Resolve appeal on a subject", 202 + "properties": { 203 + "comment": { 204 + "type": "string", 205 + "description": "Describe resolution." 206 + } 207 + } 208 + }, 209 + "modEventComment": { 210 + "type": "object", 211 + "description": "Add a comment to a subject", 212 + "required": ["comment"], 213 + "properties": { 214 + "comment": { 215 + "type": "string" 216 + }, 217 + "sticky": { 218 + "type": "boolean", 219 + "description": "Make the comment persistent on the subject" 220 + } 221 + } 222 + }, 223 + "modEventReport": { 224 + "type": "object", 225 + "description": "Report a subject", 226 + "required": ["reportType"], 227 + "properties": { 228 + "comment": { 229 + "type": "string" 230 + }, 231 + "isReporterMuted": { 232 + "type": "boolean", 233 + "description": "Set to true if the reporter was muted from reporting at the time of the event. These reports won't impact the reviewState of the subject." 234 + }, 235 + "reportType": { 236 + "type": "ref", 237 + "ref": "com.atproto.moderation.defs#reasonType" 238 + } 239 + } 240 + }, 241 + "modEventLabel": { 242 + "type": "object", 243 + "description": "Apply/Negate labels on a subject", 244 + "required": ["createLabelVals", "negateLabelVals"], 245 + "properties": { 246 + "comment": { 247 + "type": "string" 248 + }, 249 + "createLabelVals": { 250 + "type": "array", 251 + "items": { "type": "string" } 252 + }, 253 + "negateLabelVals": { 254 + "type": "array", 255 + "items": { "type": "string" } 256 + } 257 + } 258 + }, 259 + "modEventAcknowledge": { 260 + "type": "object", 261 + "properties": { 262 + "comment": { "type": "string" } 263 + } 264 + }, 265 + "modEventEscalate": { 266 + "type": "object", 267 + "properties": { 268 + "comment": { "type": "string" } 269 + } 270 + }, 271 + "modEventMute": { 272 + "type": "object", 273 + "description": "Mute incoming reports on a subject", 274 + "required": ["durationInHours"], 275 + "properties": { 276 + "comment": { "type": "string" }, 277 + "durationInHours": { 278 + "type": "integer", 279 + "description": "Indicates how long the subject should remain muted." 280 + } 281 + } 282 + }, 283 + "modEventUnmute": { 284 + "type": "object", 285 + "description": "Unmute action on a subject", 286 + "properties": { 287 + "comment": { 288 + "type": "string", 289 + "description": "Describe reasoning behind the reversal." 290 + } 291 + } 292 + }, 293 + "modEventMuteReporter": { 294 + "type": "object", 295 + "description": "Mute incoming reports from an account", 296 + "required": ["durationInHours"], 297 + "properties": { 298 + "comment": { "type": "string" }, 299 + "durationInHours": { 300 + "type": "integer", 301 + "description": "Indicates how long the account should remain muted." 302 + } 303 + } 304 + }, 305 + "modEventUnmuteReporter": { 306 + "type": "object", 307 + "description": "Unmute incoming reports from an account", 308 + "properties": { 309 + "comment": { 310 + "type": "string", 311 + "description": "Describe reasoning behind the reversal." 312 + } 313 + } 314 + }, 315 + "modEventEmail": { 316 + "type": "object", 317 + "description": "Keep a log of outgoing email to a user", 318 + "required": ["subjectLine"], 319 + "properties": { 320 + "subjectLine": { 321 + "type": "string", 322 + "description": "The subject line of the email sent to the user." 323 + }, 324 + "content": { 325 + "type": "string", 326 + "description": "The content of the email sent to the user." 327 + }, 328 + "comment": { 329 + "type": "string", 330 + "description": "Additional comment about the outgoing comm." 331 + } 332 + } 333 + }, 334 + "modEventDivert": { 335 + "type": "object", 336 + "description": "Divert a record's blobs to a 3rd party service for further scanning/tagging", 337 + "properties": { 338 + "comment": { "type": "string" } 339 + } 340 + }, 341 + "modEventTag": { 342 + "type": "object", 343 + "description": "Add/Remove a tag on a subject", 344 + "required": ["add", "remove"], 345 + "properties": { 346 + "add": { 347 + "type": "array", 348 + "items": { "type": "string" }, 349 + "description": "Tags to be added to the subject. If already exists, won't be duplicated." 350 + }, 351 + "remove": { 352 + "type": "array", 353 + "items": { "type": "string" }, 354 + "description": "Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated." 355 + }, 356 + "comment": { 357 + "type": "string", 358 + "description": "Additional comment about added/removed tags." 359 + } 360 + } 361 + }, 362 + "repoView": { 363 + "type": "object", 364 + "required": ["did", "handle", "relatedRecords", "indexedAt", "moderation"], 365 + "properties": { 366 + "did": { "type": "string", "format": "did" }, 367 + "handle": { "type": "string", "format": "handle" }, 368 + "email": { "type": "string" }, 369 + "relatedRecords": { "type": "array", "items": { "type": "unknown" } }, 370 + "indexedAt": { "type": "string", "format": "datetime" }, 371 + "moderation": { "type": "ref", "ref": "#moderation" }, 372 + "invitedBy": { 373 + "type": "ref", 374 + "ref": "com.atproto.server.defs#inviteCode" 375 + }, 376 + "invitesDisabled": { "type": "boolean" }, 377 + "inviteNote": { "type": "string" }, 378 + "deactivatedAt": { "type": "string", "format": "datetime" } 379 + } 380 + }, 381 + "repoViewDetail": { 382 + "type": "object", 383 + "required": ["did", "handle", "relatedRecords", "indexedAt", "moderation"], 384 + "properties": { 385 + "did": { "type": "string", "format": "did" }, 386 + "handle": { "type": "string", "format": "handle" }, 387 + "email": { "type": "string" }, 388 + "relatedRecords": { "type": "array", "items": { "type": "unknown" } }, 389 + "indexedAt": { "type": "string", "format": "datetime" }, 390 + "moderation": { "type": "ref", "ref": "#moderationDetail" }, 391 + "labels": { 392 + "type": "array", 393 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 394 + }, 395 + "invitedBy": { 396 + "type": "ref", 397 + "ref": "com.atproto.server.defs#inviteCode" 398 + }, 399 + "invites": { 400 + "type": "array", 401 + "items": { 402 + "type": "ref", 403 + "ref": "com.atproto.server.defs#inviteCode" 404 + } 405 + }, 406 + "invitesDisabled": { "type": "boolean" }, 407 + "inviteNote": { "type": "string" }, 408 + "emailConfirmedAt": { "type": "string", "format": "datetime" }, 409 + "deactivatedAt": { "type": "string", "format": "datetime" } 410 + } 411 + }, 412 + "repoViewNotFound": { 413 + "type": "object", 414 + "required": ["did"], 415 + "properties": { 416 + "did": { "type": "string", "format": "did" } 417 + } 418 + }, 419 + "recordView": { 420 + "type": "object", 421 + "required": ["uri", "cid", "value", "blobCids", "indexedAt", "moderation", "repo"], 422 + "properties": { 423 + "uri": { "type": "string", "format": "at-uri" }, 424 + "cid": { "type": "string", "format": "cid" }, 425 + "value": { "type": "unknown" }, 426 + "blobCids": { 427 + "type": "array", 428 + "items": { "type": "string", "format": "cid" } 429 + }, 430 + "indexedAt": { "type": "string", "format": "datetime" }, 431 + "moderation": { "type": "ref", "ref": "#moderation" }, 432 + "repo": { "type": "ref", "ref": "#repoView" } 433 + } 434 + }, 435 + "recordViewDetail": { 436 + "type": "object", 437 + "required": ["uri", "cid", "value", "blobs", "indexedAt", "moderation", "repo"], 438 + "properties": { 439 + "uri": { "type": "string", "format": "at-uri" }, 440 + "cid": { "type": "string", "format": "cid" }, 441 + "value": { "type": "unknown" }, 442 + "blobs": { 443 + "type": "array", 444 + "items": { "type": "ref", "ref": "#blobView" } 445 + }, 446 + "labels": { 447 + "type": "array", 448 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 449 + }, 450 + "indexedAt": { "type": "string", "format": "datetime" }, 451 + "moderation": { "type": "ref", "ref": "#moderationDetail" }, 452 + "repo": { "type": "ref", "ref": "#repoView" } 453 + } 454 + }, 455 + "recordViewNotFound": { 456 + "type": "object", 457 + "required": ["uri"], 458 + "properties": { 459 + "uri": { "type": "string", "format": "at-uri" } 460 + } 461 + }, 462 + "moderation": { 463 + "type": "object", 464 + "properties": { 465 + "subjectStatus": { "type": "ref", "ref": "#subjectStatusView" } 466 + } 467 + }, 468 + "moderationDetail": { 469 + "type": "object", 470 + "properties": { 471 + "subjectStatus": { 472 + "type": "ref", 473 + "ref": "#subjectStatusView" 474 + } 475 + } 476 + }, 477 + "blobView": { 478 + "type": "object", 479 + "required": ["cid", "mimeType", "size", "createdAt"], 480 + "properties": { 481 + "cid": { "type": "string", "format": "cid" }, 482 + "mimeType": { "type": "string" }, 483 + "size": { "type": "integer" }, 484 + "createdAt": { "type": "string", "format": "datetime" }, 485 + "details": { 486 + "type": "union", 487 + "refs": ["#imageDetails", "#videoDetails"] 488 + }, 489 + "moderation": { "type": "ref", "ref": "#moderation" } 490 + } 491 + }, 492 + "imageDetails": { 493 + "type": "object", 494 + "required": ["width", "height"], 495 + "properties": { 496 + "width": { "type": "integer" }, 497 + "height": { "type": "integer" } 498 + } 499 + }, 500 + "videoDetails": { 501 + "type": "object", 502 + "required": ["width", "height", "length"], 503 + "properties": { 504 + "width": { "type": "integer" }, 505 + "height": { "type": "integer" }, 506 + "length": { "type": "integer" } 507 + } 508 + } 509 + } 510 + }
+54
lexicons/tools/ozone/moderation/emitEvent.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.moderation.emitEvent", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Take a moderation action on an actor.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["event", "subject", "createdBy"], 13 + "properties": { 14 + "event": { 15 + "type": "union", 16 + "refs": [ 17 + "tools.ozone.moderation.defs#modEventTakedown", 18 + "tools.ozone.moderation.defs#modEventAcknowledge", 19 + "tools.ozone.moderation.defs#modEventEscalate", 20 + "tools.ozone.moderation.defs#modEventComment", 21 + "tools.ozone.moderation.defs#modEventLabel", 22 + "tools.ozone.moderation.defs#modEventReport", 23 + "tools.ozone.moderation.defs#modEventMute", 24 + "tools.ozone.moderation.defs#modEventUnmute", 25 + "tools.ozone.moderation.defs#modEventMuteReporter", 26 + "tools.ozone.moderation.defs#modEventUnmuteReporter", 27 + "tools.ozone.moderation.defs#modEventReverseTakedown", 28 + "tools.ozone.moderation.defs#modEventEmail", 29 + "tools.ozone.moderation.defs#modEventTag" 30 + ] 31 + }, 32 + "subject": { 33 + "type": "union", 34 + "refs": ["com.atproto.admin.defs#repoRef", "com.atproto.repo.strongRef"] 35 + }, 36 + "subjectBlobCids": { 37 + "type": "array", 38 + "items": { "type": "string", "format": "cid" } 39 + }, 40 + "createdBy": { "type": "string", "format": "did" } 41 + } 42 + } 43 + }, 44 + "output": { 45 + "encoding": "application/json", 46 + "schema": { 47 + "type": "ref", 48 + "ref": "tools.ozone.moderation.defs#modEventView" 49 + } 50 + }, 51 + "errors": [{ "name": "SubjectHasAction" }] 52 + } 53 + } 54 + }
+24
lexicons/tools/ozone/moderation/getEvent.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.moderation.getEvent", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get details about a moderation event.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["id"], 11 + "properties": { 12 + "id": { "type": "integer" } 13 + } 14 + }, 15 + "output": { 16 + "encoding": "application/json", 17 + "schema": { 18 + "type": "ref", 19 + "ref": "tools.ozone.moderation.defs#modEventViewDetail" 20 + } 21 + } 22 + } 23 + } 24 + }
+26
lexicons/tools/ozone/moderation/getRecord.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.moderation.getRecord", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get details about a record.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["uri"], 11 + "properties": { 12 + "uri": { "type": "string", "format": "at-uri" }, 13 + "cid": { "type": "string", "format": "cid" } 14 + } 15 + }, 16 + "output": { 17 + "encoding": "application/json", 18 + "schema": { 19 + "type": "ref", 20 + "ref": "tools.ozone.moderation.defs#recordViewDetail" 21 + } 22 + }, 23 + "errors": [{ "name": "RecordNotFound" }] 24 + } 25 + } 26 + }
+25
lexicons/tools/ozone/moderation/getRepo.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.moderation.getRepo", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get details about a repository.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["did"], 11 + "properties": { 12 + "did": { "type": "string", "format": "did" } 13 + } 14 + }, 15 + "output": { 16 + "encoding": "application/json", 17 + "schema": { 18 + "type": "ref", 19 + "ref": "tools.ozone.moderation.defs#repoViewDetail" 20 + } 21 + }, 22 + "errors": [{ "name": "RepoNotFound" }] 23 + } 24 + } 25 + }
+104
lexicons/tools/ozone/moderation/queryEvents.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.moderation.queryEvents", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "List moderation events related to a subject.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "types": { 12 + "type": "array", 13 + "items": { "type": "string" }, 14 + "description": "The types of events (fully qualified string in the format of tools.ozone.moderation.defs#modEvent<name>) to filter by. If not specified, all events are returned." 15 + }, 16 + "createdBy": { 17 + "type": "string", 18 + "format": "did" 19 + }, 20 + "sortDirection": { 21 + "type": "string", 22 + "default": "desc", 23 + "enum": ["asc", "desc"], 24 + "description": "Sort direction for the events. Defaults to descending order of created at timestamp." 25 + }, 26 + "createdAfter": { 27 + "type": "string", 28 + "format": "datetime", 29 + "description": "Retrieve events created after a given timestamp" 30 + }, 31 + "createdBefore": { 32 + "type": "string", 33 + "format": "datetime", 34 + "description": "Retrieve events created before a given timestamp" 35 + }, 36 + "subject": { "type": "string", "format": "uri" }, 37 + "includeAllUserRecords": { 38 + "type": "boolean", 39 + "default": false, 40 + "description": "If true, events on all record types (posts, lists, profile etc.) owned by the did are returned" 41 + }, 42 + "limit": { 43 + "type": "integer", 44 + "minimum": 1, 45 + "maximum": 100, 46 + "default": 50 47 + }, 48 + "hasComment": { 49 + "type": "boolean", 50 + "description": "If true, only events with comments are returned" 51 + }, 52 + "comment": { 53 + "type": "string", 54 + "description": "If specified, only events with comments containing the keyword are returned" 55 + }, 56 + "addedLabels": { 57 + "type": "array", 58 + "items": { "type": "string" }, 59 + "description": "If specified, only events where all of these labels were added are returned" 60 + }, 61 + "removedLabels": { 62 + "type": "array", 63 + "items": { "type": "string" }, 64 + "description": "If specified, only events where all of these labels were removed are returned" 65 + }, 66 + "addedTags": { 67 + "type": "array", 68 + "items": { "type": "string" }, 69 + "description": "If specified, only events where all of these tags were added are returned" 70 + }, 71 + "removedTags": { 72 + "type": "array", 73 + "items": { "type": "string" }, 74 + "description": "If specified, only events where all of these tags were removed are returned" 75 + }, 76 + "reportTypes": { 77 + "type": "array", 78 + "items": { 79 + "type": "string" 80 + } 81 + }, 82 + "cursor": { "type": "string" } 83 + } 84 + }, 85 + "output": { 86 + "encoding": "application/json", 87 + "schema": { 88 + "type": "object", 89 + "required": ["events"], 90 + "properties": { 91 + "cursor": { "type": "string" }, 92 + "events": { 93 + "type": "array", 94 + "items": { 95 + "type": "ref", 96 + "ref": "tools.ozone.moderation.defs#modEventView" 97 + } 98 + } 99 + } 100 + } 101 + } 102 + } 103 + } 104 + }
+111
lexicons/tools/ozone/moderation/queryStatuses.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.moderation.queryStatuses", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "View moderation statuses of subjects (record or repo).", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "subject": { "type": "string", "format": "uri" }, 12 + "comment": { 13 + "type": "string", 14 + "description": "Search subjects by keyword from comments" 15 + }, 16 + "reportedAfter": { 17 + "type": "string", 18 + "format": "datetime", 19 + "description": "Search subjects reported after a given timestamp" 20 + }, 21 + "reportedBefore": { 22 + "type": "string", 23 + "format": "datetime", 24 + "description": "Search subjects reported before a given timestamp" 25 + }, 26 + "reviewedAfter": { 27 + "type": "string", 28 + "format": "datetime", 29 + "description": "Search subjects reviewed after a given timestamp" 30 + }, 31 + "reviewedBefore": { 32 + "type": "string", 33 + "format": "datetime", 34 + "description": "Search subjects reviewed before a given timestamp" 35 + }, 36 + "includeMuted": { 37 + "type": "boolean", 38 + "description": "By default, we don't include muted subjects in the results. Set this to true to include them." 39 + }, 40 + "onlyMuted": { 41 + "type": "boolean", 42 + "description": "When set to true, only muted subjects and reporters will be returned." 43 + }, 44 + "reviewState": { 45 + "type": "string", 46 + "description": "Specify when fetching subjects in a certain state" 47 + }, 48 + "ignoreSubjects": { 49 + "type": "array", 50 + "items": { "type": "string", "format": "uri" } 51 + }, 52 + "lastReviewedBy": { 53 + "type": "string", 54 + "format": "did", 55 + "description": "Get all subject statuses that were reviewed by a specific moderator" 56 + }, 57 + "sortField": { 58 + "type": "string", 59 + "default": "lastReportedAt", 60 + "enum": ["lastReviewedAt", "lastReportedAt"] 61 + }, 62 + "sortDirection": { 63 + "type": "string", 64 + "default": "desc", 65 + "enum": ["asc", "desc"] 66 + }, 67 + "takendown": { 68 + "type": "boolean", 69 + "description": "Get subjects that were taken down" 70 + }, 71 + "appealed": { 72 + "type": "boolean", 73 + "description": "Get subjects in unresolved appealed status" 74 + }, 75 + "limit": { 76 + "type": "integer", 77 + "minimum": 1, 78 + "maximum": 100, 79 + "default": 50 80 + }, 81 + "tags": { 82 + "type": "array", 83 + "items": { "type": "string" } 84 + }, 85 + "excludeTags": { 86 + "type": "array", 87 + "items": { "type": "string" } 88 + }, 89 + "cursor": { "type": "string" } 90 + } 91 + }, 92 + "output": { 93 + "encoding": "application/json", 94 + "schema": { 95 + "type": "object", 96 + "required": ["subjectStatuses"], 97 + "properties": { 98 + "cursor": { "type": "string" }, 99 + "subjectStatuses": { 100 + "type": "array", 101 + "items": { 102 + "type": "ref", 103 + "ref": "tools.ozone.moderation.defs#subjectStatusView" 104 + } 105 + } 106 + } 107 + } 108 + } 109 + } 110 + } 111 + }
+44
lexicons/tools/ozone/moderation/searchRepos.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.moderation.searchRepos", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Find repositories based on a search term.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "term": { 12 + "type": "string", 13 + "description": "DEPRECATED: use 'q' instead" 14 + }, 15 + "q": { "type": "string" }, 16 + "limit": { 17 + "type": "integer", 18 + "minimum": 1, 19 + "maximum": 100, 20 + "default": 50 21 + }, 22 + "cursor": { "type": "string" } 23 + } 24 + }, 25 + "output": { 26 + "encoding": "application/json", 27 + "schema": { 28 + "type": "object", 29 + "required": ["repos"], 30 + "properties": { 31 + "cursor": { "type": "string" }, 32 + "repos": { 33 + "type": "array", 34 + "items": { 35 + "type": "ref", 36 + "ref": "tools.ozone.moderation.defs#repoView" 37 + } 38 + } 39 + } 40 + } 41 + } 42 + } 43 + } 44 + }
+60
lexicons/tools/ozone/server/getConfig.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.server.getConfig", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get details about ozone's server configuration.", 8 + "output": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "properties": { 13 + "appview": { 14 + "type": "ref", 15 + "ref": "#serviceConfig" 16 + }, 17 + "pds": { 18 + "type": "ref", 19 + "ref": "#serviceConfig" 20 + }, 21 + "blobDivert": { 22 + "type": "ref", 23 + "ref": "#serviceConfig" 24 + }, 25 + "chat": { 26 + "type": "ref", 27 + "ref": "#serviceConfig" 28 + }, 29 + "viewer": { 30 + "type": "ref", 31 + "ref": "#viewerConfig" 32 + } 33 + } 34 + } 35 + } 36 + }, 37 + "serviceConfig": { 38 + "type": "object", 39 + "properties": { 40 + "url": { 41 + "type": "string", 42 + "format": "uri" 43 + } 44 + } 45 + }, 46 + "viewerConfig": { 47 + "type": "object", 48 + "properties": { 49 + "role": { 50 + "type": "string", 51 + "knownValues": [ 52 + "tools.ozone.team.defs#roleAdmin", 53 + "tools.ozone.team.defs#roleModerator", 54 + "tools.ozone.team.defs#roleTriage" 55 + ] 56 + } 57 + } 58 + } 59 + } 60 + }
+41
lexicons/tools/ozone/team/addMember.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.team.addMember", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Add a member to the ozone team. Requires admin role.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["did", "role"], 13 + "properties": { 14 + "did": { "type": "string", "format": "did" }, 15 + "role": { 16 + "type": "string", 17 + "knownValues": [ 18 + "tools.ozone.team.defs#roleAdmin", 19 + "tools.ozone.team.defs#roleModerator", 20 + "tools.ozone.team.defs#roleTriage" 21 + ] 22 + } 23 + } 24 + } 25 + }, 26 + "output": { 27 + "encoding": "application/json", 28 + "schema": { 29 + "type": "ref", 30 + "ref": "tools.ozone.team.defs#member" 31 + } 32 + }, 33 + "errors": [ 34 + { 35 + "name": "MemberAlreadyExists", 36 + "description": "Member already exists in the team." 37 + } 38 + ] 39 + } 40 + } 41 + }
+37
lexicons/tools/ozone/team/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.team.defs", 4 + "defs": { 5 + "member": { 6 + "type": "object", 7 + "required": ["did", "role"], 8 + "properties": { 9 + "did": { "type": "string", "format": "did" }, 10 + "disabled": { "type": "boolean" }, 11 + "profile": { 12 + "type": "ref", 13 + "ref": "app.bsky.actor.defs#profileViewDetailed" 14 + }, 15 + "createdAt": { "type": "string", "format": "datetime" }, 16 + "updatedAt": { "type": "string", "format": "datetime" }, 17 + "lastUpdatedBy": { "type": "string" }, 18 + "role": { 19 + "type": "string", 20 + "knownValues": ["#roleAdmin", "#roleModerator", "#roleTriage"] 21 + } 22 + } 23 + }, 24 + "roleAdmin": { 25 + "type": "token", 26 + "description": "Admin role. Highest level of access, can perform all actions." 27 + }, 28 + "roleModerator": { 29 + "type": "token", 30 + "description": "Moderator role. Can perform most actions." 31 + }, 32 + "roleTriage": { 33 + "type": "token", 34 + "description": "Triage role. Mostly intended for monitoring and escalating issues." 35 + } 36 + } 37 + }
+30
lexicons/tools/ozone/team/deleteMember.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.team.deleteMember", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Delete a member from ozone team. Requires admin role.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["did"], 13 + "properties": { 14 + "did": { "type": "string", "format": "did" } 15 + } 16 + } 17 + }, 18 + "errors": [ 19 + { 20 + "name": "MemberNotFound", 21 + "description": "The member being deleted does not exist" 22 + }, 23 + { 24 + "name": "CannotDeleteSelf", 25 + "description": "You can not delete yourself from the team" 26 + } 27 + ] 28 + } 29 + } 30 + }
+39
lexicons/tools/ozone/team/listMembers.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.team.listMembers", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "List all members with access to the ozone service.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "limit": { 12 + "type": "integer", 13 + "minimum": 1, 14 + "maximum": 100, 15 + "default": 50 16 + }, 17 + "cursor": { "type": "string" } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "object", 24 + "required": ["members"], 25 + "properties": { 26 + "cursor": { "type": "string" }, 27 + "members": { 28 + "type": "array", 29 + "items": { 30 + "type": "ref", 31 + "ref": "tools.ozone.team.defs#member" 32 + } 33 + } 34 + } 35 + } 36 + } 37 + } 38 + } 39 + }
+42
lexicons/tools/ozone/team/updateMember.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "tools.ozone.team.updateMember", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Update a member in the ozone service. Requires admin role.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["did"], 13 + "properties": { 14 + "did": { "type": "string", "format": "did" }, 15 + "disabled": { "type": "boolean" }, 16 + "role": { 17 + "type": "string", 18 + "knownValues": [ 19 + "tools.ozone.team.defs#roleAdmin", 20 + "tools.ozone.team.defs#roleModerator", 21 + "tools.ozone.team.defs#roleTriage" 22 + ] 23 + } 24 + } 25 + } 26 + }, 27 + "output": { 28 + "encoding": "application/json", 29 + "schema": { 30 + "type": "ref", 31 + "ref": "tools.ozone.team.defs#member" 32 + } 33 + }, 34 + "errors": [ 35 + { 36 + "name": "MemberNotFound", 37 + "description": "The member being updated does not exist in the team" 38 + } 39 + ] 40 + } 41 + } 42 + }
+12
package.json
··· 1 + { 2 + "type": "module", 3 + "scripts": { 4 + "pull": "node ./scripts/pull-lexicons.js", 5 + "fmt": "prettier --cache --write ." 6 + }, 7 + "devDependencies": { 8 + "@mary/tar": "npm:@jsr/mary__tar@^0.2.4", 9 + "prettier": "^3.3.3", 10 + "typescript": "5.6.0-beta" 11 + } 12 + }
+335
packages/client/lib/index.ts
··· 1 + /** 2 + * @module 3 + * Handles the actual XRPC client functionalities. 4 + */ 5 + 6 + import type { At, Procedures, Queries } from './lexicons.ts'; 7 + 8 + export type Headers = Record<string, string>; 9 + 10 + /** Possible response status from an XRPC service, status <100 is used for the library itself. */ 11 + export const enum ResponseType { 12 + /** Unknown error from the library */ 13 + Unknown = 1, 14 + /** The server returned an invalid response */ 15 + InvalidResponse = 2, 16 + 17 + /** Successful response from the service */ 18 + Success = 200, 19 + /** Request was considered invalid by the service */ 20 + InvalidRequest = 400, 21 + /** Service requires an authentication token */ 22 + AuthRequired = 401, 23 + /** Request is forbidden by the service */ 24 + Forbidden = 403, 25 + /** Not a XRPC service */ 26 + XRPCNotSupported = 404, 27 + /** Payload is considered too large by the service */ 28 + PayloadTooLarge = 413, 29 + /** Ratelimit was exceeded */ 30 + RateLimitExceeded = 429, 31 + /** Internal server error */ 32 + InternalServerError = 500, 33 + /** Method hasn't been implemented */ 34 + MethodNotImplemented = 501, 35 + /** Failure by an upstream service */ 36 + UpstreamFailure = 502, 37 + /** Not enough resources */ 38 + NotEnoughResouces = 503, 39 + /** Timeout from upstream service */ 40 + UpstreamTimeout = 504, 41 + } 42 + 43 + /** XRPC response status which are recoverable (network error) */ 44 + export const RECOVERABLE_RESPONSE_STATUS: number[] = [1, 408, 425, 429, 500, 502, 503, 504, 522, 524]; 45 + 46 + /** Request type, either query (GET) or procedure (POST) */ 47 + export type RequestType = 'get' | 'post'; 48 + 49 + /** XRPC that gets passed around middlewares and eventually to the service. */ 50 + export interface XRPCRequest { 51 + service: string; 52 + type: RequestType; 53 + nsid: string; 54 + headers: Headers; 55 + params: Record<string, unknown>; 56 + encoding?: string; 57 + data?: FormData | Blob | ArrayBufferView | Record<string, unknown>; 58 + signal?: AbortSignal; 59 + } 60 + 61 + /** Response from XRPC service */ 62 + export interface XRPCResponse<T = any> { 63 + data: T; 64 + headers: Headers; 65 + } 66 + 67 + /** Options for constructing an XRPC error */ 68 + export interface XRPCErrorOptions { 69 + kind?: string; 70 + message?: string; 71 + headers?: Headers; 72 + cause?: unknown; 73 + } 74 + 75 + /** Error coming from the XRPC service */ 76 + export class XRPCError extends Error { 77 + override name = 'XRPCError'; 78 + 79 + /** Response status */ 80 + status: number; 81 + /** Response headers */ 82 + headers: Headers; 83 + /** Error kind */ 84 + kind?: string; 85 + 86 + constructor(status: number, { kind, message, headers, cause }: XRPCErrorOptions = {}) { 87 + super(message || `Unspecified error message`, { cause }); 88 + 89 + this.status = status; 90 + this.kind = kind; 91 + this.headers = headers || {}; 92 + } 93 + } 94 + 95 + /** Response returned from middlewares and XRPC service */ 96 + export interface XRPCFetchReturn { 97 + status: number; 98 + headers: Headers; 99 + body: unknown; 100 + } 101 + 102 + /** Fetch function */ 103 + export type XRPCFetch = (req: XRPCRequest) => Promise<XRPCFetchReturn>; 104 + /** Function that constructs a middleware */ 105 + export type XRPCHook = (next: XRPCFetch) => XRPCFetch; 106 + 107 + /** Options for constructing an XRPC class */ 108 + export interface XRPCOptions { 109 + service: string; 110 + } 111 + 112 + /** Base options for the query/procedure request */ 113 + interface BaseRPCOptions { 114 + /** `Content-Type` encoding for the input, defaults to `application/json` if passing a JSON object */ 115 + encoding?: string; 116 + /** Request headers to make */ 117 + headers?: Headers; 118 + /** Signal for aborting the request */ 119 + signal?: AbortSignal; 120 + } 121 + 122 + /** Options for the query/procedure request */ 123 + export type RPCOptions<T> = BaseRPCOptions & 124 + (T extends { params: any } ? { params: T['params'] } : {}) & 125 + (T extends { input: any } ? { data: T['input'] } : {}); 126 + 127 + type OutputOf<T> = T extends { output: any } ? T['output'] : never; 128 + type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>; 129 + 130 + /** The client that sends out requests. */ 131 + export class XRPC { 132 + /** The service it should connect to */ 133 + service: string; 134 + /** XRPC fetch handler */ 135 + fetch: XRPCFetch = fetchHandler; 136 + 137 + constructor(options: XRPCOptions) { 138 + this.service = options.service; 139 + } 140 + 141 + /** 142 + * Adds a hook to intercept XRPC requests. 143 + * Hooks are executed from last-registered to first-registered 144 + * @param fn Hook function 145 + */ 146 + hook(fn: XRPCHook) { 147 + this.fetch = fn(this.fetch); 148 + } 149 + 150 + /** 151 + * Makes a query (GET) request 152 + * @param nsid Namespace ID of a query endpoint 153 + * @param options Options to include like parameters 154 + * @returns The response of the request 155 + */ 156 + get<K extends keyof Queries>( 157 + nsid: K, 158 + options: RPCOptions<Queries[K]>, 159 + ): Promise<XRPCResponse<OutputOf<Queries[K]>>> { 160 + return this.#call({ type: 'get', nsid: nsid as any, ...(options as any) }); 161 + } 162 + 163 + /** 164 + * Makes a procedure (POST) request 165 + * @param nsid Namespace ID of a procedure endpoint 166 + * @param options Options to include like input body or parameters 167 + * @returns The response of the request 168 + */ 169 + call<K extends keyof Procedures>( 170 + nsid: K, 171 + options: RPCOptions<Procedures[K]>, 172 + ): Promise<XRPCResponse<OutputOf<Procedures[K]>>> { 173 + return this.#call({ type: 'post', nsid: nsid as any, ...(options as any) }); 174 + } 175 + 176 + async #call(request: PartialBy<Omit<XRPCRequest, 'service'>, 'headers' | 'params'>): Promise<XRPCResponse> { 177 + const { status, headers, body } = await this.fetch({ 178 + ...request, 179 + service: this.service, 180 + headers: request.headers === undefined ? {} : request.headers, 181 + params: request.params === undefined ? {} : request.params, 182 + }); 183 + 184 + if (status === ResponseType.Success) { 185 + return { data: body, headers: headers }; 186 + } else if (isErrorResponse(body)) { 187 + throw new XRPCError(status, { kind: body.error, message: body.message, headers }); 188 + } else { 189 + throw new XRPCError(status, { headers }); 190 + } 191 + } 192 + } 193 + 194 + /** 195 + * Clones an XRPC instance 196 + * @param rpc Base instance 197 + * @returns The cloned instance 198 + */ 199 + export const clone = (rpc: XRPC): XRPC => { 200 + const cloned = new XRPC({ service: rpc.service }); 201 + cloned.fetch = rpc.fetch; 202 + 203 + return cloned; 204 + }; 205 + 206 + /** 207 + * Clones an existing XRPC instance, with a proxy on top. 208 + * @param rpc Base instance 209 + * @param opts Proxying options 210 + * @returns Cloned instance with a proxy added 211 + */ 212 + export const withProxy = (rpc: XRPC, opts: ProxyOptions): XRPC => { 213 + const cloned = clone(rpc); 214 + 215 + cloned.hook((next) => (request) => { 216 + return next({ 217 + ...request, 218 + headers: { 219 + ...request.headers, 220 + 'atproto-proxy': `${opts.service}#${opts.type}`, 221 + }, 222 + }); 223 + }); 224 + 225 + return cloned; 226 + }; 227 + 228 + /** Known endpoint types for proxying */ 229 + export type ProxyType = 'atproto_labeler' | 'bsky_fg'; 230 + 231 + /** Options for proxying a request */ 232 + export interface ProxyOptions { 233 + /** Service it should proxy requests to */ 234 + service: At.DID; 235 + /** The endpoint to connect */ 236 + type: ProxyType | (string & {}); 237 + } 238 + 239 + /** Default fetch handler */ 240 + export const fetchHandler: XRPCFetch = async ({ 241 + service, 242 + type, 243 + nsid, 244 + headers, 245 + params, 246 + encoding, 247 + data: input, 248 + signal, 249 + }) => { 250 + const uri = new URL(`/xrpc/${nsid}`, service); 251 + const searchParams = uri.searchParams; 252 + 253 + for (const key in params) { 254 + const value = params[key]; 255 + 256 + if (value !== undefined) { 257 + if (Array.isArray(value)) { 258 + for (let idx = 0, len = value.length; idx < len; idx++) { 259 + const val = value[idx]; 260 + searchParams.append(key, val); 261 + } 262 + } else { 263 + searchParams.set(key, value as any); 264 + } 265 + } 266 + } 267 + 268 + const isProcedure = type === 'post'; 269 + const isJson = 270 + typeof input === 'object' && 271 + !(input instanceof FormData || input instanceof Blob || ArrayBuffer.isView(input)); 272 + 273 + const response = await fetch(uri, { 274 + signal: signal, 275 + method: isProcedure ? 'POST' : 'GET', 276 + headers: encoding || isJson ? { ...headers, 'Content-Type': encoding || 'application/json' } : headers, 277 + body: isJson ? JSON.stringify(input) : (input as FormData | Blob | ArrayBufferView | undefined), 278 + }); 279 + 280 + const responseHeaders = response.headers; 281 + const responseType = responseHeaders.get('Content-Type'); 282 + 283 + let promise: Promise<unknown> | undefined; 284 + let data: unknown; 285 + 286 + if (responseType) { 287 + if (responseType.startsWith('application/json')) { 288 + promise = response.json(); 289 + } else if (responseType.startsWith('text/')) { 290 + promise = response.text(); 291 + } 292 + } 293 + 294 + try { 295 + data = await (promise || response.arrayBuffer().then((buffer) => new Uint8Array(buffer))); 296 + } catch (err) { 297 + throw new XRPCError(ResponseType.InvalidResponse, { 298 + cause: err, 299 + message: `Failed to parse response body`, 300 + }); 301 + } 302 + 303 + return { 304 + status: response.status, 305 + headers: Object.fromEntries(responseHeaders), 306 + body: data, 307 + }; 308 + }; 309 + 310 + /** 311 + * Check if provided value is an error object 312 + * @param value Response value 313 + * @param names If provided, also checks if the error name matches what you expect 314 + * @returns A boolean on the check 315 + */ 316 + export const isErrorResponse = (value: any, names?: string[]): value is ErrorResponseBody => { 317 + if (typeof value !== 'object' || !value) { 318 + return false; 319 + } 320 + 321 + const kindType = typeof value.error; 322 + const messageType = typeof value.message; 323 + 324 + return ( 325 + (kindType === 'undefined' || kindType === 'string') && 326 + (messageType === 'undefined' || messageType === 'string') && 327 + (!names || names.includes(value.error)) 328 + ); 329 + }; 330 + 331 + /** Response body from a thrown query/procedure */ 332 + export interface ErrorResponseBody { 333 + error?: string; 334 + message?: string; 335 + }
+1813
packages/client/lib/lexicons.ts
··· 1 + /* eslint-disable */ 2 + // This file is automatically generated, do not edit! 3 + 4 + /** 5 + * @module 6 + * Contains type declarations for AT Protocol lexicons 7 + */ 8 + 9 + type ObjectOmit<T, K extends keyof any> = Omit<T, K>; 10 + 11 + /** Handles type branding in objects */ 12 + export declare namespace Brand { 13 + /** Symbol used to brand objects, this does not actually exist in runtime */ 14 + const Type: unique symbol; 15 + 16 + /** Get the intended `$type` field */ 17 + type GetType<T extends { [Type]?: string }> = NonNullable<T[typeof Type]>; 18 + 19 + /** Creates a union of objects where it's discriminated by `$type` field. */ 20 + type Union<T extends { [Type]?: string }> = T extends any ? T & { $type: GetType<T> } : never; 21 + 22 + /** Omits the type branding from object */ 23 + type Omit<T extends { [Type]?: string }> = ObjectOmit<T, typeof Type>; 24 + } 25 + 26 + /** Base AT Protocol schema types */ 27 + export declare namespace At { 28 + /** CID string */ 29 + type CID = string; 30 + 31 + /** DID of a user */ 32 + type DID = `did:${string}`; 33 + 34 + /** User handle */ 35 + type Handle = string; 36 + 37 + /** URI string */ 38 + type Uri = string; 39 + 40 + /** Object containing a CID string */ 41 + interface CIDLink { 42 + $link: CID; 43 + } 44 + 45 + /** Object containing a base64-encoded bytes */ 46 + interface Bytes { 47 + $bytes: string; 48 + } 49 + 50 + /** Blob interface */ 51 + interface Blob<T extends string = string> { 52 + $type: 'blob'; 53 + mimeType: T; 54 + ref: { 55 + $link: string; 56 + }; 57 + size: number; 58 + } 59 + } 60 + export declare namespace ComAtprotoAdminDefs { 61 + interface AccountView { 62 + [Brand.Type]?: 'com.atproto.admin.defs#accountView'; 63 + did: At.DID; 64 + handle: At.Handle; 65 + indexedAt: string; 66 + deactivatedAt?: string; 67 + email?: string; 68 + emailConfirmedAt?: string; 69 + invitedBy?: ComAtprotoServerDefs.InviteCode; 70 + inviteNote?: string; 71 + invites?: ComAtprotoServerDefs.InviteCode[]; 72 + invitesDisabled?: boolean; 73 + relatedRecords?: unknown[]; 74 + } 75 + interface RepoBlobRef { 76 + [Brand.Type]?: 'com.atproto.admin.defs#repoBlobRef'; 77 + cid: At.CID; 78 + did: At.DID; 79 + recordUri?: At.Uri; 80 + } 81 + interface RepoRef { 82 + [Brand.Type]?: 'com.atproto.admin.defs#repoRef'; 83 + did: At.DID; 84 + } 85 + interface StatusAttr { 86 + [Brand.Type]?: 'com.atproto.admin.defs#statusAttr'; 87 + applied: boolean; 88 + ref?: string; 89 + } 90 + } 91 + 92 + /** Delete a user account as an administrator. */ 93 + export declare namespace ComAtprotoAdminDeleteAccount { 94 + interface Params {} 95 + interface Input { 96 + did: At.DID; 97 + } 98 + type Output = undefined; 99 + } 100 + 101 + /** Disable an account from receiving new invite codes, but does not invalidate existing codes. */ 102 + export declare namespace ComAtprotoAdminDisableAccountInvites { 103 + interface Params {} 104 + interface Input { 105 + account: At.DID; 106 + /** Optional reason for disabled invites. */ 107 + note?: string; 108 + } 109 + type Output = undefined; 110 + } 111 + 112 + /** Disable some set of codes and/or all codes associated with a set of users. */ 113 + export declare namespace ComAtprotoAdminDisableInviteCodes { 114 + interface Params {} 115 + interface Input { 116 + accounts?: string[]; 117 + codes?: string[]; 118 + } 119 + type Output = undefined; 120 + } 121 + 122 + /** Re-enable an account's ability to receive invite codes. */ 123 + export declare namespace ComAtprotoAdminEnableAccountInvites { 124 + interface Params {} 125 + interface Input { 126 + account: At.DID; 127 + /** Optional reason for enabled invites. */ 128 + note?: string; 129 + } 130 + type Output = undefined; 131 + } 132 + 133 + /** Get details about an account. */ 134 + export declare namespace ComAtprotoAdminGetAccountInfo { 135 + interface Params { 136 + did: At.DID; 137 + } 138 + type Input = undefined; 139 + type Output = ComAtprotoAdminDefs.AccountView; 140 + } 141 + 142 + /** Get details about some accounts. */ 143 + export declare namespace ComAtprotoAdminGetAccountInfos { 144 + interface Params { 145 + dids: At.DID[]; 146 + } 147 + type Input = undefined; 148 + interface Output { 149 + infos: ComAtprotoAdminDefs.AccountView[]; 150 + } 151 + } 152 + 153 + /** Get an admin view of invite codes. */ 154 + export declare namespace ComAtprotoAdminGetInviteCodes { 155 + interface Params { 156 + cursor?: string; 157 + /** 158 + * Minimum: 1 \ 159 + * Maximum: 500 160 + * @default 100 161 + */ 162 + limit?: number; 163 + /** @default "recent" */ 164 + sort?: 'recent' | 'usage' | (string & {}); 165 + } 166 + type Input = undefined; 167 + interface Output { 168 + codes: ComAtprotoServerDefs.InviteCode[]; 169 + cursor?: string; 170 + } 171 + } 172 + 173 + /** Get the service-specific admin status of a subject (account, record, or blob). */ 174 + export declare namespace ComAtprotoAdminGetSubjectStatus { 175 + interface Params { 176 + blob?: At.CID; 177 + did?: At.DID; 178 + uri?: At.Uri; 179 + } 180 + type Input = undefined; 181 + interface Output { 182 + subject: Brand.Union< 183 + ComAtprotoAdminDefs.RepoBlobRef | ComAtprotoAdminDefs.RepoRef | ComAtprotoRepoStrongRef.Main 184 + >; 185 + deactivated?: ComAtprotoAdminDefs.StatusAttr; 186 + takedown?: ComAtprotoAdminDefs.StatusAttr; 187 + } 188 + } 189 + 190 + /** Get list of accounts that matches your search query. */ 191 + export declare namespace ComAtprotoAdminSearchAccounts { 192 + interface Params { 193 + cursor?: string; 194 + email?: string; 195 + /** 196 + * Minimum: 1 \ 197 + * Maximum: 100 198 + * @default 50 199 + */ 200 + limit?: number; 201 + } 202 + type Input = undefined; 203 + interface Output { 204 + accounts: ComAtprotoAdminDefs.AccountView[]; 205 + cursor?: string; 206 + } 207 + } 208 + 209 + /** Send email to a user's account email address. */ 210 + export declare namespace ComAtprotoAdminSendEmail { 211 + interface Params {} 212 + interface Input { 213 + content: string; 214 + recipientDid: At.DID; 215 + senderDid: At.DID; 216 + /** Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers */ 217 + comment?: string; 218 + subject?: string; 219 + } 220 + interface Output { 221 + sent: boolean; 222 + } 223 + } 224 + 225 + /** Administrative action to update an account's email. */ 226 + export declare namespace ComAtprotoAdminUpdateAccountEmail { 227 + interface Params {} 228 + interface Input { 229 + /** The handle or DID of the repo. */ 230 + account: string; 231 + email: string; 232 + } 233 + type Output = undefined; 234 + } 235 + 236 + /** Administrative action to update an account's handle. */ 237 + export declare namespace ComAtprotoAdminUpdateAccountHandle { 238 + interface Params {} 239 + interface Input { 240 + did: At.DID; 241 + handle: At.Handle; 242 + } 243 + type Output = undefined; 244 + } 245 + 246 + /** Update the password for a user account as an administrator. */ 247 + export declare namespace ComAtprotoAdminUpdateAccountPassword { 248 + interface Params {} 249 + interface Input { 250 + did: At.DID; 251 + password: string; 252 + } 253 + type Output = undefined; 254 + } 255 + 256 + /** Update the service-specific admin status of a subject (account, record, or blob). */ 257 + export declare namespace ComAtprotoAdminUpdateSubjectStatus { 258 + interface Params {} 259 + interface Input { 260 + subject: Brand.Union< 261 + ComAtprotoAdminDefs.RepoBlobRef | ComAtprotoAdminDefs.RepoRef | ComAtprotoRepoStrongRef.Main 262 + >; 263 + deactivated?: ComAtprotoAdminDefs.StatusAttr; 264 + takedown?: ComAtprotoAdminDefs.StatusAttr; 265 + } 266 + interface Output { 267 + subject: Brand.Union< 268 + ComAtprotoAdminDefs.RepoBlobRef | ComAtprotoAdminDefs.RepoRef | ComAtprotoRepoStrongRef.Main 269 + >; 270 + takedown?: ComAtprotoAdminDefs.StatusAttr; 271 + } 272 + } 273 + 274 + /** Describe the credentials that should be included in the DID doc of an account that is migrating to this service. */ 275 + export declare namespace ComAtprotoIdentityGetRecommendedDidCredentials { 276 + interface Params {} 277 + type Input = undefined; 278 + interface Output { 279 + alsoKnownAs?: string[]; 280 + /** Recommended rotation keys for PLC dids. Should be undefined (or ignored) for did:webs. */ 281 + rotationKeys?: string[]; 282 + services?: unknown; 283 + verificationMethods?: unknown; 284 + } 285 + } 286 + 287 + /** Request an email with a code to in order to request a signed PLC operation. Requires Auth. */ 288 + export declare namespace ComAtprotoIdentityRequestPlcOperationSignature { 289 + interface Params {} 290 + type Input = undefined; 291 + type Output = undefined; 292 + } 293 + 294 + /** Resolves a handle (domain name) to a DID. */ 295 + export declare namespace ComAtprotoIdentityResolveHandle { 296 + interface Params { 297 + /** The handle to resolve. */ 298 + handle: At.Handle; 299 + } 300 + type Input = undefined; 301 + interface Output { 302 + did: At.DID; 303 + } 304 + } 305 + 306 + /** Signs a PLC operation to update some value(s) in the requesting DID's document. */ 307 + export declare namespace ComAtprotoIdentitySignPlcOperation { 308 + interface Params {} 309 + interface Input { 310 + alsoKnownAs?: string[]; 311 + rotationKeys?: string[]; 312 + services?: unknown; 313 + /** A token received through com.atproto.identity.requestPlcOperationSignature */ 314 + token?: string; 315 + verificationMethods?: unknown; 316 + } 317 + interface Output { 318 + /** A signed DID PLC operation. */ 319 + operation: unknown; 320 + } 321 + } 322 + 323 + /** Validates a PLC operation to ensure that it doesn't violate a service's constraints or get the identity into a bad state, then submits it to the PLC registry */ 324 + export declare namespace ComAtprotoIdentitySubmitPlcOperation { 325 + interface Params {} 326 + interface Input { 327 + operation: unknown; 328 + } 329 + type Output = undefined; 330 + } 331 + 332 + /** Updates the current account's handle. Verifies handle validity, and updates did:plc document if necessary. Implemented by PDS, and requires auth. */ 333 + export declare namespace ComAtprotoIdentityUpdateHandle { 334 + interface Params {} 335 + interface Input { 336 + /** The new handle. */ 337 + handle: At.Handle; 338 + } 339 + type Output = undefined; 340 + } 341 + 342 + export declare namespace ComAtprotoLabelDefs { 343 + /** Metadata tag on an atproto resource (eg, repo or record). */ 344 + interface Label { 345 + [Brand.Type]?: 'com.atproto.label.defs#label'; 346 + /** Timestamp when this label was created. */ 347 + cts: string; 348 + /** DID of the actor who created this label. */ 349 + src: At.DID; 350 + /** AT URI of the record, repository (account), or other resource that this label applies to. */ 351 + uri: string; 352 + /** 353 + * The short string name of the value or type of this label. \ 354 + * Maximum string length: 128 355 + */ 356 + val: string; 357 + /** Optionally, CID specifying the specific version of 'uri' resource this label applies to. */ 358 + cid?: At.CID; 359 + /** Timestamp at which this label expires (no longer applies). */ 360 + exp?: string; 361 + /** If true, this is a negation label, overwriting a previous label. */ 362 + neg?: boolean; 363 + /** Signature of dag-cbor encoded label. */ 364 + sig?: At.Bytes; 365 + /** The AT Protocol version of the label object. */ 366 + ver?: number; 367 + } 368 + type LabelValue = 369 + | '!hide' 370 + | '!no-promote' 371 + | '!no-unauthenticated' 372 + | '!warn' 373 + | 'dmca-violation' 374 + | 'doxxing' 375 + | 'gore' 376 + | 'nsfl' 377 + | 'nudity' 378 + | 'porn' 379 + | 'sexual' 380 + | (string & {}); 381 + /** Declares a label value and its expected interpretations and behaviors. */ 382 + interface LabelValueDefinition { 383 + [Brand.Type]?: 'com.atproto.label.defs#labelValueDefinition'; 384 + /** What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing. */ 385 + blurs: 'content' | 'media' | 'none' | (string & {}); 386 + /** 387 + * The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+). \ 388 + * Maximum string length: 100 \ 389 + * Maximum grapheme length: 100 390 + */ 391 + identifier: string; 392 + locales: LabelValueDefinitionStrings[]; 393 + /** How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing. */ 394 + severity: 'alert' | 'inform' | 'none' | (string & {}); 395 + /** Does the user need to have adult content enabled in order to configure this label? */ 396 + adultOnly?: boolean; 397 + /** 398 + * The default setting for this label. 399 + * @default "warn" 400 + */ 401 + defaultSetting?: 'hide' | 'ignore' | 'warn' | (string & {}); 402 + } 403 + /** Strings which describe the label in the UI, localized into a specific language. */ 404 + interface LabelValueDefinitionStrings { 405 + [Brand.Type]?: 'com.atproto.label.defs#labelValueDefinitionStrings'; 406 + /** 407 + * A longer description of what the label means and why it might be applied. \ 408 + * Maximum string length: 100000 \ 409 + * Maximum grapheme length: 10000 410 + */ 411 + description: string; 412 + /** The code of the language these strings are written in. */ 413 + lang: string; 414 + /** 415 + * A short human-readable name for the label. \ 416 + * Maximum string length: 640 \ 417 + * Maximum grapheme length: 64 418 + */ 419 + name: string; 420 + } 421 + /** Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel. */ 422 + interface SelfLabel { 423 + [Brand.Type]?: 'com.atproto.label.defs#selfLabel'; 424 + /** 425 + * The short string name of the value or type of this label. \ 426 + * Maximum string length: 128 427 + */ 428 + val: string; 429 + } 430 + /** Metadata tags on an atproto record, published by the author within the record. */ 431 + interface SelfLabels { 432 + [Brand.Type]?: 'com.atproto.label.defs#selfLabels'; 433 + /** Maximum array length: 10 */ 434 + values: SelfLabel[]; 435 + } 436 + } 437 + 438 + /** Find labels relevant to the provided AT-URI patterns. Public endpoint for moderation services, though may return different or additional results with auth. */ 439 + export declare namespace ComAtprotoLabelQueryLabels { 440 + interface Params { 441 + /** List of AT URI patterns to match (boolean 'OR'). Each may be a prefix (ending with '*'; will match inclusive of the string leading to '*'), or a full URI. */ 442 + uriPatterns: string[]; 443 + cursor?: string; 444 + /** 445 + * Minimum: 1 \ 446 + * Maximum: 250 447 + * @default 50 448 + */ 449 + limit?: number; 450 + /** Optional list of label sources (DIDs) to filter on. */ 451 + sources?: At.DID[]; 452 + } 453 + type Input = undefined; 454 + interface Output { 455 + labels: ComAtprotoLabelDefs.Label[]; 456 + cursor?: string; 457 + } 458 + } 459 + 460 + export declare namespace ComAtprotoLabelSubscribeLabels { 461 + interface Info { 462 + [Brand.Type]?: 'com.atproto.label.subscribeLabels#info'; 463 + name: 'OutdatedCursor' | (string & {}); 464 + message?: string; 465 + } 466 + interface Labels { 467 + [Brand.Type]?: 'com.atproto.label.subscribeLabels#labels'; 468 + labels: ComAtprotoLabelDefs.Label[]; 469 + seq: number; 470 + } 471 + } 472 + 473 + /** Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth. */ 474 + export declare namespace ComAtprotoModerationCreateReport { 475 + interface Params {} 476 + interface Input { 477 + /** Indicates the broad category of violation the report is for. */ 478 + reasonType: ComAtprotoModerationDefs.ReasonType; 479 + subject: Brand.Union<ComAtprotoAdminDefs.RepoRef | ComAtprotoRepoStrongRef.Main>; 480 + /** 481 + * Additional context about the content and violation. \ 482 + * Maximum string length: 20000 \ 483 + * Maximum grapheme length: 2000 484 + */ 485 + reason?: string; 486 + } 487 + interface Output { 488 + createdAt: string; 489 + id: number; 490 + reasonType: ComAtprotoModerationDefs.ReasonType; 491 + reportedBy: At.DID; 492 + subject: Brand.Union<ComAtprotoAdminDefs.RepoRef | ComAtprotoRepoStrongRef.Main>; 493 + /** 494 + * Maximum string length: 20000 \ 495 + * Maximum grapheme length: 2000 496 + */ 497 + reason?: string; 498 + } 499 + } 500 + 501 + export declare namespace ComAtprotoModerationDefs { 502 + type ReasonAppeal = 'com.atproto.moderation.defs#reasonAppeal'; 503 + type ReasonMisleading = 'com.atproto.moderation.defs#reasonMisleading'; 504 + type ReasonOther = 'com.atproto.moderation.defs#reasonOther'; 505 + type ReasonRude = 'com.atproto.moderation.defs#reasonRude'; 506 + type ReasonSexual = 'com.atproto.moderation.defs#reasonSexual'; 507 + type ReasonSpam = 'com.atproto.moderation.defs#reasonSpam'; 508 + type ReasonType = 509 + | 'com.atproto.moderation.defs#reasonAppeal' 510 + | 'com.atproto.moderation.defs#reasonMisleading' 511 + | 'com.atproto.moderation.defs#reasonOther' 512 + | 'com.atproto.moderation.defs#reasonRude' 513 + | 'com.atproto.moderation.defs#reasonSexual' 514 + | 'com.atproto.moderation.defs#reasonSpam' 515 + | 'com.atproto.moderation.defs#reasonViolation' 516 + | (string & {}); 517 + type ReasonViolation = 'com.atproto.moderation.defs#reasonViolation'; 518 + } 519 + 520 + /** Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS. */ 521 + export declare namespace ComAtprotoRepoApplyWrites { 522 + interface Params {} 523 + interface Input { 524 + /** The handle or DID of the repo (aka, current account). */ 525 + repo: string; 526 + writes: Brand.Union<Create | Delete | Update>[]; 527 + /** If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations. */ 528 + swapCommit?: At.CID; 529 + /** 530 + * Can be set to 'false' to skip Lexicon schema validation of record data, for all operations. 531 + * @default true 532 + */ 533 + validate?: boolean; 534 + } 535 + type Output = undefined; 536 + interface Errors { 537 + InvalidSwap: {}; 538 + } 539 + /** Operation which creates a new record. */ 540 + interface Create { 541 + [Brand.Type]?: 'com.atproto.repo.applyWrites#create'; 542 + collection: string; 543 + value: unknown; 544 + /** Maximum string length: 15 */ 545 + rkey?: string; 546 + } 547 + /** Operation which deletes an existing record. */ 548 + interface Delete { 549 + [Brand.Type]?: 'com.atproto.repo.applyWrites#delete'; 550 + collection: string; 551 + rkey: string; 552 + } 553 + /** Operation which updates an existing record. */ 554 + interface Update { 555 + [Brand.Type]?: 'com.atproto.repo.applyWrites#update'; 556 + collection: string; 557 + rkey: string; 558 + value: unknown; 559 + } 560 + } 561 + 562 + /** Create a single new repository record. Requires auth, implemented by PDS. */ 563 + export declare namespace ComAtprotoRepoCreateRecord { 564 + interface Params {} 565 + interface Input { 566 + /** The NSID of the record collection. */ 567 + collection: string; 568 + /** The record itself. Must contain a $type field. */ 569 + record: unknown; 570 + /** The handle or DID of the repo (aka, current account). */ 571 + repo: string; 572 + /** 573 + * The Record Key. \ 574 + * Maximum string length: 15 575 + */ 576 + rkey?: string; 577 + /** Compare and swap with the previous commit by CID. */ 578 + swapCommit?: At.CID; 579 + /** 580 + * Can be set to 'false' to skip Lexicon schema validation of record data. 581 + * @default true 582 + */ 583 + validate?: boolean; 584 + } 585 + interface Output { 586 + cid: At.CID; 587 + uri: At.Uri; 588 + } 589 + interface Errors { 590 + InvalidSwap: {}; 591 + } 592 + } 593 + 594 + /** Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS. */ 595 + export declare namespace ComAtprotoRepoDeleteRecord { 596 + interface Params {} 597 + interface Input { 598 + /** The NSID of the record collection. */ 599 + collection: string; 600 + /** The handle or DID of the repo (aka, current account). */ 601 + repo: string; 602 + /** The Record Key. */ 603 + rkey: string; 604 + /** Compare and swap with the previous commit by CID. */ 605 + swapCommit?: At.CID; 606 + /** Compare and swap with the previous record by CID. */ 607 + swapRecord?: At.CID; 608 + } 609 + type Output = undefined; 610 + interface Errors { 611 + InvalidSwap: {}; 612 + } 613 + } 614 + 615 + /** Get information about an account and repository, including the list of collections. Does not require auth. */ 616 + export declare namespace ComAtprotoRepoDescribeRepo { 617 + interface Params { 618 + /** The handle or DID of the repo. */ 619 + repo: string; 620 + } 621 + type Input = undefined; 622 + interface Output { 623 + /** List of all the collections (NSIDs) for which this repo contains at least one record. */ 624 + collections: string[]; 625 + did: At.DID; 626 + /** The complete DID document for this account. */ 627 + didDoc: unknown; 628 + handle: At.Handle; 629 + /** Indicates if handle is currently valid (resolves bi-directionally) */ 630 + handleIsCorrect: boolean; 631 + } 632 + } 633 + 634 + /** Get a single record from a repository. Does not require auth. */ 635 + export declare namespace ComAtprotoRepoGetRecord { 636 + interface Params { 637 + /** The NSID of the record collection. */ 638 + collection: string; 639 + /** The handle or DID of the repo. */ 640 + repo: string; 641 + /** The Record Key. */ 642 + rkey: string; 643 + /** The CID of the version of the record. If not specified, then return the most recent version. */ 644 + cid?: At.CID; 645 + } 646 + type Input = undefined; 647 + interface Output { 648 + uri: At.Uri; 649 + value: unknown; 650 + cid?: At.CID; 651 + } 652 + } 653 + 654 + /** Import a repo in the form of a CAR file. Requires Content-Length HTTP header to be set. */ 655 + export declare namespace ComAtprotoRepoImportRepo { 656 + interface Params {} 657 + type Input = Blob | ArrayBufferView; 658 + type Output = undefined; 659 + } 660 + 661 + /** Returns a list of missing blobs for the requesting account. Intended to be used in the account migration flow. */ 662 + export declare namespace ComAtprotoRepoListMissingBlobs { 663 + interface Params { 664 + cursor?: string; 665 + /** 666 + * Minimum: 1 \ 667 + * Maximum: 1000 668 + * @default 500 669 + */ 670 + limit?: number; 671 + } 672 + type Input = undefined; 673 + interface Output { 674 + blobs: RecordBlob[]; 675 + cursor?: string; 676 + } 677 + interface RecordBlob { 678 + [Brand.Type]?: 'com.atproto.repo.listMissingBlobs#recordBlob'; 679 + cid: At.CID; 680 + recordUri: At.Uri; 681 + } 682 + } 683 + 684 + /** List a range of records in a repository, matching a specific collection. Does not require auth. */ 685 + export declare namespace ComAtprotoRepoListRecords { 686 + interface Params { 687 + /** The NSID of the record type. */ 688 + collection: string; 689 + /** The handle or DID of the repo. */ 690 + repo: string; 691 + cursor?: string; 692 + /** 693 + * The number of records to return. \ 694 + * Minimum: 1 \ 695 + * Maximum: 100 696 + * @default 50 697 + */ 698 + limit?: number; 699 + /** Flag to reverse the order of the returned records. */ 700 + reverse?: boolean; 701 + /** 702 + * DEPRECATED: The highest sort-ordered rkey to stop at (exclusive) 703 + * @deprecated 704 + */ 705 + rkeyEnd?: string; 706 + /** 707 + * DEPRECATED: The lowest sort-ordered rkey to start from (exclusive) 708 + * @deprecated 709 + */ 710 + rkeyStart?: string; 711 + } 712 + type Input = undefined; 713 + interface Output { 714 + records: Record[]; 715 + cursor?: string; 716 + } 717 + interface Record { 718 + [Brand.Type]?: 'com.atproto.repo.listRecords#record'; 719 + cid: At.CID; 720 + uri: At.Uri; 721 + value: unknown; 722 + } 723 + } 724 + 725 + /** Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS. */ 726 + export declare namespace ComAtprotoRepoPutRecord { 727 + interface Params {} 728 + interface Input { 729 + /** The NSID of the record collection. */ 730 + collection: string; 731 + /** The record to write. */ 732 + record: unknown; 733 + /** The handle or DID of the repo (aka, current account). */ 734 + repo: string; 735 + /** 736 + * The Record Key. \ 737 + * Maximum string length: 15 738 + */ 739 + rkey: string; 740 + /** Compare and swap with the previous commit by CID. */ 741 + swapCommit?: At.CID; 742 + /** Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation */ 743 + swapRecord?: At.CID | null; 744 + /** 745 + * Can be set to 'false' to skip Lexicon schema validation of record data. 746 + * @default true 747 + */ 748 + validate?: boolean; 749 + } 750 + interface Output { 751 + cid: At.CID; 752 + uri: At.Uri; 753 + } 754 + interface Errors { 755 + InvalidSwap: {}; 756 + } 757 + } 758 + 759 + export declare namespace ComAtprotoRepoStrongRef { 760 + interface Main { 761 + [Brand.Type]?: 'com.atproto.repo.strongRef'; 762 + cid: At.CID; 763 + uri: At.Uri; 764 + } 765 + } 766 + 767 + /** Upload a new blob, to be referenced from a repository record. The blob will be deleted if it is not referenced within a time window (eg, minutes). Blob restrictions (mimetype, size, etc) are enforced when the reference is created. Requires auth, implemented by PDS. */ 768 + export declare namespace ComAtprotoRepoUploadBlob { 769 + interface Params {} 770 + type Input = Blob | ArrayBufferView; 771 + interface Output { 772 + blob: At.Blob; 773 + } 774 + } 775 + 776 + /** Activates a currently deactivated account. Used to finalize account migration after the account's repo is imported and identity is setup. */ 777 + export declare namespace ComAtprotoServerActivateAccount { 778 + interface Params {} 779 + type Input = undefined; 780 + type Output = undefined; 781 + } 782 + 783 + /** Returns the status of an account, especially as pertaining to import or recovery. Can be called many times over the course of an account migration. Requires auth and can only be called pertaining to oneself. */ 784 + export declare namespace ComAtprotoServerCheckAccountStatus { 785 + interface Params {} 786 + type Input = undefined; 787 + interface Output { 788 + activated: boolean; 789 + expectedBlobs: number; 790 + importedBlobs: number; 791 + indexedRecords: number; 792 + privateStateValues: number; 793 + repoBlocks: number; 794 + repoCommit: At.CID; 795 + repoRev: string; 796 + validDid: boolean; 797 + } 798 + } 799 + 800 + /** Confirm an email using a token from com.atproto.server.requestEmailConfirmation. */ 801 + export declare namespace ComAtprotoServerConfirmEmail { 802 + interface Params {} 803 + interface Input { 804 + email: string; 805 + token: string; 806 + } 807 + type Output = undefined; 808 + interface Errors { 809 + AccountNotFound: {}; 810 + ExpiredToken: {}; 811 + InvalidToken: {}; 812 + InvalidEmail: {}; 813 + } 814 + } 815 + 816 + /** Create an account. Implemented by PDS. */ 817 + export declare namespace ComAtprotoServerCreateAccount { 818 + interface Params {} 819 + interface Input { 820 + /** Requested handle for the account. */ 821 + handle: At.Handle; 822 + /** Pre-existing atproto DID, being imported to a new account. */ 823 + did?: At.DID; 824 + email?: string; 825 + inviteCode?: string; 826 + /** Initial account password. May need to meet instance-specific password strength requirements. */ 827 + password?: string; 828 + /** A signed DID PLC operation to be submitted as part of importing an existing account to this instance. NOTE: this optional field may be updated when full account migration is implemented. */ 829 + plcOp?: unknown; 830 + /** DID PLC rotation key (aka, recovery key) to be included in PLC creation operation. */ 831 + recoveryKey?: string; 832 + verificationCode?: string; 833 + verificationPhone?: string; 834 + } 835 + /** Account login session returned on successful account creation. */ 836 + interface Output { 837 + accessJwt: string; 838 + /** The DID of the new account. */ 839 + did: At.DID; 840 + handle: At.Handle; 841 + refreshJwt: string; 842 + /** Complete DID document. */ 843 + didDoc?: unknown; 844 + } 845 + interface Errors { 846 + InvalidHandle: {}; 847 + InvalidPassword: {}; 848 + InvalidInviteCode: {}; 849 + HandleNotAvailable: {}; 850 + UnsupportedDomain: {}; 851 + UnresolvableDid: {}; 852 + IncompatibleDidDoc: {}; 853 + } 854 + } 855 + 856 + /** Create an App Password. */ 857 + export declare namespace ComAtprotoServerCreateAppPassword { 858 + interface Params {} 859 + interface Input { 860 + /** A short name for the App Password, to help distinguish them. */ 861 + name: string; 862 + /** If an app password has 'privileged' access to possibly sensitive account state. Meant for use with trusted clients. */ 863 + privileged?: boolean; 864 + } 865 + type Output = AppPassword; 866 + interface Errors { 867 + AccountTakedown: {}; 868 + } 869 + interface AppPassword { 870 + [Brand.Type]?: 'com.atproto.server.createAppPassword#appPassword'; 871 + createdAt: string; 872 + name: string; 873 + password: string; 874 + privileged?: boolean; 875 + } 876 + } 877 + 878 + /** Create an invite code. */ 879 + export declare namespace ComAtprotoServerCreateInviteCode { 880 + interface Params {} 881 + interface Input { 882 + useCount: number; 883 + forAccount?: At.DID; 884 + } 885 + interface Output { 886 + code: string; 887 + } 888 + } 889 + 890 + /** Create invite codes. */ 891 + export declare namespace ComAtprotoServerCreateInviteCodes { 892 + interface Params {} 893 + interface Input { 894 + /** @default 1 */ 895 + codeCount: number; 896 + useCount: number; 897 + forAccounts?: At.DID[]; 898 + } 899 + interface Output { 900 + codes: AccountCodes[]; 901 + } 902 + interface AccountCodes { 903 + [Brand.Type]?: 'com.atproto.server.createInviteCodes#accountCodes'; 904 + account: string; 905 + codes: string[]; 906 + } 907 + } 908 + 909 + /** Create an authentication session. */ 910 + export declare namespace ComAtprotoServerCreateSession { 911 + interface Params {} 912 + interface Input { 913 + /** Handle or other identifier supported by the server for the authenticating user. */ 914 + identifier: string; 915 + password: string; 916 + authFactorToken?: string; 917 + } 918 + interface Output { 919 + accessJwt: string; 920 + did: At.DID; 921 + handle: At.Handle; 922 + refreshJwt: string; 923 + active?: boolean; 924 + didDoc?: unknown; 925 + email?: string; 926 + emailAuthFactor?: boolean; 927 + emailConfirmed?: boolean; 928 + /** If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. */ 929 + status?: 'deactivated' | 'suspended' | 'takendown' | (string & {}); 930 + } 931 + interface Errors { 932 + AccountTakedown: {}; 933 + AuthFactorTokenRequired: {}; 934 + } 935 + } 936 + 937 + /** Deactivates a currently active account. Stops serving of repo, and future writes to repo until reactivated. Used to finalize account migration with the old host after the account has been activated on the new host. */ 938 + export declare namespace ComAtprotoServerDeactivateAccount { 939 + interface Params {} 940 + interface Input { 941 + /** A recommendation to server as to how long they should hold onto the deactivated account before deleting. */ 942 + deleteAfter?: string; 943 + } 944 + type Output = undefined; 945 + } 946 + 947 + export declare namespace ComAtprotoServerDefs { 948 + interface InviteCode { 949 + [Brand.Type]?: 'com.atproto.server.defs#inviteCode'; 950 + available: number; 951 + code: string; 952 + createdAt: string; 953 + createdBy: string; 954 + disabled: boolean; 955 + forAccount: string; 956 + uses: InviteCodeUse[]; 957 + } 958 + interface InviteCodeUse { 959 + [Brand.Type]?: 'com.atproto.server.defs#inviteCodeUse'; 960 + usedAt: string; 961 + usedBy: At.DID; 962 + } 963 + } 964 + 965 + /** Delete an actor's account with a token and password. Can only be called after requesting a deletion token. Requires auth. */ 966 + export declare namespace ComAtprotoServerDeleteAccount { 967 + interface Params {} 968 + interface Input { 969 + did: At.DID; 970 + password: string; 971 + token: string; 972 + } 973 + type Output = undefined; 974 + interface Errors { 975 + ExpiredToken: {}; 976 + InvalidToken: {}; 977 + } 978 + } 979 + 980 + /** Delete the current session. Requires auth. */ 981 + export declare namespace ComAtprotoServerDeleteSession { 982 + interface Params {} 983 + type Input = undefined; 984 + type Output = undefined; 985 + } 986 + 987 + /** Describes the server's account creation requirements and capabilities. Implemented by PDS. */ 988 + export declare namespace ComAtprotoServerDescribeServer { 989 + interface Params {} 990 + type Input = undefined; 991 + interface Output { 992 + /** List of domain suffixes that can be used in account handles. */ 993 + availableUserDomains: string[]; 994 + did: At.DID; 995 + /** Contact information */ 996 + contact?: Contact; 997 + /** If true, an invite code must be supplied to create an account on this instance. */ 998 + inviteCodeRequired?: boolean; 999 + /** URLs of service policy documents. */ 1000 + links?: Links; 1001 + /** If true, a phone verification token must be supplied to create an account on this instance. */ 1002 + phoneVerificationRequired?: boolean; 1003 + } 1004 + interface Contact { 1005 + [Brand.Type]?: 'com.atproto.server.describeServer#contact'; 1006 + email?: string; 1007 + } 1008 + interface Links { 1009 + [Brand.Type]?: 'com.atproto.server.describeServer#links'; 1010 + privacyPolicy?: string; 1011 + termsOfService?: string; 1012 + } 1013 + } 1014 + 1015 + /** Get all invite codes for the current account. Requires auth. */ 1016 + export declare namespace ComAtprotoServerGetAccountInviteCodes { 1017 + interface Params { 1018 + /** 1019 + * Controls whether any new 'earned' but not 'created' invites should be created. 1020 + * @default true 1021 + */ 1022 + createAvailable?: boolean; 1023 + /** @default true */ 1024 + includeUsed?: boolean; 1025 + } 1026 + type Input = undefined; 1027 + interface Output { 1028 + codes: ComAtprotoServerDefs.InviteCode[]; 1029 + } 1030 + interface Errors { 1031 + DuplicateCreate: {}; 1032 + } 1033 + } 1034 + 1035 + /** Get a signed token on behalf of the requesting DID for the requested service. */ 1036 + export declare namespace ComAtprotoServerGetServiceAuth { 1037 + interface Params { 1038 + /** The DID of the service that the token will be used to authenticate with */ 1039 + aud: At.DID; 1040 + /** The time in Unix Epoch seconds that the JWT expires. Defaults to 60 seconds in the future. The service may enforce certain time bounds on tokens depending on the requested scope. */ 1041 + exp?: number; 1042 + /** Lexicon (XRPC) method to bind the requested token to */ 1043 + lxm?: string; 1044 + } 1045 + type Input = undefined; 1046 + interface Output { 1047 + token: string; 1048 + } 1049 + interface Errors { 1050 + BadExpiration: {}; 1051 + } 1052 + } 1053 + 1054 + /** Get information about the current auth session. Requires auth. */ 1055 + export declare namespace ComAtprotoServerGetSession { 1056 + interface Params {} 1057 + type Input = undefined; 1058 + interface Output { 1059 + did: At.DID; 1060 + handle: At.Handle; 1061 + active?: boolean; 1062 + didDoc?: unknown; 1063 + email?: string; 1064 + emailAuthFactor?: boolean; 1065 + emailConfirmed?: boolean; 1066 + /** If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. */ 1067 + status?: 'deactivated' | 'suspended' | 'takendown' | (string & {}); 1068 + } 1069 + } 1070 + 1071 + /** List all App Passwords. */ 1072 + export declare namespace ComAtprotoServerListAppPasswords { 1073 + interface Params {} 1074 + type Input = undefined; 1075 + interface Output { 1076 + passwords: AppPassword[]; 1077 + } 1078 + interface Errors { 1079 + AccountTakedown: {}; 1080 + } 1081 + interface AppPassword { 1082 + [Brand.Type]?: 'com.atproto.server.listAppPasswords#appPassword'; 1083 + createdAt: string; 1084 + name: string; 1085 + privileged?: boolean; 1086 + } 1087 + } 1088 + 1089 + /** Refresh an authentication session. Requires auth using the 'refreshJwt' (not the 'accessJwt'). */ 1090 + export declare namespace ComAtprotoServerRefreshSession { 1091 + interface Params {} 1092 + type Input = undefined; 1093 + interface Output { 1094 + accessJwt: string; 1095 + did: At.DID; 1096 + handle: At.Handle; 1097 + refreshJwt: string; 1098 + active?: boolean; 1099 + didDoc?: unknown; 1100 + /** Hosting status of the account. If not specified, then assume 'active'. */ 1101 + status?: 'deactivated' | 'suspended' | 'takendown' | (string & {}); 1102 + } 1103 + interface Errors { 1104 + AccountTakedown: {}; 1105 + } 1106 + } 1107 + 1108 + /** Initiate a user account deletion via email. */ 1109 + export declare namespace ComAtprotoServerRequestAccountDelete { 1110 + interface Params {} 1111 + type Input = undefined; 1112 + type Output = undefined; 1113 + } 1114 + 1115 + /** Request an email with a code to confirm ownership of email. */ 1116 + export declare namespace ComAtprotoServerRequestEmailConfirmation { 1117 + interface Params {} 1118 + type Input = undefined; 1119 + type Output = undefined; 1120 + } 1121 + 1122 + /** Request a token in order to update email. */ 1123 + export declare namespace ComAtprotoServerRequestEmailUpdate { 1124 + interface Params {} 1125 + type Input = undefined; 1126 + interface Output { 1127 + tokenRequired: boolean; 1128 + } 1129 + } 1130 + 1131 + /** Initiate a user account password reset via email. */ 1132 + export declare namespace ComAtprotoServerRequestPasswordReset { 1133 + interface Params {} 1134 + interface Input { 1135 + email: string; 1136 + } 1137 + type Output = undefined; 1138 + } 1139 + 1140 + /** Reserve a repo signing key, for use with account creation. Necessary so that a DID PLC update operation can be constructed during an account migraiton. Public and does not require auth; implemented by PDS. NOTE: this endpoint may change when full account migration is implemented. */ 1141 + export declare namespace ComAtprotoServerReserveSigningKey { 1142 + interface Params {} 1143 + interface Input { 1144 + /** The DID to reserve a key for. */ 1145 + did?: At.DID; 1146 + } 1147 + interface Output { 1148 + /** The public key for the reserved signing key, in did:key serialization. */ 1149 + signingKey: string; 1150 + } 1151 + } 1152 + 1153 + /** Reset a user account password using a token. */ 1154 + export declare namespace ComAtprotoServerResetPassword { 1155 + interface Params {} 1156 + interface Input { 1157 + password: string; 1158 + token: string; 1159 + } 1160 + type Output = undefined; 1161 + interface Errors { 1162 + ExpiredToken: {}; 1163 + InvalidToken: {}; 1164 + } 1165 + } 1166 + 1167 + /** Revoke an App Password by name. */ 1168 + export declare namespace ComAtprotoServerRevokeAppPassword { 1169 + interface Params {} 1170 + interface Input { 1171 + name: string; 1172 + } 1173 + type Output = undefined; 1174 + } 1175 + 1176 + /** Update an account's email. */ 1177 + export declare namespace ComAtprotoServerUpdateEmail { 1178 + interface Params {} 1179 + interface Input { 1180 + email: string; 1181 + emailAuthFactor?: boolean; 1182 + /** Requires a token from com.atproto.sever.requestEmailUpdate if the account's email has been confirmed. */ 1183 + token?: string; 1184 + } 1185 + type Output = undefined; 1186 + interface Errors { 1187 + ExpiredToken: {}; 1188 + InvalidToken: {}; 1189 + TokenRequired: {}; 1190 + } 1191 + } 1192 + 1193 + /** Get a blob associated with a given account. Returns the full blob as originally uploaded. Does not require auth; implemented by PDS. */ 1194 + export declare namespace ComAtprotoSyncGetBlob { 1195 + interface Params { 1196 + /** The CID of the blob to fetch */ 1197 + cid: At.CID; 1198 + /** The DID of the account. */ 1199 + did: At.DID; 1200 + } 1201 + type Input = undefined; 1202 + type Output = Uint8Array; 1203 + interface Errors { 1204 + BlobNotFound: {}; 1205 + RepoNotFound: {}; 1206 + RepoTakendown: {}; 1207 + RepoSuspended: {}; 1208 + RepoDeactivated: {}; 1209 + } 1210 + } 1211 + 1212 + /** Get data blocks from a given repo, by CID. For example, intermediate MST nodes, or records. Does not require auth; implemented by PDS. */ 1213 + export declare namespace ComAtprotoSyncGetBlocks { 1214 + interface Params { 1215 + cids: At.CID[]; 1216 + /** The DID of the repo. */ 1217 + did: At.DID; 1218 + } 1219 + type Input = undefined; 1220 + type Output = Uint8Array; 1221 + interface Errors { 1222 + BlockNotFound: {}; 1223 + RepoNotFound: {}; 1224 + RepoTakendown: {}; 1225 + RepoSuspended: {}; 1226 + RepoDeactivated: {}; 1227 + } 1228 + } 1229 + 1230 + /** 1231 + * DEPRECATED - please use com.atproto.sync.getRepo instead 1232 + * @deprecated 1233 + */ 1234 + export declare namespace ComAtprotoSyncGetCheckout { 1235 + interface Params { 1236 + /** The DID of the repo. */ 1237 + did: At.DID; 1238 + } 1239 + type Input = undefined; 1240 + type Output = Uint8Array; 1241 + } 1242 + 1243 + /** 1244 + * DEPRECATED - please use com.atproto.sync.getLatestCommit instead 1245 + * @deprecated 1246 + */ 1247 + export declare namespace ComAtprotoSyncGetHead { 1248 + interface Params { 1249 + /** The DID of the repo. */ 1250 + did: At.DID; 1251 + } 1252 + type Input = undefined; 1253 + interface Output { 1254 + root: At.CID; 1255 + } 1256 + interface Errors { 1257 + HeadNotFound: {}; 1258 + } 1259 + } 1260 + 1261 + /** Get the current commit CID & revision of the specified repo. Does not require auth. */ 1262 + export declare namespace ComAtprotoSyncGetLatestCommit { 1263 + interface Params { 1264 + /** The DID of the repo. */ 1265 + did: At.DID; 1266 + } 1267 + type Input = undefined; 1268 + interface Output { 1269 + cid: At.CID; 1270 + rev: string; 1271 + } 1272 + interface Errors { 1273 + RepoNotFound: {}; 1274 + RepoTakendown: {}; 1275 + RepoSuspended: {}; 1276 + RepoDeactivated: {}; 1277 + } 1278 + } 1279 + 1280 + /** Get data blocks needed to prove the existence or non-existence of record in the current version of repo. Does not require auth. */ 1281 + export declare namespace ComAtprotoSyncGetRecord { 1282 + interface Params { 1283 + collection: string; 1284 + /** The DID of the repo. */ 1285 + did: At.DID; 1286 + /** Record Key */ 1287 + rkey: string; 1288 + /** 1289 + * DEPRECATED: referenced a repo commit by CID, and retrieved record as of that commit 1290 + * @deprecated 1291 + */ 1292 + commit?: At.CID; 1293 + } 1294 + type Input = undefined; 1295 + type Output = Uint8Array; 1296 + interface Errors { 1297 + RecordNotFound: {}; 1298 + RepoNotFound: {}; 1299 + RepoTakendown: {}; 1300 + RepoSuspended: {}; 1301 + RepoDeactivated: {}; 1302 + } 1303 + } 1304 + 1305 + /** Download a repository export as CAR file. Optionally only a 'diff' since a previous revision. Does not require auth; implemented by PDS. */ 1306 + export declare namespace ComAtprotoSyncGetRepo { 1307 + interface Params { 1308 + /** The DID of the repo. */ 1309 + did: At.DID; 1310 + /** The revision ('rev') of the repo to create a diff from. */ 1311 + since?: string; 1312 + } 1313 + type Input = undefined; 1314 + type Output = Uint8Array; 1315 + interface Errors { 1316 + RepoNotFound: {}; 1317 + RepoTakendown: {}; 1318 + RepoSuspended: {}; 1319 + RepoDeactivated: {}; 1320 + } 1321 + } 1322 + 1323 + /** Get the hosting status for a repository, on this server. Expected to be implemented by PDS and Relay. */ 1324 + export declare namespace ComAtprotoSyncGetRepoStatus { 1325 + interface Params { 1326 + /** The DID of the repo. */ 1327 + did: At.DID; 1328 + } 1329 + type Input = undefined; 1330 + interface Output { 1331 + active: boolean; 1332 + did: At.DID; 1333 + /** Optional field, the current rev of the repo, if active=true */ 1334 + rev?: string; 1335 + /** If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. */ 1336 + status?: 'deactivated' | 'suspended' | 'takendown' | (string & {}); 1337 + } 1338 + interface Errors { 1339 + RepoNotFound: {}; 1340 + } 1341 + } 1342 + 1343 + /** List blob CIDs for an account, since some repo revision. Does not require auth; implemented by PDS. */ 1344 + export declare namespace ComAtprotoSyncListBlobs { 1345 + interface Params { 1346 + /** The DID of the repo. */ 1347 + did: At.DID; 1348 + cursor?: string; 1349 + /** 1350 + * Minimum: 1 \ 1351 + * Maximum: 1000 1352 + * @default 500 1353 + */ 1354 + limit?: number; 1355 + /** Optional revision of the repo to list blobs since. */ 1356 + since?: string; 1357 + } 1358 + type Input = undefined; 1359 + interface Output { 1360 + cids: At.CID[]; 1361 + cursor?: string; 1362 + } 1363 + interface Errors { 1364 + RepoNotFound: {}; 1365 + RepoTakendown: {}; 1366 + RepoSuspended: {}; 1367 + RepoDeactivated: {}; 1368 + } 1369 + } 1370 + 1371 + /** Enumerates all the DID, rev, and commit CID for all repos hosted by this service. Does not require auth; implemented by PDS and Relay. */ 1372 + export declare namespace ComAtprotoSyncListRepos { 1373 + interface Params { 1374 + cursor?: string; 1375 + /** 1376 + * Minimum: 1 \ 1377 + * Maximum: 1000 1378 + * @default 500 1379 + */ 1380 + limit?: number; 1381 + } 1382 + type Input = undefined; 1383 + interface Output { 1384 + repos: Repo[]; 1385 + cursor?: string; 1386 + } 1387 + interface Repo { 1388 + [Brand.Type]?: 'com.atproto.sync.listRepos#repo'; 1389 + did: At.DID; 1390 + /** Current repo commit CID */ 1391 + head: At.CID; 1392 + rev: string; 1393 + active?: boolean; 1394 + /** If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. */ 1395 + status?: 'deactivated' | 'suspended' | 'takendown' | (string & {}); 1396 + } 1397 + } 1398 + 1399 + /** Notify a crawling service of a recent update, and that crawling should resume. Intended use is after a gap between repo stream events caused the crawling service to disconnect. Does not require auth; implemented by Relay. */ 1400 + export declare namespace ComAtprotoSyncNotifyOfUpdate { 1401 + interface Params {} 1402 + interface Input { 1403 + /** Hostname of the current service (usually a PDS) that is notifying of update. */ 1404 + hostname: string; 1405 + } 1406 + type Output = undefined; 1407 + } 1408 + 1409 + /** Request a service to persistently crawl hosted repos. Expected use is new PDS instances declaring their existence to Relays. Does not require auth. */ 1410 + export declare namespace ComAtprotoSyncRequestCrawl { 1411 + interface Params {} 1412 + interface Input { 1413 + /** Hostname of the current service (eg, PDS) that is requesting to be crawled. */ 1414 + hostname: string; 1415 + } 1416 + type Output = undefined; 1417 + } 1418 + 1419 + export declare namespace ComAtprotoSyncSubscribeRepos { 1420 + /** Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active. */ 1421 + interface Account { 1422 + [Brand.Type]?: 'com.atproto.sync.subscribeRepos#account'; 1423 + /** Indicates that the account has a repository which can be fetched from the host that emitted this event. */ 1424 + active: boolean; 1425 + did: At.DID; 1426 + seq: number; 1427 + time: string; 1428 + /** If active=false, this optional field indicates a reason for why the account is not active. */ 1429 + status?: 'deactivated' | 'deleted' | 'suspended' | 'takendown' | (string & {}); 1430 + } 1431 + /** Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature. */ 1432 + interface Commit { 1433 + [Brand.Type]?: 'com.atproto.sync.subscribeRepos#commit'; 1434 + /** List of new blobs (by CID) referenced by records in this commit. */ 1435 + blobs: At.CIDLink[]; 1436 + /** CAR file containing relevant blocks, as a diff since the previous repo state. */ 1437 + blocks: At.Bytes; 1438 + /** Repo commit object CID. */ 1439 + commit: At.CIDLink; 1440 + /** 1441 + * Maximum array length: 200 \ 1442 + * List of repo mutation operations in this commit (eg, records created, updated, or deleted). 1443 + */ 1444 + ops: RepoOp[]; 1445 + /** 1446 + * DEPRECATED -- unused 1447 + * @deprecated 1448 + */ 1449 + rebase: boolean; 1450 + /** The repo this event comes from. */ 1451 + repo: At.DID; 1452 + /** The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event. */ 1453 + rev: string; 1454 + /** The stream sequence number of this message. */ 1455 + seq: number; 1456 + /** The rev of the last emitted commit from this repo (if any). */ 1457 + since: string | null; 1458 + /** Timestamp of when this message was originally broadcast. */ 1459 + time: string; 1460 + /** Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data. */ 1461 + tooBig: boolean; 1462 + /** 1463 + * DEPRECATED -- unused. WARNING -- nullable and optional; stick with optional to ensure golang interoperability. 1464 + * @deprecated 1465 + */ 1466 + prev?: At.CIDLink | null; 1467 + } 1468 + /** 1469 + * DEPRECATED -- Use #identity event instead 1470 + * @deprecated 1471 + */ 1472 + interface Handle { 1473 + [Brand.Type]?: 'com.atproto.sync.subscribeRepos#handle'; 1474 + did: At.DID; 1475 + handle: At.Handle; 1476 + seq: number; 1477 + time: string; 1478 + } 1479 + /** Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache. */ 1480 + interface Identity { 1481 + [Brand.Type]?: 'com.atproto.sync.subscribeRepos#identity'; 1482 + did: At.DID; 1483 + seq: number; 1484 + time: string; 1485 + /** The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details. */ 1486 + handle?: At.Handle; 1487 + } 1488 + interface Info { 1489 + [Brand.Type]?: 'com.atproto.sync.subscribeRepos#info'; 1490 + name: 'OutdatedCursor' | (string & {}); 1491 + message?: string; 1492 + } 1493 + /** 1494 + * DEPRECATED -- Use #account event instead 1495 + * @deprecated 1496 + */ 1497 + interface Migrate { 1498 + [Brand.Type]?: 'com.atproto.sync.subscribeRepos#migrate'; 1499 + did: At.DID; 1500 + migrateTo: string | null; 1501 + seq: number; 1502 + time: string; 1503 + } 1504 + /** A repo operation, ie a mutation of a single record. */ 1505 + interface RepoOp { 1506 + [Brand.Type]?: 'com.atproto.sync.subscribeRepos#repoOp'; 1507 + action: 'create' | 'delete' | 'update' | (string & {}); 1508 + /** For creates and updates, the new record CID. For deletions, null. */ 1509 + cid: At.CIDLink | null; 1510 + path: string; 1511 + } 1512 + /** 1513 + * DEPRECATED -- Use #account event instead 1514 + * @deprecated 1515 + */ 1516 + interface Tombstone { 1517 + [Brand.Type]?: 'com.atproto.sync.subscribeRepos#tombstone'; 1518 + did: At.DID; 1519 + seq: number; 1520 + time: string; 1521 + } 1522 + } 1523 + 1524 + /** Check accounts location in signup queue. */ 1525 + export declare namespace ComAtprotoTempCheckSignupQueue { 1526 + interface Params {} 1527 + type Input = undefined; 1528 + interface Output { 1529 + activated: boolean; 1530 + estimatedTimeMs?: number; 1531 + placeInQueue?: number; 1532 + } 1533 + } 1534 + 1535 + /** 1536 + * DEPRECATED: use queryLabels or subscribeLabels instead -- Fetch all labels from a labeler created after a certain date. 1537 + * @deprecated 1538 + */ 1539 + export declare namespace ComAtprotoTempFetchLabels { 1540 + interface Params { 1541 + /** 1542 + * Minimum: 1 \ 1543 + * Maximum: 250 1544 + * @default 50 1545 + */ 1546 + limit?: number; 1547 + since?: number; 1548 + } 1549 + type Input = undefined; 1550 + interface Output { 1551 + labels: ComAtprotoLabelDefs.Label[]; 1552 + } 1553 + } 1554 + 1555 + /** Request a verification code to be sent to the supplied phone number */ 1556 + export declare namespace ComAtprotoTempRequestPhoneVerification { 1557 + interface Params {} 1558 + interface Input { 1559 + phoneNumber: string; 1560 + } 1561 + type Output = undefined; 1562 + } 1563 + 1564 + export declare interface Records {} 1565 + 1566 + export declare interface Queries { 1567 + 'com.atproto.admin.getAccountInfo': { 1568 + params: ComAtprotoAdminGetAccountInfo.Params; 1569 + output: ComAtprotoAdminGetAccountInfo.Output; 1570 + }; 1571 + 'com.atproto.admin.getAccountInfos': { 1572 + params: ComAtprotoAdminGetAccountInfos.Params; 1573 + output: ComAtprotoAdminGetAccountInfos.Output; 1574 + }; 1575 + 'com.atproto.admin.getInviteCodes': { 1576 + params: ComAtprotoAdminGetInviteCodes.Params; 1577 + output: ComAtprotoAdminGetInviteCodes.Output; 1578 + }; 1579 + 'com.atproto.admin.getSubjectStatus': { 1580 + params: ComAtprotoAdminGetSubjectStatus.Params; 1581 + output: ComAtprotoAdminGetSubjectStatus.Output; 1582 + }; 1583 + 'com.atproto.admin.searchAccounts': { 1584 + params: ComAtprotoAdminSearchAccounts.Params; 1585 + output: ComAtprotoAdminSearchAccounts.Output; 1586 + }; 1587 + 'com.atproto.identity.getRecommendedDidCredentials': { 1588 + output: ComAtprotoIdentityGetRecommendedDidCredentials.Output; 1589 + }; 1590 + 'com.atproto.identity.resolveHandle': { 1591 + params: ComAtprotoIdentityResolveHandle.Params; 1592 + output: ComAtprotoIdentityResolveHandle.Output; 1593 + }; 1594 + 'com.atproto.label.queryLabels': { 1595 + params: ComAtprotoLabelQueryLabels.Params; 1596 + output: ComAtprotoLabelQueryLabels.Output; 1597 + }; 1598 + 'com.atproto.repo.describeRepo': { 1599 + params: ComAtprotoRepoDescribeRepo.Params; 1600 + output: ComAtprotoRepoDescribeRepo.Output; 1601 + }; 1602 + 'com.atproto.repo.getRecord': { 1603 + params: ComAtprotoRepoGetRecord.Params; 1604 + output: ComAtprotoRepoGetRecord.Output; 1605 + }; 1606 + 'com.atproto.repo.listMissingBlobs': { 1607 + params: ComAtprotoRepoListMissingBlobs.Params; 1608 + output: ComAtprotoRepoListMissingBlobs.Output; 1609 + }; 1610 + 'com.atproto.repo.listRecords': { 1611 + params: ComAtprotoRepoListRecords.Params; 1612 + output: ComAtprotoRepoListRecords.Output; 1613 + }; 1614 + 'com.atproto.server.checkAccountStatus': { 1615 + output: ComAtprotoServerCheckAccountStatus.Output; 1616 + }; 1617 + 'com.atproto.server.describeServer': { 1618 + output: ComAtprotoServerDescribeServer.Output; 1619 + }; 1620 + 'com.atproto.server.getAccountInviteCodes': { 1621 + params: ComAtprotoServerGetAccountInviteCodes.Params; 1622 + output: ComAtprotoServerGetAccountInviteCodes.Output; 1623 + }; 1624 + 'com.atproto.server.getServiceAuth': { 1625 + params: ComAtprotoServerGetServiceAuth.Params; 1626 + output: ComAtprotoServerGetServiceAuth.Output; 1627 + }; 1628 + 'com.atproto.server.getSession': { 1629 + output: ComAtprotoServerGetSession.Output; 1630 + }; 1631 + 'com.atproto.server.listAppPasswords': { 1632 + output: ComAtprotoServerListAppPasswords.Output; 1633 + }; 1634 + 'com.atproto.sync.getBlob': { 1635 + params: ComAtprotoSyncGetBlob.Params; 1636 + output: ComAtprotoSyncGetBlob.Output; 1637 + }; 1638 + 'com.atproto.sync.getBlocks': { 1639 + params: ComAtprotoSyncGetBlocks.Params; 1640 + output: ComAtprotoSyncGetBlocks.Output; 1641 + }; 1642 + 'com.atproto.sync.getCheckout': { 1643 + params: ComAtprotoSyncGetCheckout.Params; 1644 + output: ComAtprotoSyncGetCheckout.Output; 1645 + }; 1646 + 'com.atproto.sync.getHead': { 1647 + params: ComAtprotoSyncGetHead.Params; 1648 + output: ComAtprotoSyncGetHead.Output; 1649 + }; 1650 + 'com.atproto.sync.getLatestCommit': { 1651 + params: ComAtprotoSyncGetLatestCommit.Params; 1652 + output: ComAtprotoSyncGetLatestCommit.Output; 1653 + }; 1654 + 'com.atproto.sync.getRecord': { 1655 + params: ComAtprotoSyncGetRecord.Params; 1656 + output: ComAtprotoSyncGetRecord.Output; 1657 + }; 1658 + 'com.atproto.sync.getRepo': { 1659 + params: ComAtprotoSyncGetRepo.Params; 1660 + output: ComAtprotoSyncGetRepo.Output; 1661 + }; 1662 + 'com.atproto.sync.getRepoStatus': { 1663 + params: ComAtprotoSyncGetRepoStatus.Params; 1664 + output: ComAtprotoSyncGetRepoStatus.Output; 1665 + }; 1666 + 'com.atproto.sync.listBlobs': { 1667 + params: ComAtprotoSyncListBlobs.Params; 1668 + output: ComAtprotoSyncListBlobs.Output; 1669 + }; 1670 + 'com.atproto.sync.listRepos': { 1671 + params: ComAtprotoSyncListRepos.Params; 1672 + output: ComAtprotoSyncListRepos.Output; 1673 + }; 1674 + 'com.atproto.temp.checkSignupQueue': { 1675 + output: ComAtprotoTempCheckSignupQueue.Output; 1676 + }; 1677 + 'com.atproto.temp.fetchLabels': { 1678 + params: ComAtprotoTempFetchLabels.Params; 1679 + output: ComAtprotoTempFetchLabels.Output; 1680 + }; 1681 + } 1682 + 1683 + export declare interface Procedures { 1684 + 'com.atproto.admin.deleteAccount': { 1685 + input: ComAtprotoAdminDeleteAccount.Input; 1686 + }; 1687 + 'com.atproto.admin.disableAccountInvites': { 1688 + input: ComAtprotoAdminDisableAccountInvites.Input; 1689 + }; 1690 + 'com.atproto.admin.disableInviteCodes': { 1691 + input: ComAtprotoAdminDisableInviteCodes.Input; 1692 + }; 1693 + 'com.atproto.admin.enableAccountInvites': { 1694 + input: ComAtprotoAdminEnableAccountInvites.Input; 1695 + }; 1696 + 'com.atproto.admin.sendEmail': { 1697 + input: ComAtprotoAdminSendEmail.Input; 1698 + output: ComAtprotoAdminSendEmail.Output; 1699 + }; 1700 + 'com.atproto.admin.updateAccountEmail': { 1701 + input: ComAtprotoAdminUpdateAccountEmail.Input; 1702 + }; 1703 + 'com.atproto.admin.updateAccountHandle': { 1704 + input: ComAtprotoAdminUpdateAccountHandle.Input; 1705 + }; 1706 + 'com.atproto.admin.updateAccountPassword': { 1707 + input: ComAtprotoAdminUpdateAccountPassword.Input; 1708 + }; 1709 + 'com.atproto.admin.updateSubjectStatus': { 1710 + input: ComAtprotoAdminUpdateSubjectStatus.Input; 1711 + output: ComAtprotoAdminUpdateSubjectStatus.Output; 1712 + }; 1713 + 'com.atproto.identity.requestPlcOperationSignature': {}; 1714 + 'com.atproto.identity.signPlcOperation': { 1715 + input: ComAtprotoIdentitySignPlcOperation.Input; 1716 + output: ComAtprotoIdentitySignPlcOperation.Output; 1717 + }; 1718 + 'com.atproto.identity.submitPlcOperation': { 1719 + input: ComAtprotoIdentitySubmitPlcOperation.Input; 1720 + }; 1721 + 'com.atproto.identity.updateHandle': { 1722 + input: ComAtprotoIdentityUpdateHandle.Input; 1723 + }; 1724 + 'com.atproto.moderation.createReport': { 1725 + input: ComAtprotoModerationCreateReport.Input; 1726 + output: ComAtprotoModerationCreateReport.Output; 1727 + }; 1728 + 'com.atproto.repo.applyWrites': { 1729 + input: ComAtprotoRepoApplyWrites.Input; 1730 + }; 1731 + 'com.atproto.repo.createRecord': { 1732 + input: ComAtprotoRepoCreateRecord.Input; 1733 + output: ComAtprotoRepoCreateRecord.Output; 1734 + }; 1735 + 'com.atproto.repo.deleteRecord': { 1736 + input: ComAtprotoRepoDeleteRecord.Input; 1737 + }; 1738 + 'com.atproto.repo.importRepo': { 1739 + input: ComAtprotoRepoImportRepo.Input; 1740 + }; 1741 + 'com.atproto.repo.putRecord': { 1742 + input: ComAtprotoRepoPutRecord.Input; 1743 + output: ComAtprotoRepoPutRecord.Output; 1744 + }; 1745 + 'com.atproto.repo.uploadBlob': { 1746 + input: ComAtprotoRepoUploadBlob.Input; 1747 + output: ComAtprotoRepoUploadBlob.Output; 1748 + }; 1749 + 'com.atproto.server.activateAccount': {}; 1750 + 'com.atproto.server.confirmEmail': { 1751 + input: ComAtprotoServerConfirmEmail.Input; 1752 + }; 1753 + 'com.atproto.server.createAccount': { 1754 + input: ComAtprotoServerCreateAccount.Input; 1755 + output: ComAtprotoServerCreateAccount.Output; 1756 + }; 1757 + 'com.atproto.server.createAppPassword': { 1758 + input: ComAtprotoServerCreateAppPassword.Input; 1759 + output: ComAtprotoServerCreateAppPassword.Output; 1760 + }; 1761 + 'com.atproto.server.createInviteCode': { 1762 + input: ComAtprotoServerCreateInviteCode.Input; 1763 + output: ComAtprotoServerCreateInviteCode.Output; 1764 + }; 1765 + 'com.atproto.server.createInviteCodes': { 1766 + input: ComAtprotoServerCreateInviteCodes.Input; 1767 + output: ComAtprotoServerCreateInviteCodes.Output; 1768 + }; 1769 + 'com.atproto.server.createSession': { 1770 + input: ComAtprotoServerCreateSession.Input; 1771 + output: ComAtprotoServerCreateSession.Output; 1772 + }; 1773 + 'com.atproto.server.deactivateAccount': { 1774 + input: ComAtprotoServerDeactivateAccount.Input; 1775 + }; 1776 + 'com.atproto.server.deleteAccount': { 1777 + input: ComAtprotoServerDeleteAccount.Input; 1778 + }; 1779 + 'com.atproto.server.deleteSession': {}; 1780 + 'com.atproto.server.refreshSession': { 1781 + output: ComAtprotoServerRefreshSession.Output; 1782 + }; 1783 + 'com.atproto.server.requestAccountDelete': {}; 1784 + 'com.atproto.server.requestEmailConfirmation': {}; 1785 + 'com.atproto.server.requestEmailUpdate': { 1786 + output: ComAtprotoServerRequestEmailUpdate.Output; 1787 + }; 1788 + 'com.atproto.server.requestPasswordReset': { 1789 + input: ComAtprotoServerRequestPasswordReset.Input; 1790 + }; 1791 + 'com.atproto.server.reserveSigningKey': { 1792 + input: ComAtprotoServerReserveSigningKey.Input; 1793 + output: ComAtprotoServerReserveSigningKey.Output; 1794 + }; 1795 + 'com.atproto.server.resetPassword': { 1796 + input: ComAtprotoServerResetPassword.Input; 1797 + }; 1798 + 'com.atproto.server.revokeAppPassword': { 1799 + input: ComAtprotoServerRevokeAppPassword.Input; 1800 + }; 1801 + 'com.atproto.server.updateEmail': { 1802 + input: ComAtprotoServerUpdateEmail.Input; 1803 + }; 1804 + 'com.atproto.sync.notifyOfUpdate': { 1805 + input: ComAtprotoSyncNotifyOfUpdate.Input; 1806 + }; 1807 + 'com.atproto.sync.requestCrawl': { 1808 + input: ComAtprotoSyncRequestCrawl.Input; 1809 + }; 1810 + 'com.atproto.temp.requestPhoneVerification': { 1811 + input: ComAtprotoTempRequestPhoneVerification.Input; 1812 + }; 1813 + }
+25
packages/client/package.json
··· 1 + { 2 + "type": "module", 3 + "name": "@atcute/client", 4 + "version": "1.0.0", 5 + "description": "lightweight and cute API client for AT Protocol", 6 + "license": "MIT", 7 + "repository": { 8 + "url": "https://codeberg.org/mary-ext/atcute" 9 + }, 10 + "files": [ 11 + "dist/" 12 + ], 13 + "exports": { 14 + ".": "./dist/index.js", 15 + "./lexicons": "./dist/lexicons.js" 16 + }, 17 + "scripts": { 18 + "build": "tsc", 19 + "generate": "./scripts/generate-lexicons.sh", 20 + "prepublish": "rm -rf dist; pnpm run build" 21 + }, 22 + "devDependencies": { 23 + "@atcute/lex-cli": "workspace:^" 24 + } 25 + }
+6
packages/client/scripts/generate-lexicons.sh
··· 1 + #/usr/bin/env bash 2 + 3 + pnpm exec lex-cli generate-main \ 4 + ../../lexicons/com/atproto/**/*.json \ 5 + -o lib/lexicons.ts \ 6 + --description "Contains type declarations for AT Protocol lexicons"
+22
packages/client/tsconfig.json
··· 1 + { 2 + "compilerOptions": { 3 + "outDir": "dist/", 4 + "esModuleInterop": true, 5 + "skipLibCheck": true, 6 + "target": "ESNext", 7 + "allowJs": true, 8 + "resolveJsonModule": true, 9 + "moduleDetection": "force", 10 + "isolatedModules": true, 11 + "verbatimModuleSyntax": true, 12 + "strict": true, 13 + "noImplicitOverride": true, 14 + "noUnusedLocals": true, 15 + "noUnusedParameters": true, 16 + "noFallthroughCasesInSwitch": true, 17 + "module": "NodeNext", 18 + "sourceMap": true, 19 + "declaration": true, 20 + }, 21 + "include": ["lib"], 22 + }
+1
packages/lex-cli/cli.mjs
··· 1 + import './dist/index.js';
+28
packages/lex-cli/package.json
··· 1 + { 2 + "type": "module", 3 + "name": "@atcute/lex-cli", 4 + "version": "1.0.0", 5 + "description": "cli tool to generate type definitions for atcute", 6 + "license": "MIT", 7 + "repository": { 8 + "url": "https://codeberg.org/mary-ext/atcute" 9 + }, 10 + "files": [ 11 + "dist/", 12 + "cli.mjs" 13 + ], 14 + "bin": "./cli.mjs", 15 + "scripts": { 16 + "build": "tsc", 17 + "prepublish": "rm -rf dist; pnpm run build" 18 + }, 19 + "dependencies": { 20 + "@badrap/valita": "^0.3.9", 21 + "@externdefs/collider": "^0.1.0", 22 + "picocolors": "^1.0.1", 23 + "prettier": "^3.3.3" 24 + }, 25 + "devDependencies": { 26 + "@types/node": "^22.3.0" 27 + } 28 + }
+536
packages/lex-cli/src/generator.ts
··· 1 + import { readFile } from 'node:fs/promises'; 2 + 3 + import { 4 + documentSchema, 5 + type DocumentSchema, 6 + type RefVariantSchema, 7 + type UserTypeSchema, 8 + type XrpcParametersSchema, 9 + } from './schema.js'; 10 + 11 + const toUpperCache: Record<string, string> = Object.create(null); 12 + const toNamespaceCache: Record<string, string> = Object.create(null); 13 + 14 + const toUpper = (s: string) => { 15 + return (toUpperCache[s] ??= s[0].toUpperCase() + s.slice(1)); 16 + }; 17 + const toNamespace = (s: string) => { 18 + return (toNamespaceCache[s] ??= s.replace(/^\w|\.\w/g, (m) => m[m.length === 1 ? 0 : 1].toUpperCase())); 19 + }; 20 + 21 + const sortName: (a: string, b: string) => number = (() => { 22 + const collator = new Intl.Collator('en-US'); 23 + return (a, b) => collator.compare(a, b); 24 + })(); 25 + 26 + const sortDefinition = (a: string, b: string) => { 27 + const aIsMain = a === 'main'; 28 + const bIsMain = b === 'main'; 29 + 30 + if (aIsMain === bIsMain) { 31 + return sortName(a, b); 32 + } 33 + 34 + return +bIsMain - +aIsMain; 35 + }; 36 + 37 + const writeJsdoc = (descriptions: string[]) => { 38 + const len = descriptions.length; 39 + 40 + if (len === 0) { 41 + return ''; 42 + } 43 + 44 + if (len === 1) { 45 + return `\n/** ${descriptions[0]} */\n`; 46 + } 47 + 48 + let jsdoc = '\n/**'; 49 + 50 + for (let idx = 0; idx < len; idx++) { 51 + const suffix = idx !== len - 1 && descriptions[idx + 1][0] !== '@'; 52 + jsdoc += `\n * ${descriptions[idx]}${suffix ? ` \\` : ''}`; 53 + } 54 + 55 + jsdoc += `\n */\n`; 56 + return jsdoc; 57 + }; 58 + 59 + const resolveType = ( 60 + nsid: string, 61 + def: UserTypeSchema | RefVariantSchema | XrpcParametersSchema, 62 + ): { value: string; descriptions: string[] } => { 63 + const type = def.type; 64 + 65 + /** @type {string[]} */ 66 + let descs = []; 67 + let val = 'unknown'; 68 + 69 + if (def.description) { 70 + descs.push(def.description); 71 + 72 + if (def.description.toLowerCase().startsWith('deprecated')) { 73 + descs.push(`@deprecated`); 74 + } 75 + } 76 + 77 + if (type === 'unknown') { 78 + val = 'unknown'; 79 + } else if (type === 'cid-link') { 80 + val = 'At.CIDLink'; 81 + } else if (type === 'integer') { 82 + val = 'number'; 83 + 84 + if (def.minimum !== undefined) { 85 + descs.push(`Minimum: ${def.minimum}`); 86 + } 87 + 88 + if (def.maximum !== undefined) { 89 + descs.push(`Maximum: ${def.maximum}`); 90 + } 91 + 92 + if (def.default !== undefined) { 93 + descs.push(`@default ${def.default}`); 94 + } 95 + } else if (type === 'boolean') { 96 + val = 'boolean'; 97 + 98 + if (def.default !== undefined) { 99 + descs.push(`@default ${def.default}`); 100 + } 101 + } else if (type === 'string') { 102 + const enums = def.enum; 103 + const known = def.knownValues; 104 + const format = def.format; 105 + 106 + if (format !== undefined) { 107 + if (format === 'did') { 108 + val = 'At.DID'; 109 + } else if (format === 'cid') { 110 + val = 'At.CID'; 111 + } else if (format === 'handle') { 112 + val = 'At.Handle'; 113 + } else if (format === 'at-uri') { 114 + val = 'At.Uri'; 115 + } else if ( 116 + format === 'at-identifier' || 117 + format === 'datetime' || 118 + format === 'language' || 119 + format === 'nsid' || 120 + format === 'uri' 121 + ) { 122 + // deliberately ignored 123 + val = 'string'; 124 + } else { 125 + console.warn(`${nsid}: unknown format ${format}`); 126 + val = 'string'; 127 + } 128 + } else { 129 + if (def.minLength !== undefined) { 130 + descs.push(`Minimum string length: ${def.minLength}`); 131 + } 132 + 133 + if (def.maxLength !== undefined) { 134 + descs.push(`Maximum string length: ${def.maxLength}`); 135 + } 136 + 137 + if (def.maxGraphemes !== undefined) { 138 + descs.push(`Maximum grapheme length: ${def.maxGraphemes}`); 139 + } 140 + 141 + if (def.default !== undefined) { 142 + descs.push(`@default ${JSON.stringify(def.default)}`); 143 + } 144 + 145 + if (enums) { 146 + val = enums.map((val) => JSON.stringify(val)).join('|'); 147 + } else if (known) { 148 + val = `${known 149 + .toSorted(sortName) 150 + .map((val) => JSON.stringify(val)) 151 + .join('|')} | (string & {})`; 152 + } else { 153 + val = 'string'; 154 + } 155 + } 156 + } else if (type === 'array') { 157 + const { value, descriptions } = resolveType(`${nsid}/0`, def.items); 158 + 159 + if (def.minLength !== undefined) { 160 + descs.push(`Minimum array length: ${def.minLength}`); 161 + } 162 + 163 + if (def.maxLength !== undefined) { 164 + descs.push(`Maximum array length: ${def.maxLength}`); 165 + } 166 + 167 + val = `(${value})[]`; 168 + descs = descs.concat(descriptions); 169 + } else if (type === 'blob') { 170 + // const accept = def.accept?.map((mime) => `\`${mime.replaceAll('*', '${string}')}\``); 171 + // val = `At.Blob${accept ? `<${accept.join('|')}>` : ''}`; 172 + 173 + val = `At.Blob`; 174 + } else if (type === 'ref') { 175 + const [ns, ref] = def.ref.split('#'); 176 + val = (ns ? toNamespace(ns) + '.' : '') + (ref ? toUpper(ref) : 'Main'); 177 + } else if (type === 'union') { 178 + const refs = def.refs.toSorted(sortName).map((raw) => { 179 + const [ns, ref] = raw.split('#'); 180 + return (ns ? toNamespace(ns) + '.' : '') + (ref ? toUpper(ref) : 'Main'); 181 + }); 182 + 183 + val = `Brand.Union<${refs.join('|')}>`; 184 + } else if (type === 'object' || type === 'params') { 185 + const required = def.required; 186 + const nullable = type === 'object' ? def.nullable : []; 187 + const properties = def.properties; 188 + 189 + const propKeys = Object.keys(properties).sort((a, b) => { 190 + const aIsOptional = !required || !required.includes(a); 191 + const bIsOptional = !required || !required.includes(b); 192 + 193 + if (aIsOptional === bIsOptional) { 194 + return sortName(a, b); 195 + } 196 + 197 + return +aIsOptional - +bIsOptional; 198 + }); 199 + 200 + let chunk = '{'; 201 + 202 + for (const prop of propKeys) { 203 + const isOptional = !required || !required.includes(prop); 204 + const isNullable = nullable !== undefined && nullable.includes(prop); 205 + const { value, descriptions } = resolveType(`${nsid}/${prop}`, properties[prop]); 206 + 207 + chunk += writeJsdoc(descriptions); 208 + chunk += `${prop}${isOptional ? `?` : ``}:${value}${isNullable ? `| null` : ``};`; 209 + } 210 + 211 + chunk += '}'; 212 + val = chunk; 213 + } else if (type === 'bytes') { 214 + val = `At.Bytes`; 215 + } else { 216 + console.log(`${nsid}: unknown type ${type}`); 217 + } 218 + 219 + return { value: val, descriptions: descs }; 220 + }; 221 + 222 + export interface GenerateDefinitionsOptions { 223 + files: string[]; 224 + main: boolean; 225 + banner?: string; 226 + description?: string; 227 + } 228 + 229 + const mainPrelude = `type ObjectOmit<T, K extends keyof any> = Omit<T, K>; 230 + 231 + /** Handles type branding in objects */ 232 + export declare namespace Brand { 233 + /** Symbol used to brand objects, this does not actually exist in runtime */ 234 + const Type: unique symbol; 235 + 236 + /** Get the intended \`$type\` field */ 237 + type GetType<T extends { [Type]?: string }> = NonNullable<T[typeof Type]>; 238 + 239 + /** Creates a union of objects where it's discriminated by \`$type\` field. */ 240 + type Union<T extends { [Type]?: string }> = T extends any ? T & { $type: GetType<T> } : never; 241 + 242 + /** Omits the type branding from object */ 243 + type Omit<T extends { [Type]?: string }> = ObjectOmit<T, typeof Type>; 244 + } 245 + 246 + /** Base AT Protocol schema types */ 247 + export declare namespace At { 248 + /** CID string */ 249 + type CID = string; 250 + 251 + /** DID of a user */ 252 + type DID = \`did:\${string}\`; 253 + 254 + /** User handle */ 255 + type Handle = string; 256 + 257 + /** URI string */ 258 + type Uri = string; 259 + 260 + /** Object containing a CID string */ 261 + interface CIDLink { 262 + $link: CID; 263 + } 264 + 265 + /** Object containing a base64-encoded bytes */ 266 + interface Bytes { 267 + $bytes: string; 268 + } 269 + 270 + /** Blob interface */ 271 + interface Blob<T extends string = string> { 272 + $type: 'blob'; 273 + mimeType: T; 274 + ref: { 275 + $link: string; 276 + }; 277 + size: number; 278 + } 279 + }`; 280 + 281 + export const generateDefinitions = async (opts: GenerateDefinitionsOptions) => { 282 + const { files, main, banner, description } = opts; 283 + 284 + let queries = ''; 285 + let procedures = ''; 286 + let records = ''; 287 + 288 + let code = `/* eslint-disable */ 289 + // This file is automatically generated, do not edit!`; 290 + 291 + if (description) { 292 + code += `\n\n/** 293 + * @module 294 + * ${description} 295 + */`; 296 + } 297 + 298 + if (main) { 299 + code += `\n\n${banner ?? ''}\n${mainPrelude}`; 300 + } else { 301 + code += `\n\nimport "@atcute/client/lexicons";${banner ?? ''} 302 + 303 + declare module "@atcute/client/lexicons" {`; 304 + } 305 + 306 + for await (const filename of files.sort(sortName)) { 307 + let document: DocumentSchema; 308 + 309 + try { 310 + const jsonString = await readFile(filename, 'utf8'); 311 + document = documentSchema.parse(JSON.parse(jsonString)); 312 + } catch (err) { 313 + throw new Error(`failed to read ${filename}`, { cause: err }); 314 + } 315 + 316 + const ns = document.id; 317 + const tsNamespace = toNamespace(ns); 318 + 319 + const descs = []; 320 + 321 + let chunk = ''; 322 + 323 + const definitions = document.defs; 324 + const keys = Object.keys(definitions).sort(sortDefinition); 325 + 326 + for (const key of keys) { 327 + const def = definitions[key]; 328 + const type = def.type; 329 + 330 + const nsid = `${ns}${key !== 'main' ? `#${key}` : ''}`; 331 + const typeName = key[0].toUpperCase() + key.slice(1); 332 + 333 + if (type === 'string') { 334 + const { value, descriptions } = resolveType(nsid, def); 335 + 336 + chunk += writeJsdoc(descriptions); 337 + chunk += `type ${typeName} = ${value};`; 338 + } else if (type === 'token') { 339 + chunk += `type ${typeName} = '${nsid}';`; 340 + } else if (type === 'object') { 341 + const required = def.required; 342 + const nullable = def.nullable; 343 + const properties = def.properties; 344 + 345 + const propKeys = Object.keys(properties).sort((a, b) => { 346 + const aIsOptional = !required || !required.includes(a); 347 + const bIsOptional = !required || !required.includes(b); 348 + 349 + if (aIsOptional === bIsOptional) { 350 + return sortName(a, b); 351 + } 352 + 353 + return +aIsOptional - +bIsOptional; 354 + }); 355 + 356 + const descs = []; 357 + 358 + if (def.description) { 359 + descs.push(def.description); 360 + 361 + if (def.description.toLowerCase().startsWith('deprecated')) { 362 + descs.push(`@deprecated`); 363 + } 364 + } 365 + 366 + chunk += writeJsdoc(descs); 367 + chunk += `interface ${typeName} {`; 368 + chunk += `[Brand.Type]?: '${nsid}';`; 369 + 370 + for (const prop of propKeys) { 371 + const isOptional = !required || !required.includes(prop); 372 + const isNullable = nullable !== undefined && nullable.includes(prop); 373 + const { value, descriptions } = resolveType(`${nsid}/${prop}`, properties[prop]); 374 + 375 + chunk += writeJsdoc(descriptions); 376 + chunk += `${prop}${isOptional ? `?` : ``}:${value}${isNullable ? `| null` : ``};`; 377 + } 378 + 379 + chunk += '}'; 380 + } else if (type === 'array') { 381 + const { value, descriptions } = resolveType(nsid, def.items); 382 + const descs = []; 383 + 384 + if (def.maxLength !== undefined) { 385 + descs.push(`Maximum array length: ${def.maxLength}`); 386 + } 387 + 388 + if (def.minLength !== undefined) { 389 + descs.push(`Minimum array length: ${def.minLength}`); 390 + } 391 + 392 + chunk += writeJsdoc(descs.concat(descriptions)); 393 + chunk += `type ${typeName} = (${value})[];`; 394 + } else if (type === 'record') { 395 + const { value, descriptions } = resolveType(nsid, def.record); 396 + 397 + chunk += writeJsdoc(descriptions); 398 + chunk += `interface Record`; 399 + chunk += value; 400 + 401 + records += `\n'${nsid}': ${tsNamespace}.Record;`; 402 + } else if (type === 'query' || type === 'procedure') { 403 + let parameters = def.parameters; 404 + 405 + const input = type === 'procedure' ? def.input : undefined; 406 + const output = def.output; 407 + const errors = def.errors; 408 + 409 + if (def.description) { 410 + descs.push(def.description); 411 + 412 + if (def.description.toLowerCase().startsWith('deprecated')) { 413 + descs.push(`@deprecated`); 414 + } 415 + } 416 + 417 + if (parameters) { 418 + if (Object.values(parameters.properties).length === 0) { 419 + parameters = undefined; 420 + } else { 421 + const { value, descriptions } = resolveType(nsid, parameters); 422 + 423 + chunk += writeJsdoc(descriptions); 424 + chunk += `interface Params ${value}`; 425 + } 426 + } else { 427 + chunk += `interface Params {}`; 428 + } 429 + 430 + if (input) { 431 + if (input.encoding === 'application/json') { 432 + const { value, descriptions } = resolveType(nsid, input.schema!); 433 + 434 + chunk += writeJsdoc(descriptions); 435 + 436 + if (input.schema!.type === 'object') { 437 + chunk += `interface Input ${value}`; 438 + } else { 439 + chunk += `type Input = ${value};`; 440 + } 441 + } else { 442 + chunk += `type Input = Blob | ArrayBufferView;`; 443 + } 444 + } else { 445 + chunk += `type Input = undefined;`; 446 + } 447 + 448 + if (output) { 449 + if (output.encoding === 'application/json') { 450 + const { value, descriptions } = resolveType(nsid, output.schema!); 451 + 452 + chunk += writeJsdoc(descriptions); 453 + 454 + if (output.schema!.type === 'object') { 455 + chunk += `interface Output ${value}`; 456 + } else { 457 + chunk += `type Output = ${value};`; 458 + } 459 + } else { 460 + chunk += `type Output = Uint8Array;`; 461 + } 462 + } else { 463 + chunk += `type Output = undefined;`; 464 + } 465 + 466 + if (errors) { 467 + chunk += `interface Errors {`; 468 + 469 + for (const error of errors) { 470 + chunk += `${error.name}: {};`; 471 + } 472 + 473 + chunk += '}'; 474 + } 475 + 476 + { 477 + let rc = `'${ns}':{\n`; 478 + 479 + if (parameters) { 480 + rc += `params: ${tsNamespace}.Params;`; 481 + } 482 + if (input) { 483 + rc += `input: ${tsNamespace}.Input;`; 484 + } 485 + if (output) { 486 + rc += `output: ${tsNamespace}.Output;`; 487 + } 488 + 489 + rc += '};'; 490 + 491 + if (type === 'query') { 492 + queries += rc; 493 + } else if (type === 'procedure') { 494 + procedures += rc; 495 + } 496 + } 497 + } else if (type === 'blob') { 498 + const { value, descriptions } = resolveType(nsid, def); 499 + 500 + chunk += writeJsdoc(descriptions); 501 + chunk += `type ${typeName} = ${value};`; 502 + } else if (type === 'bytes') { 503 + const { value, descriptions } = resolveType(nsid, def); 504 + 505 + chunk += writeJsdoc(descriptions); 506 + chunk += `type ${typeName} = ${value};`; 507 + } else { 508 + console.log(`${nsid}: unhandled type ${type}`); 509 + } 510 + } 511 + 512 + code += writeJsdoc(descs); 513 + 514 + if (main) { 515 + code += `export declare namespace ${tsNamespace} {`; 516 + } else { 517 + code += `namespace ${tsNamespace} {`; 518 + } 519 + 520 + code += chunk; 521 + code += `}\n\n`; 522 + } 523 + 524 + if (main) { 525 + code += `export declare interface Records {${records}}\n\n`; 526 + code += `export declare interface Queries {${queries}}\n\n`; 527 + code += `export declare interface Procedures {${procedures}}\n\n`; 528 + } else { 529 + code += `interface Records {${records}}\n\n`; 530 + code += `interface Queries {${queries}}\n\n`; 531 + code += `interface Procedures {${procedures}}\n\n`; 532 + code += '}'; 533 + } 534 + 535 + return code; 536 + };
+152
packages/lex-cli/src/index.ts
··· 1 + import { writeFile } from 'node:fs/promises'; 2 + import { basename } from 'node:path'; 3 + 4 + import * as v from '@badrap/valita'; 5 + import { Builtins, Command, Option, Program } from '@externdefs/collider'; 6 + import pc from 'picocolors'; 7 + import prettier from 'prettier'; 8 + 9 + import { generateDefinitions } from './generator.js'; 10 + 11 + const program = new Program({ binaryName: 'lex-cli' }); 12 + 13 + program.register(Builtins.HelpCommand); 14 + 15 + program.register( 16 + class GenerateMainLexicons extends Command { 17 + static override paths = [['generate-main']]; 18 + 19 + static override usage = Command.Usage({ 20 + description: `Generates the main type definition file`, 21 + }); 22 + 23 + output = Option.String(['-o', '--output'], { 24 + required: false, 25 + description: 'Where to save the resulting type definition file, defaults to stdout if not passed', 26 + validator: v 27 + .string() 28 + .assert((v) => basename(v).endsWith('.ts'), `expected output file to end with .ts extension`), 29 + }); 30 + 31 + desc = Option.String(['--description'], { 32 + required: false, 33 + description: 'Module description', 34 + }); 35 + 36 + banner = Option.String(['--banner'], { 37 + required: false, 38 + description: 'Insert an arbitrary string at the beginning of the module', 39 + }); 40 + 41 + files = Option.Rest({ 42 + required: 1, 43 + name: 'files', 44 + }); 45 + 46 + async execute(): Promise<number | void> { 47 + let code: string; 48 + 49 + try { 50 + code = await generateDefinitions({ 51 + files: this.files, 52 + main: true, 53 + banner: this.banner, 54 + description: this.desc, 55 + }); 56 + } catch (err) { 57 + if (err instanceof Error) { 58 + console.error(pc.bold(`${pc.red(`error: `)}: ${err.message}`)); 59 + 60 + if (err.cause instanceof Error) { 61 + console.error(` ${pc.gray(`caused by:`)}: ${err.cause.message}`); 62 + } 63 + } else { 64 + console.error(pc.bold(pc.red(`unknown error occured:`))); 65 + console.error(err); 66 + } 67 + 68 + return 1; 69 + } 70 + 71 + const config = await prettier.resolveConfig(this.output || process.cwd(), { editorconfig: true }); 72 + const formatted = await prettier.format(code, { ...config, parser: 'typescript' }); 73 + 74 + if (this.output) { 75 + await writeFile(this.output, formatted); 76 + } else { 77 + console.log(formatted); 78 + } 79 + } 80 + }, 81 + ); 82 + 83 + program.register( 84 + class GenerateLexicons extends Command { 85 + static override paths = [['generate']]; 86 + 87 + static override usage = Command.Usage({ 88 + description: `Generates a type definition file`, 89 + }); 90 + 91 + output = Option.String(['-o', '--output'], { 92 + required: false, 93 + description: 'Where to save the resulting type definition file, defaults to stdout if not passed', 94 + validator: v 95 + .string() 96 + .assert((v) => basename(v).endsWith('.ts'), `expected output file to end with .ts extension`), 97 + }); 98 + 99 + desc = Option.String(['--description'], { 100 + required: false, 101 + description: 'Module description', 102 + }); 103 + 104 + banner = Option.String(['--banner'], { 105 + required: false, 106 + description: 'Insert an arbitrary string at the beginning of the module', 107 + }); 108 + 109 + files = Option.Rest({ 110 + required: 1, 111 + name: 'files', 112 + }); 113 + 114 + async execute(): Promise<number | void> { 115 + let code: string; 116 + 117 + try { 118 + code = await generateDefinitions({ 119 + files: this.files, 120 + main: false, 121 + banner: this.banner, 122 + description: this.desc, 123 + }); 124 + } catch (err) { 125 + if (err instanceof Error) { 126 + console.error(pc.bold(`${pc.red(`error: `)}: ${err.message}`)); 127 + 128 + if (err.cause instanceof Error) { 129 + console.error(` ${pc.gray(`caused by:`)}: ${err.cause.message}`); 130 + } 131 + } else { 132 + console.error(pc.bold(pc.red(`unknown error occured:`))); 133 + console.error(err); 134 + } 135 + 136 + return 1; 137 + } 138 + 139 + const config = await prettier.resolveConfig(this.output || process.cwd(), { editorconfig: true }); 140 + const formatted = await prettier.format(code, { ...config, parser: 'typescript' }); 141 + 142 + if (this.output) { 143 + await writeFile(this.output, formatted); 144 + } else { 145 + console.log(formatted); 146 + } 147 + } 148 + }, 149 + ); 150 + 151 + const exitCode = await program.run(process.argv.slice(2)); 152 + process.exitCode = exitCode;
+288
packages/lex-cli/src/schema.ts
··· 1 + import * as v from '@badrap/valita'; 2 + 3 + const integerType = v 4 + .number() 5 + .assert((v) => Number.isInteger(v) && v >= 0, 'Number is expected to be a positive integer'); 6 + 7 + export const booleanSchema = v.object({ 8 + type: v.literal('boolean'), 9 + description: v.string().optional(), 10 + default: v.boolean().optional(), 11 + const: v.boolean().optional(), 12 + }); 13 + 14 + export type BooleanSchema = v.Infer<typeof booleanSchema>; 15 + 16 + export const integerSchema = v.object({ 17 + type: v.literal('integer'), 18 + description: v.string().optional(), 19 + default: integerType.optional(), 20 + const: integerType.optional(), 21 + enum: v.array(v.number()).optional(), 22 + maximum: integerType.optional(), 23 + minimum: integerType.optional(), 24 + }); 25 + 26 + export type IntegerSchema = v.Infer<typeof integerSchema>; 27 + 28 + export const stringSchema = v.object({ 29 + type: v.literal('string'), 30 + description: v.string().optional(), 31 + format: v 32 + .union( 33 + v.literal('at-identifier'), 34 + v.literal('at-uri'), 35 + v.literal('cid'), 36 + v.literal('datetime'), 37 + v.literal('did'), 38 + v.literal('handle'), 39 + v.literal('language'), 40 + v.literal('nsid'), 41 + v.literal('record-key'), 42 + v.literal('tid'), 43 + v.literal('uri'), 44 + ) 45 + .optional(), 46 + default: v.string().optional(), 47 + const: v.string().optional(), 48 + enum: v.array(v.string()).optional(), 49 + knownValues: v.array(v.string()).optional(), 50 + maxLength: integerType.optional(), 51 + minLength: integerType.optional(), 52 + maxGraphemes: integerType.optional(), 53 + minGraphemes: integerType.optional(), 54 + }); 55 + 56 + export type StringSchema = v.Infer<typeof stringSchema>; 57 + 58 + export const unknownSchema = v.object({ 59 + type: v.literal('unknown'), 60 + description: v.string().optional(), 61 + }); 62 + 63 + export type UnknownSchema = v.Infer<typeof unknownSchema>; 64 + 65 + export const primitiveSchema = v.union(booleanSchema, integerSchema, stringSchema, unknownSchema); 66 + 67 + export type PrimitiveSchema = v.Infer<typeof primitiveSchema>; 68 + 69 + export const bytesSchema = v.object({ 70 + type: v.literal('bytes'), 71 + description: v.string().optional(), 72 + maxLength: integerType.optional(), 73 + minLength: integerType.optional(), 74 + }); 75 + 76 + export type BytesSchema = v.Infer<typeof bytesSchema>; 77 + 78 + export const cidLinkSchema = v.object({ 79 + type: v.literal('cid-link'), 80 + description: v.string().optional(), 81 + }); 82 + 83 + export type CidLinkSchema = v.Infer<typeof cidLinkSchema>; 84 + 85 + export const ipldTypeSchema = v.union(bytesSchema, cidLinkSchema); 86 + 87 + export type IpldTypeSchema = v.Infer<typeof ipldTypeSchema>; 88 + 89 + export const refSchema = v.object({ 90 + type: v.literal('ref'), 91 + description: v.string().optional(), 92 + ref: v.string(), 93 + }); 94 + 95 + export type RefSchema = v.Infer<typeof refSchema>; 96 + 97 + export const refUnionSchema = v.object({ 98 + type: v.literal('union'), 99 + description: v.string().optional(), 100 + refs: v.array(v.string()), 101 + closed: v.boolean().default(false), 102 + }); 103 + 104 + export type RefUnionSchema = v.Infer<typeof refUnionSchema>; 105 + 106 + export const refVariantSchema = v.union(refSchema, refUnionSchema); 107 + 108 + export type RefVariantSchema = v.Infer<typeof refVariantSchema>; 109 + 110 + export const blobSchema = v.object({ 111 + type: v.literal('blob'), 112 + description: v.string().optional(), 113 + accept: v.array(v.string()).optional(), 114 + maxSize: integerType.optional(), 115 + }); 116 + 117 + export type BlobSchema = v.Infer<typeof blobSchema>; 118 + 119 + export const arraySchema = v.object({ 120 + type: v.literal('array'), 121 + description: v.string().optional(), 122 + items: v.union(primitiveSchema, ipldTypeSchema, blobSchema, blobSchema, refVariantSchema), 123 + maxLength: integerType.optional(), 124 + minLength: integerType.optional(), 125 + }); 126 + 127 + export type ArraySchema = v.Infer<typeof arraySchema>; 128 + 129 + export const primitiveArraySchema = arraySchema.extend({ 130 + items: primitiveSchema, 131 + }); 132 + 133 + export type PrimitiveArraySchema = v.Infer<typeof primitiveArraySchema>; 134 + 135 + export const tokenSchema = v.object({ 136 + type: v.literal('token'), 137 + description: v.string().optional(), 138 + }); 139 + 140 + export type TokenSchema = v.Infer<typeof tokenSchema>; 141 + 142 + const refineRequiredProperties = <T extends { required: string[]; properties: Record<string, unknown> }>( 143 + obj: T, 144 + ): v.ValitaResult<T> => { 145 + for (const field of obj.required) { 146 + if (obj.properties[field] === undefined) { 147 + return v.err(`Required field "${field}" not defined`); 148 + } 149 + } 150 + 151 + return v.ok(obj); 152 + }; 153 + 154 + export const objectSchema = v 155 + .object({ 156 + type: v.literal('object'), 157 + description: v.string().optional(), 158 + required: v.array(v.string()).default<string[]>([]), 159 + nullable: v.array(v.string()).default<string[]>([]), 160 + properties: v.record(v.union(refVariantSchema, ipldTypeSchema, arraySchema, blobSchema, primitiveSchema)), 161 + }) 162 + .chain(refineRequiredProperties); 163 + 164 + export type ObjectSchema = v.Infer<typeof objectSchema>; 165 + 166 + export const xrpcParametersSchema = v 167 + .object({ 168 + type: v.literal('params'), 169 + description: v.string().optional(), 170 + required: v.array(v.string()).default<string[]>([]), 171 + properties: v.record(v.union(primitiveSchema, primitiveArraySchema)), 172 + }) 173 + .chain(refineRequiredProperties); 174 + 175 + export type XrpcParametersSchema = v.Infer<typeof xrpcParametersSchema>; 176 + 177 + export const xrpcBodySchema = v.object({ 178 + description: v.string().optional(), 179 + encoding: v.string(), 180 + schema: v.union(refVariantSchema, objectSchema).optional(), 181 + }); 182 + 183 + export type XrpcBodySchema = v.Infer<typeof xrpcBodySchema>; 184 + 185 + export const xrpcSubscriptionMessageSchema = v.object({ 186 + description: v.string().optional(), 187 + schema: v.union(refVariantSchema, objectSchema).optional(), 188 + }); 189 + 190 + export type XrpcSubscriptionMessageSchema = v.Infer<typeof xrpcSubscriptionMessageSchema>; 191 + 192 + export const xrpcErrorSchema = v.object({ 193 + name: v.string(), 194 + description: v.string().optional(), 195 + }); 196 + 197 + export type XrpcErrorSchema = v.Infer<typeof xrpcErrorSchema>; 198 + 199 + export const xrpcQuerySchema = v.object({ 200 + type: v.literal('query'), 201 + description: v.string().optional(), 202 + parameters: xrpcParametersSchema.optional(), 203 + output: xrpcBodySchema.optional(), 204 + errors: v.array(xrpcErrorSchema).optional(), 205 + }); 206 + 207 + export type XrpcQuerySchema = v.Infer<typeof xrpcQuerySchema>; 208 + 209 + export const xrpcProcedureSchema = v.object({ 210 + type: v.literal('procedure'), 211 + description: v.string().optional(), 212 + parameters: xrpcParametersSchema.optional(), 213 + input: xrpcBodySchema.optional(), 214 + output: xrpcBodySchema.optional(), 215 + errors: v.array(xrpcErrorSchema).optional(), 216 + }); 217 + 218 + export type XrpcProcedureSchema = v.Infer<typeof xrpcProcedureSchema>; 219 + 220 + export const xrpcSubscriptionSchema = v.object({ 221 + type: v.literal('subscription'), 222 + description: v.string().optional(), 223 + parameters: xrpcParametersSchema.optional(), 224 + message: xrpcSubscriptionMessageSchema.optional(), 225 + errors: v.array(xrpcErrorSchema).optional(), 226 + }); 227 + 228 + export type XrpcSubscriptionSchema = v.Infer<typeof xrpcSubscriptionSchema>; 229 + 230 + export const recordSchema = v.object({ 231 + type: v.literal('record'), 232 + description: v.string().optional(), 233 + key: v.string().optional(), 234 + record: objectSchema, 235 + }); 236 + 237 + export type RecordSchema = v.Infer<typeof objectSchema>; 238 + 239 + export const userTypeSchema = v.union( 240 + recordSchema, 241 + xrpcQuerySchema, 242 + xrpcProcedureSchema, 243 + xrpcSubscriptionSchema, 244 + blobSchema, 245 + arraySchema, 246 + tokenSchema, 247 + objectSchema, 248 + booleanSchema, 249 + integerSchema, 250 + stringSchema, 251 + bytesSchema, 252 + cidLinkSchema, 253 + unknownSchema, 254 + ); 255 + 256 + export type UserTypeSchema = v.Infer<typeof userTypeSchema>; 257 + 258 + const NSID_RE = 259 + /^[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(\.[a-zA-Z]([a-zA-Z]{0,61}[a-zA-Z])?)$/; 260 + const nsidType = v.string().assert((v) => NSID_RE.test(v), `string doesn't match nsid format`); 261 + 262 + export const documentSchema = v 263 + .object({ 264 + lexicon: v.literal(1), 265 + id: nsidType, 266 + revision: v.number().optional(), 267 + description: v.string().optional(), 268 + defs: v.record(userTypeSchema), 269 + }) 270 + .chain((doc) => { 271 + const defs = doc.defs; 272 + 273 + for (const id in defs) { 274 + const def = defs[id]; 275 + const type = def.type; 276 + 277 + if ( 278 + id !== 'main' && 279 + (type === 'record' || type === 'query' || type === 'procedure' || type === 'subscription') 280 + ) { 281 + return v.err({ message: `${type} must be the \`main\` definition`, path: ['defs', id] }); 282 + } 283 + } 284 + 285 + return v.ok(doc); 286 + }); 287 + 288 + export type DocumentSchema = v.Infer<typeof documentSchema>;
+22
packages/lex-cli/tsconfig.json
··· 1 + { 2 + "compilerOptions": { 3 + "outDir": "dist/", 4 + "esModuleInterop": true, 5 + "skipLibCheck": true, 6 + "target": "ESNext", 7 + "allowJs": true, 8 + "resolveJsonModule": true, 9 + "moduleDetection": "force", 10 + "isolatedModules": true, 11 + "verbatimModuleSyntax": true, 12 + "strict": true, 13 + "noImplicitOverride": true, 14 + "noUnusedLocals": true, 15 + "noUnusedParameters": true, 16 + "noFallthroughCasesInSwitch": true, 17 + "module": "NodeNext", 18 + "sourceMap": true, 19 + "declaration": true, 20 + }, 21 + "include": ["src"], 22 + }
+99
pnpm-lock.yaml
··· 1 + lockfileVersion: '9.0' 2 + 3 + settings: 4 + autoInstallPeers: true 5 + excludeLinksFromLockfile: false 6 + 7 + importers: 8 + 9 + .: 10 + devDependencies: 11 + '@mary/tar': 12 + specifier: npm:@jsr/mary__tar@^0.2.4 13 + version: '@jsr/mary__tar@0.2.4' 14 + prettier: 15 + specifier: ^3.3.3 16 + version: 3.3.3 17 + typescript: 18 + specifier: 5.6.0-beta 19 + version: 5.6.0-beta 20 + 21 + packages/client: 22 + devDependencies: 23 + '@atcute/lex-cli': 24 + specifier: workspace:^ 25 + version: link:../lex-cli 26 + 27 + packages/lex-cli: 28 + dependencies: 29 + '@badrap/valita': 30 + specifier: ^0.3.9 31 + version: 0.3.9 32 + '@externdefs/collider': 33 + specifier: ^0.1.0 34 + version: 0.1.0(@badrap/valita@0.3.9) 35 + picocolors: 36 + specifier: ^1.0.1 37 + version: 1.0.1 38 + prettier: 39 + specifier: ^3.3.3 40 + version: 3.3.3 41 + devDependencies: 42 + '@types/node': 43 + specifier: ^22.3.0 44 + version: 22.3.0 45 + 46 + packages: 47 + 48 + '@badrap/valita@0.3.9': 49 + resolution: {integrity: sha512-keFt5iCwI6H5lbvhg2ZJCWa1xRffdpk6/LHCaayubaRM2zhnRIIBE1d+2NEzXLSk4Fe/aklGNXVPt7hNkvBH6g==} 50 + engines: {node: '>= 16'} 51 + 52 + '@externdefs/collider@0.1.0': 53 + resolution: {integrity: sha512-vmFJEKHhftREiuhhK3WIMKk6bGfm7kM9c5HeVElFCbtqajXqCfwY/GR3f1G0qYWCvbtcoBhIZ2O8ia3A2/pjkw==} 54 + peerDependencies: 55 + '@badrap/valita': ^0.3.9 56 + 57 + '@jsr/mary__tar@0.2.4': 58 + resolution: {integrity: sha512-jFjPcZj8DRSukPLZOt6+h74cVFdfdTMG9gzbW67YByCJTD52PEpe2sNcfCSw4mQ8hZBNgwiufCPyYL8hR9yicA==, tarball: https://npm.jsr.io/~/11/@jsr/mary__tar/0.2.4.tgz} 59 + 60 + '@types/node@22.3.0': 61 + resolution: {integrity: sha512-nrWpWVaDZuaVc5X84xJ0vNrLvomM205oQyLsRt7OHNZbSHslcWsvgFR7O7hire2ZonjLrWBbedmotmIlJDVd6g==} 62 + 63 + picocolors@1.0.1: 64 + resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} 65 + 66 + prettier@3.3.3: 67 + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} 68 + engines: {node: '>=14'} 69 + hasBin: true 70 + 71 + typescript@5.6.0-beta: 72 + resolution: {integrity: sha512-wqVumY25SwHmCJvZPHqbWfjSyWdAqTTUM+LqaPpFccOnln54EZoPr8Ra7qJV8HMEdFYcDc+S5xro0RyvaHvIvw==} 73 + engines: {node: '>=14.17'} 74 + hasBin: true 75 + 76 + undici-types@6.18.2: 77 + resolution: {integrity: sha512-5ruQbENj95yDYJNS3TvcaxPMshV7aizdv/hWYjGIKoANWKjhWNBsr2YEuYZKodQulB1b8l7ILOuDQep3afowQQ==} 78 + 79 + snapshots: 80 + 81 + '@badrap/valita@0.3.9': {} 82 + 83 + '@externdefs/collider@0.1.0(@badrap/valita@0.3.9)': 84 + dependencies: 85 + '@badrap/valita': 0.3.9 86 + 87 + '@jsr/mary__tar@0.2.4': {} 88 + 89 + '@types/node@22.3.0': 90 + dependencies: 91 + undici-types: 6.18.2 92 + 93 + picocolors@1.0.1: {} 94 + 95 + prettier@3.3.3: {} 96 + 97 + typescript@5.6.0-beta: {} 98 + 99 + undici-types@6.18.2: {}
+2
pnpm-workspace.yaml
··· 1 + packages: 2 + - packages/*
+93
scripts/pull-lexicons.js
··· 1 + import * as path from 'node:path'; 2 + import * as fs from 'node:fs/promises'; 3 + 4 + import { untar } from '@mary/tar'; 5 + import prettier from 'prettier'; 6 + 7 + const repo = `bluesky-social/atproto`; 8 + 9 + async function main() { 10 + const config = await prettier.resolveConfig(process.cwd() + '/foo', { editorconfig: true }); 11 + 12 + let sha; 13 + { 14 + console.log(`retrieving latest commit`); 15 + const response = await fetch(`https://api.github.com/repos/${repo}/commits?path=lexicons/`); 16 + 17 + if (!response.ok) { 18 + console.log(` response error ${response.status}`); 19 + return; 20 + } 21 + 22 + const json = await response.json(); 23 + const latest = json[0]; 24 + 25 + if (!latest) { 26 + console.log(` latest commit missing?`); 27 + return; 28 + } 29 + 30 + sha = latest.sha; 31 + console.log(` got ${sha}`); 32 + } 33 + 34 + const tmpdir = `lexicons-tmp/`; 35 + 36 + { 37 + console.log(`retrieving zip file`); 38 + const response = await fetch(`https://github.com/${repo}/archive/${sha}.tar.gz`); 39 + 40 + if (!response.ok) { 41 + console.log(` response error ${response.status}`); 42 + return; 43 + } 44 + 45 + const basename = `atproto-${sha}/lexicons/`; 46 + 47 + const ds = new DecompressionStream('gzip'); 48 + const stream = response.body.pipeThrough(ds); 49 + 50 + const promises = []; 51 + 52 + console.log(` reading`); 53 + for await (const entry of untar(stream)) { 54 + if (entry.type === 'file' && entry.name.startsWith(basename)) { 55 + const name = entry.name.slice(basename.length); 56 + const basedir = tmpdir + path.dirname(name); 57 + 58 + const code = await entry.text(); 59 + 60 + const promise = (async () => { 61 + const formatted = await prettier.format(code, { ...config, parser: 'json' }); 62 + 63 + await fs.mkdir(basedir, { recursive: true }); 64 + await fs.writeFile(tmpdir + name, formatted); 65 + })(); 66 + 67 + promises.push(promise); 68 + } 69 + } 70 + 71 + console.log(` flushing writes`); 72 + await Promise.all(promises); 73 + } 74 + 75 + { 76 + const source = `https://github.com/${repo}/tree/${sha}/lexicons\n`; 77 + 78 + console.log(`writing readme file`); 79 + 80 + await fs.writeFile(tmpdir + `README.md`, source); 81 + } 82 + 83 + { 84 + const dest = `lexicons/`; 85 + 86 + console.log(`moving folder`); 87 + 88 + await fs.rm(dest, { recursive: true, force: true }); 89 + await fs.rename(tmpdir, dest); 90 + } 91 + } 92 + 93 + await main();