@hobenakicoffee/libraries 1.21.1 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/types/supabase.ts +675 -2
package/package.json
CHANGED
package/src/types/supabase.ts
CHANGED
|
@@ -84,6 +84,7 @@ export type Database = {
|
|
|
84
84
|
id: string;
|
|
85
85
|
is_monthly: boolean;
|
|
86
86
|
message: string | null;
|
|
87
|
+
supporter_identity_hash: string | null;
|
|
87
88
|
supporter_name: string | null;
|
|
88
89
|
supporter_platform: string | null;
|
|
89
90
|
supporter_profile_id: string | null;
|
|
@@ -97,6 +98,7 @@ export type Database = {
|
|
|
97
98
|
id?: string;
|
|
98
99
|
is_monthly?: boolean;
|
|
99
100
|
message?: string | null;
|
|
101
|
+
supporter_identity_hash?: string | null;
|
|
100
102
|
supporter_name?: string | null;
|
|
101
103
|
supporter_platform?: string | null;
|
|
102
104
|
supporter_profile_id?: string | null;
|
|
@@ -110,6 +112,7 @@ export type Database = {
|
|
|
110
112
|
id?: string;
|
|
111
113
|
is_monthly?: boolean;
|
|
112
114
|
message?: string | null;
|
|
115
|
+
supporter_identity_hash?: string | null;
|
|
113
116
|
supporter_name?: string | null;
|
|
114
117
|
supporter_platform?: string | null;
|
|
115
118
|
supporter_profile_id?: string | null;
|
|
@@ -334,6 +337,62 @@ export type Database = {
|
|
|
334
337
|
};
|
|
335
338
|
Relationships: [];
|
|
336
339
|
};
|
|
340
|
+
membership_plans: {
|
|
341
|
+
Row: {
|
|
342
|
+
access_config: Json;
|
|
343
|
+
billing_cycle: Database["public"]["Enums"]["membership_billing_cycle_enum"];
|
|
344
|
+
created_at: string;
|
|
345
|
+
description: string | null;
|
|
346
|
+
id: string;
|
|
347
|
+
is_active: boolean;
|
|
348
|
+
is_featured: boolean;
|
|
349
|
+
name: string;
|
|
350
|
+
owner_profile_id: string;
|
|
351
|
+
price: number;
|
|
352
|
+
service_type: string;
|
|
353
|
+
sort_order: number;
|
|
354
|
+
updated_at: string;
|
|
355
|
+
};
|
|
356
|
+
Insert: {
|
|
357
|
+
access_config?: Json;
|
|
358
|
+
billing_cycle: Database["public"]["Enums"]["membership_billing_cycle_enum"];
|
|
359
|
+
created_at?: string;
|
|
360
|
+
description?: string | null;
|
|
361
|
+
id?: string;
|
|
362
|
+
is_active?: boolean;
|
|
363
|
+
is_featured?: boolean;
|
|
364
|
+
name: string;
|
|
365
|
+
owner_profile_id: string;
|
|
366
|
+
price: number;
|
|
367
|
+
service_type: string;
|
|
368
|
+
sort_order?: number;
|
|
369
|
+
updated_at?: string;
|
|
370
|
+
};
|
|
371
|
+
Update: {
|
|
372
|
+
access_config?: Json;
|
|
373
|
+
billing_cycle?: Database["public"]["Enums"]["membership_billing_cycle_enum"];
|
|
374
|
+
created_at?: string;
|
|
375
|
+
description?: string | null;
|
|
376
|
+
id?: string;
|
|
377
|
+
is_active?: boolean;
|
|
378
|
+
is_featured?: boolean;
|
|
379
|
+
name?: string;
|
|
380
|
+
owner_profile_id?: string;
|
|
381
|
+
price?: number;
|
|
382
|
+
service_type?: string;
|
|
383
|
+
sort_order?: number;
|
|
384
|
+
updated_at?: string;
|
|
385
|
+
};
|
|
386
|
+
Relationships: [
|
|
387
|
+
{
|
|
388
|
+
foreignKeyName: "membership_plans_owner_profile_id_fkey";
|
|
389
|
+
columns: ["owner_profile_id"];
|
|
390
|
+
isOneToOne: false;
|
|
391
|
+
referencedRelation: "profiles";
|
|
392
|
+
referencedColumns: ["id"];
|
|
393
|
+
},
|
|
394
|
+
];
|
|
395
|
+
};
|
|
337
396
|
messages: {
|
|
338
397
|
Row: {
|
|
339
398
|
content: string;
|
|
@@ -469,6 +528,289 @@ export type Database = {
|
|
|
469
528
|
};
|
|
470
529
|
Relationships: [];
|
|
471
530
|
};
|
|
531
|
+
newsletter_post_analytics_daily: {
|
|
532
|
+
Row: {
|
|
533
|
+
clicks: number;
|
|
534
|
+
created_at: string;
|
|
535
|
+
date: string;
|
|
536
|
+
id: string;
|
|
537
|
+
post_id: string;
|
|
538
|
+
purchases: number;
|
|
539
|
+
revenue: number;
|
|
540
|
+
updated_at: string;
|
|
541
|
+
views: number;
|
|
542
|
+
};
|
|
543
|
+
Insert: {
|
|
544
|
+
clicks?: number;
|
|
545
|
+
created_at?: string;
|
|
546
|
+
date: string;
|
|
547
|
+
id?: string;
|
|
548
|
+
post_id: string;
|
|
549
|
+
purchases?: number;
|
|
550
|
+
revenue?: number;
|
|
551
|
+
updated_at?: string;
|
|
552
|
+
views?: number;
|
|
553
|
+
};
|
|
554
|
+
Update: {
|
|
555
|
+
clicks?: number;
|
|
556
|
+
created_at?: string;
|
|
557
|
+
date?: string;
|
|
558
|
+
id?: string;
|
|
559
|
+
post_id?: string;
|
|
560
|
+
purchases?: number;
|
|
561
|
+
revenue?: number;
|
|
562
|
+
updated_at?: string;
|
|
563
|
+
views?: number;
|
|
564
|
+
};
|
|
565
|
+
Relationships: [
|
|
566
|
+
{
|
|
567
|
+
foreignKeyName: "newsletter_post_analytics_daily_post_id_fkey";
|
|
568
|
+
columns: ["post_id"];
|
|
569
|
+
isOneToOne: false;
|
|
570
|
+
referencedRelation: "newsletter_posts";
|
|
571
|
+
referencedColumns: ["id"];
|
|
572
|
+
},
|
|
573
|
+
];
|
|
574
|
+
};
|
|
575
|
+
newsletter_post_likes: {
|
|
576
|
+
Row: {
|
|
577
|
+
created_at: string;
|
|
578
|
+
id: string;
|
|
579
|
+
post_id: string;
|
|
580
|
+
profile_id: string;
|
|
581
|
+
};
|
|
582
|
+
Insert: {
|
|
583
|
+
created_at?: string;
|
|
584
|
+
id?: string;
|
|
585
|
+
post_id: string;
|
|
586
|
+
profile_id: string;
|
|
587
|
+
};
|
|
588
|
+
Update: {
|
|
589
|
+
created_at?: string;
|
|
590
|
+
id?: string;
|
|
591
|
+
post_id?: string;
|
|
592
|
+
profile_id?: string;
|
|
593
|
+
};
|
|
594
|
+
Relationships: [
|
|
595
|
+
{
|
|
596
|
+
foreignKeyName: "newsletter_post_likes_post_id_fkey";
|
|
597
|
+
columns: ["post_id"];
|
|
598
|
+
isOneToOne: false;
|
|
599
|
+
referencedRelation: "newsletter_posts";
|
|
600
|
+
referencedColumns: ["id"];
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
foreignKeyName: "newsletter_post_likes_profile_id_fkey";
|
|
604
|
+
columns: ["profile_id"];
|
|
605
|
+
isOneToOne: false;
|
|
606
|
+
referencedRelation: "profiles";
|
|
607
|
+
referencedColumns: ["id"];
|
|
608
|
+
},
|
|
609
|
+
];
|
|
610
|
+
};
|
|
611
|
+
newsletter_post_versions: {
|
|
612
|
+
Row: {
|
|
613
|
+
ai_summary: string | null;
|
|
614
|
+
content: string | null;
|
|
615
|
+
created_at: string;
|
|
616
|
+
id: string;
|
|
617
|
+
post_id: string;
|
|
618
|
+
source: Database["public"]["Enums"]["post_version_source_enum"];
|
|
619
|
+
title: string | null;
|
|
620
|
+
version_number: number;
|
|
621
|
+
};
|
|
622
|
+
Insert: {
|
|
623
|
+
ai_summary?: string | null;
|
|
624
|
+
content?: string | null;
|
|
625
|
+
created_at?: string;
|
|
626
|
+
id?: string;
|
|
627
|
+
post_id: string;
|
|
628
|
+
source: Database["public"]["Enums"]["post_version_source_enum"];
|
|
629
|
+
title?: string | null;
|
|
630
|
+
version_number: number;
|
|
631
|
+
};
|
|
632
|
+
Update: {
|
|
633
|
+
ai_summary?: string | null;
|
|
634
|
+
content?: string | null;
|
|
635
|
+
created_at?: string;
|
|
636
|
+
id?: string;
|
|
637
|
+
post_id?: string;
|
|
638
|
+
source?: Database["public"]["Enums"]["post_version_source_enum"];
|
|
639
|
+
title?: string | null;
|
|
640
|
+
version_number?: number;
|
|
641
|
+
};
|
|
642
|
+
Relationships: [
|
|
643
|
+
{
|
|
644
|
+
foreignKeyName: "newsletter_post_versions_post_id_fkey";
|
|
645
|
+
columns: ["post_id"];
|
|
646
|
+
isOneToOne: false;
|
|
647
|
+
referencedRelation: "newsletter_posts";
|
|
648
|
+
referencedColumns: ["id"];
|
|
649
|
+
},
|
|
650
|
+
];
|
|
651
|
+
};
|
|
652
|
+
newsletter_posts: {
|
|
653
|
+
Row: {
|
|
654
|
+
click_count: number;
|
|
655
|
+
content: string | null;
|
|
656
|
+
cover_image_url: string | null;
|
|
657
|
+
created_at: string;
|
|
658
|
+
excerpt: string | null;
|
|
659
|
+
id: string;
|
|
660
|
+
is_members_only: boolean;
|
|
661
|
+
is_pay_per_post: boolean;
|
|
662
|
+
like_count: number;
|
|
663
|
+
price: number | null;
|
|
664
|
+
profile_id: string;
|
|
665
|
+
published_at: string | null;
|
|
666
|
+
purchase_count: number;
|
|
667
|
+
reading_time_minutes: number | null;
|
|
668
|
+
revenue_total: number;
|
|
669
|
+
slug: string | null;
|
|
670
|
+
status: Database["public"]["Enums"]["post_status_enum"];
|
|
671
|
+
subtitle: string | null;
|
|
672
|
+
tags: string[];
|
|
673
|
+
title: string;
|
|
674
|
+
updated_at: string;
|
|
675
|
+
view_count: number;
|
|
676
|
+
visibility: Database["public"]["Enums"]["visibility_enum"];
|
|
677
|
+
};
|
|
678
|
+
Insert: {
|
|
679
|
+
click_count?: number;
|
|
680
|
+
content?: string | null;
|
|
681
|
+
cover_image_url?: string | null;
|
|
682
|
+
created_at?: string;
|
|
683
|
+
excerpt?: string | null;
|
|
684
|
+
id?: string;
|
|
685
|
+
is_members_only?: boolean;
|
|
686
|
+
is_pay_per_post?: boolean;
|
|
687
|
+
like_count?: number;
|
|
688
|
+
price?: number | null;
|
|
689
|
+
profile_id: string;
|
|
690
|
+
published_at?: string | null;
|
|
691
|
+
purchase_count?: number;
|
|
692
|
+
reading_time_minutes?: number | null;
|
|
693
|
+
revenue_total?: number;
|
|
694
|
+
slug?: string | null;
|
|
695
|
+
status?: Database["public"]["Enums"]["post_status_enum"];
|
|
696
|
+
subtitle?: string | null;
|
|
697
|
+
tags?: string[];
|
|
698
|
+
title: string;
|
|
699
|
+
updated_at?: string;
|
|
700
|
+
view_count?: number;
|
|
701
|
+
visibility?: Database["public"]["Enums"]["visibility_enum"];
|
|
702
|
+
};
|
|
703
|
+
Update: {
|
|
704
|
+
click_count?: number;
|
|
705
|
+
content?: string | null;
|
|
706
|
+
cover_image_url?: string | null;
|
|
707
|
+
created_at?: string;
|
|
708
|
+
excerpt?: string | null;
|
|
709
|
+
id?: string;
|
|
710
|
+
is_members_only?: boolean;
|
|
711
|
+
is_pay_per_post?: boolean;
|
|
712
|
+
like_count?: number;
|
|
713
|
+
price?: number | null;
|
|
714
|
+
profile_id?: string;
|
|
715
|
+
published_at?: string | null;
|
|
716
|
+
purchase_count?: number;
|
|
717
|
+
reading_time_minutes?: number | null;
|
|
718
|
+
revenue_total?: number;
|
|
719
|
+
slug?: string | null;
|
|
720
|
+
status?: Database["public"]["Enums"]["post_status_enum"];
|
|
721
|
+
subtitle?: string | null;
|
|
722
|
+
tags?: string[];
|
|
723
|
+
title?: string;
|
|
724
|
+
updated_at?: string;
|
|
725
|
+
view_count?: number;
|
|
726
|
+
visibility?: Database["public"]["Enums"]["visibility_enum"];
|
|
727
|
+
};
|
|
728
|
+
Relationships: [
|
|
729
|
+
{
|
|
730
|
+
foreignKeyName: "newsletter_posts_profile_id_fkey";
|
|
731
|
+
columns: ["profile_id"];
|
|
732
|
+
isOneToOne: false;
|
|
733
|
+
referencedRelation: "profiles";
|
|
734
|
+
referencedColumns: ["id"];
|
|
735
|
+
},
|
|
736
|
+
];
|
|
737
|
+
};
|
|
738
|
+
newsletter_settings: {
|
|
739
|
+
Row: {
|
|
740
|
+
annual_plan_id: string | null;
|
|
741
|
+
annual_price: number | null;
|
|
742
|
+
created_at: string;
|
|
743
|
+
free_tier_label: string;
|
|
744
|
+
gifting_enabled: boolean;
|
|
745
|
+
id: string;
|
|
746
|
+
member_label: string;
|
|
747
|
+
memberships_enabled: boolean;
|
|
748
|
+
monthly_plan_id: string | null;
|
|
749
|
+
monthly_price: number | null;
|
|
750
|
+
newsletter_description: string | null;
|
|
751
|
+
newsletter_title: string | null;
|
|
752
|
+
profile_id: string;
|
|
753
|
+
updated_at: string;
|
|
754
|
+
welcome_message: string | null;
|
|
755
|
+
};
|
|
756
|
+
Insert: {
|
|
757
|
+
annual_plan_id?: string | null;
|
|
758
|
+
annual_price?: number | null;
|
|
759
|
+
created_at?: string;
|
|
760
|
+
free_tier_label?: string;
|
|
761
|
+
gifting_enabled?: boolean;
|
|
762
|
+
id?: string;
|
|
763
|
+
member_label?: string;
|
|
764
|
+
memberships_enabled?: boolean;
|
|
765
|
+
monthly_plan_id?: string | null;
|
|
766
|
+
monthly_price?: number | null;
|
|
767
|
+
newsletter_description?: string | null;
|
|
768
|
+
newsletter_title?: string | null;
|
|
769
|
+
profile_id: string;
|
|
770
|
+
updated_at?: string;
|
|
771
|
+
welcome_message?: string | null;
|
|
772
|
+
};
|
|
773
|
+
Update: {
|
|
774
|
+
annual_plan_id?: string | null;
|
|
775
|
+
annual_price?: number | null;
|
|
776
|
+
created_at?: string;
|
|
777
|
+
free_tier_label?: string;
|
|
778
|
+
gifting_enabled?: boolean;
|
|
779
|
+
id?: string;
|
|
780
|
+
member_label?: string;
|
|
781
|
+
memberships_enabled?: boolean;
|
|
782
|
+
monthly_plan_id?: string | null;
|
|
783
|
+
monthly_price?: number | null;
|
|
784
|
+
newsletter_description?: string | null;
|
|
785
|
+
newsletter_title?: string | null;
|
|
786
|
+
profile_id?: string;
|
|
787
|
+
updated_at?: string;
|
|
788
|
+
welcome_message?: string | null;
|
|
789
|
+
};
|
|
790
|
+
Relationships: [
|
|
791
|
+
{
|
|
792
|
+
foreignKeyName: "newsletter_settings_annual_plan_id_fkey";
|
|
793
|
+
columns: ["annual_plan_id"];
|
|
794
|
+
isOneToOne: false;
|
|
795
|
+
referencedRelation: "membership_plans";
|
|
796
|
+
referencedColumns: ["id"];
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
foreignKeyName: "newsletter_settings_monthly_plan_id_fkey";
|
|
800
|
+
columns: ["monthly_plan_id"];
|
|
801
|
+
isOneToOne: false;
|
|
802
|
+
referencedRelation: "membership_plans";
|
|
803
|
+
referencedColumns: ["id"];
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
foreignKeyName: "newsletter_settings_profile_id_fkey";
|
|
807
|
+
columns: ["profile_id"];
|
|
808
|
+
isOneToOne: true;
|
|
809
|
+
referencedRelation: "profiles";
|
|
810
|
+
referencedColumns: ["id"];
|
|
811
|
+
},
|
|
812
|
+
];
|
|
813
|
+
};
|
|
472
814
|
payout_methods: {
|
|
473
815
|
Row: {
|
|
474
816
|
created_at: string;
|
|
@@ -510,6 +852,163 @@ export type Database = {
|
|
|
510
852
|
},
|
|
511
853
|
];
|
|
512
854
|
};
|
|
855
|
+
post_access_grants: {
|
|
856
|
+
Row: {
|
|
857
|
+
created_at: string;
|
|
858
|
+
expires_at: string | null;
|
|
859
|
+
gift_message: string | null;
|
|
860
|
+
grant_type: Database["public"]["Enums"]["access_grant_type_enum"];
|
|
861
|
+
granted_by_profile_id: string | null;
|
|
862
|
+
grantee_profile_id: string;
|
|
863
|
+
id: string;
|
|
864
|
+
is_redeemed: boolean;
|
|
865
|
+
post_id: string;
|
|
866
|
+
redeemed_at: string | null;
|
|
867
|
+
transaction_reference_id: string | null;
|
|
868
|
+
updated_at: string;
|
|
869
|
+
};
|
|
870
|
+
Insert: {
|
|
871
|
+
created_at?: string;
|
|
872
|
+
expires_at?: string | null;
|
|
873
|
+
gift_message?: string | null;
|
|
874
|
+
grant_type: Database["public"]["Enums"]["access_grant_type_enum"];
|
|
875
|
+
granted_by_profile_id?: string | null;
|
|
876
|
+
grantee_profile_id: string;
|
|
877
|
+
id?: string;
|
|
878
|
+
is_redeemed?: boolean;
|
|
879
|
+
post_id: string;
|
|
880
|
+
redeemed_at?: string | null;
|
|
881
|
+
transaction_reference_id?: string | null;
|
|
882
|
+
updated_at?: string;
|
|
883
|
+
};
|
|
884
|
+
Update: {
|
|
885
|
+
created_at?: string;
|
|
886
|
+
expires_at?: string | null;
|
|
887
|
+
gift_message?: string | null;
|
|
888
|
+
grant_type?: Database["public"]["Enums"]["access_grant_type_enum"];
|
|
889
|
+
granted_by_profile_id?: string | null;
|
|
890
|
+
grantee_profile_id?: string;
|
|
891
|
+
id?: string;
|
|
892
|
+
is_redeemed?: boolean;
|
|
893
|
+
post_id?: string;
|
|
894
|
+
redeemed_at?: string | null;
|
|
895
|
+
transaction_reference_id?: string | null;
|
|
896
|
+
updated_at?: string;
|
|
897
|
+
};
|
|
898
|
+
Relationships: [
|
|
899
|
+
{
|
|
900
|
+
foreignKeyName: "post_access_grants_granted_by_profile_id_fkey";
|
|
901
|
+
columns: ["granted_by_profile_id"];
|
|
902
|
+
isOneToOne: false;
|
|
903
|
+
referencedRelation: "profiles";
|
|
904
|
+
referencedColumns: ["id"];
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
foreignKeyName: "post_access_grants_grantee_profile_id_fkey";
|
|
908
|
+
columns: ["grantee_profile_id"];
|
|
909
|
+
isOneToOne: false;
|
|
910
|
+
referencedRelation: "profiles";
|
|
911
|
+
referencedColumns: ["id"];
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
foreignKeyName: "post_access_grants_post_id_fkey";
|
|
915
|
+
columns: ["post_id"];
|
|
916
|
+
isOneToOne: false;
|
|
917
|
+
referencedRelation: "newsletter_posts";
|
|
918
|
+
referencedColumns: ["id"];
|
|
919
|
+
},
|
|
920
|
+
{
|
|
921
|
+
foreignKeyName: "post_access_grants_transaction_reference_id_fkey";
|
|
922
|
+
columns: ["transaction_reference_id"];
|
|
923
|
+
isOneToOne: false;
|
|
924
|
+
referencedRelation: "transactions";
|
|
925
|
+
referencedColumns: ["reference_id"];
|
|
926
|
+
},
|
|
927
|
+
];
|
|
928
|
+
};
|
|
929
|
+
profile_memberships: {
|
|
930
|
+
Row: {
|
|
931
|
+
auto_renew: boolean;
|
|
932
|
+
cancelled_at: string | null;
|
|
933
|
+
created_at: string;
|
|
934
|
+
id: string;
|
|
935
|
+
member_profile_id: string;
|
|
936
|
+
owner_profile_id: string;
|
|
937
|
+
period_end: string | null;
|
|
938
|
+
period_start: string;
|
|
939
|
+
plan_id: string;
|
|
940
|
+
price_at_purchase: number;
|
|
941
|
+
renewed_at: string | null;
|
|
942
|
+
service_type: string;
|
|
943
|
+
status: Database["public"]["Enums"]["membership_status_enum"];
|
|
944
|
+
transaction_id: string | null;
|
|
945
|
+
updated_at: string;
|
|
946
|
+
};
|
|
947
|
+
Insert: {
|
|
948
|
+
auto_renew?: boolean;
|
|
949
|
+
cancelled_at?: string | null;
|
|
950
|
+
created_at?: string;
|
|
951
|
+
id?: string;
|
|
952
|
+
member_profile_id: string;
|
|
953
|
+
owner_profile_id: string;
|
|
954
|
+
period_end?: string | null;
|
|
955
|
+
period_start?: string;
|
|
956
|
+
plan_id: string;
|
|
957
|
+
price_at_purchase: number;
|
|
958
|
+
renewed_at?: string | null;
|
|
959
|
+
service_type: string;
|
|
960
|
+
status?: Database["public"]["Enums"]["membership_status_enum"];
|
|
961
|
+
transaction_id?: string | null;
|
|
962
|
+
updated_at?: string;
|
|
963
|
+
};
|
|
964
|
+
Update: {
|
|
965
|
+
auto_renew?: boolean;
|
|
966
|
+
cancelled_at?: string | null;
|
|
967
|
+
created_at?: string;
|
|
968
|
+
id?: string;
|
|
969
|
+
member_profile_id?: string;
|
|
970
|
+
owner_profile_id?: string;
|
|
971
|
+
period_end?: string | null;
|
|
972
|
+
period_start?: string;
|
|
973
|
+
plan_id?: string;
|
|
974
|
+
price_at_purchase?: number;
|
|
975
|
+
renewed_at?: string | null;
|
|
976
|
+
service_type?: string;
|
|
977
|
+
status?: Database["public"]["Enums"]["membership_status_enum"];
|
|
978
|
+
transaction_id?: string | null;
|
|
979
|
+
updated_at?: string;
|
|
980
|
+
};
|
|
981
|
+
Relationships: [
|
|
982
|
+
{
|
|
983
|
+
foreignKeyName: "profile_memberships_member_profile_id_fkey";
|
|
984
|
+
columns: ["member_profile_id"];
|
|
985
|
+
isOneToOne: false;
|
|
986
|
+
referencedRelation: "profiles";
|
|
987
|
+
referencedColumns: ["id"];
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
foreignKeyName: "profile_memberships_owner_profile_id_fkey";
|
|
991
|
+
columns: ["owner_profile_id"];
|
|
992
|
+
isOneToOne: false;
|
|
993
|
+
referencedRelation: "profiles";
|
|
994
|
+
referencedColumns: ["id"];
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
foreignKeyName: "profile_memberships_plan_id_fkey";
|
|
998
|
+
columns: ["plan_id"];
|
|
999
|
+
isOneToOne: false;
|
|
1000
|
+
referencedRelation: "membership_plans";
|
|
1001
|
+
referencedColumns: ["id"];
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
foreignKeyName: "profile_memberships_transaction_id_fkey";
|
|
1005
|
+
columns: ["transaction_id"];
|
|
1006
|
+
isOneToOne: false;
|
|
1007
|
+
referencedRelation: "transactions";
|
|
1008
|
+
referencedColumns: ["id"];
|
|
1009
|
+
},
|
|
1010
|
+
];
|
|
1011
|
+
};
|
|
513
1012
|
profiles: {
|
|
514
1013
|
Row: {
|
|
515
1014
|
allow_gifting: boolean | null;
|
|
@@ -991,6 +1490,13 @@ export type Database = {
|
|
|
991
1490
|
};
|
|
992
1491
|
Returns: boolean;
|
|
993
1492
|
};
|
|
1493
|
+
check_newsletter_post_access: {
|
|
1494
|
+
Args: { p_post_id: string };
|
|
1495
|
+
Returns: {
|
|
1496
|
+
access_reason: string;
|
|
1497
|
+
has_access: boolean;
|
|
1498
|
+
}[];
|
|
1499
|
+
};
|
|
994
1500
|
create_manager: {
|
|
995
1501
|
Args: {
|
|
996
1502
|
manager_department?: string;
|
|
@@ -1016,6 +1522,21 @@ export type Database = {
|
|
|
1016
1522
|
unread_count: number;
|
|
1017
1523
|
}[];
|
|
1018
1524
|
};
|
|
1525
|
+
get_creator_coffee_gifts_stats: {
|
|
1526
|
+
Args: {
|
|
1527
|
+
p_creator_profile_id: string;
|
|
1528
|
+
p_from_date?: string;
|
|
1529
|
+
p_to_date?: string;
|
|
1530
|
+
};
|
|
1531
|
+
Returns: {
|
|
1532
|
+
total_coffees: number;
|
|
1533
|
+
total_coffees_change: number;
|
|
1534
|
+
total_earnings: number;
|
|
1535
|
+
total_earnings_change: number;
|
|
1536
|
+
unique_supporters: number;
|
|
1537
|
+
unique_supporters_change: number;
|
|
1538
|
+
}[];
|
|
1539
|
+
};
|
|
1019
1540
|
get_followers: { Args: { target_user_id: string }; Returns: string[] };
|
|
1020
1541
|
get_following: { Args: { target_user_id: string }; Returns: string[] };
|
|
1021
1542
|
get_messages: {
|
|
@@ -1036,6 +1557,14 @@ export type Database = {
|
|
|
1036
1557
|
sender_username: string;
|
|
1037
1558
|
}[];
|
|
1038
1559
|
};
|
|
1560
|
+
get_newsletter_stats: {
|
|
1561
|
+
Args: { p_from?: string; p_profile_id: string; p_to?: string };
|
|
1562
|
+
Returns: {
|
|
1563
|
+
newsletter_subs: number;
|
|
1564
|
+
post_sales_revenue: number;
|
|
1565
|
+
total_post_views: number;
|
|
1566
|
+
}[];
|
|
1567
|
+
};
|
|
1039
1568
|
get_or_create_direct_conversation: {
|
|
1040
1569
|
Args: { p_recipient_id: string };
|
|
1041
1570
|
Returns: string;
|
|
@@ -1048,10 +1577,109 @@ export type Database = {
|
|
|
1048
1577
|
total_amount: number;
|
|
1049
1578
|
}[];
|
|
1050
1579
|
};
|
|
1580
|
+
get_post_analytics: {
|
|
1581
|
+
Args: { p_from?: string; p_post_id: string; p_to?: string };
|
|
1582
|
+
Returns: {
|
|
1583
|
+
chart_date: string;
|
|
1584
|
+
conv_rate: number;
|
|
1585
|
+
day_clicks: number;
|
|
1586
|
+
day_purchases: number;
|
|
1587
|
+
day_revenue: number;
|
|
1588
|
+
day_views: number;
|
|
1589
|
+
total_clicks: number;
|
|
1590
|
+
total_sales: number;
|
|
1591
|
+
total_views: number;
|
|
1592
|
+
}[];
|
|
1593
|
+
};
|
|
1594
|
+
get_posts_page: {
|
|
1595
|
+
Args: {
|
|
1596
|
+
p_cursor?: string;
|
|
1597
|
+
p_from?: string;
|
|
1598
|
+
p_limit?: number;
|
|
1599
|
+
p_profile_id: string;
|
|
1600
|
+
p_status: Database["public"]["Enums"]["post_status_enum"];
|
|
1601
|
+
p_to?: string;
|
|
1602
|
+
};
|
|
1603
|
+
Returns: {
|
|
1604
|
+
click_count: number;
|
|
1605
|
+
cover_image_url: string;
|
|
1606
|
+
created_at: string;
|
|
1607
|
+
draft_count: number;
|
|
1608
|
+
excerpt: string;
|
|
1609
|
+
id: string;
|
|
1610
|
+
is_members_only: boolean;
|
|
1611
|
+
is_pay_per_post: boolean;
|
|
1612
|
+
like_count: number;
|
|
1613
|
+
price: number;
|
|
1614
|
+
published_at: string;
|
|
1615
|
+
purchase_count: number;
|
|
1616
|
+
revenue_total: number;
|
|
1617
|
+
slug: string;
|
|
1618
|
+
tags: string[];
|
|
1619
|
+
title: string;
|
|
1620
|
+
updated_at: string;
|
|
1621
|
+
view_count: number;
|
|
1622
|
+
}[];
|
|
1623
|
+
};
|
|
1624
|
+
get_reader_feed: {
|
|
1625
|
+
Args: {
|
|
1626
|
+
p_cursor?: string;
|
|
1627
|
+
p_filter?: string;
|
|
1628
|
+
p_from?: string;
|
|
1629
|
+
p_limit?: number;
|
|
1630
|
+
p_search?: string;
|
|
1631
|
+
p_to?: string;
|
|
1632
|
+
};
|
|
1633
|
+
Returns: {
|
|
1634
|
+
access_badge: string;
|
|
1635
|
+
author_avatar_url: string;
|
|
1636
|
+
author_display_name: string;
|
|
1637
|
+
author_username: string;
|
|
1638
|
+
cover_image_url: string;
|
|
1639
|
+
excerpt: string;
|
|
1640
|
+
has_access: boolean;
|
|
1641
|
+
is_liked: boolean;
|
|
1642
|
+
is_members_only: boolean;
|
|
1643
|
+
is_pay_per_post: boolean;
|
|
1644
|
+
like_count: number;
|
|
1645
|
+
post_id: string;
|
|
1646
|
+
price: number;
|
|
1647
|
+
profile_id: string;
|
|
1648
|
+
published_at: string;
|
|
1649
|
+
reading_time_minutes: number;
|
|
1650
|
+
slug: string;
|
|
1651
|
+
subtitle: string;
|
|
1652
|
+
tags: string[];
|
|
1653
|
+
title: string;
|
|
1654
|
+
view_count: number;
|
|
1655
|
+
}[];
|
|
1656
|
+
};
|
|
1657
|
+
get_supporter_coffee_gifts_stats: {
|
|
1658
|
+
Args: {
|
|
1659
|
+
p_from_date: string;
|
|
1660
|
+
p_supporter_profile_id: string;
|
|
1661
|
+
p_to_date: string;
|
|
1662
|
+
};
|
|
1663
|
+
Returns: {
|
|
1664
|
+
coffees_gifted: number;
|
|
1665
|
+
creators_supported: number;
|
|
1666
|
+
total_spent: number;
|
|
1667
|
+
}[];
|
|
1668
|
+
};
|
|
1051
1669
|
get_total_supports_count: {
|
|
1052
1670
|
Args: { p_creator_id: string; p_from_date: string; p_to_date: string };
|
|
1053
1671
|
Returns: number;
|
|
1054
1672
|
};
|
|
1673
|
+
gift_newsletter_post: {
|
|
1674
|
+
Args: {
|
|
1675
|
+
p_expires_at?: string;
|
|
1676
|
+
p_gift_message?: string;
|
|
1677
|
+
p_grantee_profile_id: string;
|
|
1678
|
+
p_post_id: string;
|
|
1679
|
+
p_transaction_reference_id?: string;
|
|
1680
|
+
};
|
|
1681
|
+
Returns: string;
|
|
1682
|
+
};
|
|
1055
1683
|
handle_successful_payment: {
|
|
1056
1684
|
Args: {
|
|
1057
1685
|
p_amount: number;
|
|
@@ -1067,6 +1695,14 @@ export type Database = {
|
|
|
1067
1695
|
};
|
|
1068
1696
|
Returns: Json;
|
|
1069
1697
|
};
|
|
1698
|
+
has_active_membership: {
|
|
1699
|
+
Args: {
|
|
1700
|
+
p_member_profile_id: string;
|
|
1701
|
+
p_owner_profile_id: string;
|
|
1702
|
+
p_service_type: string;
|
|
1703
|
+
};
|
|
1704
|
+
Returns: boolean;
|
|
1705
|
+
};
|
|
1070
1706
|
is_admin: { Args: never; Returns: boolean };
|
|
1071
1707
|
is_following: { Args: { target_user_id: string }; Returns: boolean };
|
|
1072
1708
|
is_manager: { Args: { user_email: string }; Returns: boolean };
|
|
@@ -1074,6 +1710,10 @@ export type Database = {
|
|
|
1074
1710
|
Args: { p_conversation_id: string };
|
|
1075
1711
|
Returns: undefined;
|
|
1076
1712
|
};
|
|
1713
|
+
record_newsletter_post_click: {
|
|
1714
|
+
Args: { p_post_id: string };
|
|
1715
|
+
Returns: undefined;
|
|
1716
|
+
};
|
|
1077
1717
|
request_withdrawal: {
|
|
1078
1718
|
Args: { p_amount: number; p_payout_method_id: string };
|
|
1079
1719
|
Returns: string;
|
|
@@ -1088,10 +1728,13 @@ export type Database = {
|
|
|
1088
1728
|
sender_id: string;
|
|
1089
1729
|
}[];
|
|
1090
1730
|
};
|
|
1091
|
-
show_limit: { Args: never; Returns: number };
|
|
1092
|
-
show_trgm: { Args: { "": string }; Returns: string[] };
|
|
1093
1731
|
toggle_follow: { Args: { target_user_id: string }; Returns: boolean };
|
|
1732
|
+
toggle_newsletter_post_like: {
|
|
1733
|
+
Args: { p_post_id: string };
|
|
1734
|
+
Returns: Json;
|
|
1735
|
+
};
|
|
1094
1736
|
unfollow_user: { Args: { target_user_id: string }; Returns: undefined };
|
|
1737
|
+
unpublish_newsletter_post: { Args: { p_post_id: string }; Returns: Json };
|
|
1095
1738
|
upsert_supporter: {
|
|
1096
1739
|
Args: {
|
|
1097
1740
|
p_amount?: number;
|
|
@@ -1107,6 +1750,7 @@ export type Database = {
|
|
|
1107
1750
|
};
|
|
1108
1751
|
};
|
|
1109
1752
|
Enums: {
|
|
1753
|
+
access_grant_type_enum: "purchase" | "gift";
|
|
1110
1754
|
manager_permission:
|
|
1111
1755
|
| "managers.create"
|
|
1112
1756
|
| "managers.view"
|
|
@@ -1143,6 +1787,13 @@ export type Database = {
|
|
|
1143
1787
|
| "finance_manager"
|
|
1144
1788
|
| "developer_manager";
|
|
1145
1789
|
manager_status: "ACTIVE" | "INACTIVE" | "SUSPENDED";
|
|
1790
|
+
membership_billing_cycle_enum: "monthly" | "annual" | "lifetime";
|
|
1791
|
+
membership_status_enum:
|
|
1792
|
+
| "active"
|
|
1793
|
+
| "cancelled"
|
|
1794
|
+
| "expired"
|
|
1795
|
+
| "paused"
|
|
1796
|
+
| "past_due";
|
|
1146
1797
|
payment_status_enum:
|
|
1147
1798
|
| "pending"
|
|
1148
1799
|
| "processing"
|
|
@@ -1153,6 +1804,12 @@ export type Database = {
|
|
|
1153
1804
|
| "refunded"
|
|
1154
1805
|
| "reviewing";
|
|
1155
1806
|
payout_provider: "bkash" | "nagad" | "rocket" | "bank";
|
|
1807
|
+
post_status_enum: "draft" | "published" | "archived";
|
|
1808
|
+
post_version_source_enum:
|
|
1809
|
+
| "autosave"
|
|
1810
|
+
| "ai_polish"
|
|
1811
|
+
| "manual_save"
|
|
1812
|
+
| "pre_publish";
|
|
1156
1813
|
provider_enum:
|
|
1157
1814
|
| "HobeNakiCoffee"
|
|
1158
1815
|
| "Bkash"
|
|
@@ -1339,6 +1996,7 @@ export type CompositeTypes<
|
|
|
1339
1996
|
export const Constants = {
|
|
1340
1997
|
public: {
|
|
1341
1998
|
Enums: {
|
|
1999
|
+
access_grant_type_enum: ["purchase", "gift"],
|
|
1342
2000
|
manager_permission: [
|
|
1343
2001
|
"managers.create",
|
|
1344
2002
|
"managers.view",
|
|
@@ -1377,6 +2035,14 @@ export const Constants = {
|
|
|
1377
2035
|
"developer_manager",
|
|
1378
2036
|
],
|
|
1379
2037
|
manager_status: ["ACTIVE", "INACTIVE", "SUSPENDED"],
|
|
2038
|
+
membership_billing_cycle_enum: ["monthly", "annual", "lifetime"],
|
|
2039
|
+
membership_status_enum: [
|
|
2040
|
+
"active",
|
|
2041
|
+
"cancelled",
|
|
2042
|
+
"expired",
|
|
2043
|
+
"paused",
|
|
2044
|
+
"past_due",
|
|
2045
|
+
],
|
|
1380
2046
|
payment_status_enum: [
|
|
1381
2047
|
"pending",
|
|
1382
2048
|
"processing",
|
|
@@ -1388,6 +2054,13 @@ export const Constants = {
|
|
|
1388
2054
|
"reviewing",
|
|
1389
2055
|
],
|
|
1390
2056
|
payout_provider: ["bkash", "nagad", "rocket", "bank"],
|
|
2057
|
+
post_status_enum: ["draft", "published", "archived"],
|
|
2058
|
+
post_version_source_enum: [
|
|
2059
|
+
"autosave",
|
|
2060
|
+
"ai_polish",
|
|
2061
|
+
"manual_save",
|
|
2062
|
+
"pre_publish",
|
|
2063
|
+
],
|
|
1391
2064
|
provider_enum: [
|
|
1392
2065
|
"HobeNakiCoffee",
|
|
1393
2066
|
"Bkash",
|