a tool for shared writing and social publishing
at feature/thread-viewer 2135 lines 58 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 facets: { 1250 type: 'array', 1251 items: { 1252 type: 'ref', 1253 ref: 'lex:pub.leaflet.richtext.facet', 1254 }, 1255 }, 1256 }, 1257 }, 1258 }, 1259 }, 1260 PubLeafletBlocksUnorderedList: { 1261 lexicon: 1, 1262 id: 'pub.leaflet.blocks.unorderedList', 1263 defs: { 1264 main: { 1265 type: 'object', 1266 required: ['children'], 1267 properties: { 1268 children: { 1269 type: 'array', 1270 items: { 1271 type: 'ref', 1272 ref: 'lex:pub.leaflet.blocks.unorderedList#listItem', 1273 }, 1274 }, 1275 }, 1276 }, 1277 listItem: { 1278 type: 'object', 1279 required: ['content'], 1280 properties: { 1281 content: { 1282 type: 'union', 1283 refs: [ 1284 'lex:pub.leaflet.blocks.text', 1285 'lex:pub.leaflet.blocks.header', 1286 'lex:pub.leaflet.blocks.image', 1287 ], 1288 }, 1289 children: { 1290 type: 'array', 1291 items: { 1292 type: 'ref', 1293 ref: 'lex:pub.leaflet.blocks.unorderedList#listItem', 1294 }, 1295 }, 1296 }, 1297 }, 1298 }, 1299 }, 1300 PubLeafletBlocksWebsite: { 1301 lexicon: 1, 1302 id: 'pub.leaflet.blocks.website', 1303 defs: { 1304 main: { 1305 type: 'object', 1306 required: ['src'], 1307 properties: { 1308 previewImage: { 1309 type: 'blob', 1310 accept: ['image/*'], 1311 maxSize: 1000000, 1312 }, 1313 title: { 1314 type: 'string', 1315 }, 1316 description: { 1317 type: 'string', 1318 }, 1319 src: { 1320 type: 'string', 1321 format: 'uri', 1322 }, 1323 }, 1324 }, 1325 }, 1326 }, 1327 PubLeafletComment: { 1328 lexicon: 1, 1329 id: 'pub.leaflet.comment', 1330 revision: 1, 1331 description: 'A lexicon for comments on documents', 1332 defs: { 1333 main: { 1334 type: 'record', 1335 key: 'tid', 1336 description: 'Record containing a comment', 1337 record: { 1338 type: 'object', 1339 required: ['subject', 'plaintext', 'createdAt'], 1340 properties: { 1341 subject: { 1342 type: 'string', 1343 format: 'at-uri', 1344 }, 1345 createdAt: { 1346 type: 'string', 1347 format: 'datetime', 1348 }, 1349 reply: { 1350 type: 'ref', 1351 ref: 'lex:pub.leaflet.comment#replyRef', 1352 }, 1353 plaintext: { 1354 type: 'string', 1355 }, 1356 facets: { 1357 type: 'array', 1358 items: { 1359 type: 'ref', 1360 ref: 'lex:pub.leaflet.richtext.facet', 1361 }, 1362 }, 1363 onPage: { 1364 type: 'string', 1365 }, 1366 attachment: { 1367 type: 'union', 1368 refs: ['lex:pub.leaflet.comment#linearDocumentQuote'], 1369 }, 1370 }, 1371 }, 1372 }, 1373 linearDocumentQuote: { 1374 type: 'object', 1375 required: ['document', 'quote'], 1376 properties: { 1377 document: { 1378 type: 'string', 1379 format: 'at-uri', 1380 }, 1381 quote: { 1382 type: 'ref', 1383 ref: 'lex:pub.leaflet.pages.linearDocument#quote', 1384 }, 1385 }, 1386 }, 1387 replyRef: { 1388 type: 'object', 1389 required: ['parent'], 1390 properties: { 1391 parent: { 1392 type: 'string', 1393 format: 'at-uri', 1394 }, 1395 }, 1396 }, 1397 }, 1398 }, 1399 PubLeafletDocument: { 1400 lexicon: 1, 1401 id: 'pub.leaflet.document', 1402 revision: 1, 1403 description: 'A lexicon for long form rich media documents', 1404 defs: { 1405 main: { 1406 type: 'record', 1407 key: 'tid', 1408 description: 'Record containing a document', 1409 record: { 1410 type: 'object', 1411 required: ['pages', 'author', 'title'], 1412 properties: { 1413 title: { 1414 type: 'string', 1415 maxLength: 1280, 1416 maxGraphemes: 128, 1417 }, 1418 postRef: { 1419 type: 'ref', 1420 ref: 'lex:com.atproto.repo.strongRef', 1421 }, 1422 description: { 1423 type: 'string', 1424 maxLength: 3000, 1425 maxGraphemes: 300, 1426 }, 1427 publishedAt: { 1428 type: 'string', 1429 format: 'datetime', 1430 }, 1431 publication: { 1432 type: 'string', 1433 format: 'at-uri', 1434 }, 1435 author: { 1436 type: 'string', 1437 format: 'at-identifier', 1438 }, 1439 theme: { 1440 type: 'ref', 1441 ref: 'lex:pub.leaflet.publication#theme', 1442 }, 1443 tags: { 1444 type: 'array', 1445 items: { 1446 type: 'string', 1447 maxLength: 50, 1448 }, 1449 }, 1450 pages: { 1451 type: 'array', 1452 items: { 1453 type: 'union', 1454 refs: [ 1455 'lex:pub.leaflet.pages.linearDocument', 1456 'lex:pub.leaflet.pages.canvas', 1457 ], 1458 }, 1459 }, 1460 }, 1461 }, 1462 }, 1463 }, 1464 }, 1465 PubLeafletGraphSubscription: { 1466 lexicon: 1, 1467 id: 'pub.leaflet.graph.subscription', 1468 defs: { 1469 main: { 1470 type: 'record', 1471 key: 'tid', 1472 description: 'Record declaring a subscription to a publication', 1473 record: { 1474 type: 'object', 1475 required: ['publication'], 1476 properties: { 1477 publication: { 1478 type: 'string', 1479 format: 'at-uri', 1480 }, 1481 }, 1482 }, 1483 }, 1484 }, 1485 }, 1486 PubLeafletPagesCanvas: { 1487 lexicon: 1, 1488 id: 'pub.leaflet.pages.canvas', 1489 defs: { 1490 main: { 1491 type: 'object', 1492 required: ['blocks'], 1493 properties: { 1494 id: { 1495 type: 'string', 1496 }, 1497 blocks: { 1498 type: 'array', 1499 items: { 1500 type: 'ref', 1501 ref: 'lex:pub.leaflet.pages.canvas#block', 1502 }, 1503 }, 1504 }, 1505 }, 1506 block: { 1507 type: 'object', 1508 required: ['block', 'x', 'y', 'width'], 1509 properties: { 1510 block: { 1511 type: 'union', 1512 refs: [ 1513 'lex:pub.leaflet.blocks.iframe', 1514 'lex:pub.leaflet.blocks.text', 1515 'lex:pub.leaflet.blocks.blockquote', 1516 'lex:pub.leaflet.blocks.header', 1517 'lex:pub.leaflet.blocks.image', 1518 'lex:pub.leaflet.blocks.unorderedList', 1519 'lex:pub.leaflet.blocks.website', 1520 'lex:pub.leaflet.blocks.math', 1521 'lex:pub.leaflet.blocks.code', 1522 'lex:pub.leaflet.blocks.horizontalRule', 1523 'lex:pub.leaflet.blocks.bskyPost', 1524 'lex:pub.leaflet.blocks.page', 1525 'lex:pub.leaflet.blocks.poll', 1526 'lex:pub.leaflet.blocks.button', 1527 ], 1528 }, 1529 x: { 1530 type: 'integer', 1531 }, 1532 y: { 1533 type: 'integer', 1534 }, 1535 width: { 1536 type: 'integer', 1537 }, 1538 height: { 1539 type: 'integer', 1540 }, 1541 rotation: { 1542 type: 'integer', 1543 description: 'The rotation of the block in degrees', 1544 }, 1545 }, 1546 }, 1547 textAlignLeft: { 1548 type: 'token', 1549 }, 1550 textAlignCenter: { 1551 type: 'token', 1552 }, 1553 textAlignRight: { 1554 type: 'token', 1555 }, 1556 quote: { 1557 type: 'object', 1558 required: ['start', 'end'], 1559 properties: { 1560 start: { 1561 type: 'ref', 1562 ref: 'lex:pub.leaflet.pages.canvas#position', 1563 }, 1564 end: { 1565 type: 'ref', 1566 ref: 'lex:pub.leaflet.pages.canvas#position', 1567 }, 1568 }, 1569 }, 1570 position: { 1571 type: 'object', 1572 required: ['block', 'offset'], 1573 properties: { 1574 block: { 1575 type: 'array', 1576 items: { 1577 type: 'integer', 1578 }, 1579 }, 1580 offset: { 1581 type: 'integer', 1582 }, 1583 }, 1584 }, 1585 }, 1586 }, 1587 PubLeafletPagesLinearDocument: { 1588 lexicon: 1, 1589 id: 'pub.leaflet.pages.linearDocument', 1590 defs: { 1591 main: { 1592 type: 'object', 1593 required: ['blocks'], 1594 properties: { 1595 id: { 1596 type: 'string', 1597 }, 1598 blocks: { 1599 type: 'array', 1600 items: { 1601 type: 'ref', 1602 ref: 'lex:pub.leaflet.pages.linearDocument#block', 1603 }, 1604 }, 1605 }, 1606 }, 1607 block: { 1608 type: 'object', 1609 required: ['block'], 1610 properties: { 1611 block: { 1612 type: 'union', 1613 refs: [ 1614 'lex:pub.leaflet.blocks.iframe', 1615 'lex:pub.leaflet.blocks.text', 1616 'lex:pub.leaflet.blocks.blockquote', 1617 'lex:pub.leaflet.blocks.header', 1618 'lex:pub.leaflet.blocks.image', 1619 'lex:pub.leaflet.blocks.unorderedList', 1620 'lex:pub.leaflet.blocks.website', 1621 'lex:pub.leaflet.blocks.math', 1622 'lex:pub.leaflet.blocks.code', 1623 'lex:pub.leaflet.blocks.horizontalRule', 1624 'lex:pub.leaflet.blocks.bskyPost', 1625 'lex:pub.leaflet.blocks.page', 1626 'lex:pub.leaflet.blocks.poll', 1627 'lex:pub.leaflet.blocks.button', 1628 ], 1629 }, 1630 alignment: { 1631 type: 'string', 1632 knownValues: [ 1633 'lex:pub.leaflet.pages.linearDocument#textAlignLeft', 1634 'lex:pub.leaflet.pages.linearDocument#textAlignCenter', 1635 'lex:pub.leaflet.pages.linearDocument#textAlignRight', 1636 'lex:pub.leaflet.pages.linearDocument#textAlignJustify', 1637 ], 1638 }, 1639 }, 1640 }, 1641 textAlignLeft: { 1642 type: 'token', 1643 }, 1644 textAlignCenter: { 1645 type: 'token', 1646 }, 1647 textAlignRight: { 1648 type: 'token', 1649 }, 1650 textAlignJustify: { 1651 type: 'token', 1652 }, 1653 quote: { 1654 type: 'object', 1655 required: ['start', 'end'], 1656 properties: { 1657 start: { 1658 type: 'ref', 1659 ref: 'lex:pub.leaflet.pages.linearDocument#position', 1660 }, 1661 end: { 1662 type: 'ref', 1663 ref: 'lex:pub.leaflet.pages.linearDocument#position', 1664 }, 1665 }, 1666 }, 1667 position: { 1668 type: 'object', 1669 required: ['block', 'offset'], 1670 properties: { 1671 block: { 1672 type: 'array', 1673 items: { 1674 type: 'integer', 1675 }, 1676 }, 1677 offset: { 1678 type: 'integer', 1679 }, 1680 }, 1681 }, 1682 }, 1683 }, 1684 PubLeafletPollDefinition: { 1685 lexicon: 1, 1686 id: 'pub.leaflet.poll.definition', 1687 defs: { 1688 main: { 1689 type: 'record', 1690 key: 'tid', 1691 description: 'Record declaring a poll', 1692 record: { 1693 type: 'object', 1694 required: ['name', 'options'], 1695 properties: { 1696 name: { 1697 type: 'string', 1698 maxLength: 500, 1699 maxGraphemes: 100, 1700 }, 1701 options: { 1702 type: 'array', 1703 items: { 1704 type: 'ref', 1705 ref: 'lex:pub.leaflet.poll.definition#option', 1706 }, 1707 }, 1708 endDate: { 1709 type: 'string', 1710 format: 'datetime', 1711 }, 1712 }, 1713 }, 1714 }, 1715 option: { 1716 type: 'object', 1717 properties: { 1718 text: { 1719 type: 'string', 1720 maxLength: 500, 1721 maxGraphemes: 50, 1722 }, 1723 }, 1724 }, 1725 }, 1726 }, 1727 PubLeafletPollVote: { 1728 lexicon: 1, 1729 id: 'pub.leaflet.poll.vote', 1730 defs: { 1731 main: { 1732 type: 'record', 1733 key: 'tid', 1734 description: 'Record declaring a vote on a poll', 1735 record: { 1736 type: 'object', 1737 required: ['poll', 'option'], 1738 properties: { 1739 poll: { 1740 type: 'ref', 1741 ref: 'lex:com.atproto.repo.strongRef', 1742 }, 1743 option: { 1744 type: 'array', 1745 items: { 1746 type: 'string', 1747 }, 1748 }, 1749 }, 1750 }, 1751 }, 1752 }, 1753 }, 1754 PubLeafletPublication: { 1755 lexicon: 1, 1756 id: 'pub.leaflet.publication', 1757 defs: { 1758 main: { 1759 type: 'record', 1760 key: 'tid', 1761 description: 'Record declaring a publication', 1762 record: { 1763 type: 'object', 1764 required: ['name'], 1765 properties: { 1766 name: { 1767 type: 'string', 1768 maxLength: 2000, 1769 }, 1770 base_path: { 1771 type: 'string', 1772 }, 1773 description: { 1774 type: 'string', 1775 maxLength: 2000, 1776 }, 1777 icon: { 1778 type: 'blob', 1779 accept: ['image/*'], 1780 maxSize: 1000000, 1781 }, 1782 theme: { 1783 type: 'ref', 1784 ref: 'lex:pub.leaflet.publication#theme', 1785 }, 1786 preferences: { 1787 type: 'ref', 1788 ref: 'lex:pub.leaflet.publication#preferences', 1789 }, 1790 }, 1791 }, 1792 }, 1793 preferences: { 1794 type: 'object', 1795 properties: { 1796 showInDiscover: { 1797 type: 'boolean', 1798 default: true, 1799 }, 1800 showComments: { 1801 type: 'boolean', 1802 default: true, 1803 }, 1804 }, 1805 }, 1806 theme: { 1807 type: 'object', 1808 properties: { 1809 backgroundColor: { 1810 type: 'union', 1811 refs: [ 1812 'lex:pub.leaflet.theme.color#rgba', 1813 'lex:pub.leaflet.theme.color#rgb', 1814 ], 1815 }, 1816 backgroundImage: { 1817 type: 'ref', 1818 ref: 'lex:pub.leaflet.theme.backgroundImage', 1819 }, 1820 primary: { 1821 type: 'union', 1822 refs: [ 1823 'lex:pub.leaflet.theme.color#rgba', 1824 'lex:pub.leaflet.theme.color#rgb', 1825 ], 1826 }, 1827 pageBackground: { 1828 type: 'union', 1829 refs: [ 1830 'lex:pub.leaflet.theme.color#rgba', 1831 'lex:pub.leaflet.theme.color#rgb', 1832 ], 1833 }, 1834 showPageBackground: { 1835 type: 'boolean', 1836 default: false, 1837 }, 1838 accentBackground: { 1839 type: 'union', 1840 refs: [ 1841 'lex:pub.leaflet.theme.color#rgba', 1842 'lex:pub.leaflet.theme.color#rgb', 1843 ], 1844 }, 1845 accentText: { 1846 type: 'union', 1847 refs: [ 1848 'lex:pub.leaflet.theme.color#rgba', 1849 'lex:pub.leaflet.theme.color#rgb', 1850 ], 1851 }, 1852 }, 1853 }, 1854 }, 1855 }, 1856 PubLeafletRichtextFacet: { 1857 lexicon: 1, 1858 id: 'pub.leaflet.richtext.facet', 1859 defs: { 1860 main: { 1861 type: 'object', 1862 description: 'Annotation of a sub-string within rich text.', 1863 required: ['index', 'features'], 1864 properties: { 1865 index: { 1866 type: 'ref', 1867 ref: 'lex:pub.leaflet.richtext.facet#byteSlice', 1868 }, 1869 features: { 1870 type: 'array', 1871 items: { 1872 type: 'union', 1873 refs: [ 1874 'lex:pub.leaflet.richtext.facet#link', 1875 'lex:pub.leaflet.richtext.facet#didMention', 1876 'lex:pub.leaflet.richtext.facet#atMention', 1877 'lex:pub.leaflet.richtext.facet#code', 1878 'lex:pub.leaflet.richtext.facet#highlight', 1879 'lex:pub.leaflet.richtext.facet#underline', 1880 'lex:pub.leaflet.richtext.facet#strikethrough', 1881 'lex:pub.leaflet.richtext.facet#id', 1882 'lex:pub.leaflet.richtext.facet#bold', 1883 'lex:pub.leaflet.richtext.facet#italic', 1884 ], 1885 }, 1886 }, 1887 }, 1888 }, 1889 byteSlice: { 1890 type: 'object', 1891 description: 1892 '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.', 1893 required: ['byteStart', 'byteEnd'], 1894 properties: { 1895 byteStart: { 1896 type: 'integer', 1897 minimum: 0, 1898 }, 1899 byteEnd: { 1900 type: 'integer', 1901 minimum: 0, 1902 }, 1903 }, 1904 }, 1905 link: { 1906 type: 'object', 1907 description: 1908 'Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.', 1909 required: ['uri'], 1910 properties: { 1911 uri: { 1912 type: 'string', 1913 }, 1914 }, 1915 }, 1916 didMention: { 1917 type: 'object', 1918 description: 'Facet feature for mentioning a did.', 1919 required: ['did'], 1920 properties: { 1921 did: { 1922 type: 'string', 1923 format: 'did', 1924 }, 1925 }, 1926 }, 1927 atMention: { 1928 type: 'object', 1929 description: 'Facet feature for mentioning an AT URI.', 1930 required: ['atURI'], 1931 properties: { 1932 atURI: { 1933 type: 'string', 1934 format: 'uri', 1935 }, 1936 }, 1937 }, 1938 code: { 1939 type: 'object', 1940 description: 'Facet feature for inline code.', 1941 required: [], 1942 properties: {}, 1943 }, 1944 highlight: { 1945 type: 'object', 1946 description: 'Facet feature for highlighted text.', 1947 required: [], 1948 properties: {}, 1949 }, 1950 underline: { 1951 type: 'object', 1952 description: 'Facet feature for underline markup', 1953 required: [], 1954 properties: {}, 1955 }, 1956 strikethrough: { 1957 type: 'object', 1958 description: 'Facet feature for strikethrough markup', 1959 required: [], 1960 properties: {}, 1961 }, 1962 id: { 1963 type: 'object', 1964 description: 1965 'Facet feature for an identifier. Used for linking to a segment', 1966 required: [], 1967 properties: { 1968 id: { 1969 type: 'string', 1970 }, 1971 }, 1972 }, 1973 bold: { 1974 type: 'object', 1975 description: 'Facet feature for bold text', 1976 required: [], 1977 properties: {}, 1978 }, 1979 italic: { 1980 type: 'object', 1981 description: 'Facet feature for italic text', 1982 required: [], 1983 properties: {}, 1984 }, 1985 }, 1986 }, 1987 PubLeafletThemeBackgroundImage: { 1988 lexicon: 1, 1989 id: 'pub.leaflet.theme.backgroundImage', 1990 defs: { 1991 main: { 1992 type: 'object', 1993 required: ['image'], 1994 properties: { 1995 image: { 1996 type: 'blob', 1997 accept: ['image/*'], 1998 maxSize: 1000000, 1999 }, 2000 width: { 2001 type: 'integer', 2002 }, 2003 repeat: { 2004 type: 'boolean', 2005 }, 2006 }, 2007 }, 2008 }, 2009 }, 2010 PubLeafletThemeColor: { 2011 lexicon: 1, 2012 id: 'pub.leaflet.theme.color', 2013 defs: { 2014 rgba: { 2015 type: 'object', 2016 required: ['r', 'g', 'b', 'a'], 2017 properties: { 2018 r: { 2019 type: 'integer', 2020 maximum: 255, 2021 minimum: 0, 2022 }, 2023 g: { 2024 type: 'integer', 2025 maximum: 255, 2026 minimum: 0, 2027 }, 2028 b: { 2029 type: 'integer', 2030 maximum: 255, 2031 minimum: 0, 2032 }, 2033 a: { 2034 type: 'integer', 2035 maximum: 100, 2036 minimum: 0, 2037 }, 2038 }, 2039 }, 2040 rgb: { 2041 type: 'object', 2042 required: ['r', 'g', 'b'], 2043 properties: { 2044 r: { 2045 type: 'integer', 2046 maximum: 255, 2047 minimum: 0, 2048 }, 2049 g: { 2050 type: 'integer', 2051 maximum: 255, 2052 minimum: 0, 2053 }, 2054 b: { 2055 type: 'integer', 2056 maximum: 255, 2057 minimum: 0, 2058 }, 2059 }, 2060 }, 2061 }, 2062 }, 2063} as const satisfies Record<string, LexiconDoc> 2064export const schemas = Object.values(schemaDict) satisfies LexiconDoc[] 2065export const lexicons: Lexicons = new Lexicons(schemas) 2066 2067export function validate<T extends { $type: string }>( 2068 v: unknown, 2069 id: string, 2070 hash: string, 2071 requiredType: true, 2072): ValidationResult<T> 2073export function validate<T extends { $type?: string }>( 2074 v: unknown, 2075 id: string, 2076 hash: string, 2077 requiredType?: false, 2078): ValidationResult<T> 2079export function validate( 2080 v: unknown, 2081 id: string, 2082 hash: string, 2083 requiredType?: boolean, 2084): ValidationResult { 2085 return (requiredType ? is$typed : maybe$typed)(v, id, hash) 2086 ? lexicons.validate(`${id}#${hash}`, v) 2087 : { 2088 success: false, 2089 error: new ValidationError( 2090 `Must be an object with "${hash === 'main' ? id : `${id}#${hash}`}" $type property`, 2091 ), 2092 } 2093} 2094 2095export const ids = { 2096 AppBskyActorProfile: 'app.bsky.actor.profile', 2097 ComAtprotoLabelDefs: 'com.atproto.label.defs', 2098 ComAtprotoRepoApplyWrites: 'com.atproto.repo.applyWrites', 2099 ComAtprotoRepoCreateRecord: 'com.atproto.repo.createRecord', 2100 ComAtprotoRepoDefs: 'com.atproto.repo.defs', 2101 ComAtprotoRepoDeleteRecord: 'com.atproto.repo.deleteRecord', 2102 ComAtprotoRepoDescribeRepo: 'com.atproto.repo.describeRepo', 2103 ComAtprotoRepoGetRecord: 'com.atproto.repo.getRecord', 2104 ComAtprotoRepoImportRepo: 'com.atproto.repo.importRepo', 2105 ComAtprotoRepoListMissingBlobs: 'com.atproto.repo.listMissingBlobs', 2106 ComAtprotoRepoListRecords: 'com.atproto.repo.listRecords', 2107 ComAtprotoRepoPutRecord: 'com.atproto.repo.putRecord', 2108 ComAtprotoRepoStrongRef: 'com.atproto.repo.strongRef', 2109 ComAtprotoRepoUploadBlob: 'com.atproto.repo.uploadBlob', 2110 PubLeafletBlocksBlockquote: 'pub.leaflet.blocks.blockquote', 2111 PubLeafletBlocksBskyPost: 'pub.leaflet.blocks.bskyPost', 2112 PubLeafletBlocksButton: 'pub.leaflet.blocks.button', 2113 PubLeafletBlocksCode: 'pub.leaflet.blocks.code', 2114 PubLeafletBlocksHeader: 'pub.leaflet.blocks.header', 2115 PubLeafletBlocksHorizontalRule: 'pub.leaflet.blocks.horizontalRule', 2116 PubLeafletBlocksIframe: 'pub.leaflet.blocks.iframe', 2117 PubLeafletBlocksImage: 'pub.leaflet.blocks.image', 2118 PubLeafletBlocksMath: 'pub.leaflet.blocks.math', 2119 PubLeafletBlocksPage: 'pub.leaflet.blocks.page', 2120 PubLeafletBlocksPoll: 'pub.leaflet.blocks.poll', 2121 PubLeafletBlocksText: 'pub.leaflet.blocks.text', 2122 PubLeafletBlocksUnorderedList: 'pub.leaflet.blocks.unorderedList', 2123 PubLeafletBlocksWebsite: 'pub.leaflet.blocks.website', 2124 PubLeafletComment: 'pub.leaflet.comment', 2125 PubLeafletDocument: 'pub.leaflet.document', 2126 PubLeafletGraphSubscription: 'pub.leaflet.graph.subscription', 2127 PubLeafletPagesCanvas: 'pub.leaflet.pages.canvas', 2128 PubLeafletPagesLinearDocument: 'pub.leaflet.pages.linearDocument', 2129 PubLeafletPollDefinition: 'pub.leaflet.poll.definition', 2130 PubLeafletPollVote: 'pub.leaflet.poll.vote', 2131 PubLeafletPublication: 'pub.leaflet.publication', 2132 PubLeafletRichtextFacet: 'pub.leaflet.richtext.facet', 2133 PubLeafletThemeBackgroundImage: 'pub.leaflet.theme.backgroundImage', 2134 PubLeafletThemeColor: 'pub.leaflet.theme.color', 2135} as const