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', 'publication'],
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 pages: {
1440 type: 'array',
1441 items: {
1442 type: 'union',
1443 refs: [
1444 'lex:pub.leaflet.pages.linearDocument',
1445 'lex:pub.leaflet.pages.canvas',
1446 ],
1447 },
1448 },
1449 },
1450 },
1451 },
1452 },
1453 },
1454 PubLeafletGraphSubscription: {
1455 lexicon: 1,
1456 id: 'pub.leaflet.graph.subscription',
1457 defs: {
1458 main: {
1459 type: 'record',
1460 key: 'tid',
1461 description: 'Record declaring a subscription to a publication',
1462 record: {
1463 type: 'object',
1464 required: ['publication'],
1465 properties: {
1466 publication: {
1467 type: 'string',
1468 format: 'at-uri',
1469 },
1470 },
1471 },
1472 },
1473 },
1474 },
1475 PubLeafletPagesCanvas: {
1476 lexicon: 1,
1477 id: 'pub.leaflet.pages.canvas',
1478 defs: {
1479 main: {
1480 type: 'object',
1481 required: ['blocks'],
1482 properties: {
1483 id: {
1484 type: 'string',
1485 },
1486 blocks: {
1487 type: 'array',
1488 items: {
1489 type: 'ref',
1490 ref: 'lex:pub.leaflet.pages.canvas#block',
1491 },
1492 },
1493 },
1494 },
1495 block: {
1496 type: 'object',
1497 required: ['block', 'x', 'y', 'width'],
1498 properties: {
1499 block: {
1500 type: 'union',
1501 refs: [
1502 'lex:pub.leaflet.blocks.iframe',
1503 'lex:pub.leaflet.blocks.text',
1504 'lex:pub.leaflet.blocks.blockquote',
1505 'lex:pub.leaflet.blocks.header',
1506 'lex:pub.leaflet.blocks.image',
1507 'lex:pub.leaflet.blocks.unorderedList',
1508 'lex:pub.leaflet.blocks.website',
1509 'lex:pub.leaflet.blocks.math',
1510 'lex:pub.leaflet.blocks.code',
1511 'lex:pub.leaflet.blocks.horizontalRule',
1512 'lex:pub.leaflet.blocks.bskyPost',
1513 'lex:pub.leaflet.blocks.page',
1514 'lex:pub.leaflet.blocks.poll',
1515 'lex:pub.leaflet.blocks.button',
1516 ],
1517 },
1518 x: {
1519 type: 'integer',
1520 },
1521 y: {
1522 type: 'integer',
1523 },
1524 width: {
1525 type: 'integer',
1526 },
1527 height: {
1528 type: 'integer',
1529 },
1530 rotation: {
1531 type: 'integer',
1532 description: 'The rotation of the block in degrees',
1533 },
1534 },
1535 },
1536 textAlignLeft: {
1537 type: 'token',
1538 },
1539 textAlignCenter: {
1540 type: 'token',
1541 },
1542 textAlignRight: {
1543 type: 'token',
1544 },
1545 quote: {
1546 type: 'object',
1547 required: ['start', 'end'],
1548 properties: {
1549 start: {
1550 type: 'ref',
1551 ref: 'lex:pub.leaflet.pages.canvas#position',
1552 },
1553 end: {
1554 type: 'ref',
1555 ref: 'lex:pub.leaflet.pages.canvas#position',
1556 },
1557 },
1558 },
1559 position: {
1560 type: 'object',
1561 required: ['block', 'offset'],
1562 properties: {
1563 block: {
1564 type: 'array',
1565 items: {
1566 type: 'integer',
1567 },
1568 },
1569 offset: {
1570 type: 'integer',
1571 },
1572 },
1573 },
1574 },
1575 },
1576 PubLeafletPagesLinearDocument: {
1577 lexicon: 1,
1578 id: 'pub.leaflet.pages.linearDocument',
1579 defs: {
1580 main: {
1581 type: 'object',
1582 required: ['blocks'],
1583 properties: {
1584 id: {
1585 type: 'string',
1586 },
1587 blocks: {
1588 type: 'array',
1589 items: {
1590 type: 'ref',
1591 ref: 'lex:pub.leaflet.pages.linearDocument#block',
1592 },
1593 },
1594 },
1595 },
1596 block: {
1597 type: 'object',
1598 required: ['block'],
1599 properties: {
1600 block: {
1601 type: 'union',
1602 refs: [
1603 'lex:pub.leaflet.blocks.iframe',
1604 'lex:pub.leaflet.blocks.text',
1605 'lex:pub.leaflet.blocks.blockquote',
1606 'lex:pub.leaflet.blocks.header',
1607 'lex:pub.leaflet.blocks.image',
1608 'lex:pub.leaflet.blocks.unorderedList',
1609 'lex:pub.leaflet.blocks.website',
1610 'lex:pub.leaflet.blocks.math',
1611 'lex:pub.leaflet.blocks.code',
1612 'lex:pub.leaflet.blocks.horizontalRule',
1613 'lex:pub.leaflet.blocks.bskyPost',
1614 'lex:pub.leaflet.blocks.page',
1615 'lex:pub.leaflet.blocks.poll',
1616 'lex:pub.leaflet.blocks.button',
1617 ],
1618 },
1619 alignment: {
1620 type: 'string',
1621 knownValues: [
1622 'lex:pub.leaflet.pages.linearDocument#textAlignLeft',
1623 'lex:pub.leaflet.pages.linearDocument#textAlignCenter',
1624 'lex:pub.leaflet.pages.linearDocument#textAlignRight',
1625 'lex:pub.leaflet.pages.linearDocument#textAlignJustify',
1626 ],
1627 },
1628 },
1629 },
1630 textAlignLeft: {
1631 type: 'token',
1632 },
1633 textAlignCenter: {
1634 type: 'token',
1635 },
1636 textAlignRight: {
1637 type: 'token',
1638 },
1639 textAlignJustify: {
1640 type: 'token',
1641 },
1642 quote: {
1643 type: 'object',
1644 required: ['start', 'end'],
1645 properties: {
1646 start: {
1647 type: 'ref',
1648 ref: 'lex:pub.leaflet.pages.linearDocument#position',
1649 },
1650 end: {
1651 type: 'ref',
1652 ref: 'lex:pub.leaflet.pages.linearDocument#position',
1653 },
1654 },
1655 },
1656 position: {
1657 type: 'object',
1658 required: ['block', 'offset'],
1659 properties: {
1660 block: {
1661 type: 'array',
1662 items: {
1663 type: 'integer',
1664 },
1665 },
1666 offset: {
1667 type: 'integer',
1668 },
1669 },
1670 },
1671 },
1672 },
1673 PubLeafletPollDefinition: {
1674 lexicon: 1,
1675 id: 'pub.leaflet.poll.definition',
1676 defs: {
1677 main: {
1678 type: 'record',
1679 key: 'tid',
1680 description: 'Record declaring a poll',
1681 record: {
1682 type: 'object',
1683 required: ['name', 'options'],
1684 properties: {
1685 name: {
1686 type: 'string',
1687 maxLength: 500,
1688 maxGraphemes: 100,
1689 },
1690 options: {
1691 type: 'array',
1692 items: {
1693 type: 'ref',
1694 ref: 'lex:pub.leaflet.poll.definition#option',
1695 },
1696 },
1697 endDate: {
1698 type: 'string',
1699 format: 'datetime',
1700 },
1701 },
1702 },
1703 },
1704 option: {
1705 type: 'object',
1706 properties: {
1707 text: {
1708 type: 'string',
1709 maxLength: 500,
1710 maxGraphemes: 50,
1711 },
1712 },
1713 },
1714 },
1715 },
1716 PubLeafletPollVote: {
1717 lexicon: 1,
1718 id: 'pub.leaflet.poll.vote',
1719 defs: {
1720 main: {
1721 type: 'record',
1722 key: 'tid',
1723 description: 'Record declaring a vote on a poll',
1724 record: {
1725 type: 'object',
1726 required: ['poll', 'option'],
1727 properties: {
1728 poll: {
1729 type: 'ref',
1730 ref: 'lex:com.atproto.repo.strongRef',
1731 },
1732 option: {
1733 type: 'array',
1734 items: {
1735 type: 'string',
1736 },
1737 },
1738 },
1739 },
1740 },
1741 },
1742 },
1743 PubLeafletPublication: {
1744 lexicon: 1,
1745 id: 'pub.leaflet.publication',
1746 defs: {
1747 main: {
1748 type: 'record',
1749 key: 'tid',
1750 description: 'Record declaring a publication',
1751 record: {
1752 type: 'object',
1753 required: ['name'],
1754 properties: {
1755 name: {
1756 type: 'string',
1757 maxLength: 2000,
1758 },
1759 base_path: {
1760 type: 'string',
1761 },
1762 description: {
1763 type: 'string',
1764 maxLength: 2000,
1765 },
1766 icon: {
1767 type: 'blob',
1768 accept: ['image/*'],
1769 maxSize: 1000000,
1770 },
1771 theme: {
1772 type: 'ref',
1773 ref: 'lex:pub.leaflet.publication#theme',
1774 },
1775 preferences: {
1776 type: 'ref',
1777 ref: 'lex:pub.leaflet.publication#preferences',
1778 },
1779 },
1780 },
1781 },
1782 preferences: {
1783 type: 'object',
1784 properties: {
1785 showInDiscover: {
1786 type: 'boolean',
1787 default: true,
1788 },
1789 showComments: {
1790 type: 'boolean',
1791 default: true,
1792 },
1793 },
1794 },
1795 theme: {
1796 type: 'object',
1797 properties: {
1798 backgroundColor: {
1799 type: 'union',
1800 refs: [
1801 'lex:pub.leaflet.theme.color#rgba',
1802 'lex:pub.leaflet.theme.color#rgb',
1803 ],
1804 },
1805 backgroundImage: {
1806 type: 'ref',
1807 ref: 'lex:pub.leaflet.theme.backgroundImage',
1808 },
1809 primary: {
1810 type: 'union',
1811 refs: [
1812 'lex:pub.leaflet.theme.color#rgba',
1813 'lex:pub.leaflet.theme.color#rgb',
1814 ],
1815 },
1816 pageBackground: {
1817 type: 'union',
1818 refs: [
1819 'lex:pub.leaflet.theme.color#rgba',
1820 'lex:pub.leaflet.theme.color#rgb',
1821 ],
1822 },
1823 showPageBackground: {
1824 type: 'boolean',
1825 default: false,
1826 },
1827 accentBackground: {
1828 type: 'union',
1829 refs: [
1830 'lex:pub.leaflet.theme.color#rgba',
1831 'lex:pub.leaflet.theme.color#rgb',
1832 ],
1833 },
1834 accentText: {
1835 type: 'union',
1836 refs: [
1837 'lex:pub.leaflet.theme.color#rgba',
1838 'lex:pub.leaflet.theme.color#rgb',
1839 ],
1840 },
1841 },
1842 },
1843 },
1844 },
1845 PubLeafletRichtextFacet: {
1846 lexicon: 1,
1847 id: 'pub.leaflet.richtext.facet',
1848 defs: {
1849 main: {
1850 type: 'object',
1851 description: 'Annotation of a sub-string within rich text.',
1852 required: ['index', 'features'],
1853 properties: {
1854 index: {
1855 type: 'ref',
1856 ref: 'lex:pub.leaflet.richtext.facet#byteSlice',
1857 },
1858 features: {
1859 type: 'array',
1860 items: {
1861 type: 'union',
1862 refs: [
1863 'lex:pub.leaflet.richtext.facet#link',
1864 'lex:pub.leaflet.richtext.facet#code',
1865 'lex:pub.leaflet.richtext.facet#highlight',
1866 'lex:pub.leaflet.richtext.facet#underline',
1867 'lex:pub.leaflet.richtext.facet#strikethrough',
1868 'lex:pub.leaflet.richtext.facet#id',
1869 'lex:pub.leaflet.richtext.facet#bold',
1870 'lex:pub.leaflet.richtext.facet#italic',
1871 ],
1872 },
1873 },
1874 },
1875 },
1876 byteSlice: {
1877 type: 'object',
1878 description:
1879 '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.',
1880 required: ['byteStart', 'byteEnd'],
1881 properties: {
1882 byteStart: {
1883 type: 'integer',
1884 minimum: 0,
1885 },
1886 byteEnd: {
1887 type: 'integer',
1888 minimum: 0,
1889 },
1890 },
1891 },
1892 link: {
1893 type: 'object',
1894 description:
1895 'Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.',
1896 required: ['uri'],
1897 properties: {
1898 uri: {
1899 type: 'string',
1900 },
1901 },
1902 },
1903 code: {
1904 type: 'object',
1905 description: 'Facet feature for inline code.',
1906 required: [],
1907 properties: {},
1908 },
1909 highlight: {
1910 type: 'object',
1911 description: 'Facet feature for highlighted text.',
1912 required: [],
1913 properties: {},
1914 },
1915 underline: {
1916 type: 'object',
1917 description: 'Facet feature for underline markup',
1918 required: [],
1919 properties: {},
1920 },
1921 strikethrough: {
1922 type: 'object',
1923 description: 'Facet feature for strikethrough markup',
1924 required: [],
1925 properties: {},
1926 },
1927 id: {
1928 type: 'object',
1929 description:
1930 'Facet feature for an identifier. Used for linking to a segment',
1931 required: [],
1932 properties: {
1933 id: {
1934 type: 'string',
1935 },
1936 },
1937 },
1938 bold: {
1939 type: 'object',
1940 description: 'Facet feature for bold text',
1941 required: [],
1942 properties: {},
1943 },
1944 italic: {
1945 type: 'object',
1946 description: 'Facet feature for italic text',
1947 required: [],
1948 properties: {},
1949 },
1950 },
1951 },
1952 PubLeafletThemeBackgroundImage: {
1953 lexicon: 1,
1954 id: 'pub.leaflet.theme.backgroundImage',
1955 defs: {
1956 main: {
1957 type: 'object',
1958 required: ['image'],
1959 properties: {
1960 image: {
1961 type: 'blob',
1962 accept: ['image/*'],
1963 maxSize: 1000000,
1964 },
1965 width: {
1966 type: 'integer',
1967 },
1968 repeat: {
1969 type: 'boolean',
1970 },
1971 },
1972 },
1973 },
1974 },
1975 PubLeafletThemeColor: {
1976 lexicon: 1,
1977 id: 'pub.leaflet.theme.color',
1978 defs: {
1979 rgba: {
1980 type: 'object',
1981 required: ['r', 'g', 'b', 'a'],
1982 properties: {
1983 r: {
1984 type: 'integer',
1985 maximum: 255,
1986 minimum: 0,
1987 },
1988 g: {
1989 type: 'integer',
1990 maximum: 255,
1991 minimum: 0,
1992 },
1993 b: {
1994 type: 'integer',
1995 maximum: 255,
1996 minimum: 0,
1997 },
1998 a: {
1999 type: 'integer',
2000 maximum: 100,
2001 minimum: 0,
2002 },
2003 },
2004 },
2005 rgb: {
2006 type: 'object',
2007 required: ['r', 'g', 'b'],
2008 properties: {
2009 r: {
2010 type: 'integer',
2011 maximum: 255,
2012 minimum: 0,
2013 },
2014 g: {
2015 type: 'integer',
2016 maximum: 255,
2017 minimum: 0,
2018 },
2019 b: {
2020 type: 'integer',
2021 maximum: 255,
2022 minimum: 0,
2023 },
2024 },
2025 },
2026 },
2027 },
2028} as const satisfies Record<string, LexiconDoc>
2029export const schemas = Object.values(schemaDict) satisfies LexiconDoc[]
2030export const lexicons: Lexicons = new Lexicons(schemas)
2031
2032export function validate<T extends { $type: string }>(
2033 v: unknown,
2034 id: string,
2035 hash: string,
2036 requiredType: true,
2037): ValidationResult<T>
2038export function validate<T extends { $type?: string }>(
2039 v: unknown,
2040 id: string,
2041 hash: string,
2042 requiredType?: false,
2043): ValidationResult<T>
2044export function validate(
2045 v: unknown,
2046 id: string,
2047 hash: string,
2048 requiredType?: boolean,
2049): ValidationResult {
2050 return (requiredType ? is$typed : maybe$typed)(v, id, hash)
2051 ? lexicons.validate(`${id}#${hash}`, v)
2052 : {
2053 success: false,
2054 error: new ValidationError(
2055 `Must be an object with "${hash === 'main' ? id : `${id}#${hash}`}" $type property`,
2056 ),
2057 }
2058}
2059
2060export const ids = {
2061 AppBskyActorProfile: 'app.bsky.actor.profile',
2062 ComAtprotoLabelDefs: 'com.atproto.label.defs',
2063 ComAtprotoRepoApplyWrites: 'com.atproto.repo.applyWrites',
2064 ComAtprotoRepoCreateRecord: 'com.atproto.repo.createRecord',
2065 ComAtprotoRepoDefs: 'com.atproto.repo.defs',
2066 ComAtprotoRepoDeleteRecord: 'com.atproto.repo.deleteRecord',
2067 ComAtprotoRepoDescribeRepo: 'com.atproto.repo.describeRepo',
2068 ComAtprotoRepoGetRecord: 'com.atproto.repo.getRecord',
2069 ComAtprotoRepoImportRepo: 'com.atproto.repo.importRepo',
2070 ComAtprotoRepoListMissingBlobs: 'com.atproto.repo.listMissingBlobs',
2071 ComAtprotoRepoListRecords: 'com.atproto.repo.listRecords',
2072 ComAtprotoRepoPutRecord: 'com.atproto.repo.putRecord',
2073 ComAtprotoRepoStrongRef: 'com.atproto.repo.strongRef',
2074 ComAtprotoRepoUploadBlob: 'com.atproto.repo.uploadBlob',
2075 PubLeafletBlocksBlockquote: 'pub.leaflet.blocks.blockquote',
2076 PubLeafletBlocksBskyPost: 'pub.leaflet.blocks.bskyPost',
2077 PubLeafletBlocksButton: 'pub.leaflet.blocks.button',
2078 PubLeafletBlocksCode: 'pub.leaflet.blocks.code',
2079 PubLeafletBlocksHeader: 'pub.leaflet.blocks.header',
2080 PubLeafletBlocksHorizontalRule: 'pub.leaflet.blocks.horizontalRule',
2081 PubLeafletBlocksIframe: 'pub.leaflet.blocks.iframe',
2082 PubLeafletBlocksImage: 'pub.leaflet.blocks.image',
2083 PubLeafletBlocksMath: 'pub.leaflet.blocks.math',
2084 PubLeafletBlocksPage: 'pub.leaflet.blocks.page',
2085 PubLeafletBlocksPoll: 'pub.leaflet.blocks.poll',
2086 PubLeafletBlocksText: 'pub.leaflet.blocks.text',
2087 PubLeafletBlocksUnorderedList: 'pub.leaflet.blocks.unorderedList',
2088 PubLeafletBlocksWebsite: 'pub.leaflet.blocks.website',
2089 PubLeafletComment: 'pub.leaflet.comment',
2090 PubLeafletDocument: 'pub.leaflet.document',
2091 PubLeafletGraphSubscription: 'pub.leaflet.graph.subscription',
2092 PubLeafletPagesCanvas: 'pub.leaflet.pages.canvas',
2093 PubLeafletPagesLinearDocument: 'pub.leaflet.pages.linearDocument',
2094 PubLeafletPollDefinition: 'pub.leaflet.poll.definition',
2095 PubLeafletPollVote: 'pub.leaflet.poll.vote',
2096 PubLeafletPublication: 'pub.leaflet.publication',
2097 PubLeafletRichtextFacet: 'pub.leaflet.richtext.facet',
2098 PubLeafletThemeBackgroundImage: 'pub.leaflet.theme.backgroundImage',
2099 PubLeafletThemeColor: 'pub.leaflet.theme.color',
2100} as const