a tool for shared writing and social publishing
at update/reader 2477 lines 67 kB view raw
1/** 2 * GENERATED CODE - DO NOT MODIFY 3 */ 4import { 5 type LexiconDoc, 6 Lexicons, 7 ValidationError, 8 type ValidationResult, 9} from '@atproto/lexicon' 10import { type $Typed, is$typed, maybe$typed } from './util' 11 12export const schemaDict = { 13 AppBskyActorProfile: { 14 lexicon: 1, 15 id: 'app.bsky.actor.profile', 16 defs: { 17 main: { 18 type: 'record', 19 description: 'A declaration of a Bluesky account profile.', 20 key: 'literal:self', 21 record: { 22 type: 'object', 23 properties: { 24 displayName: { 25 type: 'string', 26 maxGraphemes: 64, 27 maxLength: 640, 28 }, 29 description: { 30 type: 'string', 31 description: 'Free-form profile description text.', 32 maxGraphemes: 256, 33 maxLength: 2560, 34 }, 35 avatar: { 36 type: 'blob', 37 description: 38 "Small image to be displayed next to posts from account. AKA, 'profile picture'", 39 accept: ['image/png', 'image/jpeg'], 40 maxSize: 1000000, 41 }, 42 banner: { 43 type: 'blob', 44 description: 45 'Larger horizontal image to display behind profile view.', 46 accept: ['image/png', 'image/jpeg'], 47 maxSize: 1000000, 48 }, 49 labels: { 50 type: 'union', 51 description: 52 'Self-label values, specific to the Bluesky application, on the overall account.', 53 refs: ['lex:com.atproto.label.defs#selfLabels'], 54 }, 55 joinedViaStarterPack: { 56 type: 'ref', 57 ref: 'lex:com.atproto.repo.strongRef', 58 }, 59 pinnedPost: { 60 type: 'ref', 61 ref: 'lex:com.atproto.repo.strongRef', 62 }, 63 createdAt: { 64 type: 'string', 65 format: 'datetime', 66 }, 67 }, 68 }, 69 }, 70 }, 71 }, 72 ComAtprotoLabelDefs: { 73 lexicon: 1, 74 id: 'com.atproto.label.defs', 75 defs: { 76 label: { 77 type: 'object', 78 description: 79 'Metadata tag on an atproto resource (eg, repo or record).', 80 required: ['src', 'uri', 'val', 'cts'], 81 properties: { 82 ver: { 83 type: 'integer', 84 description: 'The AT Protocol version of the label object.', 85 }, 86 src: { 87 type: 'string', 88 format: 'did', 89 description: 'DID of the actor who created this label.', 90 }, 91 uri: { 92 type: 'string', 93 format: 'uri', 94 description: 95 'AT URI of the record, repository (account), or other resource that this label applies to.', 96 }, 97 cid: { 98 type: 'string', 99 format: 'cid', 100 description: 101 "Optionally, CID specifying the specific version of 'uri' resource this label applies to.", 102 }, 103 val: { 104 type: 'string', 105 maxLength: 128, 106 description: 107 'The short string name of the value or type of this label.', 108 }, 109 neg: { 110 type: 'boolean', 111 description: 112 'If true, this is a negation label, overwriting a previous label.', 113 }, 114 cts: { 115 type: 'string', 116 format: 'datetime', 117 description: 'Timestamp when this label was created.', 118 }, 119 exp: { 120 type: 'string', 121 format: 'datetime', 122 description: 123 'Timestamp at which this label expires (no longer applies).', 124 }, 125 sig: { 126 type: 'bytes', 127 description: 'Signature of dag-cbor encoded label.', 128 }, 129 }, 130 }, 131 selfLabels: { 132 type: 'object', 133 description: 134 'Metadata tags on an atproto record, published by the author within the record.', 135 required: ['values'], 136 properties: { 137 values: { 138 type: 'array', 139 items: { 140 type: 'ref', 141 ref: 'lex:com.atproto.label.defs#selfLabel', 142 }, 143 maxLength: 10, 144 }, 145 }, 146 }, 147 selfLabel: { 148 type: 'object', 149 description: 150 'Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel.', 151 required: ['val'], 152 properties: { 153 val: { 154 type: 'string', 155 maxLength: 128, 156 description: 157 'The short string name of the value or type of this label.', 158 }, 159 }, 160 }, 161 labelValueDefinition: { 162 type: 'object', 163 description: 164 'Declares a label value and its expected interpretations and behaviors.', 165 required: ['identifier', 'severity', 'blurs', 'locales'], 166 properties: { 167 identifier: { 168 type: 'string', 169 description: 170 "The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).", 171 maxLength: 100, 172 maxGraphemes: 100, 173 }, 174 severity: { 175 type: 'string', 176 description: 177 "How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.", 178 knownValues: ['inform', 'alert', 'none'], 179 }, 180 blurs: { 181 type: 'string', 182 description: 183 "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.", 184 knownValues: ['content', 'media', 'none'], 185 }, 186 defaultSetting: { 187 type: 'string', 188 description: 'The default setting for this label.', 189 knownValues: ['ignore', 'warn', 'hide'], 190 default: 'warn', 191 }, 192 adultOnly: { 193 type: 'boolean', 194 description: 195 'Does the user need to have adult content enabled in order to configure this label?', 196 }, 197 locales: { 198 type: 'array', 199 items: { 200 type: 'ref', 201 ref: 'lex:com.atproto.label.defs#labelValueDefinitionStrings', 202 }, 203 }, 204 }, 205 }, 206 labelValueDefinitionStrings: { 207 type: 'object', 208 description: 209 'Strings which describe the label in the UI, localized into a specific language.', 210 required: ['lang', 'name', 'description'], 211 properties: { 212 lang: { 213 type: 'string', 214 description: 215 'The code of the language these strings are written in.', 216 format: 'language', 217 }, 218 name: { 219 type: 'string', 220 description: 'A short human-readable name for the label.', 221 maxGraphemes: 64, 222 maxLength: 640, 223 }, 224 description: { 225 type: 'string', 226 description: 227 'A longer description of what the label means and why it might be applied.', 228 maxGraphemes: 10000, 229 maxLength: 100000, 230 }, 231 }, 232 }, 233 labelValue: { 234 type: 'string', 235 knownValues: [ 236 '!hide', 237 '!no-promote', 238 '!warn', 239 '!no-unauthenticated', 240 'dmca-violation', 241 'doxxing', 242 'porn', 243 'sexual', 244 'nudity', 245 'nsfl', 246 'gore', 247 ], 248 }, 249 }, 250 }, 251 ComAtprotoRepoApplyWrites: { 252 lexicon: 1, 253 id: 'com.atproto.repo.applyWrites', 254 defs: { 255 main: { 256 type: 'procedure', 257 description: 258 'Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS.', 259 input: { 260 encoding: 'application/json', 261 schema: { 262 type: 'object', 263 required: ['repo', 'writes'], 264 properties: { 265 repo: { 266 type: 'string', 267 format: 'at-identifier', 268 description: 269 'The handle or DID of the repo (aka, current account).', 270 }, 271 validate: { 272 type: 'boolean', 273 description: 274 "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.", 275 }, 276 writes: { 277 type: 'array', 278 items: { 279 type: 'union', 280 refs: [ 281 'lex:com.atproto.repo.applyWrites#create', 282 'lex:com.atproto.repo.applyWrites#update', 283 'lex:com.atproto.repo.applyWrites#delete', 284 ], 285 closed: true, 286 }, 287 }, 288 swapCommit: { 289 type: 'string', 290 description: 291 'If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations.', 292 format: 'cid', 293 }, 294 }, 295 }, 296 }, 297 output: { 298 encoding: 'application/json', 299 schema: { 300 type: 'object', 301 required: [], 302 properties: { 303 commit: { 304 type: 'ref', 305 ref: 'lex:com.atproto.repo.defs#commitMeta', 306 }, 307 results: { 308 type: 'array', 309 items: { 310 type: 'union', 311 refs: [ 312 'lex:com.atproto.repo.applyWrites#createResult', 313 'lex:com.atproto.repo.applyWrites#updateResult', 314 'lex:com.atproto.repo.applyWrites#deleteResult', 315 ], 316 closed: true, 317 }, 318 }, 319 }, 320 }, 321 }, 322 errors: [ 323 { 324 name: 'InvalidSwap', 325 description: 326 "Indicates that the 'swapCommit' parameter did not match current commit.", 327 }, 328 ], 329 }, 330 create: { 331 type: 'object', 332 description: 'Operation which creates a new record.', 333 required: ['collection', 'value'], 334 properties: { 335 collection: { 336 type: 'string', 337 format: 'nsid', 338 }, 339 rkey: { 340 type: 'string', 341 maxLength: 512, 342 format: 'record-key', 343 description: 344 'NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility.', 345 }, 346 value: { 347 type: 'unknown', 348 }, 349 }, 350 }, 351 update: { 352 type: 'object', 353 description: 'Operation which updates an existing record.', 354 required: ['collection', 'rkey', 'value'], 355 properties: { 356 collection: { 357 type: 'string', 358 format: 'nsid', 359 }, 360 rkey: { 361 type: 'string', 362 format: 'record-key', 363 }, 364 value: { 365 type: 'unknown', 366 }, 367 }, 368 }, 369 delete: { 370 type: 'object', 371 description: 'Operation which deletes an existing record.', 372 required: ['collection', 'rkey'], 373 properties: { 374 collection: { 375 type: 'string', 376 format: 'nsid', 377 }, 378 rkey: { 379 type: 'string', 380 format: 'record-key', 381 }, 382 }, 383 }, 384 createResult: { 385 type: 'object', 386 required: ['uri', 'cid'], 387 properties: { 388 uri: { 389 type: 'string', 390 format: 'at-uri', 391 }, 392 cid: { 393 type: 'string', 394 format: 'cid', 395 }, 396 validationStatus: { 397 type: 'string', 398 knownValues: ['valid', 'unknown'], 399 }, 400 }, 401 }, 402 updateResult: { 403 type: 'object', 404 required: ['uri', 'cid'], 405 properties: { 406 uri: { 407 type: 'string', 408 format: 'at-uri', 409 }, 410 cid: { 411 type: 'string', 412 format: 'cid', 413 }, 414 validationStatus: { 415 type: 'string', 416 knownValues: ['valid', 'unknown'], 417 }, 418 }, 419 }, 420 deleteResult: { 421 type: 'object', 422 required: [], 423 properties: {}, 424 }, 425 }, 426 }, 427 ComAtprotoRepoCreateRecord: { 428 lexicon: 1, 429 id: 'com.atproto.repo.createRecord', 430 defs: { 431 main: { 432 type: 'procedure', 433 description: 434 'Create a single new repository record. Requires auth, implemented by PDS.', 435 input: { 436 encoding: 'application/json', 437 schema: { 438 type: 'object', 439 required: ['repo', 'collection', 'record'], 440 properties: { 441 repo: { 442 type: 'string', 443 format: 'at-identifier', 444 description: 445 'The handle or DID of the repo (aka, current account).', 446 }, 447 collection: { 448 type: 'string', 449 format: 'nsid', 450 description: 'The NSID of the record collection.', 451 }, 452 rkey: { 453 type: 'string', 454 format: 'record-key', 455 description: 'The Record Key.', 456 maxLength: 512, 457 }, 458 validate: { 459 type: 'boolean', 460 description: 461 "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.", 462 }, 463 record: { 464 type: 'unknown', 465 description: 'The record itself. Must contain a $type field.', 466 }, 467 swapCommit: { 468 type: 'string', 469 format: 'cid', 470 description: 471 'Compare and swap with the previous commit by CID.', 472 }, 473 }, 474 }, 475 }, 476 output: { 477 encoding: 'application/json', 478 schema: { 479 type: 'object', 480 required: ['uri', 'cid'], 481 properties: { 482 uri: { 483 type: 'string', 484 format: 'at-uri', 485 }, 486 cid: { 487 type: 'string', 488 format: 'cid', 489 }, 490 commit: { 491 type: 'ref', 492 ref: 'lex:com.atproto.repo.defs#commitMeta', 493 }, 494 validationStatus: { 495 type: 'string', 496 knownValues: ['valid', 'unknown'], 497 }, 498 }, 499 }, 500 }, 501 errors: [ 502 { 503 name: 'InvalidSwap', 504 description: 505 "Indicates that 'swapCommit' didn't match current repo commit.", 506 }, 507 ], 508 }, 509 }, 510 }, 511 ComAtprotoRepoDefs: { 512 lexicon: 1, 513 id: 'com.atproto.repo.defs', 514 defs: { 515 commitMeta: { 516 type: 'object', 517 required: ['cid', 'rev'], 518 properties: { 519 cid: { 520 type: 'string', 521 format: 'cid', 522 }, 523 rev: { 524 type: 'string', 525 format: 'tid', 526 }, 527 }, 528 }, 529 }, 530 }, 531 ComAtprotoRepoDeleteRecord: { 532 lexicon: 1, 533 id: 'com.atproto.repo.deleteRecord', 534 defs: { 535 main: { 536 type: 'procedure', 537 description: 538 "Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS.", 539 input: { 540 encoding: 'application/json', 541 schema: { 542 type: 'object', 543 required: ['repo', 'collection', 'rkey'], 544 properties: { 545 repo: { 546 type: 'string', 547 format: 'at-identifier', 548 description: 549 'The handle or DID of the repo (aka, current account).', 550 }, 551 collection: { 552 type: 'string', 553 format: 'nsid', 554 description: 'The NSID of the record collection.', 555 }, 556 rkey: { 557 type: 'string', 558 format: 'record-key', 559 description: 'The Record Key.', 560 }, 561 swapRecord: { 562 type: 'string', 563 format: 'cid', 564 description: 565 'Compare and swap with the previous record by CID.', 566 }, 567 swapCommit: { 568 type: 'string', 569 format: 'cid', 570 description: 571 'Compare and swap with the previous commit by CID.', 572 }, 573 }, 574 }, 575 }, 576 output: { 577 encoding: 'application/json', 578 schema: { 579 type: 'object', 580 properties: { 581 commit: { 582 type: 'ref', 583 ref: 'lex:com.atproto.repo.defs#commitMeta', 584 }, 585 }, 586 }, 587 }, 588 errors: [ 589 { 590 name: 'InvalidSwap', 591 }, 592 ], 593 }, 594 }, 595 }, 596 ComAtprotoRepoDescribeRepo: { 597 lexicon: 1, 598 id: 'com.atproto.repo.describeRepo', 599 defs: { 600 main: { 601 type: 'query', 602 description: 603 'Get information about an account and repository, including the list of collections. Does not require auth.', 604 parameters: { 605 type: 'params', 606 required: ['repo'], 607 properties: { 608 repo: { 609 type: 'string', 610 format: 'at-identifier', 611 description: 'The handle or DID of the repo.', 612 }, 613 }, 614 }, 615 output: { 616 encoding: 'application/json', 617 schema: { 618 type: 'object', 619 required: [ 620 'handle', 621 'did', 622 'didDoc', 623 'collections', 624 'handleIsCorrect', 625 ], 626 properties: { 627 handle: { 628 type: 'string', 629 format: 'handle', 630 }, 631 did: { 632 type: 'string', 633 format: 'did', 634 }, 635 didDoc: { 636 type: 'unknown', 637 description: 'The complete DID document for this account.', 638 }, 639 collections: { 640 type: 'array', 641 description: 642 'List of all the collections (NSIDs) for which this repo contains at least one record.', 643 items: { 644 type: 'string', 645 format: 'nsid', 646 }, 647 }, 648 handleIsCorrect: { 649 type: 'boolean', 650 description: 651 'Indicates if handle is currently valid (resolves bi-directionally)', 652 }, 653 }, 654 }, 655 }, 656 }, 657 }, 658 }, 659 ComAtprotoRepoGetRecord: { 660 lexicon: 1, 661 id: 'com.atproto.repo.getRecord', 662 defs: { 663 main: { 664 type: 'query', 665 description: 666 'Get a single record from a repository. Does not require auth.', 667 parameters: { 668 type: 'params', 669 required: ['repo', 'collection', 'rkey'], 670 properties: { 671 repo: { 672 type: 'string', 673 format: 'at-identifier', 674 description: 'The handle or DID of the repo.', 675 }, 676 collection: { 677 type: 'string', 678 format: 'nsid', 679 description: 'The NSID of the record collection.', 680 }, 681 rkey: { 682 type: 'string', 683 description: 'The Record Key.', 684 format: 'record-key', 685 }, 686 cid: { 687 type: 'string', 688 format: 'cid', 689 description: 690 'The CID of the version of the record. If not specified, then return the most recent version.', 691 }, 692 }, 693 }, 694 output: { 695 encoding: 'application/json', 696 schema: { 697 type: 'object', 698 required: ['uri', 'value'], 699 properties: { 700 uri: { 701 type: 'string', 702 format: 'at-uri', 703 }, 704 cid: { 705 type: 'string', 706 format: 'cid', 707 }, 708 value: { 709 type: 'unknown', 710 }, 711 }, 712 }, 713 }, 714 errors: [ 715 { 716 name: 'RecordNotFound', 717 }, 718 ], 719 }, 720 }, 721 }, 722 ComAtprotoRepoImportRepo: { 723 lexicon: 1, 724 id: 'com.atproto.repo.importRepo', 725 defs: { 726 main: { 727 type: 'procedure', 728 description: 729 'Import a repo in the form of a CAR file. Requires Content-Length HTTP header to be set.', 730 input: { 731 encoding: 'application/vnd.ipld.car', 732 }, 733 }, 734 }, 735 }, 736 ComAtprotoRepoListMissingBlobs: { 737 lexicon: 1, 738 id: 'com.atproto.repo.listMissingBlobs', 739 defs: { 740 main: { 741 type: 'query', 742 description: 743 'Returns a list of missing blobs for the requesting account. Intended to be used in the account migration flow.', 744 parameters: { 745 type: 'params', 746 properties: { 747 limit: { 748 type: 'integer', 749 minimum: 1, 750 maximum: 1000, 751 default: 500, 752 }, 753 cursor: { 754 type: 'string', 755 }, 756 }, 757 }, 758 output: { 759 encoding: 'application/json', 760 schema: { 761 type: 'object', 762 required: ['blobs'], 763 properties: { 764 cursor: { 765 type: 'string', 766 }, 767 blobs: { 768 type: 'array', 769 items: { 770 type: 'ref', 771 ref: 'lex:com.atproto.repo.listMissingBlobs#recordBlob', 772 }, 773 }, 774 }, 775 }, 776 }, 777 }, 778 recordBlob: { 779 type: 'object', 780 required: ['cid', 'recordUri'], 781 properties: { 782 cid: { 783 type: 'string', 784 format: 'cid', 785 }, 786 recordUri: { 787 type: 'string', 788 format: 'at-uri', 789 }, 790 }, 791 }, 792 }, 793 }, 794 ComAtprotoRepoListRecords: { 795 lexicon: 1, 796 id: 'com.atproto.repo.listRecords', 797 defs: { 798 main: { 799 type: 'query', 800 description: 801 'List a range of records in a repository, matching a specific collection. Does not require auth.', 802 parameters: { 803 type: 'params', 804 required: ['repo', 'collection'], 805 properties: { 806 repo: { 807 type: 'string', 808 format: 'at-identifier', 809 description: 'The handle or DID of the repo.', 810 }, 811 collection: { 812 type: 'string', 813 format: 'nsid', 814 description: 'The NSID of the record type.', 815 }, 816 limit: { 817 type: 'integer', 818 minimum: 1, 819 maximum: 100, 820 default: 50, 821 description: 'The number of records to return.', 822 }, 823 cursor: { 824 type: 'string', 825 }, 826 rkeyStart: { 827 type: 'string', 828 description: 829 'DEPRECATED: The lowest sort-ordered rkey to start from (exclusive)', 830 }, 831 rkeyEnd: { 832 type: 'string', 833 description: 834 'DEPRECATED: The highest sort-ordered rkey to stop at (exclusive)', 835 }, 836 reverse: { 837 type: 'boolean', 838 description: 'Flag to reverse the order of the returned records.', 839 }, 840 }, 841 }, 842 output: { 843 encoding: 'application/json', 844 schema: { 845 type: 'object', 846 required: ['records'], 847 properties: { 848 cursor: { 849 type: 'string', 850 }, 851 records: { 852 type: 'array', 853 items: { 854 type: 'ref', 855 ref: 'lex:com.atproto.repo.listRecords#record', 856 }, 857 }, 858 }, 859 }, 860 }, 861 }, 862 record: { 863 type: 'object', 864 required: ['uri', 'cid', 'value'], 865 properties: { 866 uri: { 867 type: 'string', 868 format: 'at-uri', 869 }, 870 cid: { 871 type: 'string', 872 format: 'cid', 873 }, 874 value: { 875 type: 'unknown', 876 }, 877 }, 878 }, 879 }, 880 }, 881 ComAtprotoRepoPutRecord: { 882 lexicon: 1, 883 id: 'com.atproto.repo.putRecord', 884 defs: { 885 main: { 886 type: 'procedure', 887 description: 888 'Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS.', 889 input: { 890 encoding: 'application/json', 891 schema: { 892 type: 'object', 893 required: ['repo', 'collection', 'rkey', 'record'], 894 nullable: ['swapRecord'], 895 properties: { 896 repo: { 897 type: 'string', 898 format: 'at-identifier', 899 description: 900 'The handle or DID of the repo (aka, current account).', 901 }, 902 collection: { 903 type: 'string', 904 format: 'nsid', 905 description: 'The NSID of the record collection.', 906 }, 907 rkey: { 908 type: 'string', 909 format: 'record-key', 910 description: 'The Record Key.', 911 maxLength: 512, 912 }, 913 validate: { 914 type: 'boolean', 915 description: 916 "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.", 917 }, 918 record: { 919 type: 'unknown', 920 description: 'The record to write.', 921 }, 922 swapRecord: { 923 type: 'string', 924 format: 'cid', 925 description: 926 'Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation', 927 }, 928 swapCommit: { 929 type: 'string', 930 format: 'cid', 931 description: 932 'Compare and swap with the previous commit by CID.', 933 }, 934 }, 935 }, 936 }, 937 output: { 938 encoding: 'application/json', 939 schema: { 940 type: 'object', 941 required: ['uri', 'cid'], 942 properties: { 943 uri: { 944 type: 'string', 945 format: 'at-uri', 946 }, 947 cid: { 948 type: 'string', 949 format: 'cid', 950 }, 951 commit: { 952 type: 'ref', 953 ref: 'lex:com.atproto.repo.defs#commitMeta', 954 }, 955 validationStatus: { 956 type: 'string', 957 knownValues: ['valid', 'unknown'], 958 }, 959 }, 960 }, 961 }, 962 errors: [ 963 { 964 name: 'InvalidSwap', 965 }, 966 ], 967 }, 968 }, 969 }, 970 ComAtprotoRepoStrongRef: { 971 lexicon: 1, 972 id: 'com.atproto.repo.strongRef', 973 description: 'A URI with a content-hash fingerprint.', 974 defs: { 975 main: { 976 type: 'object', 977 required: ['uri', 'cid'], 978 properties: { 979 uri: { 980 type: 'string', 981 format: 'at-uri', 982 }, 983 cid: { 984 type: 'string', 985 format: 'cid', 986 }, 987 }, 988 }, 989 }, 990 }, 991 ComAtprotoRepoUploadBlob: { 992 lexicon: 1, 993 id: 'com.atproto.repo.uploadBlob', 994 defs: { 995 main: { 996 type: 'procedure', 997 description: 998 '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.', 999 input: { 1000 encoding: '*/*', 1001 }, 1002 output: { 1003 encoding: 'application/json', 1004 schema: { 1005 type: 'object', 1006 required: ['blob'], 1007 properties: { 1008 blob: { 1009 type: 'blob', 1010 }, 1011 }, 1012 }, 1013 }, 1014 }, 1015 }, 1016 }, 1017 PubLeafletBlocksBlockquote: { 1018 lexicon: 1, 1019 id: 'pub.leaflet.blocks.blockquote', 1020 defs: { 1021 main: { 1022 type: 'object', 1023 required: ['plaintext'], 1024 properties: { 1025 plaintext: { 1026 type: 'string', 1027 }, 1028 facets: { 1029 type: 'array', 1030 items: { 1031 type: 'ref', 1032 ref: 'lex:pub.leaflet.richtext.facet', 1033 }, 1034 }, 1035 }, 1036 }, 1037 }, 1038 }, 1039 PubLeafletBlocksBskyPost: { 1040 lexicon: 1, 1041 id: 'pub.leaflet.blocks.bskyPost', 1042 defs: { 1043 main: { 1044 type: 'object', 1045 required: ['postRef'], 1046 properties: { 1047 postRef: { 1048 type: 'ref', 1049 ref: 'lex:com.atproto.repo.strongRef', 1050 }, 1051 }, 1052 }, 1053 }, 1054 }, 1055 PubLeafletBlocksButton: { 1056 lexicon: 1, 1057 id: 'pub.leaflet.blocks.button', 1058 defs: { 1059 main: { 1060 type: 'object', 1061 required: ['text', 'url'], 1062 properties: { 1063 text: { 1064 type: 'string', 1065 }, 1066 url: { 1067 type: 'string', 1068 format: 'uri', 1069 }, 1070 }, 1071 }, 1072 }, 1073 }, 1074 PubLeafletBlocksCode: { 1075 lexicon: 1, 1076 id: 'pub.leaflet.blocks.code', 1077 defs: { 1078 main: { 1079 type: 'object', 1080 required: ['plaintext'], 1081 properties: { 1082 plaintext: { 1083 type: 'string', 1084 }, 1085 language: { 1086 type: 'string', 1087 }, 1088 syntaxHighlightingTheme: { 1089 type: 'string', 1090 }, 1091 }, 1092 }, 1093 }, 1094 }, 1095 PubLeafletBlocksHeader: { 1096 lexicon: 1, 1097 id: 'pub.leaflet.blocks.header', 1098 defs: { 1099 main: { 1100 type: 'object', 1101 required: ['plaintext'], 1102 properties: { 1103 level: { 1104 type: 'integer', 1105 minimum: 1, 1106 maximum: 6, 1107 }, 1108 plaintext: { 1109 type: 'string', 1110 }, 1111 facets: { 1112 type: 'array', 1113 items: { 1114 type: 'ref', 1115 ref: 'lex:pub.leaflet.richtext.facet', 1116 }, 1117 }, 1118 }, 1119 }, 1120 }, 1121 }, 1122 PubLeafletBlocksHorizontalRule: { 1123 lexicon: 1, 1124 id: 'pub.leaflet.blocks.horizontalRule', 1125 defs: { 1126 main: { 1127 type: 'object', 1128 required: [], 1129 properties: {}, 1130 }, 1131 }, 1132 }, 1133 PubLeafletBlocksIframe: { 1134 lexicon: 1, 1135 id: 'pub.leaflet.blocks.iframe', 1136 defs: { 1137 main: { 1138 type: 'object', 1139 required: ['url'], 1140 properties: { 1141 url: { 1142 type: 'string', 1143 format: 'uri', 1144 }, 1145 height: { 1146 type: 'integer', 1147 minimum: 16, 1148 maximum: 1600, 1149 }, 1150 }, 1151 }, 1152 }, 1153 }, 1154 PubLeafletBlocksImage: { 1155 lexicon: 1, 1156 id: 'pub.leaflet.blocks.image', 1157 defs: { 1158 main: { 1159 type: 'object', 1160 required: ['image', 'aspectRatio'], 1161 properties: { 1162 image: { 1163 type: 'blob', 1164 accept: ['image/*'], 1165 maxSize: 1000000, 1166 }, 1167 alt: { 1168 type: 'string', 1169 description: 1170 'Alt text description of the image, for accessibility.', 1171 }, 1172 aspectRatio: { 1173 type: 'ref', 1174 ref: 'lex:pub.leaflet.blocks.image#aspectRatio', 1175 }, 1176 }, 1177 }, 1178 aspectRatio: { 1179 type: 'object', 1180 required: ['width', 'height'], 1181 properties: { 1182 width: { 1183 type: 'integer', 1184 }, 1185 height: { 1186 type: 'integer', 1187 }, 1188 }, 1189 }, 1190 }, 1191 }, 1192 PubLeafletBlocksMath: { 1193 lexicon: 1, 1194 id: 'pub.leaflet.blocks.math', 1195 defs: { 1196 main: { 1197 type: 'object', 1198 required: ['tex'], 1199 properties: { 1200 tex: { 1201 type: 'string', 1202 }, 1203 }, 1204 }, 1205 }, 1206 }, 1207 PubLeafletBlocksPage: { 1208 lexicon: 1, 1209 id: 'pub.leaflet.blocks.page', 1210 defs: { 1211 main: { 1212 type: 'object', 1213 required: ['id'], 1214 properties: { 1215 id: { 1216 type: 'string', 1217 }, 1218 }, 1219 }, 1220 }, 1221 }, 1222 PubLeafletBlocksPoll: { 1223 lexicon: 1, 1224 id: 'pub.leaflet.blocks.poll', 1225 defs: { 1226 main: { 1227 type: 'object', 1228 required: ['pollRef'], 1229 properties: { 1230 pollRef: { 1231 type: 'ref', 1232 ref: 'lex:com.atproto.repo.strongRef', 1233 }, 1234 }, 1235 }, 1236 }, 1237 }, 1238 PubLeafletBlocksText: { 1239 lexicon: 1, 1240 id: 'pub.leaflet.blocks.text', 1241 defs: { 1242 main: { 1243 type: 'object', 1244 required: ['plaintext'], 1245 properties: { 1246 plaintext: { 1247 type: 'string', 1248 }, 1249 textSize: { 1250 type: 'string', 1251 enum: ['default', 'small', 'large'], 1252 }, 1253 facets: { 1254 type: 'array', 1255 items: { 1256 type: 'ref', 1257 ref: 'lex:pub.leaflet.richtext.facet', 1258 }, 1259 }, 1260 }, 1261 }, 1262 }, 1263 }, 1264 PubLeafletBlocksUnorderedList: { 1265 lexicon: 1, 1266 id: 'pub.leaflet.blocks.unorderedList', 1267 defs: { 1268 main: { 1269 type: 'object', 1270 required: ['children'], 1271 properties: { 1272 children: { 1273 type: 'array', 1274 items: { 1275 type: 'ref', 1276 ref: 'lex:pub.leaflet.blocks.unorderedList#listItem', 1277 }, 1278 }, 1279 }, 1280 }, 1281 listItem: { 1282 type: 'object', 1283 required: ['content'], 1284 properties: { 1285 content: { 1286 type: 'union', 1287 refs: [ 1288 'lex:pub.leaflet.blocks.text', 1289 'lex:pub.leaflet.blocks.header', 1290 'lex:pub.leaflet.blocks.image', 1291 ], 1292 }, 1293 children: { 1294 type: 'array', 1295 items: { 1296 type: 'ref', 1297 ref: 'lex:pub.leaflet.blocks.unorderedList#listItem', 1298 }, 1299 }, 1300 }, 1301 }, 1302 }, 1303 }, 1304 PubLeafletBlocksWebsite: { 1305 lexicon: 1, 1306 id: 'pub.leaflet.blocks.website', 1307 defs: { 1308 main: { 1309 type: 'object', 1310 required: ['src'], 1311 properties: { 1312 previewImage: { 1313 type: 'blob', 1314 accept: ['image/*'], 1315 maxSize: 1000000, 1316 }, 1317 title: { 1318 type: 'string', 1319 }, 1320 description: { 1321 type: 'string', 1322 }, 1323 src: { 1324 type: 'string', 1325 format: 'uri', 1326 }, 1327 }, 1328 }, 1329 }, 1330 }, 1331 PubLeafletComment: { 1332 lexicon: 1, 1333 id: 'pub.leaflet.comment', 1334 revision: 1, 1335 description: 'A lexicon for comments on documents', 1336 defs: { 1337 main: { 1338 type: 'record', 1339 key: 'tid', 1340 description: 'Record containing a comment', 1341 record: { 1342 type: 'object', 1343 required: ['subject', 'plaintext', 'createdAt'], 1344 properties: { 1345 subject: { 1346 type: 'string', 1347 format: 'at-uri', 1348 }, 1349 createdAt: { 1350 type: 'string', 1351 format: 'datetime', 1352 }, 1353 reply: { 1354 type: 'ref', 1355 ref: 'lex:pub.leaflet.comment#replyRef', 1356 }, 1357 plaintext: { 1358 type: 'string', 1359 }, 1360 facets: { 1361 type: 'array', 1362 items: { 1363 type: 'ref', 1364 ref: 'lex:pub.leaflet.richtext.facet', 1365 }, 1366 }, 1367 onPage: { 1368 type: 'string', 1369 }, 1370 attachment: { 1371 type: 'union', 1372 refs: ['lex:pub.leaflet.comment#linearDocumentQuote'], 1373 }, 1374 }, 1375 }, 1376 }, 1377 linearDocumentQuote: { 1378 type: 'object', 1379 required: ['document', 'quote'], 1380 properties: { 1381 document: { 1382 type: 'string', 1383 format: 'at-uri', 1384 }, 1385 quote: { 1386 type: 'ref', 1387 ref: 'lex:pub.leaflet.pages.linearDocument#quote', 1388 }, 1389 }, 1390 }, 1391 replyRef: { 1392 type: 'object', 1393 required: ['parent'], 1394 properties: { 1395 parent: { 1396 type: 'string', 1397 format: 'at-uri', 1398 }, 1399 }, 1400 }, 1401 }, 1402 }, 1403 PubLeafletContent: { 1404 lexicon: 1, 1405 id: 'pub.leaflet.content', 1406 revision: 1, 1407 description: 'A lexicon for long form rich media documents', 1408 defs: { 1409 main: { 1410 type: 'object', 1411 description: 'Content format for leaflet documents', 1412 required: ['pages'], 1413 properties: { 1414 pages: { 1415 type: 'array', 1416 items: { 1417 type: 'union', 1418 refs: [ 1419 'lex:pub.leaflet.pages.linearDocument', 1420 'lex:pub.leaflet.pages.canvas', 1421 ], 1422 }, 1423 }, 1424 }, 1425 }, 1426 }, 1427 }, 1428 PubLeafletDocument: { 1429 lexicon: 1, 1430 id: 'pub.leaflet.document', 1431 revision: 1, 1432 description: 'A lexicon for long form rich media documents', 1433 defs: { 1434 main: { 1435 type: 'record', 1436 key: 'tid', 1437 description: 'Record containing a document', 1438 record: { 1439 type: 'object', 1440 required: ['pages', 'author', 'title'], 1441 properties: { 1442 title: { 1443 type: 'string', 1444 maxLength: 5000, 1445 maxGraphemes: 500, 1446 }, 1447 postRef: { 1448 type: 'ref', 1449 ref: 'lex:com.atproto.repo.strongRef', 1450 }, 1451 description: { 1452 type: 'string', 1453 maxLength: 30000, 1454 maxGraphemes: 3000, 1455 }, 1456 publishedAt: { 1457 type: 'string', 1458 format: 'datetime', 1459 }, 1460 publication: { 1461 type: 'string', 1462 format: 'at-uri', 1463 }, 1464 author: { 1465 type: 'string', 1466 format: 'at-identifier', 1467 }, 1468 theme: { 1469 type: 'ref', 1470 ref: 'lex:pub.leaflet.publication#theme', 1471 }, 1472 preferences: { 1473 type: 'ref', 1474 ref: 'lex:pub.leaflet.publication#preferences', 1475 }, 1476 tags: { 1477 type: 'array', 1478 items: { 1479 type: 'string', 1480 maxLength: 50, 1481 }, 1482 }, 1483 coverImage: { 1484 type: 'blob', 1485 accept: ['image/png', 'image/jpeg', 'image/webp'], 1486 maxSize: 1000000, 1487 }, 1488 pages: { 1489 type: 'array', 1490 items: { 1491 type: 'union', 1492 refs: [ 1493 'lex:pub.leaflet.pages.linearDocument', 1494 'lex:pub.leaflet.pages.canvas', 1495 ], 1496 }, 1497 }, 1498 }, 1499 }, 1500 }, 1501 }, 1502 }, 1503 PubLeafletGraphSubscription: { 1504 lexicon: 1, 1505 id: 'pub.leaflet.graph.subscription', 1506 defs: { 1507 main: { 1508 type: 'record', 1509 key: 'tid', 1510 description: 'Record declaring a subscription to a publication', 1511 record: { 1512 type: 'object', 1513 required: ['publication'], 1514 properties: { 1515 publication: { 1516 type: 'string', 1517 format: 'at-uri', 1518 }, 1519 }, 1520 }, 1521 }, 1522 }, 1523 }, 1524 PubLeafletInteractionsRecommend: { 1525 lexicon: 1, 1526 id: 'pub.leaflet.interactions.recommend', 1527 defs: { 1528 main: { 1529 type: 'record', 1530 key: 'tid', 1531 description: 'Record representing a recommend on a document', 1532 record: { 1533 type: 'object', 1534 required: ['subject', 'createdAt'], 1535 properties: { 1536 subject: { 1537 type: 'string', 1538 format: 'at-uri', 1539 }, 1540 createdAt: { 1541 type: 'string', 1542 format: 'datetime', 1543 }, 1544 }, 1545 }, 1546 }, 1547 }, 1548 }, 1549 PubLeafletPagesCanvas: { 1550 lexicon: 1, 1551 id: 'pub.leaflet.pages.canvas', 1552 defs: { 1553 main: { 1554 type: 'object', 1555 required: ['blocks'], 1556 properties: { 1557 id: { 1558 type: 'string', 1559 }, 1560 blocks: { 1561 type: 'array', 1562 items: { 1563 type: 'ref', 1564 ref: 'lex:pub.leaflet.pages.canvas#block', 1565 }, 1566 }, 1567 }, 1568 }, 1569 block: { 1570 type: 'object', 1571 required: ['block', 'x', 'y', 'width'], 1572 properties: { 1573 block: { 1574 type: 'union', 1575 refs: [ 1576 'lex:pub.leaflet.blocks.iframe', 1577 'lex:pub.leaflet.blocks.text', 1578 'lex:pub.leaflet.blocks.blockquote', 1579 'lex:pub.leaflet.blocks.header', 1580 'lex:pub.leaflet.blocks.image', 1581 'lex:pub.leaflet.blocks.unorderedList', 1582 'lex:pub.leaflet.blocks.website', 1583 'lex:pub.leaflet.blocks.math', 1584 'lex:pub.leaflet.blocks.code', 1585 'lex:pub.leaflet.blocks.horizontalRule', 1586 'lex:pub.leaflet.blocks.bskyPost', 1587 'lex:pub.leaflet.blocks.page', 1588 'lex:pub.leaflet.blocks.poll', 1589 'lex:pub.leaflet.blocks.button', 1590 ], 1591 }, 1592 x: { 1593 type: 'integer', 1594 }, 1595 y: { 1596 type: 'integer', 1597 }, 1598 width: { 1599 type: 'integer', 1600 }, 1601 height: { 1602 type: 'integer', 1603 }, 1604 rotation: { 1605 type: 'integer', 1606 description: 'The rotation of the block in degrees', 1607 }, 1608 }, 1609 }, 1610 textAlignLeft: { 1611 type: 'token', 1612 }, 1613 textAlignCenter: { 1614 type: 'token', 1615 }, 1616 textAlignRight: { 1617 type: 'token', 1618 }, 1619 quote: { 1620 type: 'object', 1621 required: ['start', 'end'], 1622 properties: { 1623 start: { 1624 type: 'ref', 1625 ref: 'lex:pub.leaflet.pages.canvas#position', 1626 }, 1627 end: { 1628 type: 'ref', 1629 ref: 'lex:pub.leaflet.pages.canvas#position', 1630 }, 1631 }, 1632 }, 1633 position: { 1634 type: 'object', 1635 required: ['block', 'offset'], 1636 properties: { 1637 block: { 1638 type: 'array', 1639 items: { 1640 type: 'integer', 1641 }, 1642 }, 1643 offset: { 1644 type: 'integer', 1645 }, 1646 }, 1647 }, 1648 }, 1649 }, 1650 PubLeafletPagesLinearDocument: { 1651 lexicon: 1, 1652 id: 'pub.leaflet.pages.linearDocument', 1653 defs: { 1654 main: { 1655 type: 'object', 1656 required: ['blocks'], 1657 properties: { 1658 id: { 1659 type: 'string', 1660 }, 1661 blocks: { 1662 type: 'array', 1663 items: { 1664 type: 'ref', 1665 ref: 'lex:pub.leaflet.pages.linearDocument#block', 1666 }, 1667 }, 1668 }, 1669 }, 1670 block: { 1671 type: 'object', 1672 required: ['block'], 1673 properties: { 1674 block: { 1675 type: 'union', 1676 refs: [ 1677 'lex:pub.leaflet.blocks.iframe', 1678 'lex:pub.leaflet.blocks.text', 1679 'lex:pub.leaflet.blocks.blockquote', 1680 'lex:pub.leaflet.blocks.header', 1681 'lex:pub.leaflet.blocks.image', 1682 'lex:pub.leaflet.blocks.unorderedList', 1683 'lex:pub.leaflet.blocks.website', 1684 'lex:pub.leaflet.blocks.math', 1685 'lex:pub.leaflet.blocks.code', 1686 'lex:pub.leaflet.blocks.horizontalRule', 1687 'lex:pub.leaflet.blocks.bskyPost', 1688 'lex:pub.leaflet.blocks.page', 1689 'lex:pub.leaflet.blocks.poll', 1690 'lex:pub.leaflet.blocks.button', 1691 ], 1692 }, 1693 alignment: { 1694 type: 'string', 1695 knownValues: [ 1696 'lex:pub.leaflet.pages.linearDocument#textAlignLeft', 1697 'lex:pub.leaflet.pages.linearDocument#textAlignCenter', 1698 'lex:pub.leaflet.pages.linearDocument#textAlignRight', 1699 'lex:pub.leaflet.pages.linearDocument#textAlignJustify', 1700 ], 1701 }, 1702 }, 1703 }, 1704 textAlignLeft: { 1705 type: 'token', 1706 }, 1707 textAlignCenter: { 1708 type: 'token', 1709 }, 1710 textAlignRight: { 1711 type: 'token', 1712 }, 1713 textAlignJustify: { 1714 type: 'token', 1715 }, 1716 quote: { 1717 type: 'object', 1718 required: ['start', 'end'], 1719 properties: { 1720 start: { 1721 type: 'ref', 1722 ref: 'lex:pub.leaflet.pages.linearDocument#position', 1723 }, 1724 end: { 1725 type: 'ref', 1726 ref: 'lex:pub.leaflet.pages.linearDocument#position', 1727 }, 1728 }, 1729 }, 1730 position: { 1731 type: 'object', 1732 required: ['block', 'offset'], 1733 properties: { 1734 block: { 1735 type: 'array', 1736 items: { 1737 type: 'integer', 1738 }, 1739 }, 1740 offset: { 1741 type: 'integer', 1742 }, 1743 }, 1744 }, 1745 }, 1746 }, 1747 PubLeafletPollDefinition: { 1748 lexicon: 1, 1749 id: 'pub.leaflet.poll.definition', 1750 defs: { 1751 main: { 1752 type: 'record', 1753 key: 'tid', 1754 description: 'Record declaring a poll', 1755 record: { 1756 type: 'object', 1757 required: ['name', 'options'], 1758 properties: { 1759 name: { 1760 type: 'string', 1761 maxLength: 500, 1762 maxGraphemes: 100, 1763 }, 1764 options: { 1765 type: 'array', 1766 items: { 1767 type: 'ref', 1768 ref: 'lex:pub.leaflet.poll.definition#option', 1769 }, 1770 }, 1771 endDate: { 1772 type: 'string', 1773 format: 'datetime', 1774 }, 1775 }, 1776 }, 1777 }, 1778 option: { 1779 type: 'object', 1780 properties: { 1781 text: { 1782 type: 'string', 1783 maxLength: 500, 1784 maxGraphemes: 50, 1785 }, 1786 }, 1787 }, 1788 }, 1789 }, 1790 PubLeafletPollVote: { 1791 lexicon: 1, 1792 id: 'pub.leaflet.poll.vote', 1793 defs: { 1794 main: { 1795 type: 'record', 1796 key: 'tid', 1797 description: 'Record declaring a vote on a poll', 1798 record: { 1799 type: 'object', 1800 required: ['poll', 'option'], 1801 properties: { 1802 poll: { 1803 type: 'ref', 1804 ref: 'lex:com.atproto.repo.strongRef', 1805 }, 1806 option: { 1807 type: 'array', 1808 items: { 1809 type: 'string', 1810 }, 1811 }, 1812 }, 1813 }, 1814 }, 1815 }, 1816 }, 1817 PubLeafletPublication: { 1818 lexicon: 1, 1819 id: 'pub.leaflet.publication', 1820 defs: { 1821 main: { 1822 type: 'record', 1823 key: 'tid', 1824 description: 'Record declaring a publication', 1825 record: { 1826 type: 'object', 1827 required: ['name'], 1828 properties: { 1829 name: { 1830 type: 'string', 1831 maxLength: 2000, 1832 }, 1833 base_path: { 1834 type: 'string', 1835 }, 1836 description: { 1837 type: 'string', 1838 maxLength: 2000, 1839 }, 1840 icon: { 1841 type: 'blob', 1842 accept: ['image/*'], 1843 maxSize: 1000000, 1844 }, 1845 theme: { 1846 type: 'ref', 1847 ref: 'lex:pub.leaflet.publication#theme', 1848 }, 1849 preferences: { 1850 type: 'ref', 1851 ref: 'lex:pub.leaflet.publication#preferences', 1852 }, 1853 }, 1854 }, 1855 }, 1856 preferences: { 1857 type: 'object', 1858 properties: { 1859 showInDiscover: { 1860 type: 'boolean', 1861 default: true, 1862 }, 1863 showComments: { 1864 type: 'boolean', 1865 default: true, 1866 }, 1867 showMentions: { 1868 type: 'boolean', 1869 default: true, 1870 }, 1871 showPrevNext: { 1872 type: 'boolean', 1873 default: true, 1874 }, 1875 showRecommends: { 1876 type: 'boolean', 1877 default: true, 1878 }, 1879 }, 1880 }, 1881 theme: { 1882 type: 'object', 1883 properties: { 1884 backgroundColor: { 1885 type: 'union', 1886 refs: [ 1887 'lex:pub.leaflet.theme.color#rgba', 1888 'lex:pub.leaflet.theme.color#rgb', 1889 ], 1890 }, 1891 backgroundImage: { 1892 type: 'ref', 1893 ref: 'lex:pub.leaflet.theme.backgroundImage', 1894 }, 1895 pageWidth: { 1896 type: 'integer', 1897 minimum: 0, 1898 maximum: 1600, 1899 }, 1900 primary: { 1901 type: 'union', 1902 refs: [ 1903 'lex:pub.leaflet.theme.color#rgba', 1904 'lex:pub.leaflet.theme.color#rgb', 1905 ], 1906 }, 1907 pageBackground: { 1908 type: 'union', 1909 refs: [ 1910 'lex:pub.leaflet.theme.color#rgba', 1911 'lex:pub.leaflet.theme.color#rgb', 1912 ], 1913 }, 1914 showPageBackground: { 1915 type: 'boolean', 1916 default: false, 1917 }, 1918 accentBackground: { 1919 type: 'union', 1920 refs: [ 1921 'lex:pub.leaflet.theme.color#rgba', 1922 'lex:pub.leaflet.theme.color#rgb', 1923 ], 1924 }, 1925 accentText: { 1926 type: 'union', 1927 refs: [ 1928 'lex:pub.leaflet.theme.color#rgba', 1929 'lex:pub.leaflet.theme.color#rgb', 1930 ], 1931 }, 1932 }, 1933 }, 1934 }, 1935 }, 1936 PubLeafletRichtextFacet: { 1937 lexicon: 1, 1938 id: 'pub.leaflet.richtext.facet', 1939 defs: { 1940 main: { 1941 type: 'object', 1942 description: 'Annotation of a sub-string within rich text.', 1943 required: ['index', 'features'], 1944 properties: { 1945 index: { 1946 type: 'ref', 1947 ref: 'lex:pub.leaflet.richtext.facet#byteSlice', 1948 }, 1949 features: { 1950 type: 'array', 1951 items: { 1952 type: 'union', 1953 refs: [ 1954 'lex:pub.leaflet.richtext.facet#link', 1955 'lex:pub.leaflet.richtext.facet#didMention', 1956 'lex:pub.leaflet.richtext.facet#atMention', 1957 'lex:pub.leaflet.richtext.facet#code', 1958 'lex:pub.leaflet.richtext.facet#highlight', 1959 'lex:pub.leaflet.richtext.facet#underline', 1960 'lex:pub.leaflet.richtext.facet#strikethrough', 1961 'lex:pub.leaflet.richtext.facet#id', 1962 'lex:pub.leaflet.richtext.facet#bold', 1963 'lex:pub.leaflet.richtext.facet#italic', 1964 ], 1965 }, 1966 }, 1967 }, 1968 }, 1969 byteSlice: { 1970 type: 'object', 1971 description: 1972 '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.', 1973 required: ['byteStart', 'byteEnd'], 1974 properties: { 1975 byteStart: { 1976 type: 'integer', 1977 minimum: 0, 1978 }, 1979 byteEnd: { 1980 type: 'integer', 1981 minimum: 0, 1982 }, 1983 }, 1984 }, 1985 link: { 1986 type: 'object', 1987 description: 1988 'Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.', 1989 required: ['uri'], 1990 properties: { 1991 uri: { 1992 type: 'string', 1993 }, 1994 }, 1995 }, 1996 didMention: { 1997 type: 'object', 1998 description: 'Facet feature for mentioning a did.', 1999 required: ['did'], 2000 properties: { 2001 did: { 2002 type: 'string', 2003 format: 'did', 2004 }, 2005 }, 2006 }, 2007 atMention: { 2008 type: 'object', 2009 description: 'Facet feature for mentioning an AT URI.', 2010 required: ['atURI'], 2011 properties: { 2012 atURI: { 2013 type: 'string', 2014 format: 'uri', 2015 }, 2016 }, 2017 }, 2018 code: { 2019 type: 'object', 2020 description: 'Facet feature for inline code.', 2021 required: [], 2022 properties: {}, 2023 }, 2024 highlight: { 2025 type: 'object', 2026 description: 'Facet feature for highlighted text.', 2027 required: [], 2028 properties: {}, 2029 }, 2030 underline: { 2031 type: 'object', 2032 description: 'Facet feature for underline markup', 2033 required: [], 2034 properties: {}, 2035 }, 2036 strikethrough: { 2037 type: 'object', 2038 description: 'Facet feature for strikethrough markup', 2039 required: [], 2040 properties: {}, 2041 }, 2042 id: { 2043 type: 'object', 2044 description: 2045 'Facet feature for an identifier. Used for linking to a segment', 2046 required: [], 2047 properties: { 2048 id: { 2049 type: 'string', 2050 }, 2051 }, 2052 }, 2053 bold: { 2054 type: 'object', 2055 description: 'Facet feature for bold text', 2056 required: [], 2057 properties: {}, 2058 }, 2059 italic: { 2060 type: 'object', 2061 description: 'Facet feature for italic text', 2062 required: [], 2063 properties: {}, 2064 }, 2065 }, 2066 }, 2067 PubLeafletThemeBackgroundImage: { 2068 lexicon: 1, 2069 id: 'pub.leaflet.theme.backgroundImage', 2070 defs: { 2071 main: { 2072 type: 'object', 2073 required: ['image'], 2074 properties: { 2075 image: { 2076 type: 'blob', 2077 accept: ['image/*'], 2078 maxSize: 1000000, 2079 }, 2080 width: { 2081 type: 'integer', 2082 }, 2083 repeat: { 2084 type: 'boolean', 2085 }, 2086 }, 2087 }, 2088 }, 2089 }, 2090 PubLeafletThemeColor: { 2091 lexicon: 1, 2092 id: 'pub.leaflet.theme.color', 2093 defs: { 2094 rgba: { 2095 type: 'object', 2096 required: ['r', 'g', 'b', 'a'], 2097 properties: { 2098 r: { 2099 type: 'integer', 2100 maximum: 255, 2101 minimum: 0, 2102 }, 2103 g: { 2104 type: 'integer', 2105 maximum: 255, 2106 minimum: 0, 2107 }, 2108 b: { 2109 type: 'integer', 2110 maximum: 255, 2111 minimum: 0, 2112 }, 2113 a: { 2114 type: 'integer', 2115 maximum: 100, 2116 minimum: 0, 2117 }, 2118 }, 2119 }, 2120 rgb: { 2121 type: 'object', 2122 required: ['r', 'g', 'b'], 2123 properties: { 2124 r: { 2125 type: 'integer', 2126 maximum: 255, 2127 minimum: 0, 2128 }, 2129 g: { 2130 type: 'integer', 2131 maximum: 255, 2132 minimum: 0, 2133 }, 2134 b: { 2135 type: 'integer', 2136 maximum: 255, 2137 minimum: 0, 2138 }, 2139 }, 2140 }, 2141 }, 2142 }, 2143 SiteStandardDocument: { 2144 defs: { 2145 main: { 2146 key: 'tid', 2147 record: { 2148 properties: { 2149 bskyPostRef: { 2150 ref: 'lex:com.atproto.repo.strongRef', 2151 type: 'ref', 2152 }, 2153 content: { 2154 closed: false, 2155 refs: ['lex:pub.leaflet.content'], 2156 type: 'union', 2157 }, 2158 coverImage: { 2159 accept: ['image/*'], 2160 maxSize: 1000000, 2161 type: 'blob', 2162 }, 2163 description: { 2164 maxGraphemes: 3000, 2165 maxLength: 30000, 2166 type: 'string', 2167 }, 2168 path: { 2169 description: 2170 'combine with the publication url or the document site to construct a full url to the document', 2171 type: 'string', 2172 }, 2173 publishedAt: { 2174 format: 'datetime', 2175 type: 'string', 2176 }, 2177 site: { 2178 description: 2179 'URI to the site or publication this document belongs to. Supports both AT-URIs (at://did/collection/rkey) for publication references and HTTPS URLs (https://example.com) for standalone documents or external sites.', 2180 format: 'uri', 2181 type: 'string', 2182 }, 2183 tags: { 2184 items: { 2185 maxGraphemes: 50, 2186 maxLength: 100, 2187 type: 'string', 2188 }, 2189 type: 'array', 2190 }, 2191 textContent: { 2192 type: 'string', 2193 }, 2194 theme: { 2195 description: 2196 'Theme for standalone documents. For documents in publications, theme is inherited from the publication.', 2197 ref: 'lex:pub.leaflet.publication#theme', 2198 type: 'ref', 2199 }, 2200 title: { 2201 maxGraphemes: 500, 2202 maxLength: 5000, 2203 type: 'string', 2204 }, 2205 preferences: { 2206 type: 'union', 2207 refs: ['lex:pub.leaflet.publication#preferences'], 2208 closed: false, 2209 }, 2210 updatedAt: { 2211 format: 'datetime', 2212 type: 'string', 2213 }, 2214 }, 2215 required: ['site', 'title', 'publishedAt'], 2216 type: 'object', 2217 }, 2218 type: 'record', 2219 }, 2220 }, 2221 id: 'site.standard.document', 2222 lexicon: 1, 2223 }, 2224 SiteStandardGraphSubscription: { 2225 defs: { 2226 main: { 2227 description: 'Record declaring a subscription to a publication', 2228 key: 'tid', 2229 record: { 2230 properties: { 2231 publication: { 2232 format: 'at-uri', 2233 type: 'string', 2234 }, 2235 }, 2236 required: ['publication'], 2237 type: 'object', 2238 }, 2239 type: 'record', 2240 }, 2241 }, 2242 id: 'site.standard.graph.subscription', 2243 lexicon: 1, 2244 }, 2245 SiteStandardPublication: { 2246 defs: { 2247 main: { 2248 key: 'tid', 2249 record: { 2250 properties: { 2251 basicTheme: { 2252 ref: 'lex:site.standard.theme.basic', 2253 type: 'ref', 2254 }, 2255 theme: { 2256 type: 'union', 2257 refs: ['lex:pub.leaflet.publication#theme'], 2258 }, 2259 description: { 2260 maxGraphemes: 300, 2261 maxLength: 3000, 2262 type: 'string', 2263 }, 2264 icon: { 2265 accept: ['image/*'], 2266 maxSize: 1000000, 2267 type: 'blob', 2268 }, 2269 name: { 2270 maxGraphemes: 128, 2271 maxLength: 1280, 2272 type: 'string', 2273 }, 2274 preferences: { 2275 ref: 'lex:site.standard.publication#preferences', 2276 type: 'ref', 2277 }, 2278 url: { 2279 format: 'uri', 2280 type: 'string', 2281 }, 2282 }, 2283 required: ['url', 'name'], 2284 type: 'object', 2285 }, 2286 type: 'record', 2287 }, 2288 preferences: { 2289 properties: { 2290 showInDiscover: { 2291 default: true, 2292 type: 'boolean', 2293 }, 2294 showComments: { 2295 default: true, 2296 type: 'boolean', 2297 }, 2298 showMentions: { 2299 default: true, 2300 type: 'boolean', 2301 }, 2302 showPrevNext: { 2303 default: false, 2304 type: 'boolean', 2305 }, 2306 showRecommends: { 2307 default: true, 2308 type: 'boolean', 2309 }, 2310 }, 2311 type: 'object', 2312 }, 2313 }, 2314 id: 'site.standard.publication', 2315 lexicon: 1, 2316 }, 2317 SiteStandardThemeBasic: { 2318 defs: { 2319 main: { 2320 properties: { 2321 accent: { 2322 refs: ['lex:site.standard.theme.color#rgb'], 2323 type: 'union', 2324 }, 2325 accentForeground: { 2326 refs: ['lex:site.standard.theme.color#rgb'], 2327 type: 'union', 2328 }, 2329 background: { 2330 refs: ['lex:site.standard.theme.color#rgb'], 2331 type: 'union', 2332 }, 2333 foreground: { 2334 refs: ['lex:site.standard.theme.color#rgb'], 2335 type: 'union', 2336 }, 2337 }, 2338 required: ['background', 'foreground', 'accent', 'accentForeground'], 2339 type: 'object', 2340 }, 2341 }, 2342 id: 'site.standard.theme.basic', 2343 lexicon: 1, 2344 }, 2345 SiteStandardThemeColor: { 2346 lexicon: 1, 2347 id: 'site.standard.theme.color', 2348 defs: { 2349 rgb: { 2350 type: 'object', 2351 required: ['r', 'g', 'b'], 2352 properties: { 2353 r: { 2354 type: 'integer', 2355 minimum: 0, 2356 maximum: 255, 2357 }, 2358 g: { 2359 type: 'integer', 2360 minimum: 0, 2361 maximum: 255, 2362 }, 2363 b: { 2364 type: 'integer', 2365 minimum: 0, 2366 maximum: 255, 2367 }, 2368 }, 2369 }, 2370 rgba: { 2371 type: 'object', 2372 required: ['r', 'g', 'b', 'a'], 2373 properties: { 2374 r: { 2375 type: 'integer', 2376 minimum: 0, 2377 maximum: 255, 2378 }, 2379 g: { 2380 type: 'integer', 2381 minimum: 0, 2382 maximum: 255, 2383 }, 2384 b: { 2385 type: 'integer', 2386 minimum: 0, 2387 maximum: 255, 2388 }, 2389 a: { 2390 type: 'integer', 2391 minimum: 0, 2392 maximum: 100, 2393 }, 2394 }, 2395 }, 2396 }, 2397 }, 2398} as const satisfies Record<string, LexiconDoc> 2399export const schemas = Object.values(schemaDict) satisfies LexiconDoc[] 2400export const lexicons: Lexicons = new Lexicons(schemas) 2401 2402export function validate<T extends { $type: string }>( 2403 v: unknown, 2404 id: string, 2405 hash: string, 2406 requiredType: true, 2407): ValidationResult<T> 2408export function validate<T extends { $type?: string }>( 2409 v: unknown, 2410 id: string, 2411 hash: string, 2412 requiredType?: false, 2413): ValidationResult<T> 2414export function validate( 2415 v: unknown, 2416 id: string, 2417 hash: string, 2418 requiredType?: boolean, 2419): ValidationResult { 2420 return (requiredType ? is$typed : maybe$typed)(v, id, hash) 2421 ? lexicons.validate(`${id}#${hash}`, v) 2422 : { 2423 success: false, 2424 error: new ValidationError( 2425 `Must be an object with "${hash === 'main' ? id : `${id}#${hash}`}" $type property`, 2426 ), 2427 } 2428} 2429 2430export const ids = { 2431 AppBskyActorProfile: 'app.bsky.actor.profile', 2432 ComAtprotoLabelDefs: 'com.atproto.label.defs', 2433 ComAtprotoRepoApplyWrites: 'com.atproto.repo.applyWrites', 2434 ComAtprotoRepoCreateRecord: 'com.atproto.repo.createRecord', 2435 ComAtprotoRepoDefs: 'com.atproto.repo.defs', 2436 ComAtprotoRepoDeleteRecord: 'com.atproto.repo.deleteRecord', 2437 ComAtprotoRepoDescribeRepo: 'com.atproto.repo.describeRepo', 2438 ComAtprotoRepoGetRecord: 'com.atproto.repo.getRecord', 2439 ComAtprotoRepoImportRepo: 'com.atproto.repo.importRepo', 2440 ComAtprotoRepoListMissingBlobs: 'com.atproto.repo.listMissingBlobs', 2441 ComAtprotoRepoListRecords: 'com.atproto.repo.listRecords', 2442 ComAtprotoRepoPutRecord: 'com.atproto.repo.putRecord', 2443 ComAtprotoRepoStrongRef: 'com.atproto.repo.strongRef', 2444 ComAtprotoRepoUploadBlob: 'com.atproto.repo.uploadBlob', 2445 PubLeafletBlocksBlockquote: 'pub.leaflet.blocks.blockquote', 2446 PubLeafletBlocksBskyPost: 'pub.leaflet.blocks.bskyPost', 2447 PubLeafletBlocksButton: 'pub.leaflet.blocks.button', 2448 PubLeafletBlocksCode: 'pub.leaflet.blocks.code', 2449 PubLeafletBlocksHeader: 'pub.leaflet.blocks.header', 2450 PubLeafletBlocksHorizontalRule: 'pub.leaflet.blocks.horizontalRule', 2451 PubLeafletBlocksIframe: 'pub.leaflet.blocks.iframe', 2452 PubLeafletBlocksImage: 'pub.leaflet.blocks.image', 2453 PubLeafletBlocksMath: 'pub.leaflet.blocks.math', 2454 PubLeafletBlocksPage: 'pub.leaflet.blocks.page', 2455 PubLeafletBlocksPoll: 'pub.leaflet.blocks.poll', 2456 PubLeafletBlocksText: 'pub.leaflet.blocks.text', 2457 PubLeafletBlocksUnorderedList: 'pub.leaflet.blocks.unorderedList', 2458 PubLeafletBlocksWebsite: 'pub.leaflet.blocks.website', 2459 PubLeafletComment: 'pub.leaflet.comment', 2460 PubLeafletContent: 'pub.leaflet.content', 2461 PubLeafletDocument: 'pub.leaflet.document', 2462 PubLeafletGraphSubscription: 'pub.leaflet.graph.subscription', 2463 PubLeafletInteractionsRecommend: 'pub.leaflet.interactions.recommend', 2464 PubLeafletPagesCanvas: 'pub.leaflet.pages.canvas', 2465 PubLeafletPagesLinearDocument: 'pub.leaflet.pages.linearDocument', 2466 PubLeafletPollDefinition: 'pub.leaflet.poll.definition', 2467 PubLeafletPollVote: 'pub.leaflet.poll.vote', 2468 PubLeafletPublication: 'pub.leaflet.publication', 2469 PubLeafletRichtextFacet: 'pub.leaflet.richtext.facet', 2470 PubLeafletThemeBackgroundImage: 'pub.leaflet.theme.backgroundImage', 2471 PubLeafletThemeColor: 'pub.leaflet.theme.color', 2472 SiteStandardDocument: 'site.standard.document', 2473 SiteStandardGraphSubscription: 'site.standard.graph.subscription', 2474 SiteStandardPublication: 'site.standard.publication', 2475 SiteStandardThemeBasic: 'site.standard.theme.basic', 2476 SiteStandardThemeColor: 'site.standard.theme.color', 2477} as const