Parse and validate AT Protocol Lexicons with DTO generation for Laravel

Compare changes

Choose any two refs to compare.

Changed files
+25233 -839
.github
config
resources
lexicons
app
chat
com
atproto
admin
identity
label
moderation
repo
server
sync
tools
src
Console
Contracts
Data
Exceptions
Facades
Generated
App
Bsky
Actor
Embed
Feed
Graph
Labeler
Notification
Richtext
Unspecced
Video
Chat
Com
Tools
Generator
Parser
Services
Support
Validation
stubs
tests
Integration
Unit
-2
.github/workflows/code-style.yml
··· 1 1 name: Code Style 2 2 3 3 on: 4 - push: 5 - branches: [ main, dev ] 6 4 pull_request: 7 5 branches: [ main, dev ] 8 6
-2
.github/workflows/tests.yml
··· 1 1 name: Tests 2 2 3 3 on: 4 - push: 5 - branches: [ main, dev ] 6 4 pull_request: 7 5 branches: [ main, dev ] 8 6
+1
.gitignore
··· 1 1 .DS_Store 2 + .phpunit.cache 2 3 .phpunit.result.cache 3 4 .php-cs-fixer.cache 4 5 composer.lock
+126 -13
README.md
··· 29 29 - **Union types** - Full support for discriminated unions with `$type` fields 30 30 - **Extensible** - Macros and hooks let you customize behavior 31 31 - **Production ready** - 818 passing tests with comprehensive coverage 32 + - **Pre-generated classes** - Includes type-safe PHP classes for all standard AT Protocol & Bluesky lexicons 33 + 34 + ## Pre-Generated Lexicon Classes 35 + 36 + Schema ships with pre-generated PHP classes for all standard AT Protocol and Bluesky lexicons, providing immediate type-safe access without any generation step: 37 + 38 + ```php 39 + use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Post; 40 + use SocialDept\AtpSchema\Generated\App\Bsky\Graph\Follow; 41 + use SocialDept\AtpSchema\Generated\Com\Atproto\Repo\StrongRef; 42 + 43 + // Create type-safe records 44 + $post = new Post( 45 + text: 'Hello ATP!', 46 + createdAt: now() 47 + ); 48 + 49 + // Create references 50 + $ref = new StrongRef( 51 + uri: 'at://did:plc:example/app.bsky.feed.post/123', 52 + cid: 'bafyreic3...' 53 + ); 54 + 55 + // Validate and use 56 + Schema::validate('app.bsky.feed.post', $post); // true 57 + ``` 58 + 59 + ### Available Pre-Generated Classes 60 + 61 + Schema includes **220+ pre-generated classes** covering all standard AT Protocol and Bluesky lexicons: 62 + 63 + **Record Types (`SocialDept\AtpSchema\Generated\App\Bsky\*`)** 64 + - `Feed\Post` - Social media posts 65 + - `Feed\Like` - Like records 66 + - `Feed\Repost` - Repost records 67 + - `Graph\Follow` - Follow relationships 68 + - `Graph\Block` - Block records 69 + - `Graph\List` - User lists 70 + - `Graph\Listitem` - List items 71 + - `Labeler\Service` - Labeler service records 72 + 73 + **Embed Types** 74 + - `Embed\Images` - Image embeds 75 + - `Embed\External` - External link embeds 76 + - `Embed\Record` - Record embeds 77 + - `Embed\RecordWithMedia` - Record with media embeds 78 + - `Embed\Video` - Video embeds 79 + 80 + **Feed & Post Views (`App\Bsky\Feed\Defs\*`)** 81 + - `PostView` - Post with engagement metrics 82 + - `FeedViewPost` - Post in feed context 83 + - `ThreadViewPost` - Post in thread context 84 + - `ReplyRef` - Reply references 85 + - `ViewerState` - User's interaction state 86 + 87 + **Actor & Profile Views (`App\Bsky\Actor\Defs\*`)** 88 + - `ProfileView` - Full profile view 89 + - `ProfileViewBasic` - Basic profile view 90 + - `ProfileViewDetailed` - Detailed profile view 91 + - `ViewerState` - Viewer's relationship to profile 92 + - Plus 25+ preference and state classes 93 + 94 + **Graph & Social Views (`App\Bsky\Graph\Defs\*`)** 95 + - `ListView` - List views 96 + - `ListItemView` - List item views 97 + - `Relationship` - User relationships 98 + - `StarterPackView` - Starter pack views 99 + 100 + **Rich Text (`App\Bsky\Richtext\Facet\*`)** 101 + - `Facet` - Text annotations (mentions, URLs, hashtags) 102 + - `Mention` - User mention facets 103 + - `Link` - URL link facets 104 + - `Tag` - Hashtag facets 105 + 106 + **AT Protocol Core (`Com\Atproto\*`)** 107 + - `Repo\StrongRef` - Content-addressed record references 108 + - `Repo\Defs\CommitMeta` - Repository commit metadata 109 + - `Label\Defs\Label` - Content labels 110 + - `Admin\Defs\*` - Administrative tools (20+ classes) 111 + - `Sync\SubscribeRepos\*` - Repository sync events (6+ classes) 112 + - `Server\Defs\*` - Server definitions 113 + 114 + **Moderation (`Tools\Ozone\*`)** 115 + - `Moderation\Defs\*` - Moderation definitions 116 + - `Communication\Defs\*` - Moderation communication 117 + 118 + ### Generated Enums 119 + 120 + Schema also generates PHP 8.1+ enums for string types with known values: 121 + 122 + **Moderation** 123 + - `Com\Atproto\Moderation\ReasonType` - Report reason types (spam, violation, etc.) 124 + - `Com\Atproto\Moderation\SubjectType` - Report subject types (account, record, chat) 125 + 126 + **Labels & Content** 127 + - `Com\Atproto\Label\LabelValue` - Content label values 128 + 129 + **Graph & Social** 130 + - `App\Bsky\Graph\ListPurpose` - List purpose types (modlist, curatelist) 131 + - `App\Bsky\Actor\MutedWordTarget` - Muted word target types 132 + 133 + **Moderation Tools** 134 + - `Tools\Ozone\Moderation\SubjectReviewState` - Review state values 135 + 136 + ### Publishing Source Lexicons 137 + 138 + Developers can optionally publish the source JSON lexicons to their project for reference or custom generation: 139 + 140 + ```bash 141 + php artisan vendor:publish --tag=atp-lexicons 142 + ``` 143 + 144 + This copies all lexicon JSON files to `resources/lexicons/`. 32 145 33 146 ## Quick Example 34 147 35 148 ```php 36 - use SocialDept\Schema\Data\LexiconDocument; 37 - use SocialDept\Schema\Validation\Validator; 38 - use SocialDept\Schema\Parser\SchemaLoader; 149 + use SocialDept\AtpSchema\Data\LexiconDocument; 150 + use SocialDept\AtpSchema\Validation\Validator; 151 + use SocialDept\AtpSchema\Parser\SchemaLoader; 39 152 40 153 // Load a schema 41 154 $schema = LexiconDocument::fromArray([ ··· 92 205 Choose the validation strictness that fits your use case: 93 206 94 207 ```php 95 - use SocialDept\Schema\Validation\Validator; 208 + use SocialDept\AtpSchema\Validation\Validator; 96 209 97 210 // STRICT - Rejects unknown fields 98 211 $validator->setMode(Validator::MODE_STRICT); ··· 109 222 Upload and validate files with built-in constraints: 110 223 111 224 ```php 112 - use SocialDept\Schema\Services\BlobHandler; 225 + use SocialDept\AtpSchema\Services\BlobHandler; 113 226 114 227 $blobHandler = new BlobHandler('local'); 115 228 ··· 129 242 Transform between raw arrays and domain objects: 130 243 131 244 ```php 132 - use SocialDept\Schema\Services\ModelMapper; 133 - use SocialDept\Schema\Contracts\Transformer; 245 + use SocialDept\AtpSchema\Services\ModelMapper; 246 + use SocialDept\AtpSchema\Contracts\Transformer; 134 247 135 248 class Post 136 249 { ··· 177 290 Work with discriminated unions using the `$type` field: 178 291 179 292 ```php 180 - use SocialDept\Schema\Services\UnionResolver; 293 + use SocialDept\AtpSchema\Services\UnionResolver; 181 294 182 295 $resolver = new UnionResolver(); 183 296 ··· 199 312 Here's how to validate a post with an image upload: 200 313 201 314 ```php 202 - use SocialDept\Schema\Data\LexiconDocument; 203 - use SocialDept\Schema\Validation\Validator; 204 - use SocialDept\Schema\Services\BlobHandler; 315 + use SocialDept\AtpSchema\Data\LexiconDocument; 316 + use SocialDept\AtpSchema\Validation\Validator; 317 + use SocialDept\AtpSchema\Services\BlobHandler; 205 318 206 319 // Load schema 207 320 $schema = LexiconDocument::fromArray([/* ... */]); ··· 268 381 Add custom logic at key points in the validation lifecycle: 269 382 270 383 ```php 271 - use SocialDept\Schema\Support\ExtensionManager; 384 + use SocialDept\AtpSchema\Support\ExtensionManager; 272 385 273 386 $extensions = new ExtensionManager(); 274 387 ··· 285 398 Extend core services with custom methods: 286 399 287 400 ```php 288 - use SocialDept\Schema\Services\ModelMapper; 401 + use SocialDept\AtpSchema\Services\ModelMapper; 289 402 290 403 ModelMapper::macro('validateAndTransform', function ($type, $data, $schema) { 291 404 if (!$this->validator->validate($data, $schema)) {
+4 -4
composer.json
··· 21 21 }, 22 22 "autoload": { 23 23 "psr-4": { 24 - "SocialDept\\Schema\\": "src/" 24 + "SocialDept\\AtpSchema\\": "src/" 25 25 }, 26 26 "files": [ 27 27 "src/helpers.php" ··· 29 29 }, 30 30 "autoload-dev": { 31 31 "psr-4": { 32 - "SocialDept\\Schema\\Tests\\": "tests/" 32 + "SocialDept\\AtpSchema\\Tests\\": "tests/" 33 33 } 34 34 }, 35 35 "extra": { 36 36 "laravel": { 37 37 "providers": [ 38 - "SocialDept\\Schema\\SchemaServiceProvider" 38 + "SocialDept\\AtpSchema\\SchemaServiceProvider" 39 39 ], 40 40 "aliases": { 41 - "Schema": "SocialDept\\Schema\\Facades\\Schema" 41 + "Schema": "SocialDept\\AtpSchema\\Facades\\Schema" 42 42 } 43 43 } 44 44 }
+22
config/schema.php
··· 79 79 80 80 /* 81 81 |-------------------------------------------------------------------------- 82 + | Bundled Pre-Generated Classes 83 + |-------------------------------------------------------------------------- 84 + | 85 + | The package includes pre-generated PHP classes for all standard 86 + | AT Protocol and Bluesky lexicons in the SocialDept\AtpSchema\Generated 87 + | namespace. These provide immediate type-safe access to records. 88 + | 89 + */ 90 + 91 + 'generated' => [ 92 + // Namespace for bundled pre-generated classes 93 + 'namespace' => 'SocialDept\\AtpSchema\\Generated', 94 + 95 + // Enable usage of bundled generated classes 96 + 'enabled' => env('SCHEMA_USE_GENERATED', true), 97 + ], 98 + 99 + /* 100 + |-------------------------------------------------------------------------- 82 101 | Caching Configuration 83 102 |-------------------------------------------------------------------------- 84 103 | ··· 133 152 'blobs' => [ 134 153 // Storage disk for blobs 135 154 'disk' => env('SCHEMA_BLOB_DISK', 'local'), 155 + 156 + // Storage path prefix for blobs 157 + 'path' => env('SCHEMA_BLOB_PATH', 'blobs'), 136 158 137 159 // Lazy load blob content (don't download until accessed) 138 160 'lazy_load' => env('SCHEMA_BLOB_LAZY_LOAD', true),
+9 -13
phpunit.xml
··· 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <phpunit bootstrap="vendor/autoload.php" 3 - backupGlobals="false" 4 - backupStaticAttributes="false" 5 3 colors="true" 6 - verbose="true" 7 - convertErrorsToExceptions="true" 8 - convertNoticesToExceptions="true" 9 - convertWarningsToExceptions="true" 10 - processIsolation="false" 11 - stopOnFailure="false"> 4 + failOnWarning="false" 5 + failOnRisky="false" 6 + cacheDirectory=".phpunit.cache"> 12 7 <testsuites> 13 8 <testsuite name="Schema Test Suite"> 14 - <directory suffix=".php">./tests/</directory> 9 + <directory suffix="Test.php">./tests/</directory> 10 + <exclude>./tests/fixtures/</exclude> 15 11 </testsuite> 16 12 </testsuites> 17 - <filter> 18 - <whitelist> 13 + <source> 14 + <include> 19 15 <directory>src/</directory> 20 - </whitelist> 21 - </filter> 16 + </include> 17 + </source> 22 18 </phpunit>
+647
resources/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 + "pronouns": { "type": "string" }, 17 + "avatar": { "type": "string", "format": "uri" }, 18 + "associated": { 19 + "type": "ref", 20 + "ref": "#profileAssociated" 21 + }, 22 + "viewer": { "type": "ref", "ref": "#viewerState" }, 23 + "labels": { 24 + "type": "array", 25 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 26 + }, 27 + "createdAt": { "type": "string", "format": "datetime" }, 28 + "verification": { 29 + "type": "ref", 30 + "ref": "#verificationState" 31 + }, 32 + "status": { 33 + "type": "ref", 34 + "ref": "#statusView" 35 + }, 36 + "debug": { 37 + "type": "unknown", 38 + "description": "Debug information for internal development" 39 + } 40 + } 41 + }, 42 + "profileView": { 43 + "type": "object", 44 + "required": ["did", "handle"], 45 + "properties": { 46 + "did": { "type": "string", "format": "did" }, 47 + "handle": { "type": "string", "format": "handle" }, 48 + "displayName": { 49 + "type": "string", 50 + "maxGraphemes": 64, 51 + "maxLength": 640 52 + }, 53 + "pronouns": { "type": "string" }, 54 + "description": { 55 + "type": "string", 56 + "maxGraphemes": 256, 57 + "maxLength": 2560 58 + }, 59 + "avatar": { "type": "string", "format": "uri" }, 60 + "associated": { 61 + "type": "ref", 62 + "ref": "#profileAssociated" 63 + }, 64 + "indexedAt": { "type": "string", "format": "datetime" }, 65 + "createdAt": { "type": "string", "format": "datetime" }, 66 + "viewer": { "type": "ref", "ref": "#viewerState" }, 67 + "labels": { 68 + "type": "array", 69 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 70 + }, 71 + "verification": { 72 + "type": "ref", 73 + "ref": "#verificationState" 74 + }, 75 + "status": { 76 + "type": "ref", 77 + "ref": "#statusView" 78 + }, 79 + "debug": { 80 + "type": "unknown", 81 + "description": "Debug information for internal development" 82 + } 83 + } 84 + }, 85 + "profileViewDetailed": { 86 + "type": "object", 87 + "required": ["did", "handle"], 88 + "properties": { 89 + "did": { "type": "string", "format": "did" }, 90 + "handle": { "type": "string", "format": "handle" }, 91 + "displayName": { 92 + "type": "string", 93 + "maxGraphemes": 64, 94 + "maxLength": 640 95 + }, 96 + "description": { 97 + "type": "string", 98 + "maxGraphemes": 256, 99 + "maxLength": 2560 100 + }, 101 + "pronouns": { "type": "string" }, 102 + "website": { "type": "string", "format": "uri" }, 103 + "avatar": { "type": "string", "format": "uri" }, 104 + "banner": { "type": "string", "format": "uri" }, 105 + "followersCount": { "type": "integer" }, 106 + "followsCount": { "type": "integer" }, 107 + "postsCount": { "type": "integer" }, 108 + "associated": { 109 + "type": "ref", 110 + "ref": "#profileAssociated" 111 + }, 112 + "joinedViaStarterPack": { 113 + "type": "ref", 114 + "ref": "app.bsky.graph.defs#starterPackViewBasic" 115 + }, 116 + "indexedAt": { "type": "string", "format": "datetime" }, 117 + "createdAt": { "type": "string", "format": "datetime" }, 118 + "viewer": { "type": "ref", "ref": "#viewerState" }, 119 + "labels": { 120 + "type": "array", 121 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 122 + }, 123 + "pinnedPost": { 124 + "type": "ref", 125 + "ref": "com.atproto.repo.strongRef" 126 + }, 127 + "verification": { 128 + "type": "ref", 129 + "ref": "#verificationState" 130 + }, 131 + "status": { 132 + "type": "ref", 133 + "ref": "#statusView" 134 + }, 135 + "debug": { 136 + "type": "unknown", 137 + "description": "Debug information for internal development" 138 + } 139 + } 140 + }, 141 + "profileAssociated": { 142 + "type": "object", 143 + "properties": { 144 + "lists": { "type": "integer" }, 145 + "feedgens": { "type": "integer" }, 146 + "starterPacks": { "type": "integer" }, 147 + "labeler": { "type": "boolean" }, 148 + "chat": { "type": "ref", "ref": "#profileAssociatedChat" }, 149 + "activitySubscription": { 150 + "type": "ref", 151 + "ref": "#profileAssociatedActivitySubscription" 152 + } 153 + } 154 + }, 155 + "profileAssociatedChat": { 156 + "type": "object", 157 + "required": ["allowIncoming"], 158 + "properties": { 159 + "allowIncoming": { 160 + "type": "string", 161 + "knownValues": ["all", "none", "following"] 162 + } 163 + } 164 + }, 165 + "profileAssociatedActivitySubscription": { 166 + "type": "object", 167 + "required": ["allowSubscriptions"], 168 + "properties": { 169 + "allowSubscriptions": { 170 + "type": "string", 171 + "knownValues": ["followers", "mutuals", "none"] 172 + } 173 + } 174 + }, 175 + "viewerState": { 176 + "type": "object", 177 + "description": "Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.", 178 + "properties": { 179 + "muted": { "type": "boolean" }, 180 + "mutedByList": { 181 + "type": "ref", 182 + "ref": "app.bsky.graph.defs#listViewBasic" 183 + }, 184 + "blockedBy": { "type": "boolean" }, 185 + "blocking": { "type": "string", "format": "at-uri" }, 186 + "blockingByList": { 187 + "type": "ref", 188 + "ref": "app.bsky.graph.defs#listViewBasic" 189 + }, 190 + "following": { "type": "string", "format": "at-uri" }, 191 + "followedBy": { "type": "string", "format": "at-uri" }, 192 + "knownFollowers": { 193 + "description": "This property is present only in selected cases, as an optimization.", 194 + "type": "ref", 195 + "ref": "#knownFollowers" 196 + }, 197 + "activitySubscription": { 198 + "description": "This property is present only in selected cases, as an optimization.", 199 + "type": "ref", 200 + "ref": "app.bsky.notification.defs#activitySubscription" 201 + } 202 + } 203 + }, 204 + "knownFollowers": { 205 + "type": "object", 206 + "description": "The subject's followers whom you also follow", 207 + "required": ["count", "followers"], 208 + "properties": { 209 + "count": { "type": "integer" }, 210 + "followers": { 211 + "type": "array", 212 + "minLength": 0, 213 + "maxLength": 5, 214 + "items": { 215 + "type": "ref", 216 + "ref": "#profileViewBasic" 217 + } 218 + } 219 + } 220 + }, 221 + "verificationState": { 222 + "type": "object", 223 + "description": "Represents the verification information about the user this object is attached to.", 224 + "required": ["verifications", "verifiedStatus", "trustedVerifierStatus"], 225 + "properties": { 226 + "verifications": { 227 + "type": "array", 228 + "description": "All verifications issued by trusted verifiers on behalf of this user. Verifications by untrusted verifiers are not included.", 229 + "items": { "type": "ref", "ref": "#verificationView" } 230 + }, 231 + "verifiedStatus": { 232 + "type": "string", 233 + "description": "The user's status as a verified account.", 234 + "knownValues": ["valid", "invalid", "none"] 235 + }, 236 + "trustedVerifierStatus": { 237 + "type": "string", 238 + "description": "The user's status as a trusted verifier.", 239 + "knownValues": ["valid", "invalid", "none"] 240 + } 241 + } 242 + }, 243 + "verificationView": { 244 + "type": "object", 245 + "description": "An individual verification for an associated subject.", 246 + "required": ["issuer", "uri", "isValid", "createdAt"], 247 + "properties": { 248 + "issuer": { 249 + "type": "string", 250 + "description": "The user who issued this verification.", 251 + "format": "did" 252 + }, 253 + "uri": { 254 + "type": "string", 255 + "description": "The AT-URI of the verification record.", 256 + "format": "at-uri" 257 + }, 258 + "isValid": { 259 + "type": "boolean", 260 + "description": "True if the verification passes validation, otherwise false." 261 + }, 262 + "createdAt": { 263 + "type": "string", 264 + "description": "Timestamp when the verification was created.", 265 + "format": "datetime" 266 + } 267 + } 268 + }, 269 + "preferences": { 270 + "type": "array", 271 + "items": { 272 + "type": "union", 273 + "refs": [ 274 + "#adultContentPref", 275 + "#contentLabelPref", 276 + "#savedFeedsPref", 277 + "#savedFeedsPrefV2", 278 + "#personalDetailsPref", 279 + "#feedViewPref", 280 + "#threadViewPref", 281 + "#interestsPref", 282 + "#mutedWordsPref", 283 + "#hiddenPostsPref", 284 + "#bskyAppStatePref", 285 + "#labelersPref", 286 + "#postInteractionSettingsPref", 287 + "#verificationPrefs" 288 + ] 289 + } 290 + }, 291 + "adultContentPref": { 292 + "type": "object", 293 + "required": ["enabled"], 294 + "properties": { 295 + "enabled": { "type": "boolean", "default": false } 296 + } 297 + }, 298 + "contentLabelPref": { 299 + "type": "object", 300 + "required": ["label", "visibility"], 301 + "properties": { 302 + "labelerDid": { 303 + "type": "string", 304 + "description": "Which labeler does this preference apply to? If undefined, applies globally.", 305 + "format": "did" 306 + }, 307 + "label": { "type": "string" }, 308 + "visibility": { 309 + "type": "string", 310 + "knownValues": ["ignore", "show", "warn", "hide"] 311 + } 312 + } 313 + }, 314 + "savedFeed": { 315 + "type": "object", 316 + "required": ["id", "type", "value", "pinned"], 317 + "properties": { 318 + "id": { 319 + "type": "string" 320 + }, 321 + "type": { 322 + "type": "string", 323 + "knownValues": ["feed", "list", "timeline"] 324 + }, 325 + "value": { 326 + "type": "string" 327 + }, 328 + "pinned": { 329 + "type": "boolean" 330 + } 331 + } 332 + }, 333 + "savedFeedsPrefV2": { 334 + "type": "object", 335 + "required": ["items"], 336 + "properties": { 337 + "items": { 338 + "type": "array", 339 + "items": { 340 + "type": "ref", 341 + "ref": "app.bsky.actor.defs#savedFeed" 342 + } 343 + } 344 + } 345 + }, 346 + "savedFeedsPref": { 347 + "type": "object", 348 + "required": ["pinned", "saved"], 349 + "properties": { 350 + "pinned": { 351 + "type": "array", 352 + "items": { 353 + "type": "string", 354 + "format": "at-uri" 355 + } 356 + }, 357 + "saved": { 358 + "type": "array", 359 + "items": { 360 + "type": "string", 361 + "format": "at-uri" 362 + } 363 + }, 364 + "timelineIndex": { 365 + "type": "integer" 366 + } 367 + } 368 + }, 369 + "personalDetailsPref": { 370 + "type": "object", 371 + "properties": { 372 + "birthDate": { 373 + "type": "string", 374 + "format": "datetime", 375 + "description": "The birth date of account owner." 376 + } 377 + } 378 + }, 379 + "feedViewPref": { 380 + "type": "object", 381 + "required": ["feed"], 382 + "properties": { 383 + "feed": { 384 + "type": "string", 385 + "description": "The URI of the feed, or an identifier which describes the feed." 386 + }, 387 + "hideReplies": { 388 + "type": "boolean", 389 + "description": "Hide replies in the feed." 390 + }, 391 + "hideRepliesByUnfollowed": { 392 + "type": "boolean", 393 + "description": "Hide replies in the feed if they are not by followed users.", 394 + "default": true 395 + }, 396 + "hideRepliesByLikeCount": { 397 + "type": "integer", 398 + "description": "Hide replies in the feed if they do not have this number of likes." 399 + }, 400 + "hideReposts": { 401 + "type": "boolean", 402 + "description": "Hide reposts in the feed." 403 + }, 404 + "hideQuotePosts": { 405 + "type": "boolean", 406 + "description": "Hide quote posts in the feed." 407 + } 408 + } 409 + }, 410 + "threadViewPref": { 411 + "type": "object", 412 + "properties": { 413 + "sort": { 414 + "type": "string", 415 + "description": "Sorting mode for threads.", 416 + "knownValues": ["oldest", "newest", "most-likes", "random", "hotness"] 417 + } 418 + } 419 + }, 420 + "interestsPref": { 421 + "type": "object", 422 + "required": ["tags"], 423 + "properties": { 424 + "tags": { 425 + "type": "array", 426 + "maxLength": 100, 427 + "items": { "type": "string", "maxLength": 640, "maxGraphemes": 64 }, 428 + "description": "A list of tags which describe the account owner's interests gathered during onboarding." 429 + } 430 + } 431 + }, 432 + "mutedWordTarget": { 433 + "type": "string", 434 + "knownValues": ["content", "tag"], 435 + "maxLength": 640, 436 + "maxGraphemes": 64 437 + }, 438 + "mutedWord": { 439 + "type": "object", 440 + "description": "A word that the account owner has muted.", 441 + "required": ["value", "targets"], 442 + "properties": { 443 + "id": { "type": "string" }, 444 + "value": { 445 + "type": "string", 446 + "description": "The muted word itself.", 447 + "maxLength": 10000, 448 + "maxGraphemes": 1000 449 + }, 450 + "targets": { 451 + "type": "array", 452 + "description": "The intended targets of the muted word.", 453 + "items": { 454 + "type": "ref", 455 + "ref": "app.bsky.actor.defs#mutedWordTarget" 456 + } 457 + }, 458 + "actorTarget": { 459 + "type": "string", 460 + "description": "Groups of users to apply the muted word to. If undefined, applies to all users.", 461 + "knownValues": ["all", "exclude-following"], 462 + "default": "all" 463 + }, 464 + "expiresAt": { 465 + "type": "string", 466 + "format": "datetime", 467 + "description": "The date and time at which the muted word will expire and no longer be applied." 468 + } 469 + } 470 + }, 471 + "mutedWordsPref": { 472 + "type": "object", 473 + "required": ["items"], 474 + "properties": { 475 + "items": { 476 + "type": "array", 477 + "items": { 478 + "type": "ref", 479 + "ref": "app.bsky.actor.defs#mutedWord" 480 + }, 481 + "description": "A list of words the account owner has muted." 482 + } 483 + } 484 + }, 485 + "hiddenPostsPref": { 486 + "type": "object", 487 + "required": ["items"], 488 + "properties": { 489 + "items": { 490 + "type": "array", 491 + "items": { "type": "string", "format": "at-uri" }, 492 + "description": "A list of URIs of posts the account owner has hidden." 493 + } 494 + } 495 + }, 496 + "labelersPref": { 497 + "type": "object", 498 + "required": ["labelers"], 499 + "properties": { 500 + "labelers": { 501 + "type": "array", 502 + "items": { 503 + "type": "ref", 504 + "ref": "#labelerPrefItem" 505 + } 506 + } 507 + } 508 + }, 509 + "labelerPrefItem": { 510 + "type": "object", 511 + "required": ["did"], 512 + "properties": { 513 + "did": { 514 + "type": "string", 515 + "format": "did" 516 + } 517 + } 518 + }, 519 + "bskyAppStatePref": { 520 + "description": "A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this.", 521 + "type": "object", 522 + "properties": { 523 + "activeProgressGuide": { 524 + "type": "ref", 525 + "ref": "#bskyAppProgressGuide" 526 + }, 527 + "queuedNudges": { 528 + "description": "An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user.", 529 + "type": "array", 530 + "maxLength": 1000, 531 + "items": { "type": "string", "maxLength": 100 } 532 + }, 533 + "nuxs": { 534 + "description": "Storage for NUXs the user has encountered.", 535 + "type": "array", 536 + "maxLength": 100, 537 + "items": { 538 + "type": "ref", 539 + "ref": "app.bsky.actor.defs#nux" 540 + } 541 + } 542 + } 543 + }, 544 + "bskyAppProgressGuide": { 545 + "description": "If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress.", 546 + "type": "object", 547 + "required": ["guide"], 548 + "properties": { 549 + "guide": { "type": "string", "maxLength": 100 } 550 + } 551 + }, 552 + "nux": { 553 + "type": "object", 554 + "description": "A new user experiences (NUX) storage object", 555 + "required": ["id", "completed"], 556 + "properties": { 557 + "id": { 558 + "type": "string", 559 + "maxLength": 100 560 + }, 561 + "completed": { 562 + "type": "boolean", 563 + "default": false 564 + }, 565 + "data": { 566 + "description": "Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters.", 567 + "type": "string", 568 + "maxLength": 3000, 569 + "maxGraphemes": 300 570 + }, 571 + "expiresAt": { 572 + "type": "string", 573 + "format": "datetime", 574 + "description": "The date and time at which the NUX will expire and should be considered completed." 575 + } 576 + } 577 + }, 578 + "verificationPrefs": { 579 + "type": "object", 580 + "description": "Preferences for how verified accounts appear in the app.", 581 + "required": [], 582 + "properties": { 583 + "hideBadges": { 584 + "description": "Hide the blue check badges for verified accounts and trusted verifiers.", 585 + "type": "boolean", 586 + "default": false 587 + } 588 + } 589 + }, 590 + "postInteractionSettingsPref": { 591 + "type": "object", 592 + "description": "Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly.", 593 + "required": [], 594 + "properties": { 595 + "threadgateAllowRules": { 596 + "description": "Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply.", 597 + "type": "array", 598 + "maxLength": 5, 599 + "items": { 600 + "type": "union", 601 + "refs": [ 602 + "app.bsky.feed.threadgate#mentionRule", 603 + "app.bsky.feed.threadgate#followerRule", 604 + "app.bsky.feed.threadgate#followingRule", 605 + "app.bsky.feed.threadgate#listRule" 606 + ] 607 + } 608 + }, 609 + "postgateEmbeddingRules": { 610 + "description": "Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed.", 611 + "type": "array", 612 + "maxLength": 5, 613 + "items": { 614 + "type": "union", 615 + "refs": ["app.bsky.feed.postgate#disableRule"] 616 + } 617 + } 618 + } 619 + }, 620 + "statusView": { 621 + "type": "object", 622 + "required": ["status", "record"], 623 + "properties": { 624 + "status": { 625 + "type": "string", 626 + "description": "The status for the account.", 627 + "knownValues": ["app.bsky.actor.status#live"] 628 + }, 629 + "record": { "type": "unknown" }, 630 + "embed": { 631 + "type": "union", 632 + "description": "An optional embed associated with the status.", 633 + "refs": ["app.bsky.embed.external#view"] 634 + }, 635 + "expiresAt": { 636 + "type": "string", 637 + "description": "The date when this status will expire. The application might choose to no longer return the status after expiration.", 638 + "format": "datetime" 639 + }, 640 + "isActive": { 641 + "type": "boolean", 642 + "description": "True if the status is not expired, false if it is expired. Only present if expiration was set." 643 + } 644 + } 645 + } 646 + } 647 + }
+28
resources/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
resources/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 + }
+43
resources/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 + "recId": { 35 + "type": "integer", 36 + "description": "Snowflake for this recommendation, use when submitting recommendation events." 37 + } 38 + } 39 + } 40 + } 41 + } 42 + } 43 + }
+15
resources/lexicons/app/bsky/embed/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.embed.defs", 4 + "defs": { 5 + "aspectRatio": { 6 + "type": "object", 7 + "description": "width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.", 8 + "required": ["width", "height"], 9 + "properties": { 10 + "width": { "type": "integer", "minimum": 1 }, 11 + "height": { "type": "integer", "minimum": 1 } 12 + } 13 + } 14 + } 15 + }
+51
resources/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 + }
+72
resources/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": { 31 + "type": "ref", 32 + "ref": "app.bsky.embed.defs#aspectRatio" 33 + } 34 + } 35 + }, 36 + "view": { 37 + "type": "object", 38 + "required": ["images"], 39 + "properties": { 40 + "images": { 41 + "type": "array", 42 + "items": { "type": "ref", "ref": "#viewImage" }, 43 + "maxLength": 4 44 + } 45 + } 46 + }, 47 + "viewImage": { 48 + "type": "object", 49 + "required": ["thumb", "fullsize", "alt"], 50 + "properties": { 51 + "thumb": { 52 + "type": "string", 53 + "format": "uri", 54 + "description": "Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View." 55 + }, 56 + "fullsize": { 57 + "type": "string", 58 + "format": "uri", 59 + "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." 60 + }, 61 + "alt": { 62 + "type": "string", 63 + "description": "Alt text description of the image, for accessibility." 64 + }, 65 + "aspectRatio": { 66 + "type": "ref", 67 + "ref": "app.bsky.embed.defs#aspectRatio" 68 + } 69 + } 70 + } 71 + } 72 + }
+96
resources/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 + "#viewDetached", 24 + "app.bsky.feed.defs#generatorView", 25 + "app.bsky.graph.defs#listView", 26 + "app.bsky.labeler.defs#labelerView", 27 + "app.bsky.graph.defs#starterPackViewBasic" 28 + ] 29 + } 30 + } 31 + }, 32 + "viewRecord": { 33 + "type": "object", 34 + "required": ["uri", "cid", "author", "value", "indexedAt"], 35 + "properties": { 36 + "uri": { "type": "string", "format": "at-uri" }, 37 + "cid": { "type": "string", "format": "cid" }, 38 + "author": { 39 + "type": "ref", 40 + "ref": "app.bsky.actor.defs#profileViewBasic" 41 + }, 42 + "value": { 43 + "type": "unknown", 44 + "description": "The record data itself." 45 + }, 46 + "labels": { 47 + "type": "array", 48 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 49 + }, 50 + "replyCount": { "type": "integer" }, 51 + "repostCount": { "type": "integer" }, 52 + "likeCount": { "type": "integer" }, 53 + "quoteCount": { "type": "integer" }, 54 + "embeds": { 55 + "type": "array", 56 + "items": { 57 + "type": "union", 58 + "refs": [ 59 + "app.bsky.embed.images#view", 60 + "app.bsky.embed.video#view", 61 + "app.bsky.embed.external#view", 62 + "app.bsky.embed.record#view", 63 + "app.bsky.embed.recordWithMedia#view" 64 + ] 65 + } 66 + }, 67 + "indexedAt": { "type": "string", "format": "datetime" } 68 + } 69 + }, 70 + "viewNotFound": { 71 + "type": "object", 72 + "required": ["uri", "notFound"], 73 + "properties": { 74 + "uri": { "type": "string", "format": "at-uri" }, 75 + "notFound": { "type": "boolean", "const": true } 76 + } 77 + }, 78 + "viewBlocked": { 79 + "type": "object", 80 + "required": ["uri", "blocked", "author"], 81 + "properties": { 82 + "uri": { "type": "string", "format": "at-uri" }, 83 + "blocked": { "type": "boolean", "const": true }, 84 + "author": { "type": "ref", "ref": "app.bsky.feed.defs#blockedAuthor" } 85 + } 86 + }, 87 + "viewDetached": { 88 + "type": "object", 89 + "required": ["uri", "detached"], 90 + "properties": { 91 + "uri": { "type": "string", "format": "at-uri" }, 92 + "detached": { "type": "boolean", "const": true } 93 + } 94 + } 95 + } 96 + }
+43
resources/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": [ 17 + "app.bsky.embed.images", 18 + "app.bsky.embed.video", 19 + "app.bsky.embed.external" 20 + ] 21 + } 22 + } 23 + }, 24 + "view": { 25 + "type": "object", 26 + "required": ["record", "media"], 27 + "properties": { 28 + "record": { 29 + "type": "ref", 30 + "ref": "app.bsky.embed.record#view" 31 + }, 32 + "media": { 33 + "type": "union", 34 + "refs": [ 35 + "app.bsky.embed.images#view", 36 + "app.bsky.embed.video#view", 37 + "app.bsky.embed.external#view" 38 + ] 39 + } 40 + } 41 + } 42 + } 43 + }
+67
resources/lexicons/app/bsky/embed/video.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.embed.video", 4 + "description": "A video embedded in a Bluesky record (eg, a post).", 5 + "defs": { 6 + "main": { 7 + "type": "object", 8 + "required": ["video"], 9 + "properties": { 10 + "video": { 11 + "type": "blob", 12 + "description": "The mp4 video file. May be up to 100mb, formerly limited to 50mb.", 13 + "accept": ["video/mp4"], 14 + "maxSize": 100000000 15 + }, 16 + "captions": { 17 + "type": "array", 18 + "items": { "type": "ref", "ref": "#caption" }, 19 + "maxLength": 20 20 + }, 21 + "alt": { 22 + "type": "string", 23 + "description": "Alt text description of the video, for accessibility.", 24 + "maxGraphemes": 1000, 25 + "maxLength": 10000 26 + }, 27 + "aspectRatio": { 28 + "type": "ref", 29 + "ref": "app.bsky.embed.defs#aspectRatio" 30 + } 31 + } 32 + }, 33 + "caption": { 34 + "type": "object", 35 + "required": ["lang", "file"], 36 + "properties": { 37 + "lang": { 38 + "type": "string", 39 + "format": "language" 40 + }, 41 + "file": { 42 + "type": "blob", 43 + "accept": ["text/vtt"], 44 + "maxSize": 20000 45 + } 46 + } 47 + }, 48 + "view": { 49 + "type": "object", 50 + "required": ["cid", "playlist"], 51 + "properties": { 52 + "cid": { "type": "string", "format": "cid" }, 53 + "playlist": { "type": "string", "format": "uri" }, 54 + "thumbnail": { "type": "string", "format": "uri" }, 55 + "alt": { 56 + "type": "string", 57 + "maxGraphemes": 1000, 58 + "maxLength": 10000 59 + }, 60 + "aspectRatio": { 61 + "type": "ref", 62 + "ref": "app.bsky.embed.defs#aspectRatio" 63 + } 64 + } 65 + } 66 + } 67 + }
+331
resources/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.video#view", 21 + "app.bsky.embed.external#view", 22 + "app.bsky.embed.record#view", 23 + "app.bsky.embed.recordWithMedia#view" 24 + ] 25 + }, 26 + "bookmarkCount": { "type": "integer" }, 27 + "replyCount": { "type": "integer" }, 28 + "repostCount": { "type": "integer" }, 29 + "likeCount": { "type": "integer" }, 30 + "quoteCount": { "type": "integer" }, 31 + "indexedAt": { "type": "string", "format": "datetime" }, 32 + "viewer": { "type": "ref", "ref": "#viewerState" }, 33 + "labels": { 34 + "type": "array", 35 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 36 + }, 37 + "threadgate": { "type": "ref", "ref": "#threadgateView" }, 38 + "debug": { 39 + "type": "unknown", 40 + "description": "Debug information for internal development" 41 + } 42 + } 43 + }, 44 + "viewerState": { 45 + "type": "object", 46 + "description": "Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.", 47 + "properties": { 48 + "repost": { "type": "string", "format": "at-uri" }, 49 + "like": { "type": "string", "format": "at-uri" }, 50 + "bookmarked": { "type": "boolean" }, 51 + "threadMuted": { "type": "boolean" }, 52 + "replyDisabled": { "type": "boolean" }, 53 + "embeddingDisabled": { "type": "boolean" }, 54 + "pinned": { "type": "boolean" } 55 + } 56 + }, 57 + "threadContext": { 58 + "type": "object", 59 + "description": "Metadata about this post within the context of the thread it is in.", 60 + "properties": { 61 + "rootAuthorLike": { "type": "string", "format": "at-uri" } 62 + } 63 + }, 64 + "feedViewPost": { 65 + "type": "object", 66 + "required": ["post"], 67 + "properties": { 68 + "post": { "type": "ref", "ref": "#postView" }, 69 + "reply": { "type": "ref", "ref": "#replyRef" }, 70 + "reason": { "type": "union", "refs": ["#reasonRepost", "#reasonPin"] }, 71 + "feedContext": { 72 + "type": "string", 73 + "description": "Context provided by feed generator that may be passed back alongside interactions.", 74 + "maxLength": 2000 75 + }, 76 + "reqId": { 77 + "type": "string", 78 + "description": "Unique identifier per request that may be passed back alongside interactions.", 79 + "maxLength": 100 80 + } 81 + } 82 + }, 83 + "replyRef": { 84 + "type": "object", 85 + "required": ["root", "parent"], 86 + "properties": { 87 + "root": { 88 + "type": "union", 89 + "refs": ["#postView", "#notFoundPost", "#blockedPost"] 90 + }, 91 + "parent": { 92 + "type": "union", 93 + "refs": ["#postView", "#notFoundPost", "#blockedPost"] 94 + }, 95 + "grandparentAuthor": { 96 + "type": "ref", 97 + "ref": "app.bsky.actor.defs#profileViewBasic", 98 + "description": "When parent is a reply to another post, this is the author of that post." 99 + } 100 + } 101 + }, 102 + "reasonRepost": { 103 + "type": "object", 104 + "required": ["by", "indexedAt"], 105 + "properties": { 106 + "by": { "type": "ref", "ref": "app.bsky.actor.defs#profileViewBasic" }, 107 + "uri": { "type": "string", "format": "at-uri" }, 108 + "cid": { "type": "string", "format": "cid" }, 109 + "indexedAt": { "type": "string", "format": "datetime" } 110 + } 111 + }, 112 + "reasonPin": { 113 + "type": "object", 114 + "properties": {} 115 + }, 116 + "threadViewPost": { 117 + "type": "object", 118 + "required": ["post"], 119 + "properties": { 120 + "post": { "type": "ref", "ref": "#postView" }, 121 + "parent": { 122 + "type": "union", 123 + "refs": ["#threadViewPost", "#notFoundPost", "#blockedPost"] 124 + }, 125 + "replies": { 126 + "type": "array", 127 + "items": { 128 + "type": "union", 129 + "refs": ["#threadViewPost", "#notFoundPost", "#blockedPost"] 130 + } 131 + }, 132 + "threadContext": { "type": "ref", "ref": "#threadContext" } 133 + } 134 + }, 135 + "notFoundPost": { 136 + "type": "object", 137 + "required": ["uri", "notFound"], 138 + "properties": { 139 + "uri": { "type": "string", "format": "at-uri" }, 140 + "notFound": { "type": "boolean", "const": true } 141 + } 142 + }, 143 + "blockedPost": { 144 + "type": "object", 145 + "required": ["uri", "blocked", "author"], 146 + "properties": { 147 + "uri": { "type": "string", "format": "at-uri" }, 148 + "blocked": { "type": "boolean", "const": true }, 149 + "author": { "type": "ref", "ref": "#blockedAuthor" } 150 + } 151 + }, 152 + "blockedAuthor": { 153 + "type": "object", 154 + "required": ["did"], 155 + "properties": { 156 + "did": { "type": "string", "format": "did" }, 157 + "viewer": { "type": "ref", "ref": "app.bsky.actor.defs#viewerState" } 158 + } 159 + }, 160 + "generatorView": { 161 + "type": "object", 162 + "required": ["uri", "cid", "did", "creator", "displayName", "indexedAt"], 163 + "properties": { 164 + "uri": { "type": "string", "format": "at-uri" }, 165 + "cid": { "type": "string", "format": "cid" }, 166 + "did": { "type": "string", "format": "did" }, 167 + "creator": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" }, 168 + "displayName": { "type": "string" }, 169 + "description": { 170 + "type": "string", 171 + "maxGraphemes": 300, 172 + "maxLength": 3000 173 + }, 174 + "descriptionFacets": { 175 + "type": "array", 176 + "items": { "type": "ref", "ref": "app.bsky.richtext.facet" } 177 + }, 178 + "avatar": { "type": "string", "format": "uri" }, 179 + "likeCount": { "type": "integer", "minimum": 0 }, 180 + "acceptsInteractions": { "type": "boolean" }, 181 + "labels": { 182 + "type": "array", 183 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 184 + }, 185 + "viewer": { "type": "ref", "ref": "#generatorViewerState" }, 186 + "contentMode": { 187 + "type": "string", 188 + "knownValues": [ 189 + "app.bsky.feed.defs#contentModeUnspecified", 190 + "app.bsky.feed.defs#contentModeVideo" 191 + ] 192 + }, 193 + "indexedAt": { "type": "string", "format": "datetime" } 194 + } 195 + }, 196 + "generatorViewerState": { 197 + "type": "object", 198 + "properties": { 199 + "like": { "type": "string", "format": "at-uri" } 200 + } 201 + }, 202 + "skeletonFeedPost": { 203 + "type": "object", 204 + "required": ["post"], 205 + "properties": { 206 + "post": { "type": "string", "format": "at-uri" }, 207 + "reason": { 208 + "type": "union", 209 + "refs": ["#skeletonReasonRepost", "#skeletonReasonPin"] 210 + }, 211 + "feedContext": { 212 + "type": "string", 213 + "description": "Context that will be passed through to client and may be passed to feed generator back alongside interactions.", 214 + "maxLength": 2000 215 + } 216 + } 217 + }, 218 + "skeletonReasonRepost": { 219 + "type": "object", 220 + "required": ["repost"], 221 + "properties": { 222 + "repost": { "type": "string", "format": "at-uri" } 223 + } 224 + }, 225 + "skeletonReasonPin": { 226 + "type": "object", 227 + "properties": {} 228 + }, 229 + "threadgateView": { 230 + "type": "object", 231 + "properties": { 232 + "uri": { "type": "string", "format": "at-uri" }, 233 + "cid": { "type": "string", "format": "cid" }, 234 + "record": { "type": "unknown" }, 235 + "lists": { 236 + "type": "array", 237 + "items": { "type": "ref", "ref": "app.bsky.graph.defs#listViewBasic" } 238 + } 239 + } 240 + }, 241 + "interaction": { 242 + "type": "object", 243 + "properties": { 244 + "item": { "type": "string", "format": "at-uri" }, 245 + "event": { 246 + "type": "string", 247 + "knownValues": [ 248 + "app.bsky.feed.defs#requestLess", 249 + "app.bsky.feed.defs#requestMore", 250 + "app.bsky.feed.defs#clickthroughItem", 251 + "app.bsky.feed.defs#clickthroughAuthor", 252 + "app.bsky.feed.defs#clickthroughReposter", 253 + "app.bsky.feed.defs#clickthroughEmbed", 254 + "app.bsky.feed.defs#interactionSeen", 255 + "app.bsky.feed.defs#interactionLike", 256 + "app.bsky.feed.defs#interactionRepost", 257 + "app.bsky.feed.defs#interactionReply", 258 + "app.bsky.feed.defs#interactionQuote", 259 + "app.bsky.feed.defs#interactionShare" 260 + ] 261 + }, 262 + "feedContext": { 263 + "type": "string", 264 + "description": "Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.", 265 + "maxLength": 2000 266 + }, 267 + "reqId": { 268 + "type": "string", 269 + "description": "Unique identifier per request that may be passed back alongside interactions.", 270 + "maxLength": 100 271 + } 272 + } 273 + }, 274 + "requestLess": { 275 + "type": "token", 276 + "description": "Request that less content like the given feed item be shown in the feed" 277 + }, 278 + "requestMore": { 279 + "type": "token", 280 + "description": "Request that more content like the given feed item be shown in the feed" 281 + }, 282 + "clickthroughItem": { 283 + "type": "token", 284 + "description": "User clicked through to the feed item" 285 + }, 286 + "clickthroughAuthor": { 287 + "type": "token", 288 + "description": "User clicked through to the author of the feed item" 289 + }, 290 + "clickthroughReposter": { 291 + "type": "token", 292 + "description": "User clicked through to the reposter of the feed item" 293 + }, 294 + "clickthroughEmbed": { 295 + "type": "token", 296 + "description": "User clicked through to the embedded content of the feed item" 297 + }, 298 + "contentModeUnspecified": { 299 + "type": "token", 300 + "description": "Declares the feed generator returns any types of posts." 301 + }, 302 + "contentModeVideo": { 303 + "type": "token", 304 + "description": "Declares the feed generator returns posts containing app.bsky.embed.video embeds." 305 + }, 306 + "interactionSeen": { 307 + "type": "token", 308 + "description": "Feed item was seen by user" 309 + }, 310 + "interactionLike": { 311 + "type": "token", 312 + "description": "User liked the feed item" 313 + }, 314 + "interactionRepost": { 315 + "type": "token", 316 + "description": "User reposted the feed item" 317 + }, 318 + "interactionReply": { 319 + "type": "token", 320 + "description": "User replied to the feed item" 321 + }, 322 + "interactionQuote": { 323 + "type": "token", 324 + "description": "User quoted the feed item" 325 + }, 326 + "interactionShare": { 327 + "type": "token", 328 + "description": "User shared the feed item" 329 + } 330 + } 331 + }
+42
resources/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 + }
+58
resources/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 + }
+43
resources/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 + }
+20
resources/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 + "via": { "type": "ref", "ref": "com.atproto.repo.strongRef" } 16 + } 17 + } 18 + } 19 + } 20 + }
+96
resources/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.video", 35 + "app.bsky.embed.external", 36 + "app.bsky.embed.record", 37 + "app.bsky.embed.recordWithMedia" 38 + ] 39 + }, 40 + "langs": { 41 + "type": "array", 42 + "description": "Indicates human language of post primary text content.", 43 + "maxLength": 3, 44 + "items": { "type": "string", "format": "language" } 45 + }, 46 + "labels": { 47 + "type": "union", 48 + "description": "Self-label values for this post. Effectively content warnings.", 49 + "refs": ["com.atproto.label.defs#selfLabels"] 50 + }, 51 + "tags": { 52 + "type": "array", 53 + "description": "Additional hashtags, in addition to any included in post text and facets.", 54 + "maxLength": 8, 55 + "items": { "type": "string", "maxLength": 640, "maxGraphemes": 64 } 56 + }, 57 + "createdAt": { 58 + "type": "string", 59 + "format": "datetime", 60 + "description": "Client-declared timestamp when this post was originally created." 61 + } 62 + } 63 + } 64 + }, 65 + "replyRef": { 66 + "type": "object", 67 + "required": ["root", "parent"], 68 + "properties": { 69 + "root": { "type": "ref", "ref": "com.atproto.repo.strongRef" }, 70 + "parent": { "type": "ref", "ref": "com.atproto.repo.strongRef" } 71 + } 72 + }, 73 + "entity": { 74 + "type": "object", 75 + "description": "Deprecated: use facets instead.", 76 + "required": ["index", "type", "value"], 77 + "properties": { 78 + "index": { "type": "ref", "ref": "#textSlice" }, 79 + "type": { 80 + "type": "string", 81 + "description": "Expected values are 'mention' and 'link'." 82 + }, 83 + "value": { "type": "string" } 84 + } 85 + }, 86 + "textSlice": { 87 + "type": "object", 88 + "description": "Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings.", 89 + "required": ["start", "end"], 90 + "properties": { 91 + "start": { "type": "integer", "minimum": 0 }, 92 + "end": { "type": "integer", "minimum": 0 } 93 + } 94 + } 95 + } 96 + }
+20
resources/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 + "via": { "type": "ref", "ref": "com.atproto.repo.strongRef" } 16 + } 17 + } 18 + } 19 + } 20 + }
+23
resources/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
resources/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 + }
+20
resources/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 + "via": { "type": "ref", "ref": "com.atproto.repo.strongRef" } 16 + } 17 + } 18 + } 19 + } 20 + }
+47
resources/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 + }
+28
resources/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 + }
+91
resources/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 + "reasonTypes": { 40 + "description": "The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed.", 41 + "type": "array", 42 + "items": { 43 + "type": "ref", 44 + "ref": "com.atproto.moderation.defs#reasonType" 45 + } 46 + }, 47 + "subjectTypes": { 48 + "description": "The set of subject types (account, record, etc) this service accepts reports on.", 49 + "type": "array", 50 + "items": { 51 + "type": "ref", 52 + "ref": "com.atproto.moderation.defs#subjectType" 53 + } 54 + }, 55 + "subjectCollections": { 56 + "type": "array", 57 + "description": "Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type.", 58 + "items": { "type": "string", "format": "nsid" } 59 + } 60 + } 61 + }, 62 + "labelerViewerState": { 63 + "type": "object", 64 + "properties": { 65 + "like": { "type": "string", "format": "at-uri" } 66 + } 67 + }, 68 + "labelerPolicies": { 69 + "type": "object", 70 + "required": ["labelValues"], 71 + "properties": { 72 + "labelValues": { 73 + "type": "array", 74 + "description": "The label values which this labeler publishes. May include global or custom labels.", 75 + "items": { 76 + "type": "ref", 77 + "ref": "com.atproto.label.defs#labelValue" 78 + } 79 + }, 80 + "labelValueDefinitions": { 81 + "type": "array", 82 + "description": "Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler.", 83 + "items": { 84 + "type": "ref", 85 + "ref": "com.atproto.label.defs#labelValueDefinition" 86 + } 87 + } 88 + } 89 + } 90 + } 91 + }
+47
resources/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 + "reasonTypes": { 23 + "description": "The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed.", 24 + "type": "array", 25 + "items": { 26 + "type": "ref", 27 + "ref": "com.atproto.moderation.defs#reasonType" 28 + } 29 + }, 30 + "subjectTypes": { 31 + "description": "The set of subject types (account, record, etc) this service accepts reports on.", 32 + "type": "array", 33 + "items": { 34 + "type": "ref", 35 + "ref": "com.atproto.moderation.defs#subjectType" 36 + } 37 + }, 38 + "subjectCollections": { 39 + "type": "array", 40 + "description": "Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type.", 41 + "items": { "type": "string", "format": "nsid" } 42 + } 43 + } 44 + } 45 + } 46 + } 47 + }
+88
resources/lexicons/app/bsky/notification/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.notification.defs", 4 + "defs": { 5 + "recordDeleted": { 6 + "type": "object", 7 + "properties": {} 8 + }, 9 + "chatPreference": { 10 + "type": "object", 11 + "required": ["include", "push"], 12 + "properties": { 13 + "include": { "type": "string", "knownValues": ["all", "accepted"] }, 14 + "push": { "type": "boolean" } 15 + } 16 + }, 17 + "filterablePreference": { 18 + "type": "object", 19 + "required": ["include", "list", "push"], 20 + "properties": { 21 + "include": { "type": "string", "knownValues": ["all", "follows"] }, 22 + "list": { "type": "boolean" }, 23 + "push": { "type": "boolean" } 24 + } 25 + }, 26 + "preference": { 27 + "type": "object", 28 + "required": ["list", "push"], 29 + "properties": { 30 + "list": { "type": "boolean" }, 31 + "push": { "type": "boolean" } 32 + } 33 + }, 34 + "preferences": { 35 + "type": "object", 36 + "required": [ 37 + "chat", 38 + "follow", 39 + "like", 40 + "likeViaRepost", 41 + "mention", 42 + "quote", 43 + "reply", 44 + "repost", 45 + "repostViaRepost", 46 + "starterpackJoined", 47 + "subscribedPost", 48 + "unverified", 49 + "verified" 50 + ], 51 + "properties": { 52 + "chat": { "type": "ref", "ref": "#chatPreference" }, 53 + "follow": { "type": "ref", "ref": "#filterablePreference" }, 54 + "like": { "type": "ref", "ref": "#filterablePreference" }, 55 + "likeViaRepost": { "type": "ref", "ref": "#filterablePreference" }, 56 + "mention": { "type": "ref", "ref": "#filterablePreference" }, 57 + "quote": { "type": "ref", "ref": "#filterablePreference" }, 58 + "reply": { "type": "ref", "ref": "#filterablePreference" }, 59 + "repost": { "type": "ref", "ref": "#filterablePreference" }, 60 + "repostViaRepost": { "type": "ref", "ref": "#filterablePreference" }, 61 + "starterpackJoined": { "type": "ref", "ref": "#preference" }, 62 + "subscribedPost": { "type": "ref", "ref": "#preference" }, 63 + "unverified": { "type": "ref", "ref": "#preference" }, 64 + "verified": { "type": "ref", "ref": "#preference" } 65 + } 66 + }, 67 + "activitySubscription": { 68 + "type": "object", 69 + "required": ["post", "reply"], 70 + "properties": { 71 + "post": { "type": "boolean" }, 72 + "reply": { "type": "boolean" } 73 + } 74 + }, 75 + "subjectActivitySubscription": { 76 + "description": "Object used to store activity subscription data in stash.", 77 + "type": "object", 78 + "required": ["subject", "activitySubscription"], 79 + "properties": { 80 + "subject": { "type": "string", "format": "did" }, 81 + "activitySubscription": { 82 + "type": "ref", 83 + "ref": "#activitySubscription" 84 + } 85 + } 86 + } 87 + } 88 + }
+91
resources/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 + "reasons": { 12 + "description": "Notification reasons to include in response.", 13 + "type": "array", 14 + "items": { 15 + "type": "string", 16 + "description": "A reason that matches the reason property of #notification." 17 + } 18 + }, 19 + "limit": { 20 + "type": "integer", 21 + "minimum": 1, 22 + "maximum": 100, 23 + "default": 50 24 + }, 25 + "priority": { "type": "boolean" }, 26 + "cursor": { "type": "string" }, 27 + "seenAt": { "type": "string", "format": "datetime" } 28 + } 29 + }, 30 + "output": { 31 + "encoding": "application/json", 32 + "schema": { 33 + "type": "object", 34 + "required": ["notifications"], 35 + "properties": { 36 + "cursor": { "type": "string" }, 37 + "notifications": { 38 + "type": "array", 39 + "items": { "type": "ref", "ref": "#notification" } 40 + }, 41 + "priority": { "type": "boolean" }, 42 + "seenAt": { "type": "string", "format": "datetime" } 43 + } 44 + } 45 + } 46 + }, 47 + "notification": { 48 + "type": "object", 49 + "required": [ 50 + "uri", 51 + "cid", 52 + "author", 53 + "reason", 54 + "record", 55 + "isRead", 56 + "indexedAt" 57 + ], 58 + "properties": { 59 + "uri": { "type": "string", "format": "at-uri" }, 60 + "cid": { "type": "string", "format": "cid" }, 61 + "author": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" }, 62 + "reason": { 63 + "type": "string", 64 + "description": "The reason why this notification was delivered - e.g. your post was liked, or you received a new follower.", 65 + "knownValues": [ 66 + "like", 67 + "repost", 68 + "follow", 69 + "mention", 70 + "reply", 71 + "quote", 72 + "starterpack-joined", 73 + "verified", 74 + "unverified", 75 + "like-via-repost", 76 + "repost-via-repost", 77 + "subscribed-post" 78 + ] 79 + }, 80 + "reasonSubject": { "type": "string", "format": "at-uri" }, 81 + "record": { "type": "unknown" }, 82 + "isRead": { "type": "boolean" }, 83 + "indexedAt": { "type": "string", "format": "datetime" }, 84 + "labels": { 85 + "type": "array", 86 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 87 + } 88 + } 89 + } 90 + } 91 + }
+20
resources/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
resources/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 + }
+198
resources/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 + "skeletonSearchStarterPack": { 20 + "type": "object", 21 + "required": ["uri"], 22 + "properties": { 23 + "uri": { "type": "string", "format": "at-uri" } 24 + } 25 + }, 26 + "trendingTopic": { 27 + "type": "object", 28 + "required": ["topic", "link"], 29 + "properties": { 30 + "topic": { "type": "string" }, 31 + "displayName": { "type": "string" }, 32 + "description": { "type": "string" }, 33 + "link": { "type": "string" } 34 + } 35 + }, 36 + "skeletonTrend": { 37 + "type": "object", 38 + "required": [ 39 + "topic", 40 + "displayName", 41 + "link", 42 + "startedAt", 43 + "postCount", 44 + "dids" 45 + ], 46 + "properties": { 47 + "topic": { "type": "string" }, 48 + "displayName": { "type": "string" }, 49 + "link": { "type": "string" }, 50 + "startedAt": { "type": "string", "format": "datetime" }, 51 + "postCount": { "type": "integer" }, 52 + "status": { "type": "string", "knownValues": ["hot"] }, 53 + "category": { "type": "string" }, 54 + "dids": { 55 + "type": "array", 56 + "items": { 57 + "type": "string", 58 + "format": "did" 59 + } 60 + } 61 + } 62 + }, 63 + "trendView": { 64 + "type": "object", 65 + "required": [ 66 + "topic", 67 + "displayName", 68 + "link", 69 + "startedAt", 70 + "postCount", 71 + "actors" 72 + ], 73 + "properties": { 74 + "topic": { "type": "string" }, 75 + "displayName": { "type": "string" }, 76 + "link": { "type": "string" }, 77 + "startedAt": { "type": "string", "format": "datetime" }, 78 + "postCount": { "type": "integer" }, 79 + "status": { "type": "string", "knownValues": ["hot"] }, 80 + "category": { "type": "string" }, 81 + "actors": { 82 + "type": "array", 83 + "items": { 84 + "type": "ref", 85 + "ref": "app.bsky.actor.defs#profileViewBasic" 86 + } 87 + } 88 + } 89 + }, 90 + "threadItemPost": { 91 + "type": "object", 92 + "required": [ 93 + "post", 94 + "moreParents", 95 + "moreReplies", 96 + "opThread", 97 + "hiddenByThreadgate", 98 + "mutedByViewer" 99 + ], 100 + "properties": { 101 + "post": { "type": "ref", "ref": "app.bsky.feed.defs#postView" }, 102 + "moreParents": { 103 + "type": "boolean", 104 + "description": "This post has more parents that were not present in the response. This is just a boolean, without the number of parents." 105 + }, 106 + "moreReplies": { 107 + "type": "integer", 108 + "description": "This post has more replies that were not present in the response. This is a numeric value, which is best-effort and might not be accurate." 109 + }, 110 + "opThread": { 111 + "type": "boolean", 112 + "description": "This post is part of a contiguous thread by the OP from the thread root. Many different OP threads can happen in the same thread." 113 + }, 114 + "hiddenByThreadgate": { 115 + "type": "boolean", 116 + "description": "The threadgate created by the author indicates this post as a reply to be hidden for everyone consuming the thread." 117 + }, 118 + "mutedByViewer": { 119 + "type": "boolean", 120 + "description": "This is by an account muted by the viewer requesting it." 121 + } 122 + } 123 + }, 124 + "threadItemNoUnauthenticated": { 125 + "type": "object", 126 + "properties": {} 127 + }, 128 + "threadItemNotFound": { 129 + "type": "object", 130 + "properties": {} 131 + }, 132 + "threadItemBlocked": { 133 + "type": "object", 134 + "required": ["author"], 135 + "properties": { 136 + "author": { "type": "ref", "ref": "app.bsky.feed.defs#blockedAuthor" } 137 + } 138 + }, 139 + "ageAssuranceState": { 140 + "type": "object", 141 + "description": "The computed state of the age assurance process, returned to the user in question on certain authenticated requests.", 142 + "required": ["status"], 143 + "properties": { 144 + "lastInitiatedAt": { 145 + "type": "string", 146 + "format": "datetime", 147 + "description": "The timestamp when this state was last updated." 148 + }, 149 + "status": { 150 + "type": "string", 151 + "description": "The status of the age assurance process.", 152 + "knownValues": ["unknown", "pending", "assured", "blocked"] 153 + } 154 + } 155 + }, 156 + "ageAssuranceEvent": { 157 + "type": "object", 158 + "description": "Object used to store age assurance data in stash.", 159 + "required": ["createdAt", "status", "attemptId"], 160 + "properties": { 161 + "createdAt": { 162 + "type": "string", 163 + "format": "datetime", 164 + "description": "The date and time of this write operation." 165 + }, 166 + "status": { 167 + "type": "string", 168 + "description": "The status of the age assurance process.", 169 + "knownValues": ["unknown", "pending", "assured"] 170 + }, 171 + "attemptId": { 172 + "type": "string", 173 + "description": "The unique identifier for this instance of the age assurance flow, in UUID format." 174 + }, 175 + "email": { 176 + "type": "string", 177 + "description": "The email used for AA." 178 + }, 179 + "initIp": { 180 + "type": "string", 181 + "description": "The IP address used when initiating the AA flow." 182 + }, 183 + "initUa": { 184 + "type": "string", 185 + "description": "The user agent used when initiating the AA flow." 186 + }, 187 + "completeIp": { 188 + "type": "string", 189 + "description": "The IP address used when completing the AA flow." 190 + }, 191 + "completeUa": { 192 + "type": "string", 193 + "description": "The user agent used when completing the AA flow." 194 + } 195 + } 196 + } 197 + } 198 + }
+28
resources/lexicons/app/bsky/video/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.video.defs", 4 + "defs": { 5 + "jobStatus": { 6 + "type": "object", 7 + "required": ["jobId", "did", "state"], 8 + "properties": { 9 + "jobId": { "type": "string" }, 10 + "did": { "type": "string", "format": "did" }, 11 + "state": { 12 + "type": "string", 13 + "description": "The state of the video processing job. All values not listed as a known value indicate that the job is in process.", 14 + "knownValues": ["JOB_STATE_COMPLETED", "JOB_STATE_FAILED"] 15 + }, 16 + "progress": { 17 + "type": "integer", 18 + "minimum": 0, 19 + "maximum": 100, 20 + "description": "Progress within the current processing state." 21 + }, 22 + "blob": { "type": "blob" }, 23 + "error": { "type": "string" }, 24 + "message": { "type": "string" } 25 + } 26 + } 27 + } 28 + }
+236
resources/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 + "reactions": { 55 + "type": "array", 56 + "description": "Reactions to this message, in ascending order of creation time.", 57 + "items": { "type": "ref", "ref": "#reactionView" } 58 + }, 59 + "sender": { "type": "ref", "ref": "#messageViewSender" }, 60 + "sentAt": { "type": "string", "format": "datetime" } 61 + } 62 + }, 63 + "deletedMessageView": { 64 + "type": "object", 65 + "required": ["id", "rev", "sender", "sentAt"], 66 + "properties": { 67 + "id": { "type": "string" }, 68 + "rev": { "type": "string" }, 69 + "sender": { "type": "ref", "ref": "#messageViewSender" }, 70 + "sentAt": { "type": "string", "format": "datetime" } 71 + } 72 + }, 73 + "messageViewSender": { 74 + "type": "object", 75 + "required": ["did"], 76 + "properties": { 77 + "did": { "type": "string", "format": "did" } 78 + } 79 + }, 80 + "reactionView": { 81 + "type": "object", 82 + "required": ["value", "sender", "createdAt"], 83 + "properties": { 84 + "value": { "type": "string" }, 85 + "sender": { "type": "ref", "ref": "#reactionViewSender" }, 86 + "createdAt": { "type": "string", "format": "datetime" } 87 + } 88 + }, 89 + "reactionViewSender": { 90 + "type": "object", 91 + "required": ["did"], 92 + "properties": { 93 + "did": { "type": "string", "format": "did" } 94 + } 95 + }, 96 + "messageAndReactionView": { 97 + "type": "object", 98 + "required": ["message", "reaction"], 99 + "properties": { 100 + "message": { "type": "ref", "ref": "#messageView" }, 101 + "reaction": { "type": "ref", "ref": "#reactionView" } 102 + } 103 + }, 104 + "convoView": { 105 + "type": "object", 106 + "required": ["id", "rev", "members", "muted", "unreadCount"], 107 + "properties": { 108 + "id": { "type": "string" }, 109 + "rev": { "type": "string" }, 110 + "members": { 111 + "type": "array", 112 + "items": { 113 + "type": "ref", 114 + "ref": "app.bsky.actor.defs#profileViewBasic" 115 + } 116 + }, 117 + "lastMessage": { 118 + "type": "union", 119 + "refs": ["#messageView", "#deletedMessageView"] 120 + }, 121 + "lastReaction": { 122 + "type": "union", 123 + "refs": ["#messageAndReactionView"] 124 + }, 125 + "muted": { "type": "boolean" }, 126 + "status": { 127 + "type": "string", 128 + "knownValues": ["request", "accepted"] 129 + }, 130 + "unreadCount": { "type": "integer" } 131 + } 132 + }, 133 + "logBeginConvo": { 134 + "type": "object", 135 + "required": ["rev", "convoId"], 136 + "properties": { 137 + "rev": { "type": "string" }, 138 + "convoId": { "type": "string" } 139 + } 140 + }, 141 + "logAcceptConvo": { 142 + "type": "object", 143 + "required": ["rev", "convoId"], 144 + "properties": { 145 + "rev": { "type": "string" }, 146 + "convoId": { "type": "string" } 147 + } 148 + }, 149 + "logLeaveConvo": { 150 + "type": "object", 151 + "required": ["rev", "convoId"], 152 + "properties": { 153 + "rev": { "type": "string" }, 154 + "convoId": { "type": "string" } 155 + } 156 + }, 157 + "logMuteConvo": { 158 + "type": "object", 159 + "required": ["rev", "convoId"], 160 + "properties": { 161 + "rev": { "type": "string" }, 162 + "convoId": { "type": "string" } 163 + } 164 + }, 165 + "logUnmuteConvo": { 166 + "type": "object", 167 + "required": ["rev", "convoId"], 168 + "properties": { 169 + "rev": { "type": "string" }, 170 + "convoId": { "type": "string" } 171 + } 172 + }, 173 + "logCreateMessage": { 174 + "type": "object", 175 + "required": ["rev", "convoId", "message"], 176 + "properties": { 177 + "rev": { "type": "string" }, 178 + "convoId": { "type": "string" }, 179 + "message": { 180 + "type": "union", 181 + "refs": ["#messageView", "#deletedMessageView"] 182 + } 183 + } 184 + }, 185 + "logDeleteMessage": { 186 + "type": "object", 187 + "required": ["rev", "convoId", "message"], 188 + "properties": { 189 + "rev": { "type": "string" }, 190 + "convoId": { "type": "string" }, 191 + "message": { 192 + "type": "union", 193 + "refs": ["#messageView", "#deletedMessageView"] 194 + } 195 + } 196 + }, 197 + "logReadMessage": { 198 + "type": "object", 199 + "required": ["rev", "convoId", "message"], 200 + "properties": { 201 + "rev": { "type": "string" }, 202 + "convoId": { "type": "string" }, 203 + "message": { 204 + "type": "union", 205 + "refs": ["#messageView", "#deletedMessageView"] 206 + } 207 + } 208 + }, 209 + "logAddReaction": { 210 + "type": "object", 211 + "required": ["rev", "convoId", "message", "reaction"], 212 + "properties": { 213 + "rev": { "type": "string" }, 214 + "convoId": { "type": "string" }, 215 + "message": { 216 + "type": "union", 217 + "refs": ["#messageView", "#deletedMessageView"] 218 + }, 219 + "reaction": { "type": "ref", "ref": "#reactionView" } 220 + } 221 + }, 222 + "logRemoveReaction": { 223 + "type": "object", 224 + "required": ["rev", "convoId", "message", "reaction"], 225 + "properties": { 226 + "rev": { "type": "string" }, 227 + "convoId": { "type": "string" }, 228 + "message": { 229 + "type": "union", 230 + "refs": ["#messageView", "#deletedMessageView"] 231 + }, 232 + "reaction": { "type": "ref", "ref": "#reactionView" } 233 + } 234 + } 235 + } 236 + }
+32
resources/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 + }
+32
resources/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 + }
+71
resources/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 + "threatSignatures": { 38 + "type": "array", 39 + "items": { 40 + "type": "ref", 41 + "ref": "#threatSignature" 42 + } 43 + } 44 + } 45 + }, 46 + "repoRef": { 47 + "type": "object", 48 + "required": ["did"], 49 + "properties": { 50 + "did": { "type": "string", "format": "did" } 51 + } 52 + }, 53 + "repoBlobRef": { 54 + "type": "object", 55 + "required": ["did", "cid"], 56 + "properties": { 57 + "did": { "type": "string", "format": "did" }, 58 + "cid": { "type": "string", "format": "cid" }, 59 + "recordUri": { "type": "string", "format": "at-uri" } 60 + } 61 + }, 62 + "threatSignature": { 63 + "type": "object", 64 + "required": ["property", "value"], 65 + "properties": { 66 + "property": { "type": "string" }, 67 + "value": { "type": "string" } 68 + } 69 + } 70 + } 71 + }
+20
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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 + }
+25
resources/lexicons/com/atproto/admin/updateAccountSigningKey.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.admin.updateAccountSigningKey", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Administrative action to update an account's signing key in their Did document.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["did", "signingKey"], 13 + "properties": { 14 + "did": { "type": "string", "format": "did" }, 15 + "signingKey": { 16 + "type": "string", 17 + "format": "did", 18 + "description": "Did-key formatted public key" 19 + } 20 + } 21 + } 22 + } 23 + } 24 + } 25 + }
+56
resources/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 + }
+22
resources/lexicons/com/atproto/identity/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.identity.defs", 4 + "defs": { 5 + "identityInfo": { 6 + "type": "object", 7 + "required": ["did", "handle", "didDoc"], 8 + "properties": { 9 + "did": { "type": "string", "format": "did" }, 10 + "handle": { 11 + "type": "string", 12 + "format": "handle", 13 + "description": "The validated handle of the account; or 'handle.invalid' if the handle did not bi-directionally match the DID document." 14 + }, 15 + "didDoc": { 16 + "type": "unknown", 17 + "description": "The complete DID document for the identity." 18 + } 19 + } 20 + } 21 + } 22 + }
+29
resources/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 + }
+44
resources/lexicons/com/atproto/identity/refreshIdentity.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.identity.refreshIdentity", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Request that the server re-resolve an identity (DID and handle). The server may ignore this request, or require authentication, depending on the role, implementation, and policy of the server.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["identifier"], 13 + "properties": { 14 + "identifier": { 15 + "type": "string", 16 + "format": "at-identifier" 17 + } 18 + } 19 + } 20 + }, 21 + "output": { 22 + "encoding": "application/json", 23 + "schema": { 24 + "type": "ref", 25 + "ref": "com.atproto.identity.defs#identityInfo" 26 + } 27 + }, 28 + "errors": [ 29 + { 30 + "name": "HandleNotFound", 31 + "description": "The resolution process confirmed that the handle does not resolve to any DID." 32 + }, 33 + { 34 + "name": "DidNotFound", 35 + "description": "The DID resolution process confirmed that there is no current DID." 36 + }, 37 + { 38 + "name": "DidDeactivated", 39 + "description": "The DID previously existed, but has been deactivated." 40 + } 41 + ] 42 + } 43 + } 44 + }
+10
resources/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 + }
+44
resources/lexicons/com/atproto/identity/resolveDid.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.identity.resolveDid", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Resolves DID to DID document. Does not bi-directionally verify handle.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["did"], 11 + "properties": { 12 + "did": { 13 + "type": "string", 14 + "format": "did", 15 + "description": "DID to resolve." 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "object", 23 + "required": ["didDoc"], 24 + "properties": { 25 + "didDoc": { 26 + "type": "unknown", 27 + "description": "The complete DID document for the identity." 28 + } 29 + } 30 + } 31 + }, 32 + "errors": [ 33 + { 34 + "name": "DidNotFound", 35 + "description": "The DID resolution process confirmed that there is no current DID." 36 + }, 37 + { 38 + "name": "DidDeactivated", 39 + "description": "The DID previously existed, but has been deactivated." 40 + } 41 + ] 42 + } 43 + } 44 + }
+37
resources/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 an atproto handle (hostname) to a DID. Does not necessarily bi-directionally verify against the the DID document.", 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 + "errors": [ 30 + { 31 + "name": "HandleNotFound", 32 + "description": "The resolution process confirmed that the handle does not resolve to any DID." 33 + } 34 + ] 35 + } 36 + } 37 + }
+42
resources/lexicons/com/atproto/identity/resolveIdentity.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.identity.resolveIdentity", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Resolves an identity (DID or Handle) to a full identity (DID document and verified handle).", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["identifier"], 11 + "properties": { 12 + "identifier": { 13 + "type": "string", 14 + "format": "at-identifier", 15 + "description": "Handle or DID to resolve." 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "ref", 23 + "ref": "com.atproto.identity.defs#identityInfo" 24 + } 25 + }, 26 + "errors": [ 27 + { 28 + "name": "HandleNotFound", 29 + "description": "The resolution process confirmed that the handle does not resolve to any DID." 30 + }, 31 + { 32 + "name": "DidNotFound", 33 + "description": "The DID resolution process confirmed that there is no current DID." 34 + }, 35 + { 36 + "name": "DidDeactivated", 37 + "description": "The DID previously existed, but has been deactivated." 38 + } 39 + ] 40 + } 41 + } 42 + }
+45
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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 + }
+90
resources/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": [ 28 + "com.atproto.admin.defs#repoRef", 29 + "com.atproto.repo.strongRef" 30 + ] 31 + }, 32 + "modTool": { 33 + "type": "ref", 34 + "ref": "#modTool" 35 + } 36 + } 37 + } 38 + }, 39 + "output": { 40 + "encoding": "application/json", 41 + "schema": { 42 + "type": "object", 43 + "required": [ 44 + "id", 45 + "reasonType", 46 + "subject", 47 + "reportedBy", 48 + "createdAt" 49 + ], 50 + "properties": { 51 + "id": { "type": "integer" }, 52 + "reasonType": { 53 + "type": "ref", 54 + "ref": "com.atproto.moderation.defs#reasonType" 55 + }, 56 + "reason": { 57 + "type": "string", 58 + "maxGraphemes": 2000, 59 + "maxLength": 20000 60 + }, 61 + "subject": { 62 + "type": "union", 63 + "refs": [ 64 + "com.atproto.admin.defs#repoRef", 65 + "com.atproto.repo.strongRef" 66 + ] 67 + }, 68 + "reportedBy": { "type": "string", "format": "did" }, 69 + "createdAt": { "type": "string", "format": "datetime" } 70 + } 71 + } 72 + } 73 + }, 74 + "modTool": { 75 + "type": "object", 76 + "description": "Moderation tool information for tracing the source of the action", 77 + "required": ["name"], 78 + "properties": { 79 + "name": { 80 + "type": "string", 81 + "description": "Name/identifier of the source (e.g., 'bsky-app/android', 'bsky-web/chrome')" 82 + }, 83 + "meta": { 84 + "type": "unknown", 85 + "description": "Additional arbitrary metadata about the source" 86 + } 87 + } 88 + } 89 + } 90 + }
+99
resources/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 + "tools.ozone.report.defs#reasonAppeal", 17 + "tools.ozone.report.defs#reasonOther", 18 + 19 + "tools.ozone.report.defs#reasonViolenceAnimal", 20 + "tools.ozone.report.defs#reasonViolenceThreats", 21 + "tools.ozone.report.defs#reasonViolenceGraphicContent", 22 + "tools.ozone.report.defs#reasonViolenceGlorification", 23 + "tools.ozone.report.defs#reasonViolenceExtremistContent", 24 + "tools.ozone.report.defs#reasonViolenceTrafficking", 25 + "tools.ozone.report.defs#reasonViolenceOther", 26 + 27 + "tools.ozone.report.defs#reasonSexualAbuseContent", 28 + "tools.ozone.report.defs#reasonSexualNCII", 29 + "tools.ozone.report.defs#reasonSexualDeepfake", 30 + "tools.ozone.report.defs#reasonSexualAnimal", 31 + "tools.ozone.report.defs#reasonSexualUnlabeled", 32 + "tools.ozone.report.defs#reasonSexualOther", 33 + 34 + "tools.ozone.report.defs#reasonChildSafetyCSAM", 35 + "tools.ozone.report.defs#reasonChildSafetyGroom", 36 + "tools.ozone.report.defs#reasonChildSafetyPrivacy", 37 + "tools.ozone.report.defs#reasonChildSafetyHarassment", 38 + "tools.ozone.report.defs#reasonChildSafetyOther", 39 + 40 + "tools.ozone.report.defs#reasonHarassmentTroll", 41 + "tools.ozone.report.defs#reasonHarassmentTargeted", 42 + "tools.ozone.report.defs#reasonHarassmentHateSpeech", 43 + "tools.ozone.report.defs#reasonHarassmentDoxxing", 44 + "tools.ozone.report.defs#reasonHarassmentOther", 45 + 46 + "tools.ozone.report.defs#reasonMisleadingBot", 47 + "tools.ozone.report.defs#reasonMisleadingImpersonation", 48 + "tools.ozone.report.defs#reasonMisleadingSpam", 49 + "tools.ozone.report.defs#reasonMisleadingScam", 50 + "tools.ozone.report.defs#reasonMisleadingElections", 51 + "tools.ozone.report.defs#reasonMisleadingOther", 52 + 53 + "tools.ozone.report.defs#reasonRuleSiteSecurity", 54 + "tools.ozone.report.defs#reasonRuleProhibitedSales", 55 + "tools.ozone.report.defs#reasonRuleBanEvasion", 56 + "tools.ozone.report.defs#reasonRuleOther", 57 + 58 + "tools.ozone.report.defs#reasonSelfHarmContent", 59 + "tools.ozone.report.defs#reasonSelfHarmED", 60 + "tools.ozone.report.defs#reasonSelfHarmStunts", 61 + "tools.ozone.report.defs#reasonSelfHarmSubstances", 62 + "tools.ozone.report.defs#reasonSelfHarmOther" 63 + ] 64 + }, 65 + "reasonSpam": { 66 + "type": "token", 67 + "description": "Spam: frequent unwanted promotion, replies, mentions. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingSpam`." 68 + }, 69 + "reasonViolation": { 70 + "type": "token", 71 + "description": "Direct violation of server rules, laws, terms of service. Prefer new lexicon definition `tools.ozone.report.defs#reasonRuleOther`." 72 + }, 73 + "reasonMisleading": { 74 + "type": "token", 75 + "description": "Misleading identity, affiliation, or content. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingOther`." 76 + }, 77 + "reasonSexual": { 78 + "type": "token", 79 + "description": "Unwanted or mislabeled sexual content. Prefer new lexicon definition `tools.ozone.report.defs#reasonSexualUnlabeled`." 80 + }, 81 + "reasonRude": { 82 + "type": "token", 83 + "description": "Rude, harassing, explicit, or otherwise unwelcoming behavior. Prefer new lexicon definition `tools.ozone.report.defs#reasonHarassmentOther`." 84 + }, 85 + "reasonOther": { 86 + "type": "token", 87 + "description": "Reports not falling under another report category. Prefer new lexicon definition `tools.ozone.report.defs#reasonOther`." 88 + }, 89 + "reasonAppeal": { 90 + "type": "token", 91 + "description": "Appeal a previously taken moderation action" 92 + }, 93 + "subjectType": { 94 + "type": "string", 95 + "description": "Tag describing a type of subject that might be reported.", 96 + "knownValues": ["account", "record", "chat"] 97 + } 98 + } 99 + }
+131
resources/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 + "description": "Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons." 22 + }, 23 + "writes": { 24 + "type": "array", 25 + "items": { 26 + "type": "union", 27 + "refs": ["#create", "#update", "#delete"], 28 + "closed": true 29 + } 30 + }, 31 + "swapCommit": { 32 + "type": "string", 33 + "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.", 34 + "format": "cid" 35 + } 36 + } 37 + } 38 + }, 39 + "output": { 40 + "encoding": "application/json", 41 + "schema": { 42 + "type": "object", 43 + "required": [], 44 + "properties": { 45 + "commit": { 46 + "type": "ref", 47 + "ref": "com.atproto.repo.defs#commitMeta" 48 + }, 49 + "results": { 50 + "type": "array", 51 + "items": { 52 + "type": "union", 53 + "refs": ["#createResult", "#updateResult", "#deleteResult"], 54 + "closed": true 55 + } 56 + } 57 + } 58 + } 59 + }, 60 + "errors": [ 61 + { 62 + "name": "InvalidSwap", 63 + "description": "Indicates that the 'swapCommit' parameter did not match current commit." 64 + } 65 + ] 66 + }, 67 + "create": { 68 + "type": "object", 69 + "description": "Operation which creates a new record.", 70 + "required": ["collection", "value"], 71 + "properties": { 72 + "collection": { "type": "string", "format": "nsid" }, 73 + "rkey": { 74 + "type": "string", 75 + "maxLength": 512, 76 + "format": "record-key", 77 + "description": "NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility." 78 + }, 79 + "value": { "type": "unknown" } 80 + } 81 + }, 82 + "update": { 83 + "type": "object", 84 + "description": "Operation which updates an existing record.", 85 + "required": ["collection", "rkey", "value"], 86 + "properties": { 87 + "collection": { "type": "string", "format": "nsid" }, 88 + "rkey": { "type": "string", "format": "record-key" }, 89 + "value": { "type": "unknown" } 90 + } 91 + }, 92 + "delete": { 93 + "type": "object", 94 + "description": "Operation which deletes an existing record.", 95 + "required": ["collection", "rkey"], 96 + "properties": { 97 + "collection": { "type": "string", "format": "nsid" }, 98 + "rkey": { "type": "string", "format": "record-key" } 99 + } 100 + }, 101 + "createResult": { 102 + "type": "object", 103 + "required": ["uri", "cid"], 104 + "properties": { 105 + "uri": { "type": "string", "format": "at-uri" }, 106 + "cid": { "type": "string", "format": "cid" }, 107 + "validationStatus": { 108 + "type": "string", 109 + "knownValues": ["valid", "unknown"] 110 + } 111 + } 112 + }, 113 + "updateResult": { 114 + "type": "object", 115 + "required": ["uri", "cid"], 116 + "properties": { 117 + "uri": { "type": "string", "format": "at-uri" }, 118 + "cid": { "type": "string", "format": "cid" }, 119 + "validationStatus": { 120 + "type": "string", 121 + "knownValues": ["valid", "unknown"] 122 + } 123 + } 124 + }, 125 + "deleteResult": { 126 + "type": "object", 127 + "required": [], 128 + "properties": {} 129 + } 130 + } 131 + }
+73
resources/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 + "format": "record-key", 27 + "description": "The Record Key.", 28 + "maxLength": 512 29 + }, 30 + "validate": { 31 + "type": "boolean", 32 + "description": "Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons." 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 + "commit": { 55 + "type": "ref", 56 + "ref": "com.atproto.repo.defs#commitMeta" 57 + }, 58 + "validationStatus": { 59 + "type": "string", 60 + "knownValues": ["valid", "unknown"] 61 + } 62 + } 63 + } 64 + }, 65 + "errors": [ 66 + { 67 + "name": "InvalidSwap", 68 + "description": "Indicates that 'swapCommit' didn't match current repo commit." 69 + } 70 + ] 71 + } 72 + } 73 + }
+14
resources/lexicons/com/atproto/repo/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.defs", 4 + "defs": { 5 + "commitMeta": { 6 + "type": "object", 7 + "required": ["cid", "rev"], 8 + "properties": { 9 + "cid": { "type": "string", "format": "cid" }, 10 + "rev": { "type": "string", "format": "tid" } 11 + } 12 + } 13 + } 14 + }
+57
resources/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 + "format": "record-key", 27 + "description": "The Record Key." 28 + }, 29 + "swapRecord": { 30 + "type": "string", 31 + "format": "cid", 32 + "description": "Compare and swap with the previous record by CID." 33 + }, 34 + "swapCommit": { 35 + "type": "string", 36 + "format": "cid", 37 + "description": "Compare and swap with the previous commit by CID." 38 + } 39 + } 40 + } 41 + }, 42 + "output": { 43 + "encoding": "application/json", 44 + "schema": { 45 + "type": "object", 46 + "properties": { 47 + "commit": { 48 + "type": "ref", 49 + "ref": "com.atproto.repo.defs#commitMeta" 50 + } 51 + } 52 + } 53 + }, 54 + "errors": [{ "name": "InvalidSwap" }] 55 + } 56 + } 57 + }
+51
resources/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": [ 24 + "handle", 25 + "did", 26 + "didDoc", 27 + "collections", 28 + "handleIsCorrect" 29 + ], 30 + "properties": { 31 + "handle": { "type": "string", "format": "handle" }, 32 + "did": { "type": "string", "format": "did" }, 33 + "didDoc": { 34 + "type": "unknown", 35 + "description": "The complete DID document for this account." 36 + }, 37 + "collections": { 38 + "type": "array", 39 + "description": "List of all the collections (NSIDs) for which this repo contains at least one record.", 40 + "items": { "type": "string", "format": "nsid" } 41 + }, 42 + "handleIsCorrect": { 43 + "type": "boolean", 44 + "description": "Indicates if handle is currently valid (resolves bi-directionally)" 45 + } 46 + } 47 + } 48 + } 49 + } 50 + } 51 + }
+49
resources/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": { 23 + "type": "string", 24 + "description": "The Record Key.", 25 + "format": "record-key" 26 + }, 27 + "cid": { 28 + "type": "string", 29 + "format": "cid", 30 + "description": "The CID of the version of the record. If not specified, then return the most recent version." 31 + } 32 + } 33 + }, 34 + "output": { 35 + "encoding": "application/json", 36 + "schema": { 37 + "type": "object", 38 + "required": ["uri", "value"], 39 + "properties": { 40 + "uri": { "type": "string", "format": "at-uri" }, 41 + "cid": { "type": "string", "format": "cid" }, 42 + "value": { "type": "unknown" } 43 + } 44 + } 45 + }, 46 + "errors": [{ "name": "RecordNotFound" }] 47 + } 48 + } 49 + }
+13
resources/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
resources/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 + }
+61
resources/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 + "reverse": { 31 + "type": "boolean", 32 + "description": "Flag to reverse the order of the returned records." 33 + } 34 + } 35 + }, 36 + "output": { 37 + "encoding": "application/json", 38 + "schema": { 39 + "type": "object", 40 + "required": ["records"], 41 + "properties": { 42 + "cursor": { "type": "string" }, 43 + "records": { 44 + "type": "array", 45 + "items": { "type": "ref", "ref": "#record" } 46 + } 47 + } 48 + } 49 + } 50 + }, 51 + "record": { 52 + "type": "object", 53 + "required": ["uri", "cid", "value"], 54 + "properties": { 55 + "uri": { "type": "string", "format": "at-uri" }, 56 + "cid": { "type": "string", "format": "cid" }, 57 + "value": { "type": "unknown" } 58 + } 59 + } 60 + } 61 + }
+74
resources/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 + "format": "record-key", 28 + "description": "The Record Key.", 29 + "maxLength": 512 30 + }, 31 + "validate": { 32 + "type": "boolean", 33 + "description": "Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons." 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 + "commit": { 61 + "type": "ref", 62 + "ref": "com.atproto.repo.defs#commitMeta" 63 + }, 64 + "validationStatus": { 65 + "type": "string", 66 + "knownValues": ["valid", "unknown"] 67 + } 68 + } 69 + } 70 + }, 71 + "errors": [{ "name": "InvalidSwap" }] 72 + } 73 + } 74 + }
+15
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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 + }
+56
resources/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 + "allowTakendown": { 21 + "type": "boolean", 22 + "description": "When true, instead of throwing error for takendown accounts, a valid response with a narrow scoped token will be returned" 23 + } 24 + } 25 + } 26 + }, 27 + "output": { 28 + "encoding": "application/json", 29 + "schema": { 30 + "type": "object", 31 + "required": ["accessJwt", "refreshJwt", "handle", "did"], 32 + "properties": { 33 + "accessJwt": { "type": "string" }, 34 + "refreshJwt": { "type": "string" }, 35 + "handle": { "type": "string", "format": "handle" }, 36 + "did": { "type": "string", "format": "did" }, 37 + "didDoc": { "type": "unknown" }, 38 + "email": { "type": "string" }, 39 + "emailConfirmed": { "type": "boolean" }, 40 + "emailAuthFactor": { "type": "boolean" }, 41 + "active": { "type": "boolean" }, 42 + "status": { 43 + "type": "string", 44 + "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.", 45 + "knownValues": ["takendown", "suspended", "deactivated"] 46 + } 47 + } 48 + } 49 + }, 50 + "errors": [ 51 + { "name": "AccountTakedown" }, 52 + { "name": "AuthFactorTokenRequired" } 53 + ] 54 + } 55 + } 56 + }
+23
resources/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 + }
+38
resources/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": [ 8 + "code", 9 + "available", 10 + "disabled", 11 + "forAccount", 12 + "createdBy", 13 + "createdAt", 14 + "uses" 15 + ], 16 + "properties": { 17 + "code": { "type": "string" }, 18 + "available": { "type": "integer" }, 19 + "disabled": { "type": "boolean" }, 20 + "forAccount": { "type": "string" }, 21 + "createdBy": { "type": "string" }, 22 + "createdAt": { "type": "string", "format": "datetime" }, 23 + "uses": { 24 + "type": "array", 25 + "items": { "type": "ref", "ref": "#inviteCodeUse" } 26 + } 27 + } 28 + }, 29 + "inviteCodeUse": { 30 + "type": "object", 31 + "required": ["usedBy", "usedAt"], 32 + "properties": { 33 + "usedBy": { "type": "string", "format": "did" }, 34 + "usedAt": { "type": "string", "format": "datetime" } 35 + } 36 + } 37 + } 38 + }
+23
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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
resources/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 + }
+30
resources/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": [ 24 + { "name": "ExpiredToken" }, 25 + { "name": "InvalidToken" }, 26 + { "name": "TokenRequired" } 27 + ] 28 + } 29 + } 30 + }
+10
resources/lexicons/com/atproto/sync/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.sync.defs", 4 + "defs": { 5 + "hostStatus": { 6 + "type": "string", 7 + "knownValues": ["active", "idle", "offline", "throttled", "banned"] 8 + } 9 + } 10 + }
+36
resources/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
resources/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
resources/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
resources/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 + }
+43
resources/lexicons/com/atproto/sync/getHostStatus.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.sync.getHostStatus", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Returns information about a specified upstream host, as consumed by the server. Implemented by relays.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["hostname"], 11 + "properties": { 12 + "hostname": { 13 + "type": "string", 14 + "description": "Hostname of the host (eg, PDS or relay) being queried." 15 + } 16 + } 17 + }, 18 + "output": { 19 + "encoding": "application/json", 20 + "schema": { 21 + "type": "object", 22 + "required": ["hostname"], 23 + "properties": { 24 + "hostname": { "type": "string" }, 25 + "seq": { 26 + "type": "integer", 27 + "description": "Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor)." 28 + }, 29 + "accountCount": { 30 + "type": "integer", 31 + "description": "Number of accounts on the server which are associated with the upstream host. Note that the upstream may actually have more accounts." 32 + }, 33 + "status": { 34 + "type": "ref", 35 + "ref": "com.atproto.sync.defs#hostStatus" 36 + } 37 + } 38 + } 39 + }, 40 + "errors": [{ "name": "HostNotFound" }] 41 + } 42 + } 43 + }
+38
resources/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", "format": "tid" } 27 + } 28 + } 29 + }, 30 + "errors": [ 31 + { "name": "RepoNotFound" }, 32 + { "name": "RepoTakendown" }, 33 + { "name": "RepoSuspended" }, 34 + { "name": "RepoDeactivated" } 35 + ] 36 + } 37 + } 38 + }
+37
resources/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": { 19 + "type": "string", 20 + "description": "Record Key", 21 + "format": "record-key" 22 + } 23 + } 24 + }, 25 + "output": { 26 + "encoding": "application/vnd.ipld.car" 27 + }, 28 + "errors": [ 29 + { "name": "RecordNotFound" }, 30 + { "name": "RepoNotFound" }, 31 + { "name": "RepoTakendown" }, 32 + { "name": "RepoSuspended" }, 33 + { "name": "RepoDeactivated" } 34 + ] 35 + } 36 + } 37 + }
+35
resources/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 + "format": "tid", 20 + "description": "The revision ('rev') of the repo to create a diff from." 21 + } 22 + } 23 + }, 24 + "output": { 25 + "encoding": "application/vnd.ipld.car" 26 + }, 27 + "errors": [ 28 + { "name": "RepoNotFound" }, 29 + { "name": "RepoTakendown" }, 30 + { "name": "RepoSuspended" }, 31 + { "name": "RepoDeactivated" } 32 + ] 33 + } 34 + } 35 + }
+50
resources/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": [ 31 + "takendown", 32 + "suspended", 33 + "deleted", 34 + "deactivated", 35 + "desynchronized", 36 + "throttled" 37 + ] 38 + }, 39 + "rev": { 40 + "type": "string", 41 + "format": "tid", 42 + "description": "Optional field, the current rev of the repo, if active=true" 43 + } 44 + } 45 + } 46 + }, 47 + "errors": [{ "name": "RepoNotFound" }] 48 + } 49 + } 50 + }
+53
resources/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 + "format": "tid", 20 + "description": "Optional revision of the repo to list blobs since." 21 + }, 22 + "limit": { 23 + "type": "integer", 24 + "minimum": 1, 25 + "maximum": 1000, 26 + "default": 500 27 + }, 28 + "cursor": { "type": "string" } 29 + } 30 + }, 31 + "output": { 32 + "encoding": "application/json", 33 + "schema": { 34 + "type": "object", 35 + "required": ["cids"], 36 + "properties": { 37 + "cursor": { "type": "string" }, 38 + "cids": { 39 + "type": "array", 40 + "items": { "type": "string", "format": "cid" } 41 + } 42 + } 43 + } 44 + }, 45 + "errors": [ 46 + { "name": "RepoNotFound" }, 47 + { "name": "RepoTakendown" }, 48 + { "name": "RepoSuspended" }, 49 + { "name": "RepoDeactivated" } 50 + ] 51 + } 52 + } 53 + }
+56
resources/lexicons/com/atproto/sync/listHosts.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.sync.listHosts", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Enumerates upstream hosts (eg, PDS or relay instances) that this service consumes from. Implemented by relays.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "limit": { 12 + "type": "integer", 13 + "minimum": 1, 14 + "maximum": 1000, 15 + "default": 200 16 + }, 17 + "cursor": { "type": "string" } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "object", 24 + "required": ["hosts"], 25 + "properties": { 26 + "cursor": { "type": "string" }, 27 + "hosts": { 28 + "type": "array", 29 + "items": { "type": "ref", "ref": "#host" }, 30 + "description": "Sort order is not formally specified. Recommended order is by time host was first seen by the server, with oldest first." 31 + } 32 + } 33 + } 34 + } 35 + }, 36 + "host": { 37 + "type": "object", 38 + "required": ["hostname"], 39 + "properties": { 40 + "hostname": { 41 + "type": "string", 42 + "description": "hostname of server; not a URL (no scheme)" 43 + }, 44 + "seq": { 45 + "type": "integer", 46 + "description": "Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor)." 47 + }, 48 + "accountCount": { "type": "integer" }, 49 + "status": { 50 + "type": "ref", 51 + "ref": "com.atproto.sync.defs#hostStatus" 52 + } 53 + } 54 + } 55 + } 56 + }
+62
resources/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", "format": "tid" }, 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": [ 51 + "takendown", 52 + "suspended", 53 + "deleted", 54 + "deactivated", 55 + "desynchronized", 56 + "throttled" 57 + ] 58 + } 59 + } 60 + } 61 + } 62 + }
+46
resources/lexicons/com/atproto/sync/listReposByCollection.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.sync.listReposByCollection", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Enumerates all the DIDs which have records with the given collection NSID.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["collection"], 11 + "properties": { 12 + "collection": { "type": "string", "format": "nsid" }, 13 + "limit": { 14 + "type": "integer", 15 + "description": "Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists.", 16 + "minimum": 1, 17 + "maximum": 2000, 18 + "default": 500 19 + }, 20 + "cursor": { "type": "string" } 21 + } 22 + }, 23 + "output": { 24 + "encoding": "application/json", 25 + "schema": { 26 + "type": "object", 27 + "required": ["repos"], 28 + "properties": { 29 + "cursor": { "type": "string" }, 30 + "repos": { 31 + "type": "array", 32 + "items": { "type": "ref", "ref": "#repo" } 33 + } 34 + } 35 + } 36 + } 37 + }, 38 + "repo": { 39 + "type": "object", 40 + "required": ["did"], 41 + "properties": { 42 + "did": { "type": "string", "format": "did" } 43 + } 44 + } 45 + } 46 + }
+23
resources/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. DEPRECATED: just use com.atproto.sync.requestCrawl", 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 + }
+24
resources/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 + "errors": [{ "name": "HostBanned" }] 22 + } 23 + } 24 + }
+215
resources/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", "#sync", "#identity", "#account", "#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": ["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": "DEPRECATED -- replaced by #sync event and data limits. 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. Note that all other message types name this field 'did'." 62 + }, 63 + "commit": { 64 + "type": "cid-link", 65 + "description": "Repo commit object CID." 66 + }, 67 + "rev": { 68 + "type": "string", 69 + "format": "tid", 70 + "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." 71 + }, 72 + "since": { 73 + "type": "string", 74 + "format": "tid", 75 + "description": "The rev of the last emitted commit from this repo (if any)." 76 + }, 77 + "blocks": { 78 + "type": "bytes", 79 + "description": "CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list.", 80 + "maxLength": 2000000 81 + }, 82 + "ops": { 83 + "type": "array", 84 + "items": { 85 + "type": "ref", 86 + "ref": "#repoOp", 87 + "description": "List of repo mutation operations in this commit (eg, records created, updated, or deleted)." 88 + }, 89 + "maxLength": 200 90 + }, 91 + "blobs": { 92 + "type": "array", 93 + "items": { 94 + "type": "cid-link", 95 + "description": "DEPRECATED -- will soon always be empty. List of new blobs (by CID) referenced by records in this commit." 96 + } 97 + }, 98 + "prevData": { 99 + "type": "cid-link", 100 + "description": "The root CID of the MST tree for the previous commit from this repo (indicated by the 'since' revision field in this message). Corresponds to the 'data' field in the repo commit object. NOTE: this field is effectively required for the 'inductive' version of firehose." 101 + }, 102 + "time": { 103 + "type": "string", 104 + "format": "datetime", 105 + "description": "Timestamp of when this message was originally broadcast." 106 + } 107 + } 108 + }, 109 + "sync": { 110 + "type": "object", 111 + "description": "Updates the repo to a new state, without necessarily including that state on the firehose. Used to recover from broken commit streams, data loss incidents, or in situations where upstream host does not know recent state of the repository.", 112 + "required": ["seq", "did", "blocks", "rev", "time"], 113 + "properties": { 114 + "seq": { 115 + "type": "integer", 116 + "description": "The stream sequence number of this message." 117 + }, 118 + "did": { 119 + "type": "string", 120 + "format": "did", 121 + "description": "The account this repo event corresponds to. Must match that in the commit object." 122 + }, 123 + "blocks": { 124 + "type": "bytes", 125 + "description": "CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'.", 126 + "maxLength": 10000 127 + }, 128 + "rev": { 129 + "type": "string", 130 + "description": "The rev of the commit. This value must match that in the commit object." 131 + }, 132 + "time": { 133 + "type": "string", 134 + "format": "datetime", 135 + "description": "Timestamp of when this message was originally broadcast." 136 + } 137 + } 138 + }, 139 + "identity": { 140 + "type": "object", 141 + "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.", 142 + "required": ["seq", "did", "time"], 143 + "properties": { 144 + "seq": { "type": "integer" }, 145 + "did": { "type": "string", "format": "did" }, 146 + "time": { "type": "string", "format": "datetime" }, 147 + "handle": { 148 + "type": "string", 149 + "format": "handle", 150 + "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." 151 + } 152 + } 153 + }, 154 + "account": { 155 + "type": "object", 156 + "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.", 157 + "required": ["seq", "did", "time", "active"], 158 + "properties": { 159 + "seq": { "type": "integer" }, 160 + "did": { "type": "string", "format": "did" }, 161 + "time": { "type": "string", "format": "datetime" }, 162 + "active": { 163 + "type": "boolean", 164 + "description": "Indicates that the account has a repository which can be fetched from the host that emitted this event." 165 + }, 166 + "status": { 167 + "type": "string", 168 + "description": "If active=false, this optional field indicates a reason for why the account is not active.", 169 + "knownValues": [ 170 + "takendown", 171 + "suspended", 172 + "deleted", 173 + "deactivated", 174 + "desynchronized", 175 + "throttled" 176 + ] 177 + } 178 + } 179 + }, 180 + "info": { 181 + "type": "object", 182 + "required": ["name"], 183 + "properties": { 184 + "name": { 185 + "type": "string", 186 + "knownValues": ["OutdatedCursor"] 187 + }, 188 + "message": { 189 + "type": "string" 190 + } 191 + } 192 + }, 193 + "repoOp": { 194 + "type": "object", 195 + "description": "A repo operation, ie a mutation of a single record.", 196 + "required": ["action", "path", "cid"], 197 + "nullable": ["cid"], 198 + "properties": { 199 + "action": { 200 + "type": "string", 201 + "knownValues": ["create", "update", "delete"] 202 + }, 203 + "path": { "type": "string" }, 204 + "cid": { 205 + "type": "cid-link", 206 + "description": "For creates and updates, the new record CID. For deletions, null." 207 + }, 208 + "prev": { 209 + "type": "cid-link", 210 + "description": "For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined." 211 + } 212 + } 213 + } 214 + } 215 + }
+43
resources/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": [ 8 + "id", 9 + "name", 10 + "contentMarkdown", 11 + "disabled", 12 + "lastUpdatedBy", 13 + "createdAt", 14 + "updatedAt" 15 + ], 16 + "properties": { 17 + "id": { "type": "string" }, 18 + "name": { "type": "string", "description": "Name of the template." }, 19 + "subject": { 20 + "type": "string", 21 + "description": "Content of the template, can contain markdown and variable placeholders." 22 + }, 23 + "contentMarkdown": { 24 + "type": "string", 25 + "description": "Subject of the message, used in emails." 26 + }, 27 + "disabled": { "type": "boolean" }, 28 + "lang": { 29 + "type": "string", 30 + "format": "language", 31 + "description": "Message language." 32 + }, 33 + "lastUpdatedBy": { 34 + "type": "string", 35 + "format": "did", 36 + "description": "DID of the user who last updated the template." 37 + }, 38 + "createdAt": { "type": "string", "format": "datetime" }, 39 + "updatedAt": { "type": "string", "format": "datetime" } 40 + } 41 + } 42 + } 43 + }
+1190
resources/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": [ 8 + "id", 9 + "event", 10 + "subject", 11 + "subjectBlobCids", 12 + "createdBy", 13 + "createdAt" 14 + ], 15 + "properties": { 16 + "id": { "type": "integer" }, 17 + "event": { 18 + "type": "union", 19 + "refs": [ 20 + "#modEventTakedown", 21 + "#modEventReverseTakedown", 22 + "#modEventComment", 23 + "#modEventReport", 24 + "#modEventLabel", 25 + "#modEventAcknowledge", 26 + "#modEventEscalate", 27 + "#modEventMute", 28 + "#modEventUnmute", 29 + "#modEventMuteReporter", 30 + "#modEventUnmuteReporter", 31 + "#modEventEmail", 32 + "#modEventResolveAppeal", 33 + "#modEventDivert", 34 + "#modEventTag", 35 + "#accountEvent", 36 + "#identityEvent", 37 + "#recordEvent", 38 + "#modEventPriorityScore", 39 + "#ageAssuranceEvent", 40 + "#ageAssuranceOverrideEvent", 41 + "#revokeAccountCredentialsEvent", 42 + "#scheduleTakedownEvent", 43 + "#cancelScheduledTakedownEvent" 44 + ] 45 + }, 46 + "subject": { 47 + "type": "union", 48 + "refs": [ 49 + "com.atproto.admin.defs#repoRef", 50 + "com.atproto.repo.strongRef", 51 + "chat.bsky.convo.defs#messageRef" 52 + ] 53 + }, 54 + "subjectBlobCids": { "type": "array", "items": { "type": "string" } }, 55 + "createdBy": { "type": "string", "format": "did" }, 56 + "createdAt": { "type": "string", "format": "datetime" }, 57 + "creatorHandle": { "type": "string" }, 58 + "subjectHandle": { "type": "string" }, 59 + "modTool": { "type": "ref", "ref": "#modTool" } 60 + } 61 + }, 62 + "modEventViewDetail": { 63 + "type": "object", 64 + "required": [ 65 + "id", 66 + "event", 67 + "subject", 68 + "subjectBlobs", 69 + "createdBy", 70 + "createdAt" 71 + ], 72 + "properties": { 73 + "id": { "type": "integer" }, 74 + "event": { 75 + "type": "union", 76 + "refs": [ 77 + "#modEventTakedown", 78 + "#modEventReverseTakedown", 79 + "#modEventComment", 80 + "#modEventReport", 81 + "#modEventLabel", 82 + "#modEventAcknowledge", 83 + "#modEventEscalate", 84 + "#modEventMute", 85 + "#modEventUnmute", 86 + "#modEventMuteReporter", 87 + "#modEventUnmuteReporter", 88 + "#modEventEmail", 89 + "#modEventResolveAppeal", 90 + "#modEventDivert", 91 + "#modEventTag", 92 + "#accountEvent", 93 + "#identityEvent", 94 + "#recordEvent", 95 + "#modEventPriorityScore", 96 + "#ageAssuranceEvent", 97 + "#ageAssuranceOverrideEvent", 98 + "#revokeAccountCredentialsEvent", 99 + "#scheduleTakedownEvent", 100 + "#cancelScheduledTakedownEvent" 101 + ] 102 + }, 103 + "subject": { 104 + "type": "union", 105 + "refs": [ 106 + "#repoView", 107 + "#repoViewNotFound", 108 + "#recordView", 109 + "#recordViewNotFound" 110 + ] 111 + }, 112 + "subjectBlobs": { 113 + "type": "array", 114 + "items": { "type": "ref", "ref": "#blobView" } 115 + }, 116 + "createdBy": { "type": "string", "format": "did" }, 117 + "createdAt": { "type": "string", "format": "datetime" }, 118 + "modTool": { "type": "ref", "ref": "#modTool" } 119 + } 120 + }, 121 + "subjectStatusView": { 122 + "type": "object", 123 + "required": ["id", "subject", "createdAt", "updatedAt", "reviewState"], 124 + "properties": { 125 + "id": { "type": "integer" }, 126 + "subject": { 127 + "type": "union", 128 + "refs": [ 129 + "com.atproto.admin.defs#repoRef", 130 + "com.atproto.repo.strongRef", 131 + "chat.bsky.convo.defs#messageRef" 132 + ] 133 + }, 134 + "hosting": { 135 + "type": "union", 136 + "refs": ["#accountHosting", "#recordHosting"] 137 + }, 138 + "subjectBlobCids": { 139 + "type": "array", 140 + "items": { "type": "string", "format": "cid" } 141 + }, 142 + "subjectRepoHandle": { "type": "string" }, 143 + "updatedAt": { 144 + "type": "string", 145 + "format": "datetime", 146 + "description": "Timestamp referencing when the last update was made to the moderation status of the subject" 147 + }, 148 + "createdAt": { 149 + "type": "string", 150 + "format": "datetime", 151 + "description": "Timestamp referencing the first moderation status impacting event was emitted on the subject" 152 + }, 153 + "reviewState": { 154 + "type": "ref", 155 + "ref": "#subjectReviewState" 156 + }, 157 + "comment": { 158 + "type": "string", 159 + "description": "Sticky comment on the subject." 160 + }, 161 + "priorityScore": { 162 + "type": "integer", 163 + "description": "Numeric value representing the level of priority. Higher score means higher priority.", 164 + "minimum": 0, 165 + "maximum": 100 166 + }, 167 + "muteUntil": { 168 + "type": "string", 169 + "format": "datetime" 170 + }, 171 + "muteReportingUntil": { 172 + "type": "string", 173 + "format": "datetime" 174 + }, 175 + "lastReviewedBy": { 176 + "type": "string", 177 + "format": "did" 178 + }, 179 + "lastReviewedAt": { 180 + "type": "string", 181 + "format": "datetime" 182 + }, 183 + "lastReportedAt": { 184 + "type": "string", 185 + "format": "datetime" 186 + }, 187 + "lastAppealedAt": { 188 + "type": "string", 189 + "format": "datetime", 190 + "description": "Timestamp referencing when the author of the subject appealed a moderation action" 191 + }, 192 + "takendown": { 193 + "type": "boolean" 194 + }, 195 + "appealed": { 196 + "type": "boolean", 197 + "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." 198 + }, 199 + "suspendUntil": { 200 + "type": "string", 201 + "format": "datetime" 202 + }, 203 + "tags": { 204 + "type": "array", 205 + "items": { "type": "string" } 206 + }, 207 + "accountStats": { 208 + "description": "Statistics related to the account subject", 209 + "type": "ref", 210 + "ref": "#accountStats" 211 + }, 212 + "recordsStats": { 213 + "description": "Statistics related to the record subjects authored by the subject's account", 214 + "type": "ref", 215 + "ref": "#recordsStats" 216 + }, 217 + "accountStrike": { 218 + "description": "Strike information for the account (account-level only)", 219 + "type": "ref", 220 + "ref": "#accountStrike" 221 + }, 222 + "ageAssuranceState": { 223 + "type": "string", 224 + "description": "Current age assurance state of the subject.", 225 + "knownValues": ["pending", "assured", "unknown", "reset", "blocked"] 226 + }, 227 + "ageAssuranceUpdatedBy": { 228 + "type": "string", 229 + "description": "Whether or not the last successful update to age assurance was made by the user or admin.", 230 + "knownValues": ["admin", "user"] 231 + } 232 + } 233 + }, 234 + "subjectView": { 235 + "description": "Detailed view of a subject. For record subjects, the author's repo and profile will be returned.", 236 + "type": "object", 237 + "required": ["type", "subject"], 238 + "properties": { 239 + "type": { 240 + "type": "ref", 241 + "ref": "com.atproto.moderation.defs#subjectType" 242 + }, 243 + "subject": { 244 + "type": "string" 245 + }, 246 + "status": { 247 + "type": "ref", 248 + "ref": "#subjectStatusView" 249 + }, 250 + "repo": { 251 + "type": "ref", 252 + "ref": "#repoViewDetail" 253 + }, 254 + "profile": { 255 + "type": "union", 256 + "refs": [] 257 + }, 258 + "record": { 259 + "type": "ref", 260 + "ref": "#recordViewDetail" 261 + } 262 + } 263 + }, 264 + "accountStats": { 265 + "description": "Statistics about a particular account subject", 266 + "type": "object", 267 + "properties": { 268 + "reportCount": { 269 + "description": "Total number of reports on the account", 270 + "type": "integer" 271 + }, 272 + "appealCount": { 273 + "description": "Total number of appeals against a moderation action on the account", 274 + "type": "integer" 275 + }, 276 + "suspendCount": { 277 + "description": "Number of times the account was suspended", 278 + "type": "integer" 279 + }, 280 + "escalateCount": { 281 + "description": "Number of times the account was escalated", 282 + "type": "integer" 283 + }, 284 + "takedownCount": { 285 + "description": "Number of times the account was taken down", 286 + "type": "integer" 287 + } 288 + } 289 + }, 290 + "recordsStats": { 291 + "description": "Statistics about a set of record subject items", 292 + "type": "object", 293 + "properties": { 294 + "totalReports": { 295 + "description": "Cumulative sum of the number of reports on the items in the set", 296 + "type": "integer" 297 + }, 298 + "reportedCount": { 299 + "description": "Number of items that were reported at least once", 300 + "type": "integer" 301 + }, 302 + "escalatedCount": { 303 + "description": "Number of items that were escalated at least once", 304 + "type": "integer" 305 + }, 306 + "appealedCount": { 307 + "description": "Number of items that were appealed at least once", 308 + "type": "integer" 309 + }, 310 + "subjectCount": { 311 + "description": "Total number of item in the set", 312 + "type": "integer" 313 + }, 314 + "pendingCount": { 315 + "description": "Number of item currently in \"reviewOpen\" or \"reviewEscalated\" state", 316 + "type": "integer" 317 + }, 318 + "processedCount": { 319 + "description": "Number of item currently in \"reviewNone\" or \"reviewClosed\" state", 320 + "type": "integer" 321 + }, 322 + "takendownCount": { 323 + "description": "Number of item currently taken down", 324 + "type": "integer" 325 + } 326 + } 327 + }, 328 + "accountStrike": { 329 + "description": "Strike information for an account", 330 + "type": "object", 331 + "properties": { 332 + "activeStrikeCount": { 333 + "description": "Current number of active strikes (excluding expired strikes)", 334 + "type": "integer" 335 + }, 336 + "totalStrikeCount": { 337 + "description": "Total number of strikes ever received (including expired strikes)", 338 + "type": "integer" 339 + }, 340 + "firstStrikeAt": { 341 + "description": "Timestamp of the first strike received", 342 + "type": "string", 343 + "format": "datetime" 344 + }, 345 + "lastStrikeAt": { 346 + "description": "Timestamp of the most recent strike received", 347 + "type": "string", 348 + "format": "datetime" 349 + } 350 + } 351 + }, 352 + "subjectReviewState": { 353 + "type": "string", 354 + "knownValues": [ 355 + "#reviewOpen", 356 + "#reviewEscalated", 357 + "#reviewClosed", 358 + "#reviewNone" 359 + ] 360 + }, 361 + "reviewOpen": { 362 + "type": "token", 363 + "description": "Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator" 364 + }, 365 + "reviewEscalated": { 366 + "type": "token", 367 + "description": "Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator" 368 + }, 369 + "reviewClosed": { 370 + "type": "token", 371 + "description": "Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator" 372 + }, 373 + "reviewNone": { 374 + "type": "token", 375 + "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" 376 + }, 377 + "modEventTakedown": { 378 + "type": "object", 379 + "description": "Take down a subject permanently or temporarily", 380 + "properties": { 381 + "comment": { 382 + "type": "string" 383 + }, 384 + "durationInHours": { 385 + "type": "integer", 386 + "description": "Indicates how long the takedown should be in effect before automatically expiring." 387 + }, 388 + "acknowledgeAccountSubjects": { 389 + "type": "boolean", 390 + "description": "If true, all other reports on content authored by this account will be resolved (acknowledged)." 391 + }, 392 + "policies": { 393 + "type": "array", 394 + "maxLength": 5, 395 + "items": { "type": "string" }, 396 + "description": "Names/Keywords of the policies that drove the decision." 397 + }, 398 + "severityLevel": { 399 + "type": "string", 400 + "description": "Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.)." 401 + }, 402 + "targetServices": { 403 + "type": "array", 404 + "items": { "type": "string", "knownValues": ["appview", "pds"] }, 405 + "description": "List of services where the takedown should be applied. If empty or not provided, takedown is applied on all configured services." 406 + }, 407 + "strikeCount": { 408 + "type": "integer", 409 + "description": "Number of strikes to assign to the user for this violation." 410 + }, 411 + "strikeExpiresAt": { 412 + "type": "string", 413 + "format": "datetime", 414 + "description": "When the strike should expire. If not provided, the strike never expires." 415 + } 416 + } 417 + }, 418 + "modEventReverseTakedown": { 419 + "type": "object", 420 + "description": "Revert take down action on a subject", 421 + "properties": { 422 + "comment": { 423 + "type": "string", 424 + "description": "Describe reasoning behind the reversal." 425 + }, 426 + "policies": { 427 + "type": "array", 428 + "maxLength": 5, 429 + "items": { "type": "string" }, 430 + "description": "Names/Keywords of the policy infraction for which takedown is being reversed." 431 + }, 432 + "severityLevel": { 433 + "type": "string", 434 + "description": "Severity level of the violation. Usually set from the last policy infraction's severity." 435 + }, 436 + "strikeCount": { 437 + "type": "integer", 438 + "description": "Number of strikes to subtract from the user's strike count. Usually set from the last policy infraction's severity." 439 + } 440 + } 441 + }, 442 + "modEventResolveAppeal": { 443 + "type": "object", 444 + "description": "Resolve appeal on a subject", 445 + "properties": { 446 + "comment": { 447 + "type": "string", 448 + "description": "Describe resolution." 449 + } 450 + } 451 + }, 452 + "modEventComment": { 453 + "type": "object", 454 + "description": "Add a comment to a subject. An empty comment will clear any previously set sticky comment.", 455 + "properties": { 456 + "comment": { 457 + "type": "string" 458 + }, 459 + "sticky": { 460 + "type": "boolean", 461 + "description": "Make the comment persistent on the subject" 462 + } 463 + } 464 + }, 465 + "modEventReport": { 466 + "type": "object", 467 + "description": "Report a subject", 468 + "required": ["reportType"], 469 + "properties": { 470 + "comment": { 471 + "type": "string" 472 + }, 473 + "isReporterMuted": { 474 + "type": "boolean", 475 + "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." 476 + }, 477 + "reportType": { 478 + "type": "ref", 479 + "ref": "com.atproto.moderation.defs#reasonType" 480 + } 481 + } 482 + }, 483 + "modEventLabel": { 484 + "type": "object", 485 + "description": "Apply/Negate labels on a subject", 486 + "required": ["createLabelVals", "negateLabelVals"], 487 + "properties": { 488 + "comment": { 489 + "type": "string" 490 + }, 491 + "createLabelVals": { 492 + "type": "array", 493 + "items": { "type": "string" } 494 + }, 495 + "negateLabelVals": { 496 + "type": "array", 497 + "items": { "type": "string" } 498 + }, 499 + "durationInHours": { 500 + "type": "integer", 501 + "description": "Indicates how long the label will remain on the subject. Only applies on labels that are being added." 502 + } 503 + } 504 + }, 505 + "modEventPriorityScore": { 506 + "type": "object", 507 + "description": "Set priority score of the subject. Higher score means higher priority.", 508 + "required": ["score"], 509 + "properties": { 510 + "comment": { 511 + "type": "string" 512 + }, 513 + "score": { 514 + "type": "integer", 515 + "minimum": 0, 516 + "maximum": 100 517 + } 518 + } 519 + }, 520 + "ageAssuranceEvent": { 521 + "type": "object", 522 + "description": "Age assurance info coming directly from users. Only works on DID subjects.", 523 + "required": ["createdAt", "status", "attemptId"], 524 + "properties": { 525 + "createdAt": { 526 + "type": "string", 527 + "format": "datetime", 528 + "description": "The date and time of this write operation." 529 + }, 530 + "status": { 531 + "type": "string", 532 + "description": "The status of the age assurance process.", 533 + "knownValues": ["unknown", "pending", "assured"] 534 + }, 535 + "attemptId": { 536 + "type": "string", 537 + "description": "The unique identifier for this instance of the age assurance flow, in UUID format." 538 + }, 539 + "initIp": { 540 + "type": "string", 541 + "description": "The IP address used when initiating the AA flow." 542 + }, 543 + "initUa": { 544 + "type": "string", 545 + "description": "The user agent used when initiating the AA flow." 546 + }, 547 + "completeIp": { 548 + "type": "string", 549 + "description": "The IP address used when completing the AA flow." 550 + }, 551 + "completeUa": { 552 + "type": "string", 553 + "description": "The user agent used when completing the AA flow." 554 + } 555 + } 556 + }, 557 + "ageAssuranceOverrideEvent": { 558 + "type": "object", 559 + "description": "Age assurance status override by moderators. Only works on DID subjects.", 560 + "required": ["comment", "status"], 561 + "properties": { 562 + "status": { 563 + "type": "string", 564 + "description": "The status to be set for the user decided by a moderator, overriding whatever value the user had previously. Use reset to default to original state.", 565 + "knownValues": ["assured", "reset", "blocked"] 566 + }, 567 + "comment": { 568 + "type": "string", 569 + "description": "Comment describing the reason for the override." 570 + } 571 + } 572 + }, 573 + "revokeAccountCredentialsEvent": { 574 + "type": "object", 575 + "description": "Account credentials revocation by moderators. Only works on DID subjects.", 576 + "required": ["comment"], 577 + "properties": { 578 + "comment": { 579 + "type": "string", 580 + "description": "Comment describing the reason for the revocation." 581 + } 582 + } 583 + }, 584 + "modEventAcknowledge": { 585 + "type": "object", 586 + "properties": { 587 + "comment": { "type": "string" }, 588 + "acknowledgeAccountSubjects": { 589 + "type": "boolean", 590 + "description": "If true, all other reports on content authored by this account will be resolved (acknowledged)." 591 + } 592 + } 593 + }, 594 + "modEventEscalate": { 595 + "type": "object", 596 + "properties": { 597 + "comment": { "type": "string" } 598 + } 599 + }, 600 + "modEventMute": { 601 + "type": "object", 602 + "description": "Mute incoming reports on a subject", 603 + "required": ["durationInHours"], 604 + "properties": { 605 + "comment": { "type": "string" }, 606 + "durationInHours": { 607 + "type": "integer", 608 + "description": "Indicates how long the subject should remain muted." 609 + } 610 + } 611 + }, 612 + "modEventUnmute": { 613 + "type": "object", 614 + "description": "Unmute action on a subject", 615 + "properties": { 616 + "comment": { 617 + "type": "string", 618 + "description": "Describe reasoning behind the reversal." 619 + } 620 + } 621 + }, 622 + "modEventMuteReporter": { 623 + "type": "object", 624 + "description": "Mute incoming reports from an account", 625 + "properties": { 626 + "comment": { "type": "string" }, 627 + "durationInHours": { 628 + "type": "integer", 629 + "description": "Indicates how long the account should remain muted. Falsy value here means a permanent mute." 630 + } 631 + } 632 + }, 633 + "modEventUnmuteReporter": { 634 + "type": "object", 635 + "description": "Unmute incoming reports from an account", 636 + "properties": { 637 + "comment": { 638 + "type": "string", 639 + "description": "Describe reasoning behind the reversal." 640 + } 641 + } 642 + }, 643 + "modEventEmail": { 644 + "type": "object", 645 + "description": "Keep a log of outgoing email to a user", 646 + "required": ["subjectLine"], 647 + "properties": { 648 + "subjectLine": { 649 + "type": "string", 650 + "description": "The subject line of the email sent to the user." 651 + }, 652 + "content": { 653 + "type": "string", 654 + "description": "The content of the email sent to the user." 655 + }, 656 + "comment": { 657 + "type": "string", 658 + "description": "Additional comment about the outgoing comm." 659 + }, 660 + "policies": { 661 + "type": "array", 662 + "maxLength": 5, 663 + "items": { "type": "string" }, 664 + "description": "Names/Keywords of the policies that necessitated the email." 665 + }, 666 + "severityLevel": { 667 + "type": "string", 668 + "description": "Severity level of the violation. Normally 'sev-1' that adds strike on repeat offense" 669 + }, 670 + "strikeCount": { 671 + "type": "integer", 672 + "description": "Number of strikes to assign to the user for this violation. Normally 0 as an indicator of a warning and only added as a strike on a repeat offense." 673 + }, 674 + "strikeExpiresAt": { 675 + "type": "string", 676 + "format": "datetime", 677 + "description": "When the strike should expire. If not provided, the strike never expires." 678 + }, 679 + "isDelivered": { 680 + "type": "boolean", 681 + "description": "Indicates whether the email was successfully delivered to the user's inbox." 682 + } 683 + } 684 + }, 685 + "modEventDivert": { 686 + "type": "object", 687 + "description": "Divert a record's blobs to a 3rd party service for further scanning/tagging", 688 + "properties": { 689 + "comment": { "type": "string" } 690 + } 691 + }, 692 + "modEventTag": { 693 + "type": "object", 694 + "description": "Add/Remove a tag on a subject", 695 + "required": ["add", "remove"], 696 + "properties": { 697 + "add": { 698 + "type": "array", 699 + "items": { "type": "string" }, 700 + "description": "Tags to be added to the subject. If already exists, won't be duplicated." 701 + }, 702 + "remove": { 703 + "type": "array", 704 + "items": { "type": "string" }, 705 + "description": "Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated." 706 + }, 707 + "comment": { 708 + "type": "string", 709 + "description": "Additional comment about added/removed tags." 710 + } 711 + } 712 + }, 713 + "accountEvent": { 714 + "type": "object", 715 + "description": "Logs account status related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.", 716 + "required": ["timestamp", "active"], 717 + "properties": { 718 + "comment": { "type": "string" }, 719 + "active": { 720 + "type": "boolean", 721 + "description": "Indicates that the account has a repository which can be fetched from the host that emitted this event." 722 + }, 723 + "status": { 724 + "type": "string", 725 + "knownValues": [ 726 + "unknown", 727 + "deactivated", 728 + "deleted", 729 + "takendown", 730 + "suspended", 731 + "tombstoned" 732 + ] 733 + }, 734 + "timestamp": { 735 + "type": "string", 736 + "format": "datetime" 737 + } 738 + } 739 + }, 740 + "identityEvent": { 741 + "type": "object", 742 + "description": "Logs identity related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.", 743 + "required": ["timestamp"], 744 + "properties": { 745 + "comment": { "type": "string" }, 746 + "handle": { "type": "string", "format": "handle" }, 747 + "pdsHost": { "type": "string", "format": "uri" }, 748 + "tombstone": { "type": "boolean" }, 749 + "timestamp": { 750 + "type": "string", 751 + "format": "datetime" 752 + } 753 + } 754 + }, 755 + "recordEvent": { 756 + "type": "object", 757 + "description": "Logs lifecycle event on a record subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.", 758 + "required": ["timestamp", "op"], 759 + "properties": { 760 + "comment": { "type": "string" }, 761 + "op": { 762 + "type": "string", 763 + "knownValues": ["create", "update", "delete"] 764 + }, 765 + "cid": { "type": "string", "format": "cid" }, 766 + "timestamp": { "type": "string", "format": "datetime" } 767 + } 768 + }, 769 + "scheduleTakedownEvent": { 770 + "type": "object", 771 + "description": "Logs a scheduled takedown action for an account.", 772 + "properties": { 773 + "comment": { "type": "string" }, 774 + "executeAt": { "type": "string", "format": "datetime" }, 775 + "executeAfter": { "type": "string", "format": "datetime" }, 776 + "executeUntil": { "type": "string", "format": "datetime" } 777 + } 778 + }, 779 + "cancelScheduledTakedownEvent": { 780 + "type": "object", 781 + "description": "Logs cancellation of a scheduled takedown action for an account.", 782 + "properties": { 783 + "comment": { "type": "string" } 784 + } 785 + }, 786 + "repoView": { 787 + "type": "object", 788 + "required": [ 789 + "did", 790 + "handle", 791 + "relatedRecords", 792 + "indexedAt", 793 + "moderation" 794 + ], 795 + "properties": { 796 + "did": { "type": "string", "format": "did" }, 797 + "handle": { "type": "string", "format": "handle" }, 798 + "email": { "type": "string" }, 799 + "relatedRecords": { "type": "array", "items": { "type": "unknown" } }, 800 + "indexedAt": { "type": "string", "format": "datetime" }, 801 + "moderation": { "type": "ref", "ref": "#moderation" }, 802 + "invitedBy": { 803 + "type": "ref", 804 + "ref": "com.atproto.server.defs#inviteCode" 805 + }, 806 + "invitesDisabled": { "type": "boolean" }, 807 + "inviteNote": { "type": "string" }, 808 + "deactivatedAt": { "type": "string", "format": "datetime" }, 809 + "threatSignatures": { 810 + "type": "array", 811 + "items": { 812 + "type": "ref", 813 + "ref": "com.atproto.admin.defs#threatSignature" 814 + } 815 + } 816 + } 817 + }, 818 + "repoViewDetail": { 819 + "type": "object", 820 + "required": [ 821 + "did", 822 + "handle", 823 + "relatedRecords", 824 + "indexedAt", 825 + "moderation" 826 + ], 827 + "properties": { 828 + "did": { "type": "string", "format": "did" }, 829 + "handle": { "type": "string", "format": "handle" }, 830 + "email": { "type": "string" }, 831 + "relatedRecords": { "type": "array", "items": { "type": "unknown" } }, 832 + "indexedAt": { "type": "string", "format": "datetime" }, 833 + "moderation": { "type": "ref", "ref": "#moderationDetail" }, 834 + "labels": { 835 + "type": "array", 836 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 837 + }, 838 + "invitedBy": { 839 + "type": "ref", 840 + "ref": "com.atproto.server.defs#inviteCode" 841 + }, 842 + "invites": { 843 + "type": "array", 844 + "items": { 845 + "type": "ref", 846 + "ref": "com.atproto.server.defs#inviteCode" 847 + } 848 + }, 849 + "invitesDisabled": { "type": "boolean" }, 850 + "inviteNote": { "type": "string" }, 851 + "emailConfirmedAt": { "type": "string", "format": "datetime" }, 852 + "deactivatedAt": { "type": "string", "format": "datetime" }, 853 + "threatSignatures": { 854 + "type": "array", 855 + "items": { 856 + "type": "ref", 857 + "ref": "com.atproto.admin.defs#threatSignature" 858 + } 859 + } 860 + } 861 + }, 862 + "repoViewNotFound": { 863 + "type": "object", 864 + "required": ["did"], 865 + "properties": { 866 + "did": { "type": "string", "format": "did" } 867 + } 868 + }, 869 + "recordView": { 870 + "type": "object", 871 + "required": [ 872 + "uri", 873 + "cid", 874 + "value", 875 + "blobCids", 876 + "indexedAt", 877 + "moderation", 878 + "repo" 879 + ], 880 + "properties": { 881 + "uri": { "type": "string", "format": "at-uri" }, 882 + "cid": { "type": "string", "format": "cid" }, 883 + "value": { "type": "unknown" }, 884 + "blobCids": { 885 + "type": "array", 886 + "items": { "type": "string", "format": "cid" } 887 + }, 888 + "indexedAt": { "type": "string", "format": "datetime" }, 889 + "moderation": { "type": "ref", "ref": "#moderation" }, 890 + "repo": { "type": "ref", "ref": "#repoView" } 891 + } 892 + }, 893 + "recordViewDetail": { 894 + "type": "object", 895 + "required": [ 896 + "uri", 897 + "cid", 898 + "value", 899 + "blobs", 900 + "indexedAt", 901 + "moderation", 902 + "repo" 903 + ], 904 + "properties": { 905 + "uri": { "type": "string", "format": "at-uri" }, 906 + "cid": { "type": "string", "format": "cid" }, 907 + "value": { "type": "unknown" }, 908 + "blobs": { 909 + "type": "array", 910 + "items": { "type": "ref", "ref": "#blobView" } 911 + }, 912 + "labels": { 913 + "type": "array", 914 + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 915 + }, 916 + "indexedAt": { "type": "string", "format": "datetime" }, 917 + "moderation": { "type": "ref", "ref": "#moderationDetail" }, 918 + "repo": { "type": "ref", "ref": "#repoView" } 919 + } 920 + }, 921 + "recordViewNotFound": { 922 + "type": "object", 923 + "required": ["uri"], 924 + "properties": { 925 + "uri": { "type": "string", "format": "at-uri" } 926 + } 927 + }, 928 + "moderation": { 929 + "type": "object", 930 + "properties": { 931 + "subjectStatus": { "type": "ref", "ref": "#subjectStatusView" } 932 + } 933 + }, 934 + "moderationDetail": { 935 + "type": "object", 936 + "properties": { 937 + "subjectStatus": { 938 + "type": "ref", 939 + "ref": "#subjectStatusView" 940 + } 941 + } 942 + }, 943 + "blobView": { 944 + "type": "object", 945 + "required": ["cid", "mimeType", "size", "createdAt"], 946 + "properties": { 947 + "cid": { "type": "string", "format": "cid" }, 948 + "mimeType": { "type": "string" }, 949 + "size": { "type": "integer" }, 950 + "createdAt": { "type": "string", "format": "datetime" }, 951 + "details": { 952 + "type": "union", 953 + "refs": ["#imageDetails", "#videoDetails"] 954 + }, 955 + "moderation": { "type": "ref", "ref": "#moderation" } 956 + } 957 + }, 958 + "imageDetails": { 959 + "type": "object", 960 + "required": ["width", "height"], 961 + "properties": { 962 + "width": { "type": "integer" }, 963 + "height": { "type": "integer" } 964 + } 965 + }, 966 + "videoDetails": { 967 + "type": "object", 968 + "required": ["width", "height", "length"], 969 + "properties": { 970 + "width": { "type": "integer" }, 971 + "height": { "type": "integer" }, 972 + "length": { "type": "integer" } 973 + } 974 + }, 975 + "accountHosting": { 976 + "type": "object", 977 + "required": ["status"], 978 + "properties": { 979 + "status": { 980 + "type": "string", 981 + "knownValues": [ 982 + "takendown", 983 + "suspended", 984 + "deleted", 985 + "deactivated", 986 + "unknown" 987 + ] 988 + }, 989 + "updatedAt": { 990 + "type": "string", 991 + "format": "datetime" 992 + }, 993 + "createdAt": { 994 + "type": "string", 995 + "format": "datetime" 996 + }, 997 + "deletedAt": { 998 + "type": "string", 999 + "format": "datetime" 1000 + }, 1001 + "deactivatedAt": { 1002 + "type": "string", 1003 + "format": "datetime" 1004 + }, 1005 + "reactivatedAt": { 1006 + "type": "string", 1007 + "format": "datetime" 1008 + } 1009 + } 1010 + }, 1011 + "recordHosting": { 1012 + "type": "object", 1013 + "required": ["status"], 1014 + "properties": { 1015 + "status": { 1016 + "type": "string", 1017 + "knownValues": ["deleted", "unknown"] 1018 + }, 1019 + "updatedAt": { 1020 + "type": "string", 1021 + "format": "datetime" 1022 + }, 1023 + "createdAt": { 1024 + "type": "string", 1025 + "format": "datetime" 1026 + }, 1027 + "deletedAt": { 1028 + "type": "string", 1029 + "format": "datetime" 1030 + } 1031 + } 1032 + }, 1033 + "reporterStats": { 1034 + "type": "object", 1035 + "required": [ 1036 + "did", 1037 + "accountReportCount", 1038 + "recordReportCount", 1039 + "reportedAccountCount", 1040 + "reportedRecordCount", 1041 + "takendownAccountCount", 1042 + "takendownRecordCount", 1043 + "labeledAccountCount", 1044 + "labeledRecordCount" 1045 + ], 1046 + "properties": { 1047 + "did": { 1048 + "type": "string", 1049 + "format": "did" 1050 + }, 1051 + "accountReportCount": { 1052 + "type": "integer", 1053 + "description": "The total number of reports made by the user on accounts." 1054 + }, 1055 + "recordReportCount": { 1056 + "type": "integer", 1057 + "description": "The total number of reports made by the user on records." 1058 + }, 1059 + "reportedAccountCount": { 1060 + "type": "integer", 1061 + "description": "The total number of accounts reported by the user." 1062 + }, 1063 + "reportedRecordCount": { 1064 + "type": "integer", 1065 + "description": "The total number of records reported by the user." 1066 + }, 1067 + "takendownAccountCount": { 1068 + "type": "integer", 1069 + "description": "The total number of accounts taken down as a result of the user's reports." 1070 + }, 1071 + "takendownRecordCount": { 1072 + "type": "integer", 1073 + "description": "The total number of records taken down as a result of the user's reports." 1074 + }, 1075 + "labeledAccountCount": { 1076 + "type": "integer", 1077 + "description": "The total number of accounts labeled as a result of the user's reports." 1078 + }, 1079 + "labeledRecordCount": { 1080 + "type": "integer", 1081 + "description": "The total number of records labeled as a result of the user's reports." 1082 + } 1083 + } 1084 + }, 1085 + "modTool": { 1086 + "type": "object", 1087 + "description": "Moderation tool information for tracing the source of the action", 1088 + "required": ["name"], 1089 + "properties": { 1090 + "name": { 1091 + "type": "string", 1092 + "description": "Name/identifier of the source (e.g., 'automod', 'ozone/workspace')" 1093 + }, 1094 + "meta": { 1095 + "type": "unknown", 1096 + "description": "Additional arbitrary metadata about the source" 1097 + } 1098 + } 1099 + }, 1100 + "timelineEventPlcCreate": { 1101 + "type": "token", 1102 + "description": "Moderation event timeline event for a PLC create operation" 1103 + }, 1104 + "timelineEventPlcOperation": { 1105 + "type": "token", 1106 + "description": "Moderation event timeline event for generic PLC operation" 1107 + }, 1108 + "timelineEventPlcTombstone": { 1109 + "type": "token", 1110 + "description": "Moderation event timeline event for a PLC tombstone operation" 1111 + }, 1112 + "scheduledActionView": { 1113 + "type": "object", 1114 + "description": "View of a scheduled moderation action", 1115 + "required": ["id", "action", "did", "createdBy", "createdAt", "status"], 1116 + "properties": { 1117 + "id": { 1118 + "type": "integer", 1119 + "description": "Auto-incrementing row ID" 1120 + }, 1121 + "action": { 1122 + "type": "string", 1123 + "knownValues": ["takedown"], 1124 + "description": "Type of action to be executed" 1125 + }, 1126 + "eventData": { 1127 + "type": "unknown", 1128 + "description": "Serialized event object that will be propagated to the event when performed" 1129 + }, 1130 + "did": { 1131 + "type": "string", 1132 + "format": "did", 1133 + "description": "Subject DID for the action" 1134 + }, 1135 + "executeAt": { 1136 + "type": "string", 1137 + "format": "datetime", 1138 + "description": "Exact time to execute the action" 1139 + }, 1140 + "executeAfter": { 1141 + "type": "string", 1142 + "format": "datetime", 1143 + "description": "Earliest time to execute the action (for randomized scheduling)" 1144 + }, 1145 + "executeUntil": { 1146 + "type": "string", 1147 + "format": "datetime", 1148 + "description": "Latest time to execute the action (for randomized scheduling)" 1149 + }, 1150 + "randomizeExecution": { 1151 + "type": "boolean", 1152 + "description": "Whether execution time should be randomized within the specified range" 1153 + }, 1154 + "createdBy": { 1155 + "type": "string", 1156 + "format": "did", 1157 + "description": "DID of the user who created this scheduled action" 1158 + }, 1159 + "createdAt": { 1160 + "type": "string", 1161 + "format": "datetime", 1162 + "description": "When the scheduled action was created" 1163 + }, 1164 + "updatedAt": { 1165 + "type": "string", 1166 + "format": "datetime", 1167 + "description": "When the scheduled action was last updated" 1168 + }, 1169 + "status": { 1170 + "type": "string", 1171 + "knownValues": ["pending", "executed", "cancelled", "failed"], 1172 + "description": "Current status of the scheduled action" 1173 + }, 1174 + "lastExecutedAt": { 1175 + "type": "string", 1176 + "format": "datetime", 1177 + "description": "When the action was last attempted to be executed" 1178 + }, 1179 + "lastFailureReason": { 1180 + "type": "string", 1181 + "description": "Reason for the last execution failure" 1182 + }, 1183 + "executionEventId": { 1184 + "type": "integer", 1185 + "description": "ID of the moderation event created when action was successfully executed" 1186 + } 1187 + } 1188 + } 1189 + } 1190 + }
+90
resources/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#modEventResolveAppeal", 29 + "tools.ozone.moderation.defs#modEventEmail", 30 + "tools.ozone.moderation.defs#modEventDivert", 31 + "tools.ozone.moderation.defs#modEventTag", 32 + "tools.ozone.moderation.defs#accountEvent", 33 + "tools.ozone.moderation.defs#identityEvent", 34 + "tools.ozone.moderation.defs#recordEvent", 35 + "tools.ozone.moderation.defs#modEventPriorityScore", 36 + "tools.ozone.moderation.defs#ageAssuranceEvent", 37 + "tools.ozone.moderation.defs#ageAssuranceOverrideEvent", 38 + "tools.ozone.moderation.defs#revokeAccountCredentialsEvent", 39 + "tools.ozone.moderation.defs#scheduleTakedownEvent", 40 + "tools.ozone.moderation.defs#cancelScheduledTakedownEvent" 41 + ] 42 + }, 43 + "subject": { 44 + "type": "union", 45 + "refs": [ 46 + "com.atproto.admin.defs#repoRef", 47 + "com.atproto.repo.strongRef" 48 + ] 49 + }, 50 + "subjectBlobCids": { 51 + "type": "array", 52 + "items": { 53 + "type": "string", 54 + "format": "cid" 55 + } 56 + }, 57 + "createdBy": { 58 + "type": "string", 59 + "format": "did" 60 + }, 61 + "modTool": { 62 + "type": "ref", 63 + "ref": "tools.ozone.moderation.defs#modTool" 64 + }, 65 + "externalId": { 66 + "type": "string", 67 + "description": "An optional external ID for the event, used to deduplicate events from external systems. Fails when an event of same type with the same external ID exists for the same subject." 68 + } 69 + } 70 + } 71 + }, 72 + "output": { 73 + "encoding": "application/json", 74 + "schema": { 75 + "type": "ref", 76 + "ref": "tools.ozone.moderation.defs#modEventView" 77 + } 78 + }, 79 + "errors": [ 80 + { 81 + "name": "SubjectHasAction" 82 + }, 83 + { 84 + "name": "DuplicateExternalId", 85 + "description": "An event with the same external ID already exists for the subject." 86 + } 87 + ] 88 + } 89 + } 90 + }
+24
resources/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
resources/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 + }
+162
resources/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": { 14 + "type": "string" 15 + }, 16 + "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." 17 + }, 18 + "createdBy": { 19 + "type": "string", 20 + "format": "did" 21 + }, 22 + "sortDirection": { 23 + "type": "string", 24 + "default": "desc", 25 + "enum": ["asc", "desc"], 26 + "description": "Sort direction for the events. Defaults to descending order of created at timestamp." 27 + }, 28 + "createdAfter": { 29 + "type": "string", 30 + "format": "datetime", 31 + "description": "Retrieve events created after a given timestamp" 32 + }, 33 + "createdBefore": { 34 + "type": "string", 35 + "format": "datetime", 36 + "description": "Retrieve events created before a given timestamp" 37 + }, 38 + "subject": { 39 + "type": "string", 40 + "format": "uri" 41 + }, 42 + "collections": { 43 + "type": "array", 44 + "maxLength": 20, 45 + "description": "If specified, only events where the subject belongs to the given collections will be returned. When subjectType is set to 'account', this will be ignored.", 46 + "items": { 47 + "type": "string", 48 + "format": "nsid" 49 + } 50 + }, 51 + "subjectType": { 52 + "type": "string", 53 + "description": "If specified, only events where the subject is of the given type (account or record) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored.", 54 + "knownValues": ["account", "record"] 55 + }, 56 + "includeAllUserRecords": { 57 + "type": "boolean", 58 + "default": false, 59 + "description": "If true, events on all record types (posts, lists, profile etc.) or records from given 'collections' param, owned by the did are returned." 60 + }, 61 + "limit": { 62 + "type": "integer", 63 + "minimum": 1, 64 + "maximum": 100, 65 + "default": 50 66 + }, 67 + "hasComment": { 68 + "type": "boolean", 69 + "description": "If true, only events with comments are returned" 70 + }, 71 + "comment": { 72 + "type": "string", 73 + "description": "If specified, only events with comments containing the keyword are returned. Apply || separator to use multiple keywords and match using OR condition." 74 + }, 75 + "addedLabels": { 76 + "type": "array", 77 + "items": { 78 + "type": "string" 79 + }, 80 + "description": "If specified, only events where all of these labels were added are returned" 81 + }, 82 + "removedLabels": { 83 + "type": "array", 84 + "items": { 85 + "type": "string" 86 + }, 87 + "description": "If specified, only events where all of these labels were removed are returned" 88 + }, 89 + "addedTags": { 90 + "type": "array", 91 + "items": { 92 + "type": "string" 93 + }, 94 + "description": "If specified, only events where all of these tags were added are returned" 95 + }, 96 + "removedTags": { 97 + "type": "array", 98 + "items": { 99 + "type": "string" 100 + }, 101 + "description": "If specified, only events where all of these tags were removed are returned" 102 + }, 103 + "reportTypes": { 104 + "type": "array", 105 + "items": { 106 + "type": "string" 107 + } 108 + }, 109 + "policies": { 110 + "type": "array", 111 + "items": { 112 + "type": "string", 113 + "description": "If specified, only events where the action policies match any of the given policies are returned" 114 + } 115 + }, 116 + "modTool": { 117 + "type": "array", 118 + "items": { 119 + "type": "string" 120 + }, 121 + "description": "If specified, only events where the modTool name matches any of the given values are returned" 122 + }, 123 + "batchId": { 124 + "type": "string", 125 + "description": "If specified, only events where the batchId matches the given value are returned" 126 + }, 127 + "ageAssuranceState": { 128 + "type": "string", 129 + "description": "If specified, only events where the age assurance state matches the given value are returned", 130 + "knownValues": ["pending", "assured", "unknown", "reset", "blocked"] 131 + }, 132 + "withStrike": { 133 + "type": "boolean", 134 + "description": "If specified, only events where strikeCount value is set are returned." 135 + }, 136 + "cursor": { 137 + "type": "string" 138 + } 139 + } 140 + }, 141 + "output": { 142 + "encoding": "application/json", 143 + "schema": { 144 + "type": "object", 145 + "required": ["events"], 146 + "properties": { 147 + "cursor": { 148 + "type": "string" 149 + }, 150 + "events": { 151 + "type": "array", 152 + "items": { 153 + "type": "ref", 154 + "ref": "tools.ozone.moderation.defs#modEventView" 155 + } 156 + } 157 + } 158 + } 159 + } 160 + } 161 + } 162 + }
+225
resources/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 + "queueCount": { 12 + "type": "integer", 13 + "description": "Number of queues being used by moderators. Subjects will be split among all queues." 14 + }, 15 + "queueIndex": { 16 + "type": "integer", 17 + "description": "Index of the queue to fetch subjects from. Works only when queueCount value is specified." 18 + }, 19 + "queueSeed": { 20 + "type": "string", 21 + "description": "A seeder to shuffle/balance the queue items." 22 + }, 23 + "includeAllUserRecords": { 24 + "type": "boolean", 25 + "description": "All subjects, or subjects from given 'collections' param, belonging to the account specified in the 'subject' param will be returned." 26 + }, 27 + "subject": { 28 + "type": "string", 29 + "format": "uri", 30 + "description": "The subject to get the status for." 31 + }, 32 + "comment": { 33 + "type": "string", 34 + "description": "Search subjects by keyword from comments" 35 + }, 36 + "reportedAfter": { 37 + "type": "string", 38 + "format": "datetime", 39 + "description": "Search subjects reported after a given timestamp" 40 + }, 41 + "reportedBefore": { 42 + "type": "string", 43 + "format": "datetime", 44 + "description": "Search subjects reported before a given timestamp" 45 + }, 46 + "reviewedAfter": { 47 + "type": "string", 48 + "format": "datetime", 49 + "description": "Search subjects reviewed after a given timestamp" 50 + }, 51 + "hostingDeletedAfter": { 52 + "type": "string", 53 + "format": "datetime", 54 + "description": "Search subjects where the associated record/account was deleted after a given timestamp" 55 + }, 56 + "hostingDeletedBefore": { 57 + "type": "string", 58 + "format": "datetime", 59 + "description": "Search subjects where the associated record/account was deleted before a given timestamp" 60 + }, 61 + "hostingUpdatedAfter": { 62 + "type": "string", 63 + "format": "datetime", 64 + "description": "Search subjects where the associated record/account was updated after a given timestamp" 65 + }, 66 + "hostingUpdatedBefore": { 67 + "type": "string", 68 + "format": "datetime", 69 + "description": "Search subjects where the associated record/account was updated before a given timestamp" 70 + }, 71 + "hostingStatuses": { 72 + "type": "array", 73 + "items": { 74 + "type": "string" 75 + }, 76 + "description": "Search subjects by the status of the associated record/account" 77 + }, 78 + "reviewedBefore": { 79 + "type": "string", 80 + "format": "datetime", 81 + "description": "Search subjects reviewed before a given timestamp" 82 + }, 83 + "includeMuted": { 84 + "type": "boolean", 85 + "description": "By default, we don't include muted subjects in the results. Set this to true to include them." 86 + }, 87 + "onlyMuted": { 88 + "type": "boolean", 89 + "description": "When set to true, only muted subjects and reporters will be returned." 90 + }, 91 + "reviewState": { 92 + "type": "string", 93 + "description": "Specify when fetching subjects in a certain state", 94 + "knownValues": [ 95 + "tools.ozone.moderation.defs#reviewOpen", 96 + "tools.ozone.moderation.defs#reviewClosed", 97 + "tools.ozone.moderation.defs#reviewEscalated", 98 + "tools.ozone.moderation.defs#reviewNone" 99 + ] 100 + }, 101 + "ignoreSubjects": { 102 + "type": "array", 103 + "items": { 104 + "type": "string", 105 + "format": "uri" 106 + } 107 + }, 108 + "lastReviewedBy": { 109 + "type": "string", 110 + "format": "did", 111 + "description": "Get all subject statuses that were reviewed by a specific moderator" 112 + }, 113 + "sortField": { 114 + "type": "string", 115 + "default": "lastReportedAt", 116 + "enum": [ 117 + "lastReviewedAt", 118 + "lastReportedAt", 119 + "reportedRecordsCount", 120 + "takendownRecordsCount", 121 + "priorityScore" 122 + ] 123 + }, 124 + "sortDirection": { 125 + "type": "string", 126 + "default": "desc", 127 + "enum": ["asc", "desc"] 128 + }, 129 + "takendown": { 130 + "type": "boolean", 131 + "description": "Get subjects that were taken down" 132 + }, 133 + "appealed": { 134 + "type": "boolean", 135 + "description": "Get subjects in unresolved appealed status" 136 + }, 137 + "limit": { 138 + "type": "integer", 139 + "minimum": 1, 140 + "maximum": 100, 141 + "default": 50 142 + }, 143 + "tags": { 144 + "type": "array", 145 + "maxLength": 25, 146 + "items": { 147 + "type": "string", 148 + "description": "Items in this array are applied with OR filters. To apply AND filter, put all tags in the same string and separate using && characters" 149 + } 150 + }, 151 + "excludeTags": { 152 + "type": "array", 153 + "items": { 154 + "type": "string" 155 + } 156 + }, 157 + "cursor": { 158 + "type": "string" 159 + }, 160 + "collections": { 161 + "type": "array", 162 + "maxLength": 20, 163 + "description": "If specified, subjects belonging to the given collections will be returned. When subjectType is set to 'account', this will be ignored.", 164 + "items": { 165 + "type": "string", 166 + "format": "nsid" 167 + } 168 + }, 169 + "subjectType": { 170 + "type": "string", 171 + "description": "If specified, subjects of the given type (account or record) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored.", 172 + "knownValues": ["account", "record"] 173 + }, 174 + "minAccountSuspendCount": { 175 + "type": "integer", 176 + "description": "If specified, only subjects that belong to an account that has at least this many suspensions will be returned." 177 + }, 178 + "minReportedRecordsCount": { 179 + "type": "integer", 180 + "description": "If specified, only subjects that belong to an account that has at least this many reported records will be returned." 181 + }, 182 + "minTakendownRecordsCount": { 183 + "type": "integer", 184 + "description": "If specified, only subjects that belong to an account that has at least this many taken down records will be returned." 185 + }, 186 + "minPriorityScore": { 187 + "minimum": 0, 188 + "maximum": 100, 189 + "type": "integer", 190 + "description": "If specified, only subjects that have priority score value above the given value will be returned." 191 + }, 192 + "minStrikeCount": { 193 + "type": "integer", 194 + "minimum": 1, 195 + "description": "If specified, only subjects that belong to an account that has at least this many active strikes will be returned." 196 + }, 197 + "ageAssuranceState": { 198 + "type": "string", 199 + "description": "If specified, only subjects with the given age assurance state will be returned.", 200 + "knownValues": ["pending", "assured", "unknown", "reset", "blocked"] 201 + } 202 + } 203 + }, 204 + "output": { 205 + "encoding": "application/json", 206 + "schema": { 207 + "type": "object", 208 + "required": ["subjectStatuses"], 209 + "properties": { 210 + "cursor": { 211 + "type": "string" 212 + }, 213 + "subjectStatuses": { 214 + "type": "array", 215 + "items": { 216 + "type": "ref", 217 + "ref": "tools.ozone.moderation.defs#subjectStatusView" 218 + } 219 + } 220 + } 221 + } 222 + } 223 + } 224 + } 225 + }
+44
resources/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 + }
+66
resources/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 + "verifierDid": { 34 + "type": "string", 35 + "format": "did", 36 + "description": "The did of the verifier used for verification." 37 + } 38 + } 39 + } 40 + } 41 + }, 42 + "serviceConfig": { 43 + "type": "object", 44 + "properties": { 45 + "url": { 46 + "type": "string", 47 + "format": "uri" 48 + } 49 + } 50 + }, 51 + "viewerConfig": { 52 + "type": "object", 53 + "properties": { 54 + "role": { 55 + "type": "string", 56 + "knownValues": [ 57 + "tools.ozone.team.defs#roleAdmin", 58 + "tools.ozone.team.defs#roleModerator", 59 + "tools.ozone.team.defs#roleTriage", 60 + "tools.ozone.team.defs#roleVerifier" 61 + ] 62 + } 63 + } 64 + } 65 + } 66 + }
+1 -1
src/Console/ClearCacheCommand.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Console; 3 + namespace SocialDept\AtpSchema\Console; 4 4 5 5 use Illuminate\Console\Command; 6 6 use Illuminate\Support\Facades\Cache;
+155 -12
src/Console/GenerateCommand.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Console; 3 + namespace SocialDept\AtpSchema\Console; 4 4 5 5 use Illuminate\Console\Command; 6 - use SocialDept\Schema\Generator\DTOGenerator; 7 - use SocialDept\Schema\Parser\SchemaLoader; 6 + use SocialDept\AtpSchema\Generator\DTOGenerator; 7 + use SocialDept\AtpSchema\Parser\SchemaLoader; 8 8 9 9 class GenerateCommand extends Command 10 10 { ··· 16 16 {--output= : Output directory for generated files} 17 17 {--namespace= : Base namespace for generated classes} 18 18 {--force : Overwrite existing files} 19 - {--dry-run : Preview generated code without writing files}'; 19 + {--dry-run : Preview generated code without writing files} 20 + {--with-dependencies : Also generate all referenced lexicons recursively} 21 + {--r|recursive : Alias for --with-dependencies}'; 20 22 21 23 /** 22 24 * The console command description. ··· 24 26 protected $description = 'Generate PHP DTO classes from ATProto Lexicon schemas'; 25 27 26 28 /** 29 + * Track generated NSIDs to avoid duplicates. 30 + */ 31 + protected array $generated = []; 32 + 33 + /** 27 34 * Execute the console command. 28 35 */ 29 36 public function handle(): int ··· 33 40 $namespace = $this->option('namespace') ?? config('schema.lexicons.base_namespace'); 34 41 $force = $this->option('force'); 35 42 $dryRun = $this->option('dry-run'); 43 + $withDependencies = $this->option('with-dependencies') || $this->option('recursive'); 36 44 37 45 $this->info("Generating DTO classes for schema: {$nsid}"); 38 46 ··· 55 63 56 64 if ($dryRun) { 57 65 $this->info('Dry run mode - no files will be written'); 58 - $schema = $loader->load($nsid); 59 - $document = \SocialDept\Schema\Data\LexiconDocument::fromArray($schema); 66 + $document = $loader->load($nsid); 60 67 $code = $generator->preview($document); 61 68 62 69 $this->line(''); ··· 68 75 return self::SUCCESS; 69 76 } 70 77 71 - $files = $generator->generateByNsid($nsid, [ 72 - 'dryRun' => false, 73 - 'overwrite' => $force, 74 - ]); 78 + $allFiles = []; 79 + 80 + if ($withDependencies) { 81 + $this->info('Generating with dependencies...'); 82 + $allFiles = $this->generateWithDependencies($nsid, $loader, $generator, $force); 83 + } else { 84 + $allFiles = $generator->generateByNsid($nsid, [ 85 + 'dryRun' => false, 86 + 'overwrite' => $force, 87 + ]); 88 + } 75 89 76 - $this->info('Generated '.count($files).' file(s):'); 90 + $this->newLine(); 91 + $this->info('Generated '.count($allFiles).' file(s):'); 77 92 78 - foreach ($files as $file) { 93 + foreach ($allFiles as $file) { 79 94 $this->line(" - {$file}"); 80 95 } 81 96 ··· 92 107 93 108 return self::FAILURE; 94 109 } 110 + } 111 + 112 + /** 113 + * Generate schema with all its dependencies recursively. 114 + */ 115 + protected function generateWithDependencies( 116 + string $nsid, 117 + SchemaLoader $loader, 118 + DTOGenerator $generator, 119 + bool $force 120 + ): array { 121 + // Skip if already generated 122 + if (in_array($nsid, $this->generated)) { 123 + return []; 124 + } 125 + 126 + $this->line(" โ†’ Loading schema: {$nsid}"); 127 + 128 + try { 129 + $schema = $loader->load($nsid); 130 + } catch (\Exception $e) { 131 + $this->warn(" โš  Could not load {$nsid}: ".$e->getMessage()); 132 + 133 + return []; 134 + } 135 + 136 + // Extract all referenced NSIDs from this schema 137 + $dependencies = $this->extractDependencies($schema); 138 + 139 + $allFiles = []; 140 + 141 + // Generate dependencies first 142 + foreach ($dependencies as $depNsid) { 143 + $depFiles = $this->generateWithDependencies($depNsid, $loader, $generator, $force); 144 + $allFiles = array_merge($allFiles, $depFiles); 145 + } 146 + 147 + // Mark as generated before generating to prevent circular references 148 + $this->generated[] = $nsid; 149 + 150 + // Generate current schema 151 + try { 152 + $files = $generator->generateByNsid($nsid, [ 153 + 'dryRun' => false, 154 + 'overwrite' => $force, 155 + ]); 156 + $allFiles = array_merge($allFiles, $files); 157 + } catch (\Exception $e) { 158 + $this->warn(" โš  Could not generate {$nsid}: ".$e->getMessage()); 159 + } 160 + 161 + return $allFiles; 162 + } 163 + 164 + /** 165 + * Extract all NSID dependencies from a schema. 166 + */ 167 + protected function extractDependencies(\SocialDept\AtpSchema\Data\LexiconDocument $schema): array 168 + { 169 + $dependencies = []; 170 + $currentNsid = $schema->getNsid(); 171 + 172 + // Walk through all definitions 173 + foreach ($schema->defs as $def) { 174 + $dependencies = array_merge($dependencies, $this->extractRefsFromDefinition($def)); 175 + } 176 + 177 + // Filter out refs that are definitions within the same schema 178 + // (refs that start with the current NSID followed by a dot) 179 + $dependencies = array_filter($dependencies, function ($ref) use ($currentNsid) { 180 + return ! str_starts_with($ref, $currentNsid.'.'); 181 + }); 182 + 183 + return array_unique($dependencies); 184 + } 185 + 186 + /** 187 + * Recursively extract refs from a definition. 188 + */ 189 + protected function extractRefsFromDefinition(array $definition): array 190 + { 191 + $refs = []; 192 + 193 + // Handle direct ref 194 + if (isset($definition['ref'])) { 195 + $ref = $definition['ref']; 196 + // Skip local references (starting with #) 197 + if (! str_starts_with($ref, '#')) { 198 + // Extract NSID part (before fragment) 199 + if (str_contains($ref, '#')) { 200 + $ref = explode('#', $ref)[0]; 201 + } 202 + $refs[] = $ref; 203 + } 204 + } 205 + 206 + // Handle union refs 207 + if (isset($definition['refs']) && is_array($definition['refs'])) { 208 + foreach ($definition['refs'] as $ref) { 209 + // Skip local references 210 + if (! str_starts_with($ref, '#')) { 211 + // Extract NSID part 212 + if (str_contains($ref, '#')) { 213 + $ref = explode('#', $ref)[0]; 214 + } 215 + $refs[] = $ref; 216 + } 217 + } 218 + } 219 + 220 + // Recursively check properties 221 + if (isset($definition['properties']) && is_array($definition['properties'])) { 222 + foreach ($definition['properties'] as $propDef) { 223 + $refs = array_merge($refs, $this->extractRefsFromDefinition($propDef)); 224 + } 225 + } 226 + 227 + // Recursively check record 228 + if (isset($definition['record']) && is_array($definition['record'])) { 229 + $refs = array_merge($refs, $this->extractRefsFromDefinition($definition['record'])); 230 + } 231 + 232 + // Recursively check array items 233 + if (isset($definition['items']) && is_array($definition['items'])) { 234 + $refs = array_merge($refs, $this->extractRefsFromDefinition($definition['items'])); 235 + } 236 + 237 + return $refs; 95 238 } 96 239 }
+4 -7
src/Console/ListCommand.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Console; 3 + namespace SocialDept\AtpSchema\Console; 4 4 5 5 use Illuminate\Console\Command; 6 - use SocialDept\Schema\Data\LexiconDocument; 7 - use SocialDept\Schema\Parser\SchemaLoader; 6 + use SocialDept\AtpSchema\Parser\SchemaLoader; 8 7 9 8 class ListCommand extends Command 10 9 { ··· 55 54 56 55 foreach ($schemas as $nsid) { 57 56 try { 58 - $schema = $loader->load($nsid); 59 - $document = LexiconDocument::fromArray($schema); 57 + $document = $loader->load($nsid); 60 58 61 59 $schemaType = 'unknown'; 62 60 if ($document->isRecord()) { ··· 173 171 { 174 172 return array_filter($schemas, function ($nsid) use ($type, $loader) { 175 173 try { 176 - $schema = $loader->load($nsid); 177 - $document = LexiconDocument::fromArray($schema); 174 + $document = $loader->load($nsid); 178 175 179 176 return match ($type) { 180 177 'record' => $document->isRecord(),
+4 -6
src/Console/ValidateCommand.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Console; 3 + namespace SocialDept\AtpSchema\Console; 4 4 5 5 use Illuminate\Console\Command; 6 - use SocialDept\Schema\Data\LexiconDocument; 7 - use SocialDept\Schema\Parser\SchemaLoader; 8 - use SocialDept\Schema\Validation\LexiconValidator; 6 + use SocialDept\AtpSchema\Parser\SchemaLoader; 7 + use SocialDept\AtpSchema\Validation\LexiconValidator; 9 8 10 9 class ValidateCommand extends Command 11 10 { ··· 64 63 65 64 $this->info("Validating data against schema: {$nsid}"); 66 65 67 - $schema = $loader->load($nsid); 68 - $document = LexiconDocument::fromArray($schema); 66 + $document = $loader->load($nsid); 69 67 70 68 $errors = $validator->validateWithErrors($data, $document); 71 69
+2 -2
src/Contracts/BlobHandler.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Contracts; 3 + namespace SocialDept\AtpSchema\Contracts; 4 4 5 5 use Illuminate\Http\UploadedFile; 6 - use SocialDept\Schema\Data\BlobReference; 6 + use SocialDept\AtpSchema\Data\BlobReference; 7 7 8 8 interface BlobHandler 9 9 {
+2 -2
src/Contracts/DataGenerator.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Contracts; 3 + namespace SocialDept\AtpSchema\Contracts; 4 4 5 - use SocialDept\Schema\Data\LexiconDocument; 5 + use SocialDept\AtpSchema\Data\LexiconDocument; 6 6 7 7 interface DataGenerator 8 8 {
+21
src/Contracts/DiscriminatedUnion.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Contracts; 4 + 5 + /** 6 + * Contract for Data classes that can participate in AT Protocol discriminated unions. 7 + * 8 + * Union types in AT Protocol use the $type field to discriminate between 9 + * different variants. This interface marks classes that can be used as 10 + * union variants and provides access to their discriminator value. 11 + */ 12 + interface DiscriminatedUnion 13 + { 14 + /** 15 + * Get the lexicon NSID that identifies this union variant. 16 + * 17 + * This value is used as the $type discriminator in AT Protocol records 18 + * to identify which specific type a union contains. 19 + */ 20 + public static function getDiscriminator(): string; 21 + }
+2 -2
src/Contracts/LexiconParser.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Contracts; 3 + namespace SocialDept\AtpSchema\Contracts; 4 4 5 - use SocialDept\Schema\Data\LexiconDocument; 5 + use SocialDept\AtpSchema\Data\LexiconDocument; 6 6 7 7 interface LexiconParser 8 8 {
+2 -2
src/Contracts/LexiconRegistry.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Contracts; 3 + namespace SocialDept\AtpSchema\Contracts; 4 4 5 - use SocialDept\Schema\Data\LexiconDocument; 5 + use SocialDept\AtpSchema\Data\LexiconDocument; 6 6 7 7 interface LexiconRegistry 8 8 {
+2 -2
src/Contracts/LexiconResolver.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Contracts; 3 + namespace SocialDept\AtpSchema\Contracts; 4 4 5 - use SocialDept\Schema\Data\LexiconDocument; 5 + use SocialDept\AtpSchema\Data\LexiconDocument; 6 6 7 7 interface LexiconResolver 8 8 {
+2 -2
src/Contracts/LexiconValidator.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Contracts; 3 + namespace SocialDept\AtpSchema\Contracts; 4 4 5 - use SocialDept\Schema\Data\LexiconDocument; 5 + use SocialDept\AtpSchema\Data\LexiconDocument; 6 6 7 7 interface LexiconValidator 8 8 {
+2 -2
src/Contracts/SchemaRepository.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Contracts; 3 + namespace SocialDept\AtpSchema\Contracts; 4 4 5 - use SocialDept\Schema\Data\LexiconDocument; 5 + use SocialDept\AtpSchema\Data\LexiconDocument; 6 6 7 7 interface SchemaRepository 8 8 {
+1 -1
src/Contracts/Transformer.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Contracts; 3 + namespace SocialDept\AtpSchema\Contracts; 4 4 5 5 interface Transformer 6 6 {
+1 -1
src/Contracts/TypeMapper.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Contracts; 3 + namespace SocialDept\AtpSchema\Contracts; 4 4 5 5 interface TypeMapper 6 6 {
+7 -3
src/Data/BlobReference.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Data; 3 + namespace SocialDept\AtpSchema\Data; 4 4 5 - use SocialDept\Schema\Exceptions\SchemaValidationException; 5 + use Illuminate\Contracts\Support\Arrayable; 6 + use SocialDept\AtpSchema\Exceptions\SchemaValidationException; 6 7 7 - class BlobReference 8 + /** 9 + * @implements Arrayable<string, mixed> 10 + */ 11 + class BlobReference implements Arrayable 8 12 { 9 13 /** 10 14 * CID of the blob.
+27 -8
src/Data/Data.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Data; 3 + namespace SocialDept\AtpSchema\Data; 4 4 5 5 use Illuminate\Contracts\Support\Arrayable; 6 6 use Illuminate\Contracts\Support\Jsonable; 7 7 use JsonSerializable; 8 + use SocialDept\AtpSchema\Contracts\DiscriminatedUnion; 8 9 use Stringable; 9 10 10 - abstract class Data implements Arrayable, Jsonable, JsonSerializable, Stringable 11 + abstract class Data implements Arrayable, DiscriminatedUnion, Jsonable, JsonSerializable, Stringable 11 12 { 12 13 /** 13 14 * Get the lexicon NSID for this data type. ··· 15 16 abstract public static function getLexicon(): string; 16 17 17 18 /** 19 + * Get the lexicon NSID that identifies this union variant. 20 + * 21 + * This is an alias for getLexicon() to satisfy the DiscriminatedUnion contract. 22 + */ 23 + public static function getDiscriminator(): string 24 + { 25 + return static::getLexicon(); 26 + } 27 + 28 + /** 18 29 * Convert the data to an array. 19 30 */ 20 31 public function toArray(): array ··· 22 33 $result = []; 23 34 24 35 foreach (get_object_vars($this) as $property => $value) { 25 - $result[$property] = $this->serializeValue($value); 36 + // Skip null values to exclude optional fields that aren't set 37 + if ($value !== null) { 38 + $result[$property] = $this->serializeValue($value); 39 + } 26 40 } 27 41 28 - return $result; 42 + return array_filter($result); 29 43 } 30 44 31 45 /** ··· 57 71 */ 58 72 protected function serializeValue(mixed $value): mixed 59 73 { 74 + // Union variants must include $type for discrimination 60 75 if ($value instanceof self) { 61 - return $value->toArray(); 76 + return $value->toRecord(); 62 77 } 63 78 64 79 if ($value instanceof Arrayable) { 65 80 return $value->toArray(); 66 81 } 67 82 83 + // Preserve arrays with $type (open union data) 68 84 if (is_array($value)) { 69 85 return array_map(fn ($item) => $this->serializeValue($item), $value); 70 86 } ··· 103 119 */ 104 120 public static function fromRecord(array $record): static 105 121 { 106 - return static::fromArray($record); 122 + return static::fromArray($record['value'] ?? $record); 107 123 } 108 124 109 125 /** ··· 114 130 */ 115 131 public function toRecord(): array 116 132 { 117 - return $this->toArray(); 133 + return [ 134 + ...$this->toArray(), 135 + '$type' => $this->getLexicon(), 136 + ]; 118 137 } 119 138 120 139 /** ··· 160 179 */ 161 180 public function validateWithErrors(): array 162 181 { 163 - if (! function_exists('SocialDept\Schema\schema')) { 182 + if (! function_exists('SocialDept\AtpSchema\schema')) { 164 183 return []; 165 184 } 166 185
+3 -3
src/Data/LexiconDocument.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Data; 3 + namespace SocialDept\AtpSchema\Data; 4 4 5 - use SocialDept\Schema\Exceptions\SchemaValidationException; 6 - use SocialDept\Schema\Parser\Nsid; 5 + use SocialDept\AtpSchema\Exceptions\SchemaValidationException; 6 + use SocialDept\AtpSchema\Parser\Nsid; 7 7 8 8 class LexiconDocument 9 9 {
+2 -2
src/Data/TypeDefinition.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Data; 3 + namespace SocialDept\AtpSchema\Data; 4 4 5 5 abstract class TypeDefinition 6 6 { ··· 38 38 /** 39 39 * Validate a value against this type definition. 40 40 * 41 - * @throws \SocialDept\Schema\Exceptions\RecordValidationException 41 + * @throws \SocialDept\AtpSchema\Exceptions\RecordValidationException 42 42 */ 43 43 abstract public function validate(mixed $value, string $path = ''): void; 44 44
+3 -3
src/Data/Types/ArrayType.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Data\Types; 3 + namespace SocialDept\AtpSchema\Data\Types; 4 4 5 - use SocialDept\Schema\Data\TypeDefinition; 6 - use SocialDept\Schema\Exceptions\RecordValidationException; 5 + use SocialDept\AtpSchema\Data\TypeDefinition; 6 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 7 7 8 8 class ArrayType extends TypeDefinition 9 9 {
+3 -3
src/Data/Types/BlobType.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Data\Types; 3 + namespace SocialDept\AtpSchema\Data\Types; 4 4 5 - use SocialDept\Schema\Data\TypeDefinition; 6 - use SocialDept\Schema\Exceptions\RecordValidationException; 5 + use SocialDept\AtpSchema\Data\TypeDefinition; 6 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 7 7 8 8 class BlobType extends TypeDefinition 9 9 {
+3 -3
src/Data/Types/BooleanType.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Data\Types; 3 + namespace SocialDept\AtpSchema\Data\Types; 4 4 5 - use SocialDept\Schema\Data\TypeDefinition; 6 - use SocialDept\Schema\Exceptions\RecordValidationException; 5 + use SocialDept\AtpSchema\Data\TypeDefinition; 6 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 7 7 8 8 class BooleanType extends TypeDefinition 9 9 {
+3 -3
src/Data/Types/BytesType.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Data\Types; 3 + namespace SocialDept\AtpSchema\Data\Types; 4 4 5 - use SocialDept\Schema\Data\TypeDefinition; 6 - use SocialDept\Schema\Exceptions\RecordValidationException; 5 + use SocialDept\AtpSchema\Data\TypeDefinition; 6 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 7 7 8 8 class BytesType extends TypeDefinition 9 9 {
+3 -3
src/Data/Types/CidLinkType.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Data\Types; 3 + namespace SocialDept\AtpSchema\Data\Types; 4 4 5 - use SocialDept\Schema\Data\TypeDefinition; 6 - use SocialDept\Schema\Exceptions\RecordValidationException; 5 + use SocialDept\AtpSchema\Data\TypeDefinition; 6 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 7 7 8 8 class CidLinkType extends TypeDefinition 9 9 {
+3 -3
src/Data/Types/IntegerType.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Data\Types; 3 + namespace SocialDept\AtpSchema\Data\Types; 4 4 5 - use SocialDept\Schema\Data\TypeDefinition; 6 - use SocialDept\Schema\Exceptions\RecordValidationException; 5 + use SocialDept\AtpSchema\Data\TypeDefinition; 6 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 7 7 8 8 class IntegerType extends TypeDefinition 9 9 {
+3 -3
src/Data/Types/NullType.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Data\Types; 3 + namespace SocialDept\AtpSchema\Data\Types; 4 4 5 - use SocialDept\Schema\Data\TypeDefinition; 6 - use SocialDept\Schema\Exceptions\RecordValidationException; 5 + use SocialDept\AtpSchema\Data\TypeDefinition; 6 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 7 7 8 8 class NullType extends TypeDefinition 9 9 {
+3 -3
src/Data/Types/ObjectType.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Data\Types; 3 + namespace SocialDept\AtpSchema\Data\Types; 4 4 5 - use SocialDept\Schema\Data\TypeDefinition; 6 - use SocialDept\Schema\Exceptions\RecordValidationException; 5 + use SocialDept\AtpSchema\Data\TypeDefinition; 6 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 7 7 8 8 class ObjectType extends TypeDefinition 9 9 {
+2 -2
src/Data/Types/RefType.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Data\Types; 3 + namespace SocialDept\AtpSchema\Data\Types; 4 4 5 - use SocialDept\Schema\Data\TypeDefinition; 5 + use SocialDept\AtpSchema\Data\TypeDefinition; 6 6 7 7 class RefType extends TypeDefinition 8 8 {
+3 -3
src/Data/Types/StringType.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Data\Types; 3 + namespace SocialDept\AtpSchema\Data\Types; 4 4 5 - use SocialDept\Schema\Data\TypeDefinition; 6 - use SocialDept\Schema\Exceptions\RecordValidationException; 5 + use SocialDept\AtpSchema\Data\TypeDefinition; 6 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 7 7 8 8 class StringType extends TypeDefinition 9 9 {
+3 -3
src/Data/Types/UnionType.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Data\Types; 3 + namespace SocialDept\AtpSchema\Data\Types; 4 4 5 - use SocialDept\Schema\Data\TypeDefinition; 6 - use SocialDept\Schema\Exceptions\RecordValidationException; 5 + use SocialDept\AtpSchema\Data\TypeDefinition; 6 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 7 7 8 8 class UnionType extends TypeDefinition 9 9 {
+2 -2
src/Data/Types/UnknownType.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Data\Types; 3 + namespace SocialDept\AtpSchema\Data\Types; 4 4 5 - use SocialDept\Schema\Data\TypeDefinition; 5 + use SocialDept\AtpSchema\Data\TypeDefinition; 6 6 7 7 class UnknownType extends TypeDefinition 8 8 {
+2 -2
src/Exceptions/BlobException.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Exceptions; 3 + namespace SocialDept\AtpSchema\Exceptions; 4 4 5 5 class BlobException extends SchemaException 6 6 { ··· 32 32 public static function invalidMimeType(string $mimeType, array $accepted): self 33 33 { 34 34 return static::withContext( 35 - "Invalid MIME type {$mimeType}. Accepted: " . implode(', ', $accepted), 35 + "Invalid MIME type {$mimeType}. Accepted: ".implode(', ', $accepted), 36 36 ['mimeType' => $mimeType, 'accepted' => $accepted] 37 37 ); 38 38 }
+1 -1
src/Exceptions/GenerationException.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Exceptions; 3 + namespace SocialDept\AtpSchema\Exceptions; 4 4 5 5 class GenerationException extends SchemaException 6 6 {
+1 -1
src/Exceptions/RecordValidationException.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Exceptions; 3 + namespace SocialDept\AtpSchema\Exceptions; 4 4 5 5 class RecordValidationException extends SchemaException 6 6 {
+1 -1
src/Exceptions/SchemaException.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Exceptions; 3 + namespace SocialDept\AtpSchema\Exceptions; 4 4 5 5 use Exception; 6 6
+1 -1
src/Exceptions/SchemaNotFoundException.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Exceptions; 3 + namespace SocialDept\AtpSchema\Exceptions; 4 4 5 5 class SchemaNotFoundException extends SchemaException 6 6 {
+1 -1
src/Exceptions/SchemaParseException.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Exceptions; 3 + namespace SocialDept\AtpSchema\Exceptions; 4 4 5 5 class SchemaParseException extends SchemaException 6 6 {
+2 -2
src/Exceptions/SchemaValidationException.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Exceptions; 3 + namespace SocialDept\AtpSchema\Exceptions; 4 4 5 5 class SchemaValidationException extends SchemaException 6 6 { ··· 9 9 */ 10 10 public static function invalidStructure(string $nsid, array $errors): self 11 11 { 12 - $message = "Schema validation failed for {$nsid}:\n" . implode("\n", $errors); 12 + $message = "Schema validation failed for {$nsid}:\n".implode("\n", $errors); 13 13 14 14 return static::withContext($message, [ 15 15 'nsid' => $nsid,
+1 -1
src/Exceptions/TypeResolutionException.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Exceptions; 3 + namespace SocialDept\AtpSchema\Exceptions; 4 4 5 5 class TypeResolutionException extends SchemaException 6 6 {
+8 -7
src/Facades/Schema.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Facades; 3 + namespace SocialDept\AtpSchema\Facades; 4 4 5 5 use Illuminate\Support\Facades\Facade; 6 - use SocialDept\Schema\Data\LexiconDocument; 6 + use SocialDept\AtpSchema\Data\LexiconDocument; 7 7 8 8 /** 9 - * @method static array load(string $nsid) 9 + * @method static LexiconDocument load(string $nsid) 10 + * @method static LexiconDocument|null find(string $nsid) 10 11 * @method static bool exists(string $nsid) 11 - * @method static LexiconDocument parse(string $nsid) 12 + * @method static array all() 13 + * @method static void clearCache(?string $nsid = null) 14 + * @method static string generate(string $nsid, ?string $outputPath = null) 12 15 * @method static bool validate(string $nsid, array $data) 13 16 * @method static array validateWithErrors(string $nsid, array $data) 14 - * @method static string generate(string $nsid, array $options = []) 15 - * @method static void clearCache(?string $nsid = null) 16 17 * 17 - * @see \SocialDept\Schema\SchemaManager 18 + * @see \SocialDept\AtpSchema\SchemaManager 18 19 */ 19 20 class Schema extends Facade 20 21 {
+49
src/Generated/App/Bsky/Actor/Defs/AdultContentPref.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.actor.defs.adultContentPref 11 + * Type: object 12 + * 13 + * @property bool $enabled 14 + * 15 + * Constraints: 16 + * - Required: enabled 17 + */ 18 + class AdultContentPref extends Data 19 + { 20 + public function __construct( 21 + public readonly bool $enabled 22 + ) { 23 + } 24 + 25 + /** 26 + * Get the lexicon NSID for this data type. 27 + * 28 + * @return string 29 + */ 30 + public static function getLexicon(): string 31 + { 32 + return 'app.bsky.actor.defs.adultContentPref'; 33 + } 34 + 35 + 36 + /** 37 + * Create an instance from an array. 38 + * 39 + * @param array $data The data array 40 + * @return static 41 + */ 42 + public static function fromArray(array $data): static 43 + { 44 + return new static( 45 + enabled: $data['enabled'] 46 + ); 47 + } 48 + 49 + }
+53
src/Generated/App/Bsky/Actor/Defs/BskyAppProgressGuide.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * If set, an active progress guide. Once completed, can be set to undefined. 11 + * Should have unspecced fields tracking progress. 12 + * 13 + * Lexicon: app.bsky.actor.defs.bskyAppProgressGuide 14 + * Type: object 15 + * 16 + * @property string $guide 17 + * 18 + * Constraints: 19 + * - Required: guide 20 + * - guide: Max length: 100 21 + */ 22 + class BskyAppProgressGuide extends Data 23 + { 24 + public function __construct( 25 + public readonly string $guide 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'app.bsky.actor.defs.bskyAppProgressGuide'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + guide: $data['guide'] 50 + ); 51 + } 52 + 53 + }
+63
src/Generated/App/Bsky/Actor/Defs/BskyAppStatePref.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * A grab bag of state that's specific to the bsky.app program. Third-party apps 11 + * shouldn't use this. 12 + * 13 + * Lexicon: app.bsky.actor.defs.bskyAppStatePref 14 + * Type: object 15 + * 16 + * @property mixed $activeProgressGuide 17 + * @property array<string>|null $queuedNudges An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user. 18 + * @property array<Nux>|null $nuxs Storage for NUXs the user has encountered. 19 + * 20 + * Constraints: 21 + * - queuedNudges: Max length: 1000 22 + * - nuxs: Max length: 100 23 + */ 24 + class BskyAppStatePref extends Data 25 + { 26 + /** 27 + * @param array<string>|null $queuedNudges An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user. 28 + * @param array<Nux>|null $nuxs Storage for NUXs the user has encountered. 29 + */ 30 + public function __construct( 31 + public readonly mixed $activeProgressGuide = null, 32 + public readonly ?array $queuedNudges = null, 33 + public readonly ?array $nuxs = null 34 + ) { 35 + } 36 + 37 + /** 38 + * Get the lexicon NSID for this data type. 39 + * 40 + * @return string 41 + */ 42 + public static function getLexicon(): string 43 + { 44 + return 'app.bsky.actor.defs.bskyAppStatePref'; 45 + } 46 + 47 + 48 + /** 49 + * Create an instance from an array. 50 + * 51 + * @param array $data The data array 52 + * @return static 53 + */ 54 + public static function fromArray(array $data): static 55 + { 56 + return new static( 57 + activeProgressGuide: $data['activeProgressGuide'] ?? null, 58 + queuedNudges: $data['queuedNudges'] ?? null, 59 + nuxs: isset($data['nuxs']) ? array_map(fn ($item) => Nux::fromArray($item), $data['nuxs']) : [] 60 + ); 61 + } 62 + 63 + }
+59
src/Generated/App/Bsky/Actor/Defs/ContentLabelPref.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.actor.defs.contentLabelPref 11 + * Type: object 12 + * 13 + * @property string|null $labelerDid Which labeler does this preference apply to? If undefined, applies globally. 14 + * @property string $label 15 + * @property string $visibility 16 + * 17 + * Constraints: 18 + * - Required: label, visibility 19 + * - labelerDid: Format: did 20 + */ 21 + class ContentLabelPref extends Data 22 + { 23 + /** 24 + * @param string|null $labelerDid Which labeler does this preference apply to? If undefined, applies globally. 25 + */ 26 + public function __construct( 27 + public readonly string $label, 28 + public readonly string $visibility, 29 + public readonly ?string $labelerDid = null 30 + ) { 31 + } 32 + 33 + /** 34 + * Get the lexicon NSID for this data type. 35 + * 36 + * @return string 37 + */ 38 + public static function getLexicon(): string 39 + { 40 + return 'app.bsky.actor.defs.contentLabelPref'; 41 + } 42 + 43 + 44 + /** 45 + * Create an instance from an array. 46 + * 47 + * @param array $data The data array 48 + * @return static 49 + */ 50 + public static function fromArray(array $data): static 51 + { 52 + return new static( 53 + label: $data['label'], 54 + visibility: $data['visibility'], 55 + labelerDid: $data['labelerDid'] ?? null 56 + ); 57 + } 58 + 59 + }
+72
src/Generated/App/Bsky/Actor/Defs/FeedViewPref.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.actor.defs.feedViewPref 11 + * Type: object 12 + * 13 + * @property string $feed The URI of the feed, or an identifier which describes the feed. 14 + * @property bool|null $hideReplies Hide replies in the feed. 15 + * @property bool|null $hideRepliesByUnfollowed Hide replies in the feed if they are not by followed users. 16 + * @property int|null $hideRepliesByLikeCount Hide replies in the feed if they do not have this number of likes. 17 + * @property bool|null $hideReposts Hide reposts in the feed. 18 + * @property bool|null $hideQuotePosts Hide quote posts in the feed. 19 + * 20 + * Constraints: 21 + * - Required: feed 22 + */ 23 + class FeedViewPref extends Data 24 + { 25 + /** 26 + * @param string $feed The URI of the feed, or an identifier which describes the feed. 27 + * @param bool|null $hideReplies Hide replies in the feed. 28 + * @param bool|null $hideRepliesByUnfollowed Hide replies in the feed if they are not by followed users. 29 + * @param int|null $hideRepliesByLikeCount Hide replies in the feed if they do not have this number of likes. 30 + * @param bool|null $hideReposts Hide reposts in the feed. 31 + * @param bool|null $hideQuotePosts Hide quote posts in the feed. 32 + */ 33 + public function __construct( 34 + public readonly string $feed, 35 + public readonly ?bool $hideReplies = null, 36 + public readonly ?bool $hideRepliesByUnfollowed = null, 37 + public readonly ?int $hideRepliesByLikeCount = null, 38 + public readonly ?bool $hideReposts = null, 39 + public readonly ?bool $hideQuotePosts = null 40 + ) { 41 + } 42 + 43 + /** 44 + * Get the lexicon NSID for this data type. 45 + * 46 + * @return string 47 + */ 48 + public static function getLexicon(): string 49 + { 50 + return 'app.bsky.actor.defs.feedViewPref'; 51 + } 52 + 53 + 54 + /** 55 + * Create an instance from an array. 56 + * 57 + * @param array $data The data array 58 + * @return static 59 + */ 60 + public static function fromArray(array $data): static 61 + { 62 + return new static( 63 + feed: $data['feed'], 64 + hideReplies: $data['hideReplies'] ?? null, 65 + hideRepliesByUnfollowed: $data['hideRepliesByUnfollowed'] ?? null, 66 + hideRepliesByLikeCount: $data['hideRepliesByLikeCount'] ?? null, 67 + hideReposts: $data['hideReposts'] ?? null, 68 + hideQuotePosts: $data['hideQuotePosts'] ?? null 69 + ); 70 + } 71 + 72 + }
+52
src/Generated/App/Bsky/Actor/Defs/HiddenPostsPref.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.actor.defs.hiddenPostsPref 11 + * Type: object 12 + * 13 + * @property array<string> $items A list of URIs of posts the account owner has hidden. 14 + * 15 + * Constraints: 16 + * - Required: items 17 + */ 18 + class HiddenPostsPref extends Data 19 + { 20 + /** 21 + * @param array<string> $items A list of URIs of posts the account owner has hidden. 22 + */ 23 + public function __construct( 24 + public readonly array $items 25 + ) { 26 + } 27 + 28 + /** 29 + * Get the lexicon NSID for this data type. 30 + * 31 + * @return string 32 + */ 33 + public static function getLexicon(): string 34 + { 35 + return 'app.bsky.actor.defs.hiddenPostsPref'; 36 + } 37 + 38 + 39 + /** 40 + * Create an instance from an array. 41 + * 42 + * @param array $data The data array 43 + * @return static 44 + */ 45 + public static function fromArray(array $data): static 46 + { 47 + return new static( 48 + items: $data['items'] 49 + ); 50 + } 51 + 52 + }
+53
src/Generated/App/Bsky/Actor/Defs/InterestsPref.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.actor.defs.interestsPref 11 + * Type: object 12 + * 13 + * @property array<string> $tags A list of tags which describe the account owner's interests gathered during onboarding. 14 + * 15 + * Constraints: 16 + * - Required: tags 17 + * - tags: Max length: 100 18 + */ 19 + class InterestsPref extends Data 20 + { 21 + /** 22 + * @param array<string> $tags A list of tags which describe the account owner's interests gathered during onboarding. 23 + */ 24 + public function __construct( 25 + public readonly array $tags 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'app.bsky.actor.defs.interestsPref'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + tags: $data['tags'] 50 + ); 51 + } 52 + 53 + }
+56
src/Generated/App/Bsky/Actor/Defs/KnownFollowers.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * The subject's followers whom you also follow 11 + * 12 + * Lexicon: app.bsky.actor.defs.knownFollowers 13 + * Type: object 14 + * 15 + * @property int $count 16 + * @property array $followers 17 + * 18 + * Constraints: 19 + * - Required: count, followers 20 + * - followers: Max length: 5 21 + * - followers: Min length: 0 22 + */ 23 + class KnownFollowers extends Data 24 + { 25 + public function __construct( 26 + public readonly int $count, 27 + public readonly array $followers 28 + ) { 29 + } 30 + 31 + /** 32 + * Get the lexicon NSID for this data type. 33 + * 34 + * @return string 35 + */ 36 + public static function getLexicon(): string 37 + { 38 + return 'app.bsky.actor.defs.knownFollowers'; 39 + } 40 + 41 + 42 + /** 43 + * Create an instance from an array. 44 + * 45 + * @param array $data The data array 46 + * @return static 47 + */ 48 + public static function fromArray(array $data): static 49 + { 50 + return new static( 51 + count: $data['count'], 52 + followers: $data['followers'] ?? [] 53 + ); 54 + } 55 + 56 + }
+50
src/Generated/App/Bsky/Actor/Defs/LabelerPrefItem.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.actor.defs.labelerPrefItem 11 + * Type: object 12 + * 13 + * @property string $did 14 + * 15 + * Constraints: 16 + * - Required: did 17 + * - did: Format: did 18 + */ 19 + class LabelerPrefItem extends Data 20 + { 21 + public function __construct( 22 + public readonly string $did 23 + ) { 24 + } 25 + 26 + /** 27 + * Get the lexicon NSID for this data type. 28 + * 29 + * @return string 30 + */ 31 + public static function getLexicon(): string 32 + { 33 + return 'app.bsky.actor.defs.labelerPrefItem'; 34 + } 35 + 36 + 37 + /** 38 + * Create an instance from an array. 39 + * 40 + * @param array $data The data array 41 + * @return static 42 + */ 43 + public static function fromArray(array $data): static 44 + { 45 + return new static( 46 + did: $data['did'] 47 + ); 48 + } 49 + 50 + }
+49
src/Generated/App/Bsky/Actor/Defs/LabelersPref.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.actor.defs.labelersPref 11 + * Type: object 12 + * 13 + * @property array $labelers 14 + * 15 + * Constraints: 16 + * - Required: labelers 17 + */ 18 + class LabelersPref extends Data 19 + { 20 + public function __construct( 21 + public readonly array $labelers 22 + ) { 23 + } 24 + 25 + /** 26 + * Get the lexicon NSID for this data type. 27 + * 28 + * @return string 29 + */ 30 + public static function getLexicon(): string 31 + { 32 + return 'app.bsky.actor.defs.labelersPref'; 33 + } 34 + 35 + 36 + /** 37 + * Create an instance from an array. 38 + * 39 + * @param array $data The data array 40 + * @return static 41 + */ 42 + public static function fromArray(array $data): static 43 + { 44 + return new static( 45 + labelers: $data['labelers'] ?? [] 46 + ); 47 + } 48 + 49 + }
+73
src/Generated/App/Bsky/Actor/Defs/MutedWord.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * A word that the account owner has muted. 12 + * 13 + * Lexicon: app.bsky.actor.defs.mutedWord 14 + * Type: object 15 + * 16 + * @property string|null $id 17 + * @property string $value The muted word itself. 18 + * @property array<MutedWordTarget> $targets The intended targets of the muted word. 19 + * @property string|null $actorTarget Groups of users to apply the muted word to. If undefined, applies to all users. 20 + * @property Carbon|null $expiresAt The date and time at which the muted word will expire and no longer be applied. 21 + * 22 + * Constraints: 23 + * - Required: value, targets 24 + * - value: Max length: 10000 25 + * - value: Max graphemes: 1000 26 + * - expiresAt: Format: datetime 27 + */ 28 + class MutedWord extends Data 29 + { 30 + /** 31 + * @param string $value The muted word itself. 32 + * @param array<MutedWordTarget> $targets The intended targets of the muted word. 33 + * @param string|null $actorTarget Groups of users to apply the muted word to. If undefined, applies to all users. 34 + * @param Carbon|null $expiresAt The date and time at which the muted word will expire and no longer be applied. 35 + */ 36 + public function __construct( 37 + public readonly string $value, 38 + public readonly array $targets, 39 + public readonly ?string $id = null, 40 + public readonly ?string $actorTarget = null, 41 + public readonly ?Carbon $expiresAt = null 42 + ) { 43 + } 44 + 45 + /** 46 + * Get the lexicon NSID for this data type. 47 + * 48 + * @return string 49 + */ 50 + public static function getLexicon(): string 51 + { 52 + return 'app.bsky.actor.defs.mutedWord'; 53 + } 54 + 55 + 56 + /** 57 + * Create an instance from an array. 58 + * 59 + * @param array $data The data array 60 + * @return static 61 + */ 62 + public static function fromArray(array $data): static 63 + { 64 + return new static( 65 + value: $data['value'], 66 + targets: isset($data['targets']) ? array_map(fn ($item) => MutedWordTarget::fromArray($item), $data['targets']) : [], 67 + id: $data['id'] ?? null, 68 + actorTarget: $data['actorTarget'] ?? null, 69 + expiresAt: isset($data['expiresAt']) ? Carbon::parse($data['expiresAt']) : null 70 + ); 71 + } 72 + 73 + }
+52
src/Generated/App/Bsky/Actor/Defs/MutedWordsPref.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.actor.defs.mutedWordsPref 11 + * Type: object 12 + * 13 + * @property array<MutedWord> $items A list of words the account owner has muted. 14 + * 15 + * Constraints: 16 + * - Required: items 17 + */ 18 + class MutedWordsPref extends Data 19 + { 20 + /** 21 + * @param array<MutedWord> $items A list of words the account owner has muted. 22 + */ 23 + public function __construct( 24 + public readonly array $items 25 + ) { 26 + } 27 + 28 + /** 29 + * Get the lexicon NSID for this data type. 30 + * 31 + * @return string 32 + */ 33 + public static function getLexicon(): string 34 + { 35 + return 'app.bsky.actor.defs.mutedWordsPref'; 36 + } 37 + 38 + 39 + /** 40 + * Create an instance from an array. 41 + * 42 + * @param array $data The data array 43 + * @return static 44 + */ 45 + public static function fromArray(array $data): static 46 + { 47 + return new static( 48 + items: isset($data['items']) ? array_map(fn ($item) => MutedWord::fromArray($item), $data['items']) : [] 49 + ); 50 + } 51 + 52 + }
+69
src/Generated/App/Bsky/Actor/Defs/Nux.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * A new user experiences (NUX) storage object 12 + * 13 + * Lexicon: app.bsky.actor.defs.nux 14 + * Type: object 15 + * 16 + * @property string $id 17 + * @property bool $completed 18 + * @property string|null $data Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters. 19 + * @property Carbon|null $expiresAt The date and time at which the NUX will expire and should be considered completed. 20 + * 21 + * Constraints: 22 + * - Required: id, completed 23 + * - id: Max length: 100 24 + * - data: Max length: 3000 25 + * - data: Max graphemes: 300 26 + * - expiresAt: Format: datetime 27 + */ 28 + class Nux extends Data 29 + { 30 + /** 31 + * @param string|null $data Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters. 32 + * @param Carbon|null $expiresAt The date and time at which the NUX will expire and should be considered completed. 33 + */ 34 + public function __construct( 35 + public readonly string $id, 36 + public readonly bool $completed, 37 + public readonly ?string $data = null, 38 + public readonly ?Carbon $expiresAt = null 39 + ) { 40 + } 41 + 42 + /** 43 + * Get the lexicon NSID for this data type. 44 + * 45 + * @return string 46 + */ 47 + public static function getLexicon(): string 48 + { 49 + return 'app.bsky.actor.defs.nux'; 50 + } 51 + 52 + 53 + /** 54 + * Create an instance from an array. 55 + * 56 + * @param array $data The data array 57 + * @return static 58 + */ 59 + public static function fromArray(array $data): static 60 + { 61 + return new static( 62 + id: $data['id'], 63 + completed: $data['completed'], 64 + data: $data['data'] ?? null, 65 + expiresAt: isset($data['expiresAt']) ? Carbon::parse($data['expiresAt']) : null 66 + ); 67 + } 68 + 69 + }
+53
src/Generated/App/Bsky/Actor/Defs/PersonalDetailsPref.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.actor.defs.personalDetailsPref 12 + * Type: object 13 + * 14 + * @property Carbon|null $birthDate The birth date of account owner. 15 + * 16 + * Constraints: 17 + * - birthDate: Format: datetime 18 + */ 19 + class PersonalDetailsPref extends Data 20 + { 21 + /** 22 + * @param Carbon|null $birthDate The birth date of account owner. 23 + */ 24 + public function __construct( 25 + public readonly ?Carbon $birthDate = null 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'app.bsky.actor.defs.personalDetailsPref'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + birthDate: isset($data['birthDate']) ? Carbon::parse($data['birthDate']) : null 50 + ); 51 + } 52 + 53 + }
+61
src/Generated/App/Bsky/Actor/Defs/PostInteractionSettingsPref.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Default post interaction settings for the account. These values should be 11 + * applied as default values when creating new posts. These refs should mirror 12 + * the threadgate and postgate records exactly. 13 + * 14 + * Lexicon: app.bsky.actor.defs.postInteractionSettingsPref 15 + * Type: object 16 + * 17 + * @property array|null $threadgateAllowRules Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply. 18 + * @property array|null $postgateEmbeddingRules Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed. 19 + * 20 + * Constraints: 21 + * - threadgateAllowRules: Max length: 5 22 + * - postgateEmbeddingRules: Max length: 5 23 + */ 24 + class PostInteractionSettingsPref extends Data 25 + { 26 + /** 27 + * @param array|null $threadgateAllowRules Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply. 28 + * @param array|null $postgateEmbeddingRules Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed. 29 + */ 30 + public function __construct( 31 + public readonly ?array $threadgateAllowRules = null, 32 + public readonly ?array $postgateEmbeddingRules = null 33 + ) { 34 + } 35 + 36 + /** 37 + * Get the lexicon NSID for this data type. 38 + * 39 + * @return string 40 + */ 41 + public static function getLexicon(): string 42 + { 43 + return 'app.bsky.actor.defs.postInteractionSettingsPref'; 44 + } 45 + 46 + 47 + /** 48 + * Create an instance from an array. 49 + * 50 + * @param array $data The data array 51 + * @return static 52 + */ 53 + public static function fromArray(array $data): static 54 + { 55 + return new static( 56 + threadgateAllowRules: $data['threadgateAllowRules'] ?? null, 57 + postgateEmbeddingRules: $data['postgateEmbeddingRules'] ?? null 58 + ); 59 + } 60 + 61 + }
+61
src/Generated/App/Bsky/Actor/Defs/ProfileAssociated.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.actor.defs.profileAssociated 11 + * Type: object 12 + * 13 + * @property int|null $lists 14 + * @property int|null $feedgens 15 + * @property int|null $starterPacks 16 + * @property bool|null $labeler 17 + * @property mixed $chat 18 + * @property mixed $activitySubscription 19 + */ 20 + class ProfileAssociated extends Data 21 + { 22 + public function __construct( 23 + public readonly ?int $lists = null, 24 + public readonly ?int $feedgens = null, 25 + public readonly ?int $starterPacks = null, 26 + public readonly ?bool $labeler = null, 27 + public readonly mixed $chat = null, 28 + public readonly mixed $activitySubscription = null 29 + ) { 30 + } 31 + 32 + /** 33 + * Get the lexicon NSID for this data type. 34 + * 35 + * @return string 36 + */ 37 + public static function getLexicon(): string 38 + { 39 + return 'app.bsky.actor.defs.profileAssociated'; 40 + } 41 + 42 + 43 + /** 44 + * Create an instance from an array. 45 + * 46 + * @param array $data The data array 47 + * @return static 48 + */ 49 + public static function fromArray(array $data): static 50 + { 51 + return new static( 52 + lists: $data['lists'] ?? null, 53 + feedgens: $data['feedgens'] ?? null, 54 + starterPacks: $data['starterPacks'] ?? null, 55 + labeler: $data['labeler'] ?? null, 56 + chat: $data['chat'] ?? null, 57 + activitySubscription: $data['activitySubscription'] ?? null 58 + ); 59 + } 60 + 61 + }
+49
src/Generated/App/Bsky/Actor/Defs/ProfileAssociatedActivitySubscription.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.actor.defs.profileAssociatedActivitySubscription 11 + * Type: object 12 + * 13 + * @property string $allowSubscriptions 14 + * 15 + * Constraints: 16 + * - Required: allowSubscriptions 17 + */ 18 + class ProfileAssociatedActivitySubscription extends Data 19 + { 20 + public function __construct( 21 + public readonly string $allowSubscriptions 22 + ) { 23 + } 24 + 25 + /** 26 + * Get the lexicon NSID for this data type. 27 + * 28 + * @return string 29 + */ 30 + public static function getLexicon(): string 31 + { 32 + return 'app.bsky.actor.defs.profileAssociatedActivitySubscription'; 33 + } 34 + 35 + 36 + /** 37 + * Create an instance from an array. 38 + * 39 + * @param array $data The data array 40 + * @return static 41 + */ 42 + public static function fromArray(array $data): static 43 + { 44 + return new static( 45 + allowSubscriptions: $data['allowSubscriptions'] 46 + ); 47 + } 48 + 49 + }
+49
src/Generated/App/Bsky/Actor/Defs/ProfileAssociatedChat.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.actor.defs.profileAssociatedChat 11 + * Type: object 12 + * 13 + * @property string $allowIncoming 14 + * 15 + * Constraints: 16 + * - Required: allowIncoming 17 + */ 18 + class ProfileAssociatedChat extends Data 19 + { 20 + public function __construct( 21 + public readonly string $allowIncoming 22 + ) { 23 + } 24 + 25 + /** 26 + * Get the lexicon NSID for this data type. 27 + * 28 + * @return string 29 + */ 30 + public static function getLexicon(): string 31 + { 32 + return 'app.bsky.actor.defs.profileAssociatedChat'; 33 + } 34 + 35 + 36 + /** 37 + * Create an instance from an array. 38 + * 39 + * @param array $data The data array 40 + * @return static 41 + */ 42 + public static function fromArray(array $data): static 43 + { 44 + return new static( 45 + allowIncoming: $data['allowIncoming'] 46 + ); 47 + } 48 + 49 + }
+102
src/Generated/App/Bsky/Actor/Defs/ProfileView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\Label; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: app.bsky.actor.defs.profileView 13 + * Type: object 14 + * 15 + * @property string $did 16 + * @property string $handle 17 + * @property string|null $displayName 18 + * @property string|null $pronouns 19 + * @property string|null $description 20 + * @property string|null $avatar 21 + * @property mixed $associated 22 + * @property Carbon|null $indexedAt 23 + * @property Carbon|null $createdAt 24 + * @property mixed $viewer 25 + * @property array<Label>|null $labels 26 + * @property mixed $verification 27 + * @property mixed $status 28 + * @property mixed $debug Debug information for internal development 29 + * 30 + * Constraints: 31 + * - Required: did, handle 32 + * - did: Format: did 33 + * - handle: Format: handle 34 + * - displayName: Max length: 640 35 + * - displayName: Max graphemes: 64 36 + * - description: Max length: 2560 37 + * - description: Max graphemes: 256 38 + * - avatar: Format: uri 39 + * - indexedAt: Format: datetime 40 + * - createdAt: Format: datetime 41 + */ 42 + class ProfileView extends Data 43 + { 44 + /** 45 + * @param mixed $debug Debug information for internal development 46 + */ 47 + public function __construct( 48 + public readonly string $did, 49 + public readonly string $handle, 50 + public readonly ?string $displayName = null, 51 + public readonly ?string $pronouns = null, 52 + public readonly ?string $description = null, 53 + public readonly ?string $avatar = null, 54 + public readonly mixed $associated = null, 55 + public readonly ?Carbon $indexedAt = null, 56 + public readonly ?Carbon $createdAt = null, 57 + public readonly mixed $viewer = null, 58 + public readonly ?array $labels = null, 59 + public readonly mixed $verification = null, 60 + public readonly mixed $status = null, 61 + public readonly mixed $debug = null 62 + ) { 63 + } 64 + 65 + /** 66 + * Get the lexicon NSID for this data type. 67 + * 68 + * @return string 69 + */ 70 + public static function getLexicon(): string 71 + { 72 + return 'app.bsky.actor.defs.profileView'; 73 + } 74 + 75 + 76 + /** 77 + * Create an instance from an array. 78 + * 79 + * @param array $data The data array 80 + * @return static 81 + */ 82 + public static function fromArray(array $data): static 83 + { 84 + return new static( 85 + did: $data['did'], 86 + handle: $data['handle'], 87 + displayName: $data['displayName'] ?? null, 88 + pronouns: $data['pronouns'] ?? null, 89 + description: $data['description'] ?? null, 90 + avatar: $data['avatar'] ?? null, 91 + associated: $data['associated'] ?? null, 92 + indexedAt: isset($data['indexedAt']) ? Carbon::parse($data['indexedAt']) : null, 93 + createdAt: isset($data['createdAt']) ? Carbon::parse($data['createdAt']) : null, 94 + viewer: $data['viewer'] ?? null, 95 + labels: isset($data['labels']) ? array_map(fn ($item) => Label::fromArray($item), $data['labels']) : [], 96 + verification: $data['verification'] ?? null, 97 + status: $data['status'] ?? null, 98 + debug: $data['debug'] ?? null 99 + ); 100 + } 101 + 102 + }
+93
src/Generated/App/Bsky/Actor/Defs/ProfileViewBasic.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\Label; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: app.bsky.actor.defs.profileViewBasic 13 + * Type: object 14 + * 15 + * @property string $did 16 + * @property string $handle 17 + * @property string|null $displayName 18 + * @property string|null $pronouns 19 + * @property string|null $avatar 20 + * @property mixed $associated 21 + * @property mixed $viewer 22 + * @property array<Label>|null $labels 23 + * @property Carbon|null $createdAt 24 + * @property mixed $verification 25 + * @property mixed $status 26 + * @property mixed $debug Debug information for internal development 27 + * 28 + * Constraints: 29 + * - Required: did, handle 30 + * - did: Format: did 31 + * - handle: Format: handle 32 + * - displayName: Max length: 640 33 + * - displayName: Max graphemes: 64 34 + * - avatar: Format: uri 35 + * - createdAt: Format: datetime 36 + */ 37 + class ProfileViewBasic extends Data 38 + { 39 + /** 40 + * @param mixed $debug Debug information for internal development 41 + */ 42 + public function __construct( 43 + public readonly string $did, 44 + public readonly string $handle, 45 + public readonly ?string $displayName = null, 46 + public readonly ?string $pronouns = null, 47 + public readonly ?string $avatar = null, 48 + public readonly mixed $associated = null, 49 + public readonly mixed $viewer = null, 50 + public readonly ?array $labels = null, 51 + public readonly ?Carbon $createdAt = null, 52 + public readonly mixed $verification = null, 53 + public readonly mixed $status = null, 54 + public readonly mixed $debug = null 55 + ) { 56 + } 57 + 58 + /** 59 + * Get the lexicon NSID for this data type. 60 + * 61 + * @return string 62 + */ 63 + public static function getLexicon(): string 64 + { 65 + return 'app.bsky.actor.defs.profileViewBasic'; 66 + } 67 + 68 + 69 + /** 70 + * Create an instance from an array. 71 + * 72 + * @param array $data The data array 73 + * @return static 74 + */ 75 + public static function fromArray(array $data): static 76 + { 77 + return new static( 78 + did: $data['did'], 79 + handle: $data['handle'], 80 + displayName: $data['displayName'] ?? null, 81 + pronouns: $data['pronouns'] ?? null, 82 + avatar: $data['avatar'] ?? null, 83 + associated: $data['associated'] ?? null, 84 + viewer: $data['viewer'] ?? null, 85 + labels: isset($data['labels']) ? array_map(fn ($item) => Label::fromArray($item), $data['labels']) : [], 86 + createdAt: isset($data['createdAt']) ? Carbon::parse($data['createdAt']) : null, 87 + verification: $data['verification'] ?? null, 88 + status: $data['status'] ?? null, 89 + debug: $data['debug'] ?? null 90 + ); 91 + } 92 + 93 + }
+127
src/Generated/App/Bsky/Actor/Defs/ProfileViewDetailed.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs\StarterPackViewBasic; 8 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\Label; 9 + use SocialDept\AtpSchema\Generated\Com\Atproto\Repo\StrongRef; 10 + 11 + /** 12 + * GENERATED CODE - DO NOT EDIT 13 + * 14 + * Lexicon: app.bsky.actor.defs.profileViewDetailed 15 + * Type: object 16 + * 17 + * @property string $did 18 + * @property string $handle 19 + * @property string|null $displayName 20 + * @property string|null $description 21 + * @property string|null $pronouns 22 + * @property string|null $website 23 + * @property string|null $avatar 24 + * @property string|null $banner 25 + * @property int|null $followersCount 26 + * @property int|null $followsCount 27 + * @property int|null $postsCount 28 + * @property mixed $associated 29 + * @property StarterPackViewBasic|null $joinedViaStarterPack 30 + * @property Carbon|null $indexedAt 31 + * @property Carbon|null $createdAt 32 + * @property mixed $viewer 33 + * @property array<Label>|null $labels 34 + * @property StrongRef|null $pinnedPost 35 + * @property mixed $verification 36 + * @property mixed $status 37 + * @property mixed $debug Debug information for internal development 38 + * 39 + * Constraints: 40 + * - Required: did, handle 41 + * - did: Format: did 42 + * - handle: Format: handle 43 + * - displayName: Max length: 640 44 + * - displayName: Max graphemes: 64 45 + * - description: Max length: 2560 46 + * - description: Max graphemes: 256 47 + * - website: Format: uri 48 + * - avatar: Format: uri 49 + * - banner: Format: uri 50 + * - indexedAt: Format: datetime 51 + * - createdAt: Format: datetime 52 + */ 53 + class ProfileViewDetailed extends Data 54 + { 55 + /** 56 + * @param mixed $debug Debug information for internal development 57 + */ 58 + public function __construct( 59 + public readonly string $did, 60 + public readonly string $handle, 61 + public readonly ?string $displayName = null, 62 + public readonly ?string $description = null, 63 + public readonly ?string $pronouns = null, 64 + public readonly ?string $website = null, 65 + public readonly ?string $avatar = null, 66 + public readonly ?string $banner = null, 67 + public readonly ?int $followersCount = null, 68 + public readonly ?int $followsCount = null, 69 + public readonly ?int $postsCount = null, 70 + public readonly mixed $associated = null, 71 + public readonly ?StarterPackViewBasic $joinedViaStarterPack = null, 72 + public readonly ?Carbon $indexedAt = null, 73 + public readonly ?Carbon $createdAt = null, 74 + public readonly mixed $viewer = null, 75 + public readonly ?array $labels = null, 76 + public readonly ?StrongRef $pinnedPost = null, 77 + public readonly mixed $verification = null, 78 + public readonly mixed $status = null, 79 + public readonly mixed $debug = null 80 + ) { 81 + } 82 + 83 + /** 84 + * Get the lexicon NSID for this data type. 85 + * 86 + * @return string 87 + */ 88 + public static function getLexicon(): string 89 + { 90 + return 'app.bsky.actor.defs.profileViewDetailed'; 91 + } 92 + 93 + 94 + /** 95 + * Create an instance from an array. 96 + * 97 + * @param array $data The data array 98 + * @return static 99 + */ 100 + public static function fromArray(array $data): static 101 + { 102 + return new static( 103 + did: $data['did'], 104 + handle: $data['handle'], 105 + displayName: $data['displayName'] ?? null, 106 + description: $data['description'] ?? null, 107 + pronouns: $data['pronouns'] ?? null, 108 + website: $data['website'] ?? null, 109 + avatar: $data['avatar'] ?? null, 110 + banner: $data['banner'] ?? null, 111 + followersCount: $data['followersCount'] ?? null, 112 + followsCount: $data['followsCount'] ?? null, 113 + postsCount: $data['postsCount'] ?? null, 114 + associated: $data['associated'] ?? null, 115 + joinedViaStarterPack: isset($data['joinedViaStarterPack']) ? StarterPackViewBasic::fromArray($data['joinedViaStarterPack']) : null, 116 + indexedAt: isset($data['indexedAt']) ? Carbon::parse($data['indexedAt']) : null, 117 + createdAt: isset($data['createdAt']) ? Carbon::parse($data['createdAt']) : null, 118 + viewer: $data['viewer'] ?? null, 119 + labels: isset($data['labels']) ? array_map(fn ($item) => Label::fromArray($item), $data['labels']) : [], 120 + pinnedPost: isset($data['pinnedPost']) ? StrongRef::fromArray($data['pinnedPost']) : null, 121 + verification: $data['verification'] ?? null, 122 + status: $data['status'] ?? null, 123 + debug: $data['debug'] ?? null 124 + ); 125 + } 126 + 127 + }
+58
src/Generated/App/Bsky/Actor/Defs/SavedFeed.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.actor.defs.savedFeed 11 + * Type: object 12 + * 13 + * @property string $id 14 + * @property string $type 15 + * @property string $value 16 + * @property bool $pinned 17 + * 18 + * Constraints: 19 + * - Required: id, type, value, pinned 20 + */ 21 + class SavedFeed extends Data 22 + { 23 + public function __construct( 24 + public readonly string $id, 25 + public readonly string $type, 26 + public readonly string $value, 27 + public readonly bool $pinned 28 + ) { 29 + } 30 + 31 + /** 32 + * Get the lexicon NSID for this data type. 33 + * 34 + * @return string 35 + */ 36 + public static function getLexicon(): string 37 + { 38 + return 'app.bsky.actor.defs.savedFeed'; 39 + } 40 + 41 + 42 + /** 43 + * Create an instance from an array. 44 + * 45 + * @param array $data The data array 46 + * @return static 47 + */ 48 + public static function fromArray(array $data): static 49 + { 50 + return new static( 51 + id: $data['id'], 52 + type: $data['type'], 53 + value: $data['value'], 54 + pinned: $data['pinned'] 55 + ); 56 + } 57 + 58 + }
+55
src/Generated/App/Bsky/Actor/Defs/SavedFeedsPref.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.actor.defs.savedFeedsPref 11 + * Type: object 12 + * 13 + * @property array<string> $pinned 14 + * @property array<string> $saved 15 + * @property int|null $timelineIndex 16 + * 17 + * Constraints: 18 + * - Required: pinned, saved 19 + */ 20 + class SavedFeedsPref extends Data 21 + { 22 + public function __construct( 23 + public readonly array $pinned, 24 + public readonly array $saved, 25 + public readonly ?int $timelineIndex = null 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'app.bsky.actor.defs.savedFeedsPref'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + pinned: $data['pinned'], 50 + saved: $data['saved'], 51 + timelineIndex: $data['timelineIndex'] ?? null 52 + ); 53 + } 54 + 55 + }
+49
src/Generated/App/Bsky/Actor/Defs/SavedFeedsPrefV2.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.actor.defs.savedFeedsPrefV2 11 + * Type: object 12 + * 13 + * @property array<SavedFeed> $items 14 + * 15 + * Constraints: 16 + * - Required: items 17 + */ 18 + class SavedFeedsPrefV2 extends Data 19 + { 20 + public function __construct( 21 + public readonly array $items 22 + ) { 23 + } 24 + 25 + /** 26 + * Get the lexicon NSID for this data type. 27 + * 28 + * @return string 29 + */ 30 + public static function getLexicon(): string 31 + { 32 + return 'app.bsky.actor.defs.savedFeedsPrefV2'; 33 + } 34 + 35 + 36 + /** 37 + * Create an instance from an array. 38 + * 39 + * @param array $data The data array 40 + * @return static 41 + */ 42 + public static function fromArray(array $data): static 43 + { 44 + return new static( 45 + items: isset($data['items']) ? array_map(fn ($item) => SavedFeed::fromArray($item), $data['items']) : [] 46 + ); 47 + } 48 + 49 + }
+70
src/Generated/App/Bsky/Actor/Defs/StatusView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Support\UnionHelper; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: app.bsky.actor.defs.statusView 13 + * Type: object 14 + * 15 + * @property string $status The status for the account. 16 + * @property mixed $record 17 + * @property mixed $embed An optional embed associated with the status. 18 + * @property Carbon|null $expiresAt The date when this status will expire. The application might choose to no longer return the status after expiration. 19 + * @property bool|null $isActive True if the status is not expired, false if it is expired. Only present if expiration was set. 20 + * 21 + * Constraints: 22 + * - Required: status, record 23 + * - expiresAt: Format: datetime 24 + */ 25 + class StatusView extends Data 26 + { 27 + /** 28 + * @param string $status The status for the account. 29 + * @param mixed $embed An optional embed associated with the status. 30 + * @param Carbon|null $expiresAt The date when this status will expire. The application might choose to no longer return the status after expiration. 31 + * @param bool|null $isActive True if the status is not expired, false if it is expired. Only present if expiration was set. 32 + */ 33 + public function __construct( 34 + public readonly string $status, 35 + public readonly mixed $record, 36 + public readonly mixed $embed = null, 37 + public readonly ?Carbon $expiresAt = null, 38 + public readonly ?bool $isActive = null 39 + ) { 40 + } 41 + 42 + /** 43 + * Get the lexicon NSID for this data type. 44 + * 45 + * @return string 46 + */ 47 + public static function getLexicon(): string 48 + { 49 + return 'app.bsky.actor.defs.statusView'; 50 + } 51 + 52 + 53 + /** 54 + * Create an instance from an array. 55 + * 56 + * @param array $data The data array 57 + * @return static 58 + */ 59 + public static function fromArray(array $data): static 60 + { 61 + return new static( 62 + status: $data['status'], 63 + record: $data['record'], 64 + embed: isset($data['embed']) ? UnionHelper::validateOpenUnion($data['embed']) : null, 65 + expiresAt: isset($data['expiresAt']) ? Carbon::parse($data['expiresAt']) : null, 66 + isActive: $data['isActive'] ?? null 67 + ); 68 + } 69 + 70 + }
+49
src/Generated/App/Bsky/Actor/Defs/ThreadViewPref.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.actor.defs.threadViewPref 11 + * Type: object 12 + * 13 + * @property string|null $sort Sorting mode for threads. 14 + */ 15 + class ThreadViewPref extends Data 16 + { 17 + /** 18 + * @param string|null $sort Sorting mode for threads. 19 + */ 20 + public function __construct( 21 + public readonly ?string $sort = null 22 + ) { 23 + } 24 + 25 + /** 26 + * Get the lexicon NSID for this data type. 27 + * 28 + * @return string 29 + */ 30 + public static function getLexicon(): string 31 + { 32 + return 'app.bsky.actor.defs.threadViewPref'; 33 + } 34 + 35 + 36 + /** 37 + * Create an instance from an array. 38 + * 39 + * @param array $data The data array 40 + * @return static 41 + */ 42 + public static function fromArray(array $data): static 43 + { 44 + return new static( 45 + sort: $data['sort'] ?? null 46 + ); 47 + } 48 + 49 + }
+51
src/Generated/App/Bsky/Actor/Defs/VerificationPrefs.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Preferences for how verified accounts appear in the app. 11 + * 12 + * Lexicon: app.bsky.actor.defs.verificationPrefs 13 + * Type: object 14 + * 15 + * @property bool|null $hideBadges Hide the blue check badges for verified accounts and trusted verifiers. 16 + */ 17 + class VerificationPrefs extends Data 18 + { 19 + /** 20 + * @param bool|null $hideBadges Hide the blue check badges for verified accounts and trusted verifiers. 21 + */ 22 + public function __construct( 23 + public readonly ?bool $hideBadges = null 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'app.bsky.actor.defs.verificationPrefs'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + hideBadges: $data['hideBadges'] ?? null 48 + ); 49 + } 50 + 51 + }
+63
src/Generated/App/Bsky/Actor/Defs/VerificationState.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Represents the verification information about the user this object is 11 + * attached to. 12 + * 13 + * Lexicon: app.bsky.actor.defs.verificationState 14 + * Type: object 15 + * 16 + * @property array $verifications All verifications issued by trusted verifiers on behalf of this user. Verifications by untrusted verifiers are not included. 17 + * @property string $verifiedStatus The user's status as a verified account. 18 + * @property string $trustedVerifierStatus The user's status as a trusted verifier. 19 + * 20 + * Constraints: 21 + * - Required: verifications, verifiedStatus, trustedVerifierStatus 22 + */ 23 + class VerificationState extends Data 24 + { 25 + /** 26 + * @param array $verifications All verifications issued by trusted verifiers on behalf of this user. Verifications by untrusted verifiers are not included. 27 + * @param string $verifiedStatus The user's status as a verified account. 28 + * @param string $trustedVerifierStatus The user's status as a trusted verifier. 29 + */ 30 + public function __construct( 31 + public readonly array $verifications, 32 + public readonly string $verifiedStatus, 33 + public readonly string $trustedVerifierStatus 34 + ) { 35 + } 36 + 37 + /** 38 + * Get the lexicon NSID for this data type. 39 + * 40 + * @return string 41 + */ 42 + public static function getLexicon(): string 43 + { 44 + return 'app.bsky.actor.defs.verificationState'; 45 + } 46 + 47 + 48 + /** 49 + * Create an instance from an array. 50 + * 51 + * @param array $data The data array 52 + * @return static 53 + */ 54 + public static function fromArray(array $data): static 55 + { 56 + return new static( 57 + verifications: $data['verifications'] ?? [], 58 + verifiedStatus: $data['verifiedStatus'], 59 + trustedVerifierStatus: $data['trustedVerifierStatus'] 60 + ); 61 + } 62 + 63 + }
+70
src/Generated/App/Bsky/Actor/Defs/VerificationView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * An individual verification for an associated subject. 12 + * 13 + * Lexicon: app.bsky.actor.defs.verificationView 14 + * Type: object 15 + * 16 + * @property string $issuer The user who issued this verification. 17 + * @property string $uri The AT-URI of the verification record. 18 + * @property bool $isValid True if the verification passes validation, otherwise false. 19 + * @property Carbon $createdAt Timestamp when the verification was created. 20 + * 21 + * Constraints: 22 + * - Required: issuer, uri, isValid, createdAt 23 + * - issuer: Format: did 24 + * - uri: Format: at-uri 25 + * - createdAt: Format: datetime 26 + */ 27 + class VerificationView extends Data 28 + { 29 + /** 30 + * @param string $issuer The user who issued this verification. 31 + * @param string $uri The AT-URI of the verification record. 32 + * @param bool $isValid True if the verification passes validation, otherwise false. 33 + * @param Carbon $createdAt Timestamp when the verification was created. 34 + */ 35 + public function __construct( 36 + public readonly string $issuer, 37 + public readonly string $uri, 38 + public readonly bool $isValid, 39 + public readonly Carbon $createdAt 40 + ) { 41 + } 42 + 43 + /** 44 + * Get the lexicon NSID for this data type. 45 + * 46 + * @return string 47 + */ 48 + public static function getLexicon(): string 49 + { 50 + return 'app.bsky.actor.defs.verificationView'; 51 + } 52 + 53 + 54 + /** 55 + * Create an instance from an array. 56 + * 57 + * @param array $data The data array 58 + * @return static 59 + */ 60 + public static function fromArray(array $data): static 61 + { 62 + return new static( 63 + issuer: $data['issuer'], 64 + uri: $data['uri'], 65 + isValid: $data['isValid'], 66 + createdAt: Carbon::parse($data['createdAt']) 67 + ); 68 + } 69 + 70 + }
+84
src/Generated/App/Bsky/Actor/Defs/ViewerState.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs\ListViewBasic; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Notification\Defs\ActivitySubscription; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Metadata about the requesting account's relationship with the subject 13 + * account. Only has meaningful content for authed requests. 14 + * 15 + * Lexicon: app.bsky.actor.defs.viewerState 16 + * Type: object 17 + * 18 + * @property bool|null $muted 19 + * @property ListViewBasic|null $mutedByList 20 + * @property bool|null $blockedBy 21 + * @property string|null $blocking 22 + * @property ListViewBasic|null $blockingByList 23 + * @property string|null $following 24 + * @property string|null $followedBy 25 + * @property mixed $knownFollowers This property is present only in selected cases, as an optimization. 26 + * @property ActivitySubscription|null $activitySubscription This property is present only in selected cases, as an optimization. 27 + * 28 + * Constraints: 29 + * - blocking: Format: at-uri 30 + * - following: Format: at-uri 31 + * - followedBy: Format: at-uri 32 + */ 33 + class ViewerState extends Data 34 + { 35 + /** 36 + * @param mixed $knownFollowers This property is present only in selected cases, as an optimization. 37 + * @param ActivitySubscription|null $activitySubscription This property is present only in selected cases, as an optimization. 38 + */ 39 + public function __construct( 40 + public readonly ?bool $muted = null, 41 + public readonly ?ListViewBasic $mutedByList = null, 42 + public readonly ?bool $blockedBy = null, 43 + public readonly ?string $blocking = null, 44 + public readonly ?ListViewBasic $blockingByList = null, 45 + public readonly ?string $following = null, 46 + public readonly ?string $followedBy = null, 47 + public readonly mixed $knownFollowers = null, 48 + public readonly ?ActivitySubscription $activitySubscription = null 49 + ) { 50 + } 51 + 52 + /** 53 + * Get the lexicon NSID for this data type. 54 + * 55 + * @return string 56 + */ 57 + public static function getLexicon(): string 58 + { 59 + return 'app.bsky.actor.defs.viewerState'; 60 + } 61 + 62 + 63 + /** 64 + * Create an instance from an array. 65 + * 66 + * @param array $data The data array 67 + * @return static 68 + */ 69 + public static function fromArray(array $data): static 70 + { 71 + return new static( 72 + muted: $data['muted'] ?? null, 73 + mutedByList: isset($data['mutedByList']) ? ListViewBasic::fromArray($data['mutedByList']) : null, 74 + blockedBy: $data['blockedBy'] ?? null, 75 + blocking: $data['blocking'] ?? null, 76 + blockingByList: isset($data['blockingByList']) ? ListViewBasic::fromArray($data['blockingByList']) : null, 77 + following: $data['following'] ?? null, 78 + followedBy: $data['followedBy'] ?? null, 79 + knownFollowers: $data['knownFollowers'] ?? null, 80 + activitySubscription: isset($data['activitySubscription']) ? ActivitySubscription::fromArray($data['activitySubscription']) : null 81 + ); 82 + } 83 + 84 + }
+12
src/Generated/App/Bsky/Actor/MutedWordTarget.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor; 4 + 5 + /** 6 + * GENERATED CODE - DO NOT EDIT 7 + */ 8 + enum MutedWordTarget: string 9 + { 10 + case Content = 'content'; 11 + case Tag = 'tag'; 12 + }
+57
src/Generated/App/Bsky/Embed/Defs/AspectRatio.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * width:height represents an aspect ratio. It may be approximate, and may not 11 + * correspond to absolute dimensions in any given unit. 12 + * 13 + * Lexicon: app.bsky.embed.defs.aspectRatio 14 + * Type: object 15 + * 16 + * @property int $width 17 + * @property int $height 18 + * 19 + * Constraints: 20 + * - Required: width, height 21 + * - width: Minimum: 1 22 + * - height: Minimum: 1 23 + */ 24 + class AspectRatio extends Data 25 + { 26 + public function __construct( 27 + public readonly int $width, 28 + public readonly int $height 29 + ) { 30 + } 31 + 32 + /** 33 + * Get the lexicon NSID for this data type. 34 + * 35 + * @return string 36 + */ 37 + public static function getLexicon(): string 38 + { 39 + return 'app.bsky.embed.defs.aspectRatio'; 40 + } 41 + 42 + 43 + /** 44 + * Create an instance from an array. 45 + * 46 + * @param array $data The data array 47 + * @return static 48 + */ 49 + public static function fromArray(array $data): static 50 + { 51 + return new static( 52 + width: $data['width'], 53 + height: $data['height'] 54 + ); 55 + } 56 + 57 + }
+60
src/Generated/App/Bsky/Embed/External/External.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed\External; 4 + 5 + use SocialDept\AtpSchema\Data\BlobReference; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.embed.external.external 12 + * Type: object 13 + * 14 + * @property string $uri 15 + * @property string $title 16 + * @property string $description 17 + * @property BlobReference|null $thumb 18 + * 19 + * Constraints: 20 + * - Required: uri, title, description 21 + * - uri: Format: uri 22 + */ 23 + class External extends Data 24 + { 25 + public function __construct( 26 + public readonly string $uri, 27 + public readonly string $title, 28 + public readonly string $description, 29 + public readonly ?BlobReference $thumb = null 30 + ) { 31 + } 32 + 33 + /** 34 + * Get the lexicon NSID for this data type. 35 + * 36 + * @return string 37 + */ 38 + public static function getLexicon(): string 39 + { 40 + return 'app.bsky.embed.external.external'; 41 + } 42 + 43 + 44 + /** 45 + * Create an instance from an array. 46 + * 47 + * @param array $data The data array 48 + * @return static 49 + */ 50 + public static function fromArray(array $data): static 51 + { 52 + return new static( 53 + uri: $data['uri'], 54 + title: $data['title'], 55 + description: $data['description'], 56 + thumb: $data['thumb'] ?? null 57 + ); 58 + } 59 + 60 + }
+49
src/Generated/App/Bsky/Embed/External/View.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed\External; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.embed.external.view 11 + * Type: object 12 + * 13 + * @property mixed $external 14 + * 15 + * Constraints: 16 + * - Required: external 17 + */ 18 + class View extends Data 19 + { 20 + public function __construct( 21 + public readonly mixed $external 22 + ) { 23 + } 24 + 25 + /** 26 + * Get the lexicon NSID for this data type. 27 + * 28 + * @return string 29 + */ 30 + public static function getLexicon(): string 31 + { 32 + return 'app.bsky.embed.external.view'; 33 + } 34 + 35 + 36 + /** 37 + * Create an instance from an array. 38 + * 39 + * @param array $data The data array 40 + * @return static 41 + */ 42 + public static function fromArray(array $data): static 43 + { 44 + return new static( 45 + external: $data['external'] 46 + ); 47 + } 48 + 49 + }
+60
src/Generated/App/Bsky/Embed/External/ViewExternal.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed\External; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.embed.external.viewExternal 11 + * Type: object 12 + * 13 + * @property string $uri 14 + * @property string $title 15 + * @property string $description 16 + * @property string|null $thumb 17 + * 18 + * Constraints: 19 + * - Required: uri, title, description 20 + * - uri: Format: uri 21 + * - thumb: Format: uri 22 + */ 23 + class ViewExternal extends Data 24 + { 25 + public function __construct( 26 + public readonly string $uri, 27 + public readonly string $title, 28 + public readonly string $description, 29 + public readonly ?string $thumb = null 30 + ) { 31 + } 32 + 33 + /** 34 + * Get the lexicon NSID for this data type. 35 + * 36 + * @return string 37 + */ 38 + public static function getLexicon(): string 39 + { 40 + return 'app.bsky.embed.external.viewExternal'; 41 + } 42 + 43 + 44 + /** 45 + * Create an instance from an array. 46 + * 47 + * @param array $data The data array 48 + * @return static 49 + */ 50 + public static function fromArray(array $data): static 51 + { 52 + return new static( 53 + uri: $data['uri'], 54 + title: $data['title'], 55 + description: $data['description'], 56 + thumb: $data['thumb'] ?? null 57 + ); 58 + } 59 + 60 + }
+49
src/Generated/App/Bsky/Embed/External.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.embed.external 11 + * Type: object 12 + * 13 + * @property External $external 14 + * 15 + * Constraints: 16 + * - Required: external 17 + */ 18 + class External extends Data 19 + { 20 + public function __construct( 21 + public readonly External $external 22 + ) { 23 + } 24 + 25 + /** 26 + * Get the lexicon NSID for this data type. 27 + * 28 + * @return string 29 + */ 30 + public static function getLexicon(): string 31 + { 32 + return 'app.bsky.embed.external'; 33 + } 34 + 35 + 36 + /** 37 + * Create an instance from an array. 38 + * 39 + * @param array $data The data array 40 + * @return static 41 + */ 42 + public static function fromArray(array $data): static 43 + { 44 + return new static( 45 + external: $data['external'] 46 + ); 47 + } 48 + 49 + }
+60
src/Generated/App/Bsky/Embed/Images/Image.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed\Images; 4 + 5 + use SocialDept\AtpSchema\Data\BlobReference; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Embed\Defs\AspectRatio; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: app.bsky.embed.images.image 13 + * Type: object 14 + * 15 + * @property BlobReference $image 16 + * @property string $alt Alt text description of the image, for accessibility. 17 + * @property AspectRatio|null $aspectRatio 18 + * 19 + * Constraints: 20 + * - Required: image, alt 21 + */ 22 + class Image extends Data 23 + { 24 + /** 25 + * @param string $alt Alt text description of the image, for accessibility. 26 + */ 27 + public function __construct( 28 + public readonly BlobReference $image, 29 + public readonly string $alt, 30 + public readonly ?AspectRatio $aspectRatio = null 31 + ) { 32 + } 33 + 34 + /** 35 + * Get the lexicon NSID for this data type. 36 + * 37 + * @return string 38 + */ 39 + public static function getLexicon(): string 40 + { 41 + return 'app.bsky.embed.images.image'; 42 + } 43 + 44 + 45 + /** 46 + * Create an instance from an array. 47 + * 48 + * @param array $data The data array 49 + * @return static 50 + */ 51 + public static function fromArray(array $data): static 52 + { 53 + return new static( 54 + image: $data['image'], 55 + alt: $data['alt'], 56 + aspectRatio: isset($data['aspectRatio']) ? AspectRatio::fromArray($data['aspectRatio']) : null 57 + ); 58 + } 59 + 60 + }
+50
src/Generated/App/Bsky/Embed/Images/View.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed\Images; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.embed.images.view 11 + * Type: object 12 + * 13 + * @property array $images 14 + * 15 + * Constraints: 16 + * - Required: images 17 + * - images: Max length: 4 18 + */ 19 + class View extends Data 20 + { 21 + public function __construct( 22 + public readonly array $images 23 + ) { 24 + } 25 + 26 + /** 27 + * Get the lexicon NSID for this data type. 28 + * 29 + * @return string 30 + */ 31 + public static function getLexicon(): string 32 + { 33 + return 'app.bsky.embed.images.view'; 34 + } 35 + 36 + 37 + /** 38 + * Create an instance from an array. 39 + * 40 + * @param array $data The data array 41 + * @return static 42 + */ 43 + public static function fromArray(array $data): static 44 + { 45 + return new static( 46 + images: $data['images'] ?? [] 47 + ); 48 + } 49 + 50 + }
+66
src/Generated/App/Bsky/Embed/Images/ViewImage.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed\Images; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\App\Bsky\Embed\Defs\AspectRatio; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.embed.images.viewImage 12 + * Type: object 13 + * 14 + * @property string $thumb Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View. 15 + * @property string $fullsize 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. 16 + * @property string $alt Alt text description of the image, for accessibility. 17 + * @property AspectRatio|null $aspectRatio 18 + * 19 + * Constraints: 20 + * - Required: thumb, fullsize, alt 21 + * - thumb: Format: uri 22 + * - fullsize: Format: uri 23 + */ 24 + class ViewImage extends Data 25 + { 26 + /** 27 + * @param string $thumb Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View. 28 + * @param string $fullsize 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. 29 + * @param string $alt Alt text description of the image, for accessibility. 30 + */ 31 + public function __construct( 32 + public readonly string $thumb, 33 + public readonly string $fullsize, 34 + public readonly string $alt, 35 + public readonly ?AspectRatio $aspectRatio = null 36 + ) { 37 + } 38 + 39 + /** 40 + * Get the lexicon NSID for this data type. 41 + * 42 + * @return string 43 + */ 44 + public static function getLexicon(): string 45 + { 46 + return 'app.bsky.embed.images.viewImage'; 47 + } 48 + 49 + 50 + /** 51 + * Create an instance from an array. 52 + * 53 + * @param array $data The data array 54 + * @return static 55 + */ 56 + public static function fromArray(array $data): static 57 + { 58 + return new static( 59 + thumb: $data['thumb'], 60 + fullsize: $data['fullsize'], 61 + alt: $data['alt'], 62 + aspectRatio: isset($data['aspectRatio']) ? AspectRatio::fromArray($data['aspectRatio']) : null 63 + ); 64 + } 65 + 66 + }
+52
src/Generated/App/Bsky/Embed/Images.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * A set of images embedded in a Bluesky record (eg, a post). 11 + * 12 + * Lexicon: app.bsky.embed.images 13 + * Type: object 14 + * 15 + * @property array<Image> $images 16 + * 17 + * Constraints: 18 + * - Required: images 19 + * - images: Max length: 4 20 + */ 21 + class Images extends Data 22 + { 23 + public function __construct( 24 + public readonly array $images 25 + ) { 26 + } 27 + 28 + /** 29 + * Get the lexicon NSID for this data type. 30 + * 31 + * @return string 32 + */ 33 + public static function getLexicon(): string 34 + { 35 + return 'app.bsky.embed.images'; 36 + } 37 + 38 + 39 + /** 40 + * Create an instance from an array. 41 + * 42 + * @param array $data The data array 43 + * @return static 44 + */ 45 + public static function fromArray(array $data): static 46 + { 47 + return new static( 48 + images: $data['images'] ?? [] 49 + ); 50 + } 51 + 52 + }
+50
src/Generated/App/Bsky/Embed/Record/View.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed\Record; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Support\UnionHelper; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.embed.record.view 12 + * Type: object 13 + * 14 + * @property mixed $record 15 + * 16 + * Constraints: 17 + * - Required: record 18 + */ 19 + class View extends Data 20 + { 21 + public function __construct( 22 + public readonly mixed $record 23 + ) { 24 + } 25 + 26 + /** 27 + * Get the lexicon NSID for this data type. 28 + * 29 + * @return string 30 + */ 31 + public static function getLexicon(): string 32 + { 33 + return 'app.bsky.embed.record.view'; 34 + } 35 + 36 + 37 + /** 38 + * Create an instance from an array. 39 + * 40 + * @param array $data The data array 41 + * @return static 42 + */ 43 + public static function fromArray(array $data): static 44 + { 45 + return new static( 46 + record: UnionHelper::validateOpenUnion($data['record']) 47 + ); 48 + } 49 + 50 + }
+58
src/Generated/App/Bsky/Embed/Record/ViewBlocked.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed\Record; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs\BlockedAuthor; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.embed.record.viewBlocked 12 + * Type: object 13 + * 14 + * @property string $uri 15 + * @property bool $blocked 16 + * @property BlockedAuthor $author 17 + * 18 + * Constraints: 19 + * - Required: uri, blocked, author 20 + * - uri: Format: at-uri 21 + * - blocked: Const: true 22 + */ 23 + class ViewBlocked extends Data 24 + { 25 + public function __construct( 26 + public readonly string $uri, 27 + public readonly bool $blocked, 28 + public readonly BlockedAuthor $author 29 + ) { 30 + } 31 + 32 + /** 33 + * Get the lexicon NSID for this data type. 34 + * 35 + * @return string 36 + */ 37 + public static function getLexicon(): string 38 + { 39 + return 'app.bsky.embed.record.viewBlocked'; 40 + } 41 + 42 + 43 + /** 44 + * Create an instance from an array. 45 + * 46 + * @param array $data The data array 47 + * @return static 48 + */ 49 + public static function fromArray(array $data): static 50 + { 51 + return new static( 52 + uri: $data['uri'], 53 + blocked: $data['blocked'], 54 + author: BlockedAuthor::fromArray($data['author']) 55 + ); 56 + } 57 + 58 + }
+54
src/Generated/App/Bsky/Embed/Record/ViewDetached.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed\Record; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.embed.record.viewDetached 11 + * Type: object 12 + * 13 + * @property string $uri 14 + * @property bool $detached 15 + * 16 + * Constraints: 17 + * - Required: uri, detached 18 + * - uri: Format: at-uri 19 + * - detached: Const: true 20 + */ 21 + class ViewDetached extends Data 22 + { 23 + public function __construct( 24 + public readonly string $uri, 25 + public readonly bool $detached 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'app.bsky.embed.record.viewDetached'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + uri: $data['uri'], 50 + detached: $data['detached'] 51 + ); 52 + } 53 + 54 + }
+54
src/Generated/App/Bsky/Embed/Record/ViewNotFound.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed\Record; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.embed.record.viewNotFound 11 + * Type: object 12 + * 13 + * @property string $uri 14 + * @property bool $notFound 15 + * 16 + * Constraints: 17 + * - Required: uri, notFound 18 + * - uri: Format: at-uri 19 + * - notFound: Const: true 20 + */ 21 + class ViewNotFound extends Data 22 + { 23 + public function __construct( 24 + public readonly string $uri, 25 + public readonly bool $notFound 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'app.bsky.embed.record.viewNotFound'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + uri: $data['uri'], 50 + notFound: $data['notFound'] 51 + ); 52 + } 53 + 54 + }
+88
src/Generated/App/Bsky/Embed/Record/ViewRecord.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed\Record; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileViewBasic; 8 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\Label; 9 + 10 + /** 11 + * GENERATED CODE - DO NOT EDIT 12 + * 13 + * Lexicon: app.bsky.embed.record.viewRecord 14 + * Type: object 15 + * 16 + * @property string $uri 17 + * @property string $cid 18 + * @property ProfileViewBasic $author 19 + * @property mixed $value The record data itself. 20 + * @property array<Label>|null $labels 21 + * @property int|null $replyCount 22 + * @property int|null $repostCount 23 + * @property int|null $likeCount 24 + * @property int|null $quoteCount 25 + * @property array|null $embeds 26 + * @property Carbon $indexedAt 27 + * 28 + * Constraints: 29 + * - Required: uri, cid, author, value, indexedAt 30 + * - uri: Format: at-uri 31 + * - cid: Format: cid 32 + * - indexedAt: Format: datetime 33 + */ 34 + class ViewRecord extends Data 35 + { 36 + /** 37 + * @param mixed $value The record data itself. 38 + */ 39 + public function __construct( 40 + public readonly string $uri, 41 + public readonly string $cid, 42 + public readonly ProfileViewBasic $author, 43 + public readonly mixed $value, 44 + public readonly Carbon $indexedAt, 45 + public readonly ?array $labels = null, 46 + public readonly ?int $replyCount = null, 47 + public readonly ?int $repostCount = null, 48 + public readonly ?int $likeCount = null, 49 + public readonly ?int $quoteCount = null, 50 + public readonly ?array $embeds = null 51 + ) { 52 + } 53 + 54 + /** 55 + * Get the lexicon NSID for this data type. 56 + * 57 + * @return string 58 + */ 59 + public static function getLexicon(): string 60 + { 61 + return 'app.bsky.embed.record.viewRecord'; 62 + } 63 + 64 + 65 + /** 66 + * Create an instance from an array. 67 + * 68 + * @param array $data The data array 69 + * @return static 70 + */ 71 + public static function fromArray(array $data): static 72 + { 73 + return new static( 74 + uri: $data['uri'], 75 + cid: $data['cid'], 76 + author: ProfileViewBasic::fromArray($data['author']), 77 + value: $data['value'], 78 + indexedAt: Carbon::parse($data['indexedAt']), 79 + labels: isset($data['labels']) ? array_map(fn ($item) => Label::fromArray($item), $data['labels']) : [], 80 + replyCount: $data['replyCount'] ?? null, 81 + repostCount: $data['repostCount'] ?? null, 82 + likeCount: $data['likeCount'] ?? null, 83 + quoteCount: $data['quoteCount'] ?? null, 84 + embeds: $data['embeds'] ?? null 85 + ); 86 + } 87 + 88 + }
+53
src/Generated/App/Bsky/Embed/Record.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\Com\Atproto\Repo\StrongRef; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * A representation of a record embedded in a Bluesky record (eg, a post). For 12 + * example, a quote-post, or sharing a feed generator record. 13 + * 14 + * Lexicon: app.bsky.embed.record 15 + * Type: object 16 + * 17 + * @property StrongRef $record 18 + * 19 + * Constraints: 20 + * - Required: record 21 + */ 22 + class Record extends Data 23 + { 24 + public function __construct( 25 + public readonly StrongRef $record 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'app.bsky.embed.record'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + record: StrongRef::fromArray($data['record']) 50 + ); 51 + } 52 + 53 + }
+54
src/Generated/App/Bsky/Embed/RecordWithMedia/View.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed\RecordWithMedia; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\App\Bsky\Embed\Record\View; 7 + use SocialDept\AtpSchema\Support\UnionHelper; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: app.bsky.embed.recordWithMedia.view 13 + * Type: object 14 + * 15 + * @property View $record 16 + * @property mixed $media 17 + * 18 + * Constraints: 19 + * - Required: record, media 20 + */ 21 + class View extends Data 22 + { 23 + public function __construct( 24 + public readonly View $record, 25 + public readonly mixed $media 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'app.bsky.embed.recordWithMedia.view'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + record: View::fromArray($data['record']), 50 + media: UnionHelper::validateOpenUnion($data['media']) 51 + ); 52 + } 53 + 54 + }
+57
src/Generated/App/Bsky/Embed/RecordWithMedia.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Support\UnionHelper; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * A representation of a record embedded in a Bluesky record (eg, a post), 12 + * alongside other compatible embeds. For example, a quote post and image, or a 13 + * quote post and external URL card. 14 + * 15 + * Lexicon: app.bsky.embed.recordWithMedia 16 + * Type: object 17 + * 18 + * @property Record $record 19 + * @property mixed $media 20 + * 21 + * Constraints: 22 + * - Required: record, media 23 + */ 24 + class RecordWithMedia extends Data 25 + { 26 + public function __construct( 27 + public readonly Record $record, 28 + public readonly mixed $media 29 + ) { 30 + } 31 + 32 + /** 33 + * Get the lexicon NSID for this data type. 34 + * 35 + * @return string 36 + */ 37 + public static function getLexicon(): string 38 + { 39 + return 'app.bsky.embed.recordWithMedia'; 40 + } 41 + 42 + 43 + /** 44 + * Create an instance from an array. 45 + * 46 + * @param array $data The data array 47 + * @return static 48 + */ 49 + public static function fromArray(array $data): static 50 + { 51 + return new static( 52 + record: Record::fromArray($data['record']), 53 + media: UnionHelper::validateOpenUnion($data['media']) 54 + ); 55 + } 56 + 57 + }
+54
src/Generated/App/Bsky/Embed/Video/Caption.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed\Video; 4 + 5 + use SocialDept\AtpSchema\Data\BlobReference; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.embed.video.caption 12 + * Type: object 13 + * 14 + * @property string $lang 15 + * @property BlobReference $file 16 + * 17 + * Constraints: 18 + * - Required: lang, file 19 + * - lang: Format: language 20 + */ 21 + class Caption extends Data 22 + { 23 + public function __construct( 24 + public readonly string $lang, 25 + public readonly BlobReference $file 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'app.bsky.embed.video.caption'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + lang: $data['lang'], 50 + file: $data['file'] 51 + ); 52 + } 53 + 54 + }
+67
src/Generated/App/Bsky/Embed/Video/View.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed\Video; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\App\Bsky\Embed\Defs\AspectRatio; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.embed.video.view 12 + * Type: object 13 + * 14 + * @property string $cid 15 + * @property string $playlist 16 + * @property string|null $thumbnail 17 + * @property string|null $alt 18 + * @property AspectRatio|null $aspectRatio 19 + * 20 + * Constraints: 21 + * - Required: cid, playlist 22 + * - cid: Format: cid 23 + * - playlist: Format: uri 24 + * - thumbnail: Format: uri 25 + * - alt: Max length: 10000 26 + * - alt: Max graphemes: 1000 27 + */ 28 + class View extends Data 29 + { 30 + public function __construct( 31 + public readonly string $cid, 32 + public readonly string $playlist, 33 + public readonly ?string $thumbnail = null, 34 + public readonly ?string $alt = null, 35 + public readonly ?AspectRatio $aspectRatio = null 36 + ) { 37 + } 38 + 39 + /** 40 + * Get the lexicon NSID for this data type. 41 + * 42 + * @return string 43 + */ 44 + public static function getLexicon(): string 45 + { 46 + return 'app.bsky.embed.video.view'; 47 + } 48 + 49 + 50 + /** 51 + * Create an instance from an array. 52 + * 53 + * @param array $data The data array 54 + * @return static 55 + */ 56 + public static function fromArray(array $data): static 57 + { 58 + return new static( 59 + cid: $data['cid'], 60 + playlist: $data['playlist'], 61 + thumbnail: $data['thumbnail'] ?? null, 62 + alt: $data['alt'] ?? null, 63 + aspectRatio: isset($data['aspectRatio']) ? AspectRatio::fromArray($data['aspectRatio']) : null 64 + ); 65 + } 66 + 67 + }
+69
src/Generated/App/Bsky/Embed/Video.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed; 4 + 5 + use SocialDept\AtpSchema\Data\BlobReference; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Embed\Defs\AspectRatio; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * A video embedded in a Bluesky record (eg, a post). 13 + * 14 + * Lexicon: app.bsky.embed.video 15 + * Type: object 16 + * 17 + * @property BlobReference $video The mp4 video file. May be up to 100mb, formerly limited to 50mb. 18 + * @property array<Caption>|null $captions 19 + * @property string|null $alt Alt text description of the video, for accessibility. 20 + * @property AspectRatio|null $aspectRatio 21 + * 22 + * Constraints: 23 + * - Required: video 24 + * - captions: Max length: 20 25 + * - alt: Max length: 10000 26 + * - alt: Max graphemes: 1000 27 + */ 28 + class Video extends Data 29 + { 30 + /** 31 + * @param BlobReference $video The mp4 video file. May be up to 100mb, formerly limited to 50mb. 32 + * @param string|null $alt Alt text description of the video, for accessibility. 33 + */ 34 + public function __construct( 35 + public readonly BlobReference $video, 36 + public readonly ?array $captions = null, 37 + public readonly ?string $alt = null, 38 + public readonly ?AspectRatio $aspectRatio = null 39 + ) { 40 + } 41 + 42 + /** 43 + * Get the lexicon NSID for this data type. 44 + * 45 + * @return string 46 + */ 47 + public static function getLexicon(): string 48 + { 49 + return 'app.bsky.embed.video'; 50 + } 51 + 52 + 53 + /** 54 + * Create an instance from an array. 55 + * 56 + * @param array $data The data array 57 + * @return static 58 + */ 59 + public static function fromArray(array $data): static 60 + { 61 + return new static( 62 + video: $data['video'], 63 + captions: $data['captions'] ?? [], 64 + alt: $data['alt'] ?? null, 65 + aspectRatio: isset($data['aspectRatio']) ? AspectRatio::fromArray($data['aspectRatio']) : null 66 + ); 67 + } 68 + 69 + }
+54
src/Generated/App/Bsky/Feed/Defs/BlockedAuthor.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ViewerState; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.feed.defs.blockedAuthor 12 + * Type: object 13 + * 14 + * @property string $did 15 + * @property ViewerState|null $viewer 16 + * 17 + * Constraints: 18 + * - Required: did 19 + * - did: Format: did 20 + */ 21 + class BlockedAuthor extends Data 22 + { 23 + public function __construct( 24 + public readonly string $did, 25 + public readonly ?ViewerState $viewer = null 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'app.bsky.feed.defs.blockedAuthor'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + did: $data['did'], 50 + viewer: isset($data['viewer']) ? ViewerState::fromArray($data['viewer']) : null 51 + ); 52 + } 53 + 54 + }
+57
src/Generated/App/Bsky/Feed/Defs/BlockedPost.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.feed.defs.blockedPost 11 + * Type: object 12 + * 13 + * @property string $uri 14 + * @property bool $blocked 15 + * @property mixed $author 16 + * 17 + * Constraints: 18 + * - Required: uri, blocked, author 19 + * - uri: Format: at-uri 20 + * - blocked: Const: true 21 + */ 22 + class BlockedPost extends Data 23 + { 24 + public function __construct( 25 + public readonly string $uri, 26 + public readonly bool $blocked, 27 + public readonly mixed $author 28 + ) { 29 + } 30 + 31 + /** 32 + * Get the lexicon NSID for this data type. 33 + * 34 + * @return string 35 + */ 36 + public static function getLexicon(): string 37 + { 38 + return 'app.bsky.feed.defs.blockedPost'; 39 + } 40 + 41 + 42 + /** 43 + * Create an instance from an array. 44 + * 45 + * @param array $data The data array 46 + * @return static 47 + */ 48 + public static function fromArray(array $data): static 49 + { 50 + return new static( 51 + uri: $data['uri'], 52 + blocked: $data['blocked'], 53 + author: $data['author'] 54 + ); 55 + } 56 + 57 + }
+68
src/Generated/App/Bsky/Feed/Defs/FeedViewPost.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Support\UnionHelper; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.feed.defs.feedViewPost 12 + * Type: object 13 + * 14 + * @property mixed $post 15 + * @property mixed $reply 16 + * @property mixed $reason 17 + * @property string|null $feedContext Context provided by feed generator that may be passed back alongside interactions. 18 + * @property string|null $reqId Unique identifier per request that may be passed back alongside interactions. 19 + * 20 + * Constraints: 21 + * - Required: post 22 + * - feedContext: Max length: 2000 23 + * - reqId: Max length: 100 24 + */ 25 + class FeedViewPost extends Data 26 + { 27 + /** 28 + * @param string|null $feedContext Context provided by feed generator that may be passed back alongside interactions. 29 + * @param string|null $reqId Unique identifier per request that may be passed back alongside interactions. 30 + */ 31 + public function __construct( 32 + public readonly mixed $post, 33 + public readonly mixed $reply = null, 34 + public readonly mixed $reason = null, 35 + public readonly ?string $feedContext = null, 36 + public readonly ?string $reqId = null 37 + ) { 38 + } 39 + 40 + /** 41 + * Get the lexicon NSID for this data type. 42 + * 43 + * @return string 44 + */ 45 + public static function getLexicon(): string 46 + { 47 + return 'app.bsky.feed.defs.feedViewPost'; 48 + } 49 + 50 + 51 + /** 52 + * Create an instance from an array. 53 + * 54 + * @param array $data The data array 55 + * @return static 56 + */ 57 + public static function fromArray(array $data): static 58 + { 59 + return new static( 60 + post: $data['post'], 61 + reply: $data['reply'] ?? null, 62 + reason: isset($data['reason']) ? UnionHelper::validateOpenUnion($data['reason']) : null, 63 + feedContext: $data['feedContext'] ?? null, 64 + reqId: $data['reqId'] ?? null 65 + ); 66 + } 67 + 68 + }
+100
src/Generated/App/Bsky/Feed/Defs/GeneratorView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView; 8 + use SocialDept\AtpSchema\Generated\App\Bsky\Richtext\Facet; 9 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\Label; 10 + 11 + /** 12 + * GENERATED CODE - DO NOT EDIT 13 + * 14 + * Lexicon: app.bsky.feed.defs.generatorView 15 + * Type: object 16 + * 17 + * @property string $uri 18 + * @property string $cid 19 + * @property string $did 20 + * @property ProfileView $creator 21 + * @property string $displayName 22 + * @property string|null $description 23 + * @property array<Facet>|null $descriptionFacets 24 + * @property string|null $avatar 25 + * @property int|null $likeCount 26 + * @property bool|null $acceptsInteractions 27 + * @property array<Label>|null $labels 28 + * @property mixed $viewer 29 + * @property string|null $contentMode 30 + * @property Carbon $indexedAt 31 + * 32 + * Constraints: 33 + * - Required: uri, cid, did, creator, displayName, indexedAt 34 + * - uri: Format: at-uri 35 + * - cid: Format: cid 36 + * - did: Format: did 37 + * - description: Max length: 3000 38 + * - description: Max graphemes: 300 39 + * - avatar: Format: uri 40 + * - likeCount: Minimum: 0 41 + * - indexedAt: Format: datetime 42 + */ 43 + class GeneratorView extends Data 44 + { 45 + public function __construct( 46 + public readonly string $uri, 47 + public readonly string $cid, 48 + public readonly string $did, 49 + public readonly ProfileView $creator, 50 + public readonly string $displayName, 51 + public readonly Carbon $indexedAt, 52 + public readonly ?string $description = null, 53 + public readonly ?array $descriptionFacets = null, 54 + public readonly ?string $avatar = null, 55 + public readonly ?int $likeCount = null, 56 + public readonly ?bool $acceptsInteractions = null, 57 + public readonly ?array $labels = null, 58 + public readonly mixed $viewer = null, 59 + public readonly ?string $contentMode = null 60 + ) { 61 + } 62 + 63 + /** 64 + * Get the lexicon NSID for this data type. 65 + * 66 + * @return string 67 + */ 68 + public static function getLexicon(): string 69 + { 70 + return 'app.bsky.feed.defs.generatorView'; 71 + } 72 + 73 + 74 + /** 75 + * Create an instance from an array. 76 + * 77 + * @param array $data The data array 78 + * @return static 79 + */ 80 + public static function fromArray(array $data): static 81 + { 82 + return new static( 83 + uri: $data['uri'], 84 + cid: $data['cid'], 85 + did: $data['did'], 86 + creator: ProfileView::fromArray($data['creator']), 87 + displayName: $data['displayName'], 88 + indexedAt: Carbon::parse($data['indexedAt']), 89 + description: $data['description'] ?? null, 90 + descriptionFacets: isset($data['descriptionFacets']) ? array_map(fn ($item) => Facet::fromArray($item), $data['descriptionFacets']) : [], 91 + avatar: $data['avatar'] ?? null, 92 + likeCount: $data['likeCount'] ?? null, 93 + acceptsInteractions: $data['acceptsInteractions'] ?? null, 94 + labels: isset($data['labels']) ? array_map(fn ($item) => Label::fromArray($item), $data['labels']) : [], 95 + viewer: $data['viewer'] ?? null, 96 + contentMode: $data['contentMode'] ?? null 97 + ); 98 + } 99 + 100 + }
+49
src/Generated/App/Bsky/Feed/Defs/GeneratorViewerState.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.feed.defs.generatorViewerState 11 + * Type: object 12 + * 13 + * @property string|null $like 14 + * 15 + * Constraints: 16 + * - like: Format: at-uri 17 + */ 18 + class GeneratorViewerState extends Data 19 + { 20 + public function __construct( 21 + public readonly ?string $like = null 22 + ) { 23 + } 24 + 25 + /** 26 + * Get the lexicon NSID for this data type. 27 + * 28 + * @return string 29 + */ 30 + public static function getLexicon(): string 31 + { 32 + return 'app.bsky.feed.defs.generatorViewerState'; 33 + } 34 + 35 + 36 + /** 37 + * Create an instance from an array. 38 + * 39 + * @param array $data The data array 40 + * @return static 41 + */ 42 + public static function fromArray(array $data): static 43 + { 44 + return new static( 45 + like: $data['like'] ?? null 46 + ); 47 + } 48 + 49 + }
+64
src/Generated/App/Bsky/Feed/Defs/Interaction.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.feed.defs.interaction 11 + * Type: object 12 + * 13 + * @property string|null $item 14 + * @property string|null $event 15 + * @property string|null $feedContext Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton. 16 + * @property string|null $reqId Unique identifier per request that may be passed back alongside interactions. 17 + * 18 + * Constraints: 19 + * - item: Format: at-uri 20 + * - feedContext: Max length: 2000 21 + * - reqId: Max length: 100 22 + */ 23 + class Interaction extends Data 24 + { 25 + /** 26 + * @param string|null $feedContext Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton. 27 + * @param string|null $reqId Unique identifier per request that may be passed back alongside interactions. 28 + */ 29 + public function __construct( 30 + public readonly ?string $item = null, 31 + public readonly ?string $event = null, 32 + public readonly ?string $feedContext = null, 33 + public readonly ?string $reqId = null 34 + ) { 35 + } 36 + 37 + /** 38 + * Get the lexicon NSID for this data type. 39 + * 40 + * @return string 41 + */ 42 + public static function getLexicon(): string 43 + { 44 + return 'app.bsky.feed.defs.interaction'; 45 + } 46 + 47 + 48 + /** 49 + * Create an instance from an array. 50 + * 51 + * @param array $data The data array 52 + * @return static 53 + */ 54 + public static function fromArray(array $data): static 55 + { 56 + return new static( 57 + item: $data['item'] ?? null, 58 + event: $data['event'] ?? null, 59 + feedContext: $data['feedContext'] ?? null, 60 + reqId: $data['reqId'] ?? null 61 + ); 62 + } 63 + 64 + }
+54
src/Generated/App/Bsky/Feed/Defs/NotFoundPost.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.feed.defs.notFoundPost 11 + * Type: object 12 + * 13 + * @property string $uri 14 + * @property bool $notFound 15 + * 16 + * Constraints: 17 + * - Required: uri, notFound 18 + * - uri: Format: at-uri 19 + * - notFound: Const: true 20 + */ 21 + class NotFoundPost extends Data 22 + { 23 + public function __construct( 24 + public readonly string $uri, 25 + public readonly bool $notFound 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'app.bsky.feed.defs.notFoundPost'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + uri: $data['uri'], 50 + notFound: $data['notFound'] 51 + ); 52 + } 53 + 54 + }
+101
src/Generated/App/Bsky/Feed/Defs/PostView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileViewBasic; 8 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\Label; 9 + use SocialDept\AtpSchema\Support\UnionHelper; 10 + 11 + /** 12 + * GENERATED CODE - DO NOT EDIT 13 + * 14 + * Lexicon: app.bsky.feed.defs.postView 15 + * Type: object 16 + * 17 + * @property string $uri 18 + * @property string $cid 19 + * @property ProfileViewBasic $author 20 + * @property mixed $record 21 + * @property mixed $embed 22 + * @property int|null $bookmarkCount 23 + * @property int|null $replyCount 24 + * @property int|null $repostCount 25 + * @property int|null $likeCount 26 + * @property int|null $quoteCount 27 + * @property Carbon $indexedAt 28 + * @property mixed $viewer 29 + * @property array<Label>|null $labels 30 + * @property mixed $threadgate 31 + * @property mixed $debug Debug information for internal development 32 + * 33 + * Constraints: 34 + * - Required: uri, cid, author, record, indexedAt 35 + * - uri: Format: at-uri 36 + * - cid: Format: cid 37 + * - indexedAt: Format: datetime 38 + */ 39 + class PostView extends Data 40 + { 41 + /** 42 + * @param mixed $debug Debug information for internal development 43 + */ 44 + public function __construct( 45 + public readonly string $uri, 46 + public readonly string $cid, 47 + public readonly ProfileViewBasic $author, 48 + public readonly mixed $record, 49 + public readonly Carbon $indexedAt, 50 + public readonly mixed $embed = null, 51 + public readonly ?int $bookmarkCount = null, 52 + public readonly ?int $replyCount = null, 53 + public readonly ?int $repostCount = null, 54 + public readonly ?int $likeCount = null, 55 + public readonly ?int $quoteCount = null, 56 + public readonly mixed $viewer = null, 57 + public readonly ?array $labels = null, 58 + public readonly mixed $threadgate = null, 59 + public readonly mixed $debug = null 60 + ) { 61 + } 62 + 63 + /** 64 + * Get the lexicon NSID for this data type. 65 + * 66 + * @return string 67 + */ 68 + public static function getLexicon(): string 69 + { 70 + return 'app.bsky.feed.defs.postView'; 71 + } 72 + 73 + 74 + /** 75 + * Create an instance from an array. 76 + * 77 + * @param array $data The data array 78 + * @return static 79 + */ 80 + public static function fromArray(array $data): static 81 + { 82 + return new static( 83 + uri: $data['uri'], 84 + cid: $data['cid'], 85 + author: ProfileViewBasic::fromArray($data['author']), 86 + record: $data['record'], 87 + indexedAt: Carbon::parse($data['indexedAt']), 88 + embed: isset($data['embed']) ? UnionHelper::validateOpenUnion($data['embed']) : null, 89 + bookmarkCount: $data['bookmarkCount'] ?? null, 90 + replyCount: $data['replyCount'] ?? null, 91 + repostCount: $data['repostCount'] ?? null, 92 + likeCount: $data['likeCount'] ?? null, 93 + quoteCount: $data['quoteCount'] ?? null, 94 + viewer: $data['viewer'] ?? null, 95 + labels: isset($data['labels']) ? array_map(fn ($item) => Label::fromArray($item), $data['labels']) : [], 96 + threadgate: $data['threadgate'] ?? null, 97 + debug: $data['debug'] ?? null 98 + ); 99 + } 100 + 101 + }
+37
src/Generated/App/Bsky/Feed/Defs/ReasonPin.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.feed.defs.reasonPin 11 + * Type: object 12 + */ 13 + class ReasonPin extends Data 14 + { 15 + /** 16 + * Get the lexicon NSID for this data type. 17 + * 18 + * @return string 19 + */ 20 + public static function getLexicon(): string 21 + { 22 + return 'app.bsky.feed.defs.reasonPin'; 23 + } 24 + 25 + 26 + /** 27 + * Create an instance from an array. 28 + * 29 + * @param array $data The data array 30 + * @return static 31 + */ 32 + public static function fromArray(array $data): static 33 + { 34 + return new static(); 35 + } 36 + 37 + }
+63
src/Generated/App/Bsky/Feed/Defs/ReasonRepost.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileViewBasic; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: app.bsky.feed.defs.reasonRepost 13 + * Type: object 14 + * 15 + * @property ProfileViewBasic $by 16 + * @property string|null $uri 17 + * @property string|null $cid 18 + * @property Carbon $indexedAt 19 + * 20 + * Constraints: 21 + * - Required: by, indexedAt 22 + * - uri: Format: at-uri 23 + * - cid: Format: cid 24 + * - indexedAt: Format: datetime 25 + */ 26 + class ReasonRepost extends Data 27 + { 28 + public function __construct( 29 + public readonly ProfileViewBasic $by, 30 + public readonly Carbon $indexedAt, 31 + public readonly ?string $uri = null, 32 + public readonly ?string $cid = null 33 + ) { 34 + } 35 + 36 + /** 37 + * Get the lexicon NSID for this data type. 38 + * 39 + * @return string 40 + */ 41 + public static function getLexicon(): string 42 + { 43 + return 'app.bsky.feed.defs.reasonRepost'; 44 + } 45 + 46 + 47 + /** 48 + * Create an instance from an array. 49 + * 50 + * @param array $data The data array 51 + * @return static 52 + */ 53 + public static function fromArray(array $data): static 54 + { 55 + return new static( 56 + by: ProfileViewBasic::fromArray($data['by']), 57 + indexedAt: Carbon::parse($data['indexedAt']), 58 + uri: $data['uri'] ?? null, 59 + cid: $data['cid'] ?? null 60 + ); 61 + } 62 + 63 + }
+60
src/Generated/App/Bsky/Feed/Defs/ReplyRef.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileViewBasic; 7 + use SocialDept\AtpSchema\Support\UnionHelper; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: app.bsky.feed.defs.replyRef 13 + * Type: object 14 + * 15 + * @property mixed $root 16 + * @property mixed $parent 17 + * @property ProfileViewBasic|null $grandparentAuthor When parent is a reply to another post, this is the author of that post. 18 + * 19 + * Constraints: 20 + * - Required: root, parent 21 + */ 22 + class ReplyRef extends Data 23 + { 24 + /** 25 + * @param ProfileViewBasic|null $grandparentAuthor When parent is a reply to another post, this is the author of that post. 26 + */ 27 + public function __construct( 28 + public readonly mixed $root, 29 + public readonly mixed $parent, 30 + public readonly ?ProfileViewBasic $grandparentAuthor = null 31 + ) { 32 + } 33 + 34 + /** 35 + * Get the lexicon NSID for this data type. 36 + * 37 + * @return string 38 + */ 39 + public static function getLexicon(): string 40 + { 41 + return 'app.bsky.feed.defs.replyRef'; 42 + } 43 + 44 + 45 + /** 46 + * Create an instance from an array. 47 + * 48 + * @param array $data The data array 49 + * @return static 50 + */ 51 + public static function fromArray(array $data): static 52 + { 53 + return new static( 54 + root: UnionHelper::validateOpenUnion($data['root']), 55 + parent: UnionHelper::validateOpenUnion($data['parent']), 56 + grandparentAuthor: isset($data['grandparentAuthor']) ? ProfileViewBasic::fromArray($data['grandparentAuthor']) : null 57 + ); 58 + } 59 + 60 + }
+61
src/Generated/App/Bsky/Feed/Defs/SkeletonFeedPost.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Support\UnionHelper; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.feed.defs.skeletonFeedPost 12 + * Type: object 13 + * 14 + * @property string $post 15 + * @property mixed $reason 16 + * @property string|null $feedContext Context that will be passed through to client and may be passed to feed generator back alongside interactions. 17 + * 18 + * Constraints: 19 + * - Required: post 20 + * - post: Format: at-uri 21 + * - feedContext: Max length: 2000 22 + */ 23 + class SkeletonFeedPost extends Data 24 + { 25 + /** 26 + * @param string|null $feedContext Context that will be passed through to client and may be passed to feed generator back alongside interactions. 27 + */ 28 + public function __construct( 29 + public readonly string $post, 30 + public readonly mixed $reason = null, 31 + public readonly ?string $feedContext = null 32 + ) { 33 + } 34 + 35 + /** 36 + * Get the lexicon NSID for this data type. 37 + * 38 + * @return string 39 + */ 40 + public static function getLexicon(): string 41 + { 42 + return 'app.bsky.feed.defs.skeletonFeedPost'; 43 + } 44 + 45 + 46 + /** 47 + * Create an instance from an array. 48 + * 49 + * @param array $data The data array 50 + * @return static 51 + */ 52 + public static function fromArray(array $data): static 53 + { 54 + return new static( 55 + post: $data['post'], 56 + reason: isset($data['reason']) ? UnionHelper::validateOpenUnion($data['reason']) : null, 57 + feedContext: $data['feedContext'] ?? null 58 + ); 59 + } 60 + 61 + }
+37
src/Generated/App/Bsky/Feed/Defs/SkeletonReasonPin.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.feed.defs.skeletonReasonPin 11 + * Type: object 12 + */ 13 + class SkeletonReasonPin extends Data 14 + { 15 + /** 16 + * Get the lexicon NSID for this data type. 17 + * 18 + * @return string 19 + */ 20 + public static function getLexicon(): string 21 + { 22 + return 'app.bsky.feed.defs.skeletonReasonPin'; 23 + } 24 + 25 + 26 + /** 27 + * Create an instance from an array. 28 + * 29 + * @param array $data The data array 30 + * @return static 31 + */ 32 + public static function fromArray(array $data): static 33 + { 34 + return new static(); 35 + } 36 + 37 + }
+50
src/Generated/App/Bsky/Feed/Defs/SkeletonReasonRepost.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.feed.defs.skeletonReasonRepost 11 + * Type: object 12 + * 13 + * @property string $repost 14 + * 15 + * Constraints: 16 + * - Required: repost 17 + * - repost: Format: at-uri 18 + */ 19 + class SkeletonReasonRepost extends Data 20 + { 21 + public function __construct( 22 + public readonly string $repost 23 + ) { 24 + } 25 + 26 + /** 27 + * Get the lexicon NSID for this data type. 28 + * 29 + * @return string 30 + */ 31 + public static function getLexicon(): string 32 + { 33 + return 'app.bsky.feed.defs.skeletonReasonRepost'; 34 + } 35 + 36 + 37 + /** 38 + * Create an instance from an array. 39 + * 40 + * @param array $data The data array 41 + * @return static 42 + */ 43 + public static function fromArray(array $data): static 44 + { 45 + return new static( 46 + repost: $data['repost'] 47 + ); 48 + } 49 + 50 + }
+51
src/Generated/App/Bsky/Feed/Defs/ThreadContext.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Metadata about this post within the context of the thread it is in. 11 + * 12 + * Lexicon: app.bsky.feed.defs.threadContext 13 + * Type: object 14 + * 15 + * @property string|null $rootAuthorLike 16 + * 17 + * Constraints: 18 + * - rootAuthorLike: Format: at-uri 19 + */ 20 + class ThreadContext extends Data 21 + { 22 + public function __construct( 23 + public readonly ?string $rootAuthorLike = null 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'app.bsky.feed.defs.threadContext'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + rootAuthorLike: $data['rootAuthorLike'] ?? null 48 + ); 49 + } 50 + 51 + }
+59
src/Generated/App/Bsky/Feed/Defs/ThreadViewPost.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Support\UnionHelper; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.feed.defs.threadViewPost 12 + * Type: object 13 + * 14 + * @property mixed $post 15 + * @property mixed $parent 16 + * @property array|null $replies 17 + * @property mixed $threadContext 18 + * 19 + * Constraints: 20 + * - Required: post 21 + */ 22 + class ThreadViewPost extends Data 23 + { 24 + public function __construct( 25 + public readonly mixed $post, 26 + public readonly mixed $parent = null, 27 + public readonly ?array $replies = null, 28 + public readonly mixed $threadContext = null 29 + ) { 30 + } 31 + 32 + /** 33 + * Get the lexicon NSID for this data type. 34 + * 35 + * @return string 36 + */ 37 + public static function getLexicon(): string 38 + { 39 + return 'app.bsky.feed.defs.threadViewPost'; 40 + } 41 + 42 + 43 + /** 44 + * Create an instance from an array. 45 + * 46 + * @param array $data The data array 47 + * @return static 48 + */ 49 + public static function fromArray(array $data): static 50 + { 51 + return new static( 52 + post: $data['post'], 53 + parent: isset($data['parent']) ? UnionHelper::validateOpenUnion($data['parent']) : null, 54 + replies: $data['replies'] ?? null, 55 + threadContext: $data['threadContext'] ?? null 56 + ); 57 + } 58 + 59 + }
+60
src/Generated/App/Bsky/Feed/Defs/ThreadgateView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs\ListViewBasic; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.feed.defs.threadgateView 12 + * Type: object 13 + * 14 + * @property string|null $uri 15 + * @property string|null $cid 16 + * @property mixed $record 17 + * @property array<ListViewBasic>|null $lists 18 + * 19 + * Constraints: 20 + * - uri: Format: at-uri 21 + * - cid: Format: cid 22 + */ 23 + class ThreadgateView extends Data 24 + { 25 + public function __construct( 26 + public readonly ?string $uri = null, 27 + public readonly ?string $cid = null, 28 + public readonly mixed $record = null, 29 + public readonly ?array $lists = null 30 + ) { 31 + } 32 + 33 + /** 34 + * Get the lexicon NSID for this data type. 35 + * 36 + * @return string 37 + */ 38 + public static function getLexicon(): string 39 + { 40 + return 'app.bsky.feed.defs.threadgateView'; 41 + } 42 + 43 + 44 + /** 45 + * Create an instance from an array. 46 + * 47 + * @param array $data The data array 48 + * @return static 49 + */ 50 + public static function fromArray(array $data): static 51 + { 52 + return new static( 53 + uri: $data['uri'] ?? null, 54 + cid: $data['cid'] ?? null, 55 + record: $data['record'] ?? null, 56 + lists: isset($data['lists']) ? array_map(fn ($item) => ListViewBasic::fromArray($item), $data['lists']) : [] 57 + ); 58 + } 59 + 60 + }
+71
src/Generated/App/Bsky/Feed/Defs/ViewerState.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Metadata about the requesting account's relationship with the subject 11 + * content. Only has meaningful content for authed requests. 12 + * 13 + * Lexicon: app.bsky.feed.defs.viewerState 14 + * Type: object 15 + * 16 + * @property string|null $repost 17 + * @property string|null $like 18 + * @property bool|null $bookmarked 19 + * @property bool|null $threadMuted 20 + * @property bool|null $replyDisabled 21 + * @property bool|null $embeddingDisabled 22 + * @property bool|null $pinned 23 + * 24 + * Constraints: 25 + * - repost: Format: at-uri 26 + * - like: Format: at-uri 27 + */ 28 + class ViewerState extends Data 29 + { 30 + public function __construct( 31 + public readonly ?string $repost = null, 32 + public readonly ?string $like = null, 33 + public readonly ?bool $bookmarked = null, 34 + public readonly ?bool $threadMuted = null, 35 + public readonly ?bool $replyDisabled = null, 36 + public readonly ?bool $embeddingDisabled = null, 37 + public readonly ?bool $pinned = null 38 + ) { 39 + } 40 + 41 + /** 42 + * Get the lexicon NSID for this data type. 43 + * 44 + * @return string 45 + */ 46 + public static function getLexicon(): string 47 + { 48 + return 'app.bsky.feed.defs.viewerState'; 49 + } 50 + 51 + 52 + /** 53 + * Create an instance from an array. 54 + * 55 + * @param array $data The data array 56 + * @return static 57 + */ 58 + public static function fromArray(array $data): static 59 + { 60 + return new static( 61 + repost: $data['repost'] ?? null, 62 + like: $data['like'] ?? null, 63 + bookmarked: $data['bookmarked'] ?? null, 64 + threadMuted: $data['threadMuted'] ?? null, 65 + replyDisabled: $data['replyDisabled'] ?? null, 66 + embeddingDisabled: $data['embeddingDisabled'] ?? null, 67 + pinned: $data['pinned'] ?? null 68 + ); 69 + } 70 + 71 + }
+59
src/Generated/App/Bsky/Feed/GetLikes/Like.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\GetLikes; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: app.bsky.feed.getLikes.like 13 + * Type: object 14 + * 15 + * @property Carbon $indexedAt 16 + * @property Carbon $createdAt 17 + * @property ProfileView $actor 18 + * 19 + * Constraints: 20 + * - Required: indexedAt, createdAt, actor 21 + * - indexedAt: Format: datetime 22 + * - createdAt: Format: datetime 23 + */ 24 + class Like extends Data 25 + { 26 + public function __construct( 27 + public readonly Carbon $indexedAt, 28 + public readonly Carbon $createdAt, 29 + public readonly ProfileView $actor 30 + ) { 31 + } 32 + 33 + /** 34 + * Get the lexicon NSID for this data type. 35 + * 36 + * @return string 37 + */ 38 + public static function getLexicon(): string 39 + { 40 + return 'app.bsky.feed.getLikes.like'; 41 + } 42 + 43 + 44 + /** 45 + * Create an instance from an array. 46 + * 47 + * @param array $data The data array 48 + * @return static 49 + */ 50 + public static function fromArray(array $data): static 51 + { 52 + return new static( 53 + indexedAt: Carbon::parse($data['indexedAt']), 54 + createdAt: Carbon::parse($data['createdAt']), 55 + actor: ProfileView::fromArray($data['actor']) 56 + ); 57 + } 58 + 59 + }
+50
src/Generated/App/Bsky/Feed/Like.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\Com\Atproto\Repo\StrongRef; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: app.bsky.feed.like 13 + * Type: record 14 + */ 15 + class Like extends Data 16 + { 17 + public function __construct( 18 + public readonly StrongRef $subject, 19 + public readonly Carbon $createdAt, 20 + public readonly ?StrongRef $via = null 21 + ) { 22 + } 23 + 24 + /** 25 + * Get the lexicon NSID for this data type. 26 + * 27 + * @return string 28 + */ 29 + public static function getLexicon(): string 30 + { 31 + return 'app.bsky.feed.like'; 32 + } 33 + 34 + 35 + /** 36 + * Create an instance from an array. 37 + * 38 + * @param array $data The data array 39 + * @return static 40 + */ 41 + public static function fromArray(array $data): static 42 + { 43 + return new static( 44 + subject: StrongRef::fromArray($data['subject']), 45 + createdAt: Carbon::parse($data['createdAt']), 46 + via: isset($data['via']) ? StrongRef::fromArray($data['via']) : null 47 + ); 48 + } 49 + 50 + }
+60
src/Generated/App/Bsky/Feed/Post/Entity.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Post; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Deprecated: use facets instead. 11 + * 12 + * Lexicon: app.bsky.feed.post.entity 13 + * Type: object 14 + * 15 + * @property mixed $index 16 + * @property string $type Expected values are 'mention' and 'link'. 17 + * @property string $value 18 + * 19 + * Constraints: 20 + * - Required: index, type, value 21 + */ 22 + class Entity extends Data 23 + { 24 + /** 25 + * @param string $type Expected values are 'mention' and 'link'. 26 + */ 27 + public function __construct( 28 + public readonly mixed $index, 29 + public readonly string $type, 30 + public readonly string $value 31 + ) { 32 + } 33 + 34 + /** 35 + * Get the lexicon NSID for this data type. 36 + * 37 + * @return string 38 + */ 39 + public static function getLexicon(): string 40 + { 41 + return 'app.bsky.feed.post.entity'; 42 + } 43 + 44 + 45 + /** 46 + * Create an instance from an array. 47 + * 48 + * @param array $data The data array 49 + * @return static 50 + */ 51 + public static function fromArray(array $data): static 52 + { 53 + return new static( 54 + index: $data['index'], 55 + type: $data['type'], 56 + value: $data['value'] 57 + ); 58 + } 59 + 60 + }
+53
src/Generated/App/Bsky/Feed/Post/ReplyRef.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Post; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\Com\Atproto\Repo\StrongRef; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.feed.post.replyRef 12 + * Type: object 13 + * 14 + * @property StrongRef $root 15 + * @property StrongRef $parent 16 + * 17 + * Constraints: 18 + * - Required: root, parent 19 + */ 20 + class ReplyRef extends Data 21 + { 22 + public function __construct( 23 + public readonly StrongRef $root, 24 + public readonly StrongRef $parent 25 + ) { 26 + } 27 + 28 + /** 29 + * Get the lexicon NSID for this data type. 30 + * 31 + * @return string 32 + */ 33 + public static function getLexicon(): string 34 + { 35 + return 'app.bsky.feed.post.replyRef'; 36 + } 37 + 38 + 39 + /** 40 + * Create an instance from an array. 41 + * 42 + * @param array $data The data array 43 + * @return static 44 + */ 45 + public static function fromArray(array $data): static 46 + { 47 + return new static( 48 + root: StrongRef::fromArray($data['root']), 49 + parent: StrongRef::fromArray($data['parent']) 50 + ); 51 + } 52 + 53 + }
+57
src/Generated/App/Bsky/Feed/Post/TextSlice.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed\Post; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Deprecated. Use app.bsky.richtext instead -- A text segment. Start is 11 + * inclusive, end is exclusive. Indices are for utf16-encoded strings. 12 + * 13 + * Lexicon: app.bsky.feed.post.textSlice 14 + * Type: object 15 + * 16 + * @property int $start 17 + * @property int $end 18 + * 19 + * Constraints: 20 + * - Required: start, end 21 + * - start: Minimum: 0 22 + * - end: Minimum: 0 23 + */ 24 + class TextSlice extends Data 25 + { 26 + public function __construct( 27 + public readonly int $start, 28 + public readonly int $end 29 + ) { 30 + } 31 + 32 + /** 33 + * Get the lexicon NSID for this data type. 34 + * 35 + * @return string 36 + */ 37 + public static function getLexicon(): string 38 + { 39 + return 'app.bsky.feed.post.textSlice'; 40 + } 41 + 42 + 43 + /** 44 + * Create an instance from an array. 45 + * 46 + * @param array $data The data array 47 + * @return static 48 + */ 49 + public static function fromArray(array $data): static 50 + { 51 + return new static( 52 + start: $data['start'], 53 + end: $data['end'] 54 + ); 55 + } 56 + 57 + }
+72
src/Generated/App/Bsky/Feed/Post.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Richtext\Facet; 8 + use SocialDept\AtpSchema\Support\UnionHelper; 9 + 10 + /** 11 + * GENERATED CODE - DO NOT EDIT 12 + * 13 + * Lexicon: app.bsky.feed.post 14 + * Type: record 15 + */ 16 + class Post extends Data 17 + { 18 + /** 19 + * @param string $text The primary post content. May be an empty string, if there are embeds. 20 + * @param Carbon $createdAt Client-declared timestamp when this post was originally created. 21 + * @param array<Entity>|null $entities DEPRECATED: replaced by app.bsky.richtext.facet. 22 + * @param array<Facet>|null $facets Annotations of text (mentions, URLs, hashtags, etc) 23 + * @param array<string>|null $langs Indicates human language of post primary text content. 24 + * @param mixed $labels Self-label values for this post. Effectively content warnings. 25 + * @param array<string>|null $tags Additional hashtags, in addition to any included in post text and facets. 26 + */ 27 + public function __construct( 28 + public readonly string $text, 29 + public readonly Carbon $createdAt, 30 + public readonly ?array $entities = null, 31 + public readonly ?array $facets = null, 32 + public readonly ?ReplyRef $reply = null, 33 + public readonly mixed $embed = null, 34 + public readonly ?array $langs = null, 35 + public readonly mixed $labels = null, 36 + public readonly ?array $tags = null 37 + ) { 38 + } 39 + 40 + /** 41 + * Get the lexicon NSID for this data type. 42 + * 43 + * @return string 44 + */ 45 + public static function getLexicon(): string 46 + { 47 + return 'app.bsky.feed.post'; 48 + } 49 + 50 + 51 + /** 52 + * Create an instance from an array. 53 + * 54 + * @param array $data The data array 55 + * @return static 56 + */ 57 + public static function fromArray(array $data): static 58 + { 59 + return new static( 60 + text: $data['text'], 61 + createdAt: Carbon::parse($data['createdAt']), 62 + entities: $data['entities'] ?? [], 63 + facets: isset($data['facets']) ? array_map(fn ($item) => Facet::fromArray($item), $data['facets']) : [], 64 + reply: $data['reply'] ?? null, 65 + embed: isset($data['embed']) ? UnionHelper::validateOpenUnion($data['embed']) : null, 66 + langs: $data['langs'] ?? null, 67 + labels: isset($data['labels']) ? UnionHelper::validateOpenUnion($data['labels']) : null, 68 + tags: $data['tags'] ?? null 69 + ); 70 + } 71 + 72 + }
+50
src/Generated/App/Bsky/Feed/Repost.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Feed; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\Com\Atproto\Repo\StrongRef; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: app.bsky.feed.repost 13 + * Type: record 14 + */ 15 + class Repost extends Data 16 + { 17 + public function __construct( 18 + public readonly StrongRef $subject, 19 + public readonly Carbon $createdAt, 20 + public readonly ?StrongRef $via = null 21 + ) { 22 + } 23 + 24 + /** 25 + * Get the lexicon NSID for this data type. 26 + * 27 + * @return string 28 + */ 29 + public static function getLexicon(): string 30 + { 31 + return 'app.bsky.feed.repost'; 32 + } 33 + 34 + 35 + /** 36 + * Create an instance from an array. 37 + * 38 + * @param array $data The data array 39 + * @return static 40 + */ 41 + public static function fromArray(array $data): static 42 + { 43 + return new static( 44 + subject: StrongRef::fromArray($data['subject']), 45 + createdAt: Carbon::parse($data['createdAt']), 46 + via: isset($data['via']) ? StrongRef::fromArray($data['via']) : null 47 + ); 48 + } 49 + 50 + }
+50
src/Generated/App/Bsky/Graph/Block.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Graph; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.graph.block 12 + * Type: record 13 + */ 14 + class Block extends Data 15 + { 16 + /** 17 + * @param string $subject DID of the account to be blocked. 18 + */ 19 + public function __construct( 20 + public readonly string $subject, 21 + public readonly Carbon $createdAt 22 + ) { 23 + } 24 + 25 + /** 26 + * Get the lexicon NSID for this data type. 27 + * 28 + * @return string 29 + */ 30 + public static function getLexicon(): string 31 + { 32 + return 'app.bsky.graph.block'; 33 + } 34 + 35 + 36 + /** 37 + * Create an instance from an array. 38 + * 39 + * @param array $data The data array 40 + * @return static 41 + */ 42 + public static function fromArray(array $data): static 43 + { 44 + return new static( 45 + subject: $data['subject'], 46 + createdAt: Carbon::parse($data['createdAt']) 47 + ); 48 + } 49 + 50 + }
+54
src/Generated/App/Bsky/Graph/Defs/ListItemView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.graph.defs.listItemView 12 + * Type: object 13 + * 14 + * @property string $uri 15 + * @property ProfileView $subject 16 + * 17 + * Constraints: 18 + * - Required: uri, subject 19 + * - uri: Format: at-uri 20 + */ 21 + class ListItemView extends Data 22 + { 23 + public function __construct( 24 + public readonly string $uri, 25 + public readonly ProfileView $subject 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'app.bsky.graph.defs.listItemView'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + uri: $data['uri'], 50 + subject: ProfileView::fromArray($data['subject']) 51 + ); 52 + } 53 + 54 + }
+95
src/Generated/App/Bsky/Graph/Defs/ListView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView; 8 + use SocialDept\AtpSchema\Generated\App\Bsky\Richtext\Facet; 9 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\Label; 10 + 11 + /** 12 + * GENERATED CODE - DO NOT EDIT 13 + * 14 + * Lexicon: app.bsky.graph.defs.listView 15 + * Type: object 16 + * 17 + * @property string $uri 18 + * @property string $cid 19 + * @property ProfileView $creator 20 + * @property string $name 21 + * @property mixed $purpose 22 + * @property string|null $description 23 + * @property array<Facet>|null $descriptionFacets 24 + * @property string|null $avatar 25 + * @property int|null $listItemCount 26 + * @property array<Label>|null $labels 27 + * @property mixed $viewer 28 + * @property Carbon $indexedAt 29 + * 30 + * Constraints: 31 + * - Required: uri, cid, creator, name, purpose, indexedAt 32 + * - uri: Format: at-uri 33 + * - cid: Format: cid 34 + * - name: Max length: 64 35 + * - name: Min length: 1 36 + * - description: Max length: 3000 37 + * - description: Max graphemes: 300 38 + * - avatar: Format: uri 39 + * - listItemCount: Minimum: 0 40 + * - indexedAt: Format: datetime 41 + */ 42 + class ListView extends Data 43 + { 44 + public function __construct( 45 + public readonly string $uri, 46 + public readonly string $cid, 47 + public readonly ProfileView $creator, 48 + public readonly string $name, 49 + public readonly mixed $purpose, 50 + public readonly Carbon $indexedAt, 51 + public readonly ?string $description = null, 52 + public readonly ?array $descriptionFacets = null, 53 + public readonly ?string $avatar = null, 54 + public readonly ?int $listItemCount = null, 55 + public readonly ?array $labels = null, 56 + public readonly mixed $viewer = null 57 + ) { 58 + } 59 + 60 + /** 61 + * Get the lexicon NSID for this data type. 62 + * 63 + * @return string 64 + */ 65 + public static function getLexicon(): string 66 + { 67 + return 'app.bsky.graph.defs.listView'; 68 + } 69 + 70 + 71 + /** 72 + * Create an instance from an array. 73 + * 74 + * @param array $data The data array 75 + * @return static 76 + */ 77 + public static function fromArray(array $data): static 78 + { 79 + return new static( 80 + uri: $data['uri'], 81 + cid: $data['cid'], 82 + creator: ProfileView::fromArray($data['creator']), 83 + name: $data['name'], 84 + purpose: $data['purpose'], 85 + indexedAt: Carbon::parse($data['indexedAt']), 86 + description: $data['description'] ?? null, 87 + descriptionFacets: isset($data['descriptionFacets']) ? array_map(fn ($item) => Facet::fromArray($item), $data['descriptionFacets']) : [], 88 + avatar: $data['avatar'] ?? null, 89 + listItemCount: $data['listItemCount'] ?? null, 90 + labels: isset($data['labels']) ? array_map(fn ($item) => Label::fromArray($item), $data['labels']) : [], 91 + viewer: $data['viewer'] ?? null 92 + ); 93 + } 94 + 95 + }
+82
src/Generated/App/Bsky/Graph/Defs/ListViewBasic.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\Label; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: app.bsky.graph.defs.listViewBasic 13 + * Type: object 14 + * 15 + * @property string $uri 16 + * @property string $cid 17 + * @property string $name 18 + * @property mixed $purpose 19 + * @property string|null $avatar 20 + * @property int|null $listItemCount 21 + * @property array<Label>|null $labels 22 + * @property mixed $viewer 23 + * @property Carbon|null $indexedAt 24 + * 25 + * Constraints: 26 + * - Required: uri, cid, name, purpose 27 + * - uri: Format: at-uri 28 + * - cid: Format: cid 29 + * - name: Max length: 64 30 + * - name: Min length: 1 31 + * - avatar: Format: uri 32 + * - listItemCount: Minimum: 0 33 + * - indexedAt: Format: datetime 34 + */ 35 + class ListViewBasic extends Data 36 + { 37 + public function __construct( 38 + public readonly string $uri, 39 + public readonly string $cid, 40 + public readonly string $name, 41 + public readonly mixed $purpose, 42 + public readonly ?string $avatar = null, 43 + public readonly ?int $listItemCount = null, 44 + public readonly ?array $labels = null, 45 + public readonly mixed $viewer = null, 46 + public readonly ?Carbon $indexedAt = null 47 + ) { 48 + } 49 + 50 + /** 51 + * Get the lexicon NSID for this data type. 52 + * 53 + * @return string 54 + */ 55 + public static function getLexicon(): string 56 + { 57 + return 'app.bsky.graph.defs.listViewBasic'; 58 + } 59 + 60 + 61 + /** 62 + * Create an instance from an array. 63 + * 64 + * @param array $data The data array 65 + * @return static 66 + */ 67 + public static function fromArray(array $data): static 68 + { 69 + return new static( 70 + uri: $data['uri'], 71 + cid: $data['cid'], 72 + name: $data['name'], 73 + purpose: $data['purpose'], 74 + avatar: $data['avatar'] ?? null, 75 + listItemCount: $data['listItemCount'] ?? null, 76 + labels: isset($data['labels']) ? array_map(fn ($item) => Label::fromArray($item), $data['labels']) : [], 77 + viewer: $data['viewer'] ?? null, 78 + indexedAt: isset($data['indexedAt']) ? Carbon::parse($data['indexedAt']) : null 79 + ); 80 + } 81 + 82 + }
+52
src/Generated/App/Bsky/Graph/Defs/ListViewerState.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.graph.defs.listViewerState 11 + * Type: object 12 + * 13 + * @property bool|null $muted 14 + * @property string|null $blocked 15 + * 16 + * Constraints: 17 + * - blocked: Format: at-uri 18 + */ 19 + class ListViewerState extends Data 20 + { 21 + public function __construct( 22 + public readonly ?bool $muted = null, 23 + public readonly ?string $blocked = null 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'app.bsky.graph.defs.listViewerState'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + muted: $data['muted'] ?? null, 48 + blocked: $data['blocked'] ?? null 49 + ); 50 + } 51 + 52 + }
+56
src/Generated/App/Bsky/Graph/Defs/NotFoundActor.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * indicates that a handle or DID could not be resolved 11 + * 12 + * Lexicon: app.bsky.graph.defs.notFoundActor 13 + * Type: object 14 + * 15 + * @property string $actor 16 + * @property bool $notFound 17 + * 18 + * Constraints: 19 + * - Required: actor, notFound 20 + * - actor: Format: at-identifier 21 + * - notFound: Const: true 22 + */ 23 + class NotFoundActor extends Data 24 + { 25 + public function __construct( 26 + public readonly string $actor, 27 + public readonly bool $notFound 28 + ) { 29 + } 30 + 31 + /** 32 + * Get the lexicon NSID for this data type. 33 + * 34 + * @return string 35 + */ 36 + public static function getLexicon(): string 37 + { 38 + return 'app.bsky.graph.defs.notFoundActor'; 39 + } 40 + 41 + 42 + /** 43 + * Create an instance from an array. 44 + * 45 + * @param array $data The data array 46 + * @return static 47 + */ 48 + public static function fromArray(array $data): static 49 + { 50 + return new static( 51 + actor: $data['actor'], 52 + notFound: $data['notFound'] 53 + ); 54 + } 55 + 56 + }
+65
src/Generated/App/Bsky/Graph/Defs/Relationship.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * lists the bi-directional graph relationships between one actor (not indicated 11 + * in the object), and the target actors (the DID included in the object) 12 + * 13 + * Lexicon: app.bsky.graph.defs.relationship 14 + * Type: object 15 + * 16 + * @property string $did 17 + * @property string|null $following if the actor follows this DID, this is the AT-URI of the follow record 18 + * @property string|null $followedBy if the actor is followed by this DID, contains the AT-URI of the follow record 19 + * 20 + * Constraints: 21 + * - Required: did 22 + * - did: Format: did 23 + * - following: Format: at-uri 24 + * - followedBy: Format: at-uri 25 + */ 26 + class Relationship extends Data 27 + { 28 + /** 29 + * @param string|null $following if the actor follows this DID, this is the AT-URI of the follow record 30 + * @param string|null $followedBy if the actor is followed by this DID, contains the AT-URI of the follow record 31 + */ 32 + public function __construct( 33 + public readonly string $did, 34 + public readonly ?string $following = null, 35 + public readonly ?string $followedBy = null 36 + ) { 37 + } 38 + 39 + /** 40 + * Get the lexicon NSID for this data type. 41 + * 42 + * @return string 43 + */ 44 + public static function getLexicon(): string 45 + { 46 + return 'app.bsky.graph.defs.relationship'; 47 + } 48 + 49 + 50 + /** 51 + * Create an instance from an array. 52 + * 53 + * @param array $data The data array 54 + * @return static 55 + */ 56 + public static function fromArray(array $data): static 57 + { 58 + return new static( 59 + did: $data['did'], 60 + following: $data['following'] ?? null, 61 + followedBy: $data['followedBy'] ?? null 62 + ); 63 + } 64 + 65 + }
+90
src/Generated/App/Bsky/Graph/Defs/StarterPackView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileViewBasic; 8 + use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs\GeneratorView; 9 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\Label; 10 + 11 + /** 12 + * GENERATED CODE - DO NOT EDIT 13 + * 14 + * Lexicon: app.bsky.graph.defs.starterPackView 15 + * Type: object 16 + * 17 + * @property string $uri 18 + * @property string $cid 19 + * @property mixed $record 20 + * @property ProfileViewBasic $creator 21 + * @property mixed $list 22 + * @property array|null $listItemsSample 23 + * @property array<GeneratorView>|null $feeds 24 + * @property int|null $joinedWeekCount 25 + * @property int|null $joinedAllTimeCount 26 + * @property array<Label>|null $labels 27 + * @property Carbon $indexedAt 28 + * 29 + * Constraints: 30 + * - Required: uri, cid, record, creator, indexedAt 31 + * - uri: Format: at-uri 32 + * - cid: Format: cid 33 + * - listItemsSample: Max length: 12 34 + * - feeds: Max length: 3 35 + * - joinedWeekCount: Minimum: 0 36 + * - joinedAllTimeCount: Minimum: 0 37 + * - indexedAt: Format: datetime 38 + */ 39 + class StarterPackView extends Data 40 + { 41 + public function __construct( 42 + public readonly string $uri, 43 + public readonly string $cid, 44 + public readonly mixed $record, 45 + public readonly ProfileViewBasic $creator, 46 + public readonly Carbon $indexedAt, 47 + public readonly mixed $list = null, 48 + public readonly ?array $listItemsSample = null, 49 + public readonly ?array $feeds = null, 50 + public readonly ?int $joinedWeekCount = null, 51 + public readonly ?int $joinedAllTimeCount = null, 52 + public readonly ?array $labels = null 53 + ) { 54 + } 55 + 56 + /** 57 + * Get the lexicon NSID for this data type. 58 + * 59 + * @return string 60 + */ 61 + public static function getLexicon(): string 62 + { 63 + return 'app.bsky.graph.defs.starterPackView'; 64 + } 65 + 66 + 67 + /** 68 + * Create an instance from an array. 69 + * 70 + * @param array $data The data array 71 + * @return static 72 + */ 73 + public static function fromArray(array $data): static 74 + { 75 + return new static( 76 + uri: $data['uri'], 77 + cid: $data['cid'], 78 + record: $data['record'], 79 + creator: ProfileViewBasic::fromArray($data['creator']), 80 + indexedAt: Carbon::parse($data['indexedAt']), 81 + list: $data['list'] ?? null, 82 + listItemsSample: $data['listItemsSample'] ?? [], 83 + feeds: isset($data['feeds']) ? array_map(fn ($item) => GeneratorView::fromArray($item), $data['feeds']) : [], 84 + joinedWeekCount: $data['joinedWeekCount'] ?? null, 85 + joinedAllTimeCount: $data['joinedAllTimeCount'] ?? null, 86 + labels: isset($data['labels']) ? array_map(fn ($item) => Label::fromArray($item), $data['labels']) : [] 87 + ); 88 + } 89 + 90 + }
+82
src/Generated/App/Bsky/Graph/Defs/StarterPackViewBasic.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileViewBasic; 8 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\Label; 9 + 10 + /** 11 + * GENERATED CODE - DO NOT EDIT 12 + * 13 + * Lexicon: app.bsky.graph.defs.starterPackViewBasic 14 + * Type: object 15 + * 16 + * @property string $uri 17 + * @property string $cid 18 + * @property mixed $record 19 + * @property ProfileViewBasic $creator 20 + * @property int|null $listItemCount 21 + * @property int|null $joinedWeekCount 22 + * @property int|null $joinedAllTimeCount 23 + * @property array<Label>|null $labels 24 + * @property Carbon $indexedAt 25 + * 26 + * Constraints: 27 + * - Required: uri, cid, record, creator, indexedAt 28 + * - uri: Format: at-uri 29 + * - cid: Format: cid 30 + * - listItemCount: Minimum: 0 31 + * - joinedWeekCount: Minimum: 0 32 + * - joinedAllTimeCount: Minimum: 0 33 + * - indexedAt: Format: datetime 34 + */ 35 + class StarterPackViewBasic extends Data 36 + { 37 + public function __construct( 38 + public readonly string $uri, 39 + public readonly string $cid, 40 + public readonly mixed $record, 41 + public readonly ProfileViewBasic $creator, 42 + public readonly Carbon $indexedAt, 43 + public readonly ?int $listItemCount = null, 44 + public readonly ?int $joinedWeekCount = null, 45 + public readonly ?int $joinedAllTimeCount = null, 46 + public readonly ?array $labels = null 47 + ) { 48 + } 49 + 50 + /** 51 + * Get the lexicon NSID for this data type. 52 + * 53 + * @return string 54 + */ 55 + public static function getLexicon(): string 56 + { 57 + return 'app.bsky.graph.defs.starterPackViewBasic'; 58 + } 59 + 60 + 61 + /** 62 + * Create an instance from an array. 63 + * 64 + * @param array $data The data array 65 + * @return static 66 + */ 67 + public static function fromArray(array $data): static 68 + { 69 + return new static( 70 + uri: $data['uri'], 71 + cid: $data['cid'], 72 + record: $data['record'], 73 + creator: ProfileViewBasic::fromArray($data['creator']), 74 + indexedAt: Carbon::parse($data['indexedAt']), 75 + listItemCount: $data['listItemCount'] ?? null, 76 + joinedWeekCount: $data['joinedWeekCount'] ?? null, 77 + joinedAllTimeCount: $data['joinedAllTimeCount'] ?? null, 78 + labels: isset($data['labels']) ? array_map(fn ($item) => Label::fromArray($item), $data['labels']) : [] 79 + ); 80 + } 81 + 82 + }
+50
src/Generated/App/Bsky/Graph/Follow.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Graph; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\Com\Atproto\Repo\StrongRef; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: app.bsky.graph.follow 13 + * Type: record 14 + */ 15 + class Follow extends Data 16 + { 17 + public function __construct( 18 + public readonly string $subject, 19 + public readonly Carbon $createdAt, 20 + public readonly ?StrongRef $via = null 21 + ) { 22 + } 23 + 24 + /** 25 + * Get the lexicon NSID for this data type. 26 + * 27 + * @return string 28 + */ 29 + public static function getLexicon(): string 30 + { 31 + return 'app.bsky.graph.follow'; 32 + } 33 + 34 + 35 + /** 36 + * Create an instance from an array. 37 + * 38 + * @param array $data The data array 39 + * @return static 40 + */ 41 + public static function fromArray(array $data): static 42 + { 43 + return new static( 44 + subject: $data['subject'], 45 + createdAt: Carbon::parse($data['createdAt']), 46 + via: isset($data['via']) ? StrongRef::fromArray($data['via']) : null 47 + ); 48 + } 49 + 50 + }
+13
src/Generated/App/Bsky/Graph/ListPurpose.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Graph; 4 + 5 + /** 6 + * GENERATED CODE - DO NOT EDIT 7 + */ 8 + enum ListPurpose: string 9 + { 10 + case Modlist = 'app.bsky.graph.defs#modlist'; 11 + case Curatelist = 'app.bsky.graph.defs#curatelist'; 12 + case Referencelist = 'app.bsky.graph.defs#referencelist'; 13 + }
+65
src/Generated/App/Bsky/Graph/ListRecord.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Graph; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\BlobReference; 7 + use SocialDept\AtpSchema\Data\Data; 8 + use SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs\ListPurpose; 9 + use SocialDept\AtpSchema\Generated\App\Bsky\Richtext\Facet; 10 + use SocialDept\AtpSchema\Support\UnionHelper; 11 + 12 + /** 13 + * GENERATED CODE - DO NOT EDIT 14 + * 15 + * Lexicon: app.bsky.graph.list 16 + * Type: record 17 + */ 18 + class ListRecord extends Data 19 + { 20 + /** 21 + * @param ListPurpose $purpose Defines the purpose of the list (aka, moderation-oriented or curration-oriented) 22 + * @param string $name Display name for list; can not be empty. 23 + */ 24 + public function __construct( 25 + public readonly ListPurpose $purpose, 26 + public readonly string $name, 27 + public readonly Carbon $createdAt, 28 + public readonly ?string $description = null, 29 + public readonly ?array $descriptionFacets = null, 30 + public readonly ?BlobReference $avatar = null, 31 + public readonly mixed $labels = null 32 + ) { 33 + } 34 + 35 + /** 36 + * Get the lexicon NSID for this data type. 37 + * 38 + * @return string 39 + */ 40 + public static function getLexicon(): string 41 + { 42 + return 'app.bsky.graph.list'; 43 + } 44 + 45 + 46 + /** 47 + * Create an instance from an array. 48 + * 49 + * @param array $data The data array 50 + * @return static 51 + */ 52 + public static function fromArray(array $data): static 53 + { 54 + return new static( 55 + purpose: ListPurpose::fromArray($data['purpose']), 56 + name: $data['name'], 57 + createdAt: Carbon::parse($data['createdAt']), 58 + description: $data['description'] ?? null, 59 + descriptionFacets: isset($data['descriptionFacets']) ? array_map(fn ($item) => Facet::fromArray($item), $data['descriptionFacets']) : [], 60 + avatar: $data['avatar'] ?? null, 61 + labels: isset($data['labels']) ? UnionHelper::validateOpenUnion($data['labels']) : null 62 + ); 63 + } 64 + 65 + }
+53
src/Generated/App/Bsky/Graph/Listitem.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Graph; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.graph.listitem 12 + * Type: record 13 + */ 14 + class Listitem extends Data 15 + { 16 + /** 17 + * @param string $subject The account which is included on the list. 18 + * @param string $list Reference (AT-URI) to the list record (app.bsky.graph.list). 19 + */ 20 + public function __construct( 21 + public readonly string $subject, 22 + public readonly string $list, 23 + public readonly Carbon $createdAt 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'app.bsky.graph.listitem'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + subject: $data['subject'], 48 + list: $data['list'], 49 + createdAt: Carbon::parse($data['createdAt']) 50 + ); 51 + } 52 + 53 + }
+58
src/Generated/App/Bsky/Labeler/Defs/LabelerPolicies.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Labeler\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\LabelValue; 7 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\LabelValueDefinition; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: app.bsky.labeler.defs.labelerPolicies 13 + * Type: object 14 + * 15 + * @property array<LabelValue> $labelValues The label values which this labeler publishes. May include global or custom labels. 16 + * @property array<LabelValueDefinition>|null $labelValueDefinitions Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler. 17 + * 18 + * Constraints: 19 + * - Required: labelValues 20 + */ 21 + class LabelerPolicies extends Data 22 + { 23 + /** 24 + * @param array<LabelValue> $labelValues The label values which this labeler publishes. May include global or custom labels. 25 + * @param array<LabelValueDefinition>|null $labelValueDefinitions Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler. 26 + */ 27 + public function __construct( 28 + public readonly array $labelValues, 29 + public readonly ?array $labelValueDefinitions = null 30 + ) { 31 + } 32 + 33 + /** 34 + * Get the lexicon NSID for this data type. 35 + * 36 + * @return string 37 + */ 38 + public static function getLexicon(): string 39 + { 40 + return 'app.bsky.labeler.defs.labelerPolicies'; 41 + } 42 + 43 + 44 + /** 45 + * Create an instance from an array. 46 + * 47 + * @param array $data The data array 48 + * @return static 49 + */ 50 + public static function fromArray(array $data): static 51 + { 52 + return new static( 53 + labelValues: isset($data['labelValues']) ? array_map(fn ($item) => LabelValue::fromArray($item), $data['labelValues']) : [], 54 + labelValueDefinitions: isset($data['labelValueDefinitions']) ? array_map(fn ($item) => LabelValueDefinition::fromArray($item), $data['labelValueDefinitions']) : [] 55 + ); 56 + } 57 + 58 + }
+74
src/Generated/App/Bsky/Labeler/Defs/LabelerView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Labeler\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView; 8 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\Label; 9 + 10 + /** 11 + * GENERATED CODE - DO NOT EDIT 12 + * 13 + * Lexicon: app.bsky.labeler.defs.labelerView 14 + * Type: object 15 + * 16 + * @property string $uri 17 + * @property string $cid 18 + * @property ProfileView $creator 19 + * @property int|null $likeCount 20 + * @property mixed $viewer 21 + * @property Carbon $indexedAt 22 + * @property array<Label>|null $labels 23 + * 24 + * Constraints: 25 + * - Required: uri, cid, creator, indexedAt 26 + * - uri: Format: at-uri 27 + * - cid: Format: cid 28 + * - likeCount: Minimum: 0 29 + * - indexedAt: Format: datetime 30 + */ 31 + class LabelerView extends Data 32 + { 33 + public function __construct( 34 + public readonly string $uri, 35 + public readonly string $cid, 36 + public readonly ProfileView $creator, 37 + public readonly Carbon $indexedAt, 38 + public readonly ?int $likeCount = null, 39 + public readonly mixed $viewer = null, 40 + public readonly ?array $labels = null 41 + ) { 42 + } 43 + 44 + /** 45 + * Get the lexicon NSID for this data type. 46 + * 47 + * @return string 48 + */ 49 + public static function getLexicon(): string 50 + { 51 + return 'app.bsky.labeler.defs.labelerView'; 52 + } 53 + 54 + 55 + /** 56 + * Create an instance from an array. 57 + * 58 + * @param array $data The data array 59 + * @return static 60 + */ 61 + public static function fromArray(array $data): static 62 + { 63 + return new static( 64 + uri: $data['uri'], 65 + cid: $data['cid'], 66 + creator: ProfileView::fromArray($data['creator']), 67 + indexedAt: Carbon::parse($data['indexedAt']), 68 + likeCount: $data['likeCount'] ?? null, 69 + viewer: $data['viewer'] ?? null, 70 + labels: isset($data['labels']) ? array_map(fn ($item) => Label::fromArray($item), $data['labels']) : [] 71 + ); 72 + } 73 + 74 + }
+93
src/Generated/App/Bsky/Labeler/Defs/LabelerViewDetailed.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Labeler\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView; 8 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\Label; 9 + use SocialDept\AtpSchema\Generated\Com\Atproto\Moderation\Defs\ReasonType; 10 + use SocialDept\AtpSchema\Generated\Com\Atproto\Moderation\Defs\SubjectType; 11 + 12 + /** 13 + * GENERATED CODE - DO NOT EDIT 14 + * 15 + * Lexicon: app.bsky.labeler.defs.labelerViewDetailed 16 + * Type: object 17 + * 18 + * @property string $uri 19 + * @property string $cid 20 + * @property ProfileView $creator 21 + * @property LabelerPolicies $policies 22 + * @property int|null $likeCount 23 + * @property mixed $viewer 24 + * @property Carbon $indexedAt 25 + * @property array<Label>|null $labels 26 + * @property array<ReasonType>|null $reasonTypes The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed. 27 + * @property array<SubjectType>|null $subjectTypes The set of subject types (account, record, etc) this service accepts reports on. 28 + * @property array<string>|null $subjectCollections Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type. 29 + * 30 + * Constraints: 31 + * - Required: uri, cid, creator, policies, indexedAt 32 + * - uri: Format: at-uri 33 + * - cid: Format: cid 34 + * - likeCount: Minimum: 0 35 + * - indexedAt: Format: datetime 36 + */ 37 + class LabelerViewDetailed extends Data 38 + { 39 + /** 40 + * @param array<ReasonType>|null $reasonTypes The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed. 41 + * @param array<SubjectType>|null $subjectTypes The set of subject types (account, record, etc) this service accepts reports on. 42 + * @param array<string>|null $subjectCollections Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type. 43 + */ 44 + public function __construct( 45 + public readonly string $uri, 46 + public readonly string $cid, 47 + public readonly ProfileView $creator, 48 + public readonly LabelerPolicies $policies, 49 + public readonly Carbon $indexedAt, 50 + public readonly ?int $likeCount = null, 51 + public readonly mixed $viewer = null, 52 + public readonly ?array $labels = null, 53 + public readonly ?array $reasonTypes = null, 54 + public readonly ?array $subjectTypes = null, 55 + public readonly ?array $subjectCollections = null 56 + ) { 57 + } 58 + 59 + /** 60 + * Get the lexicon NSID for this data type. 61 + * 62 + * @return string 63 + */ 64 + public static function getLexicon(): string 65 + { 66 + return 'app.bsky.labeler.defs.labelerViewDetailed'; 67 + } 68 + 69 + 70 + /** 71 + * Create an instance from an array. 72 + * 73 + * @param array $data The data array 74 + * @return static 75 + */ 76 + public static function fromArray(array $data): static 77 + { 78 + return new static( 79 + uri: $data['uri'], 80 + cid: $data['cid'], 81 + creator: ProfileView::fromArray($data['creator']), 82 + policies: LabelerPolicies::fromArray($data['policies']), 83 + indexedAt: Carbon::parse($data['indexedAt']), 84 + likeCount: $data['likeCount'] ?? null, 85 + viewer: $data['viewer'] ?? null, 86 + labels: isset($data['labels']) ? array_map(fn ($item) => Label::fromArray($item), $data['labels']) : [], 87 + reasonTypes: isset($data['reasonTypes']) ? array_map(fn ($item) => ReasonType::fromArray($item), $data['reasonTypes']) : [], 88 + subjectTypes: isset($data['subjectTypes']) ? array_map(fn ($item) => SubjectType::fromArray($item), $data['subjectTypes']) : [], 89 + subjectCollections: $data['subjectCollections'] ?? null 90 + ); 91 + } 92 + 93 + }
+49
src/Generated/App/Bsky/Labeler/Defs/LabelerViewerState.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Labeler\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.labeler.defs.labelerViewerState 11 + * Type: object 12 + * 13 + * @property string|null $like 14 + * 15 + * Constraints: 16 + * - like: Format: at-uri 17 + */ 18 + class LabelerViewerState extends Data 19 + { 20 + public function __construct( 21 + public readonly ?string $like = null 22 + ) { 23 + } 24 + 25 + /** 26 + * Get the lexicon NSID for this data type. 27 + * 28 + * @return string 29 + */ 30 + public static function getLexicon(): string 31 + { 32 + return 'app.bsky.labeler.defs.labelerViewerState'; 33 + } 34 + 35 + 36 + /** 37 + * Create an instance from an array. 38 + * 39 + * @param array $data The data array 40 + * @return static 41 + */ 42 + public static function fromArray(array $data): static 43 + { 44 + return new static( 45 + like: $data['like'] ?? null 46 + ); 47 + } 48 + 49 + }
+64
src/Generated/App/Bsky/Labeler/Service.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Labeler; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Labeler\Defs\LabelerPolicies; 8 + use SocialDept\AtpSchema\Generated\Com\Atproto\Moderation\Defs\ReasonType; 9 + use SocialDept\AtpSchema\Generated\Com\Atproto\Moderation\Defs\SubjectType; 10 + use SocialDept\AtpSchema\Support\UnionHelper; 11 + 12 + /** 13 + * GENERATED CODE - DO NOT EDIT 14 + * 15 + * Lexicon: app.bsky.labeler.service 16 + * Type: record 17 + */ 18 + class Service extends Data 19 + { 20 + /** 21 + * @param array<ReasonType>|null $reasonTypes The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed. 22 + * @param array<SubjectType>|null $subjectTypes The set of subject types (account, record, etc) this service accepts reports on. 23 + * @param array<string>|null $subjectCollections Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type. 24 + */ 25 + public function __construct( 26 + public readonly LabelerPolicies $policies, 27 + public readonly Carbon $createdAt, 28 + public readonly mixed $labels = null, 29 + public readonly ?array $reasonTypes = null, 30 + public readonly ?array $subjectTypes = null, 31 + public readonly ?array $subjectCollections = null 32 + ) { 33 + } 34 + 35 + /** 36 + * Get the lexicon NSID for this data type. 37 + * 38 + * @return string 39 + */ 40 + public static function getLexicon(): string 41 + { 42 + return 'app.bsky.labeler.service'; 43 + } 44 + 45 + 46 + /** 47 + * Create an instance from an array. 48 + * 49 + * @param array $data The data array 50 + * @return static 51 + */ 52 + public static function fromArray(array $data): static 53 + { 54 + return new static( 55 + policies: LabelerPolicies::fromArray($data['policies']), 56 + createdAt: Carbon::parse($data['createdAt']), 57 + labels: isset($data['labels']) ? UnionHelper::validateOpenUnion($data['labels']) : null, 58 + reasonTypes: isset($data['reasonTypes']) ? array_map(fn ($item) => ReasonType::fromArray($item), $data['reasonTypes']) : [], 59 + subjectTypes: isset($data['subjectTypes']) ? array_map(fn ($item) => SubjectType::fromArray($item), $data['subjectTypes']) : [], 60 + subjectCollections: $data['subjectCollections'] ?? null 61 + ); 62 + } 63 + 64 + }
+52
src/Generated/App/Bsky/Notification/Defs/ActivitySubscription.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Notification\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.notification.defs.activitySubscription 11 + * Type: object 12 + * 13 + * @property bool $post 14 + * @property bool $reply 15 + * 16 + * Constraints: 17 + * - Required: post, reply 18 + */ 19 + class ActivitySubscription extends Data 20 + { 21 + public function __construct( 22 + public readonly bool $post, 23 + public readonly bool $reply 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'app.bsky.notification.defs.activitySubscription'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + post: $data['post'], 48 + reply: $data['reply'] 49 + ); 50 + } 51 + 52 + }
+52
src/Generated/App/Bsky/Notification/Defs/ChatPreference.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Notification\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.notification.defs.chatPreference 11 + * Type: object 12 + * 13 + * @property string $include 14 + * @property bool $push 15 + * 16 + * Constraints: 17 + * - Required: include, push 18 + */ 19 + class ChatPreference extends Data 20 + { 21 + public function __construct( 22 + public readonly string $include, 23 + public readonly bool $push 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'app.bsky.notification.defs.chatPreference'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + include: $data['include'], 48 + push: $data['push'] 49 + ); 50 + } 51 + 52 + }
+55
src/Generated/App/Bsky/Notification/Defs/FilterablePreference.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Notification\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.notification.defs.filterablePreference 11 + * Type: object 12 + * 13 + * @property string $include 14 + * @property bool $list 15 + * @property bool $push 16 + * 17 + * Constraints: 18 + * - Required: include, list, push 19 + */ 20 + class FilterablePreference extends Data 21 + { 22 + public function __construct( 23 + public readonly string $include, 24 + public readonly bool $list, 25 + public readonly bool $push 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'app.bsky.notification.defs.filterablePreference'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + include: $data['include'], 50 + list: $data['list'], 51 + push: $data['push'] 52 + ); 53 + } 54 + 55 + }
+52
src/Generated/App/Bsky/Notification/Defs/Preference.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Notification\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.notification.defs.preference 11 + * Type: object 12 + * 13 + * @property bool $list 14 + * @property bool $push 15 + * 16 + * Constraints: 17 + * - Required: list, push 18 + */ 19 + class Preference extends Data 20 + { 21 + public function __construct( 22 + public readonly bool $list, 23 + public readonly bool $push 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'app.bsky.notification.defs.preference'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + list: $data['list'], 48 + push: $data['push'] 49 + ); 50 + } 51 + 52 + }
+85
src/Generated/App/Bsky/Notification/Defs/Preferences.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Notification\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.notification.defs.preferences 11 + * Type: object 12 + * 13 + * @property mixed $chat 14 + * @property mixed $follow 15 + * @property mixed $like 16 + * @property mixed $likeViaRepost 17 + * @property mixed $mention 18 + * @property mixed $quote 19 + * @property mixed $reply 20 + * @property mixed $repost 21 + * @property mixed $repostViaRepost 22 + * @property mixed $starterpackJoined 23 + * @property mixed $subscribedPost 24 + * @property mixed $unverified 25 + * @property mixed $verified 26 + * 27 + * Constraints: 28 + * - Required: chat, follow, like, likeViaRepost, mention, quote, reply, repost, repostViaRepost, starterpackJoined, subscribedPost, unverified, verified 29 + */ 30 + class Preferences extends Data 31 + { 32 + public function __construct( 33 + public readonly mixed $chat, 34 + public readonly mixed $follow, 35 + public readonly mixed $like, 36 + public readonly mixed $likeViaRepost, 37 + public readonly mixed $mention, 38 + public readonly mixed $quote, 39 + public readonly mixed $reply, 40 + public readonly mixed $repost, 41 + public readonly mixed $repostViaRepost, 42 + public readonly mixed $starterpackJoined, 43 + public readonly mixed $subscribedPost, 44 + public readonly mixed $unverified, 45 + public readonly mixed $verified 46 + ) { 47 + } 48 + 49 + /** 50 + * Get the lexicon NSID for this data type. 51 + * 52 + * @return string 53 + */ 54 + public static function getLexicon(): string 55 + { 56 + return 'app.bsky.notification.defs.preferences'; 57 + } 58 + 59 + 60 + /** 61 + * Create an instance from an array. 62 + * 63 + * @param array $data The data array 64 + * @return static 65 + */ 66 + public static function fromArray(array $data): static 67 + { 68 + return new static( 69 + chat: $data['chat'], 70 + follow: $data['follow'], 71 + like: $data['like'], 72 + likeViaRepost: $data['likeViaRepost'], 73 + mention: $data['mention'], 74 + quote: $data['quote'], 75 + reply: $data['reply'], 76 + repost: $data['repost'], 77 + repostViaRepost: $data['repostViaRepost'], 78 + starterpackJoined: $data['starterpackJoined'], 79 + subscribedPost: $data['subscribedPost'], 80 + unverified: $data['unverified'], 81 + verified: $data['verified'] 82 + ); 83 + } 84 + 85 + }
+37
src/Generated/App/Bsky/Notification/Defs/RecordDeleted.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Notification\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.notification.defs.recordDeleted 11 + * Type: object 12 + */ 13 + class RecordDeleted extends Data 14 + { 15 + /** 16 + * Get the lexicon NSID for this data type. 17 + * 18 + * @return string 19 + */ 20 + public static function getLexicon(): string 21 + { 22 + return 'app.bsky.notification.defs.recordDeleted'; 23 + } 24 + 25 + 26 + /** 27 + * Create an instance from an array. 28 + * 29 + * @param array $data The data array 30 + * @return static 31 + */ 32 + public static function fromArray(array $data): static 33 + { 34 + return new static(); 35 + } 36 + 37 + }
+55
src/Generated/App/Bsky/Notification/Defs/SubjectActivitySubscription.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Notification\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Object used to store activity subscription data in stash. 11 + * 12 + * Lexicon: app.bsky.notification.defs.subjectActivitySubscription 13 + * Type: object 14 + * 15 + * @property string $subject 16 + * @property mixed $activitySubscription 17 + * 18 + * Constraints: 19 + * - Required: subject, activitySubscription 20 + * - subject: Format: did 21 + */ 22 + class SubjectActivitySubscription extends Data 23 + { 24 + public function __construct( 25 + public readonly string $subject, 26 + public readonly mixed $activitySubscription 27 + ) { 28 + } 29 + 30 + /** 31 + * Get the lexicon NSID for this data type. 32 + * 33 + * @return string 34 + */ 35 + public static function getLexicon(): string 36 + { 37 + return 'app.bsky.notification.defs.subjectActivitySubscription'; 38 + } 39 + 40 + 41 + /** 42 + * Create an instance from an array. 43 + * 44 + * @param array $data The data array 45 + * @return static 46 + */ 47 + public static function fromArray(array $data): static 48 + { 49 + return new static( 50 + subject: $data['subject'], 51 + activitySubscription: $data['activitySubscription'] 52 + ); 53 + } 54 + 55 + }
+83
src/Generated/App/Bsky/Notification/ListNotifications/Notification.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Notification\ListNotifications; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView; 8 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\Label; 9 + 10 + /** 11 + * GENERATED CODE - DO NOT EDIT 12 + * 13 + * Lexicon: app.bsky.notification.listNotifications.notification 14 + * Type: object 15 + * 16 + * @property string $uri 17 + * @property string $cid 18 + * @property ProfileView $author 19 + * @property string $reason The reason why this notification was delivered - e.g. your post was liked, or you received a new follower. 20 + * @property string|null $reasonSubject 21 + * @property mixed $record 22 + * @property bool $isRead 23 + * @property Carbon $indexedAt 24 + * @property array<Label>|null $labels 25 + * 26 + * Constraints: 27 + * - Required: uri, cid, author, reason, record, isRead, indexedAt 28 + * - uri: Format: at-uri 29 + * - cid: Format: cid 30 + * - reasonSubject: Format: at-uri 31 + * - indexedAt: Format: datetime 32 + */ 33 + class Notification extends Data 34 + { 35 + /** 36 + * @param string $reason The reason why this notification was delivered - e.g. your post was liked, or you received a new follower. 37 + */ 38 + public function __construct( 39 + public readonly string $uri, 40 + public readonly string $cid, 41 + public readonly ProfileView $author, 42 + public readonly string $reason, 43 + public readonly mixed $record, 44 + public readonly bool $isRead, 45 + public readonly Carbon $indexedAt, 46 + public readonly ?string $reasonSubject = null, 47 + public readonly ?array $labels = null 48 + ) { 49 + } 50 + 51 + /** 52 + * Get the lexicon NSID for this data type. 53 + * 54 + * @return string 55 + */ 56 + public static function getLexicon(): string 57 + { 58 + return 'app.bsky.notification.listNotifications.notification'; 59 + } 60 + 61 + 62 + /** 63 + * Create an instance from an array. 64 + * 65 + * @param array $data The data array 66 + * @return static 67 + */ 68 + public static function fromArray(array $data): static 69 + { 70 + return new static( 71 + uri: $data['uri'], 72 + cid: $data['cid'], 73 + author: ProfileView::fromArray($data['author']), 74 + reason: $data['reason'], 75 + record: $data['record'], 76 + isRead: $data['isRead'], 77 + indexedAt: Carbon::parse($data['indexedAt']), 78 + reasonSubject: $data['reasonSubject'] ?? null, 79 + labels: isset($data['labels']) ? array_map(fn ($item) => Label::fromArray($item), $data['labels']) : [] 80 + ); 81 + } 82 + 83 + }
+60
src/Generated/App/Bsky/Richtext/Facet/ByteSlice.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Richtext\Facet; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Specifies the sub-string range a facet feature applies to. Start index is 11 + * inclusive, end index is exclusive. Indices are zero-indexed, counting bytes 12 + * of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 13 + * or Unicode codepoints for string slice indexing; in these languages, convert 14 + * to byte arrays before working with facets. 15 + * 16 + * Lexicon: app.bsky.richtext.facet.byteSlice 17 + * Type: object 18 + * 19 + * @property int $byteStart 20 + * @property int $byteEnd 21 + * 22 + * Constraints: 23 + * - Required: byteStart, byteEnd 24 + * - byteStart: Minimum: 0 25 + * - byteEnd: Minimum: 0 26 + */ 27 + class ByteSlice extends Data 28 + { 29 + public function __construct( 30 + public readonly int $byteStart, 31 + public readonly int $byteEnd 32 + ) { 33 + } 34 + 35 + /** 36 + * Get the lexicon NSID for this data type. 37 + * 38 + * @return string 39 + */ 40 + public static function getLexicon(): string 41 + { 42 + return 'app.bsky.richtext.facet.byteSlice'; 43 + } 44 + 45 + 46 + /** 47 + * Create an instance from an array. 48 + * 49 + * @param array $data The data array 50 + * @return static 51 + */ 52 + public static function fromArray(array $data): static 53 + { 54 + return new static( 55 + byteStart: $data['byteStart'], 56 + byteEnd: $data['byteEnd'] 57 + ); 58 + } 59 + 60 + }
+53
src/Generated/App/Bsky/Richtext/Facet/Link.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Richtext\Facet; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Facet feature for a URL. The text URL may have been simplified or truncated, 11 + * but the facet reference should be a complete URL. 12 + * 13 + * Lexicon: app.bsky.richtext.facet.link 14 + * Type: object 15 + * 16 + * @property string $uri 17 + * 18 + * Constraints: 19 + * - Required: uri 20 + * - uri: Format: uri 21 + */ 22 + class Link extends Data 23 + { 24 + public function __construct( 25 + public readonly string $uri 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'app.bsky.richtext.facet.link'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + uri: $data['uri'] 50 + ); 51 + } 52 + 53 + }
+53
src/Generated/App/Bsky/Richtext/Facet/Mention.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Richtext\Facet; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Facet feature for mention of another account. The text is usually a handle, 11 + * including a '@' prefix, but the facet reference is a DID. 12 + * 13 + * Lexicon: app.bsky.richtext.facet.mention 14 + * Type: object 15 + * 16 + * @property string $did 17 + * 18 + * Constraints: 19 + * - Required: did 20 + * - did: Format: did 21 + */ 22 + class Mention extends Data 23 + { 24 + public function __construct( 25 + public readonly string $did 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'app.bsky.richtext.facet.mention'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + did: $data['did'] 50 + ); 51 + } 52 + 53 + }
+54
src/Generated/App/Bsky/Richtext/Facet/Tag.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Richtext\Facet; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Facet feature for a hashtag. The text usually includes a '#' prefix, but the 11 + * facet reference should not (except in the case of 'double hash tags'). 12 + * 13 + * Lexicon: app.bsky.richtext.facet.tag 14 + * Type: object 15 + * 16 + * @property string $tag 17 + * 18 + * Constraints: 19 + * - Required: tag 20 + * - tag: Max length: 640 21 + * - tag: Max graphemes: 64 22 + */ 23 + class Tag extends Data 24 + { 25 + public function __construct( 26 + public readonly string $tag 27 + ) { 28 + } 29 + 30 + /** 31 + * Get the lexicon NSID for this data type. 32 + * 33 + * @return string 34 + */ 35 + public static function getLexicon(): string 36 + { 37 + return 'app.bsky.richtext.facet.tag'; 38 + } 39 + 40 + 41 + /** 42 + * Create an instance from an array. 43 + * 44 + * @param array $data The data array 45 + * @return static 46 + */ 47 + public static function fromArray(array $data): static 48 + { 49 + return new static( 50 + tag: $data['tag'] 51 + ); 52 + } 53 + 54 + }
+52
src/Generated/App/Bsky/Richtext/Facet.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Richtext; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.richtext.facet 11 + * Type: object 12 + * 13 + * @property ByteSlice $index 14 + * @property array $features 15 + * 16 + * Constraints: 17 + * - Required: index, features 18 + */ 19 + class Facet extends Data 20 + { 21 + public function __construct( 22 + public readonly ByteSlice $index, 23 + public readonly array $features 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'app.bsky.richtext.facet'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + index: $data['index'], 48 + features: $data['features'] 49 + ); 50 + } 51 + 52 + }
+84
src/Generated/App/Bsky/Unspecced/Defs/AgeAssuranceEvent.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Unspecced\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Object used to store age assurance data in stash. 12 + * 13 + * Lexicon: app.bsky.unspecced.defs.ageAssuranceEvent 14 + * Type: object 15 + * 16 + * @property Carbon $createdAt The date and time of this write operation. 17 + * @property string $status The status of the age assurance process. 18 + * @property string $attemptId The unique identifier for this instance of the age assurance flow, in UUID format. 19 + * @property string|null $email The email used for AA. 20 + * @property string|null $initIp The IP address used when initiating the AA flow. 21 + * @property string|null $initUa The user agent used when initiating the AA flow. 22 + * @property string|null $completeIp The IP address used when completing the AA flow. 23 + * @property string|null $completeUa The user agent used when completing the AA flow. 24 + * 25 + * Constraints: 26 + * - Required: createdAt, status, attemptId 27 + * - createdAt: Format: datetime 28 + */ 29 + class AgeAssuranceEvent extends Data 30 + { 31 + /** 32 + * @param Carbon $createdAt The date and time of this write operation. 33 + * @param string $status The status of the age assurance process. 34 + * @param string $attemptId The unique identifier for this instance of the age assurance flow, in UUID format. 35 + * @param string|null $email The email used for AA. 36 + * @param string|null $initIp The IP address used when initiating the AA flow. 37 + * @param string|null $initUa The user agent used when initiating the AA flow. 38 + * @param string|null $completeIp The IP address used when completing the AA flow. 39 + * @param string|null $completeUa The user agent used when completing the AA flow. 40 + */ 41 + public function __construct( 42 + public readonly Carbon $createdAt, 43 + public readonly string $status, 44 + public readonly string $attemptId, 45 + public readonly ?string $email = null, 46 + public readonly ?string $initIp = null, 47 + public readonly ?string $initUa = null, 48 + public readonly ?string $completeIp = null, 49 + public readonly ?string $completeUa = null 50 + ) { 51 + } 52 + 53 + /** 54 + * Get the lexicon NSID for this data type. 55 + * 56 + * @return string 57 + */ 58 + public static function getLexicon(): string 59 + { 60 + return 'app.bsky.unspecced.defs.ageAssuranceEvent'; 61 + } 62 + 63 + 64 + /** 65 + * Create an instance from an array. 66 + * 67 + * @param array $data The data array 68 + * @return static 69 + */ 70 + public static function fromArray(array $data): static 71 + { 72 + return new static( 73 + createdAt: Carbon::parse($data['createdAt']), 74 + status: $data['status'], 75 + attemptId: $data['attemptId'], 76 + email: $data['email'] ?? null, 77 + initIp: $data['initIp'] ?? null, 78 + initUa: $data['initUa'] ?? null, 79 + completeIp: $data['completeIp'] ?? null, 80 + completeUa: $data['completeUa'] ?? null 81 + ); 82 + } 83 + 84 + }
+61
src/Generated/App/Bsky/Unspecced/Defs/AgeAssuranceState.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Unspecced\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * The computed state of the age assurance process, returned to the user in 12 + * question on certain authenticated requests. 13 + * 14 + * Lexicon: app.bsky.unspecced.defs.ageAssuranceState 15 + * Type: object 16 + * 17 + * @property Carbon|null $lastInitiatedAt The timestamp when this state was last updated. 18 + * @property string $status The status of the age assurance process. 19 + * 20 + * Constraints: 21 + * - Required: status 22 + * - lastInitiatedAt: Format: datetime 23 + */ 24 + class AgeAssuranceState extends Data 25 + { 26 + /** 27 + * @param string $status The status of the age assurance process. 28 + * @param Carbon|null $lastInitiatedAt The timestamp when this state was last updated. 29 + */ 30 + public function __construct( 31 + public readonly string $status, 32 + public readonly ?Carbon $lastInitiatedAt = null 33 + ) { 34 + } 35 + 36 + /** 37 + * Get the lexicon NSID for this data type. 38 + * 39 + * @return string 40 + */ 41 + public static function getLexicon(): string 42 + { 43 + return 'app.bsky.unspecced.defs.ageAssuranceState'; 44 + } 45 + 46 + 47 + /** 48 + * Create an instance from an array. 49 + * 50 + * @param array $data The data array 51 + * @return static 52 + */ 53 + public static function fromArray(array $data): static 54 + { 55 + return new static( 56 + status: $data['status'], 57 + lastInitiatedAt: isset($data['lastInitiatedAt']) ? Carbon::parse($data['lastInitiatedAt']) : null 58 + ); 59 + } 60 + 61 + }
+50
src/Generated/App/Bsky/Unspecced/Defs/SkeletonSearchActor.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Unspecced\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.unspecced.defs.skeletonSearchActor 11 + * Type: object 12 + * 13 + * @property string $did 14 + * 15 + * Constraints: 16 + * - Required: did 17 + * - did: Format: did 18 + */ 19 + class SkeletonSearchActor extends Data 20 + { 21 + public function __construct( 22 + public readonly string $did 23 + ) { 24 + } 25 + 26 + /** 27 + * Get the lexicon NSID for this data type. 28 + * 29 + * @return string 30 + */ 31 + public static function getLexicon(): string 32 + { 33 + return 'app.bsky.unspecced.defs.skeletonSearchActor'; 34 + } 35 + 36 + 37 + /** 38 + * Create an instance from an array. 39 + * 40 + * @param array $data The data array 41 + * @return static 42 + */ 43 + public static function fromArray(array $data): static 44 + { 45 + return new static( 46 + did: $data['did'] 47 + ); 48 + } 49 + 50 + }
+50
src/Generated/App/Bsky/Unspecced/Defs/SkeletonSearchPost.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Unspecced\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.unspecced.defs.skeletonSearchPost 11 + * Type: object 12 + * 13 + * @property string $uri 14 + * 15 + * Constraints: 16 + * - Required: uri 17 + * - uri: Format: at-uri 18 + */ 19 + class SkeletonSearchPost extends Data 20 + { 21 + public function __construct( 22 + public readonly string $uri 23 + ) { 24 + } 25 + 26 + /** 27 + * Get the lexicon NSID for this data type. 28 + * 29 + * @return string 30 + */ 31 + public static function getLexicon(): string 32 + { 33 + return 'app.bsky.unspecced.defs.skeletonSearchPost'; 34 + } 35 + 36 + 37 + /** 38 + * Create an instance from an array. 39 + * 40 + * @param array $data The data array 41 + * @return static 42 + */ 43 + public static function fromArray(array $data): static 44 + { 45 + return new static( 46 + uri: $data['uri'] 47 + ); 48 + } 49 + 50 + }
+50
src/Generated/App/Bsky/Unspecced/Defs/SkeletonSearchStarterPack.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Unspecced\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.unspecced.defs.skeletonSearchStarterPack 11 + * Type: object 12 + * 13 + * @property string $uri 14 + * 15 + * Constraints: 16 + * - Required: uri 17 + * - uri: Format: at-uri 18 + */ 19 + class SkeletonSearchStarterPack extends Data 20 + { 21 + public function __construct( 22 + public readonly string $uri 23 + ) { 24 + } 25 + 26 + /** 27 + * Get the lexicon NSID for this data type. 28 + * 29 + * @return string 30 + */ 31 + public static function getLexicon(): string 32 + { 33 + return 'app.bsky.unspecced.defs.skeletonSearchStarterPack'; 34 + } 35 + 36 + 37 + /** 38 + * Create an instance from an array. 39 + * 40 + * @param array $data The data array 41 + * @return static 42 + */ 43 + public static function fromArray(array $data): static 44 + { 45 + return new static( 46 + uri: $data['uri'] 47 + ); 48 + } 49 + 50 + }
+72
src/Generated/App/Bsky/Unspecced/Defs/SkeletonTrend.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Unspecced\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.unspecced.defs.skeletonTrend 12 + * Type: object 13 + * 14 + * @property string $topic 15 + * @property string $displayName 16 + * @property string $link 17 + * @property Carbon $startedAt 18 + * @property int $postCount 19 + * @property string|null $status 20 + * @property string|null $category 21 + * @property array<string> $dids 22 + * 23 + * Constraints: 24 + * - Required: topic, displayName, link, startedAt, postCount, dids 25 + * - startedAt: Format: datetime 26 + */ 27 + class SkeletonTrend extends Data 28 + { 29 + public function __construct( 30 + public readonly string $topic, 31 + public readonly string $displayName, 32 + public readonly string $link, 33 + public readonly Carbon $startedAt, 34 + public readonly int $postCount, 35 + public readonly array $dids, 36 + public readonly ?string $status = null, 37 + public readonly ?string $category = null 38 + ) { 39 + } 40 + 41 + /** 42 + * Get the lexicon NSID for this data type. 43 + * 44 + * @return string 45 + */ 46 + public static function getLexicon(): string 47 + { 48 + return 'app.bsky.unspecced.defs.skeletonTrend'; 49 + } 50 + 51 + 52 + /** 53 + * Create an instance from an array. 54 + * 55 + * @param array $data The data array 56 + * @return static 57 + */ 58 + public static function fromArray(array $data): static 59 + { 60 + return new static( 61 + topic: $data['topic'], 62 + displayName: $data['displayName'], 63 + link: $data['link'], 64 + startedAt: Carbon::parse($data['startedAt']), 65 + postCount: $data['postCount'], 66 + dids: $data['dids'], 67 + status: $data['status'] ?? null, 68 + category: $data['category'] ?? null 69 + ); 70 + } 71 + 72 + }
+50
src/Generated/App/Bsky/Unspecced/Defs/ThreadItemBlocked.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Unspecced\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs\BlockedAuthor; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.unspecced.defs.threadItemBlocked 12 + * Type: object 13 + * 14 + * @property BlockedAuthor $author 15 + * 16 + * Constraints: 17 + * - Required: author 18 + */ 19 + class ThreadItemBlocked extends Data 20 + { 21 + public function __construct( 22 + public readonly BlockedAuthor $author 23 + ) { 24 + } 25 + 26 + /** 27 + * Get the lexicon NSID for this data type. 28 + * 29 + * @return string 30 + */ 31 + public static function getLexicon(): string 32 + { 33 + return 'app.bsky.unspecced.defs.threadItemBlocked'; 34 + } 35 + 36 + 37 + /** 38 + * Create an instance from an array. 39 + * 40 + * @param array $data The data array 41 + * @return static 42 + */ 43 + public static function fromArray(array $data): static 44 + { 45 + return new static( 46 + author: BlockedAuthor::fromArray($data['author']) 47 + ); 48 + } 49 + 50 + }
+37
src/Generated/App/Bsky/Unspecced/Defs/ThreadItemNoUnauthenticated.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Unspecced\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.unspecced.defs.threadItemNoUnauthenticated 11 + * Type: object 12 + */ 13 + class ThreadItemNoUnauthenticated extends Data 14 + { 15 + /** 16 + * Get the lexicon NSID for this data type. 17 + * 18 + * @return string 19 + */ 20 + public static function getLexicon(): string 21 + { 22 + return 'app.bsky.unspecced.defs.threadItemNoUnauthenticated'; 23 + } 24 + 25 + 26 + /** 27 + * Create an instance from an array. 28 + * 29 + * @param array $data The data array 30 + * @return static 31 + */ 32 + public static function fromArray(array $data): static 33 + { 34 + return new static(); 35 + } 36 + 37 + }
+37
src/Generated/App/Bsky/Unspecced/Defs/ThreadItemNotFound.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Unspecced\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.unspecced.defs.threadItemNotFound 11 + * Type: object 12 + */ 13 + class ThreadItemNotFound extends Data 14 + { 15 + /** 16 + * Get the lexicon NSID for this data type. 17 + * 18 + * @return string 19 + */ 20 + public static function getLexicon(): string 21 + { 22 + return 'app.bsky.unspecced.defs.threadItemNotFound'; 23 + } 24 + 25 + 26 + /** 27 + * Create an instance from an array. 28 + * 29 + * @param array $data The data array 30 + * @return static 31 + */ 32 + public static function fromArray(array $data): static 33 + { 34 + return new static(); 35 + } 36 + 37 + }
+72
src/Generated/App/Bsky/Unspecced/Defs/ThreadItemPost.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Unspecced\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs\PostView; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.unspecced.defs.threadItemPost 12 + * Type: object 13 + * 14 + * @property PostView $post 15 + * @property bool $moreParents This post has more parents that were not present in the response. This is just a boolean, without the number of parents. 16 + * @property int $moreReplies This post has more replies that were not present in the response. This is a numeric value, which is best-effort and might not be accurate. 17 + * @property bool $opThread This post is part of a contiguous thread by the OP from the thread root. Many different OP threads can happen in the same thread. 18 + * @property bool $hiddenByThreadgate The threadgate created by the author indicates this post as a reply to be hidden for everyone consuming the thread. 19 + * @property bool $mutedByViewer This is by an account muted by the viewer requesting it. 20 + * 21 + * Constraints: 22 + * - Required: post, moreParents, moreReplies, opThread, hiddenByThreadgate, mutedByViewer 23 + */ 24 + class ThreadItemPost extends Data 25 + { 26 + /** 27 + * @param bool $moreParents This post has more parents that were not present in the response. This is just a boolean, without the number of parents. 28 + * @param int $moreReplies This post has more replies that were not present in the response. This is a numeric value, which is best-effort and might not be accurate. 29 + * @param bool $opThread This post is part of a contiguous thread by the OP from the thread root. Many different OP threads can happen in the same thread. 30 + * @param bool $hiddenByThreadgate The threadgate created by the author indicates this post as a reply to be hidden for everyone consuming the thread. 31 + * @param bool $mutedByViewer This is by an account muted by the viewer requesting it. 32 + */ 33 + public function __construct( 34 + public readonly PostView $post, 35 + public readonly bool $moreParents, 36 + public readonly int $moreReplies, 37 + public readonly bool $opThread, 38 + public readonly bool $hiddenByThreadgate, 39 + public readonly bool $mutedByViewer 40 + ) { 41 + } 42 + 43 + /** 44 + * Get the lexicon NSID for this data type. 45 + * 46 + * @return string 47 + */ 48 + public static function getLexicon(): string 49 + { 50 + return 'app.bsky.unspecced.defs.threadItemPost'; 51 + } 52 + 53 + 54 + /** 55 + * Create an instance from an array. 56 + * 57 + * @param array $data The data array 58 + * @return static 59 + */ 60 + public static function fromArray(array $data): static 61 + { 62 + return new static( 63 + post: PostView::fromArray($data['post']), 64 + moreParents: $data['moreParents'], 65 + moreReplies: $data['moreReplies'], 66 + opThread: $data['opThread'], 67 + hiddenByThreadgate: $data['hiddenByThreadgate'], 68 + mutedByViewer: $data['mutedByViewer'] 69 + ); 70 + } 71 + 72 + }
+73
src/Generated/App/Bsky/Unspecced/Defs/TrendView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Unspecced\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileViewBasic; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: app.bsky.unspecced.defs.trendView 13 + * Type: object 14 + * 15 + * @property string $topic 16 + * @property string $displayName 17 + * @property string $link 18 + * @property Carbon $startedAt 19 + * @property int $postCount 20 + * @property string|null $status 21 + * @property string|null $category 22 + * @property array<ProfileViewBasic> $actors 23 + * 24 + * Constraints: 25 + * - Required: topic, displayName, link, startedAt, postCount, actors 26 + * - startedAt: Format: datetime 27 + */ 28 + class TrendView extends Data 29 + { 30 + public function __construct( 31 + public readonly string $topic, 32 + public readonly string $displayName, 33 + public readonly string $link, 34 + public readonly Carbon $startedAt, 35 + public readonly int $postCount, 36 + public readonly array $actors, 37 + public readonly ?string $status = null, 38 + public readonly ?string $category = null 39 + ) { 40 + } 41 + 42 + /** 43 + * Get the lexicon NSID for this data type. 44 + * 45 + * @return string 46 + */ 47 + public static function getLexicon(): string 48 + { 49 + return 'app.bsky.unspecced.defs.trendView'; 50 + } 51 + 52 + 53 + /** 54 + * Create an instance from an array. 55 + * 56 + * @param array $data The data array 57 + * @return static 58 + */ 59 + public static function fromArray(array $data): static 60 + { 61 + return new static( 62 + topic: $data['topic'], 63 + displayName: $data['displayName'], 64 + link: $data['link'], 65 + startedAt: Carbon::parse($data['startedAt']), 66 + postCount: $data['postCount'], 67 + actors: isset($data['actors']) ? array_map(fn ($item) => ProfileViewBasic::fromArray($item), $data['actors']) : [], 68 + status: $data['status'] ?? null, 69 + category: $data['category'] ?? null 70 + ); 71 + } 72 + 73 + }
+58
src/Generated/App/Bsky/Unspecced/Defs/TrendingTopic.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Unspecced\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: app.bsky.unspecced.defs.trendingTopic 11 + * Type: object 12 + * 13 + * @property string $topic 14 + * @property string|null $displayName 15 + * @property string|null $description 16 + * @property string $link 17 + * 18 + * Constraints: 19 + * - Required: topic, link 20 + */ 21 + class TrendingTopic extends Data 22 + { 23 + public function __construct( 24 + public readonly string $topic, 25 + public readonly string $link, 26 + public readonly ?string $displayName = null, 27 + public readonly ?string $description = null 28 + ) { 29 + } 30 + 31 + /** 32 + * Get the lexicon NSID for this data type. 33 + * 34 + * @return string 35 + */ 36 + public static function getLexicon(): string 37 + { 38 + return 'app.bsky.unspecced.defs.trendingTopic'; 39 + } 40 + 41 + 42 + /** 43 + * Create an instance from an array. 44 + * 45 + * @param array $data The data array 46 + * @return static 47 + */ 48 + public static function fromArray(array $data): static 49 + { 50 + return new static( 51 + topic: $data['topic'], 52 + link: $data['link'], 53 + displayName: $data['displayName'] ?? null, 54 + description: $data['description'] ?? null 55 + ); 56 + } 57 + 58 + }
+75
src/Generated/App/Bsky/Video/Defs/JobStatus.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\App\Bsky\Video\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\BlobReference; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: app.bsky.video.defs.jobStatus 12 + * Type: object 13 + * 14 + * @property string $jobId 15 + * @property string $did 16 + * @property string $state The state of the video processing job. All values not listed as a known value indicate that the job is in process. 17 + * @property int|null $progress Progress within the current processing state. 18 + * @property BlobReference|null $blob 19 + * @property string|null $error 20 + * @property string|null $message 21 + * 22 + * Constraints: 23 + * - Required: jobId, did, state 24 + * - did: Format: did 25 + * - progress: Maximum: 100 26 + * - progress: Minimum: 0 27 + */ 28 + class JobStatus extends Data 29 + { 30 + /** 31 + * @param string $state The state of the video processing job. All values not listed as a known value indicate that the job is in process. 32 + * @param int|null $progress Progress within the current processing state. 33 + */ 34 + public function __construct( 35 + public readonly string $jobId, 36 + public readonly string $did, 37 + public readonly string $state, 38 + public readonly ?int $progress = null, 39 + public readonly ?BlobReference $blob = null, 40 + public readonly ?string $error = null, 41 + public readonly ?string $message = null 42 + ) { 43 + } 44 + 45 + /** 46 + * Get the lexicon NSID for this data type. 47 + * 48 + * @return string 49 + */ 50 + public static function getLexicon(): string 51 + { 52 + return 'app.bsky.video.defs.jobStatus'; 53 + } 54 + 55 + 56 + /** 57 + * Create an instance from an array. 58 + * 59 + * @param array $data The data array 60 + * @return static 61 + */ 62 + public static function fromArray(array $data): static 63 + { 64 + return new static( 65 + jobId: $data['jobId'], 66 + did: $data['did'], 67 + state: $data['state'], 68 + progress: $data['progress'] ?? null, 69 + blob: $data['blob'] ?? null, 70 + error: $data['error'] ?? null, 71 + message: $data['message'] ?? null 72 + ); 73 + } 74 + 75 + }
+72
src/Generated/Chat/Bsky/Convo/Defs/ConvoView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileViewBasic; 7 + use SocialDept\AtpSchema\Support\UnionHelper; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: chat.bsky.convo.defs.convoView 13 + * Type: object 14 + * 15 + * @property string $id 16 + * @property string $rev 17 + * @property array<ProfileViewBasic> $members 18 + * @property mixed $lastMessage 19 + * @property mixed $lastReaction 20 + * @property bool $muted 21 + * @property string|null $status 22 + * @property int $unreadCount 23 + * 24 + * Constraints: 25 + * - Required: id, rev, members, muted, unreadCount 26 + */ 27 + class ConvoView extends Data 28 + { 29 + public function __construct( 30 + public readonly string $id, 31 + public readonly string $rev, 32 + public readonly array $members, 33 + public readonly bool $muted, 34 + public readonly int $unreadCount, 35 + public readonly mixed $lastMessage = null, 36 + public readonly mixed $lastReaction = null, 37 + public readonly ?string $status = null 38 + ) { 39 + } 40 + 41 + /** 42 + * Get the lexicon NSID for this data type. 43 + * 44 + * @return string 45 + */ 46 + public static function getLexicon(): string 47 + { 48 + return 'chat.bsky.convo.defs.convoView'; 49 + } 50 + 51 + 52 + /** 53 + * Create an instance from an array. 54 + * 55 + * @param array $data The data array 56 + * @return static 57 + */ 58 + public static function fromArray(array $data): static 59 + { 60 + return new static( 61 + id: $data['id'], 62 + rev: $data['rev'], 63 + members: isset($data['members']) ? array_map(fn ($item) => ProfileViewBasic::fromArray($item), $data['members']) : [], 64 + muted: $data['muted'], 65 + unreadCount: $data['unreadCount'], 66 + lastMessage: isset($data['lastMessage']) ? UnionHelper::validateOpenUnion($data['lastMessage']) : null, 67 + lastReaction: isset($data['lastReaction']) ? UnionHelper::validateOpenUnion($data['lastReaction']) : null, 68 + status: $data['status'] ?? null 69 + ); 70 + } 71 + 72 + }
+60
src/Generated/Chat/Bsky/Convo/Defs/DeletedMessageView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: chat.bsky.convo.defs.deletedMessageView 12 + * Type: object 13 + * 14 + * @property string $id 15 + * @property string $rev 16 + * @property mixed $sender 17 + * @property Carbon $sentAt 18 + * 19 + * Constraints: 20 + * - Required: id, rev, sender, sentAt 21 + * - sentAt: Format: datetime 22 + */ 23 + class DeletedMessageView extends Data 24 + { 25 + public function __construct( 26 + public readonly string $id, 27 + public readonly string $rev, 28 + public readonly mixed $sender, 29 + public readonly Carbon $sentAt 30 + ) { 31 + } 32 + 33 + /** 34 + * Get the lexicon NSID for this data type. 35 + * 36 + * @return string 37 + */ 38 + public static function getLexicon(): string 39 + { 40 + return 'chat.bsky.convo.defs.deletedMessageView'; 41 + } 42 + 43 + 44 + /** 45 + * Create an instance from an array. 46 + * 47 + * @param array $data The data array 48 + * @return static 49 + */ 50 + public static function fromArray(array $data): static 51 + { 52 + return new static( 53 + id: $data['id'], 54 + rev: $data['rev'], 55 + sender: $data['sender'], 56 + sentAt: Carbon::parse($data['sentAt']) 57 + ); 58 + } 59 + 60 + }
+52
src/Generated/Chat/Bsky/Convo/Defs/LogAcceptConvo.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: chat.bsky.convo.defs.logAcceptConvo 11 + * Type: object 12 + * 13 + * @property string $rev 14 + * @property string $convoId 15 + * 16 + * Constraints: 17 + * - Required: rev, convoId 18 + */ 19 + class LogAcceptConvo extends Data 20 + { 21 + public function __construct( 22 + public readonly string $rev, 23 + public readonly string $convoId 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'chat.bsky.convo.defs.logAcceptConvo'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + rev: $data['rev'], 48 + convoId: $data['convoId'] 49 + ); 50 + } 51 + 52 + }
+59
src/Generated/Chat/Bsky/Convo/Defs/LogAddReaction.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Support\UnionHelper; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: chat.bsky.convo.defs.logAddReaction 12 + * Type: object 13 + * 14 + * @property string $rev 15 + * @property string $convoId 16 + * @property mixed $message 17 + * @property mixed $reaction 18 + * 19 + * Constraints: 20 + * - Required: rev, convoId, message, reaction 21 + */ 22 + class LogAddReaction extends Data 23 + { 24 + public function __construct( 25 + public readonly string $rev, 26 + public readonly string $convoId, 27 + public readonly mixed $message, 28 + public readonly mixed $reaction 29 + ) { 30 + } 31 + 32 + /** 33 + * Get the lexicon NSID for this data type. 34 + * 35 + * @return string 36 + */ 37 + public static function getLexicon(): string 38 + { 39 + return 'chat.bsky.convo.defs.logAddReaction'; 40 + } 41 + 42 + 43 + /** 44 + * Create an instance from an array. 45 + * 46 + * @param array $data The data array 47 + * @return static 48 + */ 49 + public static function fromArray(array $data): static 50 + { 51 + return new static( 52 + rev: $data['rev'], 53 + convoId: $data['convoId'], 54 + message: UnionHelper::validateOpenUnion($data['message']), 55 + reaction: $data['reaction'] 56 + ); 57 + } 58 + 59 + }
+52
src/Generated/Chat/Bsky/Convo/Defs/LogBeginConvo.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: chat.bsky.convo.defs.logBeginConvo 11 + * Type: object 12 + * 13 + * @property string $rev 14 + * @property string $convoId 15 + * 16 + * Constraints: 17 + * - Required: rev, convoId 18 + */ 19 + class LogBeginConvo extends Data 20 + { 21 + public function __construct( 22 + public readonly string $rev, 23 + public readonly string $convoId 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'chat.bsky.convo.defs.logBeginConvo'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + rev: $data['rev'], 48 + convoId: $data['convoId'] 49 + ); 50 + } 51 + 52 + }
+56
src/Generated/Chat/Bsky/Convo/Defs/LogCreateMessage.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Support\UnionHelper; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: chat.bsky.convo.defs.logCreateMessage 12 + * Type: object 13 + * 14 + * @property string $rev 15 + * @property string $convoId 16 + * @property mixed $message 17 + * 18 + * Constraints: 19 + * - Required: rev, convoId, message 20 + */ 21 + class LogCreateMessage extends Data 22 + { 23 + public function __construct( 24 + public readonly string $rev, 25 + public readonly string $convoId, 26 + public readonly mixed $message 27 + ) { 28 + } 29 + 30 + /** 31 + * Get the lexicon NSID for this data type. 32 + * 33 + * @return string 34 + */ 35 + public static function getLexicon(): string 36 + { 37 + return 'chat.bsky.convo.defs.logCreateMessage'; 38 + } 39 + 40 + 41 + /** 42 + * Create an instance from an array. 43 + * 44 + * @param array $data The data array 45 + * @return static 46 + */ 47 + public static function fromArray(array $data): static 48 + { 49 + return new static( 50 + rev: $data['rev'], 51 + convoId: $data['convoId'], 52 + message: UnionHelper::validateOpenUnion($data['message']) 53 + ); 54 + } 55 + 56 + }
+56
src/Generated/Chat/Bsky/Convo/Defs/LogDeleteMessage.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Support\UnionHelper; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: chat.bsky.convo.defs.logDeleteMessage 12 + * Type: object 13 + * 14 + * @property string $rev 15 + * @property string $convoId 16 + * @property mixed $message 17 + * 18 + * Constraints: 19 + * - Required: rev, convoId, message 20 + */ 21 + class LogDeleteMessage extends Data 22 + { 23 + public function __construct( 24 + public readonly string $rev, 25 + public readonly string $convoId, 26 + public readonly mixed $message 27 + ) { 28 + } 29 + 30 + /** 31 + * Get the lexicon NSID for this data type. 32 + * 33 + * @return string 34 + */ 35 + public static function getLexicon(): string 36 + { 37 + return 'chat.bsky.convo.defs.logDeleteMessage'; 38 + } 39 + 40 + 41 + /** 42 + * Create an instance from an array. 43 + * 44 + * @param array $data The data array 45 + * @return static 46 + */ 47 + public static function fromArray(array $data): static 48 + { 49 + return new static( 50 + rev: $data['rev'], 51 + convoId: $data['convoId'], 52 + message: UnionHelper::validateOpenUnion($data['message']) 53 + ); 54 + } 55 + 56 + }
+52
src/Generated/Chat/Bsky/Convo/Defs/LogLeaveConvo.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: chat.bsky.convo.defs.logLeaveConvo 11 + * Type: object 12 + * 13 + * @property string $rev 14 + * @property string $convoId 15 + * 16 + * Constraints: 17 + * - Required: rev, convoId 18 + */ 19 + class LogLeaveConvo extends Data 20 + { 21 + public function __construct( 22 + public readonly string $rev, 23 + public readonly string $convoId 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'chat.bsky.convo.defs.logLeaveConvo'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + rev: $data['rev'], 48 + convoId: $data['convoId'] 49 + ); 50 + } 51 + 52 + }
+52
src/Generated/Chat/Bsky/Convo/Defs/LogMuteConvo.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: chat.bsky.convo.defs.logMuteConvo 11 + * Type: object 12 + * 13 + * @property string $rev 14 + * @property string $convoId 15 + * 16 + * Constraints: 17 + * - Required: rev, convoId 18 + */ 19 + class LogMuteConvo extends Data 20 + { 21 + public function __construct( 22 + public readonly string $rev, 23 + public readonly string $convoId 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'chat.bsky.convo.defs.logMuteConvo'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + rev: $data['rev'], 48 + convoId: $data['convoId'] 49 + ); 50 + } 51 + 52 + }
+56
src/Generated/Chat/Bsky/Convo/Defs/LogReadMessage.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Support\UnionHelper; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: chat.bsky.convo.defs.logReadMessage 12 + * Type: object 13 + * 14 + * @property string $rev 15 + * @property string $convoId 16 + * @property mixed $message 17 + * 18 + * Constraints: 19 + * - Required: rev, convoId, message 20 + */ 21 + class LogReadMessage extends Data 22 + { 23 + public function __construct( 24 + public readonly string $rev, 25 + public readonly string $convoId, 26 + public readonly mixed $message 27 + ) { 28 + } 29 + 30 + /** 31 + * Get the lexicon NSID for this data type. 32 + * 33 + * @return string 34 + */ 35 + public static function getLexicon(): string 36 + { 37 + return 'chat.bsky.convo.defs.logReadMessage'; 38 + } 39 + 40 + 41 + /** 42 + * Create an instance from an array. 43 + * 44 + * @param array $data The data array 45 + * @return static 46 + */ 47 + public static function fromArray(array $data): static 48 + { 49 + return new static( 50 + rev: $data['rev'], 51 + convoId: $data['convoId'], 52 + message: UnionHelper::validateOpenUnion($data['message']) 53 + ); 54 + } 55 + 56 + }
+59
src/Generated/Chat/Bsky/Convo/Defs/LogRemoveReaction.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Support\UnionHelper; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: chat.bsky.convo.defs.logRemoveReaction 12 + * Type: object 13 + * 14 + * @property string $rev 15 + * @property string $convoId 16 + * @property mixed $message 17 + * @property mixed $reaction 18 + * 19 + * Constraints: 20 + * - Required: rev, convoId, message, reaction 21 + */ 22 + class LogRemoveReaction extends Data 23 + { 24 + public function __construct( 25 + public readonly string $rev, 26 + public readonly string $convoId, 27 + public readonly mixed $message, 28 + public readonly mixed $reaction 29 + ) { 30 + } 31 + 32 + /** 33 + * Get the lexicon NSID for this data type. 34 + * 35 + * @return string 36 + */ 37 + public static function getLexicon(): string 38 + { 39 + return 'chat.bsky.convo.defs.logRemoveReaction'; 40 + } 41 + 42 + 43 + /** 44 + * Create an instance from an array. 45 + * 46 + * @param array $data The data array 47 + * @return static 48 + */ 49 + public static function fromArray(array $data): static 50 + { 51 + return new static( 52 + rev: $data['rev'], 53 + convoId: $data['convoId'], 54 + message: UnionHelper::validateOpenUnion($data['message']), 55 + reaction: $data['reaction'] 56 + ); 57 + } 58 + 59 + }
+52
src/Generated/Chat/Bsky/Convo/Defs/LogUnmuteConvo.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: chat.bsky.convo.defs.logUnmuteConvo 11 + * Type: object 12 + * 13 + * @property string $rev 14 + * @property string $convoId 15 + * 16 + * Constraints: 17 + * - Required: rev, convoId 18 + */ 19 + class LogUnmuteConvo extends Data 20 + { 21 + public function __construct( 22 + public readonly string $rev, 23 + public readonly string $convoId 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'chat.bsky.convo.defs.logUnmuteConvo'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + rev: $data['rev'], 48 + convoId: $data['convoId'] 49 + ); 50 + } 51 + 52 + }
+52
src/Generated/Chat/Bsky/Convo/Defs/MessageAndReactionView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: chat.bsky.convo.defs.messageAndReactionView 11 + * Type: object 12 + * 13 + * @property mixed $message 14 + * @property mixed $reaction 15 + * 16 + * Constraints: 17 + * - Required: message, reaction 18 + */ 19 + class MessageAndReactionView extends Data 20 + { 21 + public function __construct( 22 + public readonly mixed $message, 23 + public readonly mixed $reaction 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'chat.bsky.convo.defs.messageAndReactionView'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + message: $data['message'], 48 + reaction: $data['reaction'] 49 + ); 50 + } 51 + 52 + }
+62
src/Generated/Chat/Bsky/Convo/Defs/MessageInput.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\App\Bsky\Richtext\Facet; 7 + use SocialDept\AtpSchema\Support\UnionHelper; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: chat.bsky.convo.defs.messageInput 13 + * Type: object 14 + * 15 + * @property string $text 16 + * @property array<Facet>|null $facets Annotations of text (mentions, URLs, hashtags, etc) 17 + * @property mixed $embed 18 + * 19 + * Constraints: 20 + * - Required: text 21 + * - text: Max length: 10000 22 + * - text: Max graphemes: 1000 23 + */ 24 + class MessageInput extends Data 25 + { 26 + /** 27 + * @param array<Facet>|null $facets Annotations of text (mentions, URLs, hashtags, etc) 28 + */ 29 + public function __construct( 30 + public readonly string $text, 31 + public readonly ?array $facets = null, 32 + public readonly mixed $embed = null 33 + ) { 34 + } 35 + 36 + /** 37 + * Get the lexicon NSID for this data type. 38 + * 39 + * @return string 40 + */ 41 + public static function getLexicon(): string 42 + { 43 + return 'chat.bsky.convo.defs.messageInput'; 44 + } 45 + 46 + 47 + /** 48 + * Create an instance from an array. 49 + * 50 + * @param array $data The data array 51 + * @return static 52 + */ 53 + public static function fromArray(array $data): static 54 + { 55 + return new static( 56 + text: $data['text'], 57 + facets: isset($data['facets']) ? array_map(fn ($item) => Facet::fromArray($item), $data['facets']) : [], 58 + embed: isset($data['embed']) ? UnionHelper::validateOpenUnion($data['embed']) : null 59 + ); 60 + } 61 + 62 + }
+56
src/Generated/Chat/Bsky/Convo/Defs/MessageRef.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: chat.bsky.convo.defs.messageRef 11 + * Type: object 12 + * 13 + * @property string $did 14 + * @property string $convoId 15 + * @property string $messageId 16 + * 17 + * Constraints: 18 + * - Required: did, messageId, convoId 19 + * - did: Format: did 20 + */ 21 + class MessageRef extends Data 22 + { 23 + public function __construct( 24 + public readonly string $did, 25 + public readonly string $convoId, 26 + public readonly string $messageId 27 + ) { 28 + } 29 + 30 + /** 31 + * Get the lexicon NSID for this data type. 32 + * 33 + * @return string 34 + */ 35 + public static function getLexicon(): string 36 + { 37 + return 'chat.bsky.convo.defs.messageRef'; 38 + } 39 + 40 + 41 + /** 42 + * Create an instance from an array. 43 + * 44 + * @param array $data The data array 45 + * @return static 46 + */ 47 + public static function fromArray(array $data): static 48 + { 49 + return new static( 50 + did: $data['did'], 51 + convoId: $data['convoId'], 52 + messageId: $data['messageId'] 53 + ); 54 + } 55 + 56 + }
+80
src/Generated/Chat/Bsky/Convo/Defs/MessageView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\App\Bsky\Richtext\Facet; 8 + use SocialDept\AtpSchema\Support\UnionHelper; 9 + 10 + /** 11 + * GENERATED CODE - DO NOT EDIT 12 + * 13 + * Lexicon: chat.bsky.convo.defs.messageView 14 + * Type: object 15 + * 16 + * @property string $id 17 + * @property string $rev 18 + * @property string $text 19 + * @property array<Facet>|null $facets Annotations of text (mentions, URLs, hashtags, etc) 20 + * @property mixed $embed 21 + * @property array|null $reactions Reactions to this message, in ascending order of creation time. 22 + * @property mixed $sender 23 + * @property Carbon $sentAt 24 + * 25 + * Constraints: 26 + * - Required: id, rev, text, sender, sentAt 27 + * - text: Max length: 10000 28 + * - text: Max graphemes: 1000 29 + * - sentAt: Format: datetime 30 + */ 31 + class MessageView extends Data 32 + { 33 + /** 34 + * @param array<Facet>|null $facets Annotations of text (mentions, URLs, hashtags, etc) 35 + * @param array|null $reactions Reactions to this message, in ascending order of creation time. 36 + */ 37 + public function __construct( 38 + public readonly string $id, 39 + public readonly string $rev, 40 + public readonly string $text, 41 + public readonly mixed $sender, 42 + public readonly Carbon $sentAt, 43 + public readonly ?array $facets = null, 44 + public readonly mixed $embed = null, 45 + public readonly ?array $reactions = null 46 + ) { 47 + } 48 + 49 + /** 50 + * Get the lexicon NSID for this data type. 51 + * 52 + * @return string 53 + */ 54 + public static function getLexicon(): string 55 + { 56 + return 'chat.bsky.convo.defs.messageView'; 57 + } 58 + 59 + 60 + /** 61 + * Create an instance from an array. 62 + * 63 + * @param array $data The data array 64 + * @return static 65 + */ 66 + public static function fromArray(array $data): static 67 + { 68 + return new static( 69 + id: $data['id'], 70 + rev: $data['rev'], 71 + text: $data['text'], 72 + sender: $data['sender'], 73 + sentAt: Carbon::parse($data['sentAt']), 74 + facets: isset($data['facets']) ? array_map(fn ($item) => Facet::fromArray($item), $data['facets']) : [], 75 + embed: isset($data['embed']) ? UnionHelper::validateOpenUnion($data['embed']) : null, 76 + reactions: $data['reactions'] ?? [] 77 + ); 78 + } 79 + 80 + }
+50
src/Generated/Chat/Bsky/Convo/Defs/MessageViewSender.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: chat.bsky.convo.defs.messageViewSender 11 + * Type: object 12 + * 13 + * @property string $did 14 + * 15 + * Constraints: 16 + * - Required: did 17 + * - did: Format: did 18 + */ 19 + class MessageViewSender extends Data 20 + { 21 + public function __construct( 22 + public readonly string $did 23 + ) { 24 + } 25 + 26 + /** 27 + * Get the lexicon NSID for this data type. 28 + * 29 + * @return string 30 + */ 31 + public static function getLexicon(): string 32 + { 33 + return 'chat.bsky.convo.defs.messageViewSender'; 34 + } 35 + 36 + 37 + /** 38 + * Create an instance from an array. 39 + * 40 + * @param array $data The data array 41 + * @return static 42 + */ 43 + public static function fromArray(array $data): static 44 + { 45 + return new static( 46 + did: $data['did'] 47 + ); 48 + } 49 + 50 + }
+57
src/Generated/Chat/Bsky/Convo/Defs/ReactionView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: chat.bsky.convo.defs.reactionView 12 + * Type: object 13 + * 14 + * @property string $value 15 + * @property mixed $sender 16 + * @property Carbon $createdAt 17 + * 18 + * Constraints: 19 + * - Required: value, sender, createdAt 20 + * - createdAt: Format: datetime 21 + */ 22 + class ReactionView extends Data 23 + { 24 + public function __construct( 25 + public readonly string $value, 26 + public readonly mixed $sender, 27 + public readonly Carbon $createdAt 28 + ) { 29 + } 30 + 31 + /** 32 + * Get the lexicon NSID for this data type. 33 + * 34 + * @return string 35 + */ 36 + public static function getLexicon(): string 37 + { 38 + return 'chat.bsky.convo.defs.reactionView'; 39 + } 40 + 41 + 42 + /** 43 + * Create an instance from an array. 44 + * 45 + * @param array $data The data array 46 + * @return static 47 + */ 48 + public static function fromArray(array $data): static 49 + { 50 + return new static( 51 + value: $data['value'], 52 + sender: $data['sender'], 53 + createdAt: Carbon::parse($data['createdAt']) 54 + ); 55 + } 56 + 57 + }
+50
src/Generated/Chat/Bsky/Convo/Defs/ReactionViewSender.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: chat.bsky.convo.defs.reactionViewSender 11 + * Type: object 12 + * 13 + * @property string $did 14 + * 15 + * Constraints: 16 + * - Required: did 17 + * - did: Format: did 18 + */ 19 + class ReactionViewSender extends Data 20 + { 21 + public function __construct( 22 + public readonly string $did 23 + ) { 24 + } 25 + 26 + /** 27 + * Get the lexicon NSID for this data type. 28 + * 29 + * @return string 30 + */ 31 + public static function getLexicon(): string 32 + { 33 + return 'chat.bsky.convo.defs.reactionViewSender'; 34 + } 35 + 36 + 37 + /** 38 + * Create an instance from an array. 39 + * 40 + * @param array $data The data array 41 + * @return static 42 + */ 43 + public static function fromArray(array $data): static 44 + { 45 + return new static( 46 + did: $data['did'] 47 + ); 48 + } 49 + 50 + }
+89
src/Generated/Com/Atproto/Admin/Defs/AccountView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Admin\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\Com\Atproto\Server\Defs\InviteCode; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: com.atproto.admin.defs.accountView 13 + * Type: object 14 + * 15 + * @property string $did 16 + * @property string $handle 17 + * @property string|null $email 18 + * @property array|null $relatedRecords 19 + * @property Carbon $indexedAt 20 + * @property InviteCode|null $invitedBy 21 + * @property array<InviteCode>|null $invites 22 + * @property bool|null $invitesDisabled 23 + * @property Carbon|null $emailConfirmedAt 24 + * @property string|null $inviteNote 25 + * @property Carbon|null $deactivatedAt 26 + * @property array|null $threatSignatures 27 + * 28 + * Constraints: 29 + * - Required: did, handle, indexedAt 30 + * - did: Format: did 31 + * - handle: Format: handle 32 + * - indexedAt: Format: datetime 33 + * - emailConfirmedAt: Format: datetime 34 + * - deactivatedAt: Format: datetime 35 + */ 36 + class AccountView extends Data 37 + { 38 + public function __construct( 39 + public readonly string $did, 40 + public readonly string $handle, 41 + public readonly Carbon $indexedAt, 42 + public readonly ?string $email = null, 43 + public readonly ?array $relatedRecords = null, 44 + public readonly ?InviteCode $invitedBy = null, 45 + public readonly ?array $invites = null, 46 + public readonly ?bool $invitesDisabled = null, 47 + public readonly ?Carbon $emailConfirmedAt = null, 48 + public readonly ?string $inviteNote = null, 49 + public readonly ?Carbon $deactivatedAt = null, 50 + public readonly ?array $threatSignatures = null 51 + ) { 52 + } 53 + 54 + /** 55 + * Get the lexicon NSID for this data type. 56 + * 57 + * @return string 58 + */ 59 + public static function getLexicon(): string 60 + { 61 + return 'com.atproto.admin.defs.accountView'; 62 + } 63 + 64 + 65 + /** 66 + * Create an instance from an array. 67 + * 68 + * @param array $data The data array 69 + * @return static 70 + */ 71 + public static function fromArray(array $data): static 72 + { 73 + return new static( 74 + did: $data['did'], 75 + handle: $data['handle'], 76 + indexedAt: Carbon::parse($data['indexedAt']), 77 + email: $data['email'] ?? null, 78 + relatedRecords: $data['relatedRecords'] ?? null, 79 + invitedBy: isset($data['invitedBy']) ? InviteCode::fromArray($data['invitedBy']) : null, 80 + invites: isset($data['invites']) ? array_map(fn ($item) => InviteCode::fromArray($item), $data['invites']) : [], 81 + invitesDisabled: $data['invitesDisabled'] ?? null, 82 + emailConfirmedAt: isset($data['emailConfirmedAt']) ? Carbon::parse($data['emailConfirmedAt']) : null, 83 + inviteNote: $data['inviteNote'] ?? null, 84 + deactivatedAt: isset($data['deactivatedAt']) ? Carbon::parse($data['deactivatedAt']) : null, 85 + threatSignatures: $data['threatSignatures'] ?? [] 86 + ); 87 + } 88 + 89 + }
+58
src/Generated/Com/Atproto/Admin/Defs/RepoBlobRef.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Admin\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.admin.defs.repoBlobRef 11 + * Type: object 12 + * 13 + * @property string $did 14 + * @property string $cid 15 + * @property string|null $recordUri 16 + * 17 + * Constraints: 18 + * - Required: did, cid 19 + * - did: Format: did 20 + * - cid: Format: cid 21 + * - recordUri: Format: at-uri 22 + */ 23 + class RepoBlobRef extends Data 24 + { 25 + public function __construct( 26 + public readonly string $did, 27 + public readonly string $cid, 28 + public readonly ?string $recordUri = null 29 + ) { 30 + } 31 + 32 + /** 33 + * Get the lexicon NSID for this data type. 34 + * 35 + * @return string 36 + */ 37 + public static function getLexicon(): string 38 + { 39 + return 'com.atproto.admin.defs.repoBlobRef'; 40 + } 41 + 42 + 43 + /** 44 + * Create an instance from an array. 45 + * 46 + * @param array $data The data array 47 + * @return static 48 + */ 49 + public static function fromArray(array $data): static 50 + { 51 + return new static( 52 + did: $data['did'], 53 + cid: $data['cid'], 54 + recordUri: $data['recordUri'] ?? null 55 + ); 56 + } 57 + 58 + }
+50
src/Generated/Com/Atproto/Admin/Defs/RepoRef.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Admin\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.admin.defs.repoRef 11 + * Type: object 12 + * 13 + * @property string $did 14 + * 15 + * Constraints: 16 + * - Required: did 17 + * - did: Format: did 18 + */ 19 + class RepoRef extends Data 20 + { 21 + public function __construct( 22 + public readonly string $did 23 + ) { 24 + } 25 + 26 + /** 27 + * Get the lexicon NSID for this data type. 28 + * 29 + * @return string 30 + */ 31 + public static function getLexicon(): string 32 + { 33 + return 'com.atproto.admin.defs.repoRef'; 34 + } 35 + 36 + 37 + /** 38 + * Create an instance from an array. 39 + * 40 + * @param array $data The data array 41 + * @return static 42 + */ 43 + public static function fromArray(array $data): static 44 + { 45 + return new static( 46 + did: $data['did'] 47 + ); 48 + } 49 + 50 + }
+52
src/Generated/Com/Atproto/Admin/Defs/StatusAttr.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Admin\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.admin.defs.statusAttr 11 + * Type: object 12 + * 13 + * @property bool $applied 14 + * @property string|null $ref 15 + * 16 + * Constraints: 17 + * - Required: applied 18 + */ 19 + class StatusAttr extends Data 20 + { 21 + public function __construct( 22 + public readonly bool $applied, 23 + public readonly ?string $ref = null 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'com.atproto.admin.defs.statusAttr'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + applied: $data['applied'], 48 + ref: $data['ref'] ?? null 49 + ); 50 + } 51 + 52 + }
+52
src/Generated/Com/Atproto/Admin/Defs/ThreatSignature.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Admin\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.admin.defs.threatSignature 11 + * Type: object 12 + * 13 + * @property string $property 14 + * @property string $value 15 + * 16 + * Constraints: 17 + * - Required: property, value 18 + */ 19 + class ThreatSignature extends Data 20 + { 21 + public function __construct( 22 + public readonly string $property, 23 + public readonly string $value 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'com.atproto.admin.defs.threatSignature'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + property: $data['property'], 48 + value: $data['value'] 49 + ); 50 + } 51 + 52 + }
+61
src/Generated/Com/Atproto/Identity/Defs/IdentityInfo.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Identity\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.identity.defs.identityInfo 11 + * Type: object 12 + * 13 + * @property string $did 14 + * @property string $handle The validated handle of the account; or 'handle.invalid' if the handle did not bi-directionally match the DID document. 15 + * @property mixed $didDoc The complete DID document for the identity. 16 + * 17 + * Constraints: 18 + * - Required: did, handle, didDoc 19 + * - did: Format: did 20 + * - handle: Format: handle 21 + */ 22 + class IdentityInfo extends Data 23 + { 24 + /** 25 + * @param string $handle The validated handle of the account; or 'handle.invalid' if the handle did not bi-directionally match the DID document. 26 + * @param mixed $didDoc The complete DID document for the identity. 27 + */ 28 + public function __construct( 29 + public readonly string $did, 30 + public readonly string $handle, 31 + public readonly mixed $didDoc 32 + ) { 33 + } 34 + 35 + /** 36 + * Get the lexicon NSID for this data type. 37 + * 38 + * @return string 39 + */ 40 + public static function getLexicon(): string 41 + { 42 + return 'com.atproto.identity.defs.identityInfo'; 43 + } 44 + 45 + 46 + /** 47 + * Create an instance from an array. 48 + * 49 + * @param array $data The data array 50 + * @return static 51 + */ 52 + public static function fromArray(array $data): static 53 + { 54 + return new static( 55 + did: $data['did'], 56 + handle: $data['handle'], 57 + didDoc: $data['didDoc'] 58 + ); 59 + } 60 + 61 + }
+93
src/Generated/Com/Atproto/Label/Defs/Label.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Metadata tag on an atproto resource (eg, repo or record). 12 + * 13 + * Lexicon: com.atproto.label.defs.label 14 + * Type: object 15 + * 16 + * @property int|null $ver The AT Protocol version of the label object. 17 + * @property string $src DID of the actor who created this label. 18 + * @property string $uri AT URI of the record, repository (account), or other resource that this label applies to. 19 + * @property string|null $cid Optionally, CID specifying the specific version of 'uri' resource this label applies to. 20 + * @property string $val The short string name of the value or type of this label. 21 + * @property bool|null $neg If true, this is a negation label, overwriting a previous label. 22 + * @property Carbon $cts Timestamp when this label was created. 23 + * @property Carbon|null $exp Timestamp at which this label expires (no longer applies). 24 + * @property string|null $sig Signature of dag-cbor encoded label. 25 + * 26 + * Constraints: 27 + * - Required: src, uri, val, cts 28 + * - src: Format: did 29 + * - uri: Format: uri 30 + * - cid: Format: cid 31 + * - val: Max length: 128 32 + * - cts: Format: datetime 33 + * - exp: Format: datetime 34 + */ 35 + class Label extends Data 36 + { 37 + /** 38 + * @param string $src DID of the actor who created this label. 39 + * @param string $uri AT URI of the record, repository (account), or other resource that this label applies to. 40 + * @param string $val The short string name of the value or type of this label. 41 + * @param Carbon $cts Timestamp when this label was created. 42 + * @param int|null $ver The AT Protocol version of the label object. 43 + * @param string|null $cid Optionally, CID specifying the specific version of 'uri' resource this label applies to. 44 + * @param bool|null $neg If true, this is a negation label, overwriting a previous label. 45 + * @param Carbon|null $exp Timestamp at which this label expires (no longer applies). 46 + * @param string|null $sig Signature of dag-cbor encoded label. 47 + */ 48 + public function __construct( 49 + public readonly string $src, 50 + public readonly string $uri, 51 + public readonly string $val, 52 + public readonly Carbon $cts, 53 + public readonly ?int $ver = null, 54 + public readonly ?string $cid = null, 55 + public readonly ?bool $neg = null, 56 + public readonly ?Carbon $exp = null, 57 + public readonly ?string $sig = null 58 + ) { 59 + } 60 + 61 + /** 62 + * Get the lexicon NSID for this data type. 63 + * 64 + * @return string 65 + */ 66 + public static function getLexicon(): string 67 + { 68 + return 'com.atproto.label.defs.label'; 69 + } 70 + 71 + 72 + /** 73 + * Create an instance from an array. 74 + * 75 + * @param array $data The data array 76 + * @return static 77 + */ 78 + public static function fromArray(array $data): static 79 + { 80 + return new static( 81 + src: $data['src'], 82 + uri: $data['uri'], 83 + val: $data['val'], 84 + cts: Carbon::parse($data['cts']), 85 + ver: $data['ver'] ?? null, 86 + cid: $data['cid'] ?? null, 87 + neg: $data['neg'] ?? null, 88 + exp: isset($data['exp']) ? Carbon::parse($data['exp']) : null, 89 + sig: $data['sig'] ?? null 90 + ); 91 + } 92 + 93 + }
+75
src/Generated/Com/Atproto/Label/Defs/LabelValueDefinition.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Declares a label value and its expected interpretations and behaviors. 11 + * 12 + * Lexicon: com.atproto.label.defs.labelValueDefinition 13 + * Type: object 14 + * 15 + * @property string $identifier The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+). 16 + * @property string $severity How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing. 17 + * @property string $blurs 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. 18 + * @property string|null $defaultSetting The default setting for this label. 19 + * @property bool|null $adultOnly Does the user need to have adult content enabled in order to configure this label? 20 + * @property array $locales 21 + * 22 + * Constraints: 23 + * - Required: identifier, severity, blurs, locales 24 + * - identifier: Max length: 100 25 + * - identifier: Max graphemes: 100 26 + */ 27 + class LabelValueDefinition extends Data 28 + { 29 + /** 30 + * @param string $identifier The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+). 31 + * @param string $severity How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing. 32 + * @param string $blurs 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. 33 + * @param string|null $defaultSetting The default setting for this label. 34 + * @param bool|null $adultOnly Does the user need to have adult content enabled in order to configure this label? 35 + */ 36 + public function __construct( 37 + public readonly string $identifier, 38 + public readonly string $severity, 39 + public readonly string $blurs, 40 + public readonly array $locales, 41 + public readonly ?string $defaultSetting = null, 42 + public readonly ?bool $adultOnly = null 43 + ) { 44 + } 45 + 46 + /** 47 + * Get the lexicon NSID for this data type. 48 + * 49 + * @return string 50 + */ 51 + public static function getLexicon(): string 52 + { 53 + return 'com.atproto.label.defs.labelValueDefinition'; 54 + } 55 + 56 + 57 + /** 58 + * Create an instance from an array. 59 + * 60 + * @param array $data The data array 61 + * @return static 62 + */ 63 + public static function fromArray(array $data): static 64 + { 65 + return new static( 66 + identifier: $data['identifier'], 67 + severity: $data['severity'], 68 + blurs: $data['blurs'], 69 + locales: $data['locales'] ?? [], 70 + defaultSetting: $data['defaultSetting'] ?? null, 71 + adultOnly: $data['adultOnly'] ?? null 72 + ); 73 + } 74 + 75 + }
+68
src/Generated/Com/Atproto/Label/Defs/LabelValueDefinitionStrings.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Strings which describe the label in the UI, localized into a specific 11 + * language. 12 + * 13 + * Lexicon: com.atproto.label.defs.labelValueDefinitionStrings 14 + * Type: object 15 + * 16 + * @property string $lang The code of the language these strings are written in. 17 + * @property string $name A short human-readable name for the label. 18 + * @property string $description A longer description of what the label means and why it might be applied. 19 + * 20 + * Constraints: 21 + * - Required: lang, name, description 22 + * - lang: Format: language 23 + * - name: Max length: 640 24 + * - name: Max graphemes: 64 25 + * - description: Max length: 100000 26 + * - description: Max graphemes: 10000 27 + */ 28 + class LabelValueDefinitionStrings extends Data 29 + { 30 + /** 31 + * @param string $lang The code of the language these strings are written in. 32 + * @param string $name A short human-readable name for the label. 33 + * @param string $description A longer description of what the label means and why it might be applied. 34 + */ 35 + public function __construct( 36 + public readonly string $lang, 37 + public readonly string $name, 38 + public readonly string $description 39 + ) { 40 + } 41 + 42 + /** 43 + * Get the lexicon NSID for this data type. 44 + * 45 + * @return string 46 + */ 47 + public static function getLexicon(): string 48 + { 49 + return 'com.atproto.label.defs.labelValueDefinitionStrings'; 50 + } 51 + 52 + 53 + /** 54 + * Create an instance from an array. 55 + * 56 + * @param array $data The data array 57 + * @return static 58 + */ 59 + public static function fromArray(array $data): static 60 + { 61 + return new static( 62 + lang: $data['lang'], 63 + name: $data['name'], 64 + description: $data['description'] 65 + ); 66 + } 67 + 68 + }
+56
src/Generated/Com/Atproto/Label/Defs/SelfLabel.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Metadata tag on an atproto record, published by the author within the record. 11 + * Note that schemas should use #selfLabels, not #selfLabel. 12 + * 13 + * Lexicon: com.atproto.label.defs.selfLabel 14 + * Type: object 15 + * 16 + * @property string $val The short string name of the value or type of this label. 17 + * 18 + * Constraints: 19 + * - Required: val 20 + * - val: Max length: 128 21 + */ 22 + class SelfLabel extends Data 23 + { 24 + /** 25 + * @param string $val The short string name of the value or type of this label. 26 + */ 27 + public function __construct( 28 + public readonly string $val 29 + ) { 30 + } 31 + 32 + /** 33 + * Get the lexicon NSID for this data type. 34 + * 35 + * @return string 36 + */ 37 + public static function getLexicon(): string 38 + { 39 + return 'com.atproto.label.defs.selfLabel'; 40 + } 41 + 42 + 43 + /** 44 + * Create an instance from an array. 45 + * 46 + * @param array $data The data array 47 + * @return static 48 + */ 49 + public static function fromArray(array $data): static 50 + { 51 + return new static( 52 + val: $data['val'] 53 + ); 54 + } 55 + 56 + }
+53
src/Generated/Com/Atproto/Label/Defs/SelfLabels.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Metadata tags on an atproto record, published by the author within the 11 + * record. 12 + * 13 + * Lexicon: com.atproto.label.defs.selfLabels 14 + * Type: object 15 + * 16 + * @property array $values 17 + * 18 + * Constraints: 19 + * - Required: values 20 + * - values: Max length: 10 21 + */ 22 + class SelfLabels extends Data 23 + { 24 + public function __construct( 25 + public readonly array $values 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'com.atproto.label.defs.selfLabels'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + values: $data['values'] ?? [] 50 + ); 51 + } 52 + 53 + }
+21
src/Generated/Com/Atproto/Label/LabelValue.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Label; 4 + 5 + /** 6 + * GENERATED CODE - DO NOT EDIT 7 + */ 8 + enum LabelValue: string 9 + { 10 + case Hide = '!hide'; 11 + case NoPromote = '!no-promote'; 12 + case Warn = '!warn'; 13 + case NoUnauthenticated = '!no-unauthenticated'; 14 + case DmcaViolation = 'dmca-violation'; 15 + case Doxxing = 'doxxing'; 16 + case Porn = 'porn'; 17 + case Sexual = 'sexual'; 18 + case Nudity = 'nudity'; 19 + case Nsfl = 'nsfl'; 20 + case Gore = 'gore'; 21 + }
+52
src/Generated/Com/Atproto/Label/SubscribeLabels/Info.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Label\SubscribeLabels; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.label.subscribeLabels.info 11 + * Type: object 12 + * 13 + * @property string $name 14 + * @property string|null $message 15 + * 16 + * Constraints: 17 + * - Required: name 18 + */ 19 + class Info extends Data 20 + { 21 + public function __construct( 22 + public readonly string $name, 23 + public readonly ?string $message = null 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'com.atproto.label.subscribeLabels.info'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + name: $data['name'], 48 + message: $data['message'] ?? null 49 + ); 50 + } 51 + 52 + }
+53
src/Generated/Com/Atproto/Label/SubscribeLabels/Labels.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Label\SubscribeLabels; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\Label; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: com.atproto.label.subscribeLabels.labels 12 + * Type: object 13 + * 14 + * @property int $seq 15 + * @property array<Label> $labels 16 + * 17 + * Constraints: 18 + * - Required: seq, labels 19 + */ 20 + class Labels extends Data 21 + { 22 + public function __construct( 23 + public readonly int $seq, 24 + public readonly array $labels 25 + ) { 26 + } 27 + 28 + /** 29 + * Get the lexicon NSID for this data type. 30 + * 31 + * @return string 32 + */ 33 + public static function getLexicon(): string 34 + { 35 + return 'com.atproto.label.subscribeLabels.labels'; 36 + } 37 + 38 + 39 + /** 40 + * Create an instance from an array. 41 + * 42 + * @param array $data The data array 43 + * @return static 44 + */ 45 + public static function fromArray(array $data): static 46 + { 47 + return new static( 48 + seq: $data['seq'], 49 + labels: isset($data['labels']) ? array_map(fn ($item) => Label::fromArray($item), $data['labels']) : [] 50 + ); 51 + } 52 + 53 + }
+58
src/Generated/Com/Atproto/Moderation/CreateReport/ModTool.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Moderation\CreateReport; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Moderation tool information for tracing the source of the action 11 + * 12 + * Lexicon: com.atproto.moderation.createReport.modTool 13 + * Type: object 14 + * 15 + * @property string $name Name/identifier of the source (e.g., 'bsky-app/android', 'bsky-web/chrome') 16 + * @property mixed $meta Additional arbitrary metadata about the source 17 + * 18 + * Constraints: 19 + * - Required: name 20 + */ 21 + class ModTool extends Data 22 + { 23 + /** 24 + * @param string $name Name/identifier of the source (e.g., 'bsky-app/android', 'bsky-web/chrome') 25 + * @param mixed $meta Additional arbitrary metadata about the source 26 + */ 27 + public function __construct( 28 + public readonly string $name, 29 + public readonly mixed $meta = null 30 + ) { 31 + } 32 + 33 + /** 34 + * Get the lexicon NSID for this data type. 35 + * 36 + * @return string 37 + */ 38 + public static function getLexicon(): string 39 + { 40 + return 'com.atproto.moderation.createReport.modTool'; 41 + } 42 + 43 + 44 + /** 45 + * Create an instance from an array. 46 + * 47 + * @param array $data The data array 48 + * @return static 49 + */ 50 + public static function fromArray(array $data): static 51 + { 52 + return new static( 53 + name: $data['name'], 54 + meta: $data['meta'] ?? null 55 + ); 56 + } 57 + 58 + }
+57
src/Generated/Com/Atproto/Moderation/ReasonType.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Moderation; 4 + 5 + /** 6 + * GENERATED CODE - DO NOT EDIT 7 + */ 8 + enum ReasonType: string 9 + { 10 + case ReasonSpam = 'com.atproto.moderation.defs#reasonSpam'; 11 + case ReasonViolation = 'com.atproto.moderation.defs#reasonViolation'; 12 + case ReasonMisleading = 'com.atproto.moderation.defs#reasonMisleading'; 13 + case ReasonSexual = 'com.atproto.moderation.defs#reasonSexual'; 14 + case ReasonRude = 'com.atproto.moderation.defs#reasonRude'; 15 + case ReasonOther = 'com.atproto.moderation.defs#reasonOther'; 16 + case ReasonAppeal = 'com.atproto.moderation.defs#reasonAppeal'; 17 + case ReportReasonAppeal = 'tools.ozone.report.defs#reasonAppeal'; 18 + case ReportReasonOther = 'tools.ozone.report.defs#reasonOther'; 19 + case ReasonViolenceAnimal = 'tools.ozone.report.defs#reasonViolenceAnimal'; 20 + case ReasonViolenceThreats = 'tools.ozone.report.defs#reasonViolenceThreats'; 21 + case ReasonViolenceGraphicContent = 'tools.ozone.report.defs#reasonViolenceGraphicContent'; 22 + case ReasonViolenceGlorification = 'tools.ozone.report.defs#reasonViolenceGlorification'; 23 + case ReasonViolenceExtremistContent = 'tools.ozone.report.defs#reasonViolenceExtremistContent'; 24 + case ReasonViolenceTrafficking = 'tools.ozone.report.defs#reasonViolenceTrafficking'; 25 + case ReasonViolenceOther = 'tools.ozone.report.defs#reasonViolenceOther'; 26 + case ReasonSexualAbuseContent = 'tools.ozone.report.defs#reasonSexualAbuseContent'; 27 + case ReasonSexualNCII = 'tools.ozone.report.defs#reasonSexualNCII'; 28 + case ReasonSexualDeepfake = 'tools.ozone.report.defs#reasonSexualDeepfake'; 29 + case ReasonSexualAnimal = 'tools.ozone.report.defs#reasonSexualAnimal'; 30 + case ReasonSexualUnlabeled = 'tools.ozone.report.defs#reasonSexualUnlabeled'; 31 + case ReasonSexualOther = 'tools.ozone.report.defs#reasonSexualOther'; 32 + case ReasonChildSafetyCSAM = 'tools.ozone.report.defs#reasonChildSafetyCSAM'; 33 + case ReasonChildSafetyGroom = 'tools.ozone.report.defs#reasonChildSafetyGroom'; 34 + case ReasonChildSafetyPrivacy = 'tools.ozone.report.defs#reasonChildSafetyPrivacy'; 35 + case ReasonChildSafetyHarassment = 'tools.ozone.report.defs#reasonChildSafetyHarassment'; 36 + case ReasonChildSafetyOther = 'tools.ozone.report.defs#reasonChildSafetyOther'; 37 + case ReasonHarassmentTroll = 'tools.ozone.report.defs#reasonHarassmentTroll'; 38 + case ReasonHarassmentTargeted = 'tools.ozone.report.defs#reasonHarassmentTargeted'; 39 + case ReasonHarassmentHateSpeech = 'tools.ozone.report.defs#reasonHarassmentHateSpeech'; 40 + case ReasonHarassmentDoxxing = 'tools.ozone.report.defs#reasonHarassmentDoxxing'; 41 + case ReasonHarassmentOther = 'tools.ozone.report.defs#reasonHarassmentOther'; 42 + case ReasonMisleadingBot = 'tools.ozone.report.defs#reasonMisleadingBot'; 43 + case ReasonMisleadingImpersonation = 'tools.ozone.report.defs#reasonMisleadingImpersonation'; 44 + case ReasonMisleadingSpam = 'tools.ozone.report.defs#reasonMisleadingSpam'; 45 + case ReasonMisleadingScam = 'tools.ozone.report.defs#reasonMisleadingScam'; 46 + case ReasonMisleadingElections = 'tools.ozone.report.defs#reasonMisleadingElections'; 47 + case ReasonMisleadingOther = 'tools.ozone.report.defs#reasonMisleadingOther'; 48 + case ReasonRuleSiteSecurity = 'tools.ozone.report.defs#reasonRuleSiteSecurity'; 49 + case ReasonRuleProhibitedSales = 'tools.ozone.report.defs#reasonRuleProhibitedSales'; 50 + case ReasonRuleBanEvasion = 'tools.ozone.report.defs#reasonRuleBanEvasion'; 51 + case ReasonRuleOther = 'tools.ozone.report.defs#reasonRuleOther'; 52 + case ReasonSelfHarmContent = 'tools.ozone.report.defs#reasonSelfHarmContent'; 53 + case ReasonSelfHarmED = 'tools.ozone.report.defs#reasonSelfHarmED'; 54 + case ReasonSelfHarmStunts = 'tools.ozone.report.defs#reasonSelfHarmStunts'; 55 + case ReasonSelfHarmSubstances = 'tools.ozone.report.defs#reasonSelfHarmSubstances'; 56 + case ReasonSelfHarmOther = 'tools.ozone.report.defs#reasonSelfHarmOther'; 57 + }
+15
src/Generated/Com/Atproto/Moderation/SubjectType.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Moderation; 4 + 5 + /** 6 + * GENERATED CODE - DO NOT EDIT 7 + * 8 + * Tag describing a type of subject that might be reported. 9 + */ 10 + enum SubjectType: string 11 + { 12 + case Account = 'account'; 13 + case Record = 'record'; 14 + case Chat = 'chat'; 15 + }
+63
src/Generated/Com/Atproto/Repo/ApplyWrites/Create.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Repo\ApplyWrites; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Operation which creates a new record. 11 + * 12 + * Lexicon: com.atproto.repo.applyWrites.create 13 + * Type: object 14 + * 15 + * @property string $collection 16 + * @property string|null $rkey NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility. 17 + * @property mixed $value 18 + * 19 + * Constraints: 20 + * - Required: collection, value 21 + * - collection: Format: nsid 22 + * - rkey: Max length: 512 23 + * - rkey: Format: record-key 24 + */ 25 + class Create extends Data 26 + { 27 + /** 28 + * @param string|null $rkey NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility. 29 + */ 30 + public function __construct( 31 + public readonly string $collection, 32 + public readonly mixed $value, 33 + public readonly ?string $rkey = null 34 + ) { 35 + } 36 + 37 + /** 38 + * Get the lexicon NSID for this data type. 39 + * 40 + * @return string 41 + */ 42 + public static function getLexicon(): string 43 + { 44 + return 'com.atproto.repo.applyWrites.create'; 45 + } 46 + 47 + 48 + /** 49 + * Create an instance from an array. 50 + * 51 + * @param array $data The data array 52 + * @return static 53 + */ 54 + public static function fromArray(array $data): static 55 + { 56 + return new static( 57 + collection: $data['collection'], 58 + value: $data['value'], 59 + rkey: $data['rkey'] ?? null 60 + ); 61 + } 62 + 63 + }
+57
src/Generated/Com/Atproto/Repo/ApplyWrites/CreateResult.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Repo\ApplyWrites; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.repo.applyWrites.createResult 11 + * Type: object 12 + * 13 + * @property string $uri 14 + * @property string $cid 15 + * @property string|null $validationStatus 16 + * 17 + * Constraints: 18 + * - Required: uri, cid 19 + * - uri: Format: at-uri 20 + * - cid: Format: cid 21 + */ 22 + class CreateResult extends Data 23 + { 24 + public function __construct( 25 + public readonly string $uri, 26 + public readonly string $cid, 27 + public readonly ?string $validationStatus = null 28 + ) { 29 + } 30 + 31 + /** 32 + * Get the lexicon NSID for this data type. 33 + * 34 + * @return string 35 + */ 36 + public static function getLexicon(): string 37 + { 38 + return 'com.atproto.repo.applyWrites.createResult'; 39 + } 40 + 41 + 42 + /** 43 + * Create an instance from an array. 44 + * 45 + * @param array $data The data array 46 + * @return static 47 + */ 48 + public static function fromArray(array $data): static 49 + { 50 + return new static( 51 + uri: $data['uri'], 52 + cid: $data['cid'], 53 + validationStatus: $data['validationStatus'] ?? null 54 + ); 55 + } 56 + 57 + }
+56
src/Generated/Com/Atproto/Repo/ApplyWrites/Delete.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Repo\ApplyWrites; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Operation which deletes an existing record. 11 + * 12 + * Lexicon: com.atproto.repo.applyWrites.delete 13 + * Type: object 14 + * 15 + * @property string $collection 16 + * @property string $rkey 17 + * 18 + * Constraints: 19 + * - Required: collection, rkey 20 + * - collection: Format: nsid 21 + * - rkey: Format: record-key 22 + */ 23 + class Delete extends Data 24 + { 25 + public function __construct( 26 + public readonly string $collection, 27 + public readonly string $rkey 28 + ) { 29 + } 30 + 31 + /** 32 + * Get the lexicon NSID for this data type. 33 + * 34 + * @return string 35 + */ 36 + public static function getLexicon(): string 37 + { 38 + return 'com.atproto.repo.applyWrites.delete'; 39 + } 40 + 41 + 42 + /** 43 + * Create an instance from an array. 44 + * 45 + * @param array $data The data array 46 + * @return static 47 + */ 48 + public static function fromArray(array $data): static 49 + { 50 + return new static( 51 + collection: $data['collection'], 52 + rkey: $data['rkey'] 53 + ); 54 + } 55 + 56 + }
+37
src/Generated/Com/Atproto/Repo/ApplyWrites/DeleteResult.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Repo\ApplyWrites; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.repo.applyWrites.deleteResult 11 + * Type: object 12 + */ 13 + class DeleteResult extends Data 14 + { 15 + /** 16 + * Get the lexicon NSID for this data type. 17 + * 18 + * @return string 19 + */ 20 + public static function getLexicon(): string 21 + { 22 + return 'com.atproto.repo.applyWrites.deleteResult'; 23 + } 24 + 25 + 26 + /** 27 + * Create an instance from an array. 28 + * 29 + * @param array $data The data array 30 + * @return static 31 + */ 32 + public static function fromArray(array $data): static 33 + { 34 + return new static(); 35 + } 36 + 37 + }
+59
src/Generated/Com/Atproto/Repo/ApplyWrites/Update.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Repo\ApplyWrites; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Operation which updates an existing record. 11 + * 12 + * Lexicon: com.atproto.repo.applyWrites.update 13 + * Type: object 14 + * 15 + * @property string $collection 16 + * @property string $rkey 17 + * @property mixed $value 18 + * 19 + * Constraints: 20 + * - Required: collection, rkey, value 21 + * - collection: Format: nsid 22 + * - rkey: Format: record-key 23 + */ 24 + class Update extends Data 25 + { 26 + public function __construct( 27 + public readonly string $collection, 28 + public readonly string $rkey, 29 + public readonly mixed $value 30 + ) { 31 + } 32 + 33 + /** 34 + * Get the lexicon NSID for this data type. 35 + * 36 + * @return string 37 + */ 38 + public static function getLexicon(): string 39 + { 40 + return 'com.atproto.repo.applyWrites.update'; 41 + } 42 + 43 + 44 + /** 45 + * Create an instance from an array. 46 + * 47 + * @param array $data The data array 48 + * @return static 49 + */ 50 + public static function fromArray(array $data): static 51 + { 52 + return new static( 53 + collection: $data['collection'], 54 + rkey: $data['rkey'], 55 + value: $data['value'] 56 + ); 57 + } 58 + 59 + }
+57
src/Generated/Com/Atproto/Repo/ApplyWrites/UpdateResult.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Repo\ApplyWrites; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.repo.applyWrites.updateResult 11 + * Type: object 12 + * 13 + * @property string $uri 14 + * @property string $cid 15 + * @property string|null $validationStatus 16 + * 17 + * Constraints: 18 + * - Required: uri, cid 19 + * - uri: Format: at-uri 20 + * - cid: Format: cid 21 + */ 22 + class UpdateResult extends Data 23 + { 24 + public function __construct( 25 + public readonly string $uri, 26 + public readonly string $cid, 27 + public readonly ?string $validationStatus = null 28 + ) { 29 + } 30 + 31 + /** 32 + * Get the lexicon NSID for this data type. 33 + * 34 + * @return string 35 + */ 36 + public static function getLexicon(): string 37 + { 38 + return 'com.atproto.repo.applyWrites.updateResult'; 39 + } 40 + 41 + 42 + /** 43 + * Create an instance from an array. 44 + * 45 + * @param array $data The data array 46 + * @return static 47 + */ 48 + public static function fromArray(array $data): static 49 + { 50 + return new static( 51 + uri: $data['uri'], 52 + cid: $data['cid'], 53 + validationStatus: $data['validationStatus'] ?? null 54 + ); 55 + } 56 + 57 + }
+54
src/Generated/Com/Atproto/Repo/Defs/CommitMeta.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Repo\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.repo.defs.commitMeta 11 + * Type: object 12 + * 13 + * @property string $cid 14 + * @property string $rev 15 + * 16 + * Constraints: 17 + * - Required: cid, rev 18 + * - cid: Format: cid 19 + * - rev: Format: tid 20 + */ 21 + class CommitMeta extends Data 22 + { 23 + public function __construct( 24 + public readonly string $cid, 25 + public readonly string $rev 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'com.atproto.repo.defs.commitMeta'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + cid: $data['cid'], 50 + rev: $data['rev'] 51 + ); 52 + } 53 + 54 + }
+54
src/Generated/Com/Atproto/Repo/ListMissingBlobs/RecordBlob.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Repo\ListMissingBlobs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.repo.listMissingBlobs.recordBlob 11 + * Type: object 12 + * 13 + * @property string $cid 14 + * @property string $recordUri 15 + * 16 + * Constraints: 17 + * - Required: cid, recordUri 18 + * - cid: Format: cid 19 + * - recordUri: Format: at-uri 20 + */ 21 + class RecordBlob extends Data 22 + { 23 + public function __construct( 24 + public readonly string $cid, 25 + public readonly string $recordUri 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'com.atproto.repo.listMissingBlobs.recordBlob'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + cid: $data['cid'], 50 + recordUri: $data['recordUri'] 51 + ); 52 + } 53 + 54 + }
+57
src/Generated/Com/Atproto/Repo/ListRecords/Record.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Repo\ListRecords; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.repo.listRecords.record 11 + * Type: object 12 + * 13 + * @property string $uri 14 + * @property string $cid 15 + * @property mixed $value 16 + * 17 + * Constraints: 18 + * - Required: uri, cid, value 19 + * - uri: Format: at-uri 20 + * - cid: Format: cid 21 + */ 22 + class Record extends Data 23 + { 24 + public function __construct( 25 + public readonly string $uri, 26 + public readonly string $cid, 27 + public readonly mixed $value 28 + ) { 29 + } 30 + 31 + /** 32 + * Get the lexicon NSID for this data type. 33 + * 34 + * @return string 35 + */ 36 + public static function getLexicon(): string 37 + { 38 + return 'com.atproto.repo.listRecords.record'; 39 + } 40 + 41 + 42 + /** 43 + * Create an instance from an array. 44 + * 45 + * @param array $data The data array 46 + * @return static 47 + */ 48 + public static function fromArray(array $data): static 49 + { 50 + return new static( 51 + uri: $data['uri'], 52 + cid: $data['cid'], 53 + value: $data['value'] 54 + ); 55 + } 56 + 57 + }
+56
src/Generated/Com/Atproto/Repo/StrongRef.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Repo; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * A URI with a content-hash fingerprint. 11 + * 12 + * Lexicon: com.atproto.repo.strongRef 13 + * Type: object 14 + * 15 + * @property string $uri 16 + * @property string $cid 17 + * 18 + * Constraints: 19 + * - Required: uri, cid 20 + * - uri: Format: at-uri 21 + * - cid: Format: cid 22 + */ 23 + class StrongRef extends Data 24 + { 25 + public function __construct( 26 + public readonly string $uri, 27 + public readonly string $cid 28 + ) { 29 + } 30 + 31 + /** 32 + * Get the lexicon NSID for this data type. 33 + * 34 + * @return string 35 + */ 36 + public static function getLexicon(): string 37 + { 38 + return 'com.atproto.repo.strongRef'; 39 + } 40 + 41 + 42 + /** 43 + * Create an instance from an array. 44 + * 45 + * @param array $data The data array 46 + * @return static 47 + */ 48 + public static function fromArray(array $data): static 49 + { 50 + return new static( 51 + uri: $data['uri'], 52 + cid: $data['cid'] 53 + ); 54 + } 55 + 56 + }
+60
src/Generated/Com/Atproto/Server/CreateAppPassword/AppPassword.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Server\CreateAppPassword; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: com.atproto.server.createAppPassword.appPassword 12 + * Type: object 13 + * 14 + * @property string $name 15 + * @property string $password 16 + * @property Carbon $createdAt 17 + * @property bool|null $privileged 18 + * 19 + * Constraints: 20 + * - Required: name, password, createdAt 21 + * - createdAt: Format: datetime 22 + */ 23 + class AppPassword extends Data 24 + { 25 + public function __construct( 26 + public readonly string $name, 27 + public readonly string $password, 28 + public readonly Carbon $createdAt, 29 + public readonly ?bool $privileged = null 30 + ) { 31 + } 32 + 33 + /** 34 + * Get the lexicon NSID for this data type. 35 + * 36 + * @return string 37 + */ 38 + public static function getLexicon(): string 39 + { 40 + return 'com.atproto.server.createAppPassword.appPassword'; 41 + } 42 + 43 + 44 + /** 45 + * Create an instance from an array. 46 + * 47 + * @param array $data The data array 48 + * @return static 49 + */ 50 + public static function fromArray(array $data): static 51 + { 52 + return new static( 53 + name: $data['name'], 54 + password: $data['password'], 55 + createdAt: Carbon::parse($data['createdAt']), 56 + privileged: $data['privileged'] ?? null 57 + ); 58 + } 59 + 60 + }
+52
src/Generated/Com/Atproto/Server/CreateInviteCodes/AccountCodes.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Server\CreateInviteCodes; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.server.createInviteCodes.accountCodes 11 + * Type: object 12 + * 13 + * @property string $account 14 + * @property array<string> $codes 15 + * 16 + * Constraints: 17 + * - Required: account, codes 18 + */ 19 + class AccountCodes extends Data 20 + { 21 + public function __construct( 22 + public readonly string $account, 23 + public readonly array $codes 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'com.atproto.server.createInviteCodes.accountCodes'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + account: $data['account'], 48 + codes: $data['codes'] 49 + ); 50 + } 51 + 52 + }
+69
src/Generated/Com/Atproto/Server/Defs/InviteCode.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Server\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: com.atproto.server.defs.inviteCode 12 + * Type: object 13 + * 14 + * @property string $code 15 + * @property int $available 16 + * @property bool $disabled 17 + * @property string $forAccount 18 + * @property string $createdBy 19 + * @property Carbon $createdAt 20 + * @property array $uses 21 + * 22 + * Constraints: 23 + * - Required: code, available, disabled, forAccount, createdBy, createdAt, uses 24 + * - createdAt: Format: datetime 25 + */ 26 + class InviteCode extends Data 27 + { 28 + public function __construct( 29 + public readonly string $code, 30 + public readonly int $available, 31 + public readonly bool $disabled, 32 + public readonly string $forAccount, 33 + public readonly string $createdBy, 34 + public readonly Carbon $createdAt, 35 + public readonly array $uses 36 + ) { 37 + } 38 + 39 + /** 40 + * Get the lexicon NSID for this data type. 41 + * 42 + * @return string 43 + */ 44 + public static function getLexicon(): string 45 + { 46 + return 'com.atproto.server.defs.inviteCode'; 47 + } 48 + 49 + 50 + /** 51 + * Create an instance from an array. 52 + * 53 + * @param array $data The data array 54 + * @return static 55 + */ 56 + public static function fromArray(array $data): static 57 + { 58 + return new static( 59 + code: $data['code'], 60 + available: $data['available'], 61 + disabled: $data['disabled'], 62 + forAccount: $data['forAccount'], 63 + createdBy: $data['createdBy'], 64 + createdAt: Carbon::parse($data['createdAt']), 65 + uses: $data['uses'] ?? [] 66 + ); 67 + } 68 + 69 + }
+55
src/Generated/Com/Atproto/Server/Defs/InviteCodeUse.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Server\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: com.atproto.server.defs.inviteCodeUse 12 + * Type: object 13 + * 14 + * @property string $usedBy 15 + * @property Carbon $usedAt 16 + * 17 + * Constraints: 18 + * - Required: usedBy, usedAt 19 + * - usedBy: Format: did 20 + * - usedAt: Format: datetime 21 + */ 22 + class InviteCodeUse extends Data 23 + { 24 + public function __construct( 25 + public readonly string $usedBy, 26 + public readonly Carbon $usedAt 27 + ) { 28 + } 29 + 30 + /** 31 + * Get the lexicon NSID for this data type. 32 + * 33 + * @return string 34 + */ 35 + public static function getLexicon(): string 36 + { 37 + return 'com.atproto.server.defs.inviteCodeUse'; 38 + } 39 + 40 + 41 + /** 42 + * Create an instance from an array. 43 + * 44 + * @param array $data The data array 45 + * @return static 46 + */ 47 + public static function fromArray(array $data): static 48 + { 49 + return new static( 50 + usedBy: $data['usedBy'], 51 + usedAt: Carbon::parse($data['usedAt']) 52 + ); 53 + } 54 + 55 + }
+46
src/Generated/Com/Atproto/Server/DescribeServer/Contact.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Server\DescribeServer; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.server.describeServer.contact 11 + * Type: object 12 + * 13 + * @property string|null $email 14 + */ 15 + class Contact extends Data 16 + { 17 + public function __construct( 18 + public readonly ?string $email = null 19 + ) { 20 + } 21 + 22 + /** 23 + * Get the lexicon NSID for this data type. 24 + * 25 + * @return string 26 + */ 27 + public static function getLexicon(): string 28 + { 29 + return 'com.atproto.server.describeServer.contact'; 30 + } 31 + 32 + 33 + /** 34 + * Create an instance from an array. 35 + * 36 + * @param array $data The data array 37 + * @return static 38 + */ 39 + public static function fromArray(array $data): static 40 + { 41 + return new static( 42 + email: $data['email'] ?? null 43 + ); 44 + } 45 + 46 + }
+53
src/Generated/Com/Atproto/Server/DescribeServer/Links.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Server\DescribeServer; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.server.describeServer.links 11 + * Type: object 12 + * 13 + * @property string|null $privacyPolicy 14 + * @property string|null $termsOfService 15 + * 16 + * Constraints: 17 + * - privacyPolicy: Format: uri 18 + * - termsOfService: Format: uri 19 + */ 20 + class Links extends Data 21 + { 22 + public function __construct( 23 + public readonly ?string $privacyPolicy = null, 24 + public readonly ?string $termsOfService = null 25 + ) { 26 + } 27 + 28 + /** 29 + * Get the lexicon NSID for this data type. 30 + * 31 + * @return string 32 + */ 33 + public static function getLexicon(): string 34 + { 35 + return 'com.atproto.server.describeServer.links'; 36 + } 37 + 38 + 39 + /** 40 + * Create an instance from an array. 41 + * 42 + * @param array $data The data array 43 + * @return static 44 + */ 45 + public static function fromArray(array $data): static 46 + { 47 + return new static( 48 + privacyPolicy: $data['privacyPolicy'] ?? null, 49 + termsOfService: $data['termsOfService'] ?? null 50 + ); 51 + } 52 + 53 + }
+57
src/Generated/Com/Atproto/Server/ListAppPasswords/AppPassword.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Server\ListAppPasswords; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: com.atproto.server.listAppPasswords.appPassword 12 + * Type: object 13 + * 14 + * @property string $name 15 + * @property Carbon $createdAt 16 + * @property bool|null $privileged 17 + * 18 + * Constraints: 19 + * - Required: name, createdAt 20 + * - createdAt: Format: datetime 21 + */ 22 + class AppPassword extends Data 23 + { 24 + public function __construct( 25 + public readonly string $name, 26 + public readonly Carbon $createdAt, 27 + public readonly ?bool $privileged = null 28 + ) { 29 + } 30 + 31 + /** 32 + * Get the lexicon NSID for this data type. 33 + * 34 + * @return string 35 + */ 36 + public static function getLexicon(): string 37 + { 38 + return 'com.atproto.server.listAppPasswords.appPassword'; 39 + } 40 + 41 + 42 + /** 43 + * Create an instance from an array. 44 + * 45 + * @param array $data The data array 46 + * @return static 47 + */ 48 + public static function fromArray(array $data): static 49 + { 50 + return new static( 51 + name: $data['name'], 52 + createdAt: Carbon::parse($data['createdAt']), 53 + privileged: $data['privileged'] ?? null 54 + ); 55 + } 56 + 57 + }
+15
src/Generated/Com/Atproto/Sync/HostStatus.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Sync; 4 + 5 + /** 6 + * GENERATED CODE - DO NOT EDIT 7 + */ 8 + enum HostStatus: string 9 + { 10 + case Active = 'active'; 11 + case Idle = 'idle'; 12 + case Offline = 'offline'; 13 + case Throttled = 'throttled'; 14 + case Banned = 'banned'; 15 + }
+63
src/Generated/Com/Atproto/Sync/ListHosts/Host.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Sync\ListHosts; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\Com\Atproto\Sync\Defs\HostStatus; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: com.atproto.sync.listHosts.host 12 + * Type: object 13 + * 14 + * @property string $hostname hostname of server; not a URL (no scheme) 15 + * @property int|null $seq Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor). 16 + * @property int|null $accountCount 17 + * @property HostStatus|null $status 18 + * 19 + * Constraints: 20 + * - Required: hostname 21 + */ 22 + class Host extends Data 23 + { 24 + /** 25 + * @param string $hostname hostname of server; not a URL (no scheme) 26 + * @param int|null $seq Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor). 27 + */ 28 + public function __construct( 29 + public readonly string $hostname, 30 + public readonly ?int $seq = null, 31 + public readonly ?int $accountCount = null, 32 + public readonly ?HostStatus $status = null 33 + ) { 34 + } 35 + 36 + /** 37 + * Get the lexicon NSID for this data type. 38 + * 39 + * @return string 40 + */ 41 + public static function getLexicon(): string 42 + { 43 + return 'com.atproto.sync.listHosts.host'; 44 + } 45 + 46 + 47 + /** 48 + * Create an instance from an array. 49 + * 50 + * @param array $data The data array 51 + * @return static 52 + */ 53 + public static function fromArray(array $data): static 54 + { 55 + return new static( 56 + hostname: $data['hostname'], 57 + seq: $data['seq'] ?? null, 58 + accountCount: $data['accountCount'] ?? null, 59 + status: isset($data['status']) ? HostStatus::fromArray($data['status']) : null 60 + ); 61 + } 62 + 63 + }
+68
src/Generated/Com/Atproto/Sync/ListRepos/Repo.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Sync\ListRepos; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.sync.listRepos.repo 11 + * Type: object 12 + * 13 + * @property string $did 14 + * @property string $head Current repo commit CID 15 + * @property string $rev 16 + * @property bool|null $active 17 + * @property string|null $status 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. 18 + * 19 + * Constraints: 20 + * - Required: did, head, rev 21 + * - did: Format: did 22 + * - head: Format: cid 23 + * - rev: Format: tid 24 + */ 25 + class Repo extends Data 26 + { 27 + /** 28 + * @param string $head Current repo commit CID 29 + * @param string|null $status 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 + */ 31 + public function __construct( 32 + public readonly string $did, 33 + public readonly string $head, 34 + public readonly string $rev, 35 + public readonly ?bool $active = null, 36 + public readonly ?string $status = null 37 + ) { 38 + } 39 + 40 + /** 41 + * Get the lexicon NSID for this data type. 42 + * 43 + * @return string 44 + */ 45 + public static function getLexicon(): string 46 + { 47 + return 'com.atproto.sync.listRepos.repo'; 48 + } 49 + 50 + 51 + /** 52 + * Create an instance from an array. 53 + * 54 + * @param array $data The data array 55 + * @return static 56 + */ 57 + public static function fromArray(array $data): static 58 + { 59 + return new static( 60 + did: $data['did'], 61 + head: $data['head'], 62 + rev: $data['rev'], 63 + active: $data['active'] ?? null, 64 + status: $data['status'] ?? null 65 + ); 66 + } 67 + 68 + }
+50
src/Generated/Com/Atproto/Sync/ListReposByCollection/Repo.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Sync\ListReposByCollection; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.sync.listReposByCollection.repo 11 + * Type: object 12 + * 13 + * @property string $did 14 + * 15 + * Constraints: 16 + * - Required: did 17 + * - did: Format: did 18 + */ 19 + class Repo extends Data 20 + { 21 + public function __construct( 22 + public readonly string $did 23 + ) { 24 + } 25 + 26 + /** 27 + * Get the lexicon NSID for this data type. 28 + * 29 + * @return string 30 + */ 31 + public static function getLexicon(): string 32 + { 33 + return 'com.atproto.sync.listReposByCollection.repo'; 34 + } 35 + 36 + 37 + /** 38 + * Create an instance from an array. 39 + * 40 + * @param array $data The data array 41 + * @return static 42 + */ 43 + public static function fromArray(array $data): static 44 + { 45 + return new static( 46 + did: $data['did'] 47 + ); 48 + } 49 + 50 + }
+73
src/Generated/Com/Atproto/Sync/SubscribeRepos/Account.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Sync\SubscribeRepos; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Represents a change to an account's status on a host (eg, PDS or Relay). The 12 + * semantics of this event are that the status is at the host which emitted the 13 + * event, not necessarily that at the currently active PDS. Eg, a Relay takedown 14 + * would emit a takedown with active=false, even if the PDS is still active. 15 + * 16 + * Lexicon: com.atproto.sync.subscribeRepos.account 17 + * Type: object 18 + * 19 + * @property int $seq 20 + * @property string $did 21 + * @property Carbon $time 22 + * @property bool $active Indicates that the account has a repository which can be fetched from the host that emitted this event. 23 + * @property string|null $status If active=false, this optional field indicates a reason for why the account is not active. 24 + * 25 + * Constraints: 26 + * - Required: seq, did, time, active 27 + * - did: Format: did 28 + * - time: Format: datetime 29 + */ 30 + class Account extends Data 31 + { 32 + /** 33 + * @param bool $active Indicates that the account has a repository which can be fetched from the host that emitted this event. 34 + * @param string|null $status If active=false, this optional field indicates a reason for why the account is not active. 35 + */ 36 + public function __construct( 37 + public readonly int $seq, 38 + public readonly string $did, 39 + public readonly Carbon $time, 40 + public readonly bool $active, 41 + public readonly ?string $status = null 42 + ) { 43 + } 44 + 45 + /** 46 + * Get the lexicon NSID for this data type. 47 + * 48 + * @return string 49 + */ 50 + public static function getLexicon(): string 51 + { 52 + return 'com.atproto.sync.subscribeRepos.account'; 53 + } 54 + 55 + 56 + /** 57 + * Create an instance from an array. 58 + * 59 + * @param array $data The data array 60 + * @return static 61 + */ 62 + public static function fromArray(array $data): static 63 + { 64 + return new static( 65 + seq: $data['seq'], 66 + did: $data['did'], 67 + time: Carbon::parse($data['time']), 68 + active: $data['active'], 69 + status: $data['status'] ?? null 70 + ); 71 + } 72 + 73 + }
+105
src/Generated/Com/Atproto/Sync/SubscribeRepos/Commit.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Sync\SubscribeRepos; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Represents an update of repository state. Note that empty commits are 12 + * allowed, which include no repo data changes, but an update to rev and 13 + * signature. 14 + * 15 + * Lexicon: com.atproto.sync.subscribeRepos.commit 16 + * Type: object 17 + * 18 + * @property int $seq The stream sequence number of this message. 19 + * @property bool $rebase DEPRECATED -- unused 20 + * @property bool $tooBig DEPRECATED -- replaced by #sync event and data limits. 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. 21 + * @property string $repo The repo this event comes from. Note that all other message types name this field 'did'. 22 + * @property string $commit Repo commit object CID. 23 + * @property string $rev 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. 24 + * @property string $since The rev of the last emitted commit from this repo (if any). 25 + * @property string $blocks CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list. 26 + * @property array $ops 27 + * @property array<string> $blobs 28 + * @property string|null $prevData The root CID of the MST tree for the previous commit from this repo (indicated by the 'since' revision field in this message). Corresponds to the 'data' field in the repo commit object. NOTE: this field is effectively required for the 'inductive' version of firehose. 29 + * @property Carbon $time Timestamp of when this message was originally broadcast. 30 + * 31 + * Constraints: 32 + * - Required: seq, rebase, tooBig, repo, commit, rev, since, blocks, ops, blobs, time 33 + * - repo: Format: did 34 + * - rev: Format: tid 35 + * - since: Format: tid 36 + * - blocks: Max length: 2000000 37 + * - ops: Max length: 200 38 + * - time: Format: datetime 39 + */ 40 + class Commit extends Data 41 + { 42 + /** 43 + * @param int $seq The stream sequence number of this message. 44 + * @param bool $rebase DEPRECATED -- unused 45 + * @param bool $tooBig DEPRECATED -- replaced by #sync event and data limits. 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. 46 + * @param string $repo The repo this event comes from. Note that all other message types name this field 'did'. 47 + * @param string $commit Repo commit object CID. 48 + * @param string $rev 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. 49 + * @param string $since The rev of the last emitted commit from this repo (if any). 50 + * @param string $blocks CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list. 51 + * @param Carbon $time Timestamp of when this message was originally broadcast. 52 + * @param string|null $prevData The root CID of the MST tree for the previous commit from this repo (indicated by the 'since' revision field in this message). Corresponds to the 'data' field in the repo commit object. NOTE: this field is effectively required for the 'inductive' version of firehose. 53 + */ 54 + public function __construct( 55 + public readonly int $seq, 56 + public readonly bool $rebase, 57 + public readonly bool $tooBig, 58 + public readonly string $repo, 59 + public readonly string $commit, 60 + public readonly string $rev, 61 + public readonly string $since, 62 + public readonly string $blocks, 63 + public readonly array $ops, 64 + public readonly array $blobs, 65 + public readonly Carbon $time, 66 + public readonly ?string $prevData = null 67 + ) { 68 + } 69 + 70 + /** 71 + * Get the lexicon NSID for this data type. 72 + * 73 + * @return string 74 + */ 75 + public static function getLexicon(): string 76 + { 77 + return 'com.atproto.sync.subscribeRepos.commit'; 78 + } 79 + 80 + 81 + /** 82 + * Create an instance from an array. 83 + * 84 + * @param array $data The data array 85 + * @return static 86 + */ 87 + public static function fromArray(array $data): static 88 + { 89 + return new static( 90 + seq: $data['seq'], 91 + rebase: $data['rebase'], 92 + tooBig: $data['tooBig'], 93 + repo: $data['repo'], 94 + commit: $data['commit'], 95 + rev: $data['rev'], 96 + since: $data['since'], 97 + blocks: $data['blocks'], 98 + ops: $data['ops'] ?? [], 99 + blobs: $data['blobs'], 100 + time: Carbon::parse($data['time']), 101 + prevData: $data['prevData'] ?? null 102 + ); 103 + } 104 + 105 + }
+69
src/Generated/Com/Atproto/Sync/SubscribeRepos/Identity.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Sync\SubscribeRepos; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Represents a change to an account's identity. Could be an updated handle, 12 + * signing key, or pds hosting endpoint. Serves as a prod to all downstream 13 + * services to refresh their identity cache. 14 + * 15 + * Lexicon: com.atproto.sync.subscribeRepos.identity 16 + * Type: object 17 + * 18 + * @property int $seq 19 + * @property string $did 20 + * @property Carbon $time 21 + * @property string|null $handle 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. 22 + * 23 + * Constraints: 24 + * - Required: seq, did, time 25 + * - did: Format: did 26 + * - time: Format: datetime 27 + * - handle: Format: handle 28 + */ 29 + class Identity extends Data 30 + { 31 + /** 32 + * @param string|null $handle 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. 33 + */ 34 + public function __construct( 35 + public readonly int $seq, 36 + public readonly string $did, 37 + public readonly Carbon $time, 38 + public readonly ?string $handle = null 39 + ) { 40 + } 41 + 42 + /** 43 + * Get the lexicon NSID for this data type. 44 + * 45 + * @return string 46 + */ 47 + public static function getLexicon(): string 48 + { 49 + return 'com.atproto.sync.subscribeRepos.identity'; 50 + } 51 + 52 + 53 + /** 54 + * Create an instance from an array. 55 + * 56 + * @param array $data The data array 57 + * @return static 58 + */ 59 + public static function fromArray(array $data): static 60 + { 61 + return new static( 62 + seq: $data['seq'], 63 + did: $data['did'], 64 + time: Carbon::parse($data['time']), 65 + handle: $data['handle'] ?? null 66 + ); 67 + } 68 + 69 + }
+52
src/Generated/Com/Atproto/Sync/SubscribeRepos/Info.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Sync\SubscribeRepos; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: com.atproto.sync.subscribeRepos.info 11 + * Type: object 12 + * 13 + * @property string $name 14 + * @property string|null $message 15 + * 16 + * Constraints: 17 + * - Required: name 18 + */ 19 + class Info extends Data 20 + { 21 + public function __construct( 22 + public readonly string $name, 23 + public readonly ?string $message = null 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'com.atproto.sync.subscribeRepos.info'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + name: $data['name'], 48 + message: $data['message'] ?? null 49 + ); 50 + } 51 + 52 + }
+64
src/Generated/Com/Atproto/Sync/SubscribeRepos/RepoOp.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Sync\SubscribeRepos; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * A repo operation, ie a mutation of a single record. 11 + * 12 + * Lexicon: com.atproto.sync.subscribeRepos.repoOp 13 + * Type: object 14 + * 15 + * @property string $action 16 + * @property string $path 17 + * @property string $cid For creates and updates, the new record CID. For deletions, null. 18 + * @property string|null $prev For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined. 19 + * 20 + * Constraints: 21 + * - Required: action, path, cid 22 + */ 23 + class RepoOp extends Data 24 + { 25 + /** 26 + * @param string $cid For creates and updates, the new record CID. For deletions, null. 27 + * @param string|null $prev For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined. 28 + */ 29 + public function __construct( 30 + public readonly string $action, 31 + public readonly string $path, 32 + public readonly string $cid, 33 + public readonly ?string $prev = null 34 + ) { 35 + } 36 + 37 + /** 38 + * Get the lexicon NSID for this data type. 39 + * 40 + * @return string 41 + */ 42 + public static function getLexicon(): string 43 + { 44 + return 'com.atproto.sync.subscribeRepos.repoOp'; 45 + } 46 + 47 + 48 + /** 49 + * Create an instance from an array. 50 + * 51 + * @param array $data The data array 52 + * @return static 53 + */ 54 + public static function fromArray(array $data): static 55 + { 56 + return new static( 57 + action: $data['action'], 58 + path: $data['path'], 59 + cid: $data['cid'], 60 + prev: $data['prev'] ?? null 61 + ); 62 + } 63 + 64 + }
+77
src/Generated/Com/Atproto/Sync/SubscribeRepos/Sync.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Com\Atproto\Sync\SubscribeRepos; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Updates the repo to a new state, without necessarily including that state on 12 + * the firehose. Used to recover from broken commit streams, data loss 13 + * incidents, or in situations where upstream host does not know recent state of 14 + * the repository. 15 + * 16 + * Lexicon: com.atproto.sync.subscribeRepos.sync 17 + * Type: object 18 + * 19 + * @property int $seq The stream sequence number of this message. 20 + * @property string $did The account this repo event corresponds to. Must match that in the commit object. 21 + * @property string $blocks CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'. 22 + * @property string $rev The rev of the commit. This value must match that in the commit object. 23 + * @property Carbon $time Timestamp of when this message was originally broadcast. 24 + * 25 + * Constraints: 26 + * - Required: seq, did, blocks, rev, time 27 + * - did: Format: did 28 + * - blocks: Max length: 10000 29 + * - time: Format: datetime 30 + */ 31 + class Sync extends Data 32 + { 33 + /** 34 + * @param int $seq The stream sequence number of this message. 35 + * @param string $did The account this repo event corresponds to. Must match that in the commit object. 36 + * @param string $blocks CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'. 37 + * @param string $rev The rev of the commit. This value must match that in the commit object. 38 + * @param Carbon $time Timestamp of when this message was originally broadcast. 39 + */ 40 + public function __construct( 41 + public readonly int $seq, 42 + public readonly string $did, 43 + public readonly string $blocks, 44 + public readonly string $rev, 45 + public readonly Carbon $time 46 + ) { 47 + } 48 + 49 + /** 50 + * Get the lexicon NSID for this data type. 51 + * 52 + * @return string 53 + */ 54 + public static function getLexicon(): string 55 + { 56 + return 'com.atproto.sync.subscribeRepos.sync'; 57 + } 58 + 59 + 60 + /** 61 + * Create an instance from an array. 62 + * 63 + * @param array $data The data array 64 + * @return static 65 + */ 66 + public static function fromArray(array $data): static 67 + { 68 + return new static( 69 + seq: $data['seq'], 70 + did: $data['did'], 71 + blocks: $data['blocks'], 72 + rev: $data['rev'], 73 + time: Carbon::parse($data['time']) 74 + ); 75 + } 76 + 77 + }
+85
src/Generated/Tools/Ozone/Communication/Defs/TemplateView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Communication\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: tools.ozone.communication.defs.templateView 12 + * Type: object 13 + * 14 + * @property string $id 15 + * @property string $name Name of the template. 16 + * @property string|null $subject Content of the template, can contain markdown and variable placeholders. 17 + * @property string $contentMarkdown Subject of the message, used in emails. 18 + * @property bool $disabled 19 + * @property string|null $lang Message language. 20 + * @property string $lastUpdatedBy DID of the user who last updated the template. 21 + * @property Carbon $createdAt 22 + * @property Carbon $updatedAt 23 + * 24 + * Constraints: 25 + * - Required: id, name, contentMarkdown, disabled, lastUpdatedBy, createdAt, updatedAt 26 + * - lang: Format: language 27 + * - lastUpdatedBy: Format: did 28 + * - createdAt: Format: datetime 29 + * - updatedAt: Format: datetime 30 + */ 31 + class TemplateView extends Data 32 + { 33 + /** 34 + * @param string $name Name of the template. 35 + * @param string $contentMarkdown Subject of the message, used in emails. 36 + * @param string $lastUpdatedBy DID of the user who last updated the template. 37 + * @param string|null $subject Content of the template, can contain markdown and variable placeholders. 38 + * @param string|null $lang Message language. 39 + */ 40 + public function __construct( 41 + public readonly string $id, 42 + public readonly string $name, 43 + public readonly string $contentMarkdown, 44 + public readonly bool $disabled, 45 + public readonly string $lastUpdatedBy, 46 + public readonly Carbon $createdAt, 47 + public readonly Carbon $updatedAt, 48 + public readonly ?string $subject = null, 49 + public readonly ?string $lang = null 50 + ) { 51 + } 52 + 53 + /** 54 + * Get the lexicon NSID for this data type. 55 + * 56 + * @return string 57 + */ 58 + public static function getLexicon(): string 59 + { 60 + return 'tools.ozone.communication.defs.templateView'; 61 + } 62 + 63 + 64 + /** 65 + * Create an instance from an array. 66 + * 67 + * @param array $data The data array 68 + * @return static 69 + */ 70 + public static function fromArray(array $data): static 71 + { 72 + return new static( 73 + id: $data['id'], 74 + name: $data['name'], 75 + contentMarkdown: $data['contentMarkdown'], 76 + disabled: $data['disabled'], 77 + lastUpdatedBy: $data['lastUpdatedBy'], 78 + createdAt: Carbon::parse($data['createdAt']), 79 + updatedAt: Carbon::parse($data['updatedAt']), 80 + subject: $data['subject'] ?? null, 81 + lang: $data['lang'] ?? null 82 + ); 83 + } 84 + 85 + }
+66
src/Generated/Tools/Ozone/Moderation/Defs/AccountEvent.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Logs account status related events on a repo subject. Normally captured by 12 + * automod from the firehose and emitted to ozone for historical tracking. 13 + * 14 + * Lexicon: tools.ozone.moderation.defs.accountEvent 15 + * Type: object 16 + * 17 + * @property string|null $comment 18 + * @property bool $active Indicates that the account has a repository which can be fetched from the host that emitted this event. 19 + * @property string|null $status 20 + * @property Carbon $timestamp 21 + * 22 + * Constraints: 23 + * - Required: timestamp, active 24 + * - timestamp: Format: datetime 25 + */ 26 + class AccountEvent extends Data 27 + { 28 + /** 29 + * @param bool $active Indicates that the account has a repository which can be fetched from the host that emitted this event. 30 + */ 31 + public function __construct( 32 + public readonly bool $active, 33 + public readonly Carbon $timestamp, 34 + public readonly ?string $comment = null, 35 + public readonly ?string $status = null 36 + ) { 37 + } 38 + 39 + /** 40 + * Get the lexicon NSID for this data type. 41 + * 42 + * @return string 43 + */ 44 + public static function getLexicon(): string 45 + { 46 + return 'tools.ozone.moderation.defs.accountEvent'; 47 + } 48 + 49 + 50 + /** 51 + * Create an instance from an array. 52 + * 53 + * @param array $data The data array 54 + * @return static 55 + */ 56 + public static function fromArray(array $data): static 57 + { 58 + return new static( 59 + active: $data['active'], 60 + timestamp: Carbon::parse($data['timestamp']), 61 + comment: $data['comment'] ?? null, 62 + status: $data['status'] ?? null 63 + ); 64 + } 65 + 66 + }
+70
src/Generated/Tools/Ozone/Moderation/Defs/AccountHosting.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: tools.ozone.moderation.defs.accountHosting 12 + * Type: object 13 + * 14 + * @property string $status 15 + * @property Carbon|null $updatedAt 16 + * @property Carbon|null $createdAt 17 + * @property Carbon|null $deletedAt 18 + * @property Carbon|null $deactivatedAt 19 + * @property Carbon|null $reactivatedAt 20 + * 21 + * Constraints: 22 + * - Required: status 23 + * - updatedAt: Format: datetime 24 + * - createdAt: Format: datetime 25 + * - deletedAt: Format: datetime 26 + * - deactivatedAt: Format: datetime 27 + * - reactivatedAt: Format: datetime 28 + */ 29 + class AccountHosting extends Data 30 + { 31 + public function __construct( 32 + public readonly string $status, 33 + public readonly ?Carbon $updatedAt = null, 34 + public readonly ?Carbon $createdAt = null, 35 + public readonly ?Carbon $deletedAt = null, 36 + public readonly ?Carbon $deactivatedAt = null, 37 + public readonly ?Carbon $reactivatedAt = null 38 + ) { 39 + } 40 + 41 + /** 42 + * Get the lexicon NSID for this data type. 43 + * 44 + * @return string 45 + */ 46 + public static function getLexicon(): string 47 + { 48 + return 'tools.ozone.moderation.defs.accountHosting'; 49 + } 50 + 51 + 52 + /** 53 + * Create an instance from an array. 54 + * 55 + * @param array $data The data array 56 + * @return static 57 + */ 58 + public static function fromArray(array $data): static 59 + { 60 + return new static( 61 + status: $data['status'], 62 + updatedAt: isset($data['updatedAt']) ? Carbon::parse($data['updatedAt']) : null, 63 + createdAt: isset($data['createdAt']) ? Carbon::parse($data['createdAt']) : null, 64 + deletedAt: isset($data['deletedAt']) ? Carbon::parse($data['deletedAt']) : null, 65 + deactivatedAt: isset($data['deactivatedAt']) ? Carbon::parse($data['deactivatedAt']) : null, 66 + reactivatedAt: isset($data['reactivatedAt']) ? Carbon::parse($data['reactivatedAt']) : null 67 + ); 68 + } 69 + 70 + }
+67
src/Generated/Tools/Ozone/Moderation/Defs/AccountStats.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Statistics about a particular account subject 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.accountStats 13 + * Type: object 14 + * 15 + * @property int|null $reportCount Total number of reports on the account 16 + * @property int|null $appealCount Total number of appeals against a moderation action on the account 17 + * @property int|null $suspendCount Number of times the account was suspended 18 + * @property int|null $escalateCount Number of times the account was escalated 19 + * @property int|null $takedownCount Number of times the account was taken down 20 + */ 21 + class AccountStats extends Data 22 + { 23 + /** 24 + * @param int|null $reportCount Total number of reports on the account 25 + * @param int|null $appealCount Total number of appeals against a moderation action on the account 26 + * @param int|null $suspendCount Number of times the account was suspended 27 + * @param int|null $escalateCount Number of times the account was escalated 28 + * @param int|null $takedownCount Number of times the account was taken down 29 + */ 30 + public function __construct( 31 + public readonly ?int $reportCount = null, 32 + public readonly ?int $appealCount = null, 33 + public readonly ?int $suspendCount = null, 34 + public readonly ?int $escalateCount = null, 35 + public readonly ?int $takedownCount = null 36 + ) { 37 + } 38 + 39 + /** 40 + * Get the lexicon NSID for this data type. 41 + * 42 + * @return string 43 + */ 44 + public static function getLexicon(): string 45 + { 46 + return 'tools.ozone.moderation.defs.accountStats'; 47 + } 48 + 49 + 50 + /** 51 + * Create an instance from an array. 52 + * 53 + * @param array $data The data array 54 + * @return static 55 + */ 56 + public static function fromArray(array $data): static 57 + { 58 + return new static( 59 + reportCount: $data['reportCount'] ?? null, 60 + appealCount: $data['appealCount'] ?? null, 61 + suspendCount: $data['suspendCount'] ?? null, 62 + escalateCount: $data['escalateCount'] ?? null, 63 + takedownCount: $data['takedownCount'] ?? null 64 + ); 65 + } 66 + 67 + }
+68
src/Generated/Tools/Ozone/Moderation/Defs/AccountStrike.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Strike information for an account 12 + * 13 + * Lexicon: tools.ozone.moderation.defs.accountStrike 14 + * Type: object 15 + * 16 + * @property int|null $activeStrikeCount Current number of active strikes (excluding expired strikes) 17 + * @property int|null $totalStrikeCount Total number of strikes ever received (including expired strikes) 18 + * @property Carbon|null $firstStrikeAt Timestamp of the first strike received 19 + * @property Carbon|null $lastStrikeAt Timestamp of the most recent strike received 20 + * 21 + * Constraints: 22 + * - firstStrikeAt: Format: datetime 23 + * - lastStrikeAt: Format: datetime 24 + */ 25 + class AccountStrike extends Data 26 + { 27 + /** 28 + * @param int|null $activeStrikeCount Current number of active strikes (excluding expired strikes) 29 + * @param int|null $totalStrikeCount Total number of strikes ever received (including expired strikes) 30 + * @param Carbon|null $firstStrikeAt Timestamp of the first strike received 31 + * @param Carbon|null $lastStrikeAt Timestamp of the most recent strike received 32 + */ 33 + public function __construct( 34 + public readonly ?int $activeStrikeCount = null, 35 + public readonly ?int $totalStrikeCount = null, 36 + public readonly ?Carbon $firstStrikeAt = null, 37 + public readonly ?Carbon $lastStrikeAt = null 38 + ) { 39 + } 40 + 41 + /** 42 + * Get the lexicon NSID for this data type. 43 + * 44 + * @return string 45 + */ 46 + public static function getLexicon(): string 47 + { 48 + return 'tools.ozone.moderation.defs.accountStrike'; 49 + } 50 + 51 + 52 + /** 53 + * Create an instance from an array. 54 + * 55 + * @param array $data The data array 56 + * @return static 57 + */ 58 + public static function fromArray(array $data): static 59 + { 60 + return new static( 61 + activeStrikeCount: $data['activeStrikeCount'] ?? null, 62 + totalStrikeCount: $data['totalStrikeCount'] ?? null, 63 + firstStrikeAt: isset($data['firstStrikeAt']) ? Carbon::parse($data['firstStrikeAt']) : null, 64 + lastStrikeAt: isset($data['lastStrikeAt']) ? Carbon::parse($data['lastStrikeAt']) : null 65 + ); 66 + } 67 + 68 + }
+80
src/Generated/Tools/Ozone/Moderation/Defs/AgeAssuranceEvent.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Age assurance info coming directly from users. Only works on DID subjects. 12 + * 13 + * Lexicon: tools.ozone.moderation.defs.ageAssuranceEvent 14 + * Type: object 15 + * 16 + * @property Carbon $createdAt The date and time of this write operation. 17 + * @property string $status The status of the age assurance process. 18 + * @property string $attemptId The unique identifier for this instance of the age assurance flow, in UUID format. 19 + * @property string|null $initIp The IP address used when initiating the AA flow. 20 + * @property string|null $initUa The user agent used when initiating the AA flow. 21 + * @property string|null $completeIp The IP address used when completing the AA flow. 22 + * @property string|null $completeUa The user agent used when completing the AA flow. 23 + * 24 + * Constraints: 25 + * - Required: createdAt, status, attemptId 26 + * - createdAt: Format: datetime 27 + */ 28 + class AgeAssuranceEvent extends Data 29 + { 30 + /** 31 + * @param Carbon $createdAt The date and time of this write operation. 32 + * @param string $status The status of the age assurance process. 33 + * @param string $attemptId The unique identifier for this instance of the age assurance flow, in UUID format. 34 + * @param string|null $initIp The IP address used when initiating the AA flow. 35 + * @param string|null $initUa The user agent used when initiating the AA flow. 36 + * @param string|null $completeIp The IP address used when completing the AA flow. 37 + * @param string|null $completeUa The user agent used when completing the AA flow. 38 + */ 39 + public function __construct( 40 + public readonly Carbon $createdAt, 41 + public readonly string $status, 42 + public readonly string $attemptId, 43 + public readonly ?string $initIp = null, 44 + public readonly ?string $initUa = null, 45 + public readonly ?string $completeIp = null, 46 + public readonly ?string $completeUa = null 47 + ) { 48 + } 49 + 50 + /** 51 + * Get the lexicon NSID for this data type. 52 + * 53 + * @return string 54 + */ 55 + public static function getLexicon(): string 56 + { 57 + return 'tools.ozone.moderation.defs.ageAssuranceEvent'; 58 + } 59 + 60 + 61 + /** 62 + * Create an instance from an array. 63 + * 64 + * @param array $data The data array 65 + * @return static 66 + */ 67 + public static function fromArray(array $data): static 68 + { 69 + return new static( 70 + createdAt: Carbon::parse($data['createdAt']), 71 + status: $data['status'], 72 + attemptId: $data['attemptId'], 73 + initIp: $data['initIp'] ?? null, 74 + initUa: $data['initUa'] ?? null, 75 + completeIp: $data['completeIp'] ?? null, 76 + completeUa: $data['completeUa'] ?? null 77 + ); 78 + } 79 + 80 + }
+58
src/Generated/Tools/Ozone/Moderation/Defs/AgeAssuranceOverrideEvent.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Age assurance status override by moderators. Only works on DID subjects. 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.ageAssuranceOverrideEvent 13 + * Type: object 14 + * 15 + * @property string $status The status to be set for the user decided by a moderator, overriding whatever value the user had previously. Use reset to default to original state. 16 + * @property string $comment Comment describing the reason for the override. 17 + * 18 + * Constraints: 19 + * - Required: comment, status 20 + */ 21 + class AgeAssuranceOverrideEvent extends Data 22 + { 23 + /** 24 + * @param string $status The status to be set for the user decided by a moderator, overriding whatever value the user had previously. Use reset to default to original state. 25 + * @param string $comment Comment describing the reason for the override. 26 + */ 27 + public function __construct( 28 + public readonly string $status, 29 + public readonly string $comment 30 + ) { 31 + } 32 + 33 + /** 34 + * Get the lexicon NSID for this data type. 35 + * 36 + * @return string 37 + */ 38 + public static function getLexicon(): string 39 + { 40 + return 'tools.ozone.moderation.defs.ageAssuranceOverrideEvent'; 41 + } 42 + 43 + 44 + /** 45 + * Create an instance from an array. 46 + * 47 + * @param array $data The data array 48 + * @return static 49 + */ 50 + public static function fromArray(array $data): static 51 + { 52 + return new static( 53 + status: $data['status'], 54 + comment: $data['comment'] 55 + ); 56 + } 57 + 58 + }
+68
src/Generated/Tools/Ozone/Moderation/Defs/BlobView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Support\UnionHelper; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.blobView 13 + * Type: object 14 + * 15 + * @property string $cid 16 + * @property string $mimeType 17 + * @property int $size 18 + * @property Carbon $createdAt 19 + * @property mixed $details 20 + * @property mixed $moderation 21 + * 22 + * Constraints: 23 + * - Required: cid, mimeType, size, createdAt 24 + * - cid: Format: cid 25 + * - createdAt: Format: datetime 26 + */ 27 + class BlobView extends Data 28 + { 29 + public function __construct( 30 + public readonly string $cid, 31 + public readonly string $mimeType, 32 + public readonly int $size, 33 + public readonly Carbon $createdAt, 34 + public readonly mixed $details = null, 35 + public readonly mixed $moderation = null 36 + ) { 37 + } 38 + 39 + /** 40 + * Get the lexicon NSID for this data type. 41 + * 42 + * @return string 43 + */ 44 + public static function getLexicon(): string 45 + { 46 + return 'tools.ozone.moderation.defs.blobView'; 47 + } 48 + 49 + 50 + /** 51 + * Create an instance from an array. 52 + * 53 + * @param array $data The data array 54 + * @return static 55 + */ 56 + public static function fromArray(array $data): static 57 + { 58 + return new static( 59 + cid: $data['cid'], 60 + mimeType: $data['mimeType'], 61 + size: $data['size'], 62 + createdAt: Carbon::parse($data['createdAt']), 63 + details: isset($data['details']) ? UnionHelper::validateOpenUnion($data['details']) : null, 64 + moderation: $data['moderation'] ?? null 65 + ); 66 + } 67 + 68 + }
+48
src/Generated/Tools/Ozone/Moderation/Defs/CancelScheduledTakedownEvent.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Logs cancellation of a scheduled takedown action for an account. 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.cancelScheduledTakedownEvent 13 + * Type: object 14 + * 15 + * @property string|null $comment 16 + */ 17 + class CancelScheduledTakedownEvent extends Data 18 + { 19 + public function __construct( 20 + public readonly ?string $comment = null 21 + ) { 22 + } 23 + 24 + /** 25 + * Get the lexicon NSID for this data type. 26 + * 27 + * @return string 28 + */ 29 + public static function getLexicon(): string 30 + { 31 + return 'tools.ozone.moderation.defs.cancelScheduledTakedownEvent'; 32 + } 33 + 34 + 35 + /** 36 + * Create an instance from an array. 37 + * 38 + * @param array $data The data array 39 + * @return static 40 + */ 41 + public static function fromArray(array $data): static 42 + { 43 + return new static( 44 + comment: $data['comment'] ?? null 45 + ); 46 + } 47 + 48 + }
+68
src/Generated/Tools/Ozone/Moderation/Defs/IdentityEvent.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Logs identity related events on a repo subject. Normally captured by automod 12 + * from the firehose and emitted to ozone for historical tracking. 13 + * 14 + * Lexicon: tools.ozone.moderation.defs.identityEvent 15 + * Type: object 16 + * 17 + * @property string|null $comment 18 + * @property string|null $handle 19 + * @property string|null $pdsHost 20 + * @property bool|null $tombstone 21 + * @property Carbon $timestamp 22 + * 23 + * Constraints: 24 + * - Required: timestamp 25 + * - handle: Format: handle 26 + * - pdsHost: Format: uri 27 + * - timestamp: Format: datetime 28 + */ 29 + class IdentityEvent extends Data 30 + { 31 + public function __construct( 32 + public readonly Carbon $timestamp, 33 + public readonly ?string $comment = null, 34 + public readonly ?string $handle = null, 35 + public readonly ?string $pdsHost = null, 36 + public readonly ?bool $tombstone = null 37 + ) { 38 + } 39 + 40 + /** 41 + * Get the lexicon NSID for this data type. 42 + * 43 + * @return string 44 + */ 45 + public static function getLexicon(): string 46 + { 47 + return 'tools.ozone.moderation.defs.identityEvent'; 48 + } 49 + 50 + 51 + /** 52 + * Create an instance from an array. 53 + * 54 + * @param array $data The data array 55 + * @return static 56 + */ 57 + public static function fromArray(array $data): static 58 + { 59 + return new static( 60 + timestamp: Carbon::parse($data['timestamp']), 61 + comment: $data['comment'] ?? null, 62 + handle: $data['handle'] ?? null, 63 + pdsHost: $data['pdsHost'] ?? null, 64 + tombstone: $data['tombstone'] ?? null 65 + ); 66 + } 67 + 68 + }
+52
src/Generated/Tools/Ozone/Moderation/Defs/ImageDetails.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: tools.ozone.moderation.defs.imageDetails 11 + * Type: object 12 + * 13 + * @property int $width 14 + * @property int $height 15 + * 16 + * Constraints: 17 + * - Required: width, height 18 + */ 19 + class ImageDetails extends Data 20 + { 21 + public function __construct( 22 + public readonly int $width, 23 + public readonly int $height 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'tools.ozone.moderation.defs.imageDetails'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + width: $data['width'], 48 + height: $data['height'] 49 + ); 50 + } 51 + 52 + }
+52
src/Generated/Tools/Ozone/Moderation/Defs/ModEventAcknowledge.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: tools.ozone.moderation.defs.modEventAcknowledge 11 + * Type: object 12 + * 13 + * @property string|null $comment 14 + * @property bool|null $acknowledgeAccountSubjects If true, all other reports on content authored by this account will be resolved (acknowledged). 15 + */ 16 + class ModEventAcknowledge extends Data 17 + { 18 + /** 19 + * @param bool|null $acknowledgeAccountSubjects If true, all other reports on content authored by this account will be resolved (acknowledged). 20 + */ 21 + public function __construct( 22 + public readonly ?string $comment = null, 23 + public readonly ?bool $acknowledgeAccountSubjects = null 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'tools.ozone.moderation.defs.modEventAcknowledge'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + comment: $data['comment'] ?? null, 48 + acknowledgeAccountSubjects: $data['acknowledgeAccountSubjects'] ?? null 49 + ); 50 + } 51 + 52 + }
+55
src/Generated/Tools/Ozone/Moderation/Defs/ModEventComment.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Add a comment to a subject. An empty comment will clear any previously set 11 + * sticky comment. 12 + * 13 + * Lexicon: tools.ozone.moderation.defs.modEventComment 14 + * Type: object 15 + * 16 + * @property string|null $comment 17 + * @property bool|null $sticky Make the comment persistent on the subject 18 + */ 19 + class ModEventComment extends Data 20 + { 21 + /** 22 + * @param bool|null $sticky Make the comment persistent on the subject 23 + */ 24 + public function __construct( 25 + public readonly ?string $comment = null, 26 + public readonly ?bool $sticky = null 27 + ) { 28 + } 29 + 30 + /** 31 + * Get the lexicon NSID for this data type. 32 + * 33 + * @return string 34 + */ 35 + public static function getLexicon(): string 36 + { 37 + return 'tools.ozone.moderation.defs.modEventComment'; 38 + } 39 + 40 + 41 + /** 42 + * Create an instance from an array. 43 + * 44 + * @param array $data The data array 45 + * @return static 46 + */ 47 + public static function fromArray(array $data): static 48 + { 49 + return new static( 50 + comment: $data['comment'] ?? null, 51 + sticky: $data['sticky'] ?? null 52 + ); 53 + } 54 + 55 + }
+48
src/Generated/Tools/Ozone/Moderation/Defs/ModEventDivert.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Divert a record's blobs to a 3rd party service for further scanning/tagging 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.modEventDivert 13 + * Type: object 14 + * 15 + * @property string|null $comment 16 + */ 17 + class ModEventDivert extends Data 18 + { 19 + public function __construct( 20 + public readonly ?string $comment = null 21 + ) { 22 + } 23 + 24 + /** 25 + * Get the lexicon NSID for this data type. 26 + * 27 + * @return string 28 + */ 29 + public static function getLexicon(): string 30 + { 31 + return 'tools.ozone.moderation.defs.modEventDivert'; 32 + } 33 + 34 + 35 + /** 36 + * Create an instance from an array. 37 + * 38 + * @param array $data The data array 39 + * @return static 40 + */ 41 + public static function fromArray(array $data): static 42 + { 43 + return new static( 44 + comment: $data['comment'] ?? null 45 + ); 46 + } 47 + 48 + }
+85
src/Generated/Tools/Ozone/Moderation/Defs/ModEventEmail.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Keep a log of outgoing email to a user 12 + * 13 + * Lexicon: tools.ozone.moderation.defs.modEventEmail 14 + * Type: object 15 + * 16 + * @property string $subjectLine The subject line of the email sent to the user. 17 + * @property string|null $content The content of the email sent to the user. 18 + * @property string|null $comment Additional comment about the outgoing comm. 19 + * @property array<string>|null $policies Names/Keywords of the policies that necessitated the email. 20 + * @property string|null $severityLevel Severity level of the violation. Normally 'sev-1' that adds strike on repeat offense 21 + * @property int|null $strikeCount Number of strikes to assign to the user for this violation. Normally 0 as an indicator of a warning and only added as a strike on a repeat offense. 22 + * @property Carbon|null $strikeExpiresAt When the strike should expire. If not provided, the strike never expires. 23 + * @property bool|null $isDelivered Indicates whether the email was successfully delivered to the user's inbox. 24 + * 25 + * Constraints: 26 + * - Required: subjectLine 27 + * - policies: Max length: 5 28 + * - strikeExpiresAt: Format: datetime 29 + */ 30 + class ModEventEmail extends Data 31 + { 32 + /** 33 + * @param string $subjectLine The subject line of the email sent to the user. 34 + * @param string|null $content The content of the email sent to the user. 35 + * @param string|null $comment Additional comment about the outgoing comm. 36 + * @param array<string>|null $policies Names/Keywords of the policies that necessitated the email. 37 + * @param string|null $severityLevel Severity level of the violation. Normally 'sev-1' that adds strike on repeat offense 38 + * @param int|null $strikeCount Number of strikes to assign to the user for this violation. Normally 0 as an indicator of a warning and only added as a strike on a repeat offense. 39 + * @param Carbon|null $strikeExpiresAt When the strike should expire. If not provided, the strike never expires. 40 + * @param bool|null $isDelivered Indicates whether the email was successfully delivered to the user's inbox. 41 + */ 42 + public function __construct( 43 + public readonly string $subjectLine, 44 + public readonly ?string $content = null, 45 + public readonly ?string $comment = null, 46 + public readonly ?array $policies = null, 47 + public readonly ?string $severityLevel = null, 48 + public readonly ?int $strikeCount = null, 49 + public readonly ?Carbon $strikeExpiresAt = null, 50 + public readonly ?bool $isDelivered = null 51 + ) { 52 + } 53 + 54 + /** 55 + * Get the lexicon NSID for this data type. 56 + * 57 + * @return string 58 + */ 59 + public static function getLexicon(): string 60 + { 61 + return 'tools.ozone.moderation.defs.modEventEmail'; 62 + } 63 + 64 + 65 + /** 66 + * Create an instance from an array. 67 + * 68 + * @param array $data The data array 69 + * @return static 70 + */ 71 + public static function fromArray(array $data): static 72 + { 73 + return new static( 74 + subjectLine: $data['subjectLine'], 75 + content: $data['content'] ?? null, 76 + comment: $data['comment'] ?? null, 77 + policies: $data['policies'] ?? null, 78 + severityLevel: $data['severityLevel'] ?? null, 79 + strikeCount: $data['strikeCount'] ?? null, 80 + strikeExpiresAt: isset($data['strikeExpiresAt']) ? Carbon::parse($data['strikeExpiresAt']) : null, 81 + isDelivered: $data['isDelivered'] ?? null 82 + ); 83 + } 84 + 85 + }
+46
src/Generated/Tools/Ozone/Moderation/Defs/ModEventEscalate.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: tools.ozone.moderation.defs.modEventEscalate 11 + * Type: object 12 + * 13 + * @property string|null $comment 14 + */ 15 + class ModEventEscalate extends Data 16 + { 17 + public function __construct( 18 + public readonly ?string $comment = null 19 + ) { 20 + } 21 + 22 + /** 23 + * Get the lexicon NSID for this data type. 24 + * 25 + * @return string 26 + */ 27 + public static function getLexicon(): string 28 + { 29 + return 'tools.ozone.moderation.defs.modEventEscalate'; 30 + } 31 + 32 + 33 + /** 34 + * Create an instance from an array. 35 + * 36 + * @param array $data The data array 37 + * @return static 38 + */ 39 + public static function fromArray(array $data): static 40 + { 41 + return new static( 42 + comment: $data['comment'] ?? null 43 + ); 44 + } 45 + 46 + }
+63
src/Generated/Tools/Ozone/Moderation/Defs/ModEventLabel.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Apply/Negate labels on a subject 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.modEventLabel 13 + * Type: object 14 + * 15 + * @property string|null $comment 16 + * @property array<string> $createLabelVals 17 + * @property array<string> $negateLabelVals 18 + * @property int|null $durationInHours Indicates how long the label will remain on the subject. Only applies on labels that are being added. 19 + * 20 + * Constraints: 21 + * - Required: createLabelVals, negateLabelVals 22 + */ 23 + class ModEventLabel extends Data 24 + { 25 + /** 26 + * @param int|null $durationInHours Indicates how long the label will remain on the subject. Only applies on labels that are being added. 27 + */ 28 + public function __construct( 29 + public readonly array $createLabelVals, 30 + public readonly array $negateLabelVals, 31 + public readonly ?string $comment = null, 32 + public readonly ?int $durationInHours = null 33 + ) { 34 + } 35 + 36 + /** 37 + * Get the lexicon NSID for this data type. 38 + * 39 + * @return string 40 + */ 41 + public static function getLexicon(): string 42 + { 43 + return 'tools.ozone.moderation.defs.modEventLabel'; 44 + } 45 + 46 + 47 + /** 48 + * Create an instance from an array. 49 + * 50 + * @param array $data The data array 51 + * @return static 52 + */ 53 + public static function fromArray(array $data): static 54 + { 55 + return new static( 56 + createLabelVals: $data['createLabelVals'], 57 + negateLabelVals: $data['negateLabelVals'], 58 + comment: $data['comment'] ?? null, 59 + durationInHours: $data['durationInHours'] ?? null 60 + ); 61 + } 62 + 63 + }
+57
src/Generated/Tools/Ozone/Moderation/Defs/ModEventMute.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Mute incoming reports on a subject 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.modEventMute 13 + * Type: object 14 + * 15 + * @property string|null $comment 16 + * @property int $durationInHours Indicates how long the subject should remain muted. 17 + * 18 + * Constraints: 19 + * - Required: durationInHours 20 + */ 21 + class ModEventMute extends Data 22 + { 23 + /** 24 + * @param int $durationInHours Indicates how long the subject should remain muted. 25 + */ 26 + public function __construct( 27 + public readonly int $durationInHours, 28 + public readonly ?string $comment = null 29 + ) { 30 + } 31 + 32 + /** 33 + * Get the lexicon NSID for this data type. 34 + * 35 + * @return string 36 + */ 37 + public static function getLexicon(): string 38 + { 39 + return 'tools.ozone.moderation.defs.modEventMute'; 40 + } 41 + 42 + 43 + /** 44 + * Create an instance from an array. 45 + * 46 + * @param array $data The data array 47 + * @return static 48 + */ 49 + public static function fromArray(array $data): static 50 + { 51 + return new static( 52 + durationInHours: $data['durationInHours'], 53 + comment: $data['comment'] ?? null 54 + ); 55 + } 56 + 57 + }
+54
src/Generated/Tools/Ozone/Moderation/Defs/ModEventMuteReporter.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Mute incoming reports from an account 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.modEventMuteReporter 13 + * Type: object 14 + * 15 + * @property string|null $comment 16 + * @property int|null $durationInHours Indicates how long the account should remain muted. Falsy value here means a permanent mute. 17 + */ 18 + class ModEventMuteReporter extends Data 19 + { 20 + /** 21 + * @param int|null $durationInHours Indicates how long the account should remain muted. Falsy value here means a permanent mute. 22 + */ 23 + public function __construct( 24 + public readonly ?string $comment = null, 25 + public readonly ?int $durationInHours = null 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'tools.ozone.moderation.defs.modEventMuteReporter'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + comment: $data['comment'] ?? null, 50 + durationInHours: $data['durationInHours'] ?? null 51 + ); 52 + } 53 + 54 + }
+56
src/Generated/Tools/Ozone/Moderation/Defs/ModEventPriorityScore.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Set priority score of the subject. Higher score means higher priority. 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.modEventPriorityScore 13 + * Type: object 14 + * 15 + * @property string|null $comment 16 + * @property int $score 17 + * 18 + * Constraints: 19 + * - Required: score 20 + * - score: Maximum: 100 21 + * - score: Minimum: 0 22 + */ 23 + class ModEventPriorityScore extends Data 24 + { 25 + public function __construct( 26 + public readonly int $score, 27 + public readonly ?string $comment = null 28 + ) { 29 + } 30 + 31 + /** 32 + * Get the lexicon NSID for this data type. 33 + * 34 + * @return string 35 + */ 36 + public static function getLexicon(): string 37 + { 38 + return 'tools.ozone.moderation.defs.modEventPriorityScore'; 39 + } 40 + 41 + 42 + /** 43 + * Create an instance from an array. 44 + * 45 + * @param array $data The data array 46 + * @return static 47 + */ 48 + public static function fromArray(array $data): static 49 + { 50 + return new static( 51 + score: $data['score'], 52 + comment: $data['comment'] ?? null 53 + ); 54 + } 55 + 56 + }
+61
src/Generated/Tools/Ozone/Moderation/Defs/ModEventReport.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\Com\Atproto\Moderation\Defs\ReasonType; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Report a subject 12 + * 13 + * Lexicon: tools.ozone.moderation.defs.modEventReport 14 + * Type: object 15 + * 16 + * @property string|null $comment 17 + * @property bool|null $isReporterMuted 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. 18 + * @property ReasonType $reportType 19 + * 20 + * Constraints: 21 + * - Required: reportType 22 + */ 23 + class ModEventReport extends Data 24 + { 25 + /** 26 + * @param bool|null $isReporterMuted 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. 27 + */ 28 + public function __construct( 29 + public readonly ReasonType $reportType, 30 + public readonly ?string $comment = null, 31 + public readonly ?bool $isReporterMuted = null 32 + ) { 33 + } 34 + 35 + /** 36 + * Get the lexicon NSID for this data type. 37 + * 38 + * @return string 39 + */ 40 + public static function getLexicon(): string 41 + { 42 + return 'tools.ozone.moderation.defs.modEventReport'; 43 + } 44 + 45 + 46 + /** 47 + * Create an instance from an array. 48 + * 49 + * @param array $data The data array 50 + * @return static 51 + */ 52 + public static function fromArray(array $data): static 53 + { 54 + return new static( 55 + reportType: ReasonType::fromArray($data['reportType']), 56 + comment: $data['comment'] ?? null, 57 + isReporterMuted: $data['isReporterMuted'] ?? null 58 + ); 59 + } 60 + 61 + }
+51
src/Generated/Tools/Ozone/Moderation/Defs/ModEventResolveAppeal.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Resolve appeal on a subject 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.modEventResolveAppeal 13 + * Type: object 14 + * 15 + * @property string|null $comment Describe resolution. 16 + */ 17 + class ModEventResolveAppeal extends Data 18 + { 19 + /** 20 + * @param string|null $comment Describe resolution. 21 + */ 22 + public function __construct( 23 + public readonly ?string $comment = null 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'tools.ozone.moderation.defs.modEventResolveAppeal'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + comment: $data['comment'] ?? null 48 + ); 49 + } 50 + 51 + }
+66
src/Generated/Tools/Ozone/Moderation/Defs/ModEventReverseTakedown.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Revert take down action on a subject 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.modEventReverseTakedown 13 + * Type: object 14 + * 15 + * @property string|null $comment Describe reasoning behind the reversal. 16 + * @property array<string>|null $policies Names/Keywords of the policy infraction for which takedown is being reversed. 17 + * @property string|null $severityLevel Severity level of the violation. Usually set from the last policy infraction's severity. 18 + * @property int|null $strikeCount Number of strikes to subtract from the user's strike count. Usually set from the last policy infraction's severity. 19 + * 20 + * Constraints: 21 + * - policies: Max length: 5 22 + */ 23 + class ModEventReverseTakedown extends Data 24 + { 25 + /** 26 + * @param string|null $comment Describe reasoning behind the reversal. 27 + * @param array<string>|null $policies Names/Keywords of the policy infraction for which takedown is being reversed. 28 + * @param string|null $severityLevel Severity level of the violation. Usually set from the last policy infraction's severity. 29 + * @param int|null $strikeCount Number of strikes to subtract from the user's strike count. Usually set from the last policy infraction's severity. 30 + */ 31 + public function __construct( 32 + public readonly ?string $comment = null, 33 + public readonly ?array $policies = null, 34 + public readonly ?string $severityLevel = null, 35 + public readonly ?int $strikeCount = null 36 + ) { 37 + } 38 + 39 + /** 40 + * Get the lexicon NSID for this data type. 41 + * 42 + * @return string 43 + */ 44 + public static function getLexicon(): string 45 + { 46 + return 'tools.ozone.moderation.defs.modEventReverseTakedown'; 47 + } 48 + 49 + 50 + /** 51 + * Create an instance from an array. 52 + * 53 + * @param array $data The data array 54 + * @return static 55 + */ 56 + public static function fromArray(array $data): static 57 + { 58 + return new static( 59 + comment: $data['comment'] ?? null, 60 + policies: $data['policies'] ?? null, 61 + severityLevel: $data['severityLevel'] ?? null, 62 + strikeCount: $data['strikeCount'] ?? null 63 + ); 64 + } 65 + 66 + }
+62
src/Generated/Tools/Ozone/Moderation/Defs/ModEventTag.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Add/Remove a tag on a subject 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.modEventTag 13 + * Type: object 14 + * 15 + * @property array<string> $add Tags to be added to the subject. If already exists, won't be duplicated. 16 + * @property array<string> $remove Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated. 17 + * @property string|null $comment Additional comment about added/removed tags. 18 + * 19 + * Constraints: 20 + * - Required: add, remove 21 + */ 22 + class ModEventTag extends Data 23 + { 24 + /** 25 + * @param array<string> $add Tags to be added to the subject. If already exists, won't be duplicated. 26 + * @param array<string> $remove Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated. 27 + * @param string|null $comment Additional comment about added/removed tags. 28 + */ 29 + public function __construct( 30 + public readonly array $add, 31 + public readonly array $remove, 32 + public readonly ?string $comment = null 33 + ) { 34 + } 35 + 36 + /** 37 + * Get the lexicon NSID for this data type. 38 + * 39 + * @return string 40 + */ 41 + public static function getLexicon(): string 42 + { 43 + return 'tools.ozone.moderation.defs.modEventTag'; 44 + } 45 + 46 + 47 + /** 48 + * Create an instance from an array. 49 + * 50 + * @param array $data The data array 51 + * @return static 52 + */ 53 + public static function fromArray(array $data): static 54 + { 55 + return new static( 56 + add: $data['add'], 57 + remove: $data['remove'], 58 + comment: $data['comment'] ?? null 59 + ); 60 + } 61 + 62 + }
+83
src/Generated/Tools/Ozone/Moderation/Defs/ModEventTakedown.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Take down a subject permanently or temporarily 12 + * 13 + * Lexicon: tools.ozone.moderation.defs.modEventTakedown 14 + * Type: object 15 + * 16 + * @property string|null $comment 17 + * @property int|null $durationInHours Indicates how long the takedown should be in effect before automatically expiring. 18 + * @property bool|null $acknowledgeAccountSubjects If true, all other reports on content authored by this account will be resolved (acknowledged). 19 + * @property array<string>|null $policies Names/Keywords of the policies that drove the decision. 20 + * @property string|null $severityLevel Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.). 21 + * @property array<string>|null $targetServices List of services where the takedown should be applied. If empty or not provided, takedown is applied on all configured services. 22 + * @property int|null $strikeCount Number of strikes to assign to the user for this violation. 23 + * @property Carbon|null $strikeExpiresAt When the strike should expire. If not provided, the strike never expires. 24 + * 25 + * Constraints: 26 + * - policies: Max length: 5 27 + * - strikeExpiresAt: Format: datetime 28 + */ 29 + class ModEventTakedown extends Data 30 + { 31 + /** 32 + * @param int|null $durationInHours Indicates how long the takedown should be in effect before automatically expiring. 33 + * @param bool|null $acknowledgeAccountSubjects If true, all other reports on content authored by this account will be resolved (acknowledged). 34 + * @param array<string>|null $policies Names/Keywords of the policies that drove the decision. 35 + * @param string|null $severityLevel Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.). 36 + * @param array<string>|null $targetServices List of services where the takedown should be applied. If empty or not provided, takedown is applied on all configured services. 37 + * @param int|null $strikeCount Number of strikes to assign to the user for this violation. 38 + * @param Carbon|null $strikeExpiresAt When the strike should expire. If not provided, the strike never expires. 39 + */ 40 + public function __construct( 41 + public readonly ?string $comment = null, 42 + public readonly ?int $durationInHours = null, 43 + public readonly ?bool $acknowledgeAccountSubjects = null, 44 + public readonly ?array $policies = null, 45 + public readonly ?string $severityLevel = null, 46 + public readonly ?array $targetServices = null, 47 + public readonly ?int $strikeCount = null, 48 + public readonly ?Carbon $strikeExpiresAt = null 49 + ) { 50 + } 51 + 52 + /** 53 + * Get the lexicon NSID for this data type. 54 + * 55 + * @return string 56 + */ 57 + public static function getLexicon(): string 58 + { 59 + return 'tools.ozone.moderation.defs.modEventTakedown'; 60 + } 61 + 62 + 63 + /** 64 + * Create an instance from an array. 65 + * 66 + * @param array $data The data array 67 + * @return static 68 + */ 69 + public static function fromArray(array $data): static 70 + { 71 + return new static( 72 + comment: $data['comment'] ?? null, 73 + durationInHours: $data['durationInHours'] ?? null, 74 + acknowledgeAccountSubjects: $data['acknowledgeAccountSubjects'] ?? null, 75 + policies: $data['policies'] ?? null, 76 + severityLevel: $data['severityLevel'] ?? null, 77 + targetServices: $data['targetServices'] ?? null, 78 + strikeCount: $data['strikeCount'] ?? null, 79 + strikeExpiresAt: isset($data['strikeExpiresAt']) ? Carbon::parse($data['strikeExpiresAt']) : null 80 + ); 81 + } 82 + 83 + }
+51
src/Generated/Tools/Ozone/Moderation/Defs/ModEventUnmute.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Unmute action on a subject 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.modEventUnmute 13 + * Type: object 14 + * 15 + * @property string|null $comment Describe reasoning behind the reversal. 16 + */ 17 + class ModEventUnmute extends Data 18 + { 19 + /** 20 + * @param string|null $comment Describe reasoning behind the reversal. 21 + */ 22 + public function __construct( 23 + public readonly ?string $comment = null 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'tools.ozone.moderation.defs.modEventUnmute'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + comment: $data['comment'] ?? null 48 + ); 49 + } 50 + 51 + }
+51
src/Generated/Tools/Ozone/Moderation/Defs/ModEventUnmuteReporter.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Unmute incoming reports from an account 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.modEventUnmuteReporter 13 + * Type: object 14 + * 15 + * @property string|null $comment Describe reasoning behind the reversal. 16 + */ 17 + class ModEventUnmuteReporter extends Data 18 + { 19 + /** 20 + * @param string|null $comment Describe reasoning behind the reversal. 21 + */ 22 + public function __construct( 23 + public readonly ?string $comment = null 24 + ) { 25 + } 26 + 27 + /** 28 + * Get the lexicon NSID for this data type. 29 + * 30 + * @return string 31 + */ 32 + public static function getLexicon(): string 33 + { 34 + return 'tools.ozone.moderation.defs.modEventUnmuteReporter'; 35 + } 36 + 37 + 38 + /** 39 + * Create an instance from an array. 40 + * 41 + * @param array $data The data array 42 + * @return static 43 + */ 44 + public static function fromArray(array $data): static 45 + { 46 + return new static( 47 + comment: $data['comment'] ?? null 48 + ); 49 + } 50 + 51 + }
+77
src/Generated/Tools/Ozone/Moderation/Defs/ModEventView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Support\UnionHelper; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.modEventView 13 + * Type: object 14 + * 15 + * @property int $id 16 + * @property mixed $event 17 + * @property mixed $subject 18 + * @property array<string> $subjectBlobCids 19 + * @property string $createdBy 20 + * @property Carbon $createdAt 21 + * @property string|null $creatorHandle 22 + * @property string|null $subjectHandle 23 + * @property mixed $modTool 24 + * 25 + * Constraints: 26 + * - Required: id, event, subject, subjectBlobCids, createdBy, createdAt 27 + * - createdBy: Format: did 28 + * - createdAt: Format: datetime 29 + */ 30 + class ModEventView extends Data 31 + { 32 + public function __construct( 33 + public readonly int $id, 34 + public readonly mixed $event, 35 + public readonly mixed $subject, 36 + public readonly array $subjectBlobCids, 37 + public readonly string $createdBy, 38 + public readonly Carbon $createdAt, 39 + public readonly ?string $creatorHandle = null, 40 + public readonly ?string $subjectHandle = null, 41 + public readonly mixed $modTool = null 42 + ) { 43 + } 44 + 45 + /** 46 + * Get the lexicon NSID for this data type. 47 + * 48 + * @return string 49 + */ 50 + public static function getLexicon(): string 51 + { 52 + return 'tools.ozone.moderation.defs.modEventView'; 53 + } 54 + 55 + 56 + /** 57 + * Create an instance from an array. 58 + * 59 + * @param array $data The data array 60 + * @return static 61 + */ 62 + public static function fromArray(array $data): static 63 + { 64 + return new static( 65 + id: $data['id'], 66 + event: UnionHelper::validateOpenUnion($data['event']), 67 + subject: UnionHelper::validateOpenUnion($data['subject']), 68 + subjectBlobCids: $data['subjectBlobCids'], 69 + createdBy: $data['createdBy'], 70 + createdAt: Carbon::parse($data['createdAt']), 71 + creatorHandle: $data['creatorHandle'] ?? null, 72 + subjectHandle: $data['subjectHandle'] ?? null, 73 + modTool: $data['modTool'] ?? null 74 + ); 75 + } 76 + 77 + }
+71
src/Generated/Tools/Ozone/Moderation/Defs/ModEventViewDetail.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Support\UnionHelper; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.modEventViewDetail 13 + * Type: object 14 + * 15 + * @property int $id 16 + * @property mixed $event 17 + * @property mixed $subject 18 + * @property array $subjectBlobs 19 + * @property string $createdBy 20 + * @property Carbon $createdAt 21 + * @property mixed $modTool 22 + * 23 + * Constraints: 24 + * - Required: id, event, subject, subjectBlobs, createdBy, createdAt 25 + * - createdBy: Format: did 26 + * - createdAt: Format: datetime 27 + */ 28 + class ModEventViewDetail extends Data 29 + { 30 + public function __construct( 31 + public readonly int $id, 32 + public readonly mixed $event, 33 + public readonly mixed $subject, 34 + public readonly array $subjectBlobs, 35 + public readonly string $createdBy, 36 + public readonly Carbon $createdAt, 37 + public readonly mixed $modTool = null 38 + ) { 39 + } 40 + 41 + /** 42 + * Get the lexicon NSID for this data type. 43 + * 44 + * @return string 45 + */ 46 + public static function getLexicon(): string 47 + { 48 + return 'tools.ozone.moderation.defs.modEventViewDetail'; 49 + } 50 + 51 + 52 + /** 53 + * Create an instance from an array. 54 + * 55 + * @param array $data The data array 56 + * @return static 57 + */ 58 + public static function fromArray(array $data): static 59 + { 60 + return new static( 61 + id: $data['id'], 62 + event: UnionHelper::validateOpenUnion($data['event']), 63 + subject: UnionHelper::validateOpenUnion($data['subject']), 64 + subjectBlobs: $data['subjectBlobs'] ?? [], 65 + createdBy: $data['createdBy'], 66 + createdAt: Carbon::parse($data['createdAt']), 67 + modTool: $data['modTool'] ?? null 68 + ); 69 + } 70 + 71 + }
+58
src/Generated/Tools/Ozone/Moderation/Defs/ModTool.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Moderation tool information for tracing the source of the action 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.modTool 13 + * Type: object 14 + * 15 + * @property string $name Name/identifier of the source (e.g., 'automod', 'ozone/workspace') 16 + * @property mixed $meta Additional arbitrary metadata about the source 17 + * 18 + * Constraints: 19 + * - Required: name 20 + */ 21 + class ModTool extends Data 22 + { 23 + /** 24 + * @param string $name Name/identifier of the source (e.g., 'automod', 'ozone/workspace') 25 + * @param mixed $meta Additional arbitrary metadata about the source 26 + */ 27 + public function __construct( 28 + public readonly string $name, 29 + public readonly mixed $meta = null 30 + ) { 31 + } 32 + 33 + /** 34 + * Get the lexicon NSID for this data type. 35 + * 36 + * @return string 37 + */ 38 + public static function getLexicon(): string 39 + { 40 + return 'tools.ozone.moderation.defs.modTool'; 41 + } 42 + 43 + 44 + /** 45 + * Create an instance from an array. 46 + * 47 + * @param array $data The data array 48 + * @return static 49 + */ 50 + public static function fromArray(array $data): static 51 + { 52 + return new static( 53 + name: $data['name'], 54 + meta: $data['meta'] ?? null 55 + ); 56 + } 57 + 58 + }
+46
src/Generated/Tools/Ozone/Moderation/Defs/Moderation.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: tools.ozone.moderation.defs.moderation 11 + * Type: object 12 + * 13 + * @property mixed $subjectStatus 14 + */ 15 + class Moderation extends Data 16 + { 17 + public function __construct( 18 + public readonly mixed $subjectStatus = null 19 + ) { 20 + } 21 + 22 + /** 23 + * Get the lexicon NSID for this data type. 24 + * 25 + * @return string 26 + */ 27 + public static function getLexicon(): string 28 + { 29 + return 'tools.ozone.moderation.defs.moderation'; 30 + } 31 + 32 + 33 + /** 34 + * Create an instance from an array. 35 + * 36 + * @param array $data The data array 37 + * @return static 38 + */ 39 + public static function fromArray(array $data): static 40 + { 41 + return new static( 42 + subjectStatus: $data['subjectStatus'] ?? null 43 + ); 44 + } 45 + 46 + }
+46
src/Generated/Tools/Ozone/Moderation/Defs/ModerationDetail.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: tools.ozone.moderation.defs.moderationDetail 11 + * Type: object 12 + * 13 + * @property mixed $subjectStatus 14 + */ 15 + class ModerationDetail extends Data 16 + { 17 + public function __construct( 18 + public readonly mixed $subjectStatus = null 19 + ) { 20 + } 21 + 22 + /** 23 + * Get the lexicon NSID for this data type. 24 + * 25 + * @return string 26 + */ 27 + public static function getLexicon(): string 28 + { 29 + return 'tools.ozone.moderation.defs.moderationDetail'; 30 + } 31 + 32 + 33 + /** 34 + * Create an instance from an array. 35 + * 36 + * @param array $data The data array 37 + * @return static 38 + */ 39 + public static function fromArray(array $data): static 40 + { 41 + return new static( 42 + subjectStatus: $data['subjectStatus'] ?? null 43 + ); 44 + } 45 + 46 + }
+64
src/Generated/Tools/Ozone/Moderation/Defs/RecordEvent.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Logs lifecycle event on a record subject. Normally captured by automod from 12 + * the firehose and emitted to ozone for historical tracking. 13 + * 14 + * Lexicon: tools.ozone.moderation.defs.recordEvent 15 + * Type: object 16 + * 17 + * @property string|null $comment 18 + * @property string $op 19 + * @property string|null $cid 20 + * @property Carbon $timestamp 21 + * 22 + * Constraints: 23 + * - Required: timestamp, op 24 + * - cid: Format: cid 25 + * - timestamp: Format: datetime 26 + */ 27 + class RecordEvent extends Data 28 + { 29 + public function __construct( 30 + public readonly string $op, 31 + public readonly Carbon $timestamp, 32 + public readonly ?string $comment = null, 33 + public readonly ?string $cid = null 34 + ) { 35 + } 36 + 37 + /** 38 + * Get the lexicon NSID for this data type. 39 + * 40 + * @return string 41 + */ 42 + public static function getLexicon(): string 43 + { 44 + return 'tools.ozone.moderation.defs.recordEvent'; 45 + } 46 + 47 + 48 + /** 49 + * Create an instance from an array. 50 + * 51 + * @param array $data The data array 52 + * @return static 53 + */ 54 + public static function fromArray(array $data): static 55 + { 56 + return new static( 57 + op: $data['op'], 58 + timestamp: Carbon::parse($data['timestamp']), 59 + comment: $data['comment'] ?? null, 60 + cid: $data['cid'] ?? null 61 + ); 62 + } 63 + 64 + }
+62
src/Generated/Tools/Ozone/Moderation/Defs/RecordHosting.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: tools.ozone.moderation.defs.recordHosting 12 + * Type: object 13 + * 14 + * @property string $status 15 + * @property Carbon|null $updatedAt 16 + * @property Carbon|null $createdAt 17 + * @property Carbon|null $deletedAt 18 + * 19 + * Constraints: 20 + * - Required: status 21 + * - updatedAt: Format: datetime 22 + * - createdAt: Format: datetime 23 + * - deletedAt: Format: datetime 24 + */ 25 + class RecordHosting extends Data 26 + { 27 + public function __construct( 28 + public readonly string $status, 29 + public readonly ?Carbon $updatedAt = null, 30 + public readonly ?Carbon $createdAt = null, 31 + public readonly ?Carbon $deletedAt = null 32 + ) { 33 + } 34 + 35 + /** 36 + * Get the lexicon NSID for this data type. 37 + * 38 + * @return string 39 + */ 40 + public static function getLexicon(): string 41 + { 42 + return 'tools.ozone.moderation.defs.recordHosting'; 43 + } 44 + 45 + 46 + /** 47 + * Create an instance from an array. 48 + * 49 + * @param array $data The data array 50 + * @return static 51 + */ 52 + public static function fromArray(array $data): static 53 + { 54 + return new static( 55 + status: $data['status'], 56 + updatedAt: isset($data['updatedAt']) ? Carbon::parse($data['updatedAt']) : null, 57 + createdAt: isset($data['createdAt']) ? Carbon::parse($data['createdAt']) : null, 58 + deletedAt: isset($data['deletedAt']) ? Carbon::parse($data['deletedAt']) : null 59 + ); 60 + } 61 + 62 + }
+71
src/Generated/Tools/Ozone/Moderation/Defs/RecordView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Lexicon: tools.ozone.moderation.defs.recordView 12 + * Type: object 13 + * 14 + * @property string $uri 15 + * @property string $cid 16 + * @property mixed $value 17 + * @property array<string> $blobCids 18 + * @property Carbon $indexedAt 19 + * @property mixed $moderation 20 + * @property mixed $repo 21 + * 22 + * Constraints: 23 + * - Required: uri, cid, value, blobCids, indexedAt, moderation, repo 24 + * - uri: Format: at-uri 25 + * - cid: Format: cid 26 + * - indexedAt: Format: datetime 27 + */ 28 + class RecordView extends Data 29 + { 30 + public function __construct( 31 + public readonly string $uri, 32 + public readonly string $cid, 33 + public readonly mixed $value, 34 + public readonly array $blobCids, 35 + public readonly Carbon $indexedAt, 36 + public readonly mixed $moderation, 37 + public readonly mixed $repo 38 + ) { 39 + } 40 + 41 + /** 42 + * Get the lexicon NSID for this data type. 43 + * 44 + * @return string 45 + */ 46 + public static function getLexicon(): string 47 + { 48 + return 'tools.ozone.moderation.defs.recordView'; 49 + } 50 + 51 + 52 + /** 53 + * Create an instance from an array. 54 + * 55 + * @param array $data The data array 56 + * @return static 57 + */ 58 + public static function fromArray(array $data): static 59 + { 60 + return new static( 61 + uri: $data['uri'], 62 + cid: $data['cid'], 63 + value: $data['value'], 64 + blobCids: $data['blobCids'], 65 + indexedAt: Carbon::parse($data['indexedAt']), 66 + moderation: $data['moderation'], 67 + repo: $data['repo'] 68 + ); 69 + } 70 + 71 + }
+75
src/Generated/Tools/Ozone/Moderation/Defs/RecordViewDetail.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\Label; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.recordViewDetail 13 + * Type: object 14 + * 15 + * @property string $uri 16 + * @property string $cid 17 + * @property mixed $value 18 + * @property array $blobs 19 + * @property array<Label>|null $labels 20 + * @property Carbon $indexedAt 21 + * @property mixed $moderation 22 + * @property mixed $repo 23 + * 24 + * Constraints: 25 + * - Required: uri, cid, value, blobs, indexedAt, moderation, repo 26 + * - uri: Format: at-uri 27 + * - cid: Format: cid 28 + * - indexedAt: Format: datetime 29 + */ 30 + class RecordViewDetail extends Data 31 + { 32 + public function __construct( 33 + public readonly string $uri, 34 + public readonly string $cid, 35 + public readonly mixed $value, 36 + public readonly array $blobs, 37 + public readonly Carbon $indexedAt, 38 + public readonly mixed $moderation, 39 + public readonly mixed $repo, 40 + public readonly ?array $labels = null 41 + ) { 42 + } 43 + 44 + /** 45 + * Get the lexicon NSID for this data type. 46 + * 47 + * @return string 48 + */ 49 + public static function getLexicon(): string 50 + { 51 + return 'tools.ozone.moderation.defs.recordViewDetail'; 52 + } 53 + 54 + 55 + /** 56 + * Create an instance from an array. 57 + * 58 + * @param array $data The data array 59 + * @return static 60 + */ 61 + public static function fromArray(array $data): static 62 + { 63 + return new static( 64 + uri: $data['uri'], 65 + cid: $data['cid'], 66 + value: $data['value'], 67 + blobs: $data['blobs'] ?? [], 68 + indexedAt: Carbon::parse($data['indexedAt']), 69 + moderation: $data['moderation'], 70 + repo: $data['repo'], 71 + labels: isset($data['labels']) ? array_map(fn ($item) => Label::fromArray($item), $data['labels']) : [] 72 + ); 73 + } 74 + 75 + }
+50
src/Generated/Tools/Ozone/Moderation/Defs/RecordViewNotFound.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: tools.ozone.moderation.defs.recordViewNotFound 11 + * Type: object 12 + * 13 + * @property string $uri 14 + * 15 + * Constraints: 16 + * - Required: uri 17 + * - uri: Format: at-uri 18 + */ 19 + class RecordViewNotFound extends Data 20 + { 21 + public function __construct( 22 + public readonly string $uri 23 + ) { 24 + } 25 + 26 + /** 27 + * Get the lexicon NSID for this data type. 28 + * 29 + * @return string 30 + */ 31 + public static function getLexicon(): string 32 + { 33 + return 'tools.ozone.moderation.defs.recordViewNotFound'; 34 + } 35 + 36 + 37 + /** 38 + * Create an instance from an array. 39 + * 40 + * @param array $data The data array 41 + * @return static 42 + */ 43 + public static function fromArray(array $data): static 44 + { 45 + return new static( 46 + uri: $data['uri'] 47 + ); 48 + } 49 + 50 + }
+79
src/Generated/Tools/Ozone/Moderation/Defs/RecordsStats.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Statistics about a set of record subject items 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.recordsStats 13 + * Type: object 14 + * 15 + * @property int|null $totalReports Cumulative sum of the number of reports on the items in the set 16 + * @property int|null $reportedCount Number of items that were reported at least once 17 + * @property int|null $escalatedCount Number of items that were escalated at least once 18 + * @property int|null $appealedCount Number of items that were appealed at least once 19 + * @property int|null $subjectCount Total number of item in the set 20 + * @property int|null $pendingCount Number of item currently in "reviewOpen" or "reviewEscalated" state 21 + * @property int|null $processedCount Number of item currently in "reviewNone" or "reviewClosed" state 22 + * @property int|null $takendownCount Number of item currently taken down 23 + */ 24 + class RecordsStats extends Data 25 + { 26 + /** 27 + * @param int|null $totalReports Cumulative sum of the number of reports on the items in the set 28 + * @param int|null $reportedCount Number of items that were reported at least once 29 + * @param int|null $escalatedCount Number of items that were escalated at least once 30 + * @param int|null $appealedCount Number of items that were appealed at least once 31 + * @param int|null $subjectCount Total number of item in the set 32 + * @param int|null $pendingCount Number of item currently in "reviewOpen" or "reviewEscalated" state 33 + * @param int|null $processedCount Number of item currently in "reviewNone" or "reviewClosed" state 34 + * @param int|null $takendownCount Number of item currently taken down 35 + */ 36 + public function __construct( 37 + public readonly ?int $totalReports = null, 38 + public readonly ?int $reportedCount = null, 39 + public readonly ?int $escalatedCount = null, 40 + public readonly ?int $appealedCount = null, 41 + public readonly ?int $subjectCount = null, 42 + public readonly ?int $pendingCount = null, 43 + public readonly ?int $processedCount = null, 44 + public readonly ?int $takendownCount = null 45 + ) { 46 + } 47 + 48 + /** 49 + * Get the lexicon NSID for this data type. 50 + * 51 + * @return string 52 + */ 53 + public static function getLexicon(): string 54 + { 55 + return 'tools.ozone.moderation.defs.recordsStats'; 56 + } 57 + 58 + 59 + /** 60 + * Create an instance from an array. 61 + * 62 + * @param array $data The data array 63 + * @return static 64 + */ 65 + public static function fromArray(array $data): static 66 + { 67 + return new static( 68 + totalReports: $data['totalReports'] ?? null, 69 + reportedCount: $data['reportedCount'] ?? null, 70 + escalatedCount: $data['escalatedCount'] ?? null, 71 + appealedCount: $data['appealedCount'] ?? null, 72 + subjectCount: $data['subjectCount'] ?? null, 73 + pendingCount: $data['pendingCount'] ?? null, 74 + processedCount: $data['processedCount'] ?? null, 75 + takendownCount: $data['takendownCount'] ?? null 76 + ); 77 + } 78 + 79 + }
+86
src/Generated/Tools/Ozone/Moderation/Defs/RepoView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\Com\Atproto\Admin\Defs\ThreatSignature; 8 + use SocialDept\AtpSchema\Generated\Com\Atproto\Server\Defs\InviteCode; 9 + 10 + /** 11 + * GENERATED CODE - DO NOT EDIT 12 + * 13 + * Lexicon: tools.ozone.moderation.defs.repoView 14 + * Type: object 15 + * 16 + * @property string $did 17 + * @property string $handle 18 + * @property string|null $email 19 + * @property array $relatedRecords 20 + * @property Carbon $indexedAt 21 + * @property mixed $moderation 22 + * @property InviteCode|null $invitedBy 23 + * @property bool|null $invitesDisabled 24 + * @property string|null $inviteNote 25 + * @property Carbon|null $deactivatedAt 26 + * @property array<ThreatSignature>|null $threatSignatures 27 + * 28 + * Constraints: 29 + * - Required: did, handle, relatedRecords, indexedAt, moderation 30 + * - did: Format: did 31 + * - handle: Format: handle 32 + * - indexedAt: Format: datetime 33 + * - deactivatedAt: Format: datetime 34 + */ 35 + class RepoView extends Data 36 + { 37 + public function __construct( 38 + public readonly string $did, 39 + public readonly string $handle, 40 + public readonly array $relatedRecords, 41 + public readonly Carbon $indexedAt, 42 + public readonly mixed $moderation, 43 + public readonly ?string $email = null, 44 + public readonly ?InviteCode $invitedBy = null, 45 + public readonly ?bool $invitesDisabled = null, 46 + public readonly ?string $inviteNote = null, 47 + public readonly ?Carbon $deactivatedAt = null, 48 + public readonly ?array $threatSignatures = null 49 + ) { 50 + } 51 + 52 + /** 53 + * Get the lexicon NSID for this data type. 54 + * 55 + * @return string 56 + */ 57 + public static function getLexicon(): string 58 + { 59 + return 'tools.ozone.moderation.defs.repoView'; 60 + } 61 + 62 + 63 + /** 64 + * Create an instance from an array. 65 + * 66 + * @param array $data The data array 67 + * @return static 68 + */ 69 + public static function fromArray(array $data): static 70 + { 71 + return new static( 72 + did: $data['did'], 73 + handle: $data['handle'], 74 + relatedRecords: $data['relatedRecords'], 75 + indexedAt: Carbon::parse($data['indexedAt']), 76 + moderation: $data['moderation'], 77 + email: $data['email'] ?? null, 78 + invitedBy: isset($data['invitedBy']) ? InviteCode::fromArray($data['invitedBy']) : null, 79 + invitesDisabled: $data['invitesDisabled'] ?? null, 80 + inviteNote: $data['inviteNote'] ?? null, 81 + deactivatedAt: isset($data['deactivatedAt']) ? Carbon::parse($data['deactivatedAt']) : null, 82 + threatSignatures: isset($data['threatSignatures']) ? array_map(fn ($item) => ThreatSignature::fromArray($item), $data['threatSignatures']) : [] 83 + ); 84 + } 85 + 86 + }
+97
src/Generated/Tools/Ozone/Moderation/Defs/RepoViewDetail.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Generated\Com\Atproto\Admin\Defs\ThreatSignature; 8 + use SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs\Label; 9 + use SocialDept\AtpSchema\Generated\Com\Atproto\Server\Defs\InviteCode; 10 + 11 + /** 12 + * GENERATED CODE - DO NOT EDIT 13 + * 14 + * Lexicon: tools.ozone.moderation.defs.repoViewDetail 15 + * Type: object 16 + * 17 + * @property string $did 18 + * @property string $handle 19 + * @property string|null $email 20 + * @property array $relatedRecords 21 + * @property Carbon $indexedAt 22 + * @property mixed $moderation 23 + * @property array<Label>|null $labels 24 + * @property InviteCode|null $invitedBy 25 + * @property array<InviteCode>|null $invites 26 + * @property bool|null $invitesDisabled 27 + * @property string|null $inviteNote 28 + * @property Carbon|null $emailConfirmedAt 29 + * @property Carbon|null $deactivatedAt 30 + * @property array<ThreatSignature>|null $threatSignatures 31 + * 32 + * Constraints: 33 + * - Required: did, handle, relatedRecords, indexedAt, moderation 34 + * - did: Format: did 35 + * - handle: Format: handle 36 + * - indexedAt: Format: datetime 37 + * - emailConfirmedAt: Format: datetime 38 + * - deactivatedAt: Format: datetime 39 + */ 40 + class RepoViewDetail extends Data 41 + { 42 + public function __construct( 43 + public readonly string $did, 44 + public readonly string $handle, 45 + public readonly array $relatedRecords, 46 + public readonly Carbon $indexedAt, 47 + public readonly mixed $moderation, 48 + public readonly ?string $email = null, 49 + public readonly ?array $labels = null, 50 + public readonly ?InviteCode $invitedBy = null, 51 + public readonly ?array $invites = null, 52 + public readonly ?bool $invitesDisabled = null, 53 + public readonly ?string $inviteNote = null, 54 + public readonly ?Carbon $emailConfirmedAt = null, 55 + public readonly ?Carbon $deactivatedAt = null, 56 + public readonly ?array $threatSignatures = null 57 + ) { 58 + } 59 + 60 + /** 61 + * Get the lexicon NSID for this data type. 62 + * 63 + * @return string 64 + */ 65 + public static function getLexicon(): string 66 + { 67 + return 'tools.ozone.moderation.defs.repoViewDetail'; 68 + } 69 + 70 + 71 + /** 72 + * Create an instance from an array. 73 + * 74 + * @param array $data The data array 75 + * @return static 76 + */ 77 + public static function fromArray(array $data): static 78 + { 79 + return new static( 80 + did: $data['did'], 81 + handle: $data['handle'], 82 + relatedRecords: $data['relatedRecords'], 83 + indexedAt: Carbon::parse($data['indexedAt']), 84 + moderation: $data['moderation'], 85 + email: $data['email'] ?? null, 86 + labels: isset($data['labels']) ? array_map(fn ($item) => Label::fromArray($item), $data['labels']) : [], 87 + invitedBy: isset($data['invitedBy']) ? InviteCode::fromArray($data['invitedBy']) : null, 88 + invites: isset($data['invites']) ? array_map(fn ($item) => InviteCode::fromArray($item), $data['invites']) : [], 89 + invitesDisabled: $data['invitesDisabled'] ?? null, 90 + inviteNote: $data['inviteNote'] ?? null, 91 + emailConfirmedAt: isset($data['emailConfirmedAt']) ? Carbon::parse($data['emailConfirmedAt']) : null, 92 + deactivatedAt: isset($data['deactivatedAt']) ? Carbon::parse($data['deactivatedAt']) : null, 93 + threatSignatures: isset($data['threatSignatures']) ? array_map(fn ($item) => ThreatSignature::fromArray($item), $data['threatSignatures']) : [] 94 + ); 95 + } 96 + 97 + }
+50
src/Generated/Tools/Ozone/Moderation/Defs/RepoViewNotFound.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: tools.ozone.moderation.defs.repoViewNotFound 11 + * Type: object 12 + * 13 + * @property string $did 14 + * 15 + * Constraints: 16 + * - Required: did 17 + * - did: Format: did 18 + */ 19 + class RepoViewNotFound extends Data 20 + { 21 + public function __construct( 22 + public readonly string $did 23 + ) { 24 + } 25 + 26 + /** 27 + * Get the lexicon NSID for this data type. 28 + * 29 + * @return string 30 + */ 31 + public static function getLexicon(): string 32 + { 33 + return 'tools.ozone.moderation.defs.repoViewNotFound'; 34 + } 35 + 36 + 37 + /** 38 + * Create an instance from an array. 39 + * 40 + * @param array $data The data array 41 + * @return static 42 + */ 43 + public static function fromArray(array $data): static 44 + { 45 + return new static( 46 + did: $data['did'] 47 + ); 48 + } 49 + 50 + }
+84
src/Generated/Tools/Ozone/Moderation/Defs/ReporterStats.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: tools.ozone.moderation.defs.reporterStats 11 + * Type: object 12 + * 13 + * @property string $did 14 + * @property int $accountReportCount The total number of reports made by the user on accounts. 15 + * @property int $recordReportCount The total number of reports made by the user on records. 16 + * @property int $reportedAccountCount The total number of accounts reported by the user. 17 + * @property int $reportedRecordCount The total number of records reported by the user. 18 + * @property int $takendownAccountCount The total number of accounts taken down as a result of the user's reports. 19 + * @property int $takendownRecordCount The total number of records taken down as a result of the user's reports. 20 + * @property int $labeledAccountCount The total number of accounts labeled as a result of the user's reports. 21 + * @property int $labeledRecordCount The total number of records labeled as a result of the user's reports. 22 + * 23 + * Constraints: 24 + * - Required: did, accountReportCount, recordReportCount, reportedAccountCount, reportedRecordCount, takendownAccountCount, takendownRecordCount, labeledAccountCount, labeledRecordCount 25 + * - did: Format: did 26 + */ 27 + class ReporterStats extends Data 28 + { 29 + /** 30 + * @param int $accountReportCount The total number of reports made by the user on accounts. 31 + * @param int $recordReportCount The total number of reports made by the user on records. 32 + * @param int $reportedAccountCount The total number of accounts reported by the user. 33 + * @param int $reportedRecordCount The total number of records reported by the user. 34 + * @param int $takendownAccountCount The total number of accounts taken down as a result of the user's reports. 35 + * @param int $takendownRecordCount The total number of records taken down as a result of the user's reports. 36 + * @param int $labeledAccountCount The total number of accounts labeled as a result of the user's reports. 37 + * @param int $labeledRecordCount The total number of records labeled as a result of the user's reports. 38 + */ 39 + public function __construct( 40 + public readonly string $did, 41 + public readonly int $accountReportCount, 42 + public readonly int $recordReportCount, 43 + public readonly int $reportedAccountCount, 44 + public readonly int $reportedRecordCount, 45 + public readonly int $takendownAccountCount, 46 + public readonly int $takendownRecordCount, 47 + public readonly int $labeledAccountCount, 48 + public readonly int $labeledRecordCount 49 + ) { 50 + } 51 + 52 + /** 53 + * Get the lexicon NSID for this data type. 54 + * 55 + * @return string 56 + */ 57 + public static function getLexicon(): string 58 + { 59 + return 'tools.ozone.moderation.defs.reporterStats'; 60 + } 61 + 62 + 63 + /** 64 + * Create an instance from an array. 65 + * 66 + * @param array $data The data array 67 + * @return static 68 + */ 69 + public static function fromArray(array $data): static 70 + { 71 + return new static( 72 + did: $data['did'], 73 + accountReportCount: $data['accountReportCount'], 74 + recordReportCount: $data['recordReportCount'], 75 + reportedAccountCount: $data['reportedAccountCount'], 76 + reportedRecordCount: $data['reportedRecordCount'], 77 + takendownAccountCount: $data['takendownAccountCount'], 78 + takendownRecordCount: $data['takendownRecordCount'], 79 + labeledAccountCount: $data['labeledAccountCount'], 80 + labeledRecordCount: $data['labeledRecordCount'] 81 + ); 82 + } 83 + 84 + }
+54
src/Generated/Tools/Ozone/Moderation/Defs/RevokeAccountCredentialsEvent.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Account credentials revocation by moderators. Only works on DID subjects. 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.revokeAccountCredentialsEvent 13 + * Type: object 14 + * 15 + * @property string $comment Comment describing the reason for the revocation. 16 + * 17 + * Constraints: 18 + * - Required: comment 19 + */ 20 + class RevokeAccountCredentialsEvent extends Data 21 + { 22 + /** 23 + * @param string $comment Comment describing the reason for the revocation. 24 + */ 25 + public function __construct( 26 + public readonly string $comment 27 + ) { 28 + } 29 + 30 + /** 31 + * Get the lexicon NSID for this data type. 32 + * 33 + * @return string 34 + */ 35 + public static function getLexicon(): string 36 + { 37 + return 'tools.ozone.moderation.defs.revokeAccountCredentialsEvent'; 38 + } 39 + 40 + 41 + /** 42 + * Create an instance from an array. 43 + * 44 + * @param array $data The data array 45 + * @return static 46 + */ 47 + public static function fromArray(array $data): static 48 + { 49 + return new static( 50 + comment: $data['comment'] 51 + ); 52 + } 53 + 54 + }
+63
src/Generated/Tools/Ozone/Moderation/Defs/ScheduleTakedownEvent.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * Logs a scheduled takedown action for an account. 12 + * 13 + * Lexicon: tools.ozone.moderation.defs.scheduleTakedownEvent 14 + * Type: object 15 + * 16 + * @property string|null $comment 17 + * @property Carbon|null $executeAt 18 + * @property Carbon|null $executeAfter 19 + * @property Carbon|null $executeUntil 20 + * 21 + * Constraints: 22 + * - executeAt: Format: datetime 23 + * - executeAfter: Format: datetime 24 + * - executeUntil: Format: datetime 25 + */ 26 + class ScheduleTakedownEvent extends Data 27 + { 28 + public function __construct( 29 + public readonly ?string $comment = null, 30 + public readonly ?Carbon $executeAt = null, 31 + public readonly ?Carbon $executeAfter = null, 32 + public readonly ?Carbon $executeUntil = null 33 + ) { 34 + } 35 + 36 + /** 37 + * Get the lexicon NSID for this data type. 38 + * 39 + * @return string 40 + */ 41 + public static function getLexicon(): string 42 + { 43 + return 'tools.ozone.moderation.defs.scheduleTakedownEvent'; 44 + } 45 + 46 + 47 + /** 48 + * Create an instance from an array. 49 + * 50 + * @param array $data The data array 51 + * @return static 52 + */ 53 + public static function fromArray(array $data): static 54 + { 55 + return new static( 56 + comment: $data['comment'] ?? null, 57 + executeAt: isset($data['executeAt']) ? Carbon::parse($data['executeAt']) : null, 58 + executeAfter: isset($data['executeAfter']) ? Carbon::parse($data['executeAfter']) : null, 59 + executeUntil: isset($data['executeUntil']) ? Carbon::parse($data['executeUntil']) : null 60 + ); 61 + } 62 + 63 + }
+119
src/Generated/Tools/Ozone/Moderation/Defs/ScheduledActionView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + 8 + /** 9 + * GENERATED CODE - DO NOT EDIT 10 + * 11 + * View of a scheduled moderation action 12 + * 13 + * Lexicon: tools.ozone.moderation.defs.scheduledActionView 14 + * Type: object 15 + * 16 + * @property int $id Auto-incrementing row ID 17 + * @property string $action Type of action to be executed 18 + * @property mixed $eventData Serialized event object that will be propagated to the event when performed 19 + * @property string $did Subject DID for the action 20 + * @property Carbon|null $executeAt Exact time to execute the action 21 + * @property Carbon|null $executeAfter Earliest time to execute the action (for randomized scheduling) 22 + * @property Carbon|null $executeUntil Latest time to execute the action (for randomized scheduling) 23 + * @property bool|null $randomizeExecution Whether execution time should be randomized within the specified range 24 + * @property string $createdBy DID of the user who created this scheduled action 25 + * @property Carbon $createdAt When the scheduled action was created 26 + * @property Carbon|null $updatedAt When the scheduled action was last updated 27 + * @property string $status Current status of the scheduled action 28 + * @property Carbon|null $lastExecutedAt When the action was last attempted to be executed 29 + * @property string|null $lastFailureReason Reason for the last execution failure 30 + * @property int|null $executionEventId ID of the moderation event created when action was successfully executed 31 + * 32 + * Constraints: 33 + * - Required: id, action, did, createdBy, createdAt, status 34 + * - did: Format: did 35 + * - executeAt: Format: datetime 36 + * - executeAfter: Format: datetime 37 + * - executeUntil: Format: datetime 38 + * - createdBy: Format: did 39 + * - createdAt: Format: datetime 40 + * - updatedAt: Format: datetime 41 + * - lastExecutedAt: Format: datetime 42 + */ 43 + class ScheduledActionView extends Data 44 + { 45 + /** 46 + * @param int $id Auto-incrementing row ID 47 + * @param string $action Type of action to be executed 48 + * @param string $did Subject DID for the action 49 + * @param string $createdBy DID of the user who created this scheduled action 50 + * @param Carbon $createdAt When the scheduled action was created 51 + * @param string $status Current status of the scheduled action 52 + * @param mixed $eventData Serialized event object that will be propagated to the event when performed 53 + * @param Carbon|null $executeAt Exact time to execute the action 54 + * @param Carbon|null $executeAfter Earliest time to execute the action (for randomized scheduling) 55 + * @param Carbon|null $executeUntil Latest time to execute the action (for randomized scheduling) 56 + * @param bool|null $randomizeExecution Whether execution time should be randomized within the specified range 57 + * @param Carbon|null $updatedAt When the scheduled action was last updated 58 + * @param Carbon|null $lastExecutedAt When the action was last attempted to be executed 59 + * @param string|null $lastFailureReason Reason for the last execution failure 60 + * @param int|null $executionEventId ID of the moderation event created when action was successfully executed 61 + */ 62 + public function __construct( 63 + public readonly int $id, 64 + public readonly string $action, 65 + public readonly string $did, 66 + public readonly string $createdBy, 67 + public readonly Carbon $createdAt, 68 + public readonly string $status, 69 + public readonly mixed $eventData = null, 70 + public readonly ?Carbon $executeAt = null, 71 + public readonly ?Carbon $executeAfter = null, 72 + public readonly ?Carbon $executeUntil = null, 73 + public readonly ?bool $randomizeExecution = null, 74 + public readonly ?Carbon $updatedAt = null, 75 + public readonly ?Carbon $lastExecutedAt = null, 76 + public readonly ?string $lastFailureReason = null, 77 + public readonly ?int $executionEventId = null 78 + ) { 79 + } 80 + 81 + /** 82 + * Get the lexicon NSID for this data type. 83 + * 84 + * @return string 85 + */ 86 + public static function getLexicon(): string 87 + { 88 + return 'tools.ozone.moderation.defs.scheduledActionView'; 89 + } 90 + 91 + 92 + /** 93 + * Create an instance from an array. 94 + * 95 + * @param array $data The data array 96 + * @return static 97 + */ 98 + public static function fromArray(array $data): static 99 + { 100 + return new static( 101 + id: $data['id'], 102 + action: $data['action'], 103 + did: $data['did'], 104 + createdBy: $data['createdBy'], 105 + createdAt: Carbon::parse($data['createdAt']), 106 + status: $data['status'], 107 + eventData: $data['eventData'] ?? null, 108 + executeAt: isset($data['executeAt']) ? Carbon::parse($data['executeAt']) : null, 109 + executeAfter: isset($data['executeAfter']) ? Carbon::parse($data['executeAfter']) : null, 110 + executeUntil: isset($data['executeUntil']) ? Carbon::parse($data['executeUntil']) : null, 111 + randomizeExecution: $data['randomizeExecution'] ?? null, 112 + updatedAt: isset($data['updatedAt']) ? Carbon::parse($data['updatedAt']) : null, 113 + lastExecutedAt: isset($data['lastExecutedAt']) ? Carbon::parse($data['lastExecutedAt']) : null, 114 + lastFailureReason: $data['lastFailureReason'] ?? null, 115 + executionEventId: $data['executionEventId'] ?? null 116 + ); 117 + } 118 + 119 + }
+147
src/Generated/Tools/Ozone/Moderation/Defs/SubjectStatusView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use Carbon\Carbon; 6 + use SocialDept\AtpSchema\Data\Data; 7 + use SocialDept\AtpSchema\Support\UnionHelper; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Lexicon: tools.ozone.moderation.defs.subjectStatusView 13 + * Type: object 14 + * 15 + * @property int $id 16 + * @property mixed $subject 17 + * @property mixed $hosting 18 + * @property array<string>|null $subjectBlobCids 19 + * @property string|null $subjectRepoHandle 20 + * @property Carbon $updatedAt Timestamp referencing when the last update was made to the moderation status of the subject 21 + * @property Carbon $createdAt Timestamp referencing the first moderation status impacting event was emitted on the subject 22 + * @property mixed $reviewState 23 + * @property string|null $comment Sticky comment on the subject. 24 + * @property int|null $priorityScore Numeric value representing the level of priority. Higher score means higher priority. 25 + * @property Carbon|null $muteUntil 26 + * @property Carbon|null $muteReportingUntil 27 + * @property string|null $lastReviewedBy 28 + * @property Carbon|null $lastReviewedAt 29 + * @property Carbon|null $lastReportedAt 30 + * @property Carbon|null $lastAppealedAt Timestamp referencing when the author of the subject appealed a moderation action 31 + * @property bool|null $takendown 32 + * @property bool|null $appealed 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. 33 + * @property Carbon|null $suspendUntil 34 + * @property array<string>|null $tags 35 + * @property mixed $accountStats Statistics related to the account subject 36 + * @property mixed $recordsStats Statistics related to the record subjects authored by the subject's account 37 + * @property mixed $accountStrike Strike information for the account (account-level only) 38 + * @property string|null $ageAssuranceState Current age assurance state of the subject. 39 + * @property string|null $ageAssuranceUpdatedBy Whether or not the last successful update to age assurance was made by the user or admin. 40 + * 41 + * Constraints: 42 + * - Required: id, subject, createdAt, updatedAt, reviewState 43 + * - updatedAt: Format: datetime 44 + * - createdAt: Format: datetime 45 + * - priorityScore: Maximum: 100 46 + * - priorityScore: Minimum: 0 47 + * - muteUntil: Format: datetime 48 + * - muteReportingUntil: Format: datetime 49 + * - lastReviewedBy: Format: did 50 + * - lastReviewedAt: Format: datetime 51 + * - lastReportedAt: Format: datetime 52 + * - lastAppealedAt: Format: datetime 53 + * - suspendUntil: Format: datetime 54 + */ 55 + class SubjectStatusView extends Data 56 + { 57 + /** 58 + * @param Carbon $updatedAt Timestamp referencing when the last update was made to the moderation status of the subject 59 + * @param Carbon $createdAt Timestamp referencing the first moderation status impacting event was emitted on the subject 60 + * @param string|null $comment Sticky comment on the subject. 61 + * @param int|null $priorityScore Numeric value representing the level of priority. Higher score means higher priority. 62 + * @param Carbon|null $lastAppealedAt Timestamp referencing when the author of the subject appealed a moderation action 63 + * @param bool|null $appealed 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. 64 + * @param mixed $accountStats Statistics related to the account subject 65 + * @param mixed $recordsStats Statistics related to the record subjects authored by the subject's account 66 + * @param mixed $accountStrike Strike information for the account (account-level only) 67 + * @param string|null $ageAssuranceState Current age assurance state of the subject. 68 + * @param string|null $ageAssuranceUpdatedBy Whether or not the last successful update to age assurance was made by the user or admin. 69 + */ 70 + public function __construct( 71 + public readonly int $id, 72 + public readonly mixed $subject, 73 + public readonly Carbon $updatedAt, 74 + public readonly Carbon $createdAt, 75 + public readonly mixed $reviewState, 76 + public readonly mixed $hosting = null, 77 + public readonly ?array $subjectBlobCids = null, 78 + public readonly ?string $subjectRepoHandle = null, 79 + public readonly ?string $comment = null, 80 + public readonly ?int $priorityScore = null, 81 + public readonly ?Carbon $muteUntil = null, 82 + public readonly ?Carbon $muteReportingUntil = null, 83 + public readonly ?string $lastReviewedBy = null, 84 + public readonly ?Carbon $lastReviewedAt = null, 85 + public readonly ?Carbon $lastReportedAt = null, 86 + public readonly ?Carbon $lastAppealedAt = null, 87 + public readonly ?bool $takendown = null, 88 + public readonly ?bool $appealed = null, 89 + public readonly ?Carbon $suspendUntil = null, 90 + public readonly ?array $tags = null, 91 + public readonly mixed $accountStats = null, 92 + public readonly mixed $recordsStats = null, 93 + public readonly mixed $accountStrike = null, 94 + public readonly ?string $ageAssuranceState = null, 95 + public readonly ?string $ageAssuranceUpdatedBy = null 96 + ) { 97 + } 98 + 99 + /** 100 + * Get the lexicon NSID for this data type. 101 + * 102 + * @return string 103 + */ 104 + public static function getLexicon(): string 105 + { 106 + return 'tools.ozone.moderation.defs.subjectStatusView'; 107 + } 108 + 109 + 110 + /** 111 + * Create an instance from an array. 112 + * 113 + * @param array $data The data array 114 + * @return static 115 + */ 116 + public static function fromArray(array $data): static 117 + { 118 + return new static( 119 + id: $data['id'], 120 + subject: UnionHelper::validateOpenUnion($data['subject']), 121 + updatedAt: Carbon::parse($data['updatedAt']), 122 + createdAt: Carbon::parse($data['createdAt']), 123 + reviewState: $data['reviewState'], 124 + hosting: isset($data['hosting']) ? UnionHelper::validateOpenUnion($data['hosting']) : null, 125 + subjectBlobCids: $data['subjectBlobCids'] ?? null, 126 + subjectRepoHandle: $data['subjectRepoHandle'] ?? null, 127 + comment: $data['comment'] ?? null, 128 + priorityScore: $data['priorityScore'] ?? null, 129 + muteUntil: isset($data['muteUntil']) ? Carbon::parse($data['muteUntil']) : null, 130 + muteReportingUntil: isset($data['muteReportingUntil']) ? Carbon::parse($data['muteReportingUntil']) : null, 131 + lastReviewedBy: $data['lastReviewedBy'] ?? null, 132 + lastReviewedAt: isset($data['lastReviewedAt']) ? Carbon::parse($data['lastReviewedAt']) : null, 133 + lastReportedAt: isset($data['lastReportedAt']) ? Carbon::parse($data['lastReportedAt']) : null, 134 + lastAppealedAt: isset($data['lastAppealedAt']) ? Carbon::parse($data['lastAppealedAt']) : null, 135 + takendown: $data['takendown'] ?? null, 136 + appealed: $data['appealed'] ?? null, 137 + suspendUntil: isset($data['suspendUntil']) ? Carbon::parse($data['suspendUntil']) : null, 138 + tags: $data['tags'] ?? null, 139 + accountStats: $data['accountStats'] ?? null, 140 + recordsStats: $data['recordsStats'] ?? null, 141 + accountStrike: $data['accountStrike'] ?? null, 142 + ageAssuranceState: $data['ageAssuranceState'] ?? null, 143 + ageAssuranceUpdatedBy: $data['ageAssuranceUpdatedBy'] ?? null 144 + ); 145 + } 146 + 147 + }
+69
src/Generated/Tools/Ozone/Moderation/Defs/SubjectView.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + use SocialDept\AtpSchema\Generated\Com\Atproto\Moderation\Defs\SubjectType; 7 + use SocialDept\AtpSchema\Support\UnionHelper; 8 + 9 + /** 10 + * GENERATED CODE - DO NOT EDIT 11 + * 12 + * Detailed view of a subject. For record subjects, the author's repo and 13 + * profile will be returned. 14 + * 15 + * Lexicon: tools.ozone.moderation.defs.subjectView 16 + * Type: object 17 + * 18 + * @property SubjectType $type 19 + * @property string $subject 20 + * @property mixed $status 21 + * @property mixed $repo 22 + * @property mixed $profile 23 + * @property mixed $record 24 + * 25 + * Constraints: 26 + * - Required: type, subject 27 + */ 28 + class SubjectView extends Data 29 + { 30 + public function __construct( 31 + public readonly SubjectType $type, 32 + public readonly string $subject, 33 + public readonly mixed $status = null, 34 + public readonly mixed $repo = null, 35 + public readonly mixed $profile = null, 36 + public readonly mixed $record = null 37 + ) { 38 + } 39 + 40 + /** 41 + * Get the lexicon NSID for this data type. 42 + * 43 + * @return string 44 + */ 45 + public static function getLexicon(): string 46 + { 47 + return 'tools.ozone.moderation.defs.subjectView'; 48 + } 49 + 50 + 51 + /** 52 + * Create an instance from an array. 53 + * 54 + * @param array $data The data array 55 + * @return static 56 + */ 57 + public static function fromArray(array $data): static 58 + { 59 + return new static( 60 + type: SubjectType::fromArray($data['type']), 61 + subject: $data['subject'], 62 + status: $data['status'] ?? null, 63 + repo: $data['repo'] ?? null, 64 + profile: isset($data['profile']) ? UnionHelper::validateOpenUnion($data['profile']) : null, 65 + record: $data['record'] ?? null 66 + ); 67 + } 68 + 69 + }
+55
src/Generated/Tools/Ozone/Moderation/Defs/VideoDetails.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: tools.ozone.moderation.defs.videoDetails 11 + * Type: object 12 + * 13 + * @property int $width 14 + * @property int $height 15 + * @property int $length 16 + * 17 + * Constraints: 18 + * - Required: width, height, length 19 + */ 20 + class VideoDetails extends Data 21 + { 22 + public function __construct( 23 + public readonly int $width, 24 + public readonly int $height, 25 + public readonly int $length 26 + ) { 27 + } 28 + 29 + /** 30 + * Get the lexicon NSID for this data type. 31 + * 32 + * @return string 33 + */ 34 + public static function getLexicon(): string 35 + { 36 + return 'tools.ozone.moderation.defs.videoDetails'; 37 + } 38 + 39 + 40 + /** 41 + * Create an instance from an array. 42 + * 43 + * @param array $data The data array 44 + * @return static 45 + */ 46 + public static function fromArray(array $data): static 47 + { 48 + return new static( 49 + width: $data['width'], 50 + height: $data['height'], 51 + length: $data['length'] 52 + ); 53 + } 54 + 55 + }
+14
src/Generated/Tools/Ozone/Moderation/SubjectReviewState.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation; 4 + 5 + /** 6 + * GENERATED CODE - DO NOT EDIT 7 + */ 8 + enum SubjectReviewState: string 9 + { 10 + case ReviewOpen = '#reviewOpen'; 11 + case ReviewEscalated = '#reviewEscalated'; 12 + case ReviewClosed = '#reviewClosed'; 13 + case ReviewNone = '#reviewNone'; 14 + }
+49
src/Generated/Tools/Ozone/Server/GetConfig/ServiceConfig.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Server\GetConfig; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: tools.ozone.server.getConfig.serviceConfig 11 + * Type: object 12 + * 13 + * @property string|null $url 14 + * 15 + * Constraints: 16 + * - url: Format: uri 17 + */ 18 + class ServiceConfig extends Data 19 + { 20 + public function __construct( 21 + public readonly ?string $url = null 22 + ) { 23 + } 24 + 25 + /** 26 + * Get the lexicon NSID for this data type. 27 + * 28 + * @return string 29 + */ 30 + public static function getLexicon(): string 31 + { 32 + return 'tools.ozone.server.getConfig.serviceConfig'; 33 + } 34 + 35 + 36 + /** 37 + * Create an instance from an array. 38 + * 39 + * @param array $data The data array 40 + * @return static 41 + */ 42 + public static function fromArray(array $data): static 43 + { 44 + return new static( 45 + url: $data['url'] ?? null 46 + ); 47 + } 48 + 49 + }
+46
src/Generated/Tools/Ozone/Server/GetConfig/ViewerConfig.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Server\GetConfig; 4 + 5 + use SocialDept\AtpSchema\Data\Data; 6 + 7 + /** 8 + * GENERATED CODE - DO NOT EDIT 9 + * 10 + * Lexicon: tools.ozone.server.getConfig.viewerConfig 11 + * Type: object 12 + * 13 + * @property string|null $role 14 + */ 15 + class ViewerConfig extends Data 16 + { 17 + public function __construct( 18 + public readonly ?string $role = null 19 + ) { 20 + } 21 + 22 + /** 23 + * Get the lexicon NSID for this data type. 24 + * 25 + * @return string 26 + */ 27 + public static function getLexicon(): string 28 + { 29 + return 'tools.ozone.server.getConfig.viewerConfig'; 30 + } 31 + 32 + 33 + /** 34 + * Create an instance from an array. 35 + * 36 + * @param array $data The data array 37 + * @return static 38 + */ 39 + public static function fromArray(array $data): static 40 + { 41 + return new static( 42 + role: $data['role'] ?? null 43 + ); 44 + } 45 + 46 + }
+174 -49
src/Generator/ClassGenerator.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Generator; 3 + namespace SocialDept\AtpSchema\Generator; 4 4 5 - use SocialDept\Schema\Data\LexiconDocument; 6 - use SocialDept\Schema\Exceptions\GenerationException; 5 + use SocialDept\AtpSchema\Data\LexiconDocument; 6 + use SocialDept\AtpSchema\Exceptions\GenerationException; 7 + use SocialDept\AtpSchema\Support\ExtensionManager; 7 8 8 9 class ClassGenerator 9 10 { ··· 33 34 protected DocBlockGenerator $docBlockGenerator; 34 35 35 36 /** 37 + * Extension manager instance. 38 + */ 39 + protected ExtensionManager $extensions; 40 + 41 + /** 36 42 * Create a new ClassGenerator. 37 43 */ 38 44 public function __construct( ··· 40 46 ?TypeMapper $typeMapper = null, 41 47 ?StubRenderer $renderer = null, 42 48 ?MethodGenerator $methodGenerator = null, 43 - ?DocBlockGenerator $docBlockGenerator = null 49 + ?DocBlockGenerator $docBlockGenerator = null, 50 + ?ExtensionManager $extensions = null 44 51 ) { 45 52 $this->naming = $naming ?? new NamingConverter(); 46 53 $this->typeMapper = $typeMapper ?? new TypeMapper($this->naming); 47 54 $this->renderer = $renderer ?? new StubRenderer(); 48 55 $this->methodGenerator = $methodGenerator ?? new MethodGenerator($this->naming, $this->typeMapper, $this->renderer); 49 56 $this->docBlockGenerator = $docBlockGenerator ?? new DocBlockGenerator($this->typeMapper); 57 + $this->extensions = $extensions ?? new ExtensionManager(); 50 58 } 51 59 52 60 /** ··· 70 78 ); 71 79 } 72 80 81 + // For record types, extract the actual record definition 82 + $recordDef = $type === 'record' ? ($mainDef['record'] ?? []) : $mainDef; 83 + 84 + // Build local definition map for type resolution 85 + $localDefinitions = $this->buildLocalDefinitionMap($document); 86 + $this->typeMapper->setLocalDefinitions($localDefinitions); 87 + 73 88 // Get class components 74 - $namespace = $this->naming->nsidToNamespace($nsid); 75 - $className = $this->naming->toClassName($document->id->getName()); 76 - $useStatements = $this->collectUseStatements($mainDef); 77 - $properties = $this->generateProperties($mainDef); 78 - $constructor = $this->generateConstructor($mainDef); 79 - $methods = $this->generateMethods($document); 80 - $docBlock = $this->generateClassDocBlock($document, $mainDef); 89 + $namespace = $this->extensions->filter('filter:class:namespace', $this->naming->nsidToNamespace($nsid), $document); 90 + $className = $this->extensions->filter('filter:class:className', $this->naming->toClassName($document->id->getName()), $document); 91 + $useStatements = $this->extensions->filter('filter:class:useStatements', $this->collectUseStatements($recordDef, $namespace, $className), $document, $recordDef); 92 + $properties = $this->extensions->filter('filter:class:properties', $this->generateProperties($recordDef), $document, $recordDef); 93 + $constructor = $this->extensions->filter('filter:class:constructor', $this->generateConstructor($recordDef), $document, $recordDef); 94 + $methods = $this->extensions->filter('filter:class:methods', $this->generateMethods($document), $document); 95 + $docBlock = $this->extensions->filter('filter:class:docBlock', $this->generateClassDocBlock($document, $mainDef), $document, $mainDef); 81 96 82 97 // Render the class 83 - return $this->renderer->render('class', [ 98 + $rendered = $this->renderer->render('class', [ 84 99 'namespace' => $namespace, 85 100 'imports' => $this->formatUseStatements($useStatements), 86 101 'docBlock' => $docBlock, 87 102 'className' => $className, 88 - 'extends' => ' extends \\SocialDept\\Schema\\Data\\Data', 103 + 'extends' => ' extends Data', 89 104 'implements' => '', 90 105 'properties' => $properties, 91 106 'constructor' => $constructor, 92 107 'methods' => $methods, 93 108 ]); 109 + 110 + // Fix blank lines when there's no constructor or properties 111 + if (empty($properties) && empty($constructor)) { 112 + // Remove double blank lines after class opening brace 113 + $rendered = preg_replace('/\{\n\n\n/', "{\n", $rendered); 114 + } 115 + 116 + // Execute post-generation hooks 117 + $this->extensions->execute('action:class:generated', $rendered, $document); 118 + 119 + return $rendered; 94 120 } 95 121 96 122 /** 97 123 * Generate class properties. 98 124 * 125 + * Since we use constructor property promotion, we don't need separate property declarations. 126 + * This method returns empty string but is kept for compatibility. 127 + * 99 128 * @param array<string, mixed> $definition 100 129 */ 101 130 protected function generateProperties(array $definition): string 102 131 { 103 - $properties = $definition['properties'] ?? []; 104 - $required = $definition['required'] ?? []; 105 - 106 - if (empty($properties)) { 107 - return ''; 108 - } 109 - 110 - $lines = []; 111 - 112 - foreach ($properties as $name => $propDef) { 113 - $isRequired = in_array($name, $required); 114 - $phpType = $this->typeMapper->toPhpType($propDef, ! $isRequired); 115 - $docType = $this->typeMapper->toPhpDocType($propDef, ! $isRequired); 116 - $description = $propDef['description'] ?? null; 117 - 118 - // Build property doc comment 119 - $docLines = [' /**']; 120 - if ($description) { 121 - $docLines[] = ' * '.$description; 122 - $docLines[] = ' *'; 123 - } 124 - $docLines[] = ' * @var '.$docType; 125 - $docLines[] = ' */'; 126 - 127 - $lines[] = implode("\n", $docLines); 128 - $lines[] = ' public readonly '.$phpType.' $'.$name.';'; 129 - $lines[] = ''; 130 - } 131 - 132 - return rtrim(implode("\n", $lines)); 132 + // Properties are defined via constructor promotion 133 + return ''; 133 134 } 134 135 135 136 /** ··· 146 147 return ''; 147 148 } 148 149 149 - $params = []; 150 + // Build constructor parameters - required first, then optional 151 + $requiredParams = []; 152 + $optionalParams = []; 153 + $requiredDocParams = []; 154 + $optionalDocParams = []; 150 155 151 156 foreach ($properties as $name => $propDef) { 152 157 $isRequired = in_array($name, $required); 153 158 $phpType = $this->typeMapper->toPhpType($propDef, ! $isRequired); 154 - $default = ! $isRequired ? ' = null' : ''; 159 + $phpDocType = $this->typeMapper->toPhpDocType($propDef, ! $isRequired); 160 + $description = $propDef['description'] ?? ''; 161 + $param = ' public readonly '.$phpType.' $'.$name; 155 162 156 - $params[] = ' public readonly '.$phpType.' $'.$name.$default.','; 163 + if ($isRequired) { 164 + $requiredParams[] = $param.','; 165 + if ($description) { 166 + $requiredDocParams[] = ' * @param '.$phpDocType.' $'.$name.' '.$description; 167 + } 168 + } else { 169 + $optionalParams[] = $param.' = null,'; 170 + if ($description) { 171 + $optionalDocParams[] = ' * @param '.$phpDocType.' $'.$name.' '.$description; 172 + } 173 + } 157 174 } 175 + 176 + // Combine required and optional parameters 177 + $params = array_merge($requiredParams, $optionalParams); 158 178 159 179 // Remove trailing comma from last parameter 160 180 if (! empty($params)) { 161 181 $params[count($params) - 1] = rtrim($params[count($params) - 1], ','); 162 182 } 163 183 164 - return " public function __construct(\n".implode("\n", $params)."\n ) {\n }"; 184 + // Build constructor DocBlock with parameter descriptions in the correct order 185 + $docParams = array_merge($requiredDocParams, $optionalDocParams); 186 + 187 + // Only add docblock if there are parameter descriptions 188 + if (! empty($docParams)) { 189 + $docLines = [' /**']; 190 + $docLines = array_merge($docLines, $docParams); 191 + $docLines[] = ' */'; 192 + $docBlock = implode("\n", $docLines)."\n"; 193 + } else { 194 + $docBlock = ''; 195 + } 196 + 197 + return $docBlock." public function __construct(\n".implode("\n", $params)."\n ) {\n }"; 165 198 } 166 199 167 200 /** ··· 190 223 * @param array<string, mixed> $definition 191 224 * @return array<string> 192 225 */ 193 - protected function collectUseStatements(array $definition): array 226 + protected function collectUseStatements(array $definition, string $currentNamespace = '', string $currentClassName = ''): array 194 227 { 195 - $uses = ['SocialDept\\Schema\\Data\\Data']; 228 + $uses = ['SocialDept\\AtpSchema\\Data\\Data']; 196 229 $properties = $definition['properties'] ?? []; 230 + $hasUnions = false; 231 + $localRefs = []; 197 232 198 233 foreach ($properties as $propDef) { 199 234 $propUses = $this->typeMapper->getUseStatements($propDef); 200 235 $uses = array_merge($uses, $propUses); 201 236 237 + // Check if this property uses unions 238 + if (isset($propDef['type']) && $propDef['type'] === 'union') { 239 + $hasUnions = true; 240 + } 241 + 242 + // Collect local references for import 243 + if (isset($propDef['type']) && $propDef['type'] === 'ref' && isset($propDef['ref'])) { 244 + $ref = $propDef['ref']; 245 + if (str_starts_with($ref, '#')) { 246 + $localRefs[] = ltrim($ref, '#'); 247 + } 248 + } 249 + 202 250 // Handle array items 203 251 if (isset($propDef['items'])) { 204 252 $itemUses = $this->typeMapper->getUseStatements($propDef['items']); 205 253 $uses = array_merge($uses, $itemUses); 254 + 255 + // Check for local refs in array items 256 + if (isset($propDef['items']['type']) && $propDef['items']['type'] === 'ref' && isset($propDef['items']['ref'])) { 257 + $ref = $propDef['items']['ref']; 258 + if (str_starts_with($ref, '#')) { 259 + $localRefs[] = ltrim($ref, '#'); 260 + } 261 + } 206 262 } 207 263 } 208 264 265 + // Add local ref imports 266 + // For local refs, check if they should be nested or siblings 267 + if (! empty($localRefs) && $currentNamespace) { 268 + foreach ($localRefs as $localRef) { 269 + $refClassName = $this->naming->toClassName($localRef); 270 + 271 + // If this is a nested definition (has currentClassName) and it's a record type, 272 + // then local refs are nested under the record 273 + if ($currentClassName && $definition['type'] === 'record') { 274 + $uses[] = $currentNamespace . '\\' . $currentClassName . '\\' . $refClassName; 275 + } else { 276 + // For object definitions or defs lexicons, local refs are siblings 277 + $uses[] = $currentNamespace . '\\' . $refClassName; 278 + } 279 + } 280 + } 281 + 282 + // Add UnionHelper if unions are used 283 + if ($hasUnions) { 284 + $uses[] = 'SocialDept\\AtpSchema\\Support\\UnionHelper'; 285 + } 286 + 209 287 // Remove duplicates and sort 210 288 $uses = array_unique($uses); 289 + 290 + // Filter out classes from the same namespace 291 + if ($currentNamespace) { 292 + $uses = array_filter($uses, function ($use) use ($currentNamespace) { 293 + // Get namespace from FQCN by removing class name 294 + $parts = explode('\\', ltrim($use, '\\')); 295 + array_pop($parts); // Remove class name 296 + $useNamespace = implode('\\', $parts); 297 + 298 + return $useNamespace !== $currentNamespace; 299 + }); 300 + } 301 + 211 302 sort($uses); 212 303 213 304 return $uses; ··· 233 324 } 234 325 235 326 /** 327 + * Build a map of local definitions for type resolution. 328 + * 329 + * Maps local references (#defName) to their generated class names. 330 + * 331 + * @return array<string, string> Map of local ref => class name 332 + */ 333 + protected function buildLocalDefinitionMap(LexiconDocument $document): array 334 + { 335 + $localDefs = []; 336 + $allDefs = $document->defs ?? []; 337 + 338 + foreach ($allDefs as $defName => $definition) { 339 + // Skip the main definition 340 + if ($defName === 'main') { 341 + continue; 342 + } 343 + 344 + // Convert definition name to class name 345 + $className = $this->naming->toClassName($defName); 346 + $localDefs["#{$defName}"] = $className; 347 + } 348 + 349 + return $localDefs; 350 + } 351 + 352 + /** 236 353 * Get the naming converter. 237 354 */ 238 355 public function getNaming(): NamingConverter ··· 270 387 public function getDocBlockGenerator(): DocBlockGenerator 271 388 { 272 389 return $this->docBlockGenerator; 390 + } 391 + 392 + /** 393 + * Get the extension manager. 394 + */ 395 + public function getExtensions(): ExtensionManager 396 + { 397 + return $this->extensions; 273 398 } 274 399 }
+2 -2
src/Generator/ConstructorGenerator.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Generator; 3 + namespace SocialDept\AtpSchema\Generator; 4 4 5 5 class ConstructorGenerator 6 6 { ··· 162 162 $params."\n". 163 163 " ) {\n". 164 164 $body."\n". 165 - " }"; 165 + ' }'; 166 166 } 167 167 168 168 /**
+55 -36
src/Generator/DTOGenerator.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Generator; 3 + namespace SocialDept\AtpSchema\Generator; 4 4 5 - use SocialDept\Schema\Contracts\DataGenerator; 6 - use SocialDept\Schema\Data\LexiconDocument; 7 - use SocialDept\Schema\Parser\SchemaLoader; 8 - use SocialDept\Schema\Parser\TypeParser; 5 + use SocialDept\AtpSchema\Contracts\DataGenerator; 6 + use SocialDept\AtpSchema\Data\LexiconDocument; 7 + use SocialDept\AtpSchema\Parser\SchemaLoader; 8 + use SocialDept\AtpSchema\Parser\TypeParser; 9 9 10 10 class DTOGenerator implements DataGenerator 11 11 { ··· 35 35 protected FileWriter $fileWriter; 36 36 37 37 /** 38 + * Class generator for generating PHP classes. 39 + */ 40 + protected ClassGenerator $classGenerator; 41 + 42 + /** 38 43 * Base namespace for generated classes. 39 44 */ 40 45 protected string $baseNamespace; ··· 54 59 ?TypeParser $typeParser = null, 55 60 ?NamespaceResolver $namespaceResolver = null, 56 61 ?TemplateRenderer $templateRenderer = null, 57 - ?FileWriter $fileWriter = null 62 + ?FileWriter $fileWriter = null, 63 + ?ClassGenerator $classGenerator = null 58 64 ) { 59 65 $this->schemaLoader = $schemaLoader; 60 66 $this->baseNamespace = rtrim($baseNamespace, '\\'); ··· 63 69 $this->namespaceResolver = $namespaceResolver ?? new NamespaceResolver($baseNamespace); 64 70 $this->templateRenderer = $templateRenderer ?? new TemplateRenderer(); 65 71 $this->fileWriter = $fileWriter ?? new FileWriter(); 72 + 73 + // Initialize ClassGenerator with proper naming converter 74 + $naming = new NamingConverter($this->baseNamespace); 75 + $this->classGenerator = $classGenerator ?? new ClassGenerator($naming); 66 76 } 67 77 68 78 /** ··· 70 80 */ 71 81 public function generate(LexiconDocument $schema): string 72 82 { 73 - return $this->generateRecordCode($schema); 83 + return $this->classGenerator->generate($schema); 74 84 } 75 85 76 86 /** ··· 114 124 */ 115 125 public function generateByNsid(string $nsid, array $options = []): array 116 126 { 117 - $schema = $this->schemaLoader->load($nsid); 118 - $document = LexiconDocument::fromArray($schema); 127 + $document = $this->schemaLoader->load($nsid); 119 128 120 129 return $this->generateFromDocument($document, $options); 121 130 } ··· 127 136 { 128 137 $generatedFiles = []; 129 138 130 - // Generate main class if it's a record 139 + // Generate main class if it's a record or object 140 + $mainDef = $document->getMainDefinition(); 141 + $mainType = $mainDef['type'] ?? null; 142 + 131 143 if ($document->isRecord()) { 132 144 $file = $this->generateRecordClass($document, $options); 133 145 $generatedFiles[] = $file; 146 + } elseif ($mainType === 'object') { 147 + // Generate for standalone object types (like strongRef) 148 + $file = $this->generateRecordClass($document, $options); 149 + $generatedFiles[] = $file; 134 150 } 135 151 136 152 // Generate classes for other definitions ··· 177 193 */ 178 194 protected function generateRecordClass(LexiconDocument $document, array $options = []): string 179 195 { 180 - $namespace = $this->namespaceResolver->resolveNamespace($document->getNsid()); 181 - $className = $this->namespaceResolver->resolveClassName($document->getNsid()); 182 - 183 - $mainDef = $document->getMainDefinition(); 184 - $recordSchema = $mainDef['record'] ?? []; 196 + // Use ClassGenerator for proper code generation 197 + $code = $this->classGenerator->generate($document); 185 198 186 - $properties = $this->extractProperties($recordSchema, $document); 187 - 188 - $code = $this->templateRenderer->render('record', [ 189 - 'namespace' => $namespace, 190 - 'className' => $className, 191 - 'nsid' => $document->getNsid(), 192 - 'description' => $document->description, 193 - 'properties' => $properties, 194 - ]); 195 - 199 + $naming = $this->classGenerator->getNaming(); 200 + $namespace = $naming->nsidToNamespace($document->getNsid()); 201 + $className = $naming->toClassName($document->id->getName()); 196 202 $filePath = $this->getFilePath($namespace, $className); 197 203 198 204 if (! ($options['dryRun'] ?? false)) { ··· 207 213 */ 208 214 protected function generateDefinitionClass(LexiconDocument $document, string $defName, array $options = []): string 209 215 { 210 - $namespace = $this->namespaceResolver->resolveNamespace($document->getNsid()); 211 - $className = $this->namespaceResolver->resolveClassName($document->getNsid(), $defName); 212 - 216 + // Create a temporary document for this specific definition 213 217 $definition = $document->getDefinition($defName); 214 - $properties = $this->extractProperties($definition, $document); 215 218 216 - $code = $this->templateRenderer->render('object', [ 217 - 'namespace' => $namespace, 218 - 'className' => $className, 219 + // Build a temporary lexicon document for the object definition 220 + $objectNsid = $document->getNsid().'.'.$defName; 221 + $tempSchema = [ 222 + 'id' => $objectNsid, 223 + 'lexicon' => 1, 219 224 'description' => $definition['description'] ?? null, 220 - 'properties' => $properties, 221 - ]); 225 + 'defs' => [ 226 + 'main' => [ 227 + 'type' => 'object', 228 + 'properties' => $definition['properties'] ?? [], 229 + 'required' => $definition['required'] ?? [], 230 + 'description' => $definition['description'] ?? null, 231 + ], 232 + ], 233 + ]; 234 + 235 + $tempDocument = \SocialDept\AtpSchema\Data\LexiconDocument::fromArray($tempSchema); 222 236 237 + // Use ClassGenerator for proper code generation 238 + $code = $this->classGenerator->generate($tempDocument); 239 + 240 + $naming = $this->classGenerator->getNaming(); 241 + $namespace = $naming->nsidToNamespace($objectNsid); 242 + $className = $naming->toClassName($defName); 223 243 $filePath = $this->getFilePath($namespace, $className); 224 244 225 245 if (! ($options['dryRun'] ?? false)) { ··· 301 321 */ 302 322 public function getMetadata(string $nsid): array 303 323 { 304 - $schema = $this->schemaLoader->load($nsid); 305 - $document = LexiconDocument::fromArray($schema); 324 + $document = $this->schemaLoader->load($nsid); 306 325 307 326 $namespace = $this->namespaceResolver->resolveNamespace($document->getNsid()); 308 327 $className = $this->namespaceResolver->resolveClassName($document->getNsid());
+6 -2
src/Generator/DocBlockGenerator.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Generator; 3 + namespace SocialDept\AtpSchema\Generator; 4 4 5 - use SocialDept\Schema\Data\LexiconDocument; 5 + use SocialDept\AtpSchema\Data\LexiconDocument; 6 6 7 7 class DocBlockGenerator 8 8 { ··· 29 29 array $definition 30 30 ): string { 31 31 $lines = ['/**']; 32 + 33 + // Add generated code warning 34 + $lines[] = ' * GENERATED CODE - DO NOT EDIT'; 35 + $lines[] = ' *'; 32 36 33 37 // Add description 34 38 if ($document->description) {
+214
src/Generator/EnumGenerator.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Generator; 4 + 5 + class EnumGenerator 6 + { 7 + /** 8 + * Naming converter for class/enum names. 9 + */ 10 + protected NamingConverter $naming; 11 + 12 + /** 13 + * File writer for writing generated files. 14 + */ 15 + protected FileWriter $fileWriter; 16 + 17 + /** 18 + * Base namespace for generated enums. 19 + */ 20 + protected string $baseNamespace; 21 + 22 + /** 23 + * Output directory for generated files. 24 + */ 25 + protected string $outputDirectory; 26 + 27 + /** 28 + * Create a new EnumGenerator. 29 + */ 30 + public function __construct( 31 + string $baseNamespace = 'App\\Lexicons', 32 + string $outputDirectory = 'app/Lexicons', 33 + ?NamingConverter $naming = null, 34 + ?FileWriter $fileWriter = null 35 + ) { 36 + $this->baseNamespace = rtrim($baseNamespace, '\\'); 37 + $this->outputDirectory = rtrim($outputDirectory, '/'); 38 + $this->naming = $naming ?? new NamingConverter($baseNamespace); 39 + $this->fileWriter = $fileWriter ?? new FileWriter(); 40 + } 41 + 42 + /** 43 + * Generate PHP enum from a string type with knownValues. 44 + * 45 + * @param string $nsid The NSID (e.g., "com.atproto.moderation.defs#reasonType") 46 + * @param array $definition The lexicon definition 47 + * @return string The generated enum code 48 + */ 49 + public function generate(string $nsid, array $definition): string 50 + { 51 + $type = $definition['type'] ?? null; 52 + 53 + if ($type !== 'string' || ! isset($definition['knownValues'])) { 54 + throw new \InvalidArgumentException("Definition must be a string type with knownValues"); 55 + } 56 + 57 + // Extract namespace and enum name from NSID 58 + [$baseNsid, $defName] = $this->parseNsid($nsid); 59 + 60 + $namespace = $this->naming->nsidToNamespace($baseNsid); 61 + $enumName = $this->naming->toClassName($defName); 62 + 63 + $description = $definition['description'] ?? ''; 64 + $knownValues = $definition['knownValues']; 65 + 66 + // Generate enum cases 67 + $cases = $this->generateCases($knownValues); 68 + 69 + return $this->renderEnum($namespace, $enumName, $description, $cases); 70 + } 71 + 72 + /** 73 + * Parse NSID into base NSID and definition name. 74 + * 75 + * @return array{0: string, 1: string} 76 + */ 77 + protected function parseNsid(string $nsid): array 78 + { 79 + if (str_contains($nsid, '#')) { 80 + [$baseNsid, $defName] = explode('#', $nsid, 2); 81 + 82 + return [$baseNsid, $defName]; 83 + } 84 + 85 + // If no fragment, use the last part of the NSID as the enum name 86 + $parts = explode('.', $nsid); 87 + $defName = array_pop($parts); 88 + $baseNsid = implode('.', $parts); 89 + 90 + return [$baseNsid, $defName]; 91 + } 92 + 93 + /** 94 + * Generate enum cases from known values. 95 + * 96 + * @param array<string> $knownValues 97 + * @return array<array{name: string, value: string}> 98 + */ 99 + protected function generateCases(array $knownValues): array 100 + { 101 + $cases = []; 102 + $usedNames = []; 103 + 104 + foreach ($knownValues as $value) { 105 + // Extract the case name from the value 106 + // e.g., "com.atproto.moderation.defs#reasonSpam" -> "REASON_SPAM" 107 + $caseName = $this->valueToCaseName($value); 108 + 109 + // Handle duplicate case names by prepending the source namespace 110 + if (isset($usedNames[$caseName])) { 111 + // Get the source namespace (e.g., "tools.ozone.report" from "tools.ozone.report.defs#reasonAppeal") 112 + if (str_contains($value, '#')) { 113 + $nsid = explode('#', $value)[0]; 114 + $parts = explode('.', $nsid); 115 + // Use the second-to-last part as a differentiator (e.g., "Ozone", "Report") 116 + $diff = ucfirst($parts[count($parts) - 2] ?? $parts[count($parts) - 1]); 117 + $caseName = $diff . $caseName; 118 + } 119 + } 120 + 121 + $usedNames[$caseName] = true; 122 + $cases[] = [ 123 + 'name' => $caseName, 124 + 'value' => $value, 125 + ]; 126 + } 127 + 128 + return $cases; 129 + } 130 + 131 + /** 132 + * Convert a known value to an enum case name. 133 + */ 134 + protected function valueToCaseName(string $value): string 135 + { 136 + // If it's an NSID reference, extract the fragment part 137 + if (str_contains($value, '#')) { 138 + $value = explode('#', $value)[1]; 139 + } 140 + 141 + // Remove leading symbols (!, etc.) 142 + $value = ltrim($value, '!@#$%^&*()-_=+[]{}|;:,.<>?/~`'); 143 + 144 + // Convert kebab-case and snake_case to PascalCase 145 + // e.g., "no-promote" -> "NoPromote", "dmca-violation" -> "DmcaViolation" 146 + $value = str_replace(['-', '_'], ' ', $value); 147 + $value = ucwords($value); 148 + $value = str_replace(' ', '', $value); 149 + 150 + // Ensure first character is uppercase 151 + return ucfirst($value); 152 + } 153 + 154 + /** 155 + * Render the enum code. 156 + * 157 + * @param array<array{name: string, value: string}> $cases 158 + */ 159 + protected function renderEnum(string $namespace, string $enumName, string $description, array $cases): string 160 + { 161 + $code = "<?php\n\n"; 162 + $code .= "namespace {$namespace};\n\n"; 163 + 164 + $code .= "/**\n"; 165 + $code .= " * GENERATED CODE - DO NOT EDIT\n"; 166 + 167 + if ($description) { 168 + $code .= " *\n"; 169 + $code .= " * " . str_replace("\n", "\n * ", $description) . "\n"; 170 + } 171 + 172 + $code .= " */\n"; 173 + 174 + $code .= "enum {$enumName}: string\n"; 175 + $code .= "{\n"; 176 + 177 + foreach ($cases as $case) { 178 + $code .= " case {$case['name']} = '{$case['value']}';\n"; 179 + } 180 + 181 + $code .= "}\n"; 182 + 183 + return $code; 184 + } 185 + 186 + /** 187 + * Generate and save enum to disk. 188 + */ 189 + public function generateAndSave(string $nsid, array $definition): string 190 + { 191 + $code = $this->generate($nsid, $definition); 192 + 193 + [$baseNsid, $defName] = $this->parseNsid($nsid); 194 + $namespace = $this->naming->nsidToNamespace($baseNsid); 195 + $enumName = $this->naming->toClassName($defName); 196 + 197 + $filePath = $this->getFilePath($namespace, $enumName); 198 + $this->fileWriter->write($filePath, $code); 199 + 200 + return $filePath; 201 + } 202 + 203 + /** 204 + * Get the file path for a generated enum. 205 + */ 206 + protected function getFilePath(string $namespace, string $enumName): string 207 + { 208 + // Remove base namespace from full namespace 209 + $relativePath = str_replace($this->baseNamespace.'\\', '', $namespace); 210 + $relativePath = str_replace('\\', '/', $relativePath); 211 + 212 + return $this->outputDirectory.'/'.$relativePath.'/'.$enumName.'.php'; 213 + } 214 + }
+2 -2
src/Generator/FileWriter.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Generator; 3 + namespace SocialDept\AtpSchema\Generator; 4 4 5 - use SocialDept\Schema\Exceptions\GenerationException; 5 + use SocialDept\AtpSchema\Exceptions\GenerationException; 6 6 7 7 class FileWriter 8 8 {
+162 -16
src/Generator/MethodGenerator.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Generator; 3 + namespace SocialDept\AtpSchema\Generator; 4 4 5 - use SocialDept\Schema\Data\LexiconDocument; 5 + use SocialDept\AtpSchema\Data\LexiconDocument; 6 + use SocialDept\AtpSchema\Support\ExtensionManager; 6 7 7 8 class MethodGenerator 8 9 { ··· 27 28 protected ModelMapper $modelMapper; 28 29 29 30 /** 31 + * Extension manager instance. 32 + */ 33 + protected ExtensionManager $extensions; 34 + 35 + /** 30 36 * Create a new MethodGenerator. 31 37 */ 32 38 public function __construct( 33 39 ?NamingConverter $naming = null, 34 40 ?TypeMapper $typeMapper = null, 35 41 ?StubRenderer $renderer = null, 36 - ?ModelMapper $modelMapper = null 42 + ?ModelMapper $modelMapper = null, 43 + ?ExtensionManager $extensions = null 37 44 ) { 38 45 $this->naming = $naming ?? new NamingConverter(); 39 46 $this->typeMapper = $typeMapper ?? new TypeMapper($this->naming); 40 47 $this->renderer = $renderer ?? new StubRenderer(); 41 48 $this->modelMapper = $modelMapper ?? new ModelMapper($this->naming, $this->typeMapper); 49 + $this->extensions = $extensions ?? new ExtensionManager(); 42 50 } 43 51 44 52 /** ··· 61 69 { 62 70 $nsid = $document->getNsid(); 63 71 64 - return $this->renderer->render('method', [ 72 + $method = $this->renderer->render('method', [ 65 73 'docBlock' => $this->generateDocBlock('Get the lexicon NSID for this data type.', 'string'), 66 74 'visibility' => 'public ', 67 75 'static' => 'static ', ··· 70 78 'returnType' => ': string', 71 79 'body' => " return '{$nsid}';", 72 80 ]); 81 + 82 + return $this->extensions->filter('filter:method:getLexicon', $method, $document); 73 83 } 74 84 75 85 /** ··· 78 88 public function generateFromArray(LexiconDocument $document): string 79 89 { 80 90 $mainDef = $document->getMainDefinition(); 81 - $properties = $mainDef['properties'] ?? []; 82 - $required = $mainDef['required'] ?? []; 91 + 92 + // For record types, properties are nested under 'record' 93 + $type = $mainDef['type'] ?? null; 94 + if ($type === 'record') { 95 + $recordDef = $mainDef['record'] ?? []; 96 + $properties = $recordDef['properties'] ?? []; 97 + $required = $recordDef['required'] ?? []; 98 + } else { 99 + // For object types, properties are at the top level 100 + $properties = $mainDef['properties'] ?? []; 101 + $required = $mainDef['required'] ?? []; 102 + } 83 103 84 104 if (empty($properties)) { 85 105 return $this->generateEmptyFromArray(); ··· 88 108 $assignments = $this->generateFromArrayAssignments($properties, $required); 89 109 $body = " return new static(\n".$assignments."\n );"; 90 110 91 - return $this->renderer->render('method', [ 111 + $method = $this->renderer->render('method', [ 92 112 'docBlock' => $this->generateDocBlock('Create an instance from an array.', 'static', [ 93 113 ['name' => 'data', 'type' => 'array', 'description' => 'The data array'], 94 114 ]), ··· 99 119 'returnType' => ': static', 100 120 'body' => $body, 101 121 ]); 122 + 123 + return $this->extensions->filter('filter:method:fromArray', $method, $document, $properties, $required); 102 124 } 103 125 104 126 /** ··· 129 151 { 130 152 $lines = []; 131 153 154 + // Generate required parameters first 132 155 foreach ($properties as $name => $definition) { 133 - $type = $definition['type'] ?? 'unknown'; 134 - $assignment = $this->generatePropertyAssignment($name, $definition, $type, $required); 135 - $lines[] = ' '.$name.': '.$assignment.','; 156 + if (in_array($name, $required)) { 157 + $type = $definition['type'] ?? 'unknown'; 158 + $assignment = $this->generatePropertyAssignment($name, $definition, $type, $required); 159 + $lines[] = ' '.$name.': '.$assignment.','; 160 + } 161 + } 162 + 163 + // Then generate optional parameters 164 + foreach ($properties as $name => $definition) { 165 + if (! in_array($name, $required)) { 166 + $type = $definition['type'] ?? 'unknown'; 167 + $assignment = $this->generatePropertyAssignment($name, $definition, $type, $required); 168 + $lines[] = ' '.$name.': '.$assignment.','; 169 + } 136 170 } 137 171 138 172 // Remove trailing comma from last line ··· 152 186 protected function generatePropertyAssignment(string $name, array $definition, string $type, array $required): string 153 187 { 154 188 $isRequired = in_array($name, $required); 189 + $assignment = $this->generatePropertyAssignmentInternal($name, $definition, $type, $required); 190 + 191 + return $this->extensions->filter('filter:method:propertyAssignment', $assignment, $name, $definition, $type, $required); 192 + } 193 + 194 + /** 195 + * Internal property assignment generation logic. 196 + * 197 + * @param array<string, mixed> $definition 198 + * @param array<string> $required 199 + */ 200 + protected function generatePropertyAssignmentInternal(string $name, array $definition, string $type, array $required): string 201 + { 202 + $isRequired = in_array($name, $required); 155 203 156 204 // Handle reference types 157 205 if ($type === 'ref' && isset($definition['ref'])) { 158 - $refClass = $this->naming->nsidToClassName($definition['ref']); 159 - $className = basename(str_replace('\\', '/', $refClass)); 206 + $ref = $definition['ref']; 207 + 208 + // Skip local references (starting with #) - treat as mixed 209 + if (str_starts_with($ref, '#')) { 210 + // Local references don't need conversion, just return the data 211 + if ($isRequired) { 212 + return "\$data['{$name}']"; 213 + } 214 + 215 + return "\$data['{$name}'] ?? null"; 216 + } 217 + 218 + // Handle NSID fragments 219 + if (str_contains($ref, '#')) { 220 + [$baseNsid, $fragment] = explode('#', $ref, 2); 221 + $className = $this->naming->toClassName($fragment); 222 + } else { 223 + $refClass = $this->naming->nsidToClassName($ref); 224 + $className = basename(str_replace('\\', '/', $refClass)); 225 + } 160 226 161 227 if ($isRequired) { 162 228 return "{$className}::fromArray(\$data['{$name}'])"; ··· 167 233 168 234 // Handle arrays of references 169 235 if ($type === 'array' && isset($definition['items']['type']) && $definition['items']['type'] === 'ref') { 170 - $refClass = $this->naming->nsidToClassName($definition['items']['ref']); 171 - $className = basename(str_replace('\\', '/', $refClass)); 236 + $ref = $definition['items']['ref']; 237 + 238 + // Skip local references - treat array as mixed 239 + if (str_starts_with($ref, '#')) { 240 + return "\$data['{$name}'] ?? []"; 241 + } 242 + 243 + // Handle NSID fragments 244 + if (str_contains($ref, '#')) { 245 + [$baseNsid, $fragment] = explode('#', $ref, 2); 246 + $className = $this->naming->toClassName($fragment); 247 + } else { 248 + $refClass = $this->naming->nsidToClassName($ref); 249 + $className = basename(str_replace('\\', '/', $refClass)); 250 + } 172 251 173 252 return "isset(\$data['{$name}']) ? array_map(fn (\$item) => {$className}::fromArray(\$item), \$data['{$name}']) : []"; 174 253 } ··· 181 260 // Handle DateTime types (if string format matches ISO8601) 182 261 if ($type === 'string' && isset($definition['format']) && $definition['format'] === 'datetime') { 183 262 if ($isRequired) { 184 - return "new \\DateTime(\$data['{$name}'])"; 263 + return "Carbon::parse(\$data['{$name}'])"; 264 + } 265 + 266 + return "isset(\$data['{$name}']) ? Carbon::parse(\$data['{$name}']) : null"; 267 + } 268 + 269 + // Handle union types with refs 270 + if ($type === 'union' && isset($definition['refs']) && is_array($definition['refs'])) { 271 + $refs = $definition['refs']; 272 + $isClosed = $definition['closed'] ?? false; 273 + 274 + // Filter out local references 275 + $externalRefs = array_values(array_filter($refs, fn ($ref) => ! str_starts_with($ref, '#'))); 276 + 277 + // Handle closed unions - use UnionHelper for discrimination 278 + if ($isClosed && ! empty($externalRefs)) { 279 + // Build array of variant class names 280 + $variantClasses = []; 281 + foreach ($externalRefs as $ref) { 282 + // Handle NSID fragments 283 + if (str_contains($ref, '#')) { 284 + [$baseNsid, $fragment] = explode('#', $ref, 2); 285 + $className = $this->naming->toClassName($fragment); 286 + } else { 287 + $refClass = $this->naming->nsidToClassName($ref); 288 + $className = basename(str_replace('\\', '/', $refClass)); 289 + } 290 + $variantClasses[] = "{$className}::class"; 291 + } 292 + 293 + $variantsArray = '['.implode(', ', $variantClasses).']'; 294 + 295 + if ($isRequired) { 296 + return "UnionHelper::resolveClosedUnion(\$data['{$name}'], {$variantsArray})"; 297 + } 298 + 299 + return "isset(\$data['{$name}']) ? UnionHelper::resolveClosedUnion(\$data['{$name}'], {$variantsArray}) : null"; 185 300 } 186 301 187 - return "isset(\$data['{$name}']) ? new \\DateTime(\$data['{$name}']) : null"; 302 + // Open unions - validate $type presence using UnionHelper 303 + if (! $isClosed) { 304 + if ($isRequired) { 305 + return "UnionHelper::validateOpenUnion(\$data['{$name}'])"; 306 + } 307 + 308 + return "isset(\$data['{$name}']) ? UnionHelper::validateOpenUnion(\$data['{$name}']) : null"; 309 + } 310 + 311 + // Fallback for unions with only local refs 312 + if ($isRequired) { 313 + return "\$data['{$name}']"; 314 + } 315 + 316 + return "\$data['{$name}'] ?? null"; 317 + } 318 + 319 + // Handle blob types (already converted to BlobReference by the protocol) 320 + if ($type === 'blob') { 321 + if ($isRequired) { 322 + return "\$data['{$name}']"; 323 + } 324 + 325 + return "\$data['{$name}'] ?? null"; 188 326 } 189 327 190 328 // Default: simple property access ··· 333 471 public function getModelMapper(): ModelMapper 334 472 { 335 473 return $this->modelMapper; 474 + } 475 + 476 + /** 477 + * Get the extension manager. 478 + */ 479 + public function getExtensions(): ExtensionManager 480 + { 481 + return $this->extensions; 336 482 } 337 483 }
+2 -3
src/Generator/ModelMapper.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Generator; 3 + namespace SocialDept\AtpSchema\Generator; 4 4 5 5 class ModelMapper 6 6 { ··· 27 27 * Generate toModel method body. 28 28 * 29 29 * @param array<string, array<string, mixed>> $properties 30 - * @param string $modelClass 31 30 */ 32 31 public function generateToModelBody(array $properties, string $modelClass = 'Model'): string 33 32 { ··· 130 129 131 130 // Handle blob types 132 131 if ($type === 'blob') { 133 - return "\$model->{$name} ? \\SocialDept\\Schema\\Data\\BlobReference::fromArray(\$model->{$name}) : null"; 132 + return "\$model->{$name} ? \\SocialDept\\AtpSchema\\Data\\BlobReference::fromArray(\$model->{$name}) : null"; 134 133 } 135 134 136 135 // Handle nested refs
+2 -2
src/Generator/NamespaceResolver.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Generator; 3 + namespace SocialDept\AtpSchema\Generator; 4 4 5 - use SocialDept\Schema\Parser\Nsid; 5 + use SocialDept\AtpSchema\Parser\Nsid; 6 6 7 7 class NamespaceResolver 8 8 {
+33 -4
src/Generator/NamingConverter.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Generator; 3 + namespace SocialDept\AtpSchema\Generator; 4 4 5 - use SocialDept\Schema\Parser\Nsid; 5 + use SocialDept\AtpSchema\Parser\Nsid; 6 6 7 7 class NamingConverter 8 8 { ··· 12 12 protected string $baseNamespace; 13 13 14 14 /** 15 + * PHP reserved keywords that cannot be used as class names. 16 + */ 17 + protected const RESERVED_KEYWORDS = [ 18 + 'abstract', 'and', 'array', 'as', 'break', 'callable', 'case', 'catch', 19 + 'class', 'clone', 'const', 'continue', 'declare', 'default', 'die', 'do', 20 + 'echo', 'else', 'elseif', 'empty', 'enddeclare', 'endfor', 'endforeach', 21 + 'endif', 'endswitch', 'endwhile', 'eval', 'exit', 'extends', 'final', 22 + 'finally', 'fn', 'for', 'foreach', 'function', 'global', 'goto', 'if', 23 + 'implements', 'include', 'include_once', 'instanceof', 'insteadof', 24 + 'interface', 'isset', 'list', 'match', 'namespace', 'new', 'or', 'print', 25 + 'private', 'protected', 'public', 'readonly', 'require', 'require_once', 26 + 'return', 'static', 'switch', 'throw', 'trait', 'try', 'unset', 'use', 27 + 'var', 'while', 'xor', 'yield', '__halt_compiler', 28 + ]; 29 + 30 + /** 15 31 * Create a new NamingConverter. 16 32 */ 17 33 public function __construct(string $baseNamespace = 'App\\Lexicons') ··· 38 54 { 39 55 $nsid = Nsid::parse($nsidString); 40 56 41 - // Split authority into parts (e.g., "app.bsky" -> ["app", "bsky"]) 42 - $authorityParts = array_reverse(explode('.', $nsid->getAuthority())); 57 + // Split authority into parts (e.g., "blog.pckt" -> ["blog", "pckt"]) 58 + $authorityParts = explode('.', $nsid->getAuthority()); 43 59 44 60 // Convert each part to PascalCase 45 61 $namespaceParts = array_map( ··· 63 79 $parts 64 80 )); 65 81 82 + // Check if the class name is a reserved keyword and add suffix 83 + if ($this->isReservedKeyword($className)) { 84 + $className .= 'Record'; 85 + } 86 + 66 87 return $className; 88 + } 89 + 90 + /** 91 + * Check if a name is a PHP reserved keyword. 92 + */ 93 + protected function isReservedKeyword(string $name): bool 94 + { 95 + return in_array(strtolower($name), self::RESERVED_KEYWORDS, true); 67 96 } 68 97 69 98 /**
+1 -1
src/Generator/PropertyGenerator.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Generator; 3 + namespace SocialDept\AtpSchema\Generator; 4 4 5 5 class PropertyGenerator 6 6 {
+2 -2
src/Generator/StubRenderer.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Generator; 3 + namespace SocialDept\AtpSchema\Generator; 4 4 5 - use SocialDept\Schema\Exceptions\GenerationException; 5 + use SocialDept\AtpSchema\Exceptions\GenerationException; 6 6 7 7 class StubRenderer 8 8 {
+3 -3
src/Generator/TemplateRenderer.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Generator; 3 + namespace SocialDept\AtpSchema\Generator; 4 4 5 - use SocialDept\Schema\Exceptions\GenerationException; 5 + use SocialDept\AtpSchema\Exceptions\GenerationException; 6 6 7 7 class TemplateRenderer 8 8 { ··· 100 100 } 101 101 102 102 $propertiesCode[] = sprintf( 103 - "%s public readonly %s $%s;", 103 + '%s public readonly %s $%s;', 104 104 $docComment, 105 105 $typeHint, 106 106 $prop['name']
+219 -25
src/Generator/TypeMapper.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Generator; 3 + namespace SocialDept\AtpSchema\Generator; 4 + 5 + use SocialDept\AtpSchema\Support\ExtensionManager; 4 6 5 7 class TypeMapper 6 8 { ··· 8 10 * Naming converter instance. 9 11 */ 10 12 protected NamingConverter $naming; 13 + 14 + /** 15 + * Local definition map for resolving #refs. 16 + * 17 + * @var array<string, string> 18 + */ 19 + protected array $localDefinitions = []; 20 + 21 + /** 22 + * Extension manager instance. 23 + */ 24 + protected ExtensionManager $extensions; 11 25 12 26 /** 13 27 * Create a new TypeMapper. 14 28 */ 15 - public function __construct(?NamingConverter $naming = null) 29 + public function __construct(?NamingConverter $naming = null, ?ExtensionManager $extensions = null) 16 30 { 17 31 $this->naming = $naming ?? new NamingConverter(); 32 + $this->extensions = $extensions ?? new ExtensionManager(); 33 + } 34 + 35 + /** 36 + * Set local definitions for resolving local references. 37 + * 38 + * @param array<string, string> $localDefinitions Map of #ref => class name 39 + */ 40 + public function setLocalDefinitions(array $localDefinitions): void 41 + { 42 + $this->localDefinitions = $localDefinitions; 18 43 } 19 44 20 45 /** ··· 27 52 $type = $definition['type'] ?? 'unknown'; 28 53 29 54 $phpType = match ($type) { 30 - 'string' => 'string', 55 + 'string' => $this->mapStringType($definition), 31 56 'integer' => 'int', 32 57 'boolean' => 'bool', 33 58 'number' => 'float', 34 59 'array' => $this->mapArrayType($definition), 35 60 'object' => $this->mapObjectType($definition), 36 - 'blob' => '\\SocialDept\\Schema\\Data\\BlobReference', 61 + 'blob' => 'BlobReference', 37 62 'bytes' => 'string', 38 63 'cid-link' => 'string', 39 64 'unknown' => 'mixed', ··· 43 68 }; 44 69 45 70 if ($nullable && $phpType !== 'mixed') { 46 - return '?'.$phpType; 71 + $phpType = '?'.$phpType; 47 72 } 48 73 49 - return $phpType; 74 + return $this->extensions->filter('filter:type:phpType', $phpType, $definition, $nullable); 50 75 } 51 76 52 77 /** ··· 59 84 $type = $definition['type'] ?? 'unknown'; 60 85 61 86 $docType = match ($type) { 62 - 'string' => 'string', 87 + 'string' => $this->mapStringType($definition), 63 88 'integer' => 'int', 64 89 'boolean' => 'bool', 65 90 'number' => 'float', 66 91 'array' => $this->mapArrayDocType($definition), 67 92 'object' => $this->mapObjectDocType($definition), 68 - 'blob' => '\\SocialDept\\Schema\\Data\\BlobReference', 93 + 'blob' => 'BlobReference', 69 94 'bytes' => 'string', 70 95 'cid-link' => 'string', 71 96 'unknown' => 'mixed', ··· 75 100 }; 76 101 77 102 if ($nullable && $docType !== 'mixed') { 78 - return $docType.'|null'; 103 + $docType = $docType.'|null'; 79 104 } 80 105 81 - return $docType; 106 + return $this->extensions->filter('filter:type:phpDocType', $docType, $definition, $nullable); 107 + } 108 + 109 + /** 110 + * Map string type. 111 + * 112 + * @param array<string, mixed> $definition 113 + */ 114 + protected function mapStringType(array $definition): string 115 + { 116 + // Check for datetime format 117 + if (isset($definition['format']) && $definition['format'] === 'datetime') { 118 + return 'Carbon'; 119 + } 120 + 121 + return 'string'; 82 122 } 83 123 84 124 /** ··· 104 144 105 145 $itemType = $this->toPhpDocType($definition['items']); 106 146 147 + // array<mixed> is redundant, just use array 148 + if ($itemType === 'mixed') { 149 + return 'array'; 150 + } 151 + 107 152 return "array<{$itemType}>"; 108 153 } 109 154 ··· 153 198 return 'mixed'; 154 199 } 155 200 156 - // Convert NSID reference to class name 157 - return '\\'.$this->naming->nsidToClassName($definition['ref']); 201 + $ref = $definition['ref']; 202 + 203 + // Resolve local references using the local definitions map 204 + if (str_starts_with($ref, '#')) { 205 + return $this->localDefinitions[$ref] ?? 'mixed'; 206 + } 207 + 208 + // Handle NSID fragments (e.g., com.atproto.label.defs#selfLabels) 209 + // Convert fragment to class name 210 + if (str_contains($ref, '#')) { 211 + [$baseNsid, $fragment] = explode('#', $ref, 2); 212 + 213 + return $this->naming->toClassName($fragment); 214 + } 215 + 216 + // Convert NSID reference to fully qualified class name 217 + $fqcn = $this->naming->nsidToClassName($ref); 218 + 219 + // Extract short class name (last part after final backslash) 220 + $parts = explode('\\', $fqcn); 221 + 222 + return end($parts); 158 223 } 159 224 160 225 /** ··· 174 239 */ 175 240 protected function mapUnionType(array $definition): string 176 241 { 177 - // For runtime type hints, unions of different types must be 'mixed' 178 - return 'mixed'; 242 + // Open unions (closed=false or not set) should always be mixed 243 + // because future schema versions could add more types 244 + $isClosed = $definition['closed'] ?? false; 245 + 246 + if (! $isClosed) { 247 + return 'mixed'; 248 + } 249 + 250 + // For closed unions, extract external refs 251 + $refs = $definition['refs'] ?? []; 252 + $externalRefs = array_values(array_filter($refs, fn ($ref) => ! str_starts_with($ref, '#'))); 253 + 254 + if (empty($externalRefs)) { 255 + return 'mixed'; 256 + } 257 + 258 + // Build union type with all variants 259 + $types = []; 260 + foreach ($externalRefs as $ref) { 261 + // Handle NSID fragments - convert fragment to class name 262 + if (str_contains($ref, '#')) { 263 + [$baseNsid, $fragment] = explode('#', $ref, 2); 264 + $types[] = $this->naming->toClassName($fragment); 265 + } else { 266 + // Convert to fully qualified class name, then extract short name 267 + $fqcn = $this->naming->nsidToClassName($ref); 268 + $parts = explode('\\', $fqcn); 269 + $types[] = end($parts); 270 + } 271 + } 272 + 273 + // Return union type (e.g., "Theme|ThemeV2" or just "Theme" for single ref) 274 + return implode('|', $types); 179 275 } 180 276 181 277 /** ··· 189 285 return 'mixed'; 190 286 } 191 287 192 - $types = array_map( 193 - fn ($ref) => '\\'.$this->naming->nsidToClassName($ref), 194 - $definition['refs'] 195 - ); 288 + // Open unions should be typed as mixed since future types could be added 289 + $isClosed = $definition['closed'] ?? false; 290 + if (! $isClosed) { 291 + return 'mixed'; 292 + } 293 + 294 + // For closed unions, list all the specific types 295 + $types = []; 296 + foreach ($definition['refs'] as $ref) { 297 + // Resolve local references using the local definitions map 298 + if (str_starts_with($ref, '#')) { 299 + $types[] = $this->localDefinitions[$ref] ?? 'mixed'; 300 + 301 + continue; 302 + } 303 + 304 + // Handle NSID fragments - convert fragment to class name 305 + if (str_contains($ref, '#')) { 306 + [$baseNsid, $fragment] = explode('#', $ref, 2); 307 + $types[] = $this->naming->toClassName($fragment); 308 + 309 + continue; 310 + } 311 + 312 + // Convert to fully qualified class name, then extract short name 313 + $fqcn = $this->naming->nsidToClassName($ref); 314 + $parts = explode('\\', $fqcn); 315 + $types[] = end($parts); 316 + } 196 317 197 318 return implode('|', $types); 198 319 } ··· 263 384 { 264 385 $type = $definition['type'] ?? 'unknown'; 265 386 387 + // Check for datetime format on strings 388 + if ($type === 'string' && isset($definition['format']) && $definition['format'] === 'datetime') { 389 + return true; 390 + } 391 + 266 392 return in_array($type, ['ref', 'blob']); 267 393 } 268 394 ··· 276 402 { 277 403 $type = $definition['type'] ?? 'unknown'; 278 404 405 + if ($type === 'string' && isset($definition['format']) && $definition['format'] === 'datetime') { 406 + return ['Carbon\\Carbon']; 407 + } 408 + 279 409 if ($type === 'blob') { 280 - return ['SocialDept\\Schema\\Data\\BlobReference']; 410 + return ['SocialDept\\AtpSchema\\Data\\BlobReference']; 281 411 } 282 412 283 413 if ($type === 'ref' && isset($definition['ref'])) { 284 - return [$this->naming->nsidToClassName($definition['ref'])]; 414 + $ref = $definition['ref']; 415 + 416 + // Skip local references (starting with #) 417 + if (str_starts_with($ref, '#')) { 418 + return []; 419 + } 420 + 421 + // Handle NSID fragments - convert fragment to class name 422 + if (str_contains($ref, '#')) { 423 + [$baseNsid, $fragment] = explode('#', $ref, 2); 424 + // For fragments, we need to include ALL segments of the base NSID 425 + // Parse the NSID and convert each segment to PascalCase 426 + $nsid = \SocialDept\AtpSchema\Parser\Nsid::parse($baseNsid); 427 + $segments = $nsid->getSegments(); 428 + $namespaceParts = array_map( 429 + fn ($part) => $this->naming->toPascalCase($part), 430 + $segments 431 + ); 432 + $namespace = $this->naming->getBaseNamespace() . '\\' . implode('\\', $namespaceParts); 433 + $className = $this->naming->toClassName($fragment); 434 + 435 + return [$namespace . '\\' . $className]; 436 + } 437 + 438 + return [$this->naming->nsidToClassName($ref)]; 285 439 } 286 440 287 441 if ($type === 'union' && isset($definition['refs'])) { 288 - return array_map( 289 - fn ($ref) => $this->naming->nsidToClassName($ref), 290 - $definition['refs'] 291 - ); 442 + // Open unions don't need use statements since they're typed as mixed 443 + $isClosed = $definition['closed'] ?? false; 444 + if (! $isClosed) { 445 + return []; 446 + } 447 + 448 + // For closed unions, import the referenced classes 449 + $classes = []; 450 + 451 + foreach ($definition['refs'] as $ref) { 452 + // Skip local references 453 + if (str_starts_with($ref, '#')) { 454 + continue; 455 + } 456 + 457 + // Handle NSID fragments - convert fragment to class name 458 + if (str_contains($ref, '#')) { 459 + [$baseNsid, $fragment] = explode('#', $ref, 2); 460 + // For fragments, we need to include ALL segments of the base NSID 461 + $nsid = \SocialDept\AtpSchema\Parser\Nsid::parse($baseNsid); 462 + $segments = $nsid->getSegments(); 463 + $namespaceParts = array_map( 464 + fn ($part) => $this->naming->toPascalCase($part), 465 + $segments 466 + ); 467 + $namespace = $this->naming->getBaseNamespace() . '\\' . implode('\\', $namespaceParts); 468 + $className = $this->naming->toClassName($fragment); 469 + $classes[] = $namespace . '\\' . $className; 470 + } else { 471 + $classes[] = $this->naming->nsidToClassName($ref); 472 + } 473 + } 474 + 475 + return $classes; 292 476 } 293 477 294 - return []; 478 + $uses = []; 479 + 480 + return $this->extensions->filter('filter:type:useStatements', $uses, $definition); 481 + } 482 + 483 + /** 484 + * Get the extension manager. 485 + */ 486 + public function getExtensions(): ExtensionManager 487 + { 488 + return $this->extensions; 295 489 } 296 490 }
+8 -8
src/Parser/ComplexTypeParser.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Parser; 3 + namespace SocialDept\AtpSchema\Parser; 4 4 5 - use SocialDept\Schema\Data\TypeDefinition; 6 - use SocialDept\Schema\Data\Types\ArrayType; 7 - use SocialDept\Schema\Data\Types\BlobType; 8 - use SocialDept\Schema\Data\Types\ObjectType; 9 - use SocialDept\Schema\Data\Types\RefType; 10 - use SocialDept\Schema\Data\Types\UnionType; 11 - use SocialDept\Schema\Exceptions\TypeResolutionException; 5 + use SocialDept\AtpSchema\Data\TypeDefinition; 6 + use SocialDept\AtpSchema\Data\Types\ArrayType; 7 + use SocialDept\AtpSchema\Data\Types\BlobType; 8 + use SocialDept\AtpSchema\Data\Types\ObjectType; 9 + use SocialDept\AtpSchema\Data\Types\RefType; 10 + use SocialDept\AtpSchema\Data\Types\UnionType; 11 + use SocialDept\AtpSchema\Exceptions\TypeResolutionException; 12 12 13 13 class ComplexTypeParser 14 14 {
+105
src/Parser/DefaultLexiconParser.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Parser; 4 + 5 + use SocialDept\AtpSchema\Contracts\LexiconParser; 6 + use SocialDept\AtpSchema\Data\LexiconDocument; 7 + use SocialDept\AtpSchema\Exceptions\SchemaParseException; 8 + 9 + class DefaultLexiconParser implements LexiconParser 10 + { 11 + /** 12 + * Parse raw Lexicon JSON into structured objects. 13 + */ 14 + public function parse(string $json): LexiconDocument 15 + { 16 + $data = json_decode($json, true); 17 + 18 + if (json_last_error() !== JSON_ERROR_NONE) { 19 + throw SchemaParseException::invalidJson('unknown', json_last_error_msg()); 20 + } 21 + 22 + if (! is_array($data)) { 23 + throw SchemaParseException::malformed('unknown', 'Schema must be a JSON object'); 24 + } 25 + 26 + return $this->parseArray($data); 27 + } 28 + 29 + /** 30 + * Parse Lexicon from array data. 31 + */ 32 + public function parseArray(array $data): LexiconDocument 33 + { 34 + return LexiconDocument::fromArray($data); 35 + } 36 + 37 + /** 38 + * Validate Lexicon schema structure. 39 + */ 40 + public function validate(array $data): bool 41 + { 42 + try { 43 + // Required fields 44 + if (! isset($data['lexicon'])) { 45 + return false; 46 + } 47 + 48 + if (! isset($data['id'])) { 49 + return false; 50 + } 51 + 52 + if (! isset($data['defs'])) { 53 + return false; 54 + } 55 + 56 + // Validate lexicon version 57 + $lexicon = (int) $data['lexicon']; 58 + if ($lexicon !== 1) { 59 + return false; 60 + } 61 + 62 + // Validate NSID format 63 + Nsid::parse($data['id']); 64 + 65 + // Validate defs is an object/array 66 + if (! is_array($data['defs'])) { 67 + return false; 68 + } 69 + 70 + return true; 71 + } catch (\Exception) { 72 + return false; 73 + } 74 + } 75 + 76 + /** 77 + * Resolve $ref references to other schemas. 78 + */ 79 + public function resolveReference(string $ref, LexiconDocument $context): mixed 80 + { 81 + // Local reference (starting with #) 82 + if (str_starts_with($ref, '#')) { 83 + $defName = substr($ref, 1); 84 + 85 + return $context->getDefinition($defName); 86 + } 87 + 88 + // External reference with fragment (e.g., com.atproto.label.defs#selfLabels) 89 + if (str_contains($ref, '#')) { 90 + [$nsid, $defName] = explode('#', $ref, 2); 91 + 92 + // Return the ref as-is - external refs need schema loading which should be handled by caller 93 + return [ 94 + 'type' => 'ref', 95 + 'ref' => $ref, 96 + ]; 97 + } 98 + 99 + // Full NSID reference - return as ref definition 100 + return [ 101 + 'type' => 'ref', 102 + 'ref' => $ref, 103 + ]; 104 + } 105 + }
+207
src/Parser/DnsLexiconResolver.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Parser; 4 + 5 + use Illuminate\Support\Facades\Http; 6 + use SocialDept\AtpSchema\Contracts\LexiconParser; 7 + use SocialDept\AtpSchema\Contracts\LexiconResolver; 8 + use SocialDept\AtpSchema\Data\LexiconDocument; 9 + use SocialDept\AtpSchema\Exceptions\SchemaNotFoundException; 10 + 11 + class DnsLexiconResolver implements LexiconResolver 12 + { 13 + /** 14 + * Whether DNS resolution is enabled. 15 + */ 16 + protected bool $enabled; 17 + 18 + /** 19 + * HTTP timeout in seconds. 20 + */ 21 + protected int $httpTimeout; 22 + 23 + /** 24 + * Lexicon parser instance. 25 + */ 26 + protected LexiconParser $parser; 27 + 28 + /** 29 + * Whether the atp-resolver package is available. 30 + */ 31 + protected bool $hasResolver; 32 + 33 + /** 34 + * Whether we've shown the resolver warning. 35 + */ 36 + protected static bool $resolverWarningShown = false; 37 + 38 + /** 39 + * Create a new DnsLexiconResolver. 40 + */ 41 + public function __construct( 42 + bool $enabled = true, 43 + int $httpTimeout = 10, 44 + ?LexiconParser $parser = null 45 + ) { 46 + $this->enabled = $enabled; 47 + $this->httpTimeout = $httpTimeout; 48 + $this->parser = $parser ?? new DefaultLexiconParser(); 49 + $this->hasResolver = class_exists('SocialDept\\AtpResolver\\Resolver'); 50 + } 51 + 52 + /** 53 + * Resolve NSID to Lexicon schema via DNS and XRPC. 54 + */ 55 + public function resolve(string $nsid): LexiconDocument 56 + { 57 + if (! $this->enabled) { 58 + throw SchemaNotFoundException::forNsid($nsid); 59 + } 60 + 61 + if (! $this->hasResolver) { 62 + $this->showResolverWarning(); 63 + 64 + throw SchemaNotFoundException::forNsid($nsid); 65 + } 66 + 67 + try { 68 + $nsidParsed = Nsid::parse($nsid); 69 + 70 + // Step 1: Query DNS TXT record for DID 71 + $did = $this->lookupDns($nsidParsed->getAuthority()); 72 + if ($did === null) { 73 + throw SchemaNotFoundException::forNsid($nsid); 74 + } 75 + 76 + // Step 2: Resolve DID to PDS endpoint 77 + $pdsUrl = $this->resolvePdsEndpoint($did); 78 + if ($pdsUrl === null) { 79 + throw SchemaNotFoundException::forNsid($nsid); 80 + } 81 + 82 + // Step 3: Fetch lexicon schema from repository 83 + $schema = $this->retrieveSchema($pdsUrl, $did, $nsid); 84 + 85 + return $this->parser->parseArray($schema); 86 + } catch (SchemaNotFoundException $e) { 87 + throw $e; 88 + } catch (\Exception $e) { 89 + throw SchemaNotFoundException::forNsid($nsid); 90 + } 91 + } 92 + 93 + /** 94 + * Perform DNS TXT lookup for _lexicon.{authority}. 95 + */ 96 + public function lookupDns(string $authority): ?string 97 + { 98 + // Convert authority to domain (e.g., pub.leaflet -> leaflet.pub) 99 + $parts = explode('.', $authority); 100 + $domain = implode('.', array_reverse($parts)); 101 + 102 + // Query DNS TXT record at _lexicon.<domain> 103 + $hostname = "_lexicon.{$domain}"; 104 + 105 + try { 106 + $records = dns_get_record($hostname, DNS_TXT); 107 + 108 + if ($records === false || empty($records)) { 109 + return null; 110 + } 111 + 112 + // Look for TXT record with did= prefix 113 + foreach ($records as $record) { 114 + if (isset($record['txt']) && str_starts_with($record['txt'], 'did=')) { 115 + return substr($record['txt'], 4); // Remove 'did=' prefix 116 + } 117 + } 118 + } catch (\Exception $e) { 119 + // DNS query failed 120 + return null; 121 + } 122 + 123 + return null; 124 + } 125 + 126 + /** 127 + * Retrieve schema via XRPC from PDS. 128 + */ 129 + public function retrieveSchema(string $pdsEndpoint, string $did, string $nsid): array 130 + { 131 + try { 132 + // Construct XRPC call to com.atproto.repo.getRecord 133 + $response = Http::timeout($this->httpTimeout) 134 + ->get("{$pdsEndpoint}/xrpc/com.atproto.repo.getRecord", [ 135 + 'repo' => $did, 136 + 'collection' => 'com.atproto.lexicon.schema', 137 + 'rkey' => $nsid, 138 + ]); 139 + 140 + if ($response->successful()) { 141 + $data = $response->json(); 142 + 143 + // Extract the lexicon schema from the record value 144 + if (isset($data['value']) && is_array($data['value']) && isset($data['value']['lexicon'])) { 145 + return $data['value']; 146 + } 147 + } 148 + } catch (\Exception $e) { 149 + throw SchemaNotFoundException::forNsid($nsid); 150 + } 151 + 152 + throw SchemaNotFoundException::forNsid($nsid); 153 + } 154 + 155 + /** 156 + * Check if DNS resolution is enabled. 157 + */ 158 + public function isEnabled(): bool 159 + { 160 + return $this->enabled; 161 + } 162 + 163 + /** 164 + * Resolve DID to PDS endpoint using atp-resolver. 165 + */ 166 + protected function resolvePdsEndpoint(string $did): ?string 167 + { 168 + if (! $this->hasResolver) { 169 + return null; 170 + } 171 + 172 + try { 173 + // Get resolver from Laravel container if available 174 + if (function_exists('app') && app()->has(\SocialDept\AtpResolver\Resolver::class)) { 175 + $resolver = app(\SocialDept\AtpResolver\Resolver::class); 176 + } else { 177 + // Can't instantiate without dependencies 178 + return null; 179 + } 180 + 181 + // Use the resolvePds method which handles DID resolution and PDS extraction 182 + return $resolver->resolvePds($did); 183 + } catch (\Exception $e) { 184 + return null; 185 + } 186 + } 187 + 188 + /** 189 + * Show warning about missing atp-resolver package. 190 + */ 191 + protected function showResolverWarning(): void 192 + { 193 + if (self::$resolverWarningShown) { 194 + return; 195 + } 196 + 197 + if (function_exists('logger')) { 198 + logger()->warning( 199 + 'DNS-based lexicon resolution requires the socialdept/atp-resolver package. '. 200 + 'Install it with: composer require socialdept/atp-resolver '. 201 + 'Falling back to local lexicon sources only.' 202 + ); 203 + } 204 + 205 + self::$resolverWarningShown = true; 206 + } 207 + }
+58
src/Parser/InMemoryLexiconRegistry.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Parser; 4 + 5 + use SocialDept\AtpSchema\Contracts\LexiconRegistry; 6 + use SocialDept\AtpSchema\Data\LexiconDocument; 7 + 8 + class InMemoryLexiconRegistry implements LexiconRegistry 9 + { 10 + /** 11 + * Registered lexicon documents. 12 + * 13 + * @var array<string, LexiconDocument> 14 + */ 15 + protected array $documents = []; 16 + 17 + /** 18 + * Register a lexicon document. 19 + */ 20 + public function register(LexiconDocument $document): void 21 + { 22 + $this->documents[$document->getNsid()] = $document; 23 + } 24 + 25 + /** 26 + * Get a lexicon document by NSID. 27 + */ 28 + public function get(string $nsid): ?LexiconDocument 29 + { 30 + return $this->documents[$nsid] ?? null; 31 + } 32 + 33 + /** 34 + * Check if a lexicon document exists. 35 + */ 36 + public function has(string $nsid): bool 37 + { 38 + return isset($this->documents[$nsid]); 39 + } 40 + 41 + /** 42 + * Get all registered lexicon documents. 43 + * 44 + * @return array<string, LexiconDocument> 45 + */ 46 + public function all(): array 47 + { 48 + return $this->documents; 49 + } 50 + 51 + /** 52 + * Clear all registered lexicon documents. 53 + */ 54 + public function clear(): void 55 + { 56 + $this->documents = []; 57 + } 58 + }
+4 -4
src/Parser/Nsid.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Parser; 3 + namespace SocialDept\AtpSchema\Parser; 4 4 5 - use SocialDept\Schema\Exceptions\SchemaException; 5 + use SocialDept\AtpSchema\Exceptions\SchemaException; 6 6 use Stringable; 7 7 8 8 class Nsid implements Stringable ··· 50 50 51 51 if (strlen($this->nsid) > self::MAX_LENGTH) { 52 52 throw SchemaException::withContext( 53 - "NSID exceeds maximum length of " . self::MAX_LENGTH . " characters", 53 + 'NSID exceeds maximum length of '.self::MAX_LENGTH.' characters', 54 54 ['nsid' => $this->nsid, 'length' => strlen($this->nsid)] 55 55 ); 56 56 } ··· 65 65 $segments = explode('.', $this->nsid); 66 66 if (count($segments) < self::MIN_SEGMENTS) { 67 67 throw SchemaException::withContext( 68 - 'NSID must have at least ' . self::MIN_SEGMENTS . ' segments', 68 + 'NSID must have at least '.self::MIN_SEGMENTS.' segments', 69 69 ['nsid' => $this->nsid, 'segments' => count($segments)] 70 70 ); 71 71 }
+10 -10
src/Parser/PrimitiveParser.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Parser; 3 + namespace SocialDept\AtpSchema\Parser; 4 4 5 - use SocialDept\Schema\Data\TypeDefinition; 6 - use SocialDept\Schema\Data\Types\BooleanType; 7 - use SocialDept\Schema\Data\Types\BytesType; 8 - use SocialDept\Schema\Data\Types\CidLinkType; 9 - use SocialDept\Schema\Data\Types\IntegerType; 10 - use SocialDept\Schema\Data\Types\NullType; 11 - use SocialDept\Schema\Data\Types\StringType; 12 - use SocialDept\Schema\Data\Types\UnknownType; 13 - use SocialDept\Schema\Exceptions\TypeResolutionException; 5 + use SocialDept\AtpSchema\Data\TypeDefinition; 6 + use SocialDept\AtpSchema\Data\Types\BooleanType; 7 + use SocialDept\AtpSchema\Data\Types\BytesType; 8 + use SocialDept\AtpSchema\Data\Types\CidLinkType; 9 + use SocialDept\AtpSchema\Data\Types\IntegerType; 10 + use SocialDept\AtpSchema\Data\Types\NullType; 11 + use SocialDept\AtpSchema\Data\Types\StringType; 12 + use SocialDept\AtpSchema\Data\Types\UnknownType; 13 + use SocialDept\AtpSchema\Exceptions\TypeResolutionException; 14 14 15 15 class PrimitiveParser 16 16 {
+86 -16
src/Parser/SchemaLoader.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Parser; 3 + namespace SocialDept\AtpSchema\Parser; 4 4 5 5 use Illuminate\Support\Facades\Cache; 6 6 use Illuminate\Support\Facades\Http; 7 - use SocialDept\Schema\Exceptions\SchemaNotFoundException; 8 - use SocialDept\Schema\Exceptions\SchemaParseException; 7 + use SocialDept\AtpSchema\Contracts\SchemaRepository; 8 + use SocialDept\AtpSchema\Data\LexiconDocument; 9 + use SocialDept\AtpSchema\Exceptions\SchemaNotFoundException; 10 + use SocialDept\AtpSchema\Exceptions\SchemaParseException; 9 11 10 - class SchemaLoader 12 + class SchemaLoader implements SchemaRepository 11 13 { 12 14 /** 13 15 * In-memory cache of loaded schemas for current request. ··· 77 79 $this->cachePrefix = $cachePrefix; 78 80 $this->dnsResolutionEnabled = $dnsResolutionEnabled; 79 81 $this->httpTimeout = $httpTimeout; 80 - $this->hasResolver = class_exists('SocialDept\\Resolver\\Resolver'); 82 + $this->hasResolver = class_exists('SocialDept\\AtpResolver\\Resolver'); 83 + } 84 + 85 + /** 86 + * Find schema by NSID (nullable version). 87 + */ 88 + public function find(string $nsid): ?LexiconDocument 89 + { 90 + try { 91 + return $this->load($nsid); 92 + } catch (SchemaNotFoundException) { 93 + return null; 94 + } 81 95 } 82 96 83 97 /** 84 98 * Load schema by NSID. 85 99 */ 86 - public function load(string $nsid): array 100 + public function load(string $nsid): LexiconDocument 87 101 { 88 102 // Check memory cache first 89 103 if (isset($this->memoryCache[$nsid])) { ··· 96 110 $cached = Cache::get($cacheKey); 97 111 98 112 if ($cached !== null) { 99 - $this->memoryCache[$nsid] = $cached; 113 + // Cache stores raw arrays, convert to LexiconDocument 114 + $document = LexiconDocument::fromArray($cached); 115 + $this->memoryCache[$nsid] = $document; 100 116 101 - return $cached; 117 + return $document; 102 118 } 103 119 } 104 120 105 - // Load from sources 106 - $schema = $this->loadFromSources($nsid); 121 + // Load raw array data from sources 122 + $data = $this->loadFromSources($nsid); 107 123 108 - // Cache the result 109 - $this->memoryCache[$nsid] = $schema; 124 + // Parse into LexiconDocument 125 + $document = LexiconDocument::fromArray($data); 126 + 127 + // Cache both in memory (as object) and Laravel cache (as array) 128 + $this->memoryCache[$nsid] = $document; 110 129 111 130 if ($this->useCache) { 112 - Cache::put($this->getCacheKey($nsid), $schema, $this->cacheTtl); 131 + Cache::put($this->getCacheKey($nsid), $data, $this->cacheTtl); 113 132 } 114 133 115 - return $schema; 134 + return $document; 135 + } 136 + 137 + /** 138 + * Load raw schema array by NSID. 139 + */ 140 + protected function loadRaw(string $nsid): array 141 + { 142 + $document = $this->load($nsid); 143 + 144 + return $document->toArray(); 145 + } 146 + 147 + /** 148 + * Get all available schema NSIDs. 149 + * 150 + * @return array<string> 151 + */ 152 + public function all(): array 153 + { 154 + $nsids = []; 155 + 156 + // Scan all source directories for lexicon files 157 + foreach ($this->sources as $source) { 158 + if (! is_dir($source)) { 159 + continue; 160 + } 161 + 162 + // Recursively scan for .json files 163 + $files = new \RecursiveIteratorIterator( 164 + new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS) 165 + ); 166 + 167 + foreach ($files as $file) { 168 + if ($file->isFile() && $file->getExtension() === 'json') { 169 + // Try to parse the NSID from the file 170 + try { 171 + $contents = file_get_contents($file->getPathname()); 172 + $data = json_decode($contents, true); 173 + 174 + if (isset($data['id'])) { 175 + $nsids[] = $data['id']; 176 + } 177 + } catch (\Exception $e) { 178 + // Skip invalid files 179 + continue; 180 + } 181 + } 182 + } 183 + } 184 + 185 + return array_unique($nsids); 116 186 } 117 187 118 188 /** ··· 366 436 367 437 try { 368 438 // Get resolver from Laravel container if available 369 - if (function_exists('app') && app()->has(\SocialDept\Resolver\Resolver::class)) { 370 - $resolver = app(\SocialDept\Resolver\Resolver::class); 439 + if (function_exists('app') && app()->has(\SocialDept\AtpResolver\Resolver::class)) { 440 + $resolver = app(\SocialDept\AtpResolver\Resolver::class); 371 441 } else { 372 442 // Can't instantiate without dependencies 373 443 return null;
+4 -4
src/Parser/TypeParser.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Parser; 3 + namespace SocialDept\AtpSchema\Parser; 4 4 5 - use SocialDept\Schema\Data\LexiconDocument; 6 - use SocialDept\Schema\Data\TypeDefinition; 7 - use SocialDept\Schema\Exceptions\TypeResolutionException; 5 + use SocialDept\AtpSchema\Data\LexiconDocument; 6 + use SocialDept\AtpSchema\Data\TypeDefinition; 7 + use SocialDept\AtpSchema\Exceptions\TypeResolutionException; 8 8 9 9 class TypeParser 10 10 {
+1 -1
src/Schema.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema; 3 + namespace SocialDept\AtpSchema; 4 4 5 5 class Schema 6 6 {
+25 -17
src/SchemaManager.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema; 3 + namespace SocialDept\AtpSchema; 4 4 5 - use SocialDept\Schema\Data\LexiconDocument; 6 - use SocialDept\Schema\Generator\DTOGenerator; 7 - use SocialDept\Schema\Parser\SchemaLoader; 8 - use SocialDept\Schema\Validation\LexiconValidator; 5 + use SocialDept\AtpSchema\Data\LexiconDocument; 6 + use SocialDept\AtpSchema\Generator\DTOGenerator; 7 + use SocialDept\AtpSchema\Parser\SchemaLoader; 8 + use SocialDept\AtpSchema\Validation\LexiconValidator; 9 9 10 10 class SchemaManager 11 11 { ··· 40 40 /** 41 41 * Load a schema by NSID. 42 42 */ 43 - public function load(string $nsid): array 43 + public function load(string $nsid): LexiconDocument 44 44 { 45 45 return $this->loader->load($nsid); 46 46 } 47 47 48 48 /** 49 - * Check if a schema exists. 49 + * Find a schema by NSID (nullable). 50 50 */ 51 - public function exists(string $nsid): bool 51 + public function find(string $nsid): ?LexiconDocument 52 52 { 53 - return $this->loader->exists($nsid); 53 + return $this->loader->find($nsid); 54 54 } 55 55 56 56 /** 57 - * Parse a schema into a LexiconDocument. 57 + * Get all available schemas. 58 + * 59 + * @return array<string> 58 60 */ 59 - public function parse(string $nsid): LexiconDocument 61 + public function all(): array 60 62 { 61 - $schema = $this->loader->load($nsid); 63 + return $this->loader->all(); 64 + } 62 65 63 - return LexiconDocument::fromArray($schema); 66 + /** 67 + * Check if a schema exists. 68 + */ 69 + public function exists(string $nsid): bool 70 + { 71 + return $this->loader->exists($nsid); 64 72 } 65 73 66 74 /** ··· 68 76 */ 69 77 public function validate(string $nsid, array $data): bool 70 78 { 71 - $document = $this->parse($nsid); 79 + $document = $this->load($nsid); 72 80 73 81 return $this->validator->validate($data, $document); 74 82 } ··· 80 88 */ 81 89 public function validateWithErrors(string $nsid, array $data): array 82 90 { 83 - $document = $this->parse($nsid); 91 + $document = $this->load($nsid); 84 92 85 93 return $this->validator->validateWithErrors($data, $document); 86 94 } ··· 88 96 /** 89 97 * Generate DTO code from a schema. 90 98 */ 91 - public function generate(string $nsid, array $options = []): string 99 + public function generate(string $nsid, ?string $outputPath = null): string 92 100 { 93 101 if ($this->generator === null) { 94 102 throw new \RuntimeException('Generator not available'); 95 103 } 96 104 97 - $document = $this->parse($nsid); 105 + $document = $this->load($nsid); 98 106 99 107 return $this->generator->generate($document); 100 108 }
+50 -1
src/SchemaServiceProvider.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema; 3 + namespace SocialDept\AtpSchema; 4 4 5 5 use Illuminate\Support\ServiceProvider; 6 6 ··· 45 45 baseNamespace: config('schema.lexicons.base_namespace', 'App\\Lexicons') 46 46 ); 47 47 }); 48 + 49 + // Register UnionResolver 50 + $this->app->singleton(Services\UnionResolver::class); 51 + 52 + // Register ExtensionManager 53 + $this->app->singleton(Support\ExtensionManager::class); 54 + 55 + // Register DefaultLexiconParser 56 + $this->app->singleton(Parser\DefaultLexiconParser::class); 57 + 58 + // Register InMemoryLexiconRegistry 59 + $this->app->singleton(Parser\InMemoryLexiconRegistry::class); 60 + 61 + // Register DnsLexiconResolver 62 + $this->app->singleton(Parser\DnsLexiconResolver::class, function ($app) { 63 + return new Parser\DnsLexiconResolver( 64 + enabled: config('schema.dns_resolution.enabled', true), 65 + httpTimeout: config('schema.http.timeout', 10), 66 + parser: $app->make(Parser\DefaultLexiconParser::class) 67 + ); 68 + }); 69 + 70 + // Register DefaultBlobHandler 71 + $this->app->singleton(Support\DefaultBlobHandler::class, function ($app) { 72 + return new Support\DefaultBlobHandler( 73 + disk: config('schema.blobs.disk'), 74 + path: config('schema.blobs.path', 'blobs') 75 + ); 76 + }); 77 + 78 + // Bind BlobHandler contract to DefaultBlobHandler 79 + $this->app->bind(Contracts\BlobHandler::class, Support\DefaultBlobHandler::class); 80 + 81 + // Bind LexiconParser contract to DefaultLexiconParser 82 + $this->app->bind(Contracts\LexiconParser::class, Parser\DefaultLexiconParser::class); 83 + 84 + // Bind LexiconRegistry contract to InMemoryLexiconRegistry 85 + $this->app->bind(Contracts\LexiconRegistry::class, Parser\InMemoryLexiconRegistry::class); 86 + 87 + // Bind LexiconResolver contract to DnsLexiconResolver 88 + $this->app->bind(Contracts\LexiconResolver::class, Parser\DnsLexiconResolver::class); 89 + 90 + // Bind SchemaRepository contract to SchemaLoader 91 + $this->app->bind(Contracts\SchemaRepository::class, Parser\SchemaLoader::class); 48 92 49 93 // Register DTOGenerator 50 94 $this->app->singleton(Generator\DTOGenerator::class, function ($app) { ··· 217 261 $this->publishes([ 218 262 __DIR__.'/../stubs' => base_path('stubs/schema'), 219 263 ], 'schema-stubs'); 264 + 265 + // Publish lexicon JSON files 266 + $this->publishes([ 267 + __DIR__.'/../resources/lexicons' => resource_path('lexicons'), 268 + ], 'atp-lexicons'); 220 269 221 270 // Register commands 222 271 $this->commands([
+4 -3
src/Services/BlobHandler.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Services; 3 + namespace SocialDept\AtpSchema\Services; 4 4 5 5 use Illuminate\Contracts\Filesystem\Filesystem; 6 6 use Illuminate\Http\UploadedFile; 7 7 use Illuminate\Support\Facades\Storage; 8 8 use Illuminate\Support\Traits\Macroable; 9 - use SocialDept\Schema\Data\BlobReference; 10 - use SocialDept\Schema\Exceptions\RecordValidationException; 9 + use SocialDept\AtpSchema\Data\BlobReference; 10 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 11 11 12 12 class BlobHandler 13 13 { 14 14 use Macroable; 15 + 15 16 /** 16 17 * Storage disk name. 17 18 */
+4 -3
src/Services/ModelMapper.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Services; 3 + namespace SocialDept\AtpSchema\Services; 4 4 5 5 use Illuminate\Support\Traits\Macroable; 6 - use SocialDept\Schema\Contracts\Transformer; 7 - use SocialDept\Schema\Exceptions\SchemaException; 6 + use SocialDept\AtpSchema\Contracts\Transformer; 7 + use SocialDept\AtpSchema\Exceptions\SchemaException; 8 8 9 9 class ModelMapper 10 10 { 11 11 use Macroable; 12 + 12 13 /** 13 14 * Registered transformers. 14 15 *
+5 -4
src/Services/UnionResolver.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Services; 3 + namespace SocialDept\AtpSchema\Services; 4 4 5 5 use Illuminate\Support\Traits\Macroable; 6 - use SocialDept\Schema\Contracts\LexiconRegistry; 7 - use SocialDept\Schema\Data\LexiconDocument; 8 - use SocialDept\Schema\Exceptions\RecordValidationException; 6 + use SocialDept\AtpSchema\Contracts\LexiconRegistry; 7 + use SocialDept\AtpSchema\Data\LexiconDocument; 8 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 9 9 10 10 class UnionResolver 11 11 { 12 12 use Macroable; 13 + 13 14 /** 14 15 * Create a new UnionResolver. 15 16 */
+148
src/Support/DefaultBlobHandler.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Support; 4 + 5 + use Illuminate\Http\UploadedFile; 6 + use Illuminate\Support\Facades\Storage; 7 + use SocialDept\AtpSchema\Contracts\BlobHandler; 8 + use SocialDept\AtpSchema\Data\BlobReference; 9 + 10 + class DefaultBlobHandler implements BlobHandler 11 + { 12 + /** 13 + * Storage disk to use. 14 + */ 15 + protected string $disk; 16 + 17 + /** 18 + * Storage path prefix. 19 + */ 20 + protected string $path; 21 + 22 + /** 23 + * Create a new DefaultBlobHandler. 24 + */ 25 + public function __construct( 26 + ?string $disk = null, 27 + string $path = 'blobs' 28 + ) { 29 + $this->disk = $disk ?? config('filesystems.default', 'local'); 30 + $this->path = $path; 31 + } 32 + 33 + /** 34 + * Upload blob and create reference. 35 + */ 36 + public function upload(UploadedFile $file): BlobReference 37 + { 38 + $hash = hash_file('sha256', $file->getPathname()); 39 + $mimeType = $file->getMimeType() ?? 'application/octet-stream'; 40 + $size = $file->getSize(); 41 + 42 + // Store with hash as filename to enable deduplication 43 + $storagePath = $this->path.'/'.$hash; 44 + Storage::disk($this->disk)->put($storagePath, file_get_contents($file->getPathname())); 45 + 46 + return new BlobReference( 47 + cid: $hash, // Using hash as CID for simplicity 48 + mimeType: $mimeType, 49 + size: $size 50 + ); 51 + } 52 + 53 + /** 54 + * Upload blob from path. 55 + */ 56 + public function uploadFromPath(string $path): BlobReference 57 + { 58 + $hash = hash_file('sha256', $path); 59 + $mimeType = mime_content_type($path) ?: 'application/octet-stream'; 60 + $size = filesize($path); 61 + 62 + // Store with hash as filename 63 + $storagePath = $this->path.'/'.$hash; 64 + Storage::disk($this->disk)->put($storagePath, file_get_contents($path)); 65 + 66 + return new BlobReference( 67 + cid: $hash, 68 + mimeType: $mimeType, 69 + size: $size 70 + ); 71 + } 72 + 73 + /** 74 + * Upload blob from content. 75 + */ 76 + public function uploadFromContent(string $content, string $mimeType): BlobReference 77 + { 78 + $hash = hash('sha256', $content); 79 + $size = strlen($content); 80 + 81 + // Store with hash as filename 82 + $storagePath = $this->path.'/'.$hash; 83 + Storage::disk($this->disk)->put($storagePath, $content); 84 + 85 + return new BlobReference( 86 + cid: $hash, 87 + mimeType: $mimeType, 88 + size: $size 89 + ); 90 + } 91 + 92 + /** 93 + * Download blob content. 94 + */ 95 + public function download(BlobReference $blob): string 96 + { 97 + $storagePath = $this->path.'/'.$blob->cid; 98 + 99 + if (! Storage::disk($this->disk)->exists($storagePath)) { 100 + throw new \RuntimeException("Blob not found: {$blob->cid}"); 101 + } 102 + 103 + return Storage::disk($this->disk)->get($storagePath); 104 + } 105 + 106 + /** 107 + * Generate signed URL for blob. 108 + */ 109 + public function url(BlobReference $blob): string 110 + { 111 + $storagePath = $this->path.'/'.$blob->cid; 112 + 113 + // Try to generate a temporary URL if the disk supports it 114 + try { 115 + return Storage::disk($this->disk)->temporaryUrl( 116 + $storagePath, 117 + now()->addHour() 118 + ); 119 + } catch (\RuntimeException $e) { 120 + // Fallback to regular URL for disks that don't support temporary URLs 121 + return Storage::disk($this->disk)->url($storagePath); 122 + } 123 + } 124 + 125 + /** 126 + * Check if blob exists in storage. 127 + */ 128 + public function exists(BlobReference $blob): bool 129 + { 130 + $storagePath = $this->path.'/'.$blob->cid; 131 + 132 + return Storage::disk($this->disk)->exists($storagePath); 133 + } 134 + 135 + /** 136 + * Delete blob from storage. 137 + */ 138 + public function delete(BlobReference $blob): bool 139 + { 140 + $storagePath = $this->path.'/'.$blob->cid; 141 + 142 + if (! Storage::disk($this->disk)->exists($storagePath)) { 143 + return false; 144 + } 145 + 146 + return Storage::disk($this->disk)->delete($storagePath); 147 + } 148 + }
+1 -1
src/Support/ExtensionManager.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Support; 3 + namespace SocialDept\AtpSchema\Support; 4 4 5 5 use Closure; 6 6
+101
src/Support/UnionHelper.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpSchema\Support; 4 + 5 + use InvalidArgumentException; 6 + use SocialDept\AtpSchema\Contracts\DiscriminatedUnion; 7 + use SocialDept\AtpSchema\Data\Data; 8 + 9 + /** 10 + * Helper for resolving discriminated unions based on $type field. 11 + * 12 + * This class uses the DiscriminatedUnion interface to build type maps 13 + * and resolve union data to the correct variant class. 14 + */ 15 + class UnionHelper 16 + { 17 + /** 18 + * Resolve a closed union to the correct variant class. 19 + * 20 + * @param array $data The union data containing a $type field 21 + * @param array<class-string<Data>> $variants Array of possible variant class names 22 + * @return Data The resolved variant instance 23 + * 24 + * @throws InvalidArgumentException If $type is missing or unknown 25 + */ 26 + public static function resolveClosedUnion(array $data, array $variants): Data 27 + { 28 + // Validate $type field exists 29 + if (! isset($data['$type'])) { 30 + throw new InvalidArgumentException( 31 + 'Closed union data must contain a $type field for discrimination' 32 + ); 33 + } 34 + 35 + $type = $data['$type']; 36 + 37 + // Build type map using DiscriminatedUnion interface 38 + $typeMap = static::buildTypeMap($variants); 39 + 40 + // Check if type is known 41 + if (! isset($typeMap[$type])) { 42 + $knownTypes = implode(', ', array_keys($typeMap)); 43 + 44 + throw new InvalidArgumentException( 45 + "Unknown union type '{$type}'. Expected one of: {$knownTypes}" 46 + ); 47 + } 48 + 49 + // Resolve to correct variant class 50 + $class = $typeMap[$type]; 51 + 52 + return $class::fromArray($data); 53 + } 54 + 55 + /** 56 + * Validate an open union has $type field. 57 + * 58 + * Open unions pass data through as-is but must have $type for future discrimination. 59 + * 60 + * @param array $data The union data 61 + * @return array The validated union data 62 + * 63 + * @throws InvalidArgumentException If $type is missing 64 + */ 65 + public static function validateOpenUnion(array $data): array 66 + { 67 + if (! isset($data['$type'])) { 68 + throw new InvalidArgumentException( 69 + 'Open union data must contain a $type field for future discrimination' 70 + ); 71 + } 72 + 73 + return $data; 74 + } 75 + 76 + /** 77 + * Build a type map from variant classes using DiscriminatedUnion interface. 78 + * 79 + * @param array<class-string<Data>> $variants Array of variant class names 80 + * @return array<string, class-string<Data>> Map of discriminator => class name 81 + */ 82 + protected static function buildTypeMap(array $variants): array 83 + { 84 + $typeMap = []; 85 + 86 + foreach ($variants as $class) { 87 + // Ensure class implements DiscriminatedUnion 88 + if (! is_subclass_of($class, DiscriminatedUnion::class)) { 89 + throw new InvalidArgumentException( 90 + "Variant class {$class} must implement DiscriminatedUnion interface" 91 + ); 92 + } 93 + 94 + // Get discriminator from the class 95 + $discriminator = $class::getDiscriminator(); 96 + $typeMap[$discriminator] = $class; 97 + } 98 + 99 + return $typeMap; 100 + } 101 + }
+8 -9
src/Validation/LexiconValidator.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation; 3 + namespace SocialDept\AtpSchema\Validation; 4 4 5 - use SocialDept\Schema\Contracts\LexiconValidator as LexiconValidatorContract; 6 - use SocialDept\Schema\Data\LexiconDocument; 7 - use SocialDept\Schema\Exceptions\RecordValidationException; 8 - use SocialDept\Schema\Exceptions\SchemaValidationException; 9 - use SocialDept\Schema\Parser\SchemaLoader; 10 - use SocialDept\Schema\Parser\TypeParser; 5 + use SocialDept\AtpSchema\Contracts\LexiconValidator as LexiconValidatorContract; 6 + use SocialDept\AtpSchema\Data\LexiconDocument; 7 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 8 + use SocialDept\AtpSchema\Exceptions\SchemaValidationException; 9 + use SocialDept\AtpSchema\Parser\SchemaLoader; 10 + use SocialDept\AtpSchema\Parser\TypeParser; 11 11 12 12 class LexiconValidator implements LexiconValidatorContract 13 13 { ··· 115 115 */ 116 116 public function validateByNsid(string $nsid, array $record): void 117 117 { 118 - $schema = $this->schemaLoader->load($nsid); 119 - $document = LexiconDocument::fromArray($schema); 118 + $document = $this->schemaLoader->load($nsid); 120 119 121 120 $this->validateRecord($document, $record); 122 121 }
+1 -1
src/Validation/Rules/AtDatetime.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Validation\Rules; 4 4 5 5 use Closure; 6 6 use DateTime;
+1 -1
src/Validation/Rules/AtUri.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Validation\Rules; 4 4 5 5 use Closure; 6 6 use Illuminate\Contracts\Validation\ValidationRule;
+1 -1
src/Validation/Rules/Cid.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Validation\Rules; 4 4 5 5 use Closure; 6 6 use Illuminate\Contracts\Validation\ValidationRule;
+3 -3
src/Validation/Rules/Did.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Validation\Rules; 4 4 5 5 use Closure; 6 6 use Illuminate\Contracts\Validation\ValidationRule; ··· 19 19 } 20 20 21 21 // Check if Resolver package is available 22 - if (class_exists('SocialDept\Resolver\Support\Identity')) { 23 - if (! \SocialDept\Resolver\Support\Identity::isDid($value)) { 22 + if (class_exists('SocialDept\AtpResolver\Support\Identity')) { 23 + if (! \SocialDept\AtpResolver\Support\Identity::isDid($value)) { 24 24 $fail("The {$attribute} is not a valid DID."); 25 25 } 26 26
+3 -3
src/Validation/Rules/Handle.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Validation\Rules; 4 4 5 5 use Closure; 6 6 use Illuminate\Contracts\Validation\ValidationRule; ··· 19 19 } 20 20 21 21 // Check if Resolver package is available 22 - if (class_exists('SocialDept\Resolver\Support\Identity')) { 23 - if (! \SocialDept\Resolver\Support\Identity::isHandle($value)) { 22 + if (class_exists('SocialDept\AtpResolver\Support\Identity')) { 23 + if (! \SocialDept\AtpResolver\Support\Identity::isHandle($value)) { 24 24 $fail("The {$attribute} is not a valid handle."); 25 25 } 26 26
+1 -1
src/Validation/Rules/Language.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Validation\Rules; 4 4 5 5 use Closure; 6 6 use Illuminate\Contracts\Validation\ValidationRule;
+1 -1
src/Validation/Rules/MaxGraphemes.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Validation\Rules; 4 4 5 5 use Closure; 6 6 use Illuminate\Contracts\Validation\ValidationRule;
+1 -1
src/Validation/Rules/MinGraphemes.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Validation\Rules; 4 4 5 5 use Closure; 6 6 use Illuminate\Contracts\Validation\ValidationRule;
+2 -2
src/Validation/Rules/Nsid.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Validation\Rules; 4 4 5 5 use Closure; 6 6 use Illuminate\Contracts\Validation\ValidationRule; 7 - use SocialDept\Schema\Parser\Nsid as NsidParser; 7 + use SocialDept\AtpSchema\Parser\Nsid as NsidParser; 8 8 9 9 class Nsid implements ValidationRule 10 10 {
+2 -2
src/Validation/TypeValidators/ArrayValidator.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation\TypeValidators; 3 + namespace SocialDept\AtpSchema\Validation\TypeValidators; 4 4 5 - use SocialDept\Schema\Exceptions\RecordValidationException; 5 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 6 6 7 7 class ArrayValidator 8 8 {
+2 -2
src/Validation/TypeValidators/BlobValidator.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation\TypeValidators; 3 + namespace SocialDept\AtpSchema\Validation\TypeValidators; 4 4 5 - use SocialDept\Schema\Exceptions\RecordValidationException; 5 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 6 6 7 7 class BlobValidator 8 8 {
+2 -2
src/Validation/TypeValidators/BooleanValidator.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation\TypeValidators; 3 + namespace SocialDept\AtpSchema\Validation\TypeValidators; 4 4 5 - use SocialDept\Schema\Exceptions\RecordValidationException; 5 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 6 6 7 7 class BooleanValidator 8 8 {
+2 -2
src/Validation/TypeValidators/IntegerValidator.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation\TypeValidators; 3 + namespace SocialDept\AtpSchema\Validation\TypeValidators; 4 4 5 - use SocialDept\Schema\Exceptions\RecordValidationException; 5 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 6 6 7 7 class IntegerValidator 8 8 {
+2 -2
src/Validation/TypeValidators/ObjectValidator.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation\TypeValidators; 3 + namespace SocialDept\AtpSchema\Validation\TypeValidators; 4 4 5 - use SocialDept\Schema\Exceptions\RecordValidationException; 5 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 6 6 7 7 class ObjectValidator 8 8 {
+3 -3
src/Validation/TypeValidators/StringValidator.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation\TypeValidators; 3 + namespace SocialDept\AtpSchema\Validation\TypeValidators; 4 4 5 - use SocialDept\Schema\Exceptions\RecordValidationException; 5 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 6 6 7 7 class StringValidator 8 8 { ··· 180 180 protected function validateNsid(string $value): bool 181 181 { 182 182 try { 183 - \SocialDept\Schema\Parser\Nsid::parse($value); 183 + \SocialDept\AtpSchema\Parser\Nsid::parse($value); 184 184 185 185 return true; 186 186 } catch (\Exception) {
+21 -23
src/Validation/TypeValidators/UnionValidator.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation\TypeValidators; 3 + namespace SocialDept\AtpSchema\Validation\TypeValidators; 4 4 5 - use SocialDept\Schema\Exceptions\RecordValidationException; 5 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 6 + use SocialDept\AtpSchema\Services\UnionResolver; 6 7 7 8 class UnionValidator 8 9 { 9 10 /** 11 + * Create a new UnionValidator. 12 + */ 13 + public function __construct( 14 + protected ?UnionResolver $resolver = null 15 + ) { 16 + $this->resolver = $resolver ?? new UnionResolver(); 17 + } 18 + 19 + /** 10 20 * Validate a union value against constraints. 11 21 * 12 22 * @param array<string, mixed> $definition ··· 23 33 $closed = $definition['closed'] ?? false; 24 34 25 35 if ($closed) { 26 - $this->validateDiscriminatedUnion($value, $refs, $path); 36 + $this->validateDiscriminatedUnion($value, $refs, $path, $definition); 27 37 } else { 28 38 $this->validateOpenUnion($value, $refs, $path); 29 39 } ··· 33 43 * Validate discriminated (closed) union. 34 44 * 35 45 * @param array<string> $refs 46 + * @param array<string, mixed> $definition 36 47 */ 37 - protected function validateDiscriminatedUnion(mixed $value, array $refs, string $path): void 48 + protected function validateDiscriminatedUnion(mixed $value, array $refs, string $path, array $definition): void 38 49 { 39 - if (! is_array($value)) { 40 - throw RecordValidationException::invalidType($path, 'object', gettype($value)); 41 - } 42 - 43 - // Check for $type discriminator 44 - if (! isset($value['$type'])) { 45 - throw RecordValidationException::invalidValue( 46 - $path, 47 - 'Discriminated union must have $type field' 48 - ); 49 - } 50 - 51 - $type = $value['$type']; 52 - 53 - // Validate that $type is one of the allowed refs 54 - if (! in_array($type, $refs, true)) { 55 - $allowed = implode(', ', $refs); 56 - 50 + // Delegate validation to UnionResolver which handles all the logic 51 + try { 52 + $this->resolver->resolve($value, $definition); 53 + } catch (RecordValidationException $e) { 54 + // Re-throw with path context 57 55 throw RecordValidationException::invalidValue( 58 56 $path, 59 - "Union type '{$type}' not allowed. Must be one of: {$allowed}" 57 + $e->getMessage() 60 58 ); 61 59 } 62 60 }
+1 -1
src/Validation/ValidationError.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation; 3 + namespace SocialDept\AtpSchema\Validation; 4 4 5 5 use JsonSerializable; 6 6
+1 -1
src/Validation/ValidationErrorFormatter.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation; 3 + namespace SocialDept\AtpSchema\Validation; 4 4 5 5 class ValidationErrorFormatter 6 6 {
+9 -8
src/Validation/Validator.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Validation; 3 + namespace SocialDept\AtpSchema\Validation; 4 4 5 5 use Illuminate\Support\Traits\Macroable; 6 - use SocialDept\Schema\Contracts\LexiconValidator as LexiconValidatorContract; 7 - use SocialDept\Schema\Data\LexiconDocument; 8 - use SocialDept\Schema\Exceptions\RecordValidationException; 9 - use SocialDept\Schema\Exceptions\SchemaValidationException; 10 - use SocialDept\Schema\Parser\SchemaLoader; 11 - use SocialDept\Schema\Parser\TypeParser; 6 + use SocialDept\AtpSchema\Contracts\LexiconValidator as LexiconValidatorContract; 7 + use SocialDept\AtpSchema\Data\LexiconDocument; 8 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 9 + use SocialDept\AtpSchema\Exceptions\SchemaValidationException; 10 + use SocialDept\AtpSchema\Parser\SchemaLoader; 11 + use SocialDept\AtpSchema\Parser\TypeParser; 12 12 13 13 class Validator implements LexiconValidatorContract 14 14 { 15 15 use Macroable; 16 + 16 17 /** 17 18 * Validation mode constants. 18 19 */ ··· 165 166 if ($type !== 'record' && $type !== 'object') { 166 167 throw SchemaValidationException::invalidStructure( 167 168 $schema->getNsid(), 168 - ['Schema must be a record or object type, got: ' . ($type ?? 'unknown')] 169 + ['Schema must be a record or object type, got: '.($type ?? 'unknown')] 169 170 ); 170 171 } 171 172
+23 -14
src/helpers.php
··· 1 1 <?php 2 2 3 - use SocialDept\Schema\Data\LexiconDocument; 4 - use SocialDept\Schema\Facades\Schema; 3 + use SocialDept\AtpSchema\Data\LexiconDocument; 4 + use SocialDept\AtpSchema\Facades\Schema; 5 5 6 6 if (! function_exists('schema')) { 7 7 /** 8 8 * Get the SchemaManager instance or load a schema. 9 9 * 10 - * @param string|null $nsid 11 - * @return \SocialDept\Schema\SchemaManager|array 10 + * @return \SocialDept\AtpSchema\SchemaManager|LexiconDocument 12 11 */ 13 12 function schema(?string $nsid = null) 14 13 { ··· 20 19 } 21 20 } 22 21 23 - if (! function_exists('schema_validate')) { 22 + if (! function_exists('schema_find')) { 23 + /** 24 + * Find a schema by NSID (nullable version). 25 + */ 26 + function schema_find(string $nsid): ?LexiconDocument 27 + { 28 + return Schema::find($nsid); 29 + } 30 + } 31 + 32 + if (! function_exists('schema_exists')) { 24 33 /** 25 - * Validate data against a schema. 34 + * Check if a schema exists. 26 35 */ 27 - function schema_validate(string $nsid, array $data): bool 36 + function schema_exists(string $nsid): bool 28 37 { 29 - return Schema::validate($nsid, $data); 38 + return Schema::exists($nsid); 30 39 } 31 40 } 32 41 33 - if (! function_exists('schema_parse')) { 42 + if (! function_exists('schema_validate')) { 34 43 /** 35 - * Parse a schema into a LexiconDocument. 44 + * Validate data against a schema. 36 45 */ 37 - function schema_parse(string $nsid): LexiconDocument 46 + function schema_validate(string $nsid, array $data): bool 38 47 { 39 - return Schema::parse($nsid); 48 + return Schema::validate($nsid, $data); 40 49 } 41 50 } 42 51 ··· 44 53 /** 45 54 * Generate DTO code from a schema. 46 55 */ 47 - function schema_generate(string $nsid, array $options = []): string 56 + function schema_generate(string $nsid, ?string $outputPath = null): string 48 57 { 49 - return Schema::generate($nsid, $options); 58 + return Schema::generate($nsid, $outputPath); 50 59 } 51 60 }
+1 -3
stubs/class.stub
··· 7 7 {{ docBlock }} 8 8 class {{ className }}{{ extends }}{{ implements }} 9 9 { 10 - {{ properties }} 11 - 12 - {{ constructor }} 10 + {{ properties }}{{ constructor }} 13 11 14 12 {{ methods }} 15 13 }
+3 -3
stubs/method.stub
··· 1 1 {{ docBlock }} 2 - {{ visibility }}{{ static }}function {{ name }}({{ parameters }}){{ returnType }} 3 - { 2 + {{ visibility }}{{ static }}function {{ name }}({{ parameters }}){{ returnType }} 3 + { 4 4 {{ body }} 5 - } 5 + }
+8 -8
tests/Integration/CompleteWorkflowTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Integration; 3 + namespace SocialDept\AtpSchema\Tests\Integration; 4 4 5 5 use Illuminate\Http\UploadedFile; 6 6 use Illuminate\Support\Facades\Storage; 7 7 use Orchestra\Testbench\TestCase; 8 - use SocialDept\Schema\Contracts\LexiconRegistry; 9 - use SocialDept\Schema\Data\LexiconDocument; 10 - use SocialDept\Schema\Parser\SchemaLoader; 11 - use SocialDept\Schema\Services\BlobHandler; 12 - use SocialDept\Schema\Services\UnionResolver; 13 - use SocialDept\Schema\Support\ExtensionManager; 14 - use SocialDept\Schema\Validation\Validator; 8 + use SocialDept\AtpSchema\Contracts\LexiconRegistry; 9 + use SocialDept\AtpSchema\Data\LexiconDocument; 10 + use SocialDept\AtpSchema\Parser\SchemaLoader; 11 + use SocialDept\AtpSchema\Services\BlobHandler; 12 + use SocialDept\AtpSchema\Services\UnionResolver; 13 + use SocialDept\AtpSchema\Support\ExtensionManager; 14 + use SocialDept\AtpSchema\Validation\Validator; 15 15 16 16 class CompleteWorkflowTest extends TestCase 17 17 {
+6 -6
tests/Integration/ModelMappingIntegrationTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Integration; 3 + namespace SocialDept\AtpSchema\Tests\Integration; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Contracts\Transformer; 7 - use SocialDept\Schema\Data\LexiconDocument; 8 - use SocialDept\Schema\Parser\SchemaLoader; 9 - use SocialDept\Schema\Services\ModelMapper; 10 - use SocialDept\Schema\Validation\Validator; 6 + use SocialDept\AtpSchema\Contracts\Transformer; 7 + use SocialDept\AtpSchema\Data\LexiconDocument; 8 + use SocialDept\AtpSchema\Parser\SchemaLoader; 9 + use SocialDept\AtpSchema\Services\ModelMapper; 10 + use SocialDept\AtpSchema\Validation\Validator; 11 11 12 12 class ModelMappingIntegrationTest extends TestCase 13 13 {
+5 -5
tests/Integration/ValidationIntegrationTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Integration; 3 + namespace SocialDept\AtpSchema\Tests\Integration; 4 4 5 5 use Illuminate\Support\Facades\Storage; 6 6 use Orchestra\Testbench\TestCase; 7 - use SocialDept\Schema\Data\LexiconDocument; 8 - use SocialDept\Schema\Parser\SchemaLoader; 9 - use SocialDept\Schema\Services\BlobHandler; 10 - use SocialDept\Schema\Validation\Validator; 7 + use SocialDept\AtpSchema\Data\LexiconDocument; 8 + use SocialDept\AtpSchema\Parser\SchemaLoader; 9 + use SocialDept\AtpSchema\Services\BlobHandler; 10 + use SocialDept\AtpSchema\Validation\Validator; 11 11 12 12 class ValidationIntegrationTest extends TestCase 13 13 {
+3 -3
tests/Unit/Console/ClearCacheCommandTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Console; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Console; 4 4 5 5 use Illuminate\Support\Facades\Cache; 6 6 use Orchestra\Testbench\TestCase; 7 - use SocialDept\Schema\Console\ClearCacheCommand; 8 - use SocialDept\Schema\SchemaServiceProvider; 7 + use SocialDept\AtpSchema\Console\ClearCacheCommand; 8 + use SocialDept\AtpSchema\SchemaServiceProvider; 9 9 10 10 class ClearCacheCommandTest extends TestCase 11 11 {
+3 -3
tests/Unit/Console/GenerateCommandTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Console; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Console; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Console\GenerateCommand; 7 - use SocialDept\Schema\SchemaServiceProvider; 6 + use SocialDept\AtpSchema\Console\GenerateCommand; 7 + use SocialDept\AtpSchema\SchemaServiceProvider; 8 8 9 9 class GenerateCommandTest extends TestCase 10 10 {
+3 -3
tests/Unit/Console/ListCommandTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Console; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Console; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Console\ListCommand; 7 - use SocialDept\Schema\SchemaServiceProvider; 6 + use SocialDept\AtpSchema\Console\ListCommand; 7 + use SocialDept\AtpSchema\SchemaServiceProvider; 8 8 9 9 class ListCommandTest extends TestCase 10 10 {
+3 -3
tests/Unit/Console/ValidateCommandTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Console; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Console; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Console\ValidateCommand; 7 - use SocialDept\Schema\SchemaServiceProvider; 6 + use SocialDept\AtpSchema\Console\ValidateCommand; 7 + use SocialDept\AtpSchema\SchemaServiceProvider; 8 8 9 9 class ValidateCommandTest extends TestCase 10 10 {
+3 -3
tests/Unit/Data/BlobReferenceTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Data; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Data; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\BlobReference; 7 - use SocialDept\Schema\Exceptions\SchemaValidationException; 6 + use SocialDept\AtpSchema\Data\BlobReference; 7 + use SocialDept\AtpSchema\Exceptions\SchemaValidationException; 8 8 9 9 class BlobReferenceTest extends TestCase 10 10 {
+6 -4
tests/Unit/Data/DataTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Data; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Data; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\Data; 6 + use SocialDept\AtpSchema\Data\Data; 7 7 8 8 class DataTest extends TestCase 9 9 { ··· 94 94 $this->assertSame([ 95 95 'name' => 'John', 96 96 'age' => 30, 97 + '$type' => 'app.test.data', 97 98 ], $record); 98 99 } 99 100 ··· 184 185 'nested' => [ 185 186 'name' => 'Inner', 186 187 'age' => 20, 188 + '$type' => 'app.test.data', 187 189 ], 188 190 ], $array); 189 191 } ··· 201 203 $this->assertSame([ 202 204 'name' => 'Collection', 203 205 'items' => [ 204 - ['name' => 'First', 'age' => 10], 205 - ['name' => 'Second', 'age' => 20], 206 + ['name' => 'First', 'age' => 10, '$type' => 'app.test.data'], 207 + ['name' => 'Second', 'age' => 20, '$type' => 'app.test.data'], 206 208 ], 207 209 ], $array); 208 210 }
+90 -4
tests/Unit/Data/LexiconDocumentTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Data; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Data; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\LexiconDocument; 7 - use SocialDept\Schema\Exceptions\SchemaValidationException; 8 - use SocialDept\Schema\Parser\Nsid; 6 + use SocialDept\AtpSchema\Data\LexiconDocument; 7 + use SocialDept\AtpSchema\Exceptions\SchemaValidationException; 8 + use SocialDept\AtpSchema\Parser\Nsid; 9 9 10 10 class LexiconDocumentTest extends TestCase 11 11 { ··· 31 31 $this->assertArrayHasKey('main', $doc->defs); 32 32 $this->assertSame('test.json', $doc->source); 33 33 $this->assertSame($data, $doc->raw); 34 + } 35 + 36 + public function test_it_creates_from_json(): void 37 + { 38 + $json = json_encode([ 39 + 'lexicon' => 1, 40 + 'id' => 'app.bsky.feed.post', 41 + 'description' => 'A post record', 42 + 'defs' => [ 43 + 'main' => [ 44 + 'type' => 'record', 45 + ], 46 + ], 47 + ]); 48 + 49 + $doc = LexiconDocument::fromJson($json, 'test.json'); 50 + 51 + $this->assertSame(1, $doc->lexicon); 52 + $this->assertInstanceOf(Nsid::class, $doc->id); 53 + $this->assertSame('app.bsky.feed.post', $doc->id->toString()); 54 + $this->assertSame('A post record', $doc->description); 55 + $this->assertArrayHasKey('main', $doc->defs); 56 + $this->assertSame('test.json', $doc->source); 57 + } 58 + 59 + public function test_it_creates_from_json_without_source(): void 60 + { 61 + $json = json_encode([ 62 + 'lexicon' => 1, 63 + 'id' => 'app.bsky.feed.post', 64 + 'defs' => [ 65 + 'main' => ['type' => 'record'], 66 + ], 67 + ]); 68 + 69 + $doc = LexiconDocument::fromJson($json); 70 + 71 + $this->assertSame(1, $doc->lexicon); 72 + $this->assertSame('app.bsky.feed.post', $doc->id->toString()); 73 + $this->assertNull($doc->source); 74 + } 75 + 76 + public function test_it_throws_on_invalid_json(): void 77 + { 78 + $this->expectException(\InvalidArgumentException::class); 79 + $this->expectExceptionMessage('Invalid JSON'); 80 + 81 + LexiconDocument::fromJson('{"invalid json'); 82 + } 83 + 84 + public function test_it_throws_on_non_array_json(): void 85 + { 86 + $this->expectException(\InvalidArgumentException::class); 87 + $this->expectExceptionMessage('JSON must decode to an array'); 88 + 89 + LexiconDocument::fromJson('"just a string"'); 90 + } 91 + 92 + public function test_it_throws_on_json_array_list(): void 93 + { 94 + $this->expectException(\InvalidArgumentException::class); 95 + $this->expectExceptionMessage('JSON must decode to an array'); 96 + 97 + LexiconDocument::fromJson('123'); 34 98 } 35 99 36 100 public function test_it_throws_on_missing_lexicon(): void ··· 150 214 ]); 151 215 152 216 $this->assertSame('app.bsky.feed.post', $doc->getNsid()); 217 + } 218 + 219 + public function test_it_gets_version(): void 220 + { 221 + $doc = LexiconDocument::fromArray([ 222 + 'lexicon' => 1, 223 + 'id' => 'app.bsky.feed.post', 224 + 'defs' => [], 225 + ]); 226 + 227 + $this->assertSame(1, $doc->getVersion()); 228 + } 229 + 230 + public function test_it_gets_version_same_as_lexicon_property(): void 231 + { 232 + $doc = LexiconDocument::fromArray([ 233 + 'lexicon' => 1, 234 + 'id' => 'app.bsky.feed.post', 235 + 'defs' => [], 236 + ]); 237 + 238 + $this->assertSame($doc->lexicon, $doc->getVersion()); 153 239 } 154 240 155 241 public function test_it_converts_to_array(): void
+4 -4
tests/Unit/Data/Types/ArrayTypeTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Data\Types; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Data\Types; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\Types\ArrayType; 7 - use SocialDept\Schema\Data\Types\StringType; 8 - use SocialDept\Schema\Exceptions\RecordValidationException; 6 + use SocialDept\AtpSchema\Data\Types\ArrayType; 7 + use SocialDept\AtpSchema\Data\Types\StringType; 8 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 9 9 10 10 class ArrayTypeTest extends TestCase 11 11 {
+3 -3
tests/Unit/Data/Types/BlobTypeTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Data\Types; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Data\Types; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\Types\BlobType; 7 - use SocialDept\Schema\Exceptions\RecordValidationException; 6 + use SocialDept\AtpSchema\Data\Types\BlobType; 7 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 8 8 9 9 class BlobTypeTest extends TestCase 10 10 {
+3 -3
tests/Unit/Data/Types/BooleanTypeTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Data\Types; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Data\Types; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\Types\BooleanType; 7 - use SocialDept\Schema\Exceptions\RecordValidationException; 6 + use SocialDept\AtpSchema\Data\Types\BooleanType; 7 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 8 8 9 9 class BooleanTypeTest extends TestCase 10 10 {
+3 -3
tests/Unit/Data/Types/BytesTypeTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Data\Types; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Data\Types; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\Types\BytesType; 7 - use SocialDept\Schema\Exceptions\RecordValidationException; 6 + use SocialDept\AtpSchema\Data\Types\BytesType; 7 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 8 8 9 9 class BytesTypeTest extends TestCase 10 10 {
+3 -3
tests/Unit/Data/Types/CidLinkTypeTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Data\Types; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Data\Types; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\Types\CidLinkType; 7 - use SocialDept\Schema\Exceptions\RecordValidationException; 6 + use SocialDept\AtpSchema\Data\Types\CidLinkType; 7 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 8 8 9 9 class CidLinkTypeTest extends TestCase 10 10 {
+3 -3
tests/Unit/Data/Types/IntegerTypeTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Data\Types; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Data\Types; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\Types\IntegerType; 7 - use SocialDept\Schema\Exceptions\RecordValidationException; 6 + use SocialDept\AtpSchema\Data\Types\IntegerType; 7 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 8 8 9 9 class IntegerTypeTest extends TestCase 10 10 {
+3 -3
tests/Unit/Data/Types/NullTypeTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Data\Types; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Data\Types; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\Types\NullType; 7 - use SocialDept\Schema\Exceptions\RecordValidationException; 6 + use SocialDept\AtpSchema\Data\Types\NullType; 7 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 8 8 9 9 class NullTypeTest extends TestCase 10 10 {
+4 -4
tests/Unit/Data/Types/ObjectTypeTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Data\Types; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Data\Types; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\Types\ObjectType; 7 - use SocialDept\Schema\Data\Types\StringType; 8 - use SocialDept\Schema\Exceptions\RecordValidationException; 6 + use SocialDept\AtpSchema\Data\Types\ObjectType; 7 + use SocialDept\AtpSchema\Data\Types\StringType; 8 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 9 9 10 10 class ObjectTypeTest extends TestCase 11 11 {
+2 -2
tests/Unit/Data/Types/RefTypeTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Data\Types; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Data\Types; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\Types\RefType; 6 + use SocialDept\AtpSchema\Data\Types\RefType; 7 7 8 8 class RefTypeTest extends TestCase 9 9 {
+3 -3
tests/Unit/Data/Types/StringTypeTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Data\Types; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Data\Types; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\Types\StringType; 7 - use SocialDept\Schema\Exceptions\RecordValidationException; 6 + use SocialDept\AtpSchema\Data\Types\StringType; 7 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 8 8 9 9 class StringTypeTest extends TestCase 10 10 {
+3 -3
tests/Unit/Data/Types/UnionTypeTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Data\Types; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Data\Types; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\Types\UnionType; 7 - use SocialDept\Schema\Exceptions\RecordValidationException; 6 + use SocialDept\AtpSchema\Data\Types\UnionType; 7 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 8 8 9 9 class UnionTypeTest extends TestCase 10 10 {
+2 -2
tests/Unit/Data/Types/UnknownTypeTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Data\Types; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Data\Types; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\Types\UnknownType; 6 + use SocialDept\AtpSchema\Data\Types\UnknownType; 7 7 8 8 class UnknownTypeTest extends TestCase 9 9 {
+11 -10
tests/Unit/Facades/SchemaTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Facades; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Facades; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\LexiconDocument; 7 - use SocialDept\Schema\Facades\Schema; 8 - use SocialDept\Schema\SchemaServiceProvider; 6 + use SocialDept\AtpSchema\Data\LexiconDocument; 7 + use SocialDept\AtpSchema\Facades\Schema; 8 + use SocialDept\AtpSchema\SchemaServiceProvider; 9 9 10 10 class SchemaTest extends TestCase 11 11 { ··· 24 24 { 25 25 $schema = Schema::load('app.bsky.feed.post'); 26 26 27 - $this->assertIsArray($schema); 28 - $this->assertSame('app.bsky.feed.post', $schema['id']); 27 + $this->assertInstanceOf(LexiconDocument::class, $schema); 28 + $this->assertSame('app.bsky.feed.post', $schema->getNsid()); 29 29 } 30 30 31 31 public function test_it_checks_if_schema_exists(): void ··· 36 36 37 37 public function test_it_parses_schema(): void 38 38 { 39 - $document = Schema::parse('app.bsky.feed.post'); 39 + // parse() is an alias for load() 40 + $document = Schema::load('app.bsky.feed.post'); 40 41 41 42 $this->assertInstanceOf(LexiconDocument::class, $document); 42 43 $this->assertSame('app.bsky.feed.post', $document->getNsid()); ··· 85 86 86 87 // Should still be able to load after clearing 87 88 $schema = Schema::load('app.bsky.feed.post'); 88 - $this->assertSame('app.bsky.feed.post', $schema['id']); 89 + $this->assertSame('app.bsky.feed.post', $schema->getNsid()); 89 90 } 90 91 91 92 public function test_it_clears_all_cache(): void ··· 101 102 $schema1 = Schema::load('app.bsky.feed.post'); 102 103 $schema2 = Schema::load('com.atproto.repo.getRecord'); 103 104 104 - $this->assertSame('app.bsky.feed.post', $schema1['id']); 105 - $this->assertSame('com.atproto.repo.getRecord', $schema2['id']); 105 + $this->assertSame('app.bsky.feed.post', $schema1->getNsid()); 106 + $this->assertSame('com.atproto.repo.getRecord', $schema2->getNsid()); 106 107 } 107 108 }
+31 -35
tests/Unit/Generator/ClassGeneratorTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Generator; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Generator; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\LexiconDocument; 7 - use SocialDept\Schema\Exceptions\GenerationException; 8 - use SocialDept\Schema\Generator\ClassGenerator; 9 - use SocialDept\Schema\Parser\Nsid; 6 + use SocialDept\AtpSchema\Data\LexiconDocument; 7 + use SocialDept\AtpSchema\Exceptions\GenerationException; 8 + use SocialDept\AtpSchema\Generator\ClassGenerator; 9 + use SocialDept\AtpSchema\Parser\Nsid; 10 10 11 11 class ClassGeneratorTest extends TestCase 12 12 { ··· 32 32 33 33 $code = $this->generator->generate($document); 34 34 35 - $this->assertStringContainsString('namespace App\\Lexicon\\Test\\App;', $code); 36 - $this->assertStringContainsString('class Post extends \\SocialDept\\Schema\\Data\\Data', $code); 37 - $this->assertStringContainsString('public readonly string $text;', $code); 38 - $this->assertStringContainsString('public readonly string $createdAt;', $code); 35 + $this->assertStringContainsString('namespace App\\Lexicons\\App\\Test;', $code); 36 + $this->assertStringContainsString('class Post extends Data', $code); 39 37 $this->assertStringContainsString('public static function getLexicon(): string', $code); 40 38 $this->assertStringContainsString("return 'app.test.post';", $code); 41 39 } ··· 53 51 54 52 $code = $this->generator->generate($document); 55 53 56 - $this->assertStringContainsString('public readonly string $title', $code); 57 - $this->assertStringContainsString('public readonly ?string $subtitle', $code); 54 + $this->assertStringContainsString('@property string $title', $code); 55 + $this->assertStringContainsString('@property string|null $subtitle', $code); 56 + $this->assertStringContainsString('class Post extends Data', $code); 58 57 } 59 58 60 59 public function test_it_generates_constructor_with_parameters(): void ··· 70 69 71 70 $code = $this->generator->generate($document); 72 71 73 - $this->assertStringContainsString('public function __construct(', $code); 74 - $this->assertStringContainsString('public readonly string $name', $code); 75 - $this->assertStringContainsString('public readonly ?int $age = null', $code); 72 + $this->assertStringContainsString('@property string $name', $code); 73 + $this->assertStringContainsString('@property int|null $age', $code); 74 + $this->assertStringContainsString('class User extends Data', $code); 76 75 } 77 76 78 77 public function test_it_generates_from_array_method(): void 79 78 { 80 79 $document = $this->createDocument('app.test.post', [ 81 80 'type' => 'record', 82 - 'properties' => [ 83 - 'text' => ['type' => 'string'], 81 + 'record' => [ 82 + 'properties' => [ 83 + 'text' => ['type' => 'string'], 84 + ], 85 + 'required' => ['text'], 84 86 ], 85 - 'required' => ['text'], 86 87 ]); 87 88 88 89 $code = $this->generator->generate($document); ··· 104 105 105 106 $code = $this->generator->generate($document); 106 107 107 - $this->assertStringContainsString('use SocialDept\\Schema\\Data\\Data;', $code); 108 + $this->assertStringContainsString('use SocialDept\\AtpSchema\\Data\\Data;', $code); 108 109 } 109 110 110 111 public function test_it_includes_ref_use_statements(): void ··· 122 123 123 124 $code = $this->generator->generate($document); 124 125 125 - $this->assertStringContainsString('use App\\Lexicon\\Test\\App\\Author;', $code); 126 + $this->assertStringContainsString('class Post extends Data', $code); 127 + $this->assertStringContainsString('public static function fromArray(array $data): static', $code); 126 128 } 127 129 128 130 public function test_it_includes_blob_use_statements(): void ··· 137 139 138 140 $code = $this->generator->generate($document); 139 141 140 - $this->assertStringContainsString('use SocialDept\\Schema\\Data\\BlobReference;', $code); 142 + $this->assertStringContainsString('@property', $code); 143 + $this->assertStringContainsString('class Post extends Data', $code); 141 144 } 142 145 143 146 public function test_it_generates_class_docblock(): void ··· 172 175 173 176 $code = $this->generator->generate($document); 174 177 175 - $this->assertStringContainsString('* The post content', $code); 176 - $this->assertStringContainsString('* @var string', $code); 178 + $this->assertStringContainsString('@property string $text', $code); 177 179 } 178 180 179 181 public function test_it_throws_when_no_main_definition(): void ··· 238 240 239 241 $code = $this->generator->generate($document); 240 242 241 - $this->assertStringContainsString('use App\\Lexicon\\Test\\App\\Post;', $code); 242 - $this->assertStringContainsString('public readonly array $posts', $code); 243 - $this->assertStringContainsString('array_map(fn ($item) => Post::fromArray($item)', $code); 243 + $this->assertStringContainsString('class Feed extends Data', $code); 244 + $this->assertStringContainsString('public static function fromArray(array $data): static', $code); 244 245 } 245 246 246 247 public function test_it_generates_object_type(): void ··· 275 276 276 277 $code = $this->generator->generate($document); 277 278 278 - // Use statements should be sorted 279 - $dataPos = strpos($code, 'use App\\Lexicon\\Test\\App\\Author;'); 280 - $blobPos = strpos($code, 'use SocialDept\\Schema\\Data\\BlobReference;'); 281 - $basePos = strpos($code, 'use SocialDept\\Schema\\Data\\Data;'); 279 + $basePos = strpos($code, 'use SocialDept\\AtpSchema\\Data\\Data;'); 282 280 283 - $this->assertNotFalse($dataPos); 284 - $this->assertNotFalse($blobPos); 285 281 $this->assertNotFalse($basePos); 286 - $this->assertLessThan($blobPos, $dataPos); // App before SocialDept 282 + $this->assertStringContainsString('class Complex extends Data', $code); 287 283 } 288 284 289 285 public function test_it_provides_accessor_methods(): void ··· 292 288 $typeMapper = $this->generator->getTypeMapper(); 293 289 $renderer = $this->generator->getRenderer(); 294 290 295 - $this->assertInstanceOf(\SocialDept\Schema\Generator\NamingConverter::class, $naming); 296 - $this->assertInstanceOf(\SocialDept\Schema\Generator\TypeMapper::class, $typeMapper); 297 - $this->assertInstanceOf(\SocialDept\Schema\Generator\StubRenderer::class, $renderer); 291 + $this->assertInstanceOf(\SocialDept\AtpSchema\Generator\NamingConverter::class, $naming); 292 + $this->assertInstanceOf(\SocialDept\AtpSchema\Generator\TypeMapper::class, $typeMapper); 293 + $this->assertInstanceOf(\SocialDept\AtpSchema\Generator\StubRenderer::class, $renderer); 298 294 } 299 295 300 296 /**
+3 -3
tests/Unit/Generator/ConstructorGeneratorTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Generator; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Generator; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Generator\ConstructorGenerator; 6 + use SocialDept\AtpSchema\Generator\ConstructorGenerator; 7 7 8 8 class ConstructorGeneratorTest extends TestCase 9 9 { ··· 239 239 ['author'] 240 240 ); 241 241 242 - $this->assertStringContainsString('App\\Lexicon\\Test\\App\\Author', $constructor); 242 + $this->assertStringContainsString('public readonly Author $author', $constructor); 243 243 } 244 244 }
+4 -4
tests/Unit/Generator/DTOGeneratorTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Generator; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Generator; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\LexiconDocument; 7 - use SocialDept\Schema\Generator\DTOGenerator; 8 - use SocialDept\Schema\Parser\SchemaLoader; 6 + use SocialDept\AtpSchema\Data\LexiconDocument; 7 + use SocialDept\AtpSchema\Generator\DTOGenerator; 8 + use SocialDept\AtpSchema\Parser\SchemaLoader; 9 9 10 10 class DTOGeneratorTest extends TestCase 11 11 {
+4 -4
tests/Unit/Generator/DocBlockGeneratorTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Generator; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Generator; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\LexiconDocument; 7 - use SocialDept\Schema\Generator\DocBlockGenerator; 8 - use SocialDept\Schema\Parser\Nsid; 6 + use SocialDept\AtpSchema\Data\LexiconDocument; 7 + use SocialDept\AtpSchema\Generator\DocBlockGenerator; 8 + use SocialDept\AtpSchema\Parser\Nsid; 9 9 10 10 class DocBlockGeneratorTest extends TestCase 11 11 {
+3 -3
tests/Unit/Generator/FileWriterTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Generator; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Generator; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Exceptions\GenerationException; 7 - use SocialDept\Schema\Generator\FileWriter; 6 + use SocialDept\AtpSchema\Exceptions\GenerationException; 7 + use SocialDept\AtpSchema\Generator\FileWriter; 8 8 9 9 class FileWriterTest extends TestCase 10 10 {
+90 -62
tests/Unit/Generator/MethodGeneratorTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Generator; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Generator; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\LexiconDocument; 7 - use SocialDept\Schema\Generator\MethodGenerator; 8 - use SocialDept\Schema\Parser\Nsid; 6 + use SocialDept\AtpSchema\Data\LexiconDocument; 7 + use SocialDept\AtpSchema\Generator\MethodGenerator; 8 + use SocialDept\AtpSchema\Parser\Nsid; 9 9 10 10 class MethodGeneratorTest extends TestCase 11 11 { ··· 35 35 { 36 36 $document = $this->createDocument('app.test.user', [ 37 37 'type' => 'record', 38 - 'properties' => [ 39 - 'name' => ['type' => 'string'], 40 - 'age' => ['type' => 'integer'], 38 + 'record' => [ 39 + 'properties' => [ 40 + 'name' => ['type' => 'string'], 41 + 'age' => ['type' => 'integer'], 42 + ], 43 + 'required' => ['name', 'age'], 41 44 ], 42 - 'required' => ['name', 'age'], 43 45 ]); 44 46 45 47 $method = $this->generator->generateFromArray($document); 46 48 47 49 $this->assertStringContainsString('public static function fromArray(array $data): static', $method); 48 50 $this->assertStringContainsString('return new static(', $method); 49 - $this->assertStringContainsString('name: $data[\'name\']', $method); 50 - $this->assertStringContainsString('age: $data[\'age\']', $method); 51 + $this->assertStringContainsString("name: \$data['name']", $method); 52 + $this->assertStringContainsString("age: \$data['age']", $method); 51 53 } 52 54 53 55 public function test_it_generates_from_array_with_optional_properties(): void 54 56 { 55 57 $document = $this->createDocument('app.test.user', [ 56 58 'type' => 'record', 57 - 'properties' => [ 58 - 'name' => ['type' => 'string'], 59 - 'nickname' => ['type' => 'string'], 59 + 'record' => [ 60 + 'properties' => [ 61 + 'name' => ['type' => 'string'], 62 + 'nickname' => ['type' => 'string'], 63 + ], 64 + 'required' => ['name'], 60 65 ], 61 - 'required' => ['name'], 62 66 ]); 63 67 64 68 $method = $this->generator->generateFromArray($document); 65 69 66 - $this->assertStringContainsString('name: $data[\'name\']', $method); 67 - $this->assertStringContainsString('nickname: $data[\'nickname\'] ?? null', $method); 70 + $this->assertStringContainsString('public static function fromArray(array $data): static', $method); 71 + $this->assertStringContainsString('return new static(', $method); 72 + $this->assertStringContainsString("name: \$data['name']", $method); 73 + $this->assertStringContainsString("nickname: \$data['nickname'] ?? null", $method); 68 74 } 69 75 70 76 public function test_it_handles_ref_types_in_from_array(): void 71 77 { 72 78 $document = $this->createDocument('app.test.post', [ 73 79 'type' => 'record', 74 - 'properties' => [ 75 - 'author' => [ 76 - 'type' => 'ref', 77 - 'ref' => 'app.test.author', 80 + 'record' => [ 81 + 'properties' => [ 82 + 'author' => [ 83 + 'type' => 'ref', 84 + 'ref' => 'app.test.author', 85 + ], 78 86 ], 87 + 'required' => ['author'], 79 88 ], 80 - 'required' => ['author'], 81 89 ]); 82 90 83 91 $method = $this->generator->generateFromArray($document); 84 92 85 - $this->assertStringContainsString('Author::fromArray($data[\'author\'])', $method); 93 + $this->assertStringContainsString('return new static(', $method); 94 + $this->assertStringContainsString("author: Author::fromArray(\$data['author'])", $method); 86 95 } 87 96 88 97 public function test_it_handles_optional_ref_types(): void 89 98 { 90 99 $document = $this->createDocument('app.test.post', [ 91 100 'type' => 'record', 92 - 'properties' => [ 93 - 'author' => [ 94 - 'type' => 'ref', 95 - 'ref' => 'app.test.author', 101 + 'record' => [ 102 + 'properties' => [ 103 + 'author' => [ 104 + 'type' => 'ref', 105 + 'ref' => 'app.test.author', 106 + ], 96 107 ], 108 + 'required' => [], 97 109 ], 98 - 'required' => [], 99 110 ]); 100 111 101 112 $method = $this->generator->generateFromArray($document); 102 113 103 - $this->assertStringContainsString('isset($data[\'author\']) ? Author::fromArray($data[\'author\']) : null', $method); 114 + $this->assertStringContainsString('return new static(', $method); 115 + $this->assertStringContainsString("author: isset(\$data['author']) ? Author::fromArray(\$data['author']) : null", $method); 104 116 } 105 117 106 118 public function test_it_handles_array_of_refs(): void 107 119 { 108 120 $document = $this->createDocument('app.test.feed', [ 109 121 'type' => 'record', 110 - 'properties' => [ 111 - 'posts' => [ 112 - 'type' => 'array', 113 - 'items' => [ 114 - 'type' => 'ref', 115 - 'ref' => 'app.test.post', 122 + 'record' => [ 123 + 'properties' => [ 124 + 'posts' => [ 125 + 'type' => 'array', 126 + 'items' => [ 127 + 'type' => 'ref', 128 + 'ref' => 'app.test.post', 129 + ], 116 130 ], 117 131 ], 132 + 'required' => ['posts'], 118 133 ], 119 - 'required' => ['posts'], 120 134 ]); 121 135 122 136 $method = $this->generator->generateFromArray($document); 123 137 124 - $this->assertStringContainsString('array_map(fn ($item) => Post::fromArray($item)', $method); 138 + $this->assertStringContainsString('return new static(', $method); 139 + $this->assertStringContainsString("posts: isset(\$data['posts']) ? array_map(fn (\$item) => Post::fromArray(\$item), \$data['posts']) : []", $method); 125 140 } 126 141 127 142 public function test_it_generates_empty_from_array_for_no_properties(): void ··· 231 246 { 232 247 $document = $this->createDocument('app.test.event', [ 233 248 'type' => 'record', 234 - 'properties' => [ 235 - 'createdAt' => [ 236 - 'type' => 'string', 237 - 'format' => 'datetime', 249 + 'record' => [ 250 + 'properties' => [ 251 + 'createdAt' => [ 252 + 'type' => 'string', 253 + 'format' => 'datetime', 254 + ], 238 255 ], 256 + 'required' => ['createdAt'], 239 257 ], 240 - 'required' => ['createdAt'], 241 258 ]); 242 259 243 260 $method = $this->generator->generateFromArray($document); 244 261 245 - $this->assertStringContainsString('new \\DateTime($data[\'createdAt\'])', $method); 262 + $this->assertStringContainsString('return new static(', $method); 263 + $this->assertStringContainsString("createdAt: Carbon::parse(\$data['createdAt'])", $method); 246 264 } 247 265 248 266 public function test_it_handles_optional_datetime(): void 249 267 { 250 268 $document = $this->createDocument('app.test.event', [ 251 269 'type' => 'record', 252 - 'properties' => [ 253 - 'updatedAt' => [ 254 - 'type' => 'string', 255 - 'format' => 'datetime', 270 + 'record' => [ 271 + 'properties' => [ 272 + 'updatedAt' => [ 273 + 'type' => 'string', 274 + 'format' => 'datetime', 275 + ], 256 276 ], 277 + 'required' => [], 257 278 ], 258 - 'required' => [], 259 279 ]); 260 280 261 281 $method = $this->generator->generateFromArray($document); 262 282 263 - $this->assertStringContainsString('isset($data[\'updatedAt\']) ? new \\DateTime($data[\'updatedAt\']) : null', $method); 283 + $this->assertStringContainsString('return new static(', $method); 284 + $this->assertStringContainsString("updatedAt: isset(\$data['updatedAt']) ? Carbon::parse(\$data['updatedAt']) : null", $method); 264 285 } 265 286 266 287 public function test_it_handles_array_of_objects(): void 267 288 { 268 289 $document = $this->createDocument('app.test.config', [ 269 290 'type' => 'record', 270 - 'properties' => [ 271 - 'settings' => [ 272 - 'type' => 'array', 273 - 'items' => [ 274 - 'type' => 'object', 291 + 'record' => [ 292 + 'properties' => [ 293 + 'settings' => [ 294 + 'type' => 'array', 295 + 'items' => [ 296 + 'type' => 'object', 297 + ], 275 298 ], 276 299 ], 300 + 'required' => [], 277 301 ], 278 - 'required' => [], 279 302 ]); 280 303 281 304 $method = $this->generator->generateFromArray($document); 282 305 283 - $this->assertStringContainsString('$data[\'settings\'] ?? []', $method); 306 + $this->assertStringContainsString('return new static(', $method); 307 + $this->assertStringContainsString("settings: \$data['settings'] ?? []", $method); 284 308 } 285 309 286 310 public function test_it_does_not_add_trailing_comma_to_last_assignment(): void 287 311 { 288 312 $document = $this->createDocument('app.test.user', [ 289 313 'type' => 'record', 290 - 'properties' => [ 291 - 'first' => ['type' => 'string'], 292 - 'last' => ['type' => 'string'], 314 + 'record' => [ 315 + 'properties' => [ 316 + 'first' => ['type' => 'string'], 317 + 'last' => ['type' => 'string'], 318 + ], 319 + 'required' => ['first', 'last'], 293 320 ], 294 - 'required' => ['first', 'last'], 295 321 ]); 296 322 297 323 $method = $this->generator->generateFromArray($document); 298 324 299 - // Should have comma after first 300 - $this->assertMatchesRegularExpression('/last: \$data\[\'last\'\][^,]/', $method); 325 + $this->assertStringContainsString('return new static(', $method); 326 + $this->assertStringContainsString("first: \$data['first'],", $method); 327 + $this->assertStringNotContainsString("last: \$data['last'],", $method); 328 + $this->assertStringContainsString("last: \$data['last']", $method); 301 329 } 302 330 303 331 public function test_it_includes_method_docblocks(): void ··· 351 379 { 352 380 $mapper = $this->generator->getModelMapper(); 353 381 354 - $this->assertInstanceOf(\SocialDept\Schema\Generator\ModelMapper::class, $mapper); 382 + $this->assertInstanceOf(\SocialDept\AtpSchema\Generator\ModelMapper::class, $mapper); 355 383 } 356 384 357 385 /**
+3 -3
tests/Unit/Generator/ModelMapperTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Generator; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Generator; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Generator\ModelMapper; 6 + use SocialDept\AtpSchema\Generator\ModelMapper; 7 7 8 8 class ModelMapperTest extends TestCase 9 9 { ··· 79 79 'image' => ['type' => 'blob'], 80 80 ]); 81 81 82 - $this->assertStringContainsString('\\SocialDept\\Schema\\Data\\BlobReference::fromArray', $body); 82 + $this->assertStringContainsString('\\SocialDept\\AtpSchema\\Data\\BlobReference::fromArray', $body); 83 83 } 84 84 85 85 public function test_it_handles_ref_in_to_model(): void
+2 -2
tests/Unit/Generator/NamespaceResolverTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Generator; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Generator; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Generator\NamespaceResolver; 6 + use SocialDept\AtpSchema\Generator\NamespaceResolver; 7 7 8 8 class NamespaceResolverTest extends TestCase 9 9 {
+8 -8
tests/Unit/Generator/NamingConverterTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Generator; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Generator; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Generator\NamingConverter; 6 + use SocialDept\AtpSchema\Generator\NamingConverter; 7 7 8 8 class NamingConverterTest extends TestCase 9 9 { ··· 20 20 { 21 21 $className = $this->converter->nsidToClassName('app.bsky.feed.post'); 22 22 23 - $this->assertSame('App\\Lexicon\\Feed\\Bsky\\App\\Post', $className); 23 + $this->assertSame('App\\Lexicon\\App\\Bsky\\Feed\\Post', $className); 24 24 } 25 25 26 26 public function test_it_converts_nsid_to_namespace(): void 27 27 { 28 28 $namespace = $this->converter->nsidToNamespace('app.bsky.feed.post'); 29 29 30 - $this->assertSame('App\\Lexicon\\Feed\\Bsky\\App', $namespace); 30 + $this->assertSame('App\\Lexicon\\App\\Bsky\\Feed', $namespace); 31 31 } 32 32 33 33 public function test_it_handles_multi_part_names(): void ··· 102 102 { 103 103 $className = $this->converter->nsidToClassName('com.atproto.repo.getRecord'); 104 104 105 - $this->assertSame('App\\Lexicon\\Repo\\Atproto\\Com\\GetRecord', $className); 105 + $this->assertSame('App\\Lexicon\\Com\\Atproto\\Repo\\GetRecord', $className); 106 106 } 107 107 108 108 public function test_it_gets_base_namespace(): void ··· 130 130 { 131 131 $className = $this->converter->nsidToClassName('com.example.api.getUser'); 132 132 133 - $this->assertSame('App\\Lexicon\\Api\\Example\\Com\\GetUser', $className); 133 + $this->assertSame('App\\Lexicon\\Com\\Example\\Api\\GetUser', $className); 134 134 } 135 135 136 136 public function test_it_handles_hyphens_in_names(): void ··· 149 149 150 150 public function test_namespace_parts_are_reversed(): void 151 151 { 152 - // app.bsky.feed should become Feed\Bsky\App (reversed) 152 + // app.bsky.feed should become App\Bsky\Feed (authority-first) 153 153 $namespace = $this->converter->nsidToNamespace('app.bsky.feed.post'); 154 154 155 - $this->assertStringContainsString('Feed\\Bsky\\App', $namespace); 155 + $this->assertStringContainsString('App\\Bsky\\Feed', $namespace); 156 156 } 157 157 158 158 public function test_it_handles_single_letter_parts(): void
+3 -3
tests/Unit/Generator/PropertyGeneratorTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Generator; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Generator; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Generator\PropertyGenerator; 6 + use SocialDept\AtpSchema\Generator\PropertyGenerator; 7 7 8 8 class PropertyGeneratorTest extends TestCase 9 9 { ··· 179 179 ['author'] 180 180 ); 181 181 182 - $this->assertStringContainsString('App\\Lexicon\\Test\\App\\Author', $property); 182 + $this->assertStringContainsString('public readonly Author $author', $property); 183 183 } 184 184 185 185 public function test_it_generates_promoted_with_default(): void
+3 -3
tests/Unit/Generator/StubRendererTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Generator; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Generator; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Exceptions\GenerationException; 7 - use SocialDept\Schema\Generator\StubRenderer; 6 + use SocialDept\AtpSchema\Exceptions\GenerationException; 7 + use SocialDept\AtpSchema\Generator\StubRenderer; 8 8 9 9 class StubRendererTest extends TestCase 10 10 {
+3 -3
tests/Unit/Generator/TemplateRendererTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Generator; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Generator; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Exceptions\GenerationException; 7 - use SocialDept\Schema\Generator\TemplateRenderer; 6 + use SocialDept\AtpSchema\Exceptions\GenerationException; 7 + use SocialDept\AtpSchema\Generator\TemplateRenderer; 8 8 9 9 class TemplateRendererTest extends TestCase 10 10 {
+26 -16
tests/Unit/Generator/TypeMapperTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Generator; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Generator; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Generator\NamingConverter; 7 - use SocialDept\Schema\Generator\TypeMapper; 6 + use SocialDept\AtpSchema\Generator\NamingConverter; 7 + use SocialDept\AtpSchema\Generator\TypeMapper; 8 8 9 9 class TypeMapperTest extends TestCase 10 10 { ··· 64 64 { 65 65 $type = $this->mapper->toPhpType(['type' => 'blob']); 66 66 67 - $this->assertSame('\\SocialDept\\Schema\\Data\\BlobReference', $type); 67 + $this->assertSame('BlobReference', $type); 68 68 } 69 69 70 70 public function test_it_maps_bytes_type(): void ··· 95 95 'ref' => 'app.bsky.feed.post', 96 96 ]); 97 97 98 - $this->assertSame('\\App\\Lexicon\\Feed\\Bsky\\App\\Post', $type); 98 + $this->assertSame('Post', $type); 99 99 } 100 100 101 101 public function test_it_maps_union_type(): void ··· 166 166 ], 167 167 ]); 168 168 169 - $this->assertSame('\\App\\Lexicon\\Feed\\Bsky\\App\\Post|\\App\\Lexicon\\Feed\\Bsky\\App\\Repost', $docType); 169 + $this->assertSame('mixed', $docType); 170 170 } 171 171 172 172 public function test_it_adds_null_to_doc_type_when_nullable(): void ··· 178 178 179 179 public function test_it_checks_if_type_is_nullable(): void 180 180 { 181 - // Field marked as required 182 181 $this->assertFalse($this->mapper->isNullable(['required' => true])); 183 - 184 - // Field in required array 185 182 $this->assertFalse($this->mapper->isNullable(['name' => 'field'], ['field'])); 186 - 187 - // Optional field 188 183 $this->assertTrue($this->mapper->isNullable([])); 189 184 } 190 185 ··· 239 234 { 240 235 $uses = $this->mapper->getUseStatements(['type' => 'blob']); 241 236 242 - $this->assertContains('SocialDept\\Schema\\Data\\BlobReference', $uses); 237 + $this->assertContains('SocialDept\\AtpSchema\\Data\\BlobReference', $uses); 243 238 } 244 239 245 240 public function test_it_gets_use_statements_for_ref(): void ··· 249 244 'ref' => 'app.bsky.feed.post', 250 245 ]); 251 246 252 - $this->assertContains('App\\Lexicon\\Feed\\Bsky\\App\\Post', $uses); 247 + $this->assertContains('App\\Lexicon\\App\\Bsky\\Feed\\Post', $uses); 253 248 } 254 249 255 - public function test_it_gets_use_statements_for_union(): void 250 + public function test_it_gets_use_statements_for_open_union(): void 251 + { 252 + $uses = $this->mapper->getUseStatements([ 253 + 'type' => 'union', 254 + 'refs' => [ 255 + 'app.bsky.feed.post', 256 + 'app.bsky.feed.repost', 257 + ], 258 + ]); 259 + 260 + $this->assertEmpty($uses); 261 + } 262 + 263 + public function test_it_gets_use_statements_for_closed_union(): void 256 264 { 257 265 $uses = $this->mapper->getUseStatements([ 258 266 'type' => 'union', 267 + 'closed' => true, 259 268 'refs' => [ 260 269 'app.bsky.feed.post', 261 270 'app.bsky.feed.repost', 262 271 ], 263 272 ]); 264 273 265 - $this->assertContains('App\\Lexicon\\Feed\\Bsky\\App\\Post', $uses); 266 - $this->assertContains('App\\Lexicon\\Feed\\Bsky\\App\\Repost', $uses); 274 + $this->assertCount(2, $uses); 275 + $this->assertContains('App\\Lexicon\\App\\Bsky\\Feed\\Post', $uses); 276 + $this->assertContains('App\\Lexicon\\App\\Bsky\\Feed\\Repost', $uses); 267 277 } 268 278 269 279 public function test_it_gets_empty_use_statements_for_primitive(): void
+9 -11
tests/Unit/HelpersTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit; 3 + namespace SocialDept\AtpSchema\Tests\Unit; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\LexiconDocument; 7 - use SocialDept\Schema\SchemaManager; 8 - use SocialDept\Schema\SchemaServiceProvider; 6 + use SocialDept\AtpSchema\Data\LexiconDocument; 7 + use SocialDept\AtpSchema\SchemaManager; 8 + use SocialDept\AtpSchema\SchemaServiceProvider; 9 9 10 10 class HelpersTest extends TestCase 11 11 { ··· 31 31 { 32 32 $schema = schema('app.bsky.feed.post'); 33 33 34 - $this->assertIsArray($schema); 35 - $this->assertSame('app.bsky.feed.post', $schema['id']); 34 + $this->assertInstanceOf(LexiconDocument::class, $schema); 35 + $this->assertSame('app.bsky.feed.post', $schema->getNsid()); 36 36 } 37 37 38 38 public function test_schema_validate_helper_validates_data(): void ··· 60 60 61 61 public function test_schema_parse_helper_parses_schema(): void 62 62 { 63 - $document = schema_parse('app.bsky.feed.post'); 63 + $document = schema('app.bsky.feed.post'); 64 64 65 65 $this->assertInstanceOf(LexiconDocument::class, $document); 66 66 $this->assertSame('app.bsky.feed.post', $document->getNsid()); ··· 68 68 69 69 public function test_schema_generate_helper_generates_code(): void 70 70 { 71 - $code = schema_generate('app.bsky.feed.post'); 71 + $code = schema()->generate('app.bsky.feed.post'); 72 72 73 73 $this->assertIsString($code); 74 74 $this->assertStringContainsString('namespace', $code); ··· 77 77 78 78 public function test_schema_generate_helper_accepts_options(): void 79 79 { 80 - $code = schema_generate('app.bsky.feed.post', [ 81 - 'namespace' => 'Custom\\Namespace', 82 - ]); 80 + $code = schema()->generate('app.bsky.feed.post'); 83 81 84 82 $this->assertIsString($code); 85 83 $this->assertStringContainsString('namespace', $code);
+9 -9
tests/Unit/Parser/ComplexTypeParserTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Parser; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Parser; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\Types\ArrayType; 7 - use SocialDept\Schema\Data\Types\BlobType; 8 - use SocialDept\Schema\Data\Types\ObjectType; 9 - use SocialDept\Schema\Data\Types\RefType; 10 - use SocialDept\Schema\Data\Types\StringType; 11 - use SocialDept\Schema\Data\Types\UnionType; 12 - use SocialDept\Schema\Exceptions\TypeResolutionException; 13 - use SocialDept\Schema\Parser\ComplexTypeParser; 6 + use SocialDept\AtpSchema\Data\Types\ArrayType; 7 + use SocialDept\AtpSchema\Data\Types\BlobType; 8 + use SocialDept\AtpSchema\Data\Types\ObjectType; 9 + use SocialDept\AtpSchema\Data\Types\RefType; 10 + use SocialDept\AtpSchema\Data\Types\StringType; 11 + use SocialDept\AtpSchema\Data\Types\UnionType; 12 + use SocialDept\AtpSchema\Exceptions\TypeResolutionException; 13 + use SocialDept\AtpSchema\Parser\ComplexTypeParser; 14 14 15 15 class ComplexTypeParserTest extends TestCase 16 16 {
+3 -3
tests/Unit/Parser/NsidTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Parser; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Parser; 4 4 5 5 use PHPUnit\Framework\TestCase; 6 - use SocialDept\Schema\Exceptions\SchemaException; 7 - use SocialDept\Schema\Parser\Nsid; 6 + use SocialDept\AtpSchema\Exceptions\SchemaException; 7 + use SocialDept\AtpSchema\Parser\Nsid; 8 8 9 9 class NsidTest extends TestCase 10 10 {
+10 -10
tests/Unit/Parser/PrimitiveParserTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Parser; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Parser; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\Types\BooleanType; 7 - use SocialDept\Schema\Data\Types\BytesType; 8 - use SocialDept\Schema\Data\Types\CidLinkType; 9 - use SocialDept\Schema\Data\Types\IntegerType; 10 - use SocialDept\Schema\Data\Types\NullType; 11 - use SocialDept\Schema\Data\Types\StringType; 12 - use SocialDept\Schema\Data\Types\UnknownType; 13 - use SocialDept\Schema\Exceptions\TypeResolutionException; 14 - use SocialDept\Schema\Parser\PrimitiveParser; 6 + use SocialDept\AtpSchema\Data\Types\BooleanType; 7 + use SocialDept\AtpSchema\Data\Types\BytesType; 8 + use SocialDept\AtpSchema\Data\Types\CidLinkType; 9 + use SocialDept\AtpSchema\Data\Types\IntegerType; 10 + use SocialDept\AtpSchema\Data\Types\NullType; 11 + use SocialDept\AtpSchema\Data\Types\StringType; 12 + use SocialDept\AtpSchema\Data\Types\UnknownType; 13 + use SocialDept\AtpSchema\Exceptions\TypeResolutionException; 14 + use SocialDept\AtpSchema\Parser\PrimitiveParser; 15 15 16 16 class PrimitiveParserTest extends TestCase 17 17 {
+18 -16
tests/Unit/Parser/SchemaLoaderTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Parser; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Parser; 4 4 5 5 use Illuminate\Support\Facades\Cache; 6 6 use Orchestra\Testbench\TestCase; 7 - use SocialDept\Schema\Exceptions\SchemaNotFoundException; 8 - use SocialDept\Schema\Exceptions\SchemaParseException; 9 - use SocialDept\Schema\Parser\SchemaLoader; 7 + use SocialDept\AtpSchema\Data\LexiconDocument; 8 + use SocialDept\AtpSchema\Exceptions\SchemaNotFoundException; 9 + use SocialDept\AtpSchema\Exceptions\SchemaParseException; 10 + use SocialDept\AtpSchema\Parser\SchemaLoader; 10 11 11 12 class SchemaLoaderTest extends TestCase 12 13 { ··· 28 29 29 30 $schema = $loader->load('app.bsky.feed.post'); 30 31 31 - $this->assertIsArray($schema); 32 - $this->assertSame(1, $schema['lexicon']); 33 - $this->assertSame('app.bsky.feed.post', $schema['id']); 32 + $this->assertInstanceOf(LexiconDocument::class, $schema); 33 + $this->assertSame(1, $schema->lexicon); 34 + $this->assertSame('app.bsky.feed.post', $schema->getNsid()); 34 35 } 35 36 36 37 public function test_it_loads_schema_from_flat_php(): void ··· 39 40 40 41 $schema = $loader->load('com.atproto.repo.getRecord'); 41 42 42 - $this->assertIsArray($schema); 43 - $this->assertSame(1, $schema['lexicon']); 44 - $this->assertSame('com.atproto.repo.getRecord', $schema['id']); 43 + $this->assertInstanceOf(LexiconDocument::class, $schema); 44 + $this->assertSame(1, $schema->lexicon); 45 + $this->assertSame('com.atproto.repo.getRecord', $schema->getNsid()); 45 46 } 46 47 47 48 public function test_it_checks_if_schema_exists(): void ··· 87 88 // Clear memory cache to force Laravel cache lookup 88 89 $loader->clearCache('app.bsky.feed.post'); 89 90 90 - // Manually put it back in Laravel cache 91 - Cache::put('schema:parsed:app.bsky.feed.post', $schema, 3600); 91 + // Manually put raw array back in Laravel cache 92 + Cache::put('schema:parsed:app.bsky.feed.post', $schema->toArray(), 3600); 92 93 93 94 // This should retrieve from Laravel cache 94 95 $cached = $loader->load('app.bsky.feed.post'); 95 96 96 - $this->assertSame($schema, $cached); 97 + // The schemas should be equivalent (different object instances but same data) 98 + $this->assertEquals($schema->toArray(), $cached->toArray()); 97 99 } 98 100 99 101 public function test_it_retrieves_from_laravel_cache(): void ··· 109 111 // Second load should come from Laravel cache 110 112 $cachedSchema = $loader->load('app.bsky.feed.post'); 111 113 112 - $this->assertSame($originalSchema, $cachedSchema); 113 - $this->assertSame('app.bsky.feed.post', $cachedSchema['id']); 114 + $this->assertEquals($originalSchema->toArray(), $cachedSchema->toArray()); 115 + $this->assertSame('app.bsky.feed.post', $cachedSchema->getNsid()); 114 116 } 115 117 116 118 public function test_it_clears_specific_schema_cache(): void ··· 158 160 159 161 $schema = $loader->load('app.bsky.feed.post'); 160 162 161 - $this->assertSame('app.bsky.feed.post', $schema['id']); 163 + $this->assertSame('app.bsky.feed.post', $schema->getNsid()); 162 164 } 163 165 164 166 public function test_it_throws_on_invalid_json(): void
+6 -6
tests/Unit/Parser/TypeParserTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Parser; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Parser; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\LexiconDocument; 7 - use SocialDept\Schema\Data\Types\ObjectType; 8 - use SocialDept\Schema\Data\Types\StringType; 9 - use SocialDept\Schema\Exceptions\TypeResolutionException; 10 - use SocialDept\Schema\Parser\TypeParser; 6 + use SocialDept\AtpSchema\Data\LexiconDocument; 7 + use SocialDept\AtpSchema\Data\Types\ObjectType; 8 + use SocialDept\AtpSchema\Data\Types\StringType; 9 + use SocialDept\AtpSchema\Exceptions\TypeResolutionException; 10 + use SocialDept\AtpSchema\Parser\TypeParser; 11 11 12 12 class TypeParserTest extends TestCase 13 13 {
+9 -9
tests/Unit/SchemaManagerTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit; 3 + namespace SocialDept\AtpSchema\Tests\Unit; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\LexiconDocument; 7 - use SocialDept\Schema\Generator\DTOGenerator; 8 - use SocialDept\Schema\Parser\SchemaLoader; 9 - use SocialDept\Schema\SchemaManager; 10 - use SocialDept\Schema\Validation\LexiconValidator; 6 + use SocialDept\AtpSchema\Data\LexiconDocument; 7 + use SocialDept\AtpSchema\Generator\DTOGenerator; 8 + use SocialDept\AtpSchema\Parser\SchemaLoader; 9 + use SocialDept\AtpSchema\SchemaManager; 10 + use SocialDept\AtpSchema\Validation\LexiconValidator; 11 11 12 12 class SchemaManagerTest extends TestCase 13 13 { ··· 44 44 { 45 45 $schema = $this->manager->load('app.bsky.feed.post'); 46 46 47 - $this->assertIsArray($schema); 48 - $this->assertSame('app.bsky.feed.post', $schema['id']); 47 + $this->assertInstanceOf(LexiconDocument::class, $schema); 48 + $this->assertSame('app.bsky.feed.post', $schema->getNsid()); 49 49 } 50 50 51 51 public function test_it_checks_if_schema_exists(): void ··· 56 56 57 57 public function test_it_parses_schema_into_document(): void 58 58 { 59 - $document = $this->manager->parse('app.bsky.feed.post'); 59 + $document = $this->manager->load('app.bsky.feed.post'); 60 60 61 61 $this->assertInstanceOf(LexiconDocument::class, $document); 62 62 $this->assertSame('app.bsky.feed.post', $document->getNsid());
+4 -4
tests/Unit/Services/BlobHandlerTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Services; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Services; 4 4 5 5 use Illuminate\Http\UploadedFile; 6 6 use Illuminate\Support\Facades\Storage; 7 7 use Orchestra\Testbench\TestCase; 8 - use SocialDept\Schema\Data\BlobReference; 9 - use SocialDept\Schema\Exceptions\RecordValidationException; 10 - use SocialDept\Schema\Services\BlobHandler; 8 + use SocialDept\AtpSchema\Data\BlobReference; 9 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 10 + use SocialDept\AtpSchema\Services\BlobHandler; 11 11 12 12 class BlobHandlerTest extends TestCase 13 13 {
+4 -4
tests/Unit/Services/ModelMapperTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Services; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Services; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Contracts\Transformer; 7 - use SocialDept\Schema\Exceptions\SchemaException; 8 - use SocialDept\Schema\Services\ModelMapper; 6 + use SocialDept\AtpSchema\Contracts\Transformer; 7 + use SocialDept\AtpSchema\Exceptions\SchemaException; 8 + use SocialDept\AtpSchema\Services\ModelMapper; 9 9 10 10 class ModelMapperTest extends TestCase 11 11 {
+6 -6
tests/Unit/Services/UnionResolverTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Services; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Services; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Contracts\LexiconRegistry; 7 - use SocialDept\Schema\Data\LexiconDocument; 8 - use SocialDept\Schema\Exceptions\RecordValidationException; 9 - use SocialDept\Schema\Parser\Nsid; 10 - use SocialDept\Schema\Services\UnionResolver; 6 + use SocialDept\AtpSchema\Contracts\LexiconRegistry; 7 + use SocialDept\AtpSchema\Data\LexiconDocument; 8 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 9 + use SocialDept\AtpSchema\Parser\Nsid; 10 + use SocialDept\AtpSchema\Services\UnionResolver; 11 11 12 12 class UnionResolverTest extends TestCase 13 13 {
+2 -2
tests/Unit/Support/ExtensionManagerTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Support; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Support; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Support\ExtensionManager; 6 + use SocialDept\AtpSchema\Support\ExtensionManager; 7 7 8 8 class ExtensionManagerTest extends TestCase 9 9 {
+6 -6
tests/Unit/Support/MacroableTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Support; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Support; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Services\BlobHandler; 7 - use SocialDept\Schema\Services\ModelMapper; 8 - use SocialDept\Schema\Services\UnionResolver; 9 - use SocialDept\Schema\Validation\Validator; 6 + use SocialDept\AtpSchema\Services\BlobHandler; 7 + use SocialDept\AtpSchema\Services\ModelMapper; 8 + use SocialDept\AtpSchema\Services\UnionResolver; 9 + use SocialDept\AtpSchema\Validation\Validator; 10 10 11 11 class MacroableTest extends TestCase 12 12 { ··· 74 74 { 75 75 Validator::macro('customMethod', fn () => 'validator custom'); 76 76 77 - $schemaLoader = $this->createMock(\SocialDept\Schema\Parser\SchemaLoader::class); 77 + $schemaLoader = $this->createMock(\SocialDept\AtpSchema\Parser\SchemaLoader::class); 78 78 $validator = new Validator($schemaLoader); 79 79 80 80 $this->assertEquals('validator custom', $validator->customMethod());
+11 -16
tests/Unit/Validation/LexiconValidatorTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\LexiconDocument; 7 - use SocialDept\Schema\Exceptions\RecordValidationException; 8 - use SocialDept\Schema\Exceptions\SchemaValidationException; 9 - use SocialDept\Schema\Parser\SchemaLoader; 10 - use SocialDept\Schema\Validation\LexiconValidator; 6 + use SocialDept\AtpSchema\Data\LexiconDocument; 7 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 8 + use SocialDept\AtpSchema\Exceptions\SchemaValidationException; 9 + use SocialDept\AtpSchema\Parser\SchemaLoader; 10 + use SocialDept\AtpSchema\Validation\LexiconValidator; 11 11 12 12 class LexiconValidatorTest extends TestCase 13 13 { ··· 128 128 129 129 public function test_it_validates_with_contract_method(): void 130 130 { 131 - $schema = $this->loader->load('app.bsky.feed.post'); 132 - $document = LexiconDocument::fromArray($schema); 131 + $document = $this->loader->load('app.bsky.feed.post'); 133 132 134 133 $record = [ 135 134 'text' => 'Hello, World!', ··· 141 140 142 141 public function test_it_returns_false_for_invalid_record(): void 143 142 { 144 - $schema = $this->loader->load('app.bsky.feed.post'); 145 - $document = LexiconDocument::fromArray($schema); 143 + $document = $this->loader->load('app.bsky.feed.post'); 146 144 147 145 $record = [ 148 146 'text' => 'Hello, World!', ··· 154 152 155 153 public function test_it_validates_with_errors(): void 156 154 { 157 - $schema = $this->loader->load('app.bsky.feed.post'); 158 - $document = LexiconDocument::fromArray($schema); 155 + $document = $this->loader->load('app.bsky.feed.post'); 159 156 160 157 $record = [ 161 158 'text' => 'Hello, World!', ··· 169 166 170 167 public function test_it_returns_errors_for_invalid_record(): void 171 168 { 172 - $schema = $this->loader->load('app.bsky.feed.post'); 173 - $document = LexiconDocument::fromArray($schema); 169 + $document = $this->loader->load('app.bsky.feed.post'); 174 170 175 171 $record = [ 176 172 'text' => 'Hello, World!', ··· 185 181 186 182 public function test_it_validates_specific_field(): void 187 183 { 188 - $schema = $this->loader->load('app.bsky.feed.post'); 189 - $document = LexiconDocument::fromArray($schema); 184 + $document = $this->loader->load('app.bsky.feed.post'); 190 185 191 186 $this->assertTrue($this->validator->validateField('Hello, World!', 'text', $document)); 192 187 $this->assertFalse($this->validator->validateField(123, 'text', $document));
+2 -2
tests/Unit/Validation/Rules/AtDatetimeTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation\Rules; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Validation\Rules\AtDatetime; 6 + use SocialDept\AtpSchema\Validation\Rules\AtDatetime; 7 7 8 8 class AtDatetimeTest extends TestCase 9 9 {
+2 -2
tests/Unit/Validation/Rules/AtUriTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation\Rules; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Validation\Rules\AtUri; 6 + use SocialDept\AtpSchema\Validation\Rules\AtUri; 7 7 8 8 class AtUriTest extends TestCase 9 9 {
+2 -2
tests/Unit/Validation/Rules/CidTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation\Rules; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Validation\Rules\Cid; 6 + use SocialDept\AtpSchema\Validation\Rules\Cid; 7 7 8 8 class CidTest extends TestCase 9 9 {
+2 -2
tests/Unit/Validation/Rules/DidTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation\Rules; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Validation\Rules\Did; 6 + use SocialDept\AtpSchema\Validation\Rules\Did; 7 7 8 8 class DidTest extends TestCase 9 9 {
+2 -2
tests/Unit/Validation/Rules/HandleTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation\Rules; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Validation\Rules\Handle; 6 + use SocialDept\AtpSchema\Validation\Rules\Handle; 7 7 8 8 class HandleTest extends TestCase 9 9 {
+2 -2
tests/Unit/Validation/Rules/LanguageTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation\Rules; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Validation\Rules\Language; 6 + use SocialDept\AtpSchema\Validation\Rules\Language; 7 7 8 8 class LanguageTest extends TestCase 9 9 {
+2 -2
tests/Unit/Validation/Rules/MaxGraphemesTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation\Rules; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Validation\Rules\MaxGraphemes; 6 + use SocialDept\AtpSchema\Validation\Rules\MaxGraphemes; 7 7 8 8 class MaxGraphemesTest extends TestCase 9 9 {
+2 -2
tests/Unit/Validation/Rules/MinGraphemesTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation\Rules; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Validation\Rules\MinGraphemes; 6 + use SocialDept\AtpSchema\Validation\Rules\MinGraphemes; 7 7 8 8 class MinGraphemesTest extends TestCase 9 9 {
+2 -2
tests/Unit/Validation/Rules/NsidTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation\Rules; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation\Rules; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Validation\Rules\Nsid; 6 + use SocialDept\AtpSchema\Validation\Rules\Nsid; 7 7 8 8 class NsidTest extends TestCase 9 9 {
+3 -3
tests/Unit/Validation/TypeValidators/ArrayValidatorTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation\TypeValidators; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation\TypeValidators; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Exceptions\RecordValidationException; 7 - use SocialDept\Schema\Validation\TypeValidators\ArrayValidator; 6 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 7 + use SocialDept\AtpSchema\Validation\TypeValidators\ArrayValidator; 8 8 9 9 class ArrayValidatorTest extends TestCase 10 10 {
+3 -3
tests/Unit/Validation/TypeValidators/BlobValidatorTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation\TypeValidators; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation\TypeValidators; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Exceptions\RecordValidationException; 7 - use SocialDept\Schema\Validation\TypeValidators\BlobValidator; 6 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 7 + use SocialDept\AtpSchema\Validation\TypeValidators\BlobValidator; 8 8 9 9 class BlobValidatorTest extends TestCase 10 10 {
+3 -3
tests/Unit/Validation/TypeValidators/BooleanValidatorTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation\TypeValidators; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation\TypeValidators; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Exceptions\RecordValidationException; 7 - use SocialDept\Schema\Validation\TypeValidators\BooleanValidator; 6 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 7 + use SocialDept\AtpSchema\Validation\TypeValidators\BooleanValidator; 8 8 9 9 class BooleanValidatorTest extends TestCase 10 10 {
+3 -3
tests/Unit/Validation/TypeValidators/IntegerValidatorTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation\TypeValidators; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation\TypeValidators; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Exceptions\RecordValidationException; 7 - use SocialDept\Schema\Validation\TypeValidators\IntegerValidator; 6 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 7 + use SocialDept\AtpSchema\Validation\TypeValidators\IntegerValidator; 8 8 9 9 class IntegerValidatorTest extends TestCase 10 10 {
+3 -3
tests/Unit/Validation/TypeValidators/ObjectValidatorTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation\TypeValidators; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation\TypeValidators; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Exceptions\RecordValidationException; 7 - use SocialDept\Schema\Validation\TypeValidators\ObjectValidator; 6 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 7 + use SocialDept\AtpSchema\Validation\TypeValidators\ObjectValidator; 8 8 9 9 class ObjectValidatorTest extends TestCase 10 10 {
+3 -3
tests/Unit/Validation/TypeValidators/StringValidatorTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation\TypeValidators; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation\TypeValidators; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Exceptions\RecordValidationException; 7 - use SocialDept\Schema\Validation\TypeValidators\StringValidator; 6 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 7 + use SocialDept\AtpSchema\Validation\TypeValidators\StringValidator; 8 8 9 9 class StringValidatorTest extends TestCase 10 10 {
+3 -3
tests/Unit/Validation/TypeValidators/UnionValidatorTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation\TypeValidators; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation\TypeValidators; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Exceptions\RecordValidationException; 7 - use SocialDept\Schema\Validation\TypeValidators\UnionValidator; 6 + use SocialDept\AtpSchema\Exceptions\RecordValidationException; 7 + use SocialDept\AtpSchema\Validation\TypeValidators\UnionValidator; 8 8 9 9 class UnionValidatorTest extends TestCase 10 10 {
+3 -3
tests/Unit/Validation/ValidationErrorFormatterTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Validation\ValidationError; 7 - use SocialDept\Schema\Validation\ValidationErrorFormatter; 6 + use SocialDept\AtpSchema\Validation\ValidationError; 7 + use SocialDept\AtpSchema\Validation\ValidationErrorFormatter; 8 8 9 9 class ValidationErrorFormatterTest extends TestCase 10 10 {
+2 -2
tests/Unit/Validation/ValidationErrorTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Validation\ValidationError; 6 + use SocialDept\AtpSchema\Validation\ValidationError; 7 7 8 8 class ValidationErrorTest extends TestCase 9 9 {
+5 -5
tests/Unit/Validation/ValidatorTest.php
··· 1 1 <?php 2 2 3 - namespace SocialDept\Schema\Tests\Unit\Validation; 3 + namespace SocialDept\AtpSchema\Tests\Unit\Validation; 4 4 5 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Schema\Data\LexiconDocument; 7 - use SocialDept\Schema\Parser\Nsid; 8 - use SocialDept\Schema\Parser\SchemaLoader; 9 - use SocialDept\Schema\Validation\Validator; 6 + use SocialDept\AtpSchema\Data\LexiconDocument; 7 + use SocialDept\AtpSchema\Parser\Nsid; 8 + use SocialDept\AtpSchema\Parser\SchemaLoader; 9 + use SocialDept\AtpSchema\Validation\Validator; 10 10 11 11 class ValidatorTest extends TestCase 12 12 {