a tool for shared writing and social publishing
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 clientHost: {
1052 type: 'string',
1053 },
1054 },
1055 },
1056 },
1057 },
1058 PubLeafletBlocksButton: {
1059 lexicon: 1,
1060 id: 'pub.leaflet.blocks.button',
1061 defs: {
1062 main: {
1063 type: 'object',
1064 required: ['text', 'url'],
1065 properties: {
1066 text: {
1067 type: 'string',
1068 },
1069 url: {
1070 type: 'string',
1071 format: 'uri',
1072 },
1073 },
1074 },
1075 },
1076 },
1077 PubLeafletBlocksCode: {
1078 lexicon: 1,
1079 id: 'pub.leaflet.blocks.code',
1080 defs: {
1081 main: {
1082 type: 'object',
1083 required: ['plaintext'],
1084 properties: {
1085 plaintext: {
1086 type: 'string',
1087 },
1088 language: {
1089 type: 'string',
1090 },
1091 syntaxHighlightingTheme: {
1092 type: 'string',
1093 },
1094 },
1095 },
1096 },
1097 },
1098 PubLeafletBlocksHeader: {
1099 lexicon: 1,
1100 id: 'pub.leaflet.blocks.header',
1101 defs: {
1102 main: {
1103 type: 'object',
1104 required: ['plaintext'],
1105 properties: {
1106 level: {
1107 type: 'integer',
1108 minimum: 1,
1109 maximum: 6,
1110 },
1111 plaintext: {
1112 type: 'string',
1113 },
1114 facets: {
1115 type: 'array',
1116 items: {
1117 type: 'ref',
1118 ref: 'lex:pub.leaflet.richtext.facet',
1119 },
1120 },
1121 },
1122 },
1123 },
1124 },
1125 PubLeafletBlocksHorizontalRule: {
1126 lexicon: 1,
1127 id: 'pub.leaflet.blocks.horizontalRule',
1128 defs: {
1129 main: {
1130 type: 'object',
1131 required: [],
1132 properties: {},
1133 },
1134 },
1135 },
1136 PubLeafletBlocksIframe: {
1137 lexicon: 1,
1138 id: 'pub.leaflet.blocks.iframe',
1139 defs: {
1140 main: {
1141 type: 'object',
1142 required: ['url'],
1143 properties: {
1144 url: {
1145 type: 'string',
1146 format: 'uri',
1147 },
1148 height: {
1149 type: 'integer',
1150 minimum: 16,
1151 maximum: 1600,
1152 },
1153 },
1154 },
1155 },
1156 },
1157 PubLeafletBlocksImage: {
1158 lexicon: 1,
1159 id: 'pub.leaflet.blocks.image',
1160 defs: {
1161 main: {
1162 type: 'object',
1163 required: ['image', 'aspectRatio'],
1164 properties: {
1165 image: {
1166 type: 'blob',
1167 accept: ['image/*'],
1168 maxSize: 1000000,
1169 },
1170 alt: {
1171 type: 'string',
1172 description:
1173 'Alt text description of the image, for accessibility.',
1174 },
1175 aspectRatio: {
1176 type: 'ref',
1177 ref: 'lex:pub.leaflet.blocks.image#aspectRatio',
1178 },
1179 },
1180 },
1181 aspectRatio: {
1182 type: 'object',
1183 required: ['width', 'height'],
1184 properties: {
1185 width: {
1186 type: 'integer',
1187 },
1188 height: {
1189 type: 'integer',
1190 },
1191 },
1192 },
1193 },
1194 },
1195 PubLeafletBlocksMath: {
1196 lexicon: 1,
1197 id: 'pub.leaflet.blocks.math',
1198 defs: {
1199 main: {
1200 type: 'object',
1201 required: ['tex'],
1202 properties: {
1203 tex: {
1204 type: 'string',
1205 },
1206 },
1207 },
1208 },
1209 },
1210 PubLeafletBlocksOrderedList: {
1211 lexicon: 1,
1212 id: 'pub.leaflet.blocks.orderedList',
1213 defs: {
1214 main: {
1215 type: 'object',
1216 required: ['children'],
1217 properties: {
1218 startIndex: {
1219 type: 'integer',
1220 description:
1221 'The starting number for this ordered list. Defaults to 1 if not specified.',
1222 },
1223 children: {
1224 type: 'array',
1225 items: {
1226 type: 'ref',
1227 ref: 'lex:pub.leaflet.blocks.orderedList#listItem',
1228 },
1229 },
1230 },
1231 },
1232 listItem: {
1233 type: 'object',
1234 required: ['content'],
1235 properties: {
1236 content: {
1237 type: 'union',
1238 refs: [
1239 'lex:pub.leaflet.blocks.text',
1240 'lex:pub.leaflet.blocks.header',
1241 'lex:pub.leaflet.blocks.image',
1242 ],
1243 },
1244 children: {
1245 type: 'array',
1246 description:
1247 'Nested ordered list items. Mutually exclusive with unorderedListChildren; if both are present, children takes precedence.',
1248 items: {
1249 type: 'ref',
1250 ref: 'lex:pub.leaflet.blocks.orderedList#listItem',
1251 },
1252 },
1253 unorderedListChildren: {
1254 type: 'ref',
1255 description:
1256 'A nested unordered list. Mutually exclusive with children; if both are present, children takes precedence.',
1257 ref: 'lex:pub.leaflet.blocks.unorderedList',
1258 },
1259 },
1260 },
1261 },
1262 },
1263 PubLeafletBlocksPage: {
1264 lexicon: 1,
1265 id: 'pub.leaflet.blocks.page',
1266 defs: {
1267 main: {
1268 type: 'object',
1269 required: ['id'],
1270 properties: {
1271 id: {
1272 type: 'string',
1273 },
1274 },
1275 },
1276 },
1277 },
1278 PubLeafletBlocksPoll: {
1279 lexicon: 1,
1280 id: 'pub.leaflet.blocks.poll',
1281 defs: {
1282 main: {
1283 type: 'object',
1284 required: ['pollRef'],
1285 properties: {
1286 pollRef: {
1287 type: 'ref',
1288 ref: 'lex:com.atproto.repo.strongRef',
1289 },
1290 },
1291 },
1292 },
1293 },
1294 PubLeafletBlocksText: {
1295 lexicon: 1,
1296 id: 'pub.leaflet.blocks.text',
1297 defs: {
1298 main: {
1299 type: 'object',
1300 required: ['plaintext'],
1301 properties: {
1302 plaintext: {
1303 type: 'string',
1304 },
1305 textSize: {
1306 type: 'string',
1307 enum: ['default', 'small', 'large'],
1308 },
1309 facets: {
1310 type: 'array',
1311 items: {
1312 type: 'ref',
1313 ref: 'lex:pub.leaflet.richtext.facet',
1314 },
1315 },
1316 },
1317 },
1318 },
1319 },
1320 PubLeafletBlocksUnorderedList: {
1321 lexicon: 1,
1322 id: 'pub.leaflet.blocks.unorderedList',
1323 defs: {
1324 main: {
1325 type: 'object',
1326 required: ['children'],
1327 properties: {
1328 children: {
1329 type: 'array',
1330 items: {
1331 type: 'ref',
1332 ref: 'lex:pub.leaflet.blocks.unorderedList#listItem',
1333 },
1334 },
1335 },
1336 },
1337 listItem: {
1338 type: 'object',
1339 required: ['content'],
1340 properties: {
1341 content: {
1342 type: 'union',
1343 refs: [
1344 'lex:pub.leaflet.blocks.text',
1345 'lex:pub.leaflet.blocks.header',
1346 'lex:pub.leaflet.blocks.image',
1347 ],
1348 },
1349 children: {
1350 type: 'array',
1351 description:
1352 'Nested unordered list items. Mutually exclusive with orderedListChildren; if both are present, children takes precedence.',
1353 items: {
1354 type: 'ref',
1355 ref: 'lex:pub.leaflet.blocks.unorderedList#listItem',
1356 },
1357 },
1358 orderedListChildren: {
1359 type: 'ref',
1360 description:
1361 'Nested ordered list items. Mutually exclusive with children; if both are present, children takes precedence.',
1362 ref: 'lex:pub.leaflet.blocks.orderedList',
1363 },
1364 },
1365 },
1366 },
1367 },
1368 PubLeafletBlocksWebsite: {
1369 lexicon: 1,
1370 id: 'pub.leaflet.blocks.website',
1371 defs: {
1372 main: {
1373 type: 'object',
1374 required: ['src'],
1375 properties: {
1376 previewImage: {
1377 type: 'blob',
1378 accept: ['image/*'],
1379 maxSize: 1000000,
1380 },
1381 title: {
1382 type: 'string',
1383 },
1384 description: {
1385 type: 'string',
1386 },
1387 src: {
1388 type: 'string',
1389 format: 'uri',
1390 },
1391 },
1392 },
1393 },
1394 },
1395 PubLeafletComment: {
1396 lexicon: 1,
1397 id: 'pub.leaflet.comment',
1398 revision: 1,
1399 description: 'A lexicon for comments on documents',
1400 defs: {
1401 main: {
1402 type: 'record',
1403 key: 'tid',
1404 description: 'Record containing a comment',
1405 record: {
1406 type: 'object',
1407 required: ['subject', 'plaintext', 'createdAt'],
1408 properties: {
1409 subject: {
1410 type: 'string',
1411 format: 'at-uri',
1412 },
1413 createdAt: {
1414 type: 'string',
1415 format: 'datetime',
1416 },
1417 reply: {
1418 type: 'ref',
1419 ref: 'lex:pub.leaflet.comment#replyRef',
1420 },
1421 plaintext: {
1422 type: 'string',
1423 },
1424 facets: {
1425 type: 'array',
1426 items: {
1427 type: 'ref',
1428 ref: 'lex:pub.leaflet.richtext.facet',
1429 },
1430 },
1431 onPage: {
1432 type: 'string',
1433 },
1434 attachment: {
1435 type: 'union',
1436 refs: ['lex:pub.leaflet.comment#linearDocumentQuote'],
1437 },
1438 },
1439 },
1440 },
1441 linearDocumentQuote: {
1442 type: 'object',
1443 required: ['document', 'quote'],
1444 properties: {
1445 document: {
1446 type: 'string',
1447 format: 'at-uri',
1448 },
1449 quote: {
1450 type: 'ref',
1451 ref: 'lex:pub.leaflet.pages.linearDocument#quote',
1452 },
1453 },
1454 },
1455 replyRef: {
1456 type: 'object',
1457 required: ['parent'],
1458 properties: {
1459 parent: {
1460 type: 'string',
1461 format: 'at-uri',
1462 },
1463 },
1464 },
1465 },
1466 },
1467 PubLeafletContent: {
1468 lexicon: 1,
1469 id: 'pub.leaflet.content',
1470 revision: 1,
1471 description: 'A lexicon for long form rich media documents',
1472 defs: {
1473 main: {
1474 type: 'object',
1475 description: 'Content format for leaflet documents',
1476 required: ['pages'],
1477 properties: {
1478 pages: {
1479 type: 'array',
1480 items: {
1481 type: 'union',
1482 refs: [
1483 'lex:pub.leaflet.pages.linearDocument',
1484 'lex:pub.leaflet.pages.canvas',
1485 ],
1486 },
1487 },
1488 },
1489 },
1490 },
1491 },
1492 PubLeafletDocument: {
1493 lexicon: 1,
1494 id: 'pub.leaflet.document',
1495 revision: 1,
1496 description: 'A lexicon for long form rich media documents',
1497 defs: {
1498 main: {
1499 type: 'record',
1500 key: 'tid',
1501 description: 'Record containing a document',
1502 record: {
1503 type: 'object',
1504 required: ['pages', 'author', 'title'],
1505 properties: {
1506 title: {
1507 type: 'string',
1508 maxLength: 5000,
1509 maxGraphemes: 500,
1510 },
1511 postRef: {
1512 type: 'ref',
1513 ref: 'lex:com.atproto.repo.strongRef',
1514 },
1515 description: {
1516 type: 'string',
1517 maxLength: 30000,
1518 maxGraphemes: 3000,
1519 },
1520 publishedAt: {
1521 type: 'string',
1522 format: 'datetime',
1523 },
1524 publication: {
1525 type: 'string',
1526 format: 'at-uri',
1527 },
1528 author: {
1529 type: 'string',
1530 format: 'at-identifier',
1531 },
1532 theme: {
1533 type: 'ref',
1534 ref: 'lex:pub.leaflet.publication#theme',
1535 },
1536 preferences: {
1537 type: 'ref',
1538 ref: 'lex:pub.leaflet.publication#preferences',
1539 },
1540 tags: {
1541 type: 'array',
1542 items: {
1543 type: 'string',
1544 maxLength: 50,
1545 },
1546 },
1547 coverImage: {
1548 type: 'blob',
1549 accept: ['image/png', 'image/jpeg', 'image/webp'],
1550 maxSize: 1000000,
1551 },
1552 pages: {
1553 type: 'array',
1554 items: {
1555 type: 'union',
1556 refs: [
1557 'lex:pub.leaflet.pages.linearDocument',
1558 'lex:pub.leaflet.pages.canvas',
1559 ],
1560 },
1561 },
1562 },
1563 },
1564 },
1565 },
1566 },
1567 PubLeafletGraphSubscription: {
1568 lexicon: 1,
1569 id: 'pub.leaflet.graph.subscription',
1570 defs: {
1571 main: {
1572 type: 'record',
1573 key: 'tid',
1574 description: 'Record declaring a subscription to a publication',
1575 record: {
1576 type: 'object',
1577 required: ['publication'],
1578 properties: {
1579 publication: {
1580 type: 'string',
1581 format: 'at-uri',
1582 },
1583 },
1584 },
1585 },
1586 },
1587 },
1588 PubLeafletInteractionsRecommend: {
1589 lexicon: 1,
1590 id: 'pub.leaflet.interactions.recommend',
1591 defs: {
1592 main: {
1593 type: 'record',
1594 key: 'tid',
1595 description: 'Record representing a recommend on a document',
1596 record: {
1597 type: 'object',
1598 required: ['subject', 'createdAt'],
1599 properties: {
1600 subject: {
1601 type: 'string',
1602 format: 'at-uri',
1603 },
1604 createdAt: {
1605 type: 'string',
1606 format: 'datetime',
1607 },
1608 },
1609 },
1610 },
1611 },
1612 },
1613 PubLeafletPagesCanvas: {
1614 lexicon: 1,
1615 id: 'pub.leaflet.pages.canvas',
1616 defs: {
1617 main: {
1618 type: 'object',
1619 required: ['blocks'],
1620 properties: {
1621 id: {
1622 type: 'string',
1623 },
1624 blocks: {
1625 type: 'array',
1626 items: {
1627 type: 'ref',
1628 ref: 'lex:pub.leaflet.pages.canvas#block',
1629 },
1630 },
1631 },
1632 },
1633 block: {
1634 type: 'object',
1635 required: ['block', 'x', 'y', 'width'],
1636 properties: {
1637 block: {
1638 type: 'union',
1639 refs: [
1640 'lex:pub.leaflet.blocks.iframe',
1641 'lex:pub.leaflet.blocks.text',
1642 'lex:pub.leaflet.blocks.blockquote',
1643 'lex:pub.leaflet.blocks.header',
1644 'lex:pub.leaflet.blocks.image',
1645 'lex:pub.leaflet.blocks.unorderedList',
1646 'lex:pub.leaflet.blocks.orderedList',
1647 'lex:pub.leaflet.blocks.website',
1648 'lex:pub.leaflet.blocks.math',
1649 'lex:pub.leaflet.blocks.code',
1650 'lex:pub.leaflet.blocks.horizontalRule',
1651 'lex:pub.leaflet.blocks.bskyPost',
1652 'lex:pub.leaflet.blocks.page',
1653 'lex:pub.leaflet.blocks.poll',
1654 'lex:pub.leaflet.blocks.button',
1655 ],
1656 },
1657 x: {
1658 type: 'integer',
1659 },
1660 y: {
1661 type: 'integer',
1662 },
1663 width: {
1664 type: 'integer',
1665 },
1666 height: {
1667 type: 'integer',
1668 },
1669 rotation: {
1670 type: 'integer',
1671 description: 'The rotation of the block in degrees',
1672 },
1673 },
1674 },
1675 textAlignLeft: {
1676 type: 'token',
1677 },
1678 textAlignCenter: {
1679 type: 'token',
1680 },
1681 textAlignRight: {
1682 type: 'token',
1683 },
1684 quote: {
1685 type: 'object',
1686 required: ['start', 'end'],
1687 properties: {
1688 start: {
1689 type: 'ref',
1690 ref: 'lex:pub.leaflet.pages.canvas#position',
1691 },
1692 end: {
1693 type: 'ref',
1694 ref: 'lex:pub.leaflet.pages.canvas#position',
1695 },
1696 },
1697 },
1698 position: {
1699 type: 'object',
1700 required: ['block', 'offset'],
1701 properties: {
1702 block: {
1703 type: 'array',
1704 items: {
1705 type: 'integer',
1706 },
1707 },
1708 offset: {
1709 type: 'integer',
1710 },
1711 },
1712 },
1713 },
1714 },
1715 PubLeafletPagesLinearDocument: {
1716 lexicon: 1,
1717 id: 'pub.leaflet.pages.linearDocument',
1718 defs: {
1719 main: {
1720 type: 'object',
1721 required: ['blocks'],
1722 properties: {
1723 id: {
1724 type: 'string',
1725 },
1726 blocks: {
1727 type: 'array',
1728 items: {
1729 type: 'ref',
1730 ref: 'lex:pub.leaflet.pages.linearDocument#block',
1731 },
1732 },
1733 },
1734 },
1735 block: {
1736 type: 'object',
1737 required: ['block'],
1738 properties: {
1739 block: {
1740 type: 'union',
1741 refs: [
1742 'lex:pub.leaflet.blocks.iframe',
1743 'lex:pub.leaflet.blocks.text',
1744 'lex:pub.leaflet.blocks.blockquote',
1745 'lex:pub.leaflet.blocks.header',
1746 'lex:pub.leaflet.blocks.image',
1747 'lex:pub.leaflet.blocks.unorderedList',
1748 'lex:pub.leaflet.blocks.orderedList',
1749 'lex:pub.leaflet.blocks.website',
1750 'lex:pub.leaflet.blocks.math',
1751 'lex:pub.leaflet.blocks.code',
1752 'lex:pub.leaflet.blocks.horizontalRule',
1753 'lex:pub.leaflet.blocks.bskyPost',
1754 'lex:pub.leaflet.blocks.page',
1755 'lex:pub.leaflet.blocks.poll',
1756 'lex:pub.leaflet.blocks.button',
1757 ],
1758 },
1759 alignment: {
1760 type: 'string',
1761 knownValues: [
1762 'lex:pub.leaflet.pages.linearDocument#textAlignLeft',
1763 'lex:pub.leaflet.pages.linearDocument#textAlignCenter',
1764 'lex:pub.leaflet.pages.linearDocument#textAlignRight',
1765 'lex:pub.leaflet.pages.linearDocument#textAlignJustify',
1766 ],
1767 },
1768 },
1769 },
1770 textAlignLeft: {
1771 type: 'token',
1772 },
1773 textAlignCenter: {
1774 type: 'token',
1775 },
1776 textAlignRight: {
1777 type: 'token',
1778 },
1779 textAlignJustify: {
1780 type: 'token',
1781 },
1782 quote: {
1783 type: 'object',
1784 required: ['start', 'end'],
1785 properties: {
1786 start: {
1787 type: 'ref',
1788 ref: 'lex:pub.leaflet.pages.linearDocument#position',
1789 },
1790 end: {
1791 type: 'ref',
1792 ref: 'lex:pub.leaflet.pages.linearDocument#position',
1793 },
1794 },
1795 },
1796 position: {
1797 type: 'object',
1798 required: ['block', 'offset'],
1799 properties: {
1800 block: {
1801 type: 'array',
1802 items: {
1803 type: 'integer',
1804 },
1805 },
1806 offset: {
1807 type: 'integer',
1808 },
1809 },
1810 },
1811 },
1812 },
1813 PubLeafletPollDefinition: {
1814 lexicon: 1,
1815 id: 'pub.leaflet.poll.definition',
1816 defs: {
1817 main: {
1818 type: 'record',
1819 key: 'tid',
1820 description: 'Record declaring a poll',
1821 record: {
1822 type: 'object',
1823 required: ['name', 'options'],
1824 properties: {
1825 name: {
1826 type: 'string',
1827 maxLength: 500,
1828 maxGraphemes: 100,
1829 },
1830 options: {
1831 type: 'array',
1832 items: {
1833 type: 'ref',
1834 ref: 'lex:pub.leaflet.poll.definition#option',
1835 },
1836 },
1837 endDate: {
1838 type: 'string',
1839 format: 'datetime',
1840 },
1841 },
1842 },
1843 },
1844 option: {
1845 type: 'object',
1846 properties: {
1847 text: {
1848 type: 'string',
1849 maxLength: 500,
1850 maxGraphemes: 50,
1851 },
1852 },
1853 },
1854 },
1855 },
1856 PubLeafletPollVote: {
1857 lexicon: 1,
1858 id: 'pub.leaflet.poll.vote',
1859 defs: {
1860 main: {
1861 type: 'record',
1862 key: 'tid',
1863 description: 'Record declaring a vote on a poll',
1864 record: {
1865 type: 'object',
1866 required: ['poll', 'option'],
1867 properties: {
1868 poll: {
1869 type: 'ref',
1870 ref: 'lex:com.atproto.repo.strongRef',
1871 },
1872 option: {
1873 type: 'array',
1874 items: {
1875 type: 'string',
1876 },
1877 },
1878 },
1879 },
1880 },
1881 },
1882 },
1883 PubLeafletPublication: {
1884 lexicon: 1,
1885 id: 'pub.leaflet.publication',
1886 defs: {
1887 main: {
1888 type: 'record',
1889 key: 'tid',
1890 description: 'Record declaring a publication',
1891 record: {
1892 type: 'object',
1893 required: ['name'],
1894 properties: {
1895 name: {
1896 type: 'string',
1897 maxLength: 2000,
1898 },
1899 base_path: {
1900 type: 'string',
1901 },
1902 description: {
1903 type: 'string',
1904 maxLength: 2000,
1905 },
1906 icon: {
1907 type: 'blob',
1908 accept: ['image/*'],
1909 maxSize: 1000000,
1910 },
1911 theme: {
1912 type: 'ref',
1913 ref: 'lex:pub.leaflet.publication#theme',
1914 },
1915 preferences: {
1916 type: 'ref',
1917 ref: 'lex:pub.leaflet.publication#preferences',
1918 },
1919 },
1920 },
1921 },
1922 preferences: {
1923 type: 'object',
1924 properties: {
1925 showInDiscover: {
1926 type: 'boolean',
1927 default: true,
1928 },
1929 showComments: {
1930 type: 'boolean',
1931 default: true,
1932 },
1933 showMentions: {
1934 type: 'boolean',
1935 default: true,
1936 },
1937 showPrevNext: {
1938 type: 'boolean',
1939 default: true,
1940 },
1941 showRecommends: {
1942 type: 'boolean',
1943 default: true,
1944 },
1945 },
1946 },
1947 theme: {
1948 type: 'object',
1949 properties: {
1950 backgroundColor: {
1951 type: 'union',
1952 refs: [
1953 'lex:pub.leaflet.theme.color#rgba',
1954 'lex:pub.leaflet.theme.color#rgb',
1955 ],
1956 },
1957 backgroundImage: {
1958 type: 'ref',
1959 ref: 'lex:pub.leaflet.theme.backgroundImage',
1960 },
1961 pageWidth: {
1962 type: 'integer',
1963 minimum: 0,
1964 maximum: 1600,
1965 },
1966 primary: {
1967 type: 'union',
1968 refs: [
1969 'lex:pub.leaflet.theme.color#rgba',
1970 'lex:pub.leaflet.theme.color#rgb',
1971 ],
1972 },
1973 pageBackground: {
1974 type: 'union',
1975 refs: [
1976 'lex:pub.leaflet.theme.color#rgba',
1977 'lex:pub.leaflet.theme.color#rgb',
1978 ],
1979 },
1980 showPageBackground: {
1981 type: 'boolean',
1982 default: false,
1983 },
1984 accentBackground: {
1985 type: 'union',
1986 refs: [
1987 'lex:pub.leaflet.theme.color#rgba',
1988 'lex:pub.leaflet.theme.color#rgb',
1989 ],
1990 },
1991 accentText: {
1992 type: 'union',
1993 refs: [
1994 'lex:pub.leaflet.theme.color#rgba',
1995 'lex:pub.leaflet.theme.color#rgb',
1996 ],
1997 },
1998 headingFont: {
1999 type: 'string',
2000 maxLength: 100,
2001 },
2002 bodyFont: {
2003 type: 'string',
2004 maxLength: 100,
2005 },
2006 },
2007 },
2008 },
2009 },
2010 PubLeafletRichtextFacet: {
2011 lexicon: 1,
2012 id: 'pub.leaflet.richtext.facet',
2013 defs: {
2014 main: {
2015 type: 'object',
2016 description: 'Annotation of a sub-string within rich text.',
2017 required: ['index', 'features'],
2018 properties: {
2019 index: {
2020 type: 'ref',
2021 ref: 'lex:pub.leaflet.richtext.facet#byteSlice',
2022 },
2023 features: {
2024 type: 'array',
2025 items: {
2026 type: 'union',
2027 refs: [
2028 'lex:pub.leaflet.richtext.facet#link',
2029 'lex:pub.leaflet.richtext.facet#didMention',
2030 'lex:pub.leaflet.richtext.facet#atMention',
2031 'lex:pub.leaflet.richtext.facet#code',
2032 'lex:pub.leaflet.richtext.facet#highlight',
2033 'lex:pub.leaflet.richtext.facet#underline',
2034 'lex:pub.leaflet.richtext.facet#strikethrough',
2035 'lex:pub.leaflet.richtext.facet#id',
2036 'lex:pub.leaflet.richtext.facet#bold',
2037 'lex:pub.leaflet.richtext.facet#italic',
2038 'lex:pub.leaflet.richtext.facet#footnote',
2039 ],
2040 },
2041 },
2042 },
2043 },
2044 byteSlice: {
2045 type: 'object',
2046 description:
2047 '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.',
2048 required: ['byteStart', 'byteEnd'],
2049 properties: {
2050 byteStart: {
2051 type: 'integer',
2052 minimum: 0,
2053 },
2054 byteEnd: {
2055 type: 'integer',
2056 minimum: 0,
2057 },
2058 },
2059 },
2060 link: {
2061 type: 'object',
2062 description:
2063 'Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.',
2064 required: ['uri'],
2065 properties: {
2066 uri: {
2067 type: 'string',
2068 },
2069 },
2070 },
2071 didMention: {
2072 type: 'object',
2073 description: 'Facet feature for mentioning a did.',
2074 required: ['did'],
2075 properties: {
2076 did: {
2077 type: 'string',
2078 format: 'did',
2079 },
2080 },
2081 },
2082 atMention: {
2083 type: 'object',
2084 description: 'Facet feature for mentioning an AT URI.',
2085 required: ['atURI'],
2086 properties: {
2087 atURI: {
2088 type: 'string',
2089 format: 'uri',
2090 },
2091 },
2092 },
2093 code: {
2094 type: 'object',
2095 description: 'Facet feature for inline code.',
2096 required: [],
2097 properties: {},
2098 },
2099 highlight: {
2100 type: 'object',
2101 description: 'Facet feature for highlighted text.',
2102 required: [],
2103 properties: {},
2104 },
2105 underline: {
2106 type: 'object',
2107 description: 'Facet feature for underline markup',
2108 required: [],
2109 properties: {},
2110 },
2111 strikethrough: {
2112 type: 'object',
2113 description: 'Facet feature for strikethrough markup',
2114 required: [],
2115 properties: {},
2116 },
2117 id: {
2118 type: 'object',
2119 description:
2120 'Facet feature for an identifier. Used for linking to a segment',
2121 required: [],
2122 properties: {
2123 id: {
2124 type: 'string',
2125 },
2126 },
2127 },
2128 bold: {
2129 type: 'object',
2130 description: 'Facet feature for bold text',
2131 required: [],
2132 properties: {},
2133 },
2134 italic: {
2135 type: 'object',
2136 description: 'Facet feature for italic text',
2137 required: [],
2138 properties: {},
2139 },
2140 footnote: {
2141 type: 'object',
2142 description: 'Facet feature for a footnote reference',
2143 required: ['footnoteId', 'contentPlaintext'],
2144 properties: {
2145 footnoteId: {
2146 type: 'string',
2147 },
2148 contentPlaintext: {
2149 type: 'string',
2150 },
2151 contentFacets: {
2152 type: 'array',
2153 items: {
2154 type: 'ref',
2155 ref: 'lex:pub.leaflet.richtext.facet',
2156 },
2157 },
2158 },
2159 },
2160 },
2161 },
2162 PubLeafletThemeBackgroundImage: {
2163 lexicon: 1,
2164 id: 'pub.leaflet.theme.backgroundImage',
2165 defs: {
2166 main: {
2167 type: 'object',
2168 required: ['image'],
2169 properties: {
2170 image: {
2171 type: 'blob',
2172 accept: ['image/*'],
2173 maxSize: 1000000,
2174 },
2175 width: {
2176 type: 'integer',
2177 },
2178 repeat: {
2179 type: 'boolean',
2180 },
2181 },
2182 },
2183 },
2184 },
2185 PubLeafletThemeColor: {
2186 lexicon: 1,
2187 id: 'pub.leaflet.theme.color',
2188 defs: {
2189 rgba: {
2190 type: 'object',
2191 required: ['r', 'g', 'b', 'a'],
2192 properties: {
2193 r: {
2194 type: 'integer',
2195 maximum: 255,
2196 minimum: 0,
2197 },
2198 g: {
2199 type: 'integer',
2200 maximum: 255,
2201 minimum: 0,
2202 },
2203 b: {
2204 type: 'integer',
2205 maximum: 255,
2206 minimum: 0,
2207 },
2208 a: {
2209 type: 'integer',
2210 maximum: 100,
2211 minimum: 0,
2212 },
2213 },
2214 },
2215 rgb: {
2216 type: 'object',
2217 required: ['r', 'g', 'b'],
2218 properties: {
2219 r: {
2220 type: 'integer',
2221 maximum: 255,
2222 minimum: 0,
2223 },
2224 g: {
2225 type: 'integer',
2226 maximum: 255,
2227 minimum: 0,
2228 },
2229 b: {
2230 type: 'integer',
2231 maximum: 255,
2232 minimum: 0,
2233 },
2234 },
2235 },
2236 },
2237 },
2238 SiteStandardDocument: {
2239 defs: {
2240 main: {
2241 key: 'tid',
2242 record: {
2243 properties: {
2244 bskyPostRef: {
2245 ref: 'lex:com.atproto.repo.strongRef',
2246 type: 'ref',
2247 },
2248 content: {
2249 closed: false,
2250 refs: ['lex:pub.leaflet.content'],
2251 type: 'union',
2252 },
2253 coverImage: {
2254 accept: ['image/*'],
2255 maxSize: 1000000,
2256 type: 'blob',
2257 },
2258 description: {
2259 maxGraphemes: 3000,
2260 maxLength: 30000,
2261 type: 'string',
2262 },
2263 path: {
2264 description:
2265 'combine with the publication url or the document site to construct a full url to the document',
2266 type: 'string',
2267 },
2268 publishedAt: {
2269 format: 'datetime',
2270 type: 'string',
2271 },
2272 site: {
2273 description:
2274 '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.',
2275 format: 'uri',
2276 type: 'string',
2277 },
2278 tags: {
2279 items: {
2280 maxGraphemes: 50,
2281 maxLength: 100,
2282 type: 'string',
2283 },
2284 type: 'array',
2285 },
2286 textContent: {
2287 type: 'string',
2288 },
2289 theme: {
2290 description:
2291 'Theme for standalone documents. For documents in publications, theme is inherited from the publication.',
2292 ref: 'lex:pub.leaflet.publication#theme',
2293 type: 'ref',
2294 },
2295 title: {
2296 maxGraphemes: 500,
2297 maxLength: 5000,
2298 type: 'string',
2299 },
2300 preferences: {
2301 type: 'union',
2302 refs: ['lex:pub.leaflet.publication#preferences'],
2303 closed: false,
2304 },
2305 updatedAt: {
2306 format: 'datetime',
2307 type: 'string',
2308 },
2309 },
2310 required: ['site', 'title', 'publishedAt'],
2311 type: 'object',
2312 },
2313 type: 'record',
2314 },
2315 },
2316 id: 'site.standard.document',
2317 lexicon: 1,
2318 },
2319 SiteStandardGraphSubscription: {
2320 defs: {
2321 main: {
2322 description: 'Record declaring a subscription to a publication',
2323 key: 'tid',
2324 record: {
2325 properties: {
2326 publication: {
2327 format: 'at-uri',
2328 type: 'string',
2329 },
2330 },
2331 required: ['publication'],
2332 type: 'object',
2333 },
2334 type: 'record',
2335 },
2336 },
2337 id: 'site.standard.graph.subscription',
2338 lexicon: 1,
2339 },
2340 SiteStandardPublication: {
2341 defs: {
2342 main: {
2343 key: 'tid',
2344 record: {
2345 properties: {
2346 basicTheme: {
2347 ref: 'lex:site.standard.theme.basic',
2348 type: 'ref',
2349 },
2350 theme: {
2351 type: 'union',
2352 refs: ['lex:pub.leaflet.publication#theme'],
2353 },
2354 description: {
2355 maxGraphemes: 300,
2356 maxLength: 3000,
2357 type: 'string',
2358 },
2359 icon: {
2360 accept: ['image/*'],
2361 maxSize: 1000000,
2362 type: 'blob',
2363 },
2364 name: {
2365 maxGraphemes: 128,
2366 maxLength: 1280,
2367 type: 'string',
2368 },
2369 preferences: {
2370 ref: 'lex:site.standard.publication#preferences',
2371 type: 'ref',
2372 },
2373 url: {
2374 format: 'uri',
2375 type: 'string',
2376 },
2377 },
2378 required: ['url', 'name'],
2379 type: 'object',
2380 },
2381 type: 'record',
2382 },
2383 preferences: {
2384 properties: {
2385 showInDiscover: {
2386 default: true,
2387 type: 'boolean',
2388 },
2389 showComments: {
2390 default: true,
2391 type: 'boolean',
2392 },
2393 showMentions: {
2394 default: true,
2395 type: 'boolean',
2396 },
2397 showPrevNext: {
2398 default: false,
2399 type: 'boolean',
2400 },
2401 showRecommends: {
2402 default: true,
2403 type: 'boolean',
2404 },
2405 },
2406 type: 'object',
2407 },
2408 },
2409 id: 'site.standard.publication',
2410 lexicon: 1,
2411 },
2412 SiteStandardThemeBasic: {
2413 defs: {
2414 main: {
2415 properties: {
2416 accent: {
2417 refs: ['lex:site.standard.theme.color#rgb'],
2418 type: 'union',
2419 },
2420 accentForeground: {
2421 refs: ['lex:site.standard.theme.color#rgb'],
2422 type: 'union',
2423 },
2424 background: {
2425 refs: ['lex:site.standard.theme.color#rgb'],
2426 type: 'union',
2427 },
2428 foreground: {
2429 refs: ['lex:site.standard.theme.color#rgb'],
2430 type: 'union',
2431 },
2432 },
2433 required: ['background', 'foreground', 'accent', 'accentForeground'],
2434 type: 'object',
2435 },
2436 },
2437 id: 'site.standard.theme.basic',
2438 lexicon: 1,
2439 },
2440 SiteStandardThemeColor: {
2441 lexicon: 1,
2442 id: 'site.standard.theme.color',
2443 defs: {
2444 rgb: {
2445 type: 'object',
2446 required: ['r', 'g', 'b'],
2447 properties: {
2448 r: {
2449 type: 'integer',
2450 minimum: 0,
2451 maximum: 255,
2452 },
2453 g: {
2454 type: 'integer',
2455 minimum: 0,
2456 maximum: 255,
2457 },
2458 b: {
2459 type: 'integer',
2460 minimum: 0,
2461 maximum: 255,
2462 },
2463 },
2464 },
2465 rgba: {
2466 type: 'object',
2467 required: ['r', 'g', 'b', 'a'],
2468 properties: {
2469 r: {
2470 type: 'integer',
2471 minimum: 0,
2472 maximum: 255,
2473 },
2474 g: {
2475 type: 'integer',
2476 minimum: 0,
2477 maximum: 255,
2478 },
2479 b: {
2480 type: 'integer',
2481 minimum: 0,
2482 maximum: 255,
2483 },
2484 a: {
2485 type: 'integer',
2486 minimum: 0,
2487 maximum: 100,
2488 },
2489 },
2490 },
2491 },
2492 },
2493} as const satisfies Record<string, LexiconDoc>
2494export const schemas = Object.values(schemaDict) satisfies LexiconDoc[]
2495export const lexicons: Lexicons = new Lexicons(schemas)
2496
2497export function validate<T extends { $type: string }>(
2498 v: unknown,
2499 id: string,
2500 hash: string,
2501 requiredType: true,
2502): ValidationResult<T>
2503export function validate<T extends { $type?: string }>(
2504 v: unknown,
2505 id: string,
2506 hash: string,
2507 requiredType?: false,
2508): ValidationResult<T>
2509export function validate(
2510 v: unknown,
2511 id: string,
2512 hash: string,
2513 requiredType?: boolean,
2514): ValidationResult {
2515 return (requiredType ? is$typed : maybe$typed)(v, id, hash)
2516 ? lexicons.validate(`${id}#${hash}`, v)
2517 : {
2518 success: false,
2519 error: new ValidationError(
2520 `Must be an object with "${hash === 'main' ? id : `${id}#${hash}`}" $type property`,
2521 ),
2522 }
2523}
2524
2525export const ids = {
2526 AppBskyActorProfile: 'app.bsky.actor.profile',
2527 ComAtprotoLabelDefs: 'com.atproto.label.defs',
2528 ComAtprotoRepoApplyWrites: 'com.atproto.repo.applyWrites',
2529 ComAtprotoRepoCreateRecord: 'com.atproto.repo.createRecord',
2530 ComAtprotoRepoDefs: 'com.atproto.repo.defs',
2531 ComAtprotoRepoDeleteRecord: 'com.atproto.repo.deleteRecord',
2532 ComAtprotoRepoDescribeRepo: 'com.atproto.repo.describeRepo',
2533 ComAtprotoRepoGetRecord: 'com.atproto.repo.getRecord',
2534 ComAtprotoRepoImportRepo: 'com.atproto.repo.importRepo',
2535 ComAtprotoRepoListMissingBlobs: 'com.atproto.repo.listMissingBlobs',
2536 ComAtprotoRepoListRecords: 'com.atproto.repo.listRecords',
2537 ComAtprotoRepoPutRecord: 'com.atproto.repo.putRecord',
2538 ComAtprotoRepoStrongRef: 'com.atproto.repo.strongRef',
2539 ComAtprotoRepoUploadBlob: 'com.atproto.repo.uploadBlob',
2540 PubLeafletBlocksBlockquote: 'pub.leaflet.blocks.blockquote',
2541 PubLeafletBlocksBskyPost: 'pub.leaflet.blocks.bskyPost',
2542 PubLeafletBlocksButton: 'pub.leaflet.blocks.button',
2543 PubLeafletBlocksCode: 'pub.leaflet.blocks.code',
2544 PubLeafletBlocksHeader: 'pub.leaflet.blocks.header',
2545 PubLeafletBlocksHorizontalRule: 'pub.leaflet.blocks.horizontalRule',
2546 PubLeafletBlocksIframe: 'pub.leaflet.blocks.iframe',
2547 PubLeafletBlocksImage: 'pub.leaflet.blocks.image',
2548 PubLeafletBlocksMath: 'pub.leaflet.blocks.math',
2549 PubLeafletBlocksOrderedList: 'pub.leaflet.blocks.orderedList',
2550 PubLeafletBlocksPage: 'pub.leaflet.blocks.page',
2551 PubLeafletBlocksPoll: 'pub.leaflet.blocks.poll',
2552 PubLeafletBlocksText: 'pub.leaflet.blocks.text',
2553 PubLeafletBlocksUnorderedList: 'pub.leaflet.blocks.unorderedList',
2554 PubLeafletBlocksWebsite: 'pub.leaflet.blocks.website',
2555 PubLeafletComment: 'pub.leaflet.comment',
2556 PubLeafletContent: 'pub.leaflet.content',
2557 PubLeafletDocument: 'pub.leaflet.document',
2558 PubLeafletGraphSubscription: 'pub.leaflet.graph.subscription',
2559 PubLeafletInteractionsRecommend: 'pub.leaflet.interactions.recommend',
2560 PubLeafletPagesCanvas: 'pub.leaflet.pages.canvas',
2561 PubLeafletPagesLinearDocument: 'pub.leaflet.pages.linearDocument',
2562 PubLeafletPollDefinition: 'pub.leaflet.poll.definition',
2563 PubLeafletPollVote: 'pub.leaflet.poll.vote',
2564 PubLeafletPublication: 'pub.leaflet.publication',
2565 PubLeafletRichtextFacet: 'pub.leaflet.richtext.facet',
2566 PubLeafletThemeBackgroundImage: 'pub.leaflet.theme.backgroundImage',
2567 PubLeafletThemeColor: 'pub.leaflet.theme.color',
2568 SiteStandardDocument: 'site.standard.document',
2569 SiteStandardGraphSubscription: 'site.standard.graph.subscription',
2570 SiteStandardPublication: 'site.standard.publication',
2571 SiteStandardThemeBasic: 'site.standard.theme.basic',
2572 SiteStandardThemeColor: 'site.standard.theme.color',
2573} as const