a tool for shared writing and social publishing
at update/delete-blocks 2434 lines 66 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 tags: { 1473 type: 'array', 1474 items: { 1475 type: 'string', 1476 maxLength: 50, 1477 }, 1478 }, 1479 coverImage: { 1480 type: 'blob', 1481 accept: ['image/png', 'image/jpeg', 'image/webp'], 1482 maxSize: 1000000, 1483 }, 1484 pages: { 1485 type: 'array', 1486 items: { 1487 type: 'union', 1488 refs: [ 1489 'lex:pub.leaflet.pages.linearDocument', 1490 'lex:pub.leaflet.pages.canvas', 1491 ], 1492 }, 1493 }, 1494 }, 1495 }, 1496 }, 1497 }, 1498 }, 1499 PubLeafletGraphSubscription: { 1500 lexicon: 1, 1501 id: 'pub.leaflet.graph.subscription', 1502 defs: { 1503 main: { 1504 type: 'record', 1505 key: 'tid', 1506 description: 'Record declaring a subscription to a publication', 1507 record: { 1508 type: 'object', 1509 required: ['publication'], 1510 properties: { 1511 publication: { 1512 type: 'string', 1513 format: 'at-uri', 1514 }, 1515 }, 1516 }, 1517 }, 1518 }, 1519 }, 1520 PubLeafletPagesCanvas: { 1521 lexicon: 1, 1522 id: 'pub.leaflet.pages.canvas', 1523 defs: { 1524 main: { 1525 type: 'object', 1526 required: ['blocks'], 1527 properties: { 1528 id: { 1529 type: 'string', 1530 }, 1531 blocks: { 1532 type: 'array', 1533 items: { 1534 type: 'ref', 1535 ref: 'lex:pub.leaflet.pages.canvas#block', 1536 }, 1537 }, 1538 }, 1539 }, 1540 block: { 1541 type: 'object', 1542 required: ['block', 'x', 'y', 'width'], 1543 properties: { 1544 block: { 1545 type: 'union', 1546 refs: [ 1547 'lex:pub.leaflet.blocks.iframe', 1548 'lex:pub.leaflet.blocks.text', 1549 'lex:pub.leaflet.blocks.blockquote', 1550 'lex:pub.leaflet.blocks.header', 1551 'lex:pub.leaflet.blocks.image', 1552 'lex:pub.leaflet.blocks.unorderedList', 1553 'lex:pub.leaflet.blocks.website', 1554 'lex:pub.leaflet.blocks.math', 1555 'lex:pub.leaflet.blocks.code', 1556 'lex:pub.leaflet.blocks.horizontalRule', 1557 'lex:pub.leaflet.blocks.bskyPost', 1558 'lex:pub.leaflet.blocks.page', 1559 'lex:pub.leaflet.blocks.poll', 1560 'lex:pub.leaflet.blocks.button', 1561 ], 1562 }, 1563 x: { 1564 type: 'integer', 1565 }, 1566 y: { 1567 type: 'integer', 1568 }, 1569 width: { 1570 type: 'integer', 1571 }, 1572 height: { 1573 type: 'integer', 1574 }, 1575 rotation: { 1576 type: 'integer', 1577 description: 'The rotation of the block in degrees', 1578 }, 1579 }, 1580 }, 1581 textAlignLeft: { 1582 type: 'token', 1583 }, 1584 textAlignCenter: { 1585 type: 'token', 1586 }, 1587 textAlignRight: { 1588 type: 'token', 1589 }, 1590 quote: { 1591 type: 'object', 1592 required: ['start', 'end'], 1593 properties: { 1594 start: { 1595 type: 'ref', 1596 ref: 'lex:pub.leaflet.pages.canvas#position', 1597 }, 1598 end: { 1599 type: 'ref', 1600 ref: 'lex:pub.leaflet.pages.canvas#position', 1601 }, 1602 }, 1603 }, 1604 position: { 1605 type: 'object', 1606 required: ['block', 'offset'], 1607 properties: { 1608 block: { 1609 type: 'array', 1610 items: { 1611 type: 'integer', 1612 }, 1613 }, 1614 offset: { 1615 type: 'integer', 1616 }, 1617 }, 1618 }, 1619 }, 1620 }, 1621 PubLeafletPagesLinearDocument: { 1622 lexicon: 1, 1623 id: 'pub.leaflet.pages.linearDocument', 1624 defs: { 1625 main: { 1626 type: 'object', 1627 required: ['blocks'], 1628 properties: { 1629 id: { 1630 type: 'string', 1631 }, 1632 blocks: { 1633 type: 'array', 1634 items: { 1635 type: 'ref', 1636 ref: 'lex:pub.leaflet.pages.linearDocument#block', 1637 }, 1638 }, 1639 }, 1640 }, 1641 block: { 1642 type: 'object', 1643 required: ['block'], 1644 properties: { 1645 block: { 1646 type: 'union', 1647 refs: [ 1648 'lex:pub.leaflet.blocks.iframe', 1649 'lex:pub.leaflet.blocks.text', 1650 'lex:pub.leaflet.blocks.blockquote', 1651 'lex:pub.leaflet.blocks.header', 1652 'lex:pub.leaflet.blocks.image', 1653 'lex:pub.leaflet.blocks.unorderedList', 1654 'lex:pub.leaflet.blocks.website', 1655 'lex:pub.leaflet.blocks.math', 1656 'lex:pub.leaflet.blocks.code', 1657 'lex:pub.leaflet.blocks.horizontalRule', 1658 'lex:pub.leaflet.blocks.bskyPost', 1659 'lex:pub.leaflet.blocks.page', 1660 'lex:pub.leaflet.blocks.poll', 1661 'lex:pub.leaflet.blocks.button', 1662 ], 1663 }, 1664 alignment: { 1665 type: 'string', 1666 knownValues: [ 1667 'lex:pub.leaflet.pages.linearDocument#textAlignLeft', 1668 'lex:pub.leaflet.pages.linearDocument#textAlignCenter', 1669 'lex:pub.leaflet.pages.linearDocument#textAlignRight', 1670 'lex:pub.leaflet.pages.linearDocument#textAlignJustify', 1671 ], 1672 }, 1673 }, 1674 }, 1675 textAlignLeft: { 1676 type: 'token', 1677 }, 1678 textAlignCenter: { 1679 type: 'token', 1680 }, 1681 textAlignRight: { 1682 type: 'token', 1683 }, 1684 textAlignJustify: { 1685 type: 'token', 1686 }, 1687 quote: { 1688 type: 'object', 1689 required: ['start', 'end'], 1690 properties: { 1691 start: { 1692 type: 'ref', 1693 ref: 'lex:pub.leaflet.pages.linearDocument#position', 1694 }, 1695 end: { 1696 type: 'ref', 1697 ref: 'lex:pub.leaflet.pages.linearDocument#position', 1698 }, 1699 }, 1700 }, 1701 position: { 1702 type: 'object', 1703 required: ['block', 'offset'], 1704 properties: { 1705 block: { 1706 type: 'array', 1707 items: { 1708 type: 'integer', 1709 }, 1710 }, 1711 offset: { 1712 type: 'integer', 1713 }, 1714 }, 1715 }, 1716 }, 1717 }, 1718 PubLeafletPollDefinition: { 1719 lexicon: 1, 1720 id: 'pub.leaflet.poll.definition', 1721 defs: { 1722 main: { 1723 type: 'record', 1724 key: 'tid', 1725 description: 'Record declaring a poll', 1726 record: { 1727 type: 'object', 1728 required: ['name', 'options'], 1729 properties: { 1730 name: { 1731 type: 'string', 1732 maxLength: 500, 1733 maxGraphemes: 100, 1734 }, 1735 options: { 1736 type: 'array', 1737 items: { 1738 type: 'ref', 1739 ref: 'lex:pub.leaflet.poll.definition#option', 1740 }, 1741 }, 1742 endDate: { 1743 type: 'string', 1744 format: 'datetime', 1745 }, 1746 }, 1747 }, 1748 }, 1749 option: { 1750 type: 'object', 1751 properties: { 1752 text: { 1753 type: 'string', 1754 maxLength: 500, 1755 maxGraphemes: 50, 1756 }, 1757 }, 1758 }, 1759 }, 1760 }, 1761 PubLeafletPollVote: { 1762 lexicon: 1, 1763 id: 'pub.leaflet.poll.vote', 1764 defs: { 1765 main: { 1766 type: 'record', 1767 key: 'tid', 1768 description: 'Record declaring a vote on a poll', 1769 record: { 1770 type: 'object', 1771 required: ['poll', 'option'], 1772 properties: { 1773 poll: { 1774 type: 'ref', 1775 ref: 'lex:com.atproto.repo.strongRef', 1776 }, 1777 option: { 1778 type: 'array', 1779 items: { 1780 type: 'string', 1781 }, 1782 }, 1783 }, 1784 }, 1785 }, 1786 }, 1787 }, 1788 PubLeafletPublication: { 1789 lexicon: 1, 1790 id: 'pub.leaflet.publication', 1791 defs: { 1792 main: { 1793 type: 'record', 1794 key: 'tid', 1795 description: 'Record declaring a publication', 1796 record: { 1797 type: 'object', 1798 required: ['name'], 1799 properties: { 1800 name: { 1801 type: 'string', 1802 maxLength: 2000, 1803 }, 1804 base_path: { 1805 type: 'string', 1806 }, 1807 description: { 1808 type: 'string', 1809 maxLength: 2000, 1810 }, 1811 icon: { 1812 type: 'blob', 1813 accept: ['image/*'], 1814 maxSize: 1000000, 1815 }, 1816 theme: { 1817 type: 'ref', 1818 ref: 'lex:pub.leaflet.publication#theme', 1819 }, 1820 preferences: { 1821 type: 'ref', 1822 ref: 'lex:pub.leaflet.publication#preferences', 1823 }, 1824 }, 1825 }, 1826 }, 1827 preferences: { 1828 type: 'object', 1829 properties: { 1830 showInDiscover: { 1831 type: 'boolean', 1832 default: true, 1833 }, 1834 showComments: { 1835 type: 'boolean', 1836 default: true, 1837 }, 1838 showMentions: { 1839 type: 'boolean', 1840 default: true, 1841 }, 1842 showPrevNext: { 1843 type: 'boolean', 1844 default: true, 1845 }, 1846 }, 1847 }, 1848 theme: { 1849 type: 'object', 1850 properties: { 1851 backgroundColor: { 1852 type: 'union', 1853 refs: [ 1854 'lex:pub.leaflet.theme.color#rgba', 1855 'lex:pub.leaflet.theme.color#rgb', 1856 ], 1857 }, 1858 backgroundImage: { 1859 type: 'ref', 1860 ref: 'lex:pub.leaflet.theme.backgroundImage', 1861 }, 1862 pageWidth: { 1863 type: 'integer', 1864 minimum: 0, 1865 maximum: 1600, 1866 }, 1867 primary: { 1868 type: 'union', 1869 refs: [ 1870 'lex:pub.leaflet.theme.color#rgba', 1871 'lex:pub.leaflet.theme.color#rgb', 1872 ], 1873 }, 1874 pageBackground: { 1875 type: 'union', 1876 refs: [ 1877 'lex:pub.leaflet.theme.color#rgba', 1878 'lex:pub.leaflet.theme.color#rgb', 1879 ], 1880 }, 1881 showPageBackground: { 1882 type: 'boolean', 1883 default: false, 1884 }, 1885 accentBackground: { 1886 type: 'union', 1887 refs: [ 1888 'lex:pub.leaflet.theme.color#rgba', 1889 'lex:pub.leaflet.theme.color#rgb', 1890 ], 1891 }, 1892 accentText: { 1893 type: 'union', 1894 refs: [ 1895 'lex:pub.leaflet.theme.color#rgba', 1896 'lex:pub.leaflet.theme.color#rgb', 1897 ], 1898 }, 1899 }, 1900 }, 1901 }, 1902 }, 1903 PubLeafletRichtextFacet: { 1904 lexicon: 1, 1905 id: 'pub.leaflet.richtext.facet', 1906 defs: { 1907 main: { 1908 type: 'object', 1909 description: 'Annotation of a sub-string within rich text.', 1910 required: ['index', 'features'], 1911 properties: { 1912 index: { 1913 type: 'ref', 1914 ref: 'lex:pub.leaflet.richtext.facet#byteSlice', 1915 }, 1916 features: { 1917 type: 'array', 1918 items: { 1919 type: 'union', 1920 refs: [ 1921 'lex:pub.leaflet.richtext.facet#link', 1922 'lex:pub.leaflet.richtext.facet#didMention', 1923 'lex:pub.leaflet.richtext.facet#atMention', 1924 'lex:pub.leaflet.richtext.facet#code', 1925 'lex:pub.leaflet.richtext.facet#highlight', 1926 'lex:pub.leaflet.richtext.facet#underline', 1927 'lex:pub.leaflet.richtext.facet#strikethrough', 1928 'lex:pub.leaflet.richtext.facet#id', 1929 'lex:pub.leaflet.richtext.facet#bold', 1930 'lex:pub.leaflet.richtext.facet#italic', 1931 ], 1932 }, 1933 }, 1934 }, 1935 }, 1936 byteSlice: { 1937 type: 'object', 1938 description: 1939 '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.', 1940 required: ['byteStart', 'byteEnd'], 1941 properties: { 1942 byteStart: { 1943 type: 'integer', 1944 minimum: 0, 1945 }, 1946 byteEnd: { 1947 type: 'integer', 1948 minimum: 0, 1949 }, 1950 }, 1951 }, 1952 link: { 1953 type: 'object', 1954 description: 1955 'Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.', 1956 required: ['uri'], 1957 properties: { 1958 uri: { 1959 type: 'string', 1960 }, 1961 }, 1962 }, 1963 didMention: { 1964 type: 'object', 1965 description: 'Facet feature for mentioning a did.', 1966 required: ['did'], 1967 properties: { 1968 did: { 1969 type: 'string', 1970 format: 'did', 1971 }, 1972 }, 1973 }, 1974 atMention: { 1975 type: 'object', 1976 description: 'Facet feature for mentioning an AT URI.', 1977 required: ['atURI'], 1978 properties: { 1979 atURI: { 1980 type: 'string', 1981 format: 'uri', 1982 }, 1983 }, 1984 }, 1985 code: { 1986 type: 'object', 1987 description: 'Facet feature for inline code.', 1988 required: [], 1989 properties: {}, 1990 }, 1991 highlight: { 1992 type: 'object', 1993 description: 'Facet feature for highlighted text.', 1994 required: [], 1995 properties: {}, 1996 }, 1997 underline: { 1998 type: 'object', 1999 description: 'Facet feature for underline markup', 2000 required: [], 2001 properties: {}, 2002 }, 2003 strikethrough: { 2004 type: 'object', 2005 description: 'Facet feature for strikethrough markup', 2006 required: [], 2007 properties: {}, 2008 }, 2009 id: { 2010 type: 'object', 2011 description: 2012 'Facet feature for an identifier. Used for linking to a segment', 2013 required: [], 2014 properties: { 2015 id: { 2016 type: 'string', 2017 }, 2018 }, 2019 }, 2020 bold: { 2021 type: 'object', 2022 description: 'Facet feature for bold text', 2023 required: [], 2024 properties: {}, 2025 }, 2026 italic: { 2027 type: 'object', 2028 description: 'Facet feature for italic text', 2029 required: [], 2030 properties: {}, 2031 }, 2032 }, 2033 }, 2034 PubLeafletThemeBackgroundImage: { 2035 lexicon: 1, 2036 id: 'pub.leaflet.theme.backgroundImage', 2037 defs: { 2038 main: { 2039 type: 'object', 2040 required: ['image'], 2041 properties: { 2042 image: { 2043 type: 'blob', 2044 accept: ['image/*'], 2045 maxSize: 1000000, 2046 }, 2047 width: { 2048 type: 'integer', 2049 }, 2050 repeat: { 2051 type: 'boolean', 2052 }, 2053 }, 2054 }, 2055 }, 2056 }, 2057 PubLeafletThemeColor: { 2058 lexicon: 1, 2059 id: 'pub.leaflet.theme.color', 2060 defs: { 2061 rgba: { 2062 type: 'object', 2063 required: ['r', 'g', 'b', 'a'], 2064 properties: { 2065 r: { 2066 type: 'integer', 2067 maximum: 255, 2068 minimum: 0, 2069 }, 2070 g: { 2071 type: 'integer', 2072 maximum: 255, 2073 minimum: 0, 2074 }, 2075 b: { 2076 type: 'integer', 2077 maximum: 255, 2078 minimum: 0, 2079 }, 2080 a: { 2081 type: 'integer', 2082 maximum: 100, 2083 minimum: 0, 2084 }, 2085 }, 2086 }, 2087 rgb: { 2088 type: 'object', 2089 required: ['r', 'g', 'b'], 2090 properties: { 2091 r: { 2092 type: 'integer', 2093 maximum: 255, 2094 minimum: 0, 2095 }, 2096 g: { 2097 type: 'integer', 2098 maximum: 255, 2099 minimum: 0, 2100 }, 2101 b: { 2102 type: 'integer', 2103 maximum: 255, 2104 minimum: 0, 2105 }, 2106 }, 2107 }, 2108 }, 2109 }, 2110 SiteStandardDocument: { 2111 defs: { 2112 main: { 2113 key: 'tid', 2114 record: { 2115 properties: { 2116 bskyPostRef: { 2117 ref: 'lex:com.atproto.repo.strongRef', 2118 type: 'ref', 2119 }, 2120 content: { 2121 closed: false, 2122 refs: ['lex:pub.leaflet.content'], 2123 type: 'union', 2124 }, 2125 coverImage: { 2126 accept: ['image/*'], 2127 maxSize: 1000000, 2128 type: 'blob', 2129 }, 2130 description: { 2131 maxGraphemes: 3000, 2132 maxLength: 30000, 2133 type: 'string', 2134 }, 2135 path: { 2136 description: 2137 'combine with the publication url or the document site to construct a full url to the document', 2138 type: 'string', 2139 }, 2140 publishedAt: { 2141 format: 'datetime', 2142 type: 'string', 2143 }, 2144 site: { 2145 description: 2146 '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.', 2147 format: 'uri', 2148 type: 'string', 2149 }, 2150 tags: { 2151 items: { 2152 maxGraphemes: 50, 2153 maxLength: 100, 2154 type: 'string', 2155 }, 2156 type: 'array', 2157 }, 2158 textContent: { 2159 type: 'string', 2160 }, 2161 theme: { 2162 description: 2163 'Theme for standalone documents. For documents in publications, theme is inherited from the publication.', 2164 ref: 'lex:pub.leaflet.publication#theme', 2165 type: 'ref', 2166 }, 2167 title: { 2168 maxGraphemes: 500, 2169 maxLength: 5000, 2170 type: 'string', 2171 }, 2172 updatedAt: { 2173 format: 'datetime', 2174 type: 'string', 2175 }, 2176 }, 2177 required: ['site', 'title', 'publishedAt'], 2178 type: 'object', 2179 }, 2180 type: 'record', 2181 }, 2182 }, 2183 id: 'site.standard.document', 2184 lexicon: 1, 2185 }, 2186 SiteStandardGraphSubscription: { 2187 defs: { 2188 main: { 2189 description: 'Record declaring a subscription to a publication', 2190 key: 'tid', 2191 record: { 2192 properties: { 2193 publication: { 2194 format: 'at-uri', 2195 type: 'string', 2196 }, 2197 }, 2198 required: ['publication'], 2199 type: 'object', 2200 }, 2201 type: 'record', 2202 }, 2203 }, 2204 id: 'site.standard.graph.subscription', 2205 lexicon: 1, 2206 }, 2207 SiteStandardPublication: { 2208 defs: { 2209 main: { 2210 key: 'tid', 2211 record: { 2212 properties: { 2213 basicTheme: { 2214 ref: 'lex:site.standard.theme.basic', 2215 type: 'ref', 2216 }, 2217 theme: { 2218 type: 'ref', 2219 ref: 'lex:pub.leaflet.publication#theme', 2220 }, 2221 description: { 2222 maxGraphemes: 300, 2223 maxLength: 3000, 2224 type: 'string', 2225 }, 2226 icon: { 2227 accept: ['image/*'], 2228 maxSize: 1000000, 2229 type: 'blob', 2230 }, 2231 name: { 2232 maxGraphemes: 128, 2233 maxLength: 1280, 2234 type: 'string', 2235 }, 2236 preferences: { 2237 ref: 'lex:site.standard.publication#preferences', 2238 type: 'ref', 2239 }, 2240 url: { 2241 format: 'uri', 2242 type: 'string', 2243 }, 2244 }, 2245 required: ['url', 'name'], 2246 type: 'object', 2247 }, 2248 type: 'record', 2249 }, 2250 preferences: { 2251 properties: { 2252 showInDiscover: { 2253 default: true, 2254 type: 'boolean', 2255 }, 2256 showComments: { 2257 default: true, 2258 type: 'boolean', 2259 }, 2260 showMentions: { 2261 default: true, 2262 type: 'boolean', 2263 }, 2264 showPrevNext: { 2265 default: false, 2266 type: 'boolean', 2267 }, 2268 }, 2269 type: 'object', 2270 }, 2271 }, 2272 id: 'site.standard.publication', 2273 lexicon: 1, 2274 }, 2275 SiteStandardThemeBasic: { 2276 defs: { 2277 main: { 2278 properties: { 2279 accent: { 2280 refs: ['lex:site.standard.theme.color#rgb'], 2281 type: 'union', 2282 }, 2283 accentForeground: { 2284 refs: ['lex:site.standard.theme.color#rgb'], 2285 type: 'union', 2286 }, 2287 background: { 2288 refs: ['lex:site.standard.theme.color#rgb'], 2289 type: 'union', 2290 }, 2291 foreground: { 2292 refs: ['lex:site.standard.theme.color#rgb'], 2293 type: 'union', 2294 }, 2295 }, 2296 required: ['background', 'foreground', 'accent', 'accentForeground'], 2297 type: 'object', 2298 }, 2299 }, 2300 id: 'site.standard.theme.basic', 2301 lexicon: 1, 2302 }, 2303 SiteStandardThemeColor: { 2304 lexicon: 1, 2305 id: 'site.standard.theme.color', 2306 defs: { 2307 rgb: { 2308 type: 'object', 2309 required: ['r', 'g', 'b'], 2310 properties: { 2311 r: { 2312 type: 'integer', 2313 minimum: 0, 2314 maximum: 255, 2315 }, 2316 g: { 2317 type: 'integer', 2318 minimum: 0, 2319 maximum: 255, 2320 }, 2321 b: { 2322 type: 'integer', 2323 minimum: 0, 2324 maximum: 255, 2325 }, 2326 }, 2327 }, 2328 rgba: { 2329 type: 'object', 2330 required: ['r', 'g', 'b', 'a'], 2331 properties: { 2332 r: { 2333 type: 'integer', 2334 minimum: 0, 2335 maximum: 255, 2336 }, 2337 g: { 2338 type: 'integer', 2339 minimum: 0, 2340 maximum: 255, 2341 }, 2342 b: { 2343 type: 'integer', 2344 minimum: 0, 2345 maximum: 255, 2346 }, 2347 a: { 2348 type: 'integer', 2349 minimum: 0, 2350 maximum: 100, 2351 }, 2352 }, 2353 }, 2354 }, 2355 }, 2356} as const satisfies Record<string, LexiconDoc> 2357export const schemas = Object.values(schemaDict) satisfies LexiconDoc[] 2358export const lexicons: Lexicons = new Lexicons(schemas) 2359 2360export function validate<T extends { $type: string }>( 2361 v: unknown, 2362 id: string, 2363 hash: string, 2364 requiredType: true, 2365): ValidationResult<T> 2366export function validate<T extends { $type?: string }>( 2367 v: unknown, 2368 id: string, 2369 hash: string, 2370 requiredType?: false, 2371): ValidationResult<T> 2372export function validate( 2373 v: unknown, 2374 id: string, 2375 hash: string, 2376 requiredType?: boolean, 2377): ValidationResult { 2378 return (requiredType ? is$typed : maybe$typed)(v, id, hash) 2379 ? lexicons.validate(`${id}#${hash}`, v) 2380 : { 2381 success: false, 2382 error: new ValidationError( 2383 `Must be an object with "${hash === 'main' ? id : `${id}#${hash}`}" $type property`, 2384 ), 2385 } 2386} 2387 2388export const ids = { 2389 AppBskyActorProfile: 'app.bsky.actor.profile', 2390 ComAtprotoLabelDefs: 'com.atproto.label.defs', 2391 ComAtprotoRepoApplyWrites: 'com.atproto.repo.applyWrites', 2392 ComAtprotoRepoCreateRecord: 'com.atproto.repo.createRecord', 2393 ComAtprotoRepoDefs: 'com.atproto.repo.defs', 2394 ComAtprotoRepoDeleteRecord: 'com.atproto.repo.deleteRecord', 2395 ComAtprotoRepoDescribeRepo: 'com.atproto.repo.describeRepo', 2396 ComAtprotoRepoGetRecord: 'com.atproto.repo.getRecord', 2397 ComAtprotoRepoImportRepo: 'com.atproto.repo.importRepo', 2398 ComAtprotoRepoListMissingBlobs: 'com.atproto.repo.listMissingBlobs', 2399 ComAtprotoRepoListRecords: 'com.atproto.repo.listRecords', 2400 ComAtprotoRepoPutRecord: 'com.atproto.repo.putRecord', 2401 ComAtprotoRepoStrongRef: 'com.atproto.repo.strongRef', 2402 ComAtprotoRepoUploadBlob: 'com.atproto.repo.uploadBlob', 2403 PubLeafletBlocksBlockquote: 'pub.leaflet.blocks.blockquote', 2404 PubLeafletBlocksBskyPost: 'pub.leaflet.blocks.bskyPost', 2405 PubLeafletBlocksButton: 'pub.leaflet.blocks.button', 2406 PubLeafletBlocksCode: 'pub.leaflet.blocks.code', 2407 PubLeafletBlocksHeader: 'pub.leaflet.blocks.header', 2408 PubLeafletBlocksHorizontalRule: 'pub.leaflet.blocks.horizontalRule', 2409 PubLeafletBlocksIframe: 'pub.leaflet.blocks.iframe', 2410 PubLeafletBlocksImage: 'pub.leaflet.blocks.image', 2411 PubLeafletBlocksMath: 'pub.leaflet.blocks.math', 2412 PubLeafletBlocksPage: 'pub.leaflet.blocks.page', 2413 PubLeafletBlocksPoll: 'pub.leaflet.blocks.poll', 2414 PubLeafletBlocksText: 'pub.leaflet.blocks.text', 2415 PubLeafletBlocksUnorderedList: 'pub.leaflet.blocks.unorderedList', 2416 PubLeafletBlocksWebsite: 'pub.leaflet.blocks.website', 2417 PubLeafletComment: 'pub.leaflet.comment', 2418 PubLeafletContent: 'pub.leaflet.content', 2419 PubLeafletDocument: 'pub.leaflet.document', 2420 PubLeafletGraphSubscription: 'pub.leaflet.graph.subscription', 2421 PubLeafletPagesCanvas: 'pub.leaflet.pages.canvas', 2422 PubLeafletPagesLinearDocument: 'pub.leaflet.pages.linearDocument', 2423 PubLeafletPollDefinition: 'pub.leaflet.poll.definition', 2424 PubLeafletPollVote: 'pub.leaflet.poll.vote', 2425 PubLeafletPublication: 'pub.leaflet.publication', 2426 PubLeafletRichtextFacet: 'pub.leaflet.richtext.facet', 2427 PubLeafletThemeBackgroundImage: 'pub.leaflet.theme.backgroundImage', 2428 PubLeafletThemeColor: 'pub.leaflet.theme.color', 2429 SiteStandardDocument: 'site.standard.document', 2430 SiteStandardGraphSubscription: 'site.standard.graph.subscription', 2431 SiteStandardPublication: 'site.standard.publication', 2432 SiteStandardThemeBasic: 'site.standard.theme.basic', 2433 SiteStandardThemeColor: 'site.standard.theme.color', 2434} as const