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 notifications: {
706 Row: {
707 created_at: string
708 data: Json
709 id: string
710 read: boolean
711 recipient: string
712 }
713 Insert: {
714 created_at?: string
715 data: Json
716 id: string
717 read?: boolean
718 recipient: string
719 }
720 Update: {
721 created_at?: string
722 data?: Json
723 id?: string
724 read?: boolean
725 recipient?: string
726 }
727 Relationships: [
728 {
729 foreignKeyName: "notifications_recipient_fkey"
730 columns: ["recipient"]
731 isOneToOne: false
732 referencedRelation: "identities"
733 referencedColumns: ["atp_did"]
734 },
735 ]
736 }
737 oauth_session_store: {
738 Row: {
739 key: string
740 session: Json
741 }
742 Insert: {
743 key: string
744 session: Json
745 }
746 Update: {
747 key?: string
748 session?: Json
749 }
750 Relationships: []
751 }
752 oauth_state_store: {
753 Row: {
754 key: string
755 state: Json
756 }
757 Insert: {
758 key: string
759 state: Json
760 }
761 Update: {
762 key?: string
763 state?: Json
764 }
765 Relationships: []
766 }
767 permission_token_on_homepage: {
768 Row: {
769 archived: boolean | null
770 created_at: string
771 identity: string
772 token: string
773 }
774 Insert: {
775 archived?: boolean | null
776 created_at?: string
777 identity: string
778 token: string
779 }
780 Update: {
781 archived?: boolean | null
782 created_at?: string
783 identity?: string
784 token?: string
785 }
786 Relationships: [
787 {
788 foreignKeyName: "permission_token_creator_identity_fkey"
789 columns: ["identity"]
790 isOneToOne: false
791 referencedRelation: "identities"
792 referencedColumns: ["id"]
793 },
794 {
795 foreignKeyName: "permission_token_on_homepage_token_fkey"
796 columns: ["token"]
797 isOneToOne: false
798 referencedRelation: "permission_tokens"
799 referencedColumns: ["id"]
800 },
801 ]
802 }
803 permission_token_rights: {
804 Row: {
805 change_entity_set: boolean
806 create_token: boolean
807 created_at: string
808 entity_set: string
809 read: boolean
810 token: string
811 write: boolean
812 }
813 Insert: {
814 change_entity_set?: boolean
815 create_token?: boolean
816 created_at?: string
817 entity_set: string
818 read?: boolean
819 token: string
820 write?: boolean
821 }
822 Update: {
823 change_entity_set?: boolean
824 create_token?: boolean
825 created_at?: string
826 entity_set?: string
827 read?: boolean
828 token?: string
829 write?: boolean
830 }
831 Relationships: [
832 {
833 foreignKeyName: "permission_token_rights_entity_set_fkey"
834 columns: ["entity_set"]
835 isOneToOne: false
836 referencedRelation: "entity_sets"
837 referencedColumns: ["id"]
838 },
839 {
840 foreignKeyName: "permission_token_rights_token_fkey"
841 columns: ["token"]
842 isOneToOne: false
843 referencedRelation: "permission_tokens"
844 referencedColumns: ["id"]
845 },
846 ]
847 }
848 permission_tokens: {
849 Row: {
850 blocked_by_admin: boolean | null
851 id: string
852 root_entity: string
853 }
854 Insert: {
855 blocked_by_admin?: boolean | null
856 id?: string
857 root_entity: string
858 }
859 Update: {
860 blocked_by_admin?: boolean | null
861 id?: string
862 root_entity?: string
863 }
864 Relationships: [
865 {
866 foreignKeyName: "permission_tokens_root_entity_fkey"
867 columns: ["root_entity"]
868 isOneToOne: false
869 referencedRelation: "entities"
870 referencedColumns: ["id"]
871 },
872 ]
873 }
874 phone_number_auth_tokens: {
875 Row: {
876 confirmation_code: string
877 confirmed: boolean
878 country_code: string
879 created_at: string
880 id: string
881 phone_number: string
882 }
883 Insert: {
884 confirmation_code: string
885 confirmed?: boolean
886 country_code: string
887 created_at?: string
888 id?: string
889 phone_number: string
890 }
891 Update: {
892 confirmation_code?: string
893 confirmed?: boolean
894 country_code?: string
895 created_at?: string
896 id?: string
897 phone_number?: string
898 }
899 Relationships: []
900 }
901 phone_rsvps_to_entity: {
902 Row: {
903 country_code: string
904 created_at: string
905 entity: string
906 id: string
907 name: string
908 phone_number: string
909 plus_ones: number
910 status: Database["public"]["Enums"]["rsvp_status"]
911 }
912 Insert: {
913 country_code: string
914 created_at?: string
915 entity: string
916 id?: string
917 name?: string
918 phone_number: string
919 plus_ones?: number
920 status: Database["public"]["Enums"]["rsvp_status"]
921 }
922 Update: {
923 country_code?: string
924 created_at?: string
925 entity?: string
926 id?: string
927 name?: string
928 phone_number?: string
929 plus_ones?: number
930 status?: Database["public"]["Enums"]["rsvp_status"]
931 }
932 Relationships: [
933 {
934 foreignKeyName: "phone_rsvps_to_entity_entity_fkey"
935 columns: ["entity"]
936 isOneToOne: false
937 referencedRelation: "entities"
938 referencedColumns: ["id"]
939 },
940 ]
941 }
942 poll_votes_on_entity: {
943 Row: {
944 created_at: string
945 id: string
946 option_entity: string
947 poll_entity: string
948 voter_token: string
949 }
950 Insert: {
951 created_at?: string
952 id?: string
953 option_entity: string
954 poll_entity: string
955 voter_token: string
956 }
957 Update: {
958 created_at?: string
959 id?: string
960 option_entity?: string
961 poll_entity?: string
962 voter_token?: string
963 }
964 Relationships: [
965 {
966 foreignKeyName: "poll_votes_on_entity_option_entity_fkey"
967 columns: ["option_entity"]
968 isOneToOne: false
969 referencedRelation: "entities"
970 referencedColumns: ["id"]
971 },
972 {
973 foreignKeyName: "poll_votes_on_entity_poll_entity_fkey"
974 columns: ["poll_entity"]
975 isOneToOne: false
976 referencedRelation: "entities"
977 referencedColumns: ["id"]
978 },
979 ]
980 }
981 publication_domains: {
982 Row: {
983 created_at: string
984 domain: string
985 identity: string
986 publication: string
987 }
988 Insert: {
989 created_at?: string
990 domain: string
991 identity: string
992 publication: string
993 }
994 Update: {
995 created_at?: string
996 domain?: string
997 identity?: string
998 publication?: string
999 }
1000 Relationships: [
1001 {
1002 foreignKeyName: "publication_domains_domain_fkey"
1003 columns: ["domain"]
1004 isOneToOne: false
1005 referencedRelation: "custom_domains"
1006 referencedColumns: ["domain"]
1007 },
1008 {
1009 foreignKeyName: "publication_domains_identity_fkey"
1010 columns: ["identity"]
1011 isOneToOne: false
1012 referencedRelation: "identities"
1013 referencedColumns: ["atp_did"]
1014 },
1015 {
1016 foreignKeyName: "publication_domains_publication_fkey"
1017 columns: ["publication"]
1018 isOneToOne: false
1019 referencedRelation: "publications"
1020 referencedColumns: ["uri"]
1021 },
1022 ]
1023 }
1024 publication_subscriptions: {
1025 Row: {
1026 created_at: string
1027 identity: string
1028 publication: string
1029 record: Json
1030 uri: string
1031 }
1032 Insert: {
1033 created_at?: string
1034 identity: string
1035 publication: string
1036 record: Json
1037 uri: string
1038 }
1039 Update: {
1040 created_at?: string
1041 identity?: string
1042 publication?: string
1043 record?: Json
1044 uri?: string
1045 }
1046 Relationships: [
1047 {
1048 foreignKeyName: "publication_subscriptions_identity_fkey"
1049 columns: ["identity"]
1050 isOneToOne: false
1051 referencedRelation: "identities"
1052 referencedColumns: ["atp_did"]
1053 },
1054 {
1055 foreignKeyName: "publication_subscriptions_publication_fkey"
1056 columns: ["publication"]
1057 isOneToOne: false
1058 referencedRelation: "publications"
1059 referencedColumns: ["uri"]
1060 },
1061 ]
1062 }
1063 publications: {
1064 Row: {
1065 identity_did: string
1066 indexed_at: string
1067 name: string
1068 record: Json | null
1069 uri: string
1070 }
1071 Insert: {
1072 identity_did: string
1073 indexed_at?: string
1074 name: string
1075 record?: Json | null
1076 uri: string
1077 }
1078 Update: {
1079 identity_did?: string
1080 indexed_at?: string
1081 name?: string
1082 record?: Json | null
1083 uri?: string
1084 }
1085 Relationships: [
1086 {
1087 foreignKeyName: "publications_identity_did_fkey"
1088 columns: ["identity_did"]
1089 isOneToOne: false
1090 referencedRelation: "identities"
1091 referencedColumns: ["atp_did"]
1092 },
1093 ]
1094 }
1095 recommends_on_documents: {
1096 Row: {
1097 document: string
1098 indexed_at: string
1099 recommender_did: string
1100 record: Json
1101 uri: string
1102 }
1103 Insert: {
1104 document: string
1105 indexed_at?: string
1106 recommender_did: string
1107 record: Json
1108 uri: string
1109 }
1110 Update: {
1111 document?: string
1112 indexed_at?: string
1113 recommender_did?: string
1114 record?: Json
1115 uri?: string
1116 }
1117 Relationships: [
1118 {
1119 foreignKeyName: "recommends_on_documents_document_fkey"
1120 columns: ["document"]
1121 isOneToOne: false
1122 referencedRelation: "documents"
1123 referencedColumns: ["uri"]
1124 },
1125 {
1126 foreignKeyName: "recommends_on_documents_recommender_did_fkey"
1127 columns: ["recommender_did"]
1128 isOneToOne: false
1129 referencedRelation: "identities"
1130 referencedColumns: ["atp_did"]
1131 },
1132 ]
1133 }
1134 replicache_clients: {
1135 Row: {
1136 client_group: string
1137 client_id: string
1138 last_mutation: number
1139 }
1140 Insert: {
1141 client_group: string
1142 client_id: string
1143 last_mutation: number
1144 }
1145 Update: {
1146 client_group?: string
1147 client_id?: string
1148 last_mutation?: number
1149 }
1150 Relationships: []
1151 }
1152 site_standard_documents: {
1153 Row: {
1154 data: Json
1155 identity_did: string
1156 indexed_at: string
1157 uri: string
1158 }
1159 Insert: {
1160 data: Json
1161 identity_did: string
1162 indexed_at?: string
1163 uri: string
1164 }
1165 Update: {
1166 data?: Json
1167 identity_did?: string
1168 indexed_at?: string
1169 uri?: string
1170 }
1171 Relationships: [
1172 {
1173 foreignKeyName: "site_standard_documents_identity_did_fkey"
1174 columns: ["identity_did"]
1175 isOneToOne: false
1176 referencedRelation: "identities"
1177 referencedColumns: ["atp_did"]
1178 },
1179 ]
1180 }
1181 site_standard_documents_in_publications: {
1182 Row: {
1183 document: string
1184 indexed_at: string
1185 publication: string
1186 }
1187 Insert: {
1188 document: string
1189 indexed_at?: string
1190 publication: string
1191 }
1192 Update: {
1193 document?: string
1194 indexed_at?: string
1195 publication?: string
1196 }
1197 Relationships: [
1198 {
1199 foreignKeyName: "site_standard_documents_in_publications_document_fkey"
1200 columns: ["document"]
1201 isOneToOne: false
1202 referencedRelation: "site_standard_documents"
1203 referencedColumns: ["uri"]
1204 },
1205 {
1206 foreignKeyName: "site_standard_documents_in_publications_publication_fkey"
1207 columns: ["publication"]
1208 isOneToOne: false
1209 referencedRelation: "site_standard_publications"
1210 referencedColumns: ["uri"]
1211 },
1212 ]
1213 }
1214 site_standard_publications: {
1215 Row: {
1216 data: Json
1217 identity_did: string
1218 indexed_at: string
1219 uri: string
1220 }
1221 Insert: {
1222 data: Json
1223 identity_did: string
1224 indexed_at?: string
1225 uri: string
1226 }
1227 Update: {
1228 data?: Json
1229 identity_did?: string
1230 indexed_at?: string
1231 uri?: string
1232 }
1233 Relationships: [
1234 {
1235 foreignKeyName: "site_standard_publications_identity_did_fkey"
1236 columns: ["identity_did"]
1237 isOneToOne: false
1238 referencedRelation: "identities"
1239 referencedColumns: ["atp_did"]
1240 },
1241 ]
1242 }
1243 site_standard_subscriptions: {
1244 Row: {
1245 created_at: string
1246 identity: string
1247 publication: string
1248 record: Json
1249 uri: string
1250 }
1251 Insert: {
1252 created_at?: string
1253 identity: string
1254 publication: string
1255 record: Json
1256 uri: string
1257 }
1258 Update: {
1259 created_at?: string
1260 identity?: string
1261 publication?: string
1262 record?: Json
1263 uri?: string
1264 }
1265 Relationships: [
1266 {
1267 foreignKeyName: "site_standard_subscriptions_identity_fkey"
1268 columns: ["identity"]
1269 isOneToOne: false
1270 referencedRelation: "identities"
1271 referencedColumns: ["atp_did"]
1272 },
1273 {
1274 foreignKeyName: "site_standard_subscriptions_publication_fkey"
1275 columns: ["publication"]
1276 isOneToOne: false
1277 referencedRelation: "site_standard_publications"
1278 referencedColumns: ["uri"]
1279 },
1280 ]
1281 }
1282 subscribers_to_publications: {
1283 Row: {
1284 created_at: string
1285 identity: string
1286 publication: string
1287 }
1288 Insert: {
1289 created_at?: string
1290 identity: string
1291 publication: string
1292 }
1293 Update: {
1294 created_at?: string
1295 identity?: string
1296 publication?: string
1297 }
1298 Relationships: [
1299 {
1300 foreignKeyName: "subscribers_to_publications_identity_fkey"
1301 columns: ["identity"]
1302 isOneToOne: false
1303 referencedRelation: "identities"
1304 referencedColumns: ["email"]
1305 },
1306 {
1307 foreignKeyName: "subscribers_to_publications_publication_fkey"
1308 columns: ["publication"]
1309 isOneToOne: false
1310 referencedRelation: "publications"
1311 referencedColumns: ["uri"]
1312 },
1313 ]
1314 }
1315 user_entitlements: {
1316 Row: {
1317 entitlement_key: string
1318 expires_at: string | null
1319 granted_at: string
1320 identity_id: string
1321 metadata: Json | null
1322 source: string | null
1323 }
1324 Insert: {
1325 entitlement_key: string
1326 expires_at?: string | null
1327 granted_at?: string
1328 identity_id: string
1329 metadata?: Json | null
1330 source?: string | null
1331 }
1332 Update: {
1333 entitlement_key?: string
1334 expires_at?: string | null
1335 granted_at?: string
1336 identity_id?: string
1337 metadata?: Json | null
1338 source?: string | null
1339 }
1340 Relationships: [
1341 {
1342 foreignKeyName: "user_entitlements_identity_id_fkey"
1343 columns: ["identity_id"]
1344 isOneToOne: false
1345 referencedRelation: "identities"
1346 referencedColumns: ["id"]
1347 },
1348 ]
1349 }
1350 user_subscriptions: {
1351 Row: {
1352 created_at: string
1353 current_period_end: string | null
1354 identity_id: string
1355 plan: string | null
1356 status: string | null
1357 stripe_customer_id: string
1358 stripe_subscription_id: string | null
1359 updated_at: string
1360 }
1361 Insert: {
1362 created_at?: string
1363 current_period_end?: string | null
1364 identity_id: string
1365 plan?: string | null
1366 status?: string | null
1367 stripe_customer_id: string
1368 stripe_subscription_id?: string | null
1369 updated_at?: string
1370 }
1371 Update: {
1372 created_at?: string
1373 current_period_end?: string | null
1374 identity_id?: string
1375 plan?: string | null
1376 status?: string | null
1377 stripe_customer_id?: string
1378 stripe_subscription_id?: string | null
1379 updated_at?: string
1380 }
1381 Relationships: [
1382 {
1383 foreignKeyName: "user_subscriptions_identity_id_fkey"
1384 columns: ["identity_id"]
1385 isOneToOne: true
1386 referencedRelation: "identities"
1387 referencedColumns: ["id"]
1388 },
1389 ]
1390 }
1391 }
1392 Views: {
1393 [_ in never]: never
1394 }
1395 Functions: {
1396 create_identity_homepage: {
1397 Args: Record<PropertyKey, never>
1398 Returns: string
1399 }
1400 get_facts: {
1401 Args: {
1402 root: string
1403 }
1404 Returns: {
1405 attribute: string
1406 created_at: string
1407 data: Json
1408 entity: string
1409 id: string
1410 updated_at: string | null
1411 version: number
1412 }[]
1413 }
1414 get_facts_for_roots: {
1415 Args: {
1416 roots: string[]
1417 max_depth: number
1418 }
1419 Returns: {
1420 root_id: string
1421 id: string
1422 entity: string
1423 attribute: string
1424 data: Json
1425 created_at: string
1426 updated_at: string
1427 version: number
1428 }[]
1429 }
1430 get_facts_with_depth: {
1431 Args: {
1432 root: string
1433 max_depth: number
1434 }
1435 Returns: {
1436 like: unknown
1437 }[]
1438 }
1439 get_profile_posts: {
1440 Args: {
1441 p_did: string
1442 p_cursor_sort_date?: string | null
1443 p_cursor_uri?: string | null
1444 p_limit?: number
1445 }
1446 Returns: {
1447 uri: string
1448 data: Json
1449 sort_date: string
1450 comments_count: number
1451 mentions_count: number
1452 recommends_count: number
1453 publication_uri: string
1454 publication_record: Json
1455 publication_name: string
1456 }[]
1457 }
1458 get_reader_feed: {
1459 Args: {
1460 p_identity: string
1461 p_cursor_timestamp?: string
1462 p_cursor_uri?: string
1463 p_limit?: number
1464 }
1465 Returns: {
1466 uri: string
1467 data: Json
1468 sort_date: string
1469 comments_count: number
1470 mentions_count: number
1471 recommends_count: number
1472 publication_uri: string
1473 publication_record: Json
1474 publication_name: string
1475 }[]
1476 }
1477 parse_iso_timestamp: {
1478 Args: {
1479 "": string
1480 }
1481 Returns: string
1482 }
1483 pull_data: {
1484 Args: {
1485 token_id: string
1486 client_group_id: string
1487 }
1488 Returns: Database["public"]["CompositeTypes"]["pull_result"]
1489 }
1490 search_tags: {
1491 Args: {
1492 search_query: string
1493 }
1494 Returns: {
1495 name: string
1496 document_count: number
1497 }[]
1498 }
1499 }
1500 Enums: {
1501 rsvp_status: "GOING" | "NOT_GOING" | "MAYBE"
1502 }
1503 CompositeTypes: {
1504 pull_result: {
1505 client_groups: Json | null
1506 facts: Json | null
1507 publications: Json | null
1508 }
1509 }
1510 }
1511 storage: {
1512 Tables: {
1513 buckets: {
1514 Row: {
1515 allowed_mime_types: string[] | null
1516 avif_autodetection: boolean | null
1517 created_at: string | null
1518 file_size_limit: number | null
1519 id: string
1520 name: string
1521 owner: string | null
1522 owner_id: string | null
1523 public: boolean | null
1524 updated_at: string | null
1525 }
1526 Insert: {
1527 allowed_mime_types?: string[] | null
1528 avif_autodetection?: boolean | null
1529 created_at?: string | null
1530 file_size_limit?: number | null
1531 id: string
1532 name: string
1533 owner?: string | null
1534 owner_id?: string | null
1535 public?: boolean | null
1536 updated_at?: string | null
1537 }
1538 Update: {
1539 allowed_mime_types?: string[] | null
1540 avif_autodetection?: boolean | null
1541 created_at?: string | null
1542 file_size_limit?: number | null
1543 id?: string
1544 name?: string
1545 owner?: string | null
1546 owner_id?: string | null
1547 public?: boolean | null
1548 updated_at?: string | null
1549 }
1550 Relationships: []
1551 }
1552 migrations: {
1553 Row: {
1554 executed_at: string | null
1555 hash: string
1556 id: number
1557 name: string
1558 }
1559 Insert: {
1560 executed_at?: string | null
1561 hash: string
1562 id: number
1563 name: string
1564 }
1565 Update: {
1566 executed_at?: string | null
1567 hash?: string
1568 id?: number
1569 name?: string
1570 }
1571 Relationships: []
1572 }
1573 objects: {
1574 Row: {
1575 bucket_id: string | null
1576 created_at: string | null
1577 id: string
1578 last_accessed_at: string | null
1579 metadata: Json | null
1580 name: string | null
1581 owner: string | null
1582 owner_id: string | null
1583 path_tokens: string[] | null
1584 updated_at: string | null
1585 version: string | null
1586 }
1587 Insert: {
1588 bucket_id?: string | null
1589 created_at?: string | null
1590 id?: string
1591 last_accessed_at?: string | null
1592 metadata?: Json | null
1593 name?: string | null
1594 owner?: string | null
1595 owner_id?: string | null
1596 path_tokens?: string[] | null
1597 updated_at?: string | null
1598 version?: string | null
1599 }
1600 Update: {
1601 bucket_id?: string | null
1602 created_at?: string | null
1603 id?: string
1604 last_accessed_at?: string | null
1605 metadata?: Json | null
1606 name?: string | null
1607 owner?: string | null
1608 owner_id?: string | null
1609 path_tokens?: string[] | null
1610 updated_at?: string | null
1611 version?: string | null
1612 }
1613 Relationships: [
1614 {
1615 foreignKeyName: "objects_bucketId_fkey"
1616 columns: ["bucket_id"]
1617 isOneToOne: false
1618 referencedRelation: "buckets"
1619 referencedColumns: ["id"]
1620 },
1621 ]
1622 }
1623 s3_multipart_uploads: {
1624 Row: {
1625 bucket_id: string
1626 created_at: string
1627 id: string
1628 in_progress_size: number
1629 key: string
1630 owner_id: string | null
1631 upload_signature: string
1632 version: string
1633 }
1634 Insert: {
1635 bucket_id: string
1636 created_at?: string
1637 id: string
1638 in_progress_size?: number
1639 key: string
1640 owner_id?: string | null
1641 upload_signature: string
1642 version: string
1643 }
1644 Update: {
1645 bucket_id?: string
1646 created_at?: string
1647 id?: string
1648 in_progress_size?: number
1649 key?: string
1650 owner_id?: string | null
1651 upload_signature?: string
1652 version?: string
1653 }
1654 Relationships: [
1655 {
1656 foreignKeyName: "s3_multipart_uploads_bucket_id_fkey"
1657 columns: ["bucket_id"]
1658 isOneToOne: false
1659 referencedRelation: "buckets"
1660 referencedColumns: ["id"]
1661 },
1662 ]
1663 }
1664 s3_multipart_uploads_parts: {
1665 Row: {
1666 bucket_id: string
1667 created_at: string
1668 etag: string
1669 id: string
1670 key: string
1671 owner_id: string | null
1672 part_number: number
1673 size: number
1674 upload_id: string
1675 version: string
1676 }
1677 Insert: {
1678 bucket_id: string
1679 created_at?: string
1680 etag: string
1681 id?: string
1682 key: string
1683 owner_id?: string | null
1684 part_number: number
1685 size?: number
1686 upload_id: string
1687 version: string
1688 }
1689 Update: {
1690 bucket_id?: string
1691 created_at?: string
1692 etag?: string
1693 id?: string
1694 key?: string
1695 owner_id?: string | null
1696 part_number?: number
1697 size?: number
1698 upload_id?: string
1699 version?: string
1700 }
1701 Relationships: [
1702 {
1703 foreignKeyName: "s3_multipart_uploads_parts_bucket_id_fkey"
1704 columns: ["bucket_id"]
1705 isOneToOne: false
1706 referencedRelation: "buckets"
1707 referencedColumns: ["id"]
1708 },
1709 {
1710 foreignKeyName: "s3_multipart_uploads_parts_upload_id_fkey"
1711 columns: ["upload_id"]
1712 isOneToOne: false
1713 referencedRelation: "s3_multipart_uploads"
1714 referencedColumns: ["id"]
1715 },
1716 ]
1717 }
1718 }
1719 Views: {
1720 [_ in never]: never
1721 }
1722 Functions: {
1723 can_insert_object: {
1724 Args: {
1725 bucketid: string
1726 name: string
1727 owner: string
1728 metadata: Json
1729 }
1730 Returns: undefined
1731 }
1732 extension: {
1733 Args: {
1734 name: string
1735 }
1736 Returns: string
1737 }
1738 filename: {
1739 Args: {
1740 name: string
1741 }
1742 Returns: string
1743 }
1744 foldername: {
1745 Args: {
1746 name: string
1747 }
1748 Returns: string[]
1749 }
1750 get_size_by_bucket: {
1751 Args: Record<PropertyKey, never>
1752 Returns: {
1753 size: number
1754 bucket_id: string
1755 }[]
1756 }
1757 list_multipart_uploads_with_delimiter: {
1758 Args: {
1759 bucket_id: string
1760 prefix_param: string
1761 delimiter_param: string
1762 max_keys?: number
1763 next_key_token?: string
1764 next_upload_token?: string
1765 }
1766 Returns: {
1767 key: string
1768 id: string
1769 created_at: string
1770 }[]
1771 }
1772 list_objects_with_delimiter: {
1773 Args: {
1774 bucket_id: string
1775 prefix_param: string
1776 delimiter_param: string
1777 max_keys?: number
1778 start_after?: string
1779 next_token?: string
1780 }
1781 Returns: {
1782 name: string
1783 id: string
1784 metadata: Json
1785 updated_at: string
1786 }[]
1787 }
1788 search: {
1789 Args: {
1790 prefix: string
1791 bucketname: string
1792 limits?: number
1793 levels?: number
1794 offsets?: number
1795 search?: string
1796 sortcolumn?: string
1797 sortorder?: string
1798 }
1799 Returns: {
1800 name: string
1801 id: string
1802 updated_at: string
1803 created_at: string
1804 last_accessed_at: string
1805 metadata: Json
1806 }[]
1807 }
1808 }
1809 Enums: {
1810 [_ in never]: never
1811 }
1812 CompositeTypes: {
1813 [_ in never]: never
1814 }
1815 }
1816}
1817
1818type PublicSchema = Database[Extract<keyof Database, "public">]
1819
1820export type Tables<
1821 PublicTableNameOrOptions extends
1822 | keyof (PublicSchema["Tables"] & PublicSchema["Views"])
1823 | { schema: keyof Database },
1824 TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1825 ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1826 Database[PublicTableNameOrOptions["schema"]]["Views"])
1827 : never = never,
1828> = PublicTableNameOrOptions extends { schema: keyof Database }
1829 ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1830 Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
1831 Row: infer R
1832 }
1833 ? R
1834 : never
1835 : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] &
1836 PublicSchema["Views"])
1837 ? (PublicSchema["Tables"] &
1838 PublicSchema["Views"])[PublicTableNameOrOptions] extends {
1839 Row: infer R
1840 }
1841 ? R
1842 : never
1843 : never
1844
1845export type TablesInsert<
1846 PublicTableNameOrOptions extends
1847 | keyof PublicSchema["Tables"]
1848 | { schema: keyof Database },
1849 TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1850 ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1851 : never = never,
1852> = PublicTableNameOrOptions extends { schema: keyof Database }
1853 ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1854 Insert: infer I
1855 }
1856 ? I
1857 : never
1858 : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
1859 ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
1860 Insert: infer I
1861 }
1862 ? I
1863 : never
1864 : never
1865
1866export type TablesUpdate<
1867 PublicTableNameOrOptions extends
1868 | keyof PublicSchema["Tables"]
1869 | { schema: keyof Database },
1870 TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1871 ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1872 : never = never,
1873> = PublicTableNameOrOptions extends { schema: keyof Database }
1874 ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1875 Update: infer U
1876 }
1877 ? U
1878 : never
1879 : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
1880 ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
1881 Update: infer U
1882 }
1883 ? U
1884 : never
1885 : never
1886
1887export type Enums<
1888 PublicEnumNameOrOptions extends
1889 | keyof PublicSchema["Enums"]
1890 | { schema: keyof Database },
1891 EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
1892 ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
1893 : never = never,
1894> = PublicEnumNameOrOptions extends { schema: keyof Database }
1895 ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
1896 : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
1897 ? PublicSchema["Enums"][PublicEnumNameOrOptions]
1898 : never
1899