a tool for shared writing and social publishing
1export type Json =
2 | string
3 | number
4 | boolean
5 | null
6 | { [key: string]: Json | undefined }
7 | Json[]
8
9export type Database = {
10 graphql_public: {
11 Tables: {
12 [_ in never]: never
13 }
14 Views: {
15 [_ in never]: never
16 }
17 Functions: {
18 graphql: {
19 Args: {
20 operationName?: string
21 query?: string
22 variables?: Json
23 extensions?: Json
24 }
25 Returns: Json
26 }
27 }
28 Enums: {
29 [_ in never]: never
30 }
31 CompositeTypes: {
32 [_ in never]: never
33 }
34 }
35 public: {
36 Tables: {
37 atp_poll_records: {
38 Row: {
39 cid: string
40 created_at: string
41 record: Json
42 uri: string
43 }
44 Insert: {
45 cid: string
46 created_at?: string
47 record: Json
48 uri: string
49 }
50 Update: {
51 cid?: string
52 created_at?: string
53 record?: Json
54 uri?: string
55 }
56 Relationships: []
57 }
58 atp_poll_votes: {
59 Row: {
60 indexed_at: string
61 poll_cid: string
62 poll_uri: string
63 record: Json
64 uri: string
65 voter_did: string
66 }
67 Insert: {
68 indexed_at?: string
69 poll_cid: string
70 poll_uri: string
71 record: Json
72 uri: string
73 voter_did: string
74 }
75 Update: {
76 indexed_at?: string
77 poll_cid?: string
78 poll_uri?: string
79 record?: Json
80 uri?: string
81 voter_did?: string
82 }
83 Relationships: [
84 {
85 foreignKeyName: "atp_poll_votes_poll_uri_fkey"
86 columns: ["poll_uri"]
87 isOneToOne: false
88 referencedRelation: "atp_poll_records"
89 referencedColumns: ["uri"]
90 },
91 ]
92 }
93 bsky_follows: {
94 Row: {
95 follows: string
96 identity: string
97 }
98 Insert: {
99 follows: string
100 identity?: string
101 }
102 Update: {
103 follows?: string
104 identity?: string
105 }
106 Relationships: [
107 {
108 foreignKeyName: "bsky_follows_follows_fkey"
109 columns: ["follows"]
110 isOneToOne: false
111 referencedRelation: "identities"
112 referencedColumns: ["atp_did"]
113 },
114 {
115 foreignKeyName: "bsky_follows_identity_fkey"
116 columns: ["identity"]
117 isOneToOne: false
118 referencedRelation: "identities"
119 referencedColumns: ["atp_did"]
120 },
121 ]
122 }
123 bsky_posts: {
124 Row: {
125 cid: string
126 indexed_at: string
127 post_view: Json
128 uri: string
129 }
130 Insert: {
131 cid: string
132 indexed_at?: string
133 post_view: Json
134 uri: string
135 }
136 Update: {
137 cid?: string
138 indexed_at?: string
139 post_view?: Json
140 uri?: string
141 }
142 Relationships: []
143 }
144 bsky_profiles: {
145 Row: {
146 did: string
147 handle: string | null
148 indexed_at: string
149 record: Json
150 }
151 Insert: {
152 did: string
153 handle?: string | null
154 indexed_at?: string
155 record: Json
156 }
157 Update: {
158 did?: string
159 handle?: string | null
160 indexed_at?: string
161 record?: Json
162 }
163 Relationships: [
164 {
165 foreignKeyName: "bsky_profiles_did_fkey"
166 columns: ["did"]
167 isOneToOne: true
168 referencedRelation: "identities"
169 referencedColumns: ["atp_did"]
170 },
171 ]
172 }
173 comments_on_documents: {
174 Row: {
175 document: string | null
176 indexed_at: string
177 profile: string | null
178 record: Json
179 uri: string
180 }
181 Insert: {
182 document?: string | null
183 indexed_at?: string
184 profile?: string | null
185 record: Json
186 uri: string
187 }
188 Update: {
189 document?: string | null
190 indexed_at?: string
191 profile?: string | null
192 record?: Json
193 uri?: string
194 }
195 Relationships: [
196 {
197 foreignKeyName: "comments_on_documents_document_fkey"
198 columns: ["document"]
199 isOneToOne: false
200 referencedRelation: "documents"
201 referencedColumns: ["uri"]
202 },
203 {
204 foreignKeyName: "comments_on_documents_profile_fkey"
205 columns: ["profile"]
206 isOneToOne: false
207 referencedRelation: "bsky_profiles"
208 referencedColumns: ["did"]
209 },
210 ]
211 }
212 custom_domain_routes: {
213 Row: {
214 created_at: string
215 domain: string
216 edit_permission_token: string
217 id: string
218 route: string
219 view_permission_token: string
220 }
221 Insert: {
222 created_at?: string
223 domain: string
224 edit_permission_token: string
225 id?: string
226 route: string
227 view_permission_token: string
228 }
229 Update: {
230 created_at?: string
231 domain?: string
232 edit_permission_token?: string
233 id?: string
234 route?: string
235 view_permission_token?: string
236 }
237 Relationships: [
238 {
239 foreignKeyName: "custom_domain_routes_domain_fkey"
240 columns: ["domain"]
241 isOneToOne: false
242 referencedRelation: "custom_domains"
243 referencedColumns: ["domain"]
244 },
245 {
246 foreignKeyName: "custom_domain_routes_edit_permission_token_fkey"
247 columns: ["edit_permission_token"]
248 isOneToOne: false
249 referencedRelation: "permission_tokens"
250 referencedColumns: ["id"]
251 },
252 {
253 foreignKeyName: "custom_domain_routes_view_permission_token_fkey"
254 columns: ["view_permission_token"]
255 isOneToOne: false
256 referencedRelation: "permission_tokens"
257 referencedColumns: ["id"]
258 },
259 ]
260 }
261 custom_domains: {
262 Row: {
263 confirmed: boolean
264 created_at: string
265 domain: string
266 identity: string | null
267 identity_id: string | null
268 }
269 Insert: {
270 confirmed: boolean
271 created_at?: string
272 domain: string
273 identity?: string | null
274 identity_id?: string | null
275 }
276 Update: {
277 confirmed?: boolean
278 created_at?: string
279 domain?: string
280 identity?: string | null
281 identity_id?: string | null
282 }
283 Relationships: [
284 {
285 foreignKeyName: "custom_domains_identity_fkey"
286 columns: ["identity"]
287 isOneToOne: false
288 referencedRelation: "identities"
289 referencedColumns: ["email"]
290 },
291 {
292 foreignKeyName: "custom_domains_identity_id_fkey"
293 columns: ["identity_id"]
294 isOneToOne: false
295 referencedRelation: "identities"
296 referencedColumns: ["id"]
297 },
298 ]
299 }
300 document_mentions_in_bsky: {
301 Row: {
302 document: string
303 indexed_at: string
304 link: string
305 uri: string
306 }
307 Insert: {
308 document: string
309 indexed_at?: string
310 link: string
311 uri: string
312 }
313 Update: {
314 document?: string
315 indexed_at?: string
316 link?: string
317 uri?: string
318 }
319 Relationships: [
320 {
321 foreignKeyName: "document_mentions_in_bsky_document_fkey"
322 columns: ["document"]
323 isOneToOne: false
324 referencedRelation: "documents"
325 referencedColumns: ["uri"]
326 },
327 {
328 foreignKeyName: "document_mentions_in_bsky_uri_fkey"
329 columns: ["uri"]
330 isOneToOne: false
331 referencedRelation: "bsky_posts"
332 referencedColumns: ["uri"]
333 },
334 ]
335 }
336 documents: {
337 Row: {
338 bsky_like_count: number
339 data: Json
340 indexed: boolean
341 indexed_at: string
342 recommend_count: number
343 sort_date: string
344 uri: string
345 }
346 Insert: {
347 bsky_like_count?: number
348 data: Json
349 indexed?: boolean
350 indexed_at?: string
351 recommend_count?: number
352 sort_date?: string
353 uri: string
354 }
355 Update: {
356 bsky_like_count?: number
357 data?: Json
358 indexed?: boolean
359 indexed_at?: string
360 recommend_count?: number
361 sort_date?: string
362 uri?: string
363 }
364 Relationships: []
365 }
366 documents_in_publications: {
367 Row: {
368 document: string
369 indexed_at: string
370 publication: string
371 }
372 Insert: {
373 document: string
374 indexed_at?: string
375 publication: string
376 }
377 Update: {
378 document?: string
379 indexed_at?: string
380 publication?: string
381 }
382 Relationships: [
383 {
384 foreignKeyName: "documents_in_publications_document_fkey"
385 columns: ["document"]
386 isOneToOne: false
387 referencedRelation: "documents"
388 referencedColumns: ["uri"]
389 },
390 {
391 foreignKeyName: "documents_in_publications_publication_fkey"
392 columns: ["publication"]
393 isOneToOne: false
394 referencedRelation: "publications"
395 referencedColumns: ["uri"]
396 },
397 ]
398 }
399 email_auth_tokens: {
400 Row: {
401 confirmation_code: string
402 confirmed: boolean
403 created_at: string
404 email: string | null
405 id: string
406 identity: string | null
407 }
408 Insert: {
409 confirmation_code: string
410 confirmed?: boolean
411 created_at?: string
412 email?: string | null
413 id?: string
414 identity?: string | null
415 }
416 Update: {
417 confirmation_code?: string
418 confirmed?: boolean
419 created_at?: string
420 email?: string | null
421 id?: string
422 identity?: string | null
423 }
424 Relationships: [
425 {
426 foreignKeyName: "email_auth_tokens_identity_fkey"
427 columns: ["identity"]
428 isOneToOne: false
429 referencedRelation: "identities"
430 referencedColumns: ["id"]
431 },
432 ]
433 }
434 email_subscriptions_to_entity: {
435 Row: {
436 confirmation_code: string
437 confirmed: boolean
438 created_at: string
439 email: string
440 entity: string
441 id: string
442 token: string
443 }
444 Insert: {
445 confirmation_code: string
446 confirmed?: boolean
447 created_at?: string
448 email: string
449 entity: string
450 id?: string
451 token: string
452 }
453 Update: {
454 confirmation_code?: string
455 confirmed?: boolean
456 created_at?: string
457 email?: string
458 entity?: string
459 id?: string
460 token?: string
461 }
462 Relationships: [
463 {
464 foreignKeyName: "email_subscriptions_to_entity_entity_fkey"
465 columns: ["entity"]
466 isOneToOne: false
467 referencedRelation: "entities"
468 referencedColumns: ["id"]
469 },
470 {
471 foreignKeyName: "email_subscriptions_to_entity_token_fkey"
472 columns: ["token"]
473 isOneToOne: false
474 referencedRelation: "permission_tokens"
475 referencedColumns: ["id"]
476 },
477 ]
478 }
479 entities: {
480 Row: {
481 created_at: string
482 id: string
483 set: string
484 }
485 Insert: {
486 created_at?: string
487 id: string
488 set: string
489 }
490 Update: {
491 created_at?: string
492 id?: string
493 set?: string
494 }
495 Relationships: [
496 {
497 foreignKeyName: "entities_set_fkey"
498 columns: ["set"]
499 isOneToOne: false
500 referencedRelation: "entity_sets"
501 referencedColumns: ["id"]
502 },
503 ]
504 }
505 entity_sets: {
506 Row: {
507 created_at: string
508 id: string
509 }
510 Insert: {
511 created_at?: string
512 id?: string
513 }
514 Update: {
515 created_at?: string
516 id?: string
517 }
518 Relationships: []
519 }
520 facts: {
521 Row: {
522 attribute: string
523 created_at: string
524 data: Json
525 entity: string
526 id: string
527 updated_at: string | null
528 version: number
529 }
530 Insert: {
531 attribute: string
532 created_at?: string
533 data: Json
534 entity: string
535 id: string
536 updated_at?: string | null
537 version?: number
538 }
539 Update: {
540 attribute?: string
541 created_at?: string
542 data?: Json
543 entity?: string
544 id?: string
545 updated_at?: string | null
546 version?: number
547 }
548 Relationships: [
549 {
550 foreignKeyName: "facts_entity_fkey"
551 columns: ["entity"]
552 isOneToOne: false
553 referencedRelation: "entities"
554 referencedColumns: ["id"]
555 },
556 ]
557 }
558 identities: {
559 Row: {
560 atp_did: string | null
561 created_at: string
562 email: string | null
563 home_page: string
564 id: string
565 interface_state: Json | null
566 metadata: Json | null
567 }
568 Insert: {
569 atp_did?: string | null
570 created_at?: string
571 email?: string | null
572 home_page?: string
573 id?: string
574 interface_state?: Json | null
575 metadata?: Json | null
576 }
577 Update: {
578 atp_did?: string | null
579 created_at?: string
580 email?: string | null
581 home_page?: string
582 id?: string
583 interface_state?: Json | null
584 metadata?: Json | null
585 }
586 Relationships: [
587 {
588 foreignKeyName: "identities_home_page_fkey"
589 columns: ["home_page"]
590 isOneToOne: false
591 referencedRelation: "permission_tokens"
592 referencedColumns: ["id"]
593 },
594 ]
595 }
596 leaflets_in_publications: {
597 Row: {
598 archived: boolean | null
599 cover_image: string | null
600 description: string
601 doc: string | null
602 leaflet: string
603 preferences: Json | null
604 publication: string
605 tags: string[] | null
606 title: string
607 }
608 Insert: {
609 archived?: boolean | null
610 cover_image?: string | null
611 description?: string
612 doc?: string | null
613 leaflet: string
614 preferences?: Json | null
615 publication: string
616 tags?: string[] | null
617 title?: string
618 }
619 Update: {
620 archived?: boolean | null
621 cover_image?: string | null
622 description?: string
623 doc?: string | null
624 leaflet?: string
625 preferences?: Json | null
626 publication?: string
627 tags?: string[] | null
628 title?: string
629 }
630 Relationships: [
631 {
632 foreignKeyName: "leaflets_in_publications_doc_fkey"
633 columns: ["doc"]
634 isOneToOne: false
635 referencedRelation: "documents"
636 referencedColumns: ["uri"]
637 },
638 {
639 foreignKeyName: "leaflets_in_publications_leaflet_fkey"
640 columns: ["leaflet"]
641 isOneToOne: false
642 referencedRelation: "permission_tokens"
643 referencedColumns: ["id"]
644 },
645 {
646 foreignKeyName: "leaflets_in_publications_publication_fkey"
647 columns: ["publication"]
648 isOneToOne: false
649 referencedRelation: "publications"
650 referencedColumns: ["uri"]
651 },
652 ]
653 }
654 leaflets_to_documents: {
655 Row: {
656 archived: boolean | null
657 cover_image: string | null
658 created_at: string
659 description: string
660 document: string
661 leaflet: string
662 preferences: Json | null
663 tags: string[] | null
664 title: string
665 }
666 Insert: {
667 archived?: boolean | null
668 cover_image?: string | null
669 created_at?: string
670 description?: string
671 document: string
672 leaflet: string
673 preferences?: Json | null
674 tags?: string[] | null
675 title?: string
676 }
677 Update: {
678 archived?: boolean | null
679 cover_image?: string | null
680 created_at?: string
681 description?: string
682 document?: string
683 leaflet?: string
684 preferences?: Json | null
685 tags?: string[] | null
686 title?: string
687 }
688 Relationships: [
689 {
690 foreignKeyName: "leaflets_to_documents_document_fkey"
691 columns: ["document"]
692 isOneToOne: false
693 referencedRelation: "documents"
694 referencedColumns: ["uri"]
695 },
696 {
697 foreignKeyName: "leaflets_to_documents_leaflet_fkey"
698 columns: ["leaflet"]
699 isOneToOne: false
700 referencedRelation: "permission_tokens"
701 referencedColumns: ["id"]
702 },
703 ]
704 }
705 mention_service_configs: {
706 Row: {
707 identity_did: string
708 record: Json
709 uri: string
710 }
711 Insert: {
712 identity_did: string
713 record: Json
714 uri: string
715 }
716 Update: {
717 identity_did?: string
718 record?: Json
719 uri?: string
720 }
721 Relationships: []
722 }
723 mention_services: {
724 Row: {
725 identity_did: string
726 record: Json
727 uri: string
728 }
729 Insert: {
730 identity_did: string
731 record: Json
732 uri: string
733 }
734 Update: {
735 identity_did?: string
736 record?: Json
737 uri?: string
738 }
739 Relationships: []
740 }
741 notifications: {
742 Row: {
743 created_at: string
744 data: Json
745 id: string
746 read: boolean
747 recipient: string
748 }
749 Insert: {
750 created_at?: string
751 data: Json
752 id: string
753 read?: boolean
754 recipient: string
755 }
756 Update: {
757 created_at?: string
758 data?: Json
759 id?: string
760 read?: boolean
761 recipient?: string
762 }
763 Relationships: [
764 {
765 foreignKeyName: "notifications_recipient_fkey"
766 columns: ["recipient"]
767 isOneToOne: false
768 referencedRelation: "identities"
769 referencedColumns: ["atp_did"]
770 },
771 ]
772 }
773 oauth_session_store: {
774 Row: {
775 key: string
776 session: Json
777 }
778 Insert: {
779 key: string
780 session: Json
781 }
782 Update: {
783 key?: string
784 session?: Json
785 }
786 Relationships: []
787 }
788 oauth_state_store: {
789 Row: {
790 key: string
791 state: Json
792 }
793 Insert: {
794 key: string
795 state: Json
796 }
797 Update: {
798 key?: string
799 state?: Json
800 }
801 Relationships: []
802 }
803 permission_token_on_homepage: {
804 Row: {
805 archived: boolean | null
806 created_at: string
807 identity: string
808 token: string
809 }
810 Insert: {
811 archived?: boolean | null
812 created_at?: string
813 identity: string
814 token: string
815 }
816 Update: {
817 archived?: boolean | null
818 created_at?: string
819 identity?: string
820 token?: string
821 }
822 Relationships: [
823 {
824 foreignKeyName: "permission_token_creator_identity_fkey"
825 columns: ["identity"]
826 isOneToOne: false
827 referencedRelation: "identities"
828 referencedColumns: ["id"]
829 },
830 {
831 foreignKeyName: "permission_token_on_homepage_token_fkey"
832 columns: ["token"]
833 isOneToOne: false
834 referencedRelation: "permission_tokens"
835 referencedColumns: ["id"]
836 },
837 ]
838 }
839 permission_token_rights: {
840 Row: {
841 change_entity_set: boolean
842 create_token: boolean
843 created_at: string
844 entity_set: string
845 read: boolean
846 token: string
847 write: boolean
848 }
849 Insert: {
850 change_entity_set?: boolean
851 create_token?: boolean
852 created_at?: string
853 entity_set: string
854 read?: boolean
855 token: string
856 write?: boolean
857 }
858 Update: {
859 change_entity_set?: boolean
860 create_token?: boolean
861 created_at?: string
862 entity_set?: string
863 read?: boolean
864 token?: string
865 write?: boolean
866 }
867 Relationships: [
868 {
869 foreignKeyName: "permission_token_rights_entity_set_fkey"
870 columns: ["entity_set"]
871 isOneToOne: false
872 referencedRelation: "entity_sets"
873 referencedColumns: ["id"]
874 },
875 {
876 foreignKeyName: "permission_token_rights_token_fkey"
877 columns: ["token"]
878 isOneToOne: false
879 referencedRelation: "permission_tokens"
880 referencedColumns: ["id"]
881 },
882 ]
883 }
884 permission_tokens: {
885 Row: {
886 blocked_by_admin: boolean | null
887 id: string
888 root_entity: string
889 }
890 Insert: {
891 blocked_by_admin?: boolean | null
892 id?: string
893 root_entity: string
894 }
895 Update: {
896 blocked_by_admin?: boolean | null
897 id?: string
898 root_entity?: string
899 }
900 Relationships: [
901 {
902 foreignKeyName: "permission_tokens_root_entity_fkey"
903 columns: ["root_entity"]
904 isOneToOne: false
905 referencedRelation: "entities"
906 referencedColumns: ["id"]
907 },
908 ]
909 }
910 phone_number_auth_tokens: {
911 Row: {
912 confirmation_code: string
913 confirmed: boolean
914 country_code: string
915 created_at: string
916 id: string
917 phone_number: string
918 }
919 Insert: {
920 confirmation_code: string
921 confirmed?: boolean
922 country_code: string
923 created_at?: string
924 id?: string
925 phone_number: string
926 }
927 Update: {
928 confirmation_code?: string
929 confirmed?: boolean
930 country_code?: string
931 created_at?: string
932 id?: string
933 phone_number?: string
934 }
935 Relationships: []
936 }
937 phone_rsvps_to_entity: {
938 Row: {
939 country_code: string
940 created_at: string
941 entity: string
942 id: string
943 name: string
944 phone_number: string
945 plus_ones: number
946 status: Database["public"]["Enums"]["rsvp_status"]
947 }
948 Insert: {
949 country_code: string
950 created_at?: string
951 entity: string
952 id?: string
953 name?: string
954 phone_number: string
955 plus_ones?: number
956 status: Database["public"]["Enums"]["rsvp_status"]
957 }
958 Update: {
959 country_code?: string
960 created_at?: string
961 entity?: string
962 id?: string
963 name?: string
964 phone_number?: string
965 plus_ones?: number
966 status?: Database["public"]["Enums"]["rsvp_status"]
967 }
968 Relationships: [
969 {
970 foreignKeyName: "phone_rsvps_to_entity_entity_fkey"
971 columns: ["entity"]
972 isOneToOne: false
973 referencedRelation: "entities"
974 referencedColumns: ["id"]
975 },
976 ]
977 }
978 poll_votes_on_entity: {
979 Row: {
980 created_at: string
981 id: string
982 option_entity: string
983 poll_entity: string
984 voter_token: string
985 }
986 Insert: {
987 created_at?: string
988 id?: string
989 option_entity: string
990 poll_entity: string
991 voter_token: string
992 }
993 Update: {
994 created_at?: string
995 id?: string
996 option_entity?: string
997 poll_entity?: string
998 voter_token?: string
999 }
1000 Relationships: [
1001 {
1002 foreignKeyName: "poll_votes_on_entity_option_entity_fkey"
1003 columns: ["option_entity"]
1004 isOneToOne: false
1005 referencedRelation: "entities"
1006 referencedColumns: ["id"]
1007 },
1008 {
1009 foreignKeyName: "poll_votes_on_entity_poll_entity_fkey"
1010 columns: ["poll_entity"]
1011 isOneToOne: false
1012 referencedRelation: "entities"
1013 referencedColumns: ["id"]
1014 },
1015 ]
1016 }
1017 publication_domains: {
1018 Row: {
1019 created_at: string
1020 domain: string
1021 identity: string
1022 publication: string
1023 }
1024 Insert: {
1025 created_at?: string
1026 domain: string
1027 identity: string
1028 publication: string
1029 }
1030 Update: {
1031 created_at?: string
1032 domain?: string
1033 identity?: string
1034 publication?: string
1035 }
1036 Relationships: [
1037 {
1038 foreignKeyName: "publication_domains_domain_fkey"
1039 columns: ["domain"]
1040 isOneToOne: false
1041 referencedRelation: "custom_domains"
1042 referencedColumns: ["domain"]
1043 },
1044 {
1045 foreignKeyName: "publication_domains_identity_fkey"
1046 columns: ["identity"]
1047 isOneToOne: false
1048 referencedRelation: "identities"
1049 referencedColumns: ["atp_did"]
1050 },
1051 {
1052 foreignKeyName: "publication_domains_publication_fkey"
1053 columns: ["publication"]
1054 isOneToOne: false
1055 referencedRelation: "publications"
1056 referencedColumns: ["uri"]
1057 },
1058 ]
1059 }
1060 publication_subscriptions: {
1061 Row: {
1062 created_at: string
1063 identity: string
1064 publication: string
1065 record: Json
1066 uri: string
1067 }
1068 Insert: {
1069 created_at?: string
1070 identity: string
1071 publication: string
1072 record: Json
1073 uri: string
1074 }
1075 Update: {
1076 created_at?: string
1077 identity?: string
1078 publication?: string
1079 record?: Json
1080 uri?: string
1081 }
1082 Relationships: [
1083 {
1084 foreignKeyName: "publication_subscriptions_identity_fkey"
1085 columns: ["identity"]
1086 isOneToOne: false
1087 referencedRelation: "identities"
1088 referencedColumns: ["atp_did"]
1089 },
1090 {
1091 foreignKeyName: "publication_subscriptions_publication_fkey"
1092 columns: ["publication"]
1093 isOneToOne: false
1094 referencedRelation: "publications"
1095 referencedColumns: ["uri"]
1096 },
1097 ]
1098 }
1099 publications: {
1100 Row: {
1101 identity_did: string
1102 indexed_at: string
1103 name: string
1104 record: Json | null
1105 uri: string
1106 }
1107 Insert: {
1108 identity_did: string
1109 indexed_at?: string
1110 name: string
1111 record?: Json | null
1112 uri: string
1113 }
1114 Update: {
1115 identity_did?: string
1116 indexed_at?: string
1117 name?: string
1118 record?: Json | null
1119 uri?: string
1120 }
1121 Relationships: [
1122 {
1123 foreignKeyName: "publications_identity_did_fkey"
1124 columns: ["identity_did"]
1125 isOneToOne: false
1126 referencedRelation: "identities"
1127 referencedColumns: ["atp_did"]
1128 },
1129 ]
1130 }
1131 recommends_on_documents: {
1132 Row: {
1133 document: string
1134 indexed_at: string
1135 recommender_did: string
1136 record: Json
1137 uri: string
1138 }
1139 Insert: {
1140 document: string
1141 indexed_at?: string
1142 recommender_did: string
1143 record: Json
1144 uri: string
1145 }
1146 Update: {
1147 document?: string
1148 indexed_at?: string
1149 recommender_did?: string
1150 record?: Json
1151 uri?: string
1152 }
1153 Relationships: [
1154 {
1155 foreignKeyName: "recommends_on_documents_document_fkey"
1156 columns: ["document"]
1157 isOneToOne: false
1158 referencedRelation: "documents"
1159 referencedColumns: ["uri"]
1160 },
1161 {
1162 foreignKeyName: "recommends_on_documents_recommender_did_fkey"
1163 columns: ["recommender_did"]
1164 isOneToOne: false
1165 referencedRelation: "identities"
1166 referencedColumns: ["atp_did"]
1167 },
1168 ]
1169 }
1170 replicache_clients: {
1171 Row: {
1172 client_group: string
1173 client_id: string
1174 last_mutation: number
1175 }
1176 Insert: {
1177 client_group: string
1178 client_id: string
1179 last_mutation: number
1180 }
1181 Update: {
1182 client_group?: string
1183 client_id?: string
1184 last_mutation?: number
1185 }
1186 Relationships: []
1187 }
1188 site_standard_documents: {
1189 Row: {
1190 data: Json
1191 identity_did: string
1192 indexed_at: string
1193 uri: string
1194 }
1195 Insert: {
1196 data: Json
1197 identity_did: string
1198 indexed_at?: string
1199 uri: string
1200 }
1201 Update: {
1202 data?: Json
1203 identity_did?: string
1204 indexed_at?: string
1205 uri?: string
1206 }
1207 Relationships: [
1208 {
1209 foreignKeyName: "site_standard_documents_identity_did_fkey"
1210 columns: ["identity_did"]
1211 isOneToOne: false
1212 referencedRelation: "identities"
1213 referencedColumns: ["atp_did"]
1214 },
1215 ]
1216 }
1217 site_standard_documents_in_publications: {
1218 Row: {
1219 document: string
1220 indexed_at: string
1221 publication: string
1222 }
1223 Insert: {
1224 document: string
1225 indexed_at?: string
1226 publication: string
1227 }
1228 Update: {
1229 document?: string
1230 indexed_at?: string
1231 publication?: string
1232 }
1233 Relationships: [
1234 {
1235 foreignKeyName: "site_standard_documents_in_publications_document_fkey"
1236 columns: ["document"]
1237 isOneToOne: false
1238 referencedRelation: "site_standard_documents"
1239 referencedColumns: ["uri"]
1240 },
1241 {
1242 foreignKeyName: "site_standard_documents_in_publications_publication_fkey"
1243 columns: ["publication"]
1244 isOneToOne: false
1245 referencedRelation: "site_standard_publications"
1246 referencedColumns: ["uri"]
1247 },
1248 ]
1249 }
1250 site_standard_publications: {
1251 Row: {
1252 data: Json
1253 identity_did: string
1254 indexed_at: string
1255 uri: string
1256 }
1257 Insert: {
1258 data: Json
1259 identity_did: string
1260 indexed_at?: string
1261 uri: string
1262 }
1263 Update: {
1264 data?: Json
1265 identity_did?: string
1266 indexed_at?: string
1267 uri?: string
1268 }
1269 Relationships: [
1270 {
1271 foreignKeyName: "site_standard_publications_identity_did_fkey"
1272 columns: ["identity_did"]
1273 isOneToOne: false
1274 referencedRelation: "identities"
1275 referencedColumns: ["atp_did"]
1276 },
1277 ]
1278 }
1279 site_standard_subscriptions: {
1280 Row: {
1281 created_at: string
1282 identity: string
1283 publication: string
1284 record: Json
1285 uri: string
1286 }
1287 Insert: {
1288 created_at?: string
1289 identity: string
1290 publication: string
1291 record: Json
1292 uri: string
1293 }
1294 Update: {
1295 created_at?: string
1296 identity?: string
1297 publication?: string
1298 record?: Json
1299 uri?: string
1300 }
1301 Relationships: [
1302 {
1303 foreignKeyName: "site_standard_subscriptions_identity_fkey"
1304 columns: ["identity"]
1305 isOneToOne: false
1306 referencedRelation: "identities"
1307 referencedColumns: ["atp_did"]
1308 },
1309 {
1310 foreignKeyName: "site_standard_subscriptions_publication_fkey"
1311 columns: ["publication"]
1312 isOneToOne: false
1313 referencedRelation: "site_standard_publications"
1314 referencedColumns: ["uri"]
1315 },
1316 ]
1317 }
1318 subscribers_to_publications: {
1319 Row: {
1320 created_at: string
1321 identity: string
1322 publication: string
1323 }
1324 Insert: {
1325 created_at?: string
1326 identity: string
1327 publication: string
1328 }
1329 Update: {
1330 created_at?: string
1331 identity?: string
1332 publication?: string
1333 }
1334 Relationships: [
1335 {
1336 foreignKeyName: "subscribers_to_publications_identity_fkey"
1337 columns: ["identity"]
1338 isOneToOne: false
1339 referencedRelation: "identities"
1340 referencedColumns: ["email"]
1341 },
1342 {
1343 foreignKeyName: "subscribers_to_publications_publication_fkey"
1344 columns: ["publication"]
1345 isOneToOne: false
1346 referencedRelation: "publications"
1347 referencedColumns: ["uri"]
1348 },
1349 ]
1350 }
1351 user_entitlements: {
1352 Row: {
1353 entitlement_key: string
1354 expires_at: string | null
1355 granted_at: string
1356 identity_id: string
1357 metadata: Json | null
1358 source: string | null
1359 }
1360 Insert: {
1361 entitlement_key: string
1362 expires_at?: string | null
1363 granted_at?: string
1364 identity_id: string
1365 metadata?: Json | null
1366 source?: string | null
1367 }
1368 Update: {
1369 entitlement_key?: string
1370 expires_at?: string | null
1371 granted_at?: string
1372 identity_id?: string
1373 metadata?: Json | null
1374 source?: string | null
1375 }
1376 Relationships: [
1377 {
1378 foreignKeyName: "user_entitlements_identity_id_fkey"
1379 columns: ["identity_id"]
1380 isOneToOne: false
1381 referencedRelation: "identities"
1382 referencedColumns: ["id"]
1383 },
1384 ]
1385 }
1386 user_subscriptions: {
1387 Row: {
1388 created_at: string
1389 current_period_end: string | null
1390 identity_id: string
1391 plan: string | null
1392 status: string | null
1393 stripe_customer_id: string
1394 stripe_subscription_id: string | null
1395 updated_at: string
1396 }
1397 Insert: {
1398 created_at?: string
1399 current_period_end?: string | null
1400 identity_id: string
1401 plan?: string | null
1402 status?: string | null
1403 stripe_customer_id: string
1404 stripe_subscription_id?: string | null
1405 updated_at?: string
1406 }
1407 Update: {
1408 created_at?: string
1409 current_period_end?: string | null
1410 identity_id?: string
1411 plan?: string | null
1412 status?: string | null
1413 stripe_customer_id?: string
1414 stripe_subscription_id?: string | null
1415 updated_at?: string
1416 }
1417 Relationships: [
1418 {
1419 foreignKeyName: "user_subscriptions_identity_id_fkey"
1420 columns: ["identity_id"]
1421 isOneToOne: true
1422 referencedRelation: "identities"
1423 referencedColumns: ["id"]
1424 },
1425 ]
1426 }
1427 }
1428 Views: {
1429 [_ in never]: never
1430 }
1431 Functions: {
1432 create_identity_homepage: {
1433 Args: Record<PropertyKey, never>
1434 Returns: string
1435 }
1436 get_facts: {
1437 Args: {
1438 root: string
1439 }
1440 Returns: {
1441 attribute: string
1442 created_at: string
1443 data: Json
1444 entity: string
1445 id: string
1446 updated_at: string | null
1447 version: number
1448 }[]
1449 }
1450 get_facts_for_roots: {
1451 Args: {
1452 roots: string[]
1453 max_depth: number
1454 }
1455 Returns: {
1456 root_id: string
1457 id: string
1458 entity: string
1459 attribute: string
1460 data: Json
1461 created_at: string
1462 updated_at: string
1463 version: number
1464 }[]
1465 }
1466 get_facts_with_depth: {
1467 Args: {
1468 root: string
1469 max_depth: number
1470 }
1471 Returns: {
1472 like: unknown
1473 }[]
1474 }
1475 get_profile_posts: {
1476 Args: {
1477 p_did: string
1478 p_cursor_sort_date?: string | null
1479 p_cursor_uri?: string | null
1480 p_limit?: number
1481 }
1482 Returns: {
1483 uri: string
1484 data: Json
1485 sort_date: string
1486 comments_count: number
1487 mentions_count: number
1488 recommends_count: number
1489 publication_uri: string
1490 publication_record: Json
1491 publication_name: string
1492 }[]
1493 }
1494 get_reader_feed: {
1495 Args: {
1496 p_identity: string
1497 p_cursor_timestamp?: string
1498 p_cursor_uri?: string
1499 p_limit?: number
1500 }
1501 Returns: {
1502 uri: string
1503 data: Json
1504 sort_date: string
1505 comments_count: number
1506 mentions_count: number
1507 recommends_count: number
1508 publication_uri: string
1509 publication_record: Json
1510 publication_name: string
1511 }[]
1512 }
1513 parse_iso_timestamp: {
1514 Args: {
1515 "": string
1516 }
1517 Returns: string
1518 }
1519 get_leaflet_page_data: {
1520 Args: {
1521 p_token_id: string
1522 }
1523 Returns: Database["public"]["CompositeTypes"]["leaflet_page_result"]
1524 }
1525 pull_data: {
1526 Args: {
1527 token_id: string
1528 client_group_id: string
1529 }
1530 Returns: Database["public"]["CompositeTypes"]["pull_result"]
1531 }
1532 search_tags: {
1533 Args: {
1534 search_query: string
1535 }
1536 Returns: {
1537 name: string
1538 document_count: number
1539 }[]
1540 }
1541 }
1542 Enums: {
1543 rsvp_status: "GOING" | "NOT_GOING" | "MAYBE"
1544 }
1545 CompositeTypes: {
1546 leaflet_page_result: {
1547 permission_token: Json | null
1548 permission_token_rights: Json | null
1549 leaflets_in_publications: Json | null
1550 leaflets_to_documents: Json | null
1551 custom_domain_routes: Json | null
1552 facts: Json | null
1553 }
1554 pull_result: {
1555 client_groups: Json | null
1556 facts: Json | null
1557 publications: Json | null
1558 }
1559 }
1560 }
1561 storage: {
1562 Tables: {
1563 buckets: {
1564 Row: {
1565 allowed_mime_types: string[] | null
1566 avif_autodetection: boolean | null
1567 created_at: string | null
1568 file_size_limit: number | null
1569 id: string
1570 name: string
1571 owner: string | null
1572 owner_id: string | null
1573 public: boolean | null
1574 updated_at: string | null
1575 }
1576 Insert: {
1577 allowed_mime_types?: string[] | null
1578 avif_autodetection?: boolean | null
1579 created_at?: string | null
1580 file_size_limit?: number | null
1581 id: string
1582 name: string
1583 owner?: string | null
1584 owner_id?: string | null
1585 public?: boolean | null
1586 updated_at?: string | null
1587 }
1588 Update: {
1589 allowed_mime_types?: string[] | null
1590 avif_autodetection?: boolean | null
1591 created_at?: string | null
1592 file_size_limit?: number | null
1593 id?: string
1594 name?: string
1595 owner?: string | null
1596 owner_id?: string | null
1597 public?: boolean | null
1598 updated_at?: string | null
1599 }
1600 Relationships: []
1601 }
1602 migrations: {
1603 Row: {
1604 executed_at: string | null
1605 hash: string
1606 id: number
1607 name: string
1608 }
1609 Insert: {
1610 executed_at?: string | null
1611 hash: string
1612 id: number
1613 name: string
1614 }
1615 Update: {
1616 executed_at?: string | null
1617 hash?: string
1618 id?: number
1619 name?: string
1620 }
1621 Relationships: []
1622 }
1623 objects: {
1624 Row: {
1625 bucket_id: string | null
1626 created_at: string | null
1627 id: string
1628 last_accessed_at: string | null
1629 metadata: Json | null
1630 name: string | null
1631 owner: string | null
1632 owner_id: string | null
1633 path_tokens: string[] | null
1634 updated_at: string | null
1635 version: string | null
1636 }
1637 Insert: {
1638 bucket_id?: string | null
1639 created_at?: string | null
1640 id?: string
1641 last_accessed_at?: string | null
1642 metadata?: Json | null
1643 name?: string | null
1644 owner?: string | null
1645 owner_id?: string | null
1646 path_tokens?: string[] | null
1647 updated_at?: string | null
1648 version?: string | null
1649 }
1650 Update: {
1651 bucket_id?: string | null
1652 created_at?: string | null
1653 id?: string
1654 last_accessed_at?: string | null
1655 metadata?: Json | null
1656 name?: string | null
1657 owner?: string | null
1658 owner_id?: string | null
1659 path_tokens?: string[] | null
1660 updated_at?: string | null
1661 version?: string | null
1662 }
1663 Relationships: [
1664 {
1665 foreignKeyName: "objects_bucketId_fkey"
1666 columns: ["bucket_id"]
1667 isOneToOne: false
1668 referencedRelation: "buckets"
1669 referencedColumns: ["id"]
1670 },
1671 ]
1672 }
1673 s3_multipart_uploads: {
1674 Row: {
1675 bucket_id: string
1676 created_at: string
1677 id: string
1678 in_progress_size: number
1679 key: string
1680 owner_id: string | null
1681 upload_signature: string
1682 version: string
1683 }
1684 Insert: {
1685 bucket_id: string
1686 created_at?: string
1687 id: string
1688 in_progress_size?: number
1689 key: string
1690 owner_id?: string | null
1691 upload_signature: string
1692 version: string
1693 }
1694 Update: {
1695 bucket_id?: string
1696 created_at?: string
1697 id?: string
1698 in_progress_size?: number
1699 key?: string
1700 owner_id?: string | null
1701 upload_signature?: string
1702 version?: string
1703 }
1704 Relationships: [
1705 {
1706 foreignKeyName: "s3_multipart_uploads_bucket_id_fkey"
1707 columns: ["bucket_id"]
1708 isOneToOne: false
1709 referencedRelation: "buckets"
1710 referencedColumns: ["id"]
1711 },
1712 ]
1713 }
1714 s3_multipart_uploads_parts: {
1715 Row: {
1716 bucket_id: string
1717 created_at: string
1718 etag: string
1719 id: string
1720 key: string
1721 owner_id: string | null
1722 part_number: number
1723 size: number
1724 upload_id: string
1725 version: string
1726 }
1727 Insert: {
1728 bucket_id: string
1729 created_at?: string
1730 etag: string
1731 id?: string
1732 key: string
1733 owner_id?: string | null
1734 part_number: number
1735 size?: number
1736 upload_id: string
1737 version: string
1738 }
1739 Update: {
1740 bucket_id?: string
1741 created_at?: string
1742 etag?: string
1743 id?: string
1744 key?: string
1745 owner_id?: string | null
1746 part_number?: number
1747 size?: number
1748 upload_id?: string
1749 version?: string
1750 }
1751 Relationships: [
1752 {
1753 foreignKeyName: "s3_multipart_uploads_parts_bucket_id_fkey"
1754 columns: ["bucket_id"]
1755 isOneToOne: false
1756 referencedRelation: "buckets"
1757 referencedColumns: ["id"]
1758 },
1759 {
1760 foreignKeyName: "s3_multipart_uploads_parts_upload_id_fkey"
1761 columns: ["upload_id"]
1762 isOneToOne: false
1763 referencedRelation: "s3_multipart_uploads"
1764 referencedColumns: ["id"]
1765 },
1766 ]
1767 }
1768 }
1769 Views: {
1770 [_ in never]: never
1771 }
1772 Functions: {
1773 can_insert_object: {
1774 Args: {
1775 bucketid: string
1776 name: string
1777 owner: string
1778 metadata: Json
1779 }
1780 Returns: undefined
1781 }
1782 extension: {
1783 Args: {
1784 name: string
1785 }
1786 Returns: string
1787 }
1788 filename: {
1789 Args: {
1790 name: string
1791 }
1792 Returns: string
1793 }
1794 foldername: {
1795 Args: {
1796 name: string
1797 }
1798 Returns: string[]
1799 }
1800 get_size_by_bucket: {
1801 Args: Record<PropertyKey, never>
1802 Returns: {
1803 size: number
1804 bucket_id: string
1805 }[]
1806 }
1807 list_multipart_uploads_with_delimiter: {
1808 Args: {
1809 bucket_id: string
1810 prefix_param: string
1811 delimiter_param: string
1812 max_keys?: number
1813 next_key_token?: string
1814 next_upload_token?: string
1815 }
1816 Returns: {
1817 key: string
1818 id: string
1819 created_at: string
1820 }[]
1821 }
1822 list_objects_with_delimiter: {
1823 Args: {
1824 bucket_id: string
1825 prefix_param: string
1826 delimiter_param: string
1827 max_keys?: number
1828 start_after?: string
1829 next_token?: string
1830 }
1831 Returns: {
1832 name: string
1833 id: string
1834 metadata: Json
1835 updated_at: string
1836 }[]
1837 }
1838 search: {
1839 Args: {
1840 prefix: string
1841 bucketname: string
1842 limits?: number
1843 levels?: number
1844 offsets?: number
1845 search?: string
1846 sortcolumn?: string
1847 sortorder?: string
1848 }
1849 Returns: {
1850 name: string
1851 id: string
1852 updated_at: string
1853 created_at: string
1854 last_accessed_at: string
1855 metadata: Json
1856 }[]
1857 }
1858 }
1859 Enums: {
1860 [_ in never]: never
1861 }
1862 CompositeTypes: {
1863 [_ in never]: never
1864 }
1865 }
1866}
1867
1868type PublicSchema = Database[Extract<keyof Database, "public">]
1869
1870export type Tables<
1871 PublicTableNameOrOptions extends
1872 | keyof (PublicSchema["Tables"] & PublicSchema["Views"])
1873 | { schema: keyof Database },
1874 TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1875 ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1876 Database[PublicTableNameOrOptions["schema"]]["Views"])
1877 : never = never,
1878> = PublicTableNameOrOptions extends { schema: keyof Database }
1879 ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1880 Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
1881 Row: infer R
1882 }
1883 ? R
1884 : never
1885 : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] &
1886 PublicSchema["Views"])
1887 ? (PublicSchema["Tables"] &
1888 PublicSchema["Views"])[PublicTableNameOrOptions] extends {
1889 Row: infer R
1890 }
1891 ? R
1892 : never
1893 : never
1894
1895export type TablesInsert<
1896 PublicTableNameOrOptions extends
1897 | keyof PublicSchema["Tables"]
1898 | { schema: keyof Database },
1899 TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1900 ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1901 : never = never,
1902> = PublicTableNameOrOptions extends { schema: keyof Database }
1903 ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1904 Insert: infer I
1905 }
1906 ? I
1907 : never
1908 : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
1909 ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
1910 Insert: infer I
1911 }
1912 ? I
1913 : never
1914 : never
1915
1916export type TablesUpdate<
1917 PublicTableNameOrOptions extends
1918 | keyof PublicSchema["Tables"]
1919 | { schema: keyof Database },
1920 TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1921 ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1922 : never = never,
1923> = PublicTableNameOrOptions extends { schema: keyof Database }
1924 ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1925 Update: infer U
1926 }
1927 ? U
1928 : never
1929 : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
1930 ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
1931 Update: infer U
1932 }
1933 ? U
1934 : never
1935 : never
1936
1937export type Enums<
1938 PublicEnumNameOrOptions extends
1939 | keyof PublicSchema["Enums"]
1940 | { schema: keyof Database },
1941 EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
1942 ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
1943 : never = never,
1944> = PublicEnumNameOrOptions extends { schema: keyof Database }
1945 ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
1946 : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
1947 ? PublicSchema["Enums"][PublicEnumNameOrOptions]
1948 : never
1949