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