@elevasis/ui 1.2.1 → 1.3.1
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/dist/CoreAuthKitInner-3J4RVQO6.js +43 -0
- package/dist/api/index.d.ts +32 -18
- package/dist/api/index.js +4 -2
- package/dist/auth/context.d.ts +23 -5
- package/dist/auth/index.d.ts +119 -30
- package/dist/auth/index.js +6 -3
- package/dist/chunk-2JBWPFHF.js +108 -0
- package/dist/chunk-4VGWQ5AN.js +91 -0
- package/dist/chunk-72HOBFMP.js +87 -0
- package/dist/{chunk-WNWKOCGJ.js → chunk-A3MCANC6.js} +296 -2
- package/dist/{chunk-JKERRYVS.js → chunk-BLO4SISK.js} +7 -3
- package/dist/chunk-DD3CCMCZ.js +15 -0
- package/dist/chunk-FWZJH3TL.js +13 -0
- package/dist/{chunk-GEFB5YIR.js → chunk-JBFFCZI4.js} +1 -1
- package/dist/chunk-JGJSZ3UE.js +47 -0
- package/dist/{chunk-7AI5ZYJ4.js → chunk-JVAZHVNV.js} +2 -94
- package/dist/{chunk-ZGHDPDTF.js → chunk-JYSYHVLU.js} +3 -3
- package/dist/{chunk-5UWFGBFM.js → chunk-L2CM2CUA.js} +16 -4
- package/dist/chunk-NEK6JKPW.js +75 -0
- package/dist/{chunk-J3FALDQE.js → chunk-NXHL23JW.js} +7 -13
- package/dist/{chunk-OUHGHTE7.js → chunk-O3PY6B6E.js} +3 -2
- package/dist/{chunk-YULUKCS6.js → chunk-PVVQTENF.js} +1 -1
- package/dist/chunk-TIRMFDM4.js +33 -0
- package/dist/{chunk-PYL4XW6H.js → chunk-TMFCNFLW.js} +1 -1
- package/dist/{chunk-S66I2PYB.js → chunk-TN3PU2WK.js} +1 -1
- package/dist/chunk-TYV5NJV2.js +1 -0
- package/dist/{chunk-B64YDSAY.js → chunk-TZPAA4RC.js} +54 -97
- package/dist/chunk-UMXDDEAG.js +148 -0
- package/dist/chunk-XLV6LYN2.js +157 -0
- package/dist/components/command-queue/index.js +6 -4
- package/dist/components/index.js +9 -7
- package/dist/components/notifications/index.js +4 -3
- package/dist/display/index.js +3 -2
- package/dist/hooks/index.d.ts +2630 -3
- package/dist/hooks/index.js +9 -5
- package/dist/hooks/published.d.ts +2630 -3
- package/dist/hooks/published.js +7 -3
- package/dist/index.d.ts +759 -164
- package/dist/index.js +24 -18
- package/dist/initialization/index.d.ts +49 -1
- package/dist/initialization/index.js +5 -2
- package/dist/organization/index.d.ts +61 -2
- package/dist/organization/index.js +5 -2
- package/dist/profile/index.d.ts +30 -2
- package/dist/profile/index.js +2 -1
- package/dist/provider/index.d.ts +116 -43
- package/dist/provider/index.js +10 -6
- package/dist/provider/published.d.ts +88 -28
- package/dist/provider/published.js +9 -4
- package/dist/supabase/index.js +2 -47
- package/dist/utils/index.js +2 -1
- package/package.json +15 -2
- package/dist/CoreAuthKitInner-KM72EYJS.js +0 -19
- package/dist/chunk-GDV44UWF.js +0 -138
- package/dist/chunk-HBRMWW6V.js +0 -43
- package/dist/chunk-NIAVTSMB.js +0 -21
- package/dist/chunk-QSVZP2NU.js +0 -214
- package/dist/chunk-ZQVPUAGR.js +0 -89
- /package/dist/{chunk-Q47SPRY7.js → chunk-RNP5R5I3.js} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
+
import * as react from 'react';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -650,6 +651,2212 @@ interface AgentMemory {
|
|
|
650
651
|
history: MemoryEntry[];
|
|
651
652
|
}
|
|
652
653
|
|
|
654
|
+
type Json = string | number | boolean | null | {
|
|
655
|
+
[key: string]: Json | undefined;
|
|
656
|
+
} | Json[];
|
|
657
|
+
type Database = {
|
|
658
|
+
__InternalSupabase: {
|
|
659
|
+
PostgrestVersion: "12.2.3 (519615d)";
|
|
660
|
+
};
|
|
661
|
+
public: {
|
|
662
|
+
Tables: {
|
|
663
|
+
acq_companies: {
|
|
664
|
+
Row: {
|
|
665
|
+
attio_company_id: string | null;
|
|
666
|
+
batch_id: string | null;
|
|
667
|
+
category: string | null;
|
|
668
|
+
category_pain: string | null;
|
|
669
|
+
created_at: string;
|
|
670
|
+
domain: string | null;
|
|
671
|
+
enrichment_data: Json | null;
|
|
672
|
+
filter_reason: string | null;
|
|
673
|
+
founded_year: number | null;
|
|
674
|
+
id: string;
|
|
675
|
+
linkedin_url: string | null;
|
|
676
|
+
location_city: string | null;
|
|
677
|
+
location_state: string | null;
|
|
678
|
+
name: string;
|
|
679
|
+
num_employees: number | null;
|
|
680
|
+
organization_id: string;
|
|
681
|
+
pipeline_status: Json;
|
|
682
|
+
segment: string | null;
|
|
683
|
+
source: string | null;
|
|
684
|
+
status: string;
|
|
685
|
+
updated_at: string;
|
|
686
|
+
website: string | null;
|
|
687
|
+
};
|
|
688
|
+
Insert: {
|
|
689
|
+
attio_company_id?: string | null;
|
|
690
|
+
batch_id?: string | null;
|
|
691
|
+
category?: string | null;
|
|
692
|
+
category_pain?: string | null;
|
|
693
|
+
created_at?: string;
|
|
694
|
+
domain?: string | null;
|
|
695
|
+
enrichment_data?: Json | null;
|
|
696
|
+
filter_reason?: string | null;
|
|
697
|
+
founded_year?: number | null;
|
|
698
|
+
id?: string;
|
|
699
|
+
linkedin_url?: string | null;
|
|
700
|
+
location_city?: string | null;
|
|
701
|
+
location_state?: string | null;
|
|
702
|
+
name: string;
|
|
703
|
+
num_employees?: number | null;
|
|
704
|
+
organization_id: string;
|
|
705
|
+
pipeline_status?: Json;
|
|
706
|
+
segment?: string | null;
|
|
707
|
+
source?: string | null;
|
|
708
|
+
status?: string;
|
|
709
|
+
updated_at?: string;
|
|
710
|
+
website?: string | null;
|
|
711
|
+
};
|
|
712
|
+
Update: {
|
|
713
|
+
attio_company_id?: string | null;
|
|
714
|
+
batch_id?: string | null;
|
|
715
|
+
category?: string | null;
|
|
716
|
+
category_pain?: string | null;
|
|
717
|
+
created_at?: string;
|
|
718
|
+
domain?: string | null;
|
|
719
|
+
enrichment_data?: Json | null;
|
|
720
|
+
filter_reason?: string | null;
|
|
721
|
+
founded_year?: number | null;
|
|
722
|
+
id?: string;
|
|
723
|
+
linkedin_url?: string | null;
|
|
724
|
+
location_city?: string | null;
|
|
725
|
+
location_state?: string | null;
|
|
726
|
+
name?: string;
|
|
727
|
+
num_employees?: number | null;
|
|
728
|
+
organization_id?: string;
|
|
729
|
+
pipeline_status?: Json;
|
|
730
|
+
segment?: string | null;
|
|
731
|
+
source?: string | null;
|
|
732
|
+
status?: string;
|
|
733
|
+
updated_at?: string;
|
|
734
|
+
website?: string | null;
|
|
735
|
+
};
|
|
736
|
+
Relationships: [
|
|
737
|
+
{
|
|
738
|
+
foreignKeyName: "acq_companies_organization_id_fkey";
|
|
739
|
+
columns: ["organization_id"];
|
|
740
|
+
isOneToOne: false;
|
|
741
|
+
referencedRelation: "organizations";
|
|
742
|
+
referencedColumns: ["id"];
|
|
743
|
+
}
|
|
744
|
+
];
|
|
745
|
+
};
|
|
746
|
+
acq_contacts: {
|
|
747
|
+
Row: {
|
|
748
|
+
attio_person_id: string | null;
|
|
749
|
+
batch_id: string | null;
|
|
750
|
+
brochure_first_viewed_at: string | null;
|
|
751
|
+
brochure_view_count: number;
|
|
752
|
+
company_id: string | null;
|
|
753
|
+
created_at: string;
|
|
754
|
+
email: string;
|
|
755
|
+
email_valid: string | null;
|
|
756
|
+
enrichment_data: Json;
|
|
757
|
+
filter_reason: string | null;
|
|
758
|
+
first_name: string | null;
|
|
759
|
+
headline: string | null;
|
|
760
|
+
id: string;
|
|
761
|
+
last_name: string | null;
|
|
762
|
+
linkedin_url: string | null;
|
|
763
|
+
nurture: boolean;
|
|
764
|
+
opening_line: string | null;
|
|
765
|
+
organization_id: string;
|
|
766
|
+
pipeline_status: Json;
|
|
767
|
+
source: string | null;
|
|
768
|
+
source_id: string | null;
|
|
769
|
+
status: string;
|
|
770
|
+
title: string | null;
|
|
771
|
+
updated_at: string;
|
|
772
|
+
};
|
|
773
|
+
Insert: {
|
|
774
|
+
attio_person_id?: string | null;
|
|
775
|
+
batch_id?: string | null;
|
|
776
|
+
brochure_first_viewed_at?: string | null;
|
|
777
|
+
brochure_view_count?: number;
|
|
778
|
+
company_id?: string | null;
|
|
779
|
+
created_at?: string;
|
|
780
|
+
email: string;
|
|
781
|
+
email_valid?: string | null;
|
|
782
|
+
enrichment_data?: Json;
|
|
783
|
+
filter_reason?: string | null;
|
|
784
|
+
first_name?: string | null;
|
|
785
|
+
headline?: string | null;
|
|
786
|
+
id?: string;
|
|
787
|
+
last_name?: string | null;
|
|
788
|
+
linkedin_url?: string | null;
|
|
789
|
+
nurture?: boolean;
|
|
790
|
+
opening_line?: string | null;
|
|
791
|
+
organization_id: string;
|
|
792
|
+
pipeline_status?: Json;
|
|
793
|
+
source?: string | null;
|
|
794
|
+
source_id?: string | null;
|
|
795
|
+
status?: string;
|
|
796
|
+
title?: string | null;
|
|
797
|
+
updated_at?: string;
|
|
798
|
+
};
|
|
799
|
+
Update: {
|
|
800
|
+
attio_person_id?: string | null;
|
|
801
|
+
batch_id?: string | null;
|
|
802
|
+
brochure_first_viewed_at?: string | null;
|
|
803
|
+
brochure_view_count?: number;
|
|
804
|
+
company_id?: string | null;
|
|
805
|
+
created_at?: string;
|
|
806
|
+
email?: string;
|
|
807
|
+
email_valid?: string | null;
|
|
808
|
+
enrichment_data?: Json;
|
|
809
|
+
filter_reason?: string | null;
|
|
810
|
+
first_name?: string | null;
|
|
811
|
+
headline?: string | null;
|
|
812
|
+
id?: string;
|
|
813
|
+
last_name?: string | null;
|
|
814
|
+
linkedin_url?: string | null;
|
|
815
|
+
nurture?: boolean;
|
|
816
|
+
opening_line?: string | null;
|
|
817
|
+
organization_id?: string;
|
|
818
|
+
pipeline_status?: Json;
|
|
819
|
+
source?: string | null;
|
|
820
|
+
source_id?: string | null;
|
|
821
|
+
status?: string;
|
|
822
|
+
title?: string | null;
|
|
823
|
+
updated_at?: string;
|
|
824
|
+
};
|
|
825
|
+
Relationships: [
|
|
826
|
+
{
|
|
827
|
+
foreignKeyName: "acq_contacts_company_id_fkey";
|
|
828
|
+
columns: ["company_id"];
|
|
829
|
+
isOneToOne: false;
|
|
830
|
+
referencedRelation: "acq_companies";
|
|
831
|
+
referencedColumns: ["id"];
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
foreignKeyName: "acq_contacts_organization_id_fkey";
|
|
835
|
+
columns: ["organization_id"];
|
|
836
|
+
isOneToOne: false;
|
|
837
|
+
referencedRelation: "organizations";
|
|
838
|
+
referencedColumns: ["id"];
|
|
839
|
+
}
|
|
840
|
+
];
|
|
841
|
+
};
|
|
842
|
+
acq_content: {
|
|
843
|
+
Row: {
|
|
844
|
+
body: string | null;
|
|
845
|
+
created_at: string;
|
|
846
|
+
id: string;
|
|
847
|
+
organization_id: string;
|
|
848
|
+
pillar: string;
|
|
849
|
+
status: string;
|
|
850
|
+
title: string;
|
|
851
|
+
updated_at: string;
|
|
852
|
+
};
|
|
853
|
+
Insert: {
|
|
854
|
+
body?: string | null;
|
|
855
|
+
created_at?: string;
|
|
856
|
+
id?: string;
|
|
857
|
+
organization_id: string;
|
|
858
|
+
pillar: string;
|
|
859
|
+
status?: string;
|
|
860
|
+
title: string;
|
|
861
|
+
updated_at?: string;
|
|
862
|
+
};
|
|
863
|
+
Update: {
|
|
864
|
+
body?: string | null;
|
|
865
|
+
created_at?: string;
|
|
866
|
+
id?: string;
|
|
867
|
+
organization_id?: string;
|
|
868
|
+
pillar?: string;
|
|
869
|
+
status?: string;
|
|
870
|
+
title?: string;
|
|
871
|
+
updated_at?: string;
|
|
872
|
+
};
|
|
873
|
+
Relationships: [
|
|
874
|
+
{
|
|
875
|
+
foreignKeyName: "acq_content_organization_id_fkey";
|
|
876
|
+
columns: ["organization_id"];
|
|
877
|
+
isOneToOne: false;
|
|
878
|
+
referencedRelation: "organizations";
|
|
879
|
+
referencedColumns: ["id"];
|
|
880
|
+
}
|
|
881
|
+
];
|
|
882
|
+
};
|
|
883
|
+
acq_content_distributions: {
|
|
884
|
+
Row: {
|
|
885
|
+
adapted_body: string | null;
|
|
886
|
+
checklist: Json | null;
|
|
887
|
+
content_id: string;
|
|
888
|
+
created_at: string;
|
|
889
|
+
format: string;
|
|
890
|
+
id: string;
|
|
891
|
+
media_urls: Json;
|
|
892
|
+
metrics: Json;
|
|
893
|
+
metrics_updated_at: string | null;
|
|
894
|
+
organization_id: string;
|
|
895
|
+
platform: string;
|
|
896
|
+
platform_content: Json | null;
|
|
897
|
+
platform_post_id: string | null;
|
|
898
|
+
platform_url: string | null;
|
|
899
|
+
published_at: string | null;
|
|
900
|
+
status: string;
|
|
901
|
+
updated_at: string;
|
|
902
|
+
};
|
|
903
|
+
Insert: {
|
|
904
|
+
adapted_body?: string | null;
|
|
905
|
+
checklist?: Json | null;
|
|
906
|
+
content_id: string;
|
|
907
|
+
created_at?: string;
|
|
908
|
+
format: string;
|
|
909
|
+
id?: string;
|
|
910
|
+
media_urls?: Json;
|
|
911
|
+
metrics?: Json;
|
|
912
|
+
metrics_updated_at?: string | null;
|
|
913
|
+
organization_id: string;
|
|
914
|
+
platform: string;
|
|
915
|
+
platform_content?: Json | null;
|
|
916
|
+
platform_post_id?: string | null;
|
|
917
|
+
platform_url?: string | null;
|
|
918
|
+
published_at?: string | null;
|
|
919
|
+
status?: string;
|
|
920
|
+
updated_at?: string;
|
|
921
|
+
};
|
|
922
|
+
Update: {
|
|
923
|
+
adapted_body?: string | null;
|
|
924
|
+
checklist?: Json | null;
|
|
925
|
+
content_id?: string;
|
|
926
|
+
created_at?: string;
|
|
927
|
+
format?: string;
|
|
928
|
+
id?: string;
|
|
929
|
+
media_urls?: Json;
|
|
930
|
+
metrics?: Json;
|
|
931
|
+
metrics_updated_at?: string | null;
|
|
932
|
+
organization_id?: string;
|
|
933
|
+
platform?: string;
|
|
934
|
+
platform_content?: Json | null;
|
|
935
|
+
platform_post_id?: string | null;
|
|
936
|
+
platform_url?: string | null;
|
|
937
|
+
published_at?: string | null;
|
|
938
|
+
status?: string;
|
|
939
|
+
updated_at?: string;
|
|
940
|
+
};
|
|
941
|
+
Relationships: [
|
|
942
|
+
{
|
|
943
|
+
foreignKeyName: "acq_content_distributions_content_id_fkey";
|
|
944
|
+
columns: ["content_id"];
|
|
945
|
+
isOneToOne: false;
|
|
946
|
+
referencedRelation: "acq_content";
|
|
947
|
+
referencedColumns: ["id"];
|
|
948
|
+
},
|
|
949
|
+
{
|
|
950
|
+
foreignKeyName: "acq_content_distributions_organization_id_fkey";
|
|
951
|
+
columns: ["organization_id"];
|
|
952
|
+
isOneToOne: false;
|
|
953
|
+
referencedRelation: "organizations";
|
|
954
|
+
referencedColumns: ["id"];
|
|
955
|
+
}
|
|
956
|
+
];
|
|
957
|
+
};
|
|
958
|
+
acq_deals: {
|
|
959
|
+
Row: {
|
|
960
|
+
activity_log: Json;
|
|
961
|
+
attio_deal_id: string;
|
|
962
|
+
cached_stage: string | null;
|
|
963
|
+
closed_lost_at: string | null;
|
|
964
|
+
closed_lost_reason: string | null;
|
|
965
|
+
contact_email: string;
|
|
966
|
+
contact_id: string | null;
|
|
967
|
+
created_at: string;
|
|
968
|
+
discovery_data: Json | null;
|
|
969
|
+
discovery_submitted_at: string | null;
|
|
970
|
+
discovery_submitted_by: string | null;
|
|
971
|
+
id: string;
|
|
972
|
+
initial_fee: number | null;
|
|
973
|
+
monthly_fee: number | null;
|
|
974
|
+
organization_id: string;
|
|
975
|
+
payment_link_sent_at: string | null;
|
|
976
|
+
payment_received_at: string | null;
|
|
977
|
+
proposal_data: Json | null;
|
|
978
|
+
proposal_generated_at: string | null;
|
|
979
|
+
proposal_pdf_url: string | null;
|
|
980
|
+
proposal_reviewed_at: string | null;
|
|
981
|
+
proposal_reviewed_by: string | null;
|
|
982
|
+
proposal_sent_at: string | null;
|
|
983
|
+
proposal_signed_at: string | null;
|
|
984
|
+
proposal_status: string | null;
|
|
985
|
+
signature_envelope_id: string | null;
|
|
986
|
+
source_list_id: string | null;
|
|
987
|
+
source_type: string | null;
|
|
988
|
+
stripe_payment_id: string | null;
|
|
989
|
+
stripe_payment_link: string | null;
|
|
990
|
+
stripe_payment_link_id: string | null;
|
|
991
|
+
stripe_subscription_id: string | null;
|
|
992
|
+
updated_at: string;
|
|
993
|
+
};
|
|
994
|
+
Insert: {
|
|
995
|
+
activity_log?: Json;
|
|
996
|
+
attio_deal_id: string;
|
|
997
|
+
cached_stage?: string | null;
|
|
998
|
+
closed_lost_at?: string | null;
|
|
999
|
+
closed_lost_reason?: string | null;
|
|
1000
|
+
contact_email: string;
|
|
1001
|
+
contact_id?: string | null;
|
|
1002
|
+
created_at?: string;
|
|
1003
|
+
discovery_data?: Json | null;
|
|
1004
|
+
discovery_submitted_at?: string | null;
|
|
1005
|
+
discovery_submitted_by?: string | null;
|
|
1006
|
+
id?: string;
|
|
1007
|
+
initial_fee?: number | null;
|
|
1008
|
+
monthly_fee?: number | null;
|
|
1009
|
+
organization_id: string;
|
|
1010
|
+
payment_link_sent_at?: string | null;
|
|
1011
|
+
payment_received_at?: string | null;
|
|
1012
|
+
proposal_data?: Json | null;
|
|
1013
|
+
proposal_generated_at?: string | null;
|
|
1014
|
+
proposal_pdf_url?: string | null;
|
|
1015
|
+
proposal_reviewed_at?: string | null;
|
|
1016
|
+
proposal_reviewed_by?: string | null;
|
|
1017
|
+
proposal_sent_at?: string | null;
|
|
1018
|
+
proposal_signed_at?: string | null;
|
|
1019
|
+
proposal_status?: string | null;
|
|
1020
|
+
signature_envelope_id?: string | null;
|
|
1021
|
+
source_list_id?: string | null;
|
|
1022
|
+
source_type?: string | null;
|
|
1023
|
+
stripe_payment_id?: string | null;
|
|
1024
|
+
stripe_payment_link?: string | null;
|
|
1025
|
+
stripe_payment_link_id?: string | null;
|
|
1026
|
+
stripe_subscription_id?: string | null;
|
|
1027
|
+
updated_at?: string;
|
|
1028
|
+
};
|
|
1029
|
+
Update: {
|
|
1030
|
+
activity_log?: Json;
|
|
1031
|
+
attio_deal_id?: string;
|
|
1032
|
+
cached_stage?: string | null;
|
|
1033
|
+
closed_lost_at?: string | null;
|
|
1034
|
+
closed_lost_reason?: string | null;
|
|
1035
|
+
contact_email?: string;
|
|
1036
|
+
contact_id?: string | null;
|
|
1037
|
+
created_at?: string;
|
|
1038
|
+
discovery_data?: Json | null;
|
|
1039
|
+
discovery_submitted_at?: string | null;
|
|
1040
|
+
discovery_submitted_by?: string | null;
|
|
1041
|
+
id?: string;
|
|
1042
|
+
initial_fee?: number | null;
|
|
1043
|
+
monthly_fee?: number | null;
|
|
1044
|
+
organization_id?: string;
|
|
1045
|
+
payment_link_sent_at?: string | null;
|
|
1046
|
+
payment_received_at?: string | null;
|
|
1047
|
+
proposal_data?: Json | null;
|
|
1048
|
+
proposal_generated_at?: string | null;
|
|
1049
|
+
proposal_pdf_url?: string | null;
|
|
1050
|
+
proposal_reviewed_at?: string | null;
|
|
1051
|
+
proposal_reviewed_by?: string | null;
|
|
1052
|
+
proposal_sent_at?: string | null;
|
|
1053
|
+
proposal_signed_at?: string | null;
|
|
1054
|
+
proposal_status?: string | null;
|
|
1055
|
+
signature_envelope_id?: string | null;
|
|
1056
|
+
source_list_id?: string | null;
|
|
1057
|
+
source_type?: string | null;
|
|
1058
|
+
stripe_payment_id?: string | null;
|
|
1059
|
+
stripe_payment_link?: string | null;
|
|
1060
|
+
stripe_payment_link_id?: string | null;
|
|
1061
|
+
stripe_subscription_id?: string | null;
|
|
1062
|
+
updated_at?: string;
|
|
1063
|
+
};
|
|
1064
|
+
Relationships: [
|
|
1065
|
+
{
|
|
1066
|
+
foreignKeyName: "acq_deals_contact_id_fkey";
|
|
1067
|
+
columns: ["contact_id"];
|
|
1068
|
+
isOneToOne: false;
|
|
1069
|
+
referencedRelation: "acq_contacts";
|
|
1070
|
+
referencedColumns: ["id"];
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
foreignKeyName: "acq_deals_organization_id_fkey";
|
|
1074
|
+
columns: ["organization_id"];
|
|
1075
|
+
isOneToOne: false;
|
|
1076
|
+
referencedRelation: "organizations";
|
|
1077
|
+
referencedColumns: ["id"];
|
|
1078
|
+
},
|
|
1079
|
+
{
|
|
1080
|
+
foreignKeyName: "acq_deals_source_list_id_fkey";
|
|
1081
|
+
columns: ["source_list_id"];
|
|
1082
|
+
isOneToOne: false;
|
|
1083
|
+
referencedRelation: "acq_lists";
|
|
1084
|
+
referencedColumns: ["id"];
|
|
1085
|
+
}
|
|
1086
|
+
];
|
|
1087
|
+
};
|
|
1088
|
+
acq_list_members: {
|
|
1089
|
+
Row: {
|
|
1090
|
+
added_at: string;
|
|
1091
|
+
added_by: string | null;
|
|
1092
|
+
contact_id: string;
|
|
1093
|
+
id: string;
|
|
1094
|
+
list_id: string;
|
|
1095
|
+
};
|
|
1096
|
+
Insert: {
|
|
1097
|
+
added_at?: string;
|
|
1098
|
+
added_by?: string | null;
|
|
1099
|
+
contact_id: string;
|
|
1100
|
+
id?: string;
|
|
1101
|
+
list_id: string;
|
|
1102
|
+
};
|
|
1103
|
+
Update: {
|
|
1104
|
+
added_at?: string;
|
|
1105
|
+
added_by?: string | null;
|
|
1106
|
+
contact_id?: string;
|
|
1107
|
+
id?: string;
|
|
1108
|
+
list_id?: string;
|
|
1109
|
+
};
|
|
1110
|
+
Relationships: [
|
|
1111
|
+
{
|
|
1112
|
+
foreignKeyName: "acq_list_members_contact_id_fkey";
|
|
1113
|
+
columns: ["contact_id"];
|
|
1114
|
+
isOneToOne: false;
|
|
1115
|
+
referencedRelation: "acq_contacts";
|
|
1116
|
+
referencedColumns: ["id"];
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
foreignKeyName: "acq_list_members_list_id_fkey";
|
|
1120
|
+
columns: ["list_id"];
|
|
1121
|
+
isOneToOne: false;
|
|
1122
|
+
referencedRelation: "acq_lists";
|
|
1123
|
+
referencedColumns: ["id"];
|
|
1124
|
+
}
|
|
1125
|
+
];
|
|
1126
|
+
};
|
|
1127
|
+
acq_lists: {
|
|
1128
|
+
Row: {
|
|
1129
|
+
batch_ids: string[];
|
|
1130
|
+
completed_at: string | null;
|
|
1131
|
+
created_at: string;
|
|
1132
|
+
description: string | null;
|
|
1133
|
+
id: string;
|
|
1134
|
+
instantly_campaign_id: string | null;
|
|
1135
|
+
launched_at: string | null;
|
|
1136
|
+
metadata: Json;
|
|
1137
|
+
name: string;
|
|
1138
|
+
organization_id: string;
|
|
1139
|
+
status: string;
|
|
1140
|
+
type: string;
|
|
1141
|
+
};
|
|
1142
|
+
Insert: {
|
|
1143
|
+
batch_ids?: string[];
|
|
1144
|
+
completed_at?: string | null;
|
|
1145
|
+
created_at?: string;
|
|
1146
|
+
description?: string | null;
|
|
1147
|
+
id?: string;
|
|
1148
|
+
instantly_campaign_id?: string | null;
|
|
1149
|
+
launched_at?: string | null;
|
|
1150
|
+
metadata?: Json;
|
|
1151
|
+
name: string;
|
|
1152
|
+
organization_id: string;
|
|
1153
|
+
status?: string;
|
|
1154
|
+
type?: string;
|
|
1155
|
+
};
|
|
1156
|
+
Update: {
|
|
1157
|
+
batch_ids?: string[];
|
|
1158
|
+
completed_at?: string | null;
|
|
1159
|
+
created_at?: string;
|
|
1160
|
+
description?: string | null;
|
|
1161
|
+
id?: string;
|
|
1162
|
+
instantly_campaign_id?: string | null;
|
|
1163
|
+
launched_at?: string | null;
|
|
1164
|
+
metadata?: Json;
|
|
1165
|
+
name?: string;
|
|
1166
|
+
organization_id?: string;
|
|
1167
|
+
status?: string;
|
|
1168
|
+
type?: string;
|
|
1169
|
+
};
|
|
1170
|
+
Relationships: [
|
|
1171
|
+
{
|
|
1172
|
+
foreignKeyName: "acq_lists_organization_id_fkey";
|
|
1173
|
+
columns: ["organization_id"];
|
|
1174
|
+
isOneToOne: false;
|
|
1175
|
+
referencedRelation: "organizations";
|
|
1176
|
+
referencedColumns: ["id"];
|
|
1177
|
+
}
|
|
1178
|
+
];
|
|
1179
|
+
};
|
|
1180
|
+
acq_seo_metrics: {
|
|
1181
|
+
Row: {
|
|
1182
|
+
ai_citations: Json | null;
|
|
1183
|
+
avg_position: number | null;
|
|
1184
|
+
clicks: number | null;
|
|
1185
|
+
created_at: string;
|
|
1186
|
+
cta_clicks: number | null;
|
|
1187
|
+
ctr: number | null;
|
|
1188
|
+
data_point_count: number | null;
|
|
1189
|
+
faq_count: number | null;
|
|
1190
|
+
form_submissions: number | null;
|
|
1191
|
+
id: string;
|
|
1192
|
+
impressions: number | null;
|
|
1193
|
+
organization_id: string;
|
|
1194
|
+
period: string;
|
|
1195
|
+
quality_score: number | null;
|
|
1196
|
+
readability: number | null;
|
|
1197
|
+
scroll_100: number | null;
|
|
1198
|
+
scroll_25: number | null;
|
|
1199
|
+
scroll_50: number | null;
|
|
1200
|
+
scroll_75: number | null;
|
|
1201
|
+
seo_page_id: string;
|
|
1202
|
+
word_count: number | null;
|
|
1203
|
+
};
|
|
1204
|
+
Insert: {
|
|
1205
|
+
ai_citations?: Json | null;
|
|
1206
|
+
avg_position?: number | null;
|
|
1207
|
+
clicks?: number | null;
|
|
1208
|
+
created_at?: string;
|
|
1209
|
+
cta_clicks?: number | null;
|
|
1210
|
+
ctr?: number | null;
|
|
1211
|
+
data_point_count?: number | null;
|
|
1212
|
+
faq_count?: number | null;
|
|
1213
|
+
form_submissions?: number | null;
|
|
1214
|
+
id?: string;
|
|
1215
|
+
impressions?: number | null;
|
|
1216
|
+
organization_id: string;
|
|
1217
|
+
period: string;
|
|
1218
|
+
quality_score?: number | null;
|
|
1219
|
+
readability?: number | null;
|
|
1220
|
+
scroll_100?: number | null;
|
|
1221
|
+
scroll_25?: number | null;
|
|
1222
|
+
scroll_50?: number | null;
|
|
1223
|
+
scroll_75?: number | null;
|
|
1224
|
+
seo_page_id: string;
|
|
1225
|
+
word_count?: number | null;
|
|
1226
|
+
};
|
|
1227
|
+
Update: {
|
|
1228
|
+
ai_citations?: Json | null;
|
|
1229
|
+
avg_position?: number | null;
|
|
1230
|
+
clicks?: number | null;
|
|
1231
|
+
created_at?: string;
|
|
1232
|
+
cta_clicks?: number | null;
|
|
1233
|
+
ctr?: number | null;
|
|
1234
|
+
data_point_count?: number | null;
|
|
1235
|
+
faq_count?: number | null;
|
|
1236
|
+
form_submissions?: number | null;
|
|
1237
|
+
id?: string;
|
|
1238
|
+
impressions?: number | null;
|
|
1239
|
+
organization_id?: string;
|
|
1240
|
+
period?: string;
|
|
1241
|
+
quality_score?: number | null;
|
|
1242
|
+
readability?: number | null;
|
|
1243
|
+
scroll_100?: number | null;
|
|
1244
|
+
scroll_25?: number | null;
|
|
1245
|
+
scroll_50?: number | null;
|
|
1246
|
+
scroll_75?: number | null;
|
|
1247
|
+
seo_page_id?: string;
|
|
1248
|
+
word_count?: number | null;
|
|
1249
|
+
};
|
|
1250
|
+
Relationships: [
|
|
1251
|
+
{
|
|
1252
|
+
foreignKeyName: "acq_seo_metrics_organization_id_fkey";
|
|
1253
|
+
columns: ["organization_id"];
|
|
1254
|
+
isOneToOne: false;
|
|
1255
|
+
referencedRelation: "organizations";
|
|
1256
|
+
referencedColumns: ["id"];
|
|
1257
|
+
},
|
|
1258
|
+
{
|
|
1259
|
+
foreignKeyName: "acq_seo_metrics_seo_page_id_fkey";
|
|
1260
|
+
columns: ["seo_page_id"];
|
|
1261
|
+
isOneToOne: false;
|
|
1262
|
+
referencedRelation: "acq_seo_pages";
|
|
1263
|
+
referencedColumns: ["id"];
|
|
1264
|
+
}
|
|
1265
|
+
];
|
|
1266
|
+
};
|
|
1267
|
+
acq_seo_pages: {
|
|
1268
|
+
Row: {
|
|
1269
|
+
city: string | null;
|
|
1270
|
+
content: Json | null;
|
|
1271
|
+
created_at: string;
|
|
1272
|
+
faq_items: Json | null;
|
|
1273
|
+
hero_image_url: string | null;
|
|
1274
|
+
id: string;
|
|
1275
|
+
internal_links: Json | null;
|
|
1276
|
+
local_data: Json | null;
|
|
1277
|
+
meta_description: string | null;
|
|
1278
|
+
organization_id: string;
|
|
1279
|
+
page_type: string;
|
|
1280
|
+
published_at: string | null;
|
|
1281
|
+
refreshed_at: string | null;
|
|
1282
|
+
schema_markup: Json | null;
|
|
1283
|
+
slug: string;
|
|
1284
|
+
state: string | null;
|
|
1285
|
+
status: string;
|
|
1286
|
+
title: string;
|
|
1287
|
+
updated_at: string;
|
|
1288
|
+
use_case: string | null;
|
|
1289
|
+
vertical: string;
|
|
1290
|
+
};
|
|
1291
|
+
Insert: {
|
|
1292
|
+
city?: string | null;
|
|
1293
|
+
content?: Json | null;
|
|
1294
|
+
created_at?: string;
|
|
1295
|
+
faq_items?: Json | null;
|
|
1296
|
+
hero_image_url?: string | null;
|
|
1297
|
+
id?: string;
|
|
1298
|
+
internal_links?: Json | null;
|
|
1299
|
+
local_data?: Json | null;
|
|
1300
|
+
meta_description?: string | null;
|
|
1301
|
+
organization_id: string;
|
|
1302
|
+
page_type: string;
|
|
1303
|
+
published_at?: string | null;
|
|
1304
|
+
refreshed_at?: string | null;
|
|
1305
|
+
schema_markup?: Json | null;
|
|
1306
|
+
slug: string;
|
|
1307
|
+
state?: string | null;
|
|
1308
|
+
status?: string;
|
|
1309
|
+
title: string;
|
|
1310
|
+
updated_at?: string;
|
|
1311
|
+
use_case?: string | null;
|
|
1312
|
+
vertical: string;
|
|
1313
|
+
};
|
|
1314
|
+
Update: {
|
|
1315
|
+
city?: string | null;
|
|
1316
|
+
content?: Json | null;
|
|
1317
|
+
created_at?: string;
|
|
1318
|
+
faq_items?: Json | null;
|
|
1319
|
+
hero_image_url?: string | null;
|
|
1320
|
+
id?: string;
|
|
1321
|
+
internal_links?: Json | null;
|
|
1322
|
+
local_data?: Json | null;
|
|
1323
|
+
meta_description?: string | null;
|
|
1324
|
+
organization_id?: string;
|
|
1325
|
+
page_type?: string;
|
|
1326
|
+
published_at?: string | null;
|
|
1327
|
+
refreshed_at?: string | null;
|
|
1328
|
+
schema_markup?: Json | null;
|
|
1329
|
+
slug?: string;
|
|
1330
|
+
state?: string | null;
|
|
1331
|
+
status?: string;
|
|
1332
|
+
title?: string;
|
|
1333
|
+
updated_at?: string;
|
|
1334
|
+
use_case?: string | null;
|
|
1335
|
+
vertical?: string;
|
|
1336
|
+
};
|
|
1337
|
+
Relationships: [
|
|
1338
|
+
{
|
|
1339
|
+
foreignKeyName: "acq_seo_pages_organization_id_fkey";
|
|
1340
|
+
columns: ["organization_id"];
|
|
1341
|
+
isOneToOne: false;
|
|
1342
|
+
referencedRelation: "organizations";
|
|
1343
|
+
referencedColumns: ["id"];
|
|
1344
|
+
}
|
|
1345
|
+
];
|
|
1346
|
+
};
|
|
1347
|
+
acq_social_posts: {
|
|
1348
|
+
Row: {
|
|
1349
|
+
author_name: string;
|
|
1350
|
+
author_url: string | null;
|
|
1351
|
+
comments_count: number;
|
|
1352
|
+
created_at: string;
|
|
1353
|
+
discovered_at: string;
|
|
1354
|
+
engagement_count: number;
|
|
1355
|
+
feedback: string | null;
|
|
1356
|
+
final_response: string | null;
|
|
1357
|
+
fully_reviewed: boolean;
|
|
1358
|
+
id: string;
|
|
1359
|
+
initial_draft: string | null;
|
|
1360
|
+
matched_keywords: string[];
|
|
1361
|
+
matched_query: string | null;
|
|
1362
|
+
metadata: Json;
|
|
1363
|
+
organization_id: string;
|
|
1364
|
+
platform: string;
|
|
1365
|
+
platform_post_id: string;
|
|
1366
|
+
post_text: string;
|
|
1367
|
+
post_title: string;
|
|
1368
|
+
post_url: string;
|
|
1369
|
+
posted_at: string;
|
|
1370
|
+
relevance_score: number;
|
|
1371
|
+
responded_at: string | null;
|
|
1372
|
+
reviewed_at: string | null;
|
|
1373
|
+
skip_reason: string | null;
|
|
1374
|
+
source_category: string | null;
|
|
1375
|
+
status: string;
|
|
1376
|
+
updated_at: string;
|
|
1377
|
+
};
|
|
1378
|
+
Insert: {
|
|
1379
|
+
author_name: string;
|
|
1380
|
+
author_url?: string | null;
|
|
1381
|
+
comments_count?: number;
|
|
1382
|
+
created_at?: string;
|
|
1383
|
+
discovered_at?: string;
|
|
1384
|
+
engagement_count?: number;
|
|
1385
|
+
feedback?: string | null;
|
|
1386
|
+
final_response?: string | null;
|
|
1387
|
+
fully_reviewed?: boolean;
|
|
1388
|
+
id?: string;
|
|
1389
|
+
initial_draft?: string | null;
|
|
1390
|
+
matched_keywords?: string[];
|
|
1391
|
+
matched_query?: string | null;
|
|
1392
|
+
metadata?: Json;
|
|
1393
|
+
organization_id: string;
|
|
1394
|
+
platform: string;
|
|
1395
|
+
platform_post_id: string;
|
|
1396
|
+
post_text: string;
|
|
1397
|
+
post_title: string;
|
|
1398
|
+
post_url: string;
|
|
1399
|
+
posted_at: string;
|
|
1400
|
+
relevance_score?: number;
|
|
1401
|
+
responded_at?: string | null;
|
|
1402
|
+
reviewed_at?: string | null;
|
|
1403
|
+
skip_reason?: string | null;
|
|
1404
|
+
source_category?: string | null;
|
|
1405
|
+
status?: string;
|
|
1406
|
+
updated_at?: string;
|
|
1407
|
+
};
|
|
1408
|
+
Update: {
|
|
1409
|
+
author_name?: string;
|
|
1410
|
+
author_url?: string | null;
|
|
1411
|
+
comments_count?: number;
|
|
1412
|
+
created_at?: string;
|
|
1413
|
+
discovered_at?: string;
|
|
1414
|
+
engagement_count?: number;
|
|
1415
|
+
feedback?: string | null;
|
|
1416
|
+
final_response?: string | null;
|
|
1417
|
+
fully_reviewed?: boolean;
|
|
1418
|
+
id?: string;
|
|
1419
|
+
initial_draft?: string | null;
|
|
1420
|
+
matched_keywords?: string[];
|
|
1421
|
+
matched_query?: string | null;
|
|
1422
|
+
metadata?: Json;
|
|
1423
|
+
organization_id?: string;
|
|
1424
|
+
platform?: string;
|
|
1425
|
+
platform_post_id?: string;
|
|
1426
|
+
post_text?: string;
|
|
1427
|
+
post_title?: string;
|
|
1428
|
+
post_url?: string;
|
|
1429
|
+
posted_at?: string;
|
|
1430
|
+
relevance_score?: number;
|
|
1431
|
+
responded_at?: string | null;
|
|
1432
|
+
reviewed_at?: string | null;
|
|
1433
|
+
skip_reason?: string | null;
|
|
1434
|
+
source_category?: string | null;
|
|
1435
|
+
status?: string;
|
|
1436
|
+
updated_at?: string;
|
|
1437
|
+
};
|
|
1438
|
+
Relationships: [
|
|
1439
|
+
{
|
|
1440
|
+
foreignKeyName: "acq_social_posts_organization_id_fkey";
|
|
1441
|
+
columns: ["organization_id"];
|
|
1442
|
+
isOneToOne: false;
|
|
1443
|
+
referencedRelation: "organizations";
|
|
1444
|
+
referencedColumns: ["id"];
|
|
1445
|
+
}
|
|
1446
|
+
];
|
|
1447
|
+
};
|
|
1448
|
+
activities: {
|
|
1449
|
+
Row: {
|
|
1450
|
+
activity_type: string;
|
|
1451
|
+
actor_id: string | null;
|
|
1452
|
+
actor_type: string | null;
|
|
1453
|
+
created_at: string;
|
|
1454
|
+
description: string | null;
|
|
1455
|
+
entity_id: string;
|
|
1456
|
+
entity_name: string | null;
|
|
1457
|
+
entity_type: string;
|
|
1458
|
+
id: string;
|
|
1459
|
+
metadata: Json | null;
|
|
1460
|
+
occurred_at: string;
|
|
1461
|
+
organization_id: string;
|
|
1462
|
+
status: string;
|
|
1463
|
+
title: string;
|
|
1464
|
+
};
|
|
1465
|
+
Insert: {
|
|
1466
|
+
activity_type: string;
|
|
1467
|
+
actor_id?: string | null;
|
|
1468
|
+
actor_type?: string | null;
|
|
1469
|
+
created_at?: string;
|
|
1470
|
+
description?: string | null;
|
|
1471
|
+
entity_id: string;
|
|
1472
|
+
entity_name?: string | null;
|
|
1473
|
+
entity_type: string;
|
|
1474
|
+
id?: string;
|
|
1475
|
+
metadata?: Json | null;
|
|
1476
|
+
occurred_at?: string;
|
|
1477
|
+
organization_id: string;
|
|
1478
|
+
status: string;
|
|
1479
|
+
title: string;
|
|
1480
|
+
};
|
|
1481
|
+
Update: {
|
|
1482
|
+
activity_type?: string;
|
|
1483
|
+
actor_id?: string | null;
|
|
1484
|
+
actor_type?: string | null;
|
|
1485
|
+
created_at?: string;
|
|
1486
|
+
description?: string | null;
|
|
1487
|
+
entity_id?: string;
|
|
1488
|
+
entity_name?: string | null;
|
|
1489
|
+
entity_type?: string;
|
|
1490
|
+
id?: string;
|
|
1491
|
+
metadata?: Json | null;
|
|
1492
|
+
occurred_at?: string;
|
|
1493
|
+
organization_id?: string;
|
|
1494
|
+
status?: string;
|
|
1495
|
+
title?: string;
|
|
1496
|
+
};
|
|
1497
|
+
Relationships: [
|
|
1498
|
+
{
|
|
1499
|
+
foreignKeyName: "activities_organization_id_fkey";
|
|
1500
|
+
columns: ["organization_id"];
|
|
1501
|
+
isOneToOne: false;
|
|
1502
|
+
referencedRelation: "organizations";
|
|
1503
|
+
referencedColumns: ["id"];
|
|
1504
|
+
}
|
|
1505
|
+
];
|
|
1506
|
+
};
|
|
1507
|
+
api_keys: {
|
|
1508
|
+
Row: {
|
|
1509
|
+
created_at: string | null;
|
|
1510
|
+
id: string;
|
|
1511
|
+
key_hash: string;
|
|
1512
|
+
last_used_at: string | null;
|
|
1513
|
+
name: string;
|
|
1514
|
+
organization_id: string;
|
|
1515
|
+
};
|
|
1516
|
+
Insert: {
|
|
1517
|
+
created_at?: string | null;
|
|
1518
|
+
id?: string;
|
|
1519
|
+
key_hash: string;
|
|
1520
|
+
last_used_at?: string | null;
|
|
1521
|
+
name: string;
|
|
1522
|
+
organization_id: string;
|
|
1523
|
+
};
|
|
1524
|
+
Update: {
|
|
1525
|
+
created_at?: string | null;
|
|
1526
|
+
id?: string;
|
|
1527
|
+
key_hash?: string;
|
|
1528
|
+
last_used_at?: string | null;
|
|
1529
|
+
name?: string;
|
|
1530
|
+
organization_id?: string;
|
|
1531
|
+
};
|
|
1532
|
+
Relationships: [
|
|
1533
|
+
{
|
|
1534
|
+
foreignKeyName: "api_keys_organization_id_fkey";
|
|
1535
|
+
columns: ["organization_id"];
|
|
1536
|
+
isOneToOne: false;
|
|
1537
|
+
referencedRelation: "organizations";
|
|
1538
|
+
referencedColumns: ["id"];
|
|
1539
|
+
}
|
|
1540
|
+
];
|
|
1541
|
+
};
|
|
1542
|
+
calibration_projects: {
|
|
1543
|
+
Row: {
|
|
1544
|
+
created_at: string | null;
|
|
1545
|
+
description: string | null;
|
|
1546
|
+
id: string;
|
|
1547
|
+
name: string;
|
|
1548
|
+
organization_id: string;
|
|
1549
|
+
resource_id: string;
|
|
1550
|
+
resource_type: string;
|
|
1551
|
+
updated_at: string | null;
|
|
1552
|
+
};
|
|
1553
|
+
Insert: {
|
|
1554
|
+
created_at?: string | null;
|
|
1555
|
+
description?: string | null;
|
|
1556
|
+
id?: string;
|
|
1557
|
+
name: string;
|
|
1558
|
+
organization_id: string;
|
|
1559
|
+
resource_id: string;
|
|
1560
|
+
resource_type: string;
|
|
1561
|
+
updated_at?: string | null;
|
|
1562
|
+
};
|
|
1563
|
+
Update: {
|
|
1564
|
+
created_at?: string | null;
|
|
1565
|
+
description?: string | null;
|
|
1566
|
+
id?: string;
|
|
1567
|
+
name?: string;
|
|
1568
|
+
organization_id?: string;
|
|
1569
|
+
resource_id?: string;
|
|
1570
|
+
resource_type?: string;
|
|
1571
|
+
updated_at?: string | null;
|
|
1572
|
+
};
|
|
1573
|
+
Relationships: [
|
|
1574
|
+
{
|
|
1575
|
+
foreignKeyName: "calibration_projects_organization_id_fkey";
|
|
1576
|
+
columns: ["organization_id"];
|
|
1577
|
+
isOneToOne: false;
|
|
1578
|
+
referencedRelation: "organizations";
|
|
1579
|
+
referencedColumns: ["id"];
|
|
1580
|
+
}
|
|
1581
|
+
];
|
|
1582
|
+
};
|
|
1583
|
+
calibration_runs: {
|
|
1584
|
+
Row: {
|
|
1585
|
+
completed_at: string | null;
|
|
1586
|
+
config_variants: Json;
|
|
1587
|
+
created_at: string | null;
|
|
1588
|
+
description: string | null;
|
|
1589
|
+
execution_mode: string;
|
|
1590
|
+
grader_model: string | null;
|
|
1591
|
+
grading_rubric: Json | null;
|
|
1592
|
+
id: string;
|
|
1593
|
+
name: string;
|
|
1594
|
+
organization_id: string;
|
|
1595
|
+
project_id: string;
|
|
1596
|
+
results: Json;
|
|
1597
|
+
status: string;
|
|
1598
|
+
test_inputs: Json;
|
|
1599
|
+
};
|
|
1600
|
+
Insert: {
|
|
1601
|
+
completed_at?: string | null;
|
|
1602
|
+
config_variants: Json;
|
|
1603
|
+
created_at?: string | null;
|
|
1604
|
+
description?: string | null;
|
|
1605
|
+
execution_mode?: string;
|
|
1606
|
+
grader_model?: string | null;
|
|
1607
|
+
grading_rubric?: Json | null;
|
|
1608
|
+
id?: string;
|
|
1609
|
+
name: string;
|
|
1610
|
+
organization_id: string;
|
|
1611
|
+
project_id: string;
|
|
1612
|
+
results?: Json;
|
|
1613
|
+
status?: string;
|
|
1614
|
+
test_inputs: Json;
|
|
1615
|
+
};
|
|
1616
|
+
Update: {
|
|
1617
|
+
completed_at?: string | null;
|
|
1618
|
+
config_variants?: Json;
|
|
1619
|
+
created_at?: string | null;
|
|
1620
|
+
description?: string | null;
|
|
1621
|
+
execution_mode?: string;
|
|
1622
|
+
grader_model?: string | null;
|
|
1623
|
+
grading_rubric?: Json | null;
|
|
1624
|
+
id?: string;
|
|
1625
|
+
name?: string;
|
|
1626
|
+
organization_id?: string;
|
|
1627
|
+
project_id?: string;
|
|
1628
|
+
results?: Json;
|
|
1629
|
+
status?: string;
|
|
1630
|
+
test_inputs?: Json;
|
|
1631
|
+
};
|
|
1632
|
+
Relationships: [
|
|
1633
|
+
{
|
|
1634
|
+
foreignKeyName: "calibration_runs_organization_id_fkey";
|
|
1635
|
+
columns: ["organization_id"];
|
|
1636
|
+
isOneToOne: false;
|
|
1637
|
+
referencedRelation: "organizations";
|
|
1638
|
+
referencedColumns: ["id"];
|
|
1639
|
+
},
|
|
1640
|
+
{
|
|
1641
|
+
foreignKeyName: "calibration_runs_project_id_fkey";
|
|
1642
|
+
columns: ["project_id"];
|
|
1643
|
+
isOneToOne: false;
|
|
1644
|
+
referencedRelation: "calibration_projects";
|
|
1645
|
+
referencedColumns: ["id"];
|
|
1646
|
+
}
|
|
1647
|
+
];
|
|
1648
|
+
};
|
|
1649
|
+
command_queue: {
|
|
1650
|
+
Row: {
|
|
1651
|
+
action_payload: Json | null;
|
|
1652
|
+
actions: Json;
|
|
1653
|
+
completed_at: string | null;
|
|
1654
|
+
completed_by: string | null;
|
|
1655
|
+
context: Json;
|
|
1656
|
+
created_at: string;
|
|
1657
|
+
description: string | null;
|
|
1658
|
+
expires_at: string | null;
|
|
1659
|
+
human_checkpoint: string | null;
|
|
1660
|
+
id: string;
|
|
1661
|
+
idempotency_key: string | null;
|
|
1662
|
+
metadata: Json | null;
|
|
1663
|
+
organization_id: string;
|
|
1664
|
+
origin_execution_id: string;
|
|
1665
|
+
origin_resource_id: string;
|
|
1666
|
+
origin_resource_type: string;
|
|
1667
|
+
priority: number;
|
|
1668
|
+
selected_action: string | null;
|
|
1669
|
+
status: string;
|
|
1670
|
+
target_execution_id: string | null;
|
|
1671
|
+
target_resource_id: string | null;
|
|
1672
|
+
target_resource_type: string | null;
|
|
1673
|
+
};
|
|
1674
|
+
Insert: {
|
|
1675
|
+
action_payload?: Json | null;
|
|
1676
|
+
actions: Json;
|
|
1677
|
+
completed_at?: string | null;
|
|
1678
|
+
completed_by?: string | null;
|
|
1679
|
+
context: Json;
|
|
1680
|
+
created_at?: string;
|
|
1681
|
+
description?: string | null;
|
|
1682
|
+
expires_at?: string | null;
|
|
1683
|
+
human_checkpoint?: string | null;
|
|
1684
|
+
id?: string;
|
|
1685
|
+
idempotency_key?: string | null;
|
|
1686
|
+
metadata?: Json | null;
|
|
1687
|
+
organization_id: string;
|
|
1688
|
+
origin_execution_id: string;
|
|
1689
|
+
origin_resource_id: string;
|
|
1690
|
+
origin_resource_type: string;
|
|
1691
|
+
priority?: number;
|
|
1692
|
+
selected_action?: string | null;
|
|
1693
|
+
status?: string;
|
|
1694
|
+
target_execution_id?: string | null;
|
|
1695
|
+
target_resource_id?: string | null;
|
|
1696
|
+
target_resource_type?: string | null;
|
|
1697
|
+
};
|
|
1698
|
+
Update: {
|
|
1699
|
+
action_payload?: Json | null;
|
|
1700
|
+
actions?: Json;
|
|
1701
|
+
completed_at?: string | null;
|
|
1702
|
+
completed_by?: string | null;
|
|
1703
|
+
context?: Json;
|
|
1704
|
+
created_at?: string;
|
|
1705
|
+
description?: string | null;
|
|
1706
|
+
expires_at?: string | null;
|
|
1707
|
+
human_checkpoint?: string | null;
|
|
1708
|
+
id?: string;
|
|
1709
|
+
idempotency_key?: string | null;
|
|
1710
|
+
metadata?: Json | null;
|
|
1711
|
+
organization_id?: string;
|
|
1712
|
+
origin_execution_id?: string;
|
|
1713
|
+
origin_resource_id?: string;
|
|
1714
|
+
origin_resource_type?: string;
|
|
1715
|
+
priority?: number;
|
|
1716
|
+
selected_action?: string | null;
|
|
1717
|
+
status?: string;
|
|
1718
|
+
target_execution_id?: string | null;
|
|
1719
|
+
target_resource_id?: string | null;
|
|
1720
|
+
target_resource_type?: string | null;
|
|
1721
|
+
};
|
|
1722
|
+
Relationships: [
|
|
1723
|
+
{
|
|
1724
|
+
foreignKeyName: "command_queue_completed_by_fkey";
|
|
1725
|
+
columns: ["completed_by"];
|
|
1726
|
+
isOneToOne: false;
|
|
1727
|
+
referencedRelation: "users";
|
|
1728
|
+
referencedColumns: ["id"];
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
foreignKeyName: "command_queue_organization_id_fkey";
|
|
1732
|
+
columns: ["organization_id"];
|
|
1733
|
+
isOneToOne: false;
|
|
1734
|
+
referencedRelation: "organizations";
|
|
1735
|
+
referencedColumns: ["id"];
|
|
1736
|
+
},
|
|
1737
|
+
{
|
|
1738
|
+
foreignKeyName: "command_queue_target_execution_id_fkey";
|
|
1739
|
+
columns: ["target_execution_id"];
|
|
1740
|
+
isOneToOne: false;
|
|
1741
|
+
referencedRelation: "execution_logs";
|
|
1742
|
+
referencedColumns: ["execution_id"];
|
|
1743
|
+
}
|
|
1744
|
+
];
|
|
1745
|
+
};
|
|
1746
|
+
credentials: {
|
|
1747
|
+
Row: {
|
|
1748
|
+
created_at: string;
|
|
1749
|
+
created_by: string | null;
|
|
1750
|
+
encrypted_value: string;
|
|
1751
|
+
id: string;
|
|
1752
|
+
name: string;
|
|
1753
|
+
organization_id: string;
|
|
1754
|
+
provider: string | null;
|
|
1755
|
+
type: string;
|
|
1756
|
+
updated_at: string;
|
|
1757
|
+
};
|
|
1758
|
+
Insert: {
|
|
1759
|
+
created_at?: string;
|
|
1760
|
+
created_by?: string | null;
|
|
1761
|
+
encrypted_value: string;
|
|
1762
|
+
id?: string;
|
|
1763
|
+
name: string;
|
|
1764
|
+
organization_id: string;
|
|
1765
|
+
provider?: string | null;
|
|
1766
|
+
type?: string;
|
|
1767
|
+
updated_at?: string;
|
|
1768
|
+
};
|
|
1769
|
+
Update: {
|
|
1770
|
+
created_at?: string;
|
|
1771
|
+
created_by?: string | null;
|
|
1772
|
+
encrypted_value?: string;
|
|
1773
|
+
id?: string;
|
|
1774
|
+
name?: string;
|
|
1775
|
+
organization_id?: string;
|
|
1776
|
+
provider?: string | null;
|
|
1777
|
+
type?: string;
|
|
1778
|
+
updated_at?: string;
|
|
1779
|
+
};
|
|
1780
|
+
Relationships: [
|
|
1781
|
+
{
|
|
1782
|
+
foreignKeyName: "credentials_created_by_fkey";
|
|
1783
|
+
columns: ["created_by"];
|
|
1784
|
+
isOneToOne: false;
|
|
1785
|
+
referencedRelation: "users";
|
|
1786
|
+
referencedColumns: ["id"];
|
|
1787
|
+
},
|
|
1788
|
+
{
|
|
1789
|
+
foreignKeyName: "credentials_organization_id_fkey";
|
|
1790
|
+
columns: ["organization_id"];
|
|
1791
|
+
isOneToOne: false;
|
|
1792
|
+
referencedRelation: "organizations";
|
|
1793
|
+
referencedColumns: ["id"];
|
|
1794
|
+
}
|
|
1795
|
+
];
|
|
1796
|
+
};
|
|
1797
|
+
deployments: {
|
|
1798
|
+
Row: {
|
|
1799
|
+
compiled_docs: Json | null;
|
|
1800
|
+
created_at: string;
|
|
1801
|
+
deployment_version: string | null;
|
|
1802
|
+
documentation: Json | null;
|
|
1803
|
+
error_message: string | null;
|
|
1804
|
+
id: string;
|
|
1805
|
+
organization_id: string;
|
|
1806
|
+
pid: number | null;
|
|
1807
|
+
port: number | null;
|
|
1808
|
+
sdk_version: string;
|
|
1809
|
+
status: string;
|
|
1810
|
+
tarball_path: string | null;
|
|
1811
|
+
updated_at: string;
|
|
1812
|
+
};
|
|
1813
|
+
Insert: {
|
|
1814
|
+
compiled_docs?: Json | null;
|
|
1815
|
+
created_at?: string;
|
|
1816
|
+
deployment_version?: string | null;
|
|
1817
|
+
documentation?: Json | null;
|
|
1818
|
+
error_message?: string | null;
|
|
1819
|
+
id?: string;
|
|
1820
|
+
organization_id: string;
|
|
1821
|
+
pid?: number | null;
|
|
1822
|
+
port?: number | null;
|
|
1823
|
+
sdk_version: string;
|
|
1824
|
+
status?: string;
|
|
1825
|
+
tarball_path?: string | null;
|
|
1826
|
+
updated_at?: string;
|
|
1827
|
+
};
|
|
1828
|
+
Update: {
|
|
1829
|
+
compiled_docs?: Json | null;
|
|
1830
|
+
created_at?: string;
|
|
1831
|
+
deployment_version?: string | null;
|
|
1832
|
+
documentation?: Json | null;
|
|
1833
|
+
error_message?: string | null;
|
|
1834
|
+
id?: string;
|
|
1835
|
+
organization_id?: string;
|
|
1836
|
+
pid?: number | null;
|
|
1837
|
+
port?: number | null;
|
|
1838
|
+
sdk_version?: string;
|
|
1839
|
+
status?: string;
|
|
1840
|
+
tarball_path?: string | null;
|
|
1841
|
+
updated_at?: string;
|
|
1842
|
+
};
|
|
1843
|
+
Relationships: [
|
|
1844
|
+
{
|
|
1845
|
+
foreignKeyName: "deployments_organization_id_fkey";
|
|
1846
|
+
columns: ["organization_id"];
|
|
1847
|
+
isOneToOne: false;
|
|
1848
|
+
referencedRelation: "organizations";
|
|
1849
|
+
referencedColumns: ["id"];
|
|
1850
|
+
}
|
|
1851
|
+
];
|
|
1852
|
+
};
|
|
1853
|
+
execution_errors: {
|
|
1854
|
+
Row: {
|
|
1855
|
+
created_at: string | null;
|
|
1856
|
+
error_category: string;
|
|
1857
|
+
error_message: string;
|
|
1858
|
+
error_severity: string;
|
|
1859
|
+
error_stack_trace: string | null;
|
|
1860
|
+
error_type: string;
|
|
1861
|
+
execution_id: string;
|
|
1862
|
+
id: string;
|
|
1863
|
+
metadata: Json | null;
|
|
1864
|
+
occurred_at: string;
|
|
1865
|
+
organization_id: string;
|
|
1866
|
+
resolved: boolean;
|
|
1867
|
+
resolved_at: string | null;
|
|
1868
|
+
resolved_by: string | null;
|
|
1869
|
+
};
|
|
1870
|
+
Insert: {
|
|
1871
|
+
created_at?: string | null;
|
|
1872
|
+
error_category: string;
|
|
1873
|
+
error_message: string;
|
|
1874
|
+
error_severity: string;
|
|
1875
|
+
error_stack_trace?: string | null;
|
|
1876
|
+
error_type: string;
|
|
1877
|
+
execution_id: string;
|
|
1878
|
+
id?: string;
|
|
1879
|
+
metadata?: Json | null;
|
|
1880
|
+
occurred_at?: string;
|
|
1881
|
+
organization_id: string;
|
|
1882
|
+
resolved?: boolean;
|
|
1883
|
+
resolved_at?: string | null;
|
|
1884
|
+
resolved_by?: string | null;
|
|
1885
|
+
};
|
|
1886
|
+
Update: {
|
|
1887
|
+
created_at?: string | null;
|
|
1888
|
+
error_category?: string;
|
|
1889
|
+
error_message?: string;
|
|
1890
|
+
error_severity?: string;
|
|
1891
|
+
error_stack_trace?: string | null;
|
|
1892
|
+
error_type?: string;
|
|
1893
|
+
execution_id?: string;
|
|
1894
|
+
id?: string;
|
|
1895
|
+
metadata?: Json | null;
|
|
1896
|
+
occurred_at?: string;
|
|
1897
|
+
organization_id?: string;
|
|
1898
|
+
resolved?: boolean;
|
|
1899
|
+
resolved_at?: string | null;
|
|
1900
|
+
resolved_by?: string | null;
|
|
1901
|
+
};
|
|
1902
|
+
Relationships: [
|
|
1903
|
+
{
|
|
1904
|
+
foreignKeyName: "execution_errors_execution_id_fkey";
|
|
1905
|
+
columns: ["execution_id"];
|
|
1906
|
+
isOneToOne: false;
|
|
1907
|
+
referencedRelation: "execution_logs";
|
|
1908
|
+
referencedColumns: ["execution_id"];
|
|
1909
|
+
},
|
|
1910
|
+
{
|
|
1911
|
+
foreignKeyName: "execution_errors_organization_id_fkey";
|
|
1912
|
+
columns: ["organization_id"];
|
|
1913
|
+
isOneToOne: false;
|
|
1914
|
+
referencedRelation: "organizations";
|
|
1915
|
+
referencedColumns: ["id"];
|
|
1916
|
+
},
|
|
1917
|
+
{
|
|
1918
|
+
foreignKeyName: "execution_errors_resolved_by_fkey";
|
|
1919
|
+
columns: ["resolved_by"];
|
|
1920
|
+
isOneToOne: false;
|
|
1921
|
+
referencedRelation: "users";
|
|
1922
|
+
referencedColumns: ["id"];
|
|
1923
|
+
}
|
|
1924
|
+
];
|
|
1925
|
+
};
|
|
1926
|
+
execution_logs: {
|
|
1927
|
+
Row: {
|
|
1928
|
+
api_version: string | null;
|
|
1929
|
+
completed_at: string | null;
|
|
1930
|
+
created_at: string | null;
|
|
1931
|
+
error: string | null;
|
|
1932
|
+
execution_id: string;
|
|
1933
|
+
input: Json | null;
|
|
1934
|
+
last_heartbeat_at: string | null;
|
|
1935
|
+
logs: Json | null;
|
|
1936
|
+
organization_id: string;
|
|
1937
|
+
origin_execution_id: string | null;
|
|
1938
|
+
output: Json | null;
|
|
1939
|
+
resource_id: string;
|
|
1940
|
+
resource_status: string;
|
|
1941
|
+
resource_type: string;
|
|
1942
|
+
resource_version: string | null;
|
|
1943
|
+
sdk_version: string | null;
|
|
1944
|
+
session_id: string | null;
|
|
1945
|
+
session_turn_number: number | null;
|
|
1946
|
+
started_at: string;
|
|
1947
|
+
status: string;
|
|
1948
|
+
trigger_type: string | null;
|
|
1949
|
+
updated_at: string | null;
|
|
1950
|
+
user_id: string | null;
|
|
1951
|
+
};
|
|
1952
|
+
Insert: {
|
|
1953
|
+
api_version?: string | null;
|
|
1954
|
+
completed_at?: string | null;
|
|
1955
|
+
created_at?: string | null;
|
|
1956
|
+
error?: string | null;
|
|
1957
|
+
execution_id?: string;
|
|
1958
|
+
input?: Json | null;
|
|
1959
|
+
last_heartbeat_at?: string | null;
|
|
1960
|
+
logs?: Json | null;
|
|
1961
|
+
organization_id: string;
|
|
1962
|
+
origin_execution_id?: string | null;
|
|
1963
|
+
output?: Json | null;
|
|
1964
|
+
resource_id: string;
|
|
1965
|
+
resource_status?: string;
|
|
1966
|
+
resource_type?: string;
|
|
1967
|
+
resource_version?: string | null;
|
|
1968
|
+
sdk_version?: string | null;
|
|
1969
|
+
session_id?: string | null;
|
|
1970
|
+
session_turn_number?: number | null;
|
|
1971
|
+
started_at?: string;
|
|
1972
|
+
status: string;
|
|
1973
|
+
trigger_type?: string | null;
|
|
1974
|
+
updated_at?: string | null;
|
|
1975
|
+
user_id?: string | null;
|
|
1976
|
+
};
|
|
1977
|
+
Update: {
|
|
1978
|
+
api_version?: string | null;
|
|
1979
|
+
completed_at?: string | null;
|
|
1980
|
+
created_at?: string | null;
|
|
1981
|
+
error?: string | null;
|
|
1982
|
+
execution_id?: string;
|
|
1983
|
+
input?: Json | null;
|
|
1984
|
+
last_heartbeat_at?: string | null;
|
|
1985
|
+
logs?: Json | null;
|
|
1986
|
+
organization_id?: string;
|
|
1987
|
+
origin_execution_id?: string | null;
|
|
1988
|
+
output?: Json | null;
|
|
1989
|
+
resource_id?: string;
|
|
1990
|
+
resource_status?: string;
|
|
1991
|
+
resource_type?: string;
|
|
1992
|
+
resource_version?: string | null;
|
|
1993
|
+
sdk_version?: string | null;
|
|
1994
|
+
session_id?: string | null;
|
|
1995
|
+
session_turn_number?: number | null;
|
|
1996
|
+
started_at?: string;
|
|
1997
|
+
status?: string;
|
|
1998
|
+
trigger_type?: string | null;
|
|
1999
|
+
updated_at?: string | null;
|
|
2000
|
+
user_id?: string | null;
|
|
2001
|
+
};
|
|
2002
|
+
Relationships: [
|
|
2003
|
+
{
|
|
2004
|
+
foreignKeyName: "execution_history_organization_id_fkey";
|
|
2005
|
+
columns: ["organization_id"];
|
|
2006
|
+
isOneToOne: false;
|
|
2007
|
+
referencedRelation: "organizations";
|
|
2008
|
+
referencedColumns: ["id"];
|
|
2009
|
+
},
|
|
2010
|
+
{
|
|
2011
|
+
foreignKeyName: "execution_logs_origin_execution_id_fkey";
|
|
2012
|
+
columns: ["origin_execution_id"];
|
|
2013
|
+
isOneToOne: false;
|
|
2014
|
+
referencedRelation: "execution_logs";
|
|
2015
|
+
referencedColumns: ["execution_id"];
|
|
2016
|
+
},
|
|
2017
|
+
{
|
|
2018
|
+
foreignKeyName: "execution_logs_session_id_fkey";
|
|
2019
|
+
columns: ["session_id"];
|
|
2020
|
+
isOneToOne: false;
|
|
2021
|
+
referencedRelation: "sessions";
|
|
2022
|
+
referencedColumns: ["session_id"];
|
|
2023
|
+
},
|
|
2024
|
+
{
|
|
2025
|
+
foreignKeyName: "execution_logs_user_id_fkey";
|
|
2026
|
+
columns: ["user_id"];
|
|
2027
|
+
isOneToOne: false;
|
|
2028
|
+
referencedRelation: "users";
|
|
2029
|
+
referencedColumns: ["id"];
|
|
2030
|
+
}
|
|
2031
|
+
];
|
|
2032
|
+
};
|
|
2033
|
+
execution_metrics: {
|
|
2034
|
+
Row: {
|
|
2035
|
+
ai_call_count: number;
|
|
2036
|
+
ai_calls: Json | null;
|
|
2037
|
+
automation_savings_usd: number | null;
|
|
2038
|
+
created_at: string | null;
|
|
2039
|
+
duration_ms: number | null;
|
|
2040
|
+
execution_id: string;
|
|
2041
|
+
organization_id: string;
|
|
2042
|
+
resource_id: string;
|
|
2043
|
+
total_cost_usd: number;
|
|
2044
|
+
total_input_tokens: number;
|
|
2045
|
+
total_output_tokens: number;
|
|
2046
|
+
};
|
|
2047
|
+
Insert: {
|
|
2048
|
+
ai_call_count: number;
|
|
2049
|
+
ai_calls?: Json | null;
|
|
2050
|
+
automation_savings_usd?: number | null;
|
|
2051
|
+
created_at?: string | null;
|
|
2052
|
+
duration_ms?: number | null;
|
|
2053
|
+
execution_id: string;
|
|
2054
|
+
organization_id: string;
|
|
2055
|
+
resource_id: string;
|
|
2056
|
+
total_cost_usd: number;
|
|
2057
|
+
total_input_tokens: number;
|
|
2058
|
+
total_output_tokens: number;
|
|
2059
|
+
};
|
|
2060
|
+
Update: {
|
|
2061
|
+
ai_call_count?: number;
|
|
2062
|
+
ai_calls?: Json | null;
|
|
2063
|
+
automation_savings_usd?: number | null;
|
|
2064
|
+
created_at?: string | null;
|
|
2065
|
+
duration_ms?: number | null;
|
|
2066
|
+
execution_id?: string;
|
|
2067
|
+
organization_id?: string;
|
|
2068
|
+
resource_id?: string;
|
|
2069
|
+
total_cost_usd?: number;
|
|
2070
|
+
total_input_tokens?: number;
|
|
2071
|
+
total_output_tokens?: number;
|
|
2072
|
+
};
|
|
2073
|
+
Relationships: [
|
|
2074
|
+
{
|
|
2075
|
+
foreignKeyName: "execution_metrics_execution_id_fkey";
|
|
2076
|
+
columns: ["execution_id"];
|
|
2077
|
+
isOneToOne: true;
|
|
2078
|
+
referencedRelation: "execution_logs";
|
|
2079
|
+
referencedColumns: ["execution_id"];
|
|
2080
|
+
},
|
|
2081
|
+
{
|
|
2082
|
+
foreignKeyName: "execution_metrics_organization_id_fkey";
|
|
2083
|
+
columns: ["organization_id"];
|
|
2084
|
+
isOneToOne: false;
|
|
2085
|
+
referencedRelation: "organizations";
|
|
2086
|
+
referencedColumns: ["id"];
|
|
2087
|
+
}
|
|
2088
|
+
];
|
|
2089
|
+
};
|
|
2090
|
+
notifications: {
|
|
2091
|
+
Row: {
|
|
2092
|
+
action_url: string | null;
|
|
2093
|
+
category: string;
|
|
2094
|
+
created_at: string | null;
|
|
2095
|
+
id: string;
|
|
2096
|
+
message: string;
|
|
2097
|
+
organization_id: string;
|
|
2098
|
+
read: boolean | null;
|
|
2099
|
+
read_at: string | null;
|
|
2100
|
+
title: string;
|
|
2101
|
+
user_id: string;
|
|
2102
|
+
};
|
|
2103
|
+
Insert: {
|
|
2104
|
+
action_url?: string | null;
|
|
2105
|
+
category: string;
|
|
2106
|
+
created_at?: string | null;
|
|
2107
|
+
id?: string;
|
|
2108
|
+
message: string;
|
|
2109
|
+
organization_id: string;
|
|
2110
|
+
read?: boolean | null;
|
|
2111
|
+
read_at?: string | null;
|
|
2112
|
+
title: string;
|
|
2113
|
+
user_id: string;
|
|
2114
|
+
};
|
|
2115
|
+
Update: {
|
|
2116
|
+
action_url?: string | null;
|
|
2117
|
+
category?: string;
|
|
2118
|
+
created_at?: string | null;
|
|
2119
|
+
id?: string;
|
|
2120
|
+
message?: string;
|
|
2121
|
+
organization_id?: string;
|
|
2122
|
+
read?: boolean | null;
|
|
2123
|
+
read_at?: string | null;
|
|
2124
|
+
title?: string;
|
|
2125
|
+
user_id?: string;
|
|
2126
|
+
};
|
|
2127
|
+
Relationships: [
|
|
2128
|
+
{
|
|
2129
|
+
foreignKeyName: "notifications_organization_id_fkey";
|
|
2130
|
+
columns: ["organization_id"];
|
|
2131
|
+
isOneToOne: false;
|
|
2132
|
+
referencedRelation: "organizations";
|
|
2133
|
+
referencedColumns: ["id"];
|
|
2134
|
+
},
|
|
2135
|
+
{
|
|
2136
|
+
foreignKeyName: "notifications_user_id_fkey";
|
|
2137
|
+
columns: ["user_id"];
|
|
2138
|
+
isOneToOne: false;
|
|
2139
|
+
referencedRelation: "users";
|
|
2140
|
+
referencedColumns: ["id"];
|
|
2141
|
+
}
|
|
2142
|
+
];
|
|
2143
|
+
};
|
|
2144
|
+
org_invitations: {
|
|
2145
|
+
Row: {
|
|
2146
|
+
accept_invitation_url: string | null;
|
|
2147
|
+
accepted_at: string | null;
|
|
2148
|
+
created_at: string | null;
|
|
2149
|
+
email: string;
|
|
2150
|
+
expires_at: string;
|
|
2151
|
+
id: string;
|
|
2152
|
+
invitation_state: string | null;
|
|
2153
|
+
invitation_token: string | null;
|
|
2154
|
+
inviter_user_id: string | null;
|
|
2155
|
+
organization_id: string | null;
|
|
2156
|
+
revoked_at: string | null;
|
|
2157
|
+
role_slug: string | null;
|
|
2158
|
+
updated_at: string | null;
|
|
2159
|
+
workos_invitation_id: string;
|
|
2160
|
+
};
|
|
2161
|
+
Insert: {
|
|
2162
|
+
accept_invitation_url?: string | null;
|
|
2163
|
+
accepted_at?: string | null;
|
|
2164
|
+
created_at?: string | null;
|
|
2165
|
+
email: string;
|
|
2166
|
+
expires_at: string;
|
|
2167
|
+
id?: string;
|
|
2168
|
+
invitation_state?: string | null;
|
|
2169
|
+
invitation_token?: string | null;
|
|
2170
|
+
inviter_user_id?: string | null;
|
|
2171
|
+
organization_id?: string | null;
|
|
2172
|
+
revoked_at?: string | null;
|
|
2173
|
+
role_slug?: string | null;
|
|
2174
|
+
updated_at?: string | null;
|
|
2175
|
+
workos_invitation_id: string;
|
|
2176
|
+
};
|
|
2177
|
+
Update: {
|
|
2178
|
+
accept_invitation_url?: string | null;
|
|
2179
|
+
accepted_at?: string | null;
|
|
2180
|
+
created_at?: string | null;
|
|
2181
|
+
email?: string;
|
|
2182
|
+
expires_at?: string;
|
|
2183
|
+
id?: string;
|
|
2184
|
+
invitation_state?: string | null;
|
|
2185
|
+
invitation_token?: string | null;
|
|
2186
|
+
inviter_user_id?: string | null;
|
|
2187
|
+
organization_id?: string | null;
|
|
2188
|
+
revoked_at?: string | null;
|
|
2189
|
+
role_slug?: string | null;
|
|
2190
|
+
updated_at?: string | null;
|
|
2191
|
+
workos_invitation_id?: string;
|
|
2192
|
+
};
|
|
2193
|
+
Relationships: [
|
|
2194
|
+
{
|
|
2195
|
+
foreignKeyName: "org_invitations_inviter_user_id_fkey";
|
|
2196
|
+
columns: ["inviter_user_id"];
|
|
2197
|
+
isOneToOne: false;
|
|
2198
|
+
referencedRelation: "users";
|
|
2199
|
+
referencedColumns: ["id"];
|
|
2200
|
+
},
|
|
2201
|
+
{
|
|
2202
|
+
foreignKeyName: "org_invitations_organization_id_fkey";
|
|
2203
|
+
columns: ["organization_id"];
|
|
2204
|
+
isOneToOne: false;
|
|
2205
|
+
referencedRelation: "organizations";
|
|
2206
|
+
referencedColumns: ["id"];
|
|
2207
|
+
}
|
|
2208
|
+
];
|
|
2209
|
+
};
|
|
2210
|
+
org_memberships: {
|
|
2211
|
+
Row: {
|
|
2212
|
+
config: Json;
|
|
2213
|
+
created_at: string | null;
|
|
2214
|
+
id: string;
|
|
2215
|
+
membership_status: string | null;
|
|
2216
|
+
organization_id: string;
|
|
2217
|
+
role_slug: string | null;
|
|
2218
|
+
updated_at: string | null;
|
|
2219
|
+
user_id: string;
|
|
2220
|
+
workos_membership_id: string | null;
|
|
2221
|
+
};
|
|
2222
|
+
Insert: {
|
|
2223
|
+
config?: Json;
|
|
2224
|
+
created_at?: string | null;
|
|
2225
|
+
id?: string;
|
|
2226
|
+
membership_status?: string | null;
|
|
2227
|
+
organization_id: string;
|
|
2228
|
+
role_slug?: string | null;
|
|
2229
|
+
updated_at?: string | null;
|
|
2230
|
+
user_id: string;
|
|
2231
|
+
workos_membership_id?: string | null;
|
|
2232
|
+
};
|
|
2233
|
+
Update: {
|
|
2234
|
+
config?: Json;
|
|
2235
|
+
created_at?: string | null;
|
|
2236
|
+
id?: string;
|
|
2237
|
+
membership_status?: string | null;
|
|
2238
|
+
organization_id?: string;
|
|
2239
|
+
role_slug?: string | null;
|
|
2240
|
+
updated_at?: string | null;
|
|
2241
|
+
user_id?: string;
|
|
2242
|
+
workos_membership_id?: string | null;
|
|
2243
|
+
};
|
|
2244
|
+
Relationships: [
|
|
2245
|
+
{
|
|
2246
|
+
foreignKeyName: "org_memberships_organization_id_fkey";
|
|
2247
|
+
columns: ["organization_id"];
|
|
2248
|
+
isOneToOne: false;
|
|
2249
|
+
referencedRelation: "organizations";
|
|
2250
|
+
referencedColumns: ["id"];
|
|
2251
|
+
},
|
|
2252
|
+
{
|
|
2253
|
+
foreignKeyName: "org_memberships_user_id_fkey";
|
|
2254
|
+
columns: ["user_id"];
|
|
2255
|
+
isOneToOne: false;
|
|
2256
|
+
referencedRelation: "users";
|
|
2257
|
+
referencedColumns: ["id"];
|
|
2258
|
+
}
|
|
2259
|
+
];
|
|
2260
|
+
};
|
|
2261
|
+
organizations: {
|
|
2262
|
+
Row: {
|
|
2263
|
+
config: Json;
|
|
2264
|
+
created_at: string;
|
|
2265
|
+
id: string;
|
|
2266
|
+
is_test: boolean;
|
|
2267
|
+
metadata: Json;
|
|
2268
|
+
name: string;
|
|
2269
|
+
status: string;
|
|
2270
|
+
updated_at: string;
|
|
2271
|
+
workos_org_id: string;
|
|
2272
|
+
};
|
|
2273
|
+
Insert: {
|
|
2274
|
+
config?: Json;
|
|
2275
|
+
created_at?: string;
|
|
2276
|
+
id?: string;
|
|
2277
|
+
is_test?: boolean;
|
|
2278
|
+
metadata?: Json;
|
|
2279
|
+
name: string;
|
|
2280
|
+
status?: string;
|
|
2281
|
+
updated_at?: string;
|
|
2282
|
+
workos_org_id: string;
|
|
2283
|
+
};
|
|
2284
|
+
Update: {
|
|
2285
|
+
config?: Json;
|
|
2286
|
+
created_at?: string;
|
|
2287
|
+
id?: string;
|
|
2288
|
+
is_test?: boolean;
|
|
2289
|
+
metadata?: Json;
|
|
2290
|
+
name?: string;
|
|
2291
|
+
status?: string;
|
|
2292
|
+
updated_at?: string;
|
|
2293
|
+
workos_org_id?: string;
|
|
2294
|
+
};
|
|
2295
|
+
Relationships: [];
|
|
2296
|
+
};
|
|
2297
|
+
session_messages: {
|
|
2298
|
+
Row: {
|
|
2299
|
+
created_at: string | null;
|
|
2300
|
+
id: string;
|
|
2301
|
+
message: string;
|
|
2302
|
+
message_index: number | null;
|
|
2303
|
+
message_type: string | null;
|
|
2304
|
+
metadata: Json | null;
|
|
2305
|
+
role: string;
|
|
2306
|
+
session_id: string;
|
|
2307
|
+
session_turn_number: number;
|
|
2308
|
+
};
|
|
2309
|
+
Insert: {
|
|
2310
|
+
created_at?: string | null;
|
|
2311
|
+
id: string;
|
|
2312
|
+
message: string;
|
|
2313
|
+
message_index?: number | null;
|
|
2314
|
+
message_type?: string | null;
|
|
2315
|
+
metadata?: Json | null;
|
|
2316
|
+
role: string;
|
|
2317
|
+
session_id: string;
|
|
2318
|
+
session_turn_number: number;
|
|
2319
|
+
};
|
|
2320
|
+
Update: {
|
|
2321
|
+
created_at?: string | null;
|
|
2322
|
+
id?: string;
|
|
2323
|
+
message?: string;
|
|
2324
|
+
message_index?: number | null;
|
|
2325
|
+
message_type?: string | null;
|
|
2326
|
+
metadata?: Json | null;
|
|
2327
|
+
role?: string;
|
|
2328
|
+
session_id?: string;
|
|
2329
|
+
session_turn_number?: number;
|
|
2330
|
+
};
|
|
2331
|
+
Relationships: [
|
|
2332
|
+
{
|
|
2333
|
+
foreignKeyName: "session_messages_session_id_fkey";
|
|
2334
|
+
columns: ["session_id"];
|
|
2335
|
+
isOneToOne: false;
|
|
2336
|
+
referencedRelation: "sessions";
|
|
2337
|
+
referencedColumns: ["session_id"];
|
|
2338
|
+
}
|
|
2339
|
+
];
|
|
2340
|
+
};
|
|
2341
|
+
sessions: {
|
|
2342
|
+
Row: {
|
|
2343
|
+
context_window_size: number;
|
|
2344
|
+
created_at: string | null;
|
|
2345
|
+
cumulative_input_tokens: number;
|
|
2346
|
+
cumulative_output_tokens: number;
|
|
2347
|
+
deleted_at: string | null;
|
|
2348
|
+
ended_at: string | null;
|
|
2349
|
+
memory_snapshot: Json;
|
|
2350
|
+
metadata: Json | null;
|
|
2351
|
+
organization_id: string;
|
|
2352
|
+
resource_id: string;
|
|
2353
|
+
session_id: string;
|
|
2354
|
+
session_total_turns: number | null;
|
|
2355
|
+
updated_at: string | null;
|
|
2356
|
+
user_id: string | null;
|
|
2357
|
+
};
|
|
2358
|
+
Insert: {
|
|
2359
|
+
context_window_size?: number;
|
|
2360
|
+
created_at?: string | null;
|
|
2361
|
+
cumulative_input_tokens?: number;
|
|
2362
|
+
cumulative_output_tokens?: number;
|
|
2363
|
+
deleted_at?: string | null;
|
|
2364
|
+
ended_at?: string | null;
|
|
2365
|
+
memory_snapshot: Json;
|
|
2366
|
+
metadata?: Json | null;
|
|
2367
|
+
organization_id: string;
|
|
2368
|
+
resource_id: string;
|
|
2369
|
+
session_id?: string;
|
|
2370
|
+
session_total_turns?: number | null;
|
|
2371
|
+
updated_at?: string | null;
|
|
2372
|
+
user_id?: string | null;
|
|
2373
|
+
};
|
|
2374
|
+
Update: {
|
|
2375
|
+
context_window_size?: number;
|
|
2376
|
+
created_at?: string | null;
|
|
2377
|
+
cumulative_input_tokens?: number;
|
|
2378
|
+
cumulative_output_tokens?: number;
|
|
2379
|
+
deleted_at?: string | null;
|
|
2380
|
+
ended_at?: string | null;
|
|
2381
|
+
memory_snapshot?: Json;
|
|
2382
|
+
metadata?: Json | null;
|
|
2383
|
+
organization_id?: string;
|
|
2384
|
+
resource_id?: string;
|
|
2385
|
+
session_id?: string;
|
|
2386
|
+
session_total_turns?: number | null;
|
|
2387
|
+
updated_at?: string | null;
|
|
2388
|
+
user_id?: string | null;
|
|
2389
|
+
};
|
|
2390
|
+
Relationships: [
|
|
2391
|
+
{
|
|
2392
|
+
foreignKeyName: "fk_organization";
|
|
2393
|
+
columns: ["organization_id"];
|
|
2394
|
+
isOneToOne: false;
|
|
2395
|
+
referencedRelation: "organizations";
|
|
2396
|
+
referencedColumns: ["id"];
|
|
2397
|
+
},
|
|
2398
|
+
{
|
|
2399
|
+
foreignKeyName: "fk_user";
|
|
2400
|
+
columns: ["user_id"];
|
|
2401
|
+
isOneToOne: false;
|
|
2402
|
+
referencedRelation: "users";
|
|
2403
|
+
referencedColumns: ["id"];
|
|
2404
|
+
}
|
|
2405
|
+
];
|
|
2406
|
+
};
|
|
2407
|
+
task_schedules: {
|
|
2408
|
+
Row: {
|
|
2409
|
+
created_at: string;
|
|
2410
|
+
current_step: number;
|
|
2411
|
+
description: string | null;
|
|
2412
|
+
id: string;
|
|
2413
|
+
idempotency_key: string | null;
|
|
2414
|
+
last_execution_id: string | null;
|
|
2415
|
+
last_run_at: string | null;
|
|
2416
|
+
max_retries: number;
|
|
2417
|
+
metadata: Json | null;
|
|
2418
|
+
name: string;
|
|
2419
|
+
next_run_at: string | null;
|
|
2420
|
+
organization_id: string;
|
|
2421
|
+
origin_execution_id: string | null;
|
|
2422
|
+
origin_resource_id: string | null;
|
|
2423
|
+
origin_resource_type: string | null;
|
|
2424
|
+
retry_count: number;
|
|
2425
|
+
schedule_config: Json;
|
|
2426
|
+
status: string;
|
|
2427
|
+
target_resource_id: string;
|
|
2428
|
+
target_resource_type: string;
|
|
2429
|
+
updated_at: string;
|
|
2430
|
+
};
|
|
2431
|
+
Insert: {
|
|
2432
|
+
created_at?: string;
|
|
2433
|
+
current_step?: number;
|
|
2434
|
+
description?: string | null;
|
|
2435
|
+
id?: string;
|
|
2436
|
+
idempotency_key?: string | null;
|
|
2437
|
+
last_execution_id?: string | null;
|
|
2438
|
+
last_run_at?: string | null;
|
|
2439
|
+
max_retries?: number;
|
|
2440
|
+
metadata?: Json | null;
|
|
2441
|
+
name: string;
|
|
2442
|
+
next_run_at?: string | null;
|
|
2443
|
+
organization_id: string;
|
|
2444
|
+
origin_execution_id?: string | null;
|
|
2445
|
+
origin_resource_id?: string | null;
|
|
2446
|
+
origin_resource_type?: string | null;
|
|
2447
|
+
retry_count?: number;
|
|
2448
|
+
schedule_config: Json;
|
|
2449
|
+
status?: string;
|
|
2450
|
+
target_resource_id: string;
|
|
2451
|
+
target_resource_type: string;
|
|
2452
|
+
updated_at?: string;
|
|
2453
|
+
};
|
|
2454
|
+
Update: {
|
|
2455
|
+
created_at?: string;
|
|
2456
|
+
current_step?: number;
|
|
2457
|
+
description?: string | null;
|
|
2458
|
+
id?: string;
|
|
2459
|
+
idempotency_key?: string | null;
|
|
2460
|
+
last_execution_id?: string | null;
|
|
2461
|
+
last_run_at?: string | null;
|
|
2462
|
+
max_retries?: number;
|
|
2463
|
+
metadata?: Json | null;
|
|
2464
|
+
name?: string;
|
|
2465
|
+
next_run_at?: string | null;
|
|
2466
|
+
organization_id?: string;
|
|
2467
|
+
origin_execution_id?: string | null;
|
|
2468
|
+
origin_resource_id?: string | null;
|
|
2469
|
+
origin_resource_type?: string | null;
|
|
2470
|
+
retry_count?: number;
|
|
2471
|
+
schedule_config?: Json;
|
|
2472
|
+
status?: string;
|
|
2473
|
+
target_resource_id?: string;
|
|
2474
|
+
target_resource_type?: string;
|
|
2475
|
+
updated_at?: string;
|
|
2476
|
+
};
|
|
2477
|
+
Relationships: [
|
|
2478
|
+
{
|
|
2479
|
+
foreignKeyName: "task_schedules_organization_id_fkey";
|
|
2480
|
+
columns: ["organization_id"];
|
|
2481
|
+
isOneToOne: false;
|
|
2482
|
+
referencedRelation: "organizations";
|
|
2483
|
+
referencedColumns: ["id"];
|
|
2484
|
+
}
|
|
2485
|
+
];
|
|
2486
|
+
};
|
|
2487
|
+
training_assessments: {
|
|
2488
|
+
Row: {
|
|
2489
|
+
answers: Json | null;
|
|
2490
|
+
assessment_slug: string;
|
|
2491
|
+
attempted_at: string;
|
|
2492
|
+
course_slug: string;
|
|
2493
|
+
id: string;
|
|
2494
|
+
organization_id: string;
|
|
2495
|
+
passed: boolean;
|
|
2496
|
+
score: number;
|
|
2497
|
+
user_id: string;
|
|
2498
|
+
};
|
|
2499
|
+
Insert: {
|
|
2500
|
+
answers?: Json | null;
|
|
2501
|
+
assessment_slug: string;
|
|
2502
|
+
attempted_at?: string;
|
|
2503
|
+
course_slug: string;
|
|
2504
|
+
id?: string;
|
|
2505
|
+
organization_id: string;
|
|
2506
|
+
passed: boolean;
|
|
2507
|
+
score: number;
|
|
2508
|
+
user_id: string;
|
|
2509
|
+
};
|
|
2510
|
+
Update: {
|
|
2511
|
+
answers?: Json | null;
|
|
2512
|
+
assessment_slug?: string;
|
|
2513
|
+
attempted_at?: string;
|
|
2514
|
+
course_slug?: string;
|
|
2515
|
+
id?: string;
|
|
2516
|
+
organization_id?: string;
|
|
2517
|
+
passed?: boolean;
|
|
2518
|
+
score?: number;
|
|
2519
|
+
user_id?: string;
|
|
2520
|
+
};
|
|
2521
|
+
Relationships: [
|
|
2522
|
+
{
|
|
2523
|
+
foreignKeyName: "training_assessments_organization_id_fkey";
|
|
2524
|
+
columns: ["organization_id"];
|
|
2525
|
+
isOneToOne: false;
|
|
2526
|
+
referencedRelation: "organizations";
|
|
2527
|
+
referencedColumns: ["id"];
|
|
2528
|
+
},
|
|
2529
|
+
{
|
|
2530
|
+
foreignKeyName: "training_assessments_user_id_fkey";
|
|
2531
|
+
columns: ["user_id"];
|
|
2532
|
+
isOneToOne: false;
|
|
2533
|
+
referencedRelation: "users";
|
|
2534
|
+
referencedColumns: ["id"];
|
|
2535
|
+
}
|
|
2536
|
+
];
|
|
2537
|
+
};
|
|
2538
|
+
training_certifications: {
|
|
2539
|
+
Row: {
|
|
2540
|
+
awarded_at: string;
|
|
2541
|
+
certification_slug: string;
|
|
2542
|
+
id: string;
|
|
2543
|
+
organization_id: string;
|
|
2544
|
+
user_id: string;
|
|
2545
|
+
};
|
|
2546
|
+
Insert: {
|
|
2547
|
+
awarded_at?: string;
|
|
2548
|
+
certification_slug: string;
|
|
2549
|
+
id?: string;
|
|
2550
|
+
organization_id: string;
|
|
2551
|
+
user_id: string;
|
|
2552
|
+
};
|
|
2553
|
+
Update: {
|
|
2554
|
+
awarded_at?: string;
|
|
2555
|
+
certification_slug?: string;
|
|
2556
|
+
id?: string;
|
|
2557
|
+
organization_id?: string;
|
|
2558
|
+
user_id?: string;
|
|
2559
|
+
};
|
|
2560
|
+
Relationships: [
|
|
2561
|
+
{
|
|
2562
|
+
foreignKeyName: "training_certifications_organization_id_fkey";
|
|
2563
|
+
columns: ["organization_id"];
|
|
2564
|
+
isOneToOne: false;
|
|
2565
|
+
referencedRelation: "organizations";
|
|
2566
|
+
referencedColumns: ["id"];
|
|
2567
|
+
},
|
|
2568
|
+
{
|
|
2569
|
+
foreignKeyName: "training_certifications_user_id_fkey";
|
|
2570
|
+
columns: ["user_id"];
|
|
2571
|
+
isOneToOne: false;
|
|
2572
|
+
referencedRelation: "users";
|
|
2573
|
+
referencedColumns: ["id"];
|
|
2574
|
+
}
|
|
2575
|
+
];
|
|
2576
|
+
};
|
|
2577
|
+
training_progress: {
|
|
2578
|
+
Row: {
|
|
2579
|
+
completed_at: string;
|
|
2580
|
+
course_slug: string;
|
|
2581
|
+
id: string;
|
|
2582
|
+
lesson_slug: string;
|
|
2583
|
+
organization_id: string;
|
|
2584
|
+
user_id: string;
|
|
2585
|
+
};
|
|
2586
|
+
Insert: {
|
|
2587
|
+
completed_at?: string;
|
|
2588
|
+
course_slug: string;
|
|
2589
|
+
id?: string;
|
|
2590
|
+
lesson_slug: string;
|
|
2591
|
+
organization_id: string;
|
|
2592
|
+
user_id: string;
|
|
2593
|
+
};
|
|
2594
|
+
Update: {
|
|
2595
|
+
completed_at?: string;
|
|
2596
|
+
course_slug?: string;
|
|
2597
|
+
id?: string;
|
|
2598
|
+
lesson_slug?: string;
|
|
2599
|
+
organization_id?: string;
|
|
2600
|
+
user_id?: string;
|
|
2601
|
+
};
|
|
2602
|
+
Relationships: [
|
|
2603
|
+
{
|
|
2604
|
+
foreignKeyName: "training_progress_organization_id_fkey";
|
|
2605
|
+
columns: ["organization_id"];
|
|
2606
|
+
isOneToOne: false;
|
|
2607
|
+
referencedRelation: "organizations";
|
|
2608
|
+
referencedColumns: ["id"];
|
|
2609
|
+
},
|
|
2610
|
+
{
|
|
2611
|
+
foreignKeyName: "training_progress_user_id_fkey";
|
|
2612
|
+
columns: ["user_id"];
|
|
2613
|
+
isOneToOne: false;
|
|
2614
|
+
referencedRelation: "users";
|
|
2615
|
+
referencedColumns: ["id"];
|
|
2616
|
+
}
|
|
2617
|
+
];
|
|
2618
|
+
};
|
|
2619
|
+
users: {
|
|
2620
|
+
Row: {
|
|
2621
|
+
config: Json;
|
|
2622
|
+
created_at: string;
|
|
2623
|
+
display_name: string | null;
|
|
2624
|
+
email: string;
|
|
2625
|
+
first_name: string | null;
|
|
2626
|
+
id: string;
|
|
2627
|
+
is_active: boolean;
|
|
2628
|
+
is_platform_admin: boolean | null;
|
|
2629
|
+
last_login_at: string | null;
|
|
2630
|
+
last_name: string | null;
|
|
2631
|
+
last_visited_org: string | null;
|
|
2632
|
+
profile_picture_url: string | null;
|
|
2633
|
+
updated_at: string;
|
|
2634
|
+
workos_user_id: string | null;
|
|
2635
|
+
};
|
|
2636
|
+
Insert: {
|
|
2637
|
+
config?: Json;
|
|
2638
|
+
created_at?: string;
|
|
2639
|
+
display_name?: string | null;
|
|
2640
|
+
email: string;
|
|
2641
|
+
first_name?: string | null;
|
|
2642
|
+
id?: string;
|
|
2643
|
+
is_active?: boolean;
|
|
2644
|
+
is_platform_admin?: boolean | null;
|
|
2645
|
+
last_login_at?: string | null;
|
|
2646
|
+
last_name?: string | null;
|
|
2647
|
+
last_visited_org?: string | null;
|
|
2648
|
+
profile_picture_url?: string | null;
|
|
2649
|
+
updated_at?: string;
|
|
2650
|
+
workos_user_id?: string | null;
|
|
2651
|
+
};
|
|
2652
|
+
Update: {
|
|
2653
|
+
config?: Json;
|
|
2654
|
+
created_at?: string;
|
|
2655
|
+
display_name?: string | null;
|
|
2656
|
+
email?: string;
|
|
2657
|
+
first_name?: string | null;
|
|
2658
|
+
id?: string;
|
|
2659
|
+
is_active?: boolean;
|
|
2660
|
+
is_platform_admin?: boolean | null;
|
|
2661
|
+
last_login_at?: string | null;
|
|
2662
|
+
last_name?: string | null;
|
|
2663
|
+
last_visited_org?: string | null;
|
|
2664
|
+
profile_picture_url?: string | null;
|
|
2665
|
+
updated_at?: string;
|
|
2666
|
+
workos_user_id?: string | null;
|
|
2667
|
+
};
|
|
2668
|
+
Relationships: [
|
|
2669
|
+
{
|
|
2670
|
+
foreignKeyName: "user_profiles_last_visited_org_fkey";
|
|
2671
|
+
columns: ["last_visited_org"];
|
|
2672
|
+
isOneToOne: false;
|
|
2673
|
+
referencedRelation: "organizations";
|
|
2674
|
+
referencedColumns: ["id"];
|
|
2675
|
+
}
|
|
2676
|
+
];
|
|
2677
|
+
};
|
|
2678
|
+
webhook_endpoints: {
|
|
2679
|
+
Row: {
|
|
2680
|
+
created_at: string;
|
|
2681
|
+
description: string | null;
|
|
2682
|
+
id: string;
|
|
2683
|
+
key: string;
|
|
2684
|
+
last_triggered_at: string | null;
|
|
2685
|
+
name: string;
|
|
2686
|
+
organization_id: string;
|
|
2687
|
+
request_count: number;
|
|
2688
|
+
resource_id: string | null;
|
|
2689
|
+
status: string;
|
|
2690
|
+
updated_at: string;
|
|
2691
|
+
};
|
|
2692
|
+
Insert: {
|
|
2693
|
+
created_at?: string;
|
|
2694
|
+
description?: string | null;
|
|
2695
|
+
id?: string;
|
|
2696
|
+
key: string;
|
|
2697
|
+
last_triggered_at?: string | null;
|
|
2698
|
+
name: string;
|
|
2699
|
+
organization_id: string;
|
|
2700
|
+
request_count?: number;
|
|
2701
|
+
resource_id?: string | null;
|
|
2702
|
+
status?: string;
|
|
2703
|
+
updated_at?: string;
|
|
2704
|
+
};
|
|
2705
|
+
Update: {
|
|
2706
|
+
created_at?: string;
|
|
2707
|
+
description?: string | null;
|
|
2708
|
+
id?: string;
|
|
2709
|
+
key?: string;
|
|
2710
|
+
last_triggered_at?: string | null;
|
|
2711
|
+
name?: string;
|
|
2712
|
+
organization_id?: string;
|
|
2713
|
+
request_count?: number;
|
|
2714
|
+
resource_id?: string | null;
|
|
2715
|
+
status?: string;
|
|
2716
|
+
updated_at?: string;
|
|
2717
|
+
};
|
|
2718
|
+
Relationships: [
|
|
2719
|
+
{
|
|
2720
|
+
foreignKeyName: "webhook_endpoints_organization_id_fkey";
|
|
2721
|
+
columns: ["organization_id"];
|
|
2722
|
+
isOneToOne: false;
|
|
2723
|
+
referencedRelation: "organizations";
|
|
2724
|
+
referencedColumns: ["id"];
|
|
2725
|
+
}
|
|
2726
|
+
];
|
|
2727
|
+
};
|
|
2728
|
+
};
|
|
2729
|
+
Views: {
|
|
2730
|
+
[_ in never]: never;
|
|
2731
|
+
};
|
|
2732
|
+
Functions: {
|
|
2733
|
+
acq_default_checklist: {
|
|
2734
|
+
Args: {
|
|
2735
|
+
p_platform: string;
|
|
2736
|
+
};
|
|
2737
|
+
Returns: Json;
|
|
2738
|
+
};
|
|
2739
|
+
append_deal_activity: {
|
|
2740
|
+
Args: {
|
|
2741
|
+
p_activity: Json;
|
|
2742
|
+
p_deal_id: string;
|
|
2743
|
+
p_organization_id: string;
|
|
2744
|
+
};
|
|
2745
|
+
Returns: undefined;
|
|
2746
|
+
};
|
|
2747
|
+
auth_jwt_claims: {
|
|
2748
|
+
Args: never;
|
|
2749
|
+
Returns: Json;
|
|
2750
|
+
};
|
|
2751
|
+
auth_uid_safe: {
|
|
2752
|
+
Args: never;
|
|
2753
|
+
Returns: string;
|
|
2754
|
+
};
|
|
2755
|
+
current_user_is_platform_admin: {
|
|
2756
|
+
Args: never;
|
|
2757
|
+
Returns: boolean;
|
|
2758
|
+
};
|
|
2759
|
+
current_user_supabase_id: {
|
|
2760
|
+
Args: never;
|
|
2761
|
+
Returns: string;
|
|
2762
|
+
};
|
|
2763
|
+
detect_stalled_executions: {
|
|
2764
|
+
Args: never;
|
|
2765
|
+
Returns: undefined;
|
|
2766
|
+
};
|
|
2767
|
+
execute_session_turn: {
|
|
2768
|
+
Args: {
|
|
2769
|
+
p_session_id: string;
|
|
2770
|
+
};
|
|
2771
|
+
Returns: {
|
|
2772
|
+
created_at: string;
|
|
2773
|
+
ended_at: string;
|
|
2774
|
+
memory_snapshot: Json;
|
|
2775
|
+
metadata: Json;
|
|
2776
|
+
organization_id: string;
|
|
2777
|
+
resource_id: string;
|
|
2778
|
+
session_id: string;
|
|
2779
|
+
session_total_turns: number;
|
|
2780
|
+
updated_at: string;
|
|
2781
|
+
user_id: string;
|
|
2782
|
+
}[];
|
|
2783
|
+
};
|
|
2784
|
+
get_storage_org_id: {
|
|
2785
|
+
Args: {
|
|
2786
|
+
file_path: string;
|
|
2787
|
+
};
|
|
2788
|
+
Returns: string;
|
|
2789
|
+
};
|
|
2790
|
+
get_workos_user_id: {
|
|
2791
|
+
Args: never;
|
|
2792
|
+
Returns: string;
|
|
2793
|
+
};
|
|
2794
|
+
is_org_admin: {
|
|
2795
|
+
Args: {
|
|
2796
|
+
org_id: string;
|
|
2797
|
+
};
|
|
2798
|
+
Returns: boolean;
|
|
2799
|
+
};
|
|
2800
|
+
is_org_member: {
|
|
2801
|
+
Args: {
|
|
2802
|
+
org_id: string;
|
|
2803
|
+
};
|
|
2804
|
+
Returns: boolean;
|
|
2805
|
+
};
|
|
2806
|
+
link_workos_membership_on_accept: {
|
|
2807
|
+
Args: {
|
|
2808
|
+
p_email: string;
|
|
2809
|
+
p_organization_id: string;
|
|
2810
|
+
p_workos_membership_id: string;
|
|
2811
|
+
};
|
|
2812
|
+
Returns: boolean;
|
|
2813
|
+
};
|
|
2814
|
+
pre_provision_invited_user: {
|
|
2815
|
+
Args: {
|
|
2816
|
+
p_email: string;
|
|
2817
|
+
p_organization_id: string;
|
|
2818
|
+
p_role_slug?: string;
|
|
2819
|
+
};
|
|
2820
|
+
Returns: Json;
|
|
2821
|
+
};
|
|
2822
|
+
process_due_schedules: {
|
|
2823
|
+
Args: never;
|
|
2824
|
+
Returns: Json;
|
|
2825
|
+
};
|
|
2826
|
+
upsert_user_profile: {
|
|
2827
|
+
Args: never;
|
|
2828
|
+
Returns: {
|
|
2829
|
+
profile_display_name: string;
|
|
2830
|
+
profile_email: string;
|
|
2831
|
+
profile_id: string;
|
|
2832
|
+
profile_workos_user_id: string;
|
|
2833
|
+
}[];
|
|
2834
|
+
};
|
|
2835
|
+
};
|
|
2836
|
+
Enums: {
|
|
2837
|
+
[_ in never]: never;
|
|
2838
|
+
};
|
|
2839
|
+
CompositeTypes: {
|
|
2840
|
+
[_ in never]: never;
|
|
2841
|
+
};
|
|
2842
|
+
};
|
|
2843
|
+
};
|
|
2844
|
+
type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">;
|
|
2845
|
+
type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">];
|
|
2846
|
+
type Tables<DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) | {
|
|
2847
|
+
schema: keyof DatabaseWithoutInternals;
|
|
2848
|
+
}, TableName extends DefaultSchemaTableNameOrOptions extends {
|
|
2849
|
+
schema: keyof DatabaseWithoutInternals;
|
|
2850
|
+
} ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"]) : never = never> = DefaultSchemaTableNameOrOptions extends {
|
|
2851
|
+
schema: keyof DatabaseWithoutInternals;
|
|
2852
|
+
} ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
|
|
2853
|
+
Row: infer R;
|
|
2854
|
+
} ? R : never : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) ? (DefaultSchema["Tables"] & DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
|
|
2855
|
+
Row: infer R;
|
|
2856
|
+
} ? R : never : never;
|
|
2857
|
+
|
|
2858
|
+
type SupabaseUserProfile = Tables<'users'>;
|
|
2859
|
+
|
|
653
2860
|
/**
|
|
654
2861
|
* Origin resource type - where an execution/task originated from.
|
|
655
2862
|
* Used for audit trails and tracking execution lineage.
|
|
@@ -764,6 +2971,108 @@ interface SessionDTO {
|
|
|
764
2971
|
endedAt?: Date | null;
|
|
765
2972
|
}
|
|
766
2973
|
|
|
2974
|
+
/**
|
|
2975
|
+
* Multi-tenancy configuration types
|
|
2976
|
+
*
|
|
2977
|
+
* Config is stored in dedicated `config` columns (NOT nested in metadata):
|
|
2978
|
+
* - organizations.config: Org-level feature config
|
|
2979
|
+
* - org_memberships.config: Per-user-per-org feature overrides
|
|
2980
|
+
* - users.config: User-global config (training)
|
|
2981
|
+
*/
|
|
2982
|
+
/**
|
|
2983
|
+
* Valid course groups (matches Category type from training)
|
|
2984
|
+
*/
|
|
2985
|
+
type CourseGroup = 'foundation' | 'sales' | 'technical';
|
|
2986
|
+
/**
|
|
2987
|
+
* Org-level feature config (stored in organizations.config)
|
|
2988
|
+
* Controls which features are available to all org members
|
|
2989
|
+
* Valid feature keys: operations, monitoring, acquisition, calibration, seo
|
|
2990
|
+
*/
|
|
2991
|
+
interface OrgFeatureConfig {
|
|
2992
|
+
features?: {
|
|
2993
|
+
operations?: boolean;
|
|
2994
|
+
monitoring?: boolean;
|
|
2995
|
+
acquisition?: boolean;
|
|
2996
|
+
calibration?: boolean;
|
|
2997
|
+
seo?: boolean;
|
|
2998
|
+
};
|
|
2999
|
+
training?: {
|
|
3000
|
+
allowed_course_groups?: CourseGroup[];
|
|
3001
|
+
};
|
|
3002
|
+
}
|
|
3003
|
+
/**
|
|
3004
|
+
* Per-user-per-org config (stored in org_memberships.config)
|
|
3005
|
+
* Overrides org-level feature config for specific users
|
|
3006
|
+
*/
|
|
3007
|
+
type MembershipFeatureConfig = OrgFeatureConfig;
|
|
3008
|
+
/**
|
|
3009
|
+
* User-global config (stored in users.config)
|
|
3010
|
+
* Training and theme are user-specific, NOT org-specific
|
|
3011
|
+
*/
|
|
3012
|
+
interface UserConfig {
|
|
3013
|
+
training?: {
|
|
3014
|
+
enabled?: boolean;
|
|
3015
|
+
allowed_courses?: string[];
|
|
3016
|
+
allowed_course_groups?: CourseGroup[];
|
|
3017
|
+
};
|
|
3018
|
+
theme?: {
|
|
3019
|
+
preset?: 'default' | 'tactical' | 'regal' | 'cyber-volt' | 'aurora' | 'rose-gold' | 'midnight' | 'ember' | 'obsidian' | 'honey' | 'abyss' | 'canopy' | 'slate' | 'cyber-strike' | 'cyber-flux' | 'cyber-void';
|
|
3020
|
+
colorScheme?: 'light' | 'dark' | 'auto';
|
|
3021
|
+
};
|
|
3022
|
+
onboarding?: {
|
|
3023
|
+
completed?: boolean;
|
|
3024
|
+
completedAt?: string;
|
|
3025
|
+
role?: string;
|
|
3026
|
+
primaryUseCase?: string[];
|
|
3027
|
+
experienceLevel?: string;
|
|
3028
|
+
/** Onboarding guide system state (set by checklist/tour system) */
|
|
3029
|
+
guides?: {
|
|
3030
|
+
completedIds?: string[];
|
|
3031
|
+
dismissed?: boolean;
|
|
3032
|
+
completedAt?: string;
|
|
3033
|
+
};
|
|
3034
|
+
};
|
|
3035
|
+
}
|
|
3036
|
+
|
|
3037
|
+
/**
|
|
3038
|
+
* Organization Membership types based on WorkOS API
|
|
3039
|
+
*/
|
|
3040
|
+
interface OrganizationMembership {
|
|
3041
|
+
object: 'organization_membership';
|
|
3042
|
+
id: string;
|
|
3043
|
+
userId: string;
|
|
3044
|
+
organizationId: string;
|
|
3045
|
+
role: {
|
|
3046
|
+
slug: string;
|
|
3047
|
+
};
|
|
3048
|
+
status: 'active' | 'inactive';
|
|
3049
|
+
createdAt: string;
|
|
3050
|
+
updatedAt: string;
|
|
3051
|
+
}
|
|
3052
|
+
/**
|
|
3053
|
+
* Extended membership with user and organization details for UI
|
|
3054
|
+
*/
|
|
3055
|
+
interface MembershipWithDetails extends OrganizationMembership {
|
|
3056
|
+
user?: {
|
|
3057
|
+
id: string;
|
|
3058
|
+
email: string;
|
|
3059
|
+
firstName?: string;
|
|
3060
|
+
lastName?: string;
|
|
3061
|
+
profilePictureUrl?: string;
|
|
3062
|
+
};
|
|
3063
|
+
organization?: {
|
|
3064
|
+
id: string;
|
|
3065
|
+
name: string;
|
|
3066
|
+
workos_org_id: string;
|
|
3067
|
+
primaryDomain?: string;
|
|
3068
|
+
is_test?: boolean;
|
|
3069
|
+
status?: string;
|
|
3070
|
+
metadata?: Record<string, unknown>;
|
|
3071
|
+
config?: OrgFeatureConfig;
|
|
3072
|
+
};
|
|
3073
|
+
config?: MembershipFeatureConfig;
|
|
3074
|
+
}
|
|
3075
|
+
|
|
767
3076
|
/**
|
|
768
3077
|
* Time range selector for dashboard metrics
|
|
769
3078
|
*/
|
|
@@ -1225,7 +3534,7 @@ declare function useGetExecutionHistory(scheduleId: string | undefined, options?
|
|
|
1225
3534
|
executions: {
|
|
1226
3535
|
id: string;
|
|
1227
3536
|
createdAt: string;
|
|
1228
|
-
status: "
|
|
3537
|
+
status: "completed" | "failed" | "running" | "cancelled";
|
|
1229
3538
|
step: number | null;
|
|
1230
3539
|
itemLabel: string | null;
|
|
1231
3540
|
duration: number | null;
|
|
@@ -1577,6 +3886,43 @@ declare function useMarkAllAsRead(): _tanstack_react_query.UseMutationResult<voi
|
|
|
1577
3886
|
*/
|
|
1578
3887
|
declare function useNotificationCount(): _tanstack_react_query.UseQueryResult<number, Error>;
|
|
1579
3888
|
|
|
3889
|
+
/**
|
|
3890
|
+
* Hook that provides a standardized error notification handler
|
|
3891
|
+
* for use in React Query mutation hooks.
|
|
3892
|
+
*
|
|
3893
|
+
* Delegates to the active NotificationAdapter so it works in any
|
|
3894
|
+
* consumer (Mantine, Sonner, console fallback, etc.)
|
|
3895
|
+
*
|
|
3896
|
+
* @example
|
|
3897
|
+
* ```typescript
|
|
3898
|
+
* const mutation = useMutation({
|
|
3899
|
+
* mutationFn: deleteApiKey,
|
|
3900
|
+
* onError: useErrorNotification()
|
|
3901
|
+
* })
|
|
3902
|
+
* ```
|
|
3903
|
+
*/
|
|
3904
|
+
declare function useErrorNotification(): (error: unknown) => void;
|
|
3905
|
+
|
|
3906
|
+
/**
|
|
3907
|
+
* Hook that provides a standardized success notification handler.
|
|
3908
|
+
* Delegates to the active NotificationAdapter.
|
|
3909
|
+
*/
|
|
3910
|
+
declare function useSuccessNotification(): (title: string, message: string) => void;
|
|
3911
|
+
|
|
3912
|
+
/**
|
|
3913
|
+
* Hook that provides a standardized warning notification handler.
|
|
3914
|
+
* Delegates to the active NotificationAdapter.
|
|
3915
|
+
*/
|
|
3916
|
+
declare function useWarningNotification(): (title: string, message: string) => void;
|
|
3917
|
+
|
|
3918
|
+
/**
|
|
3919
|
+
* Generic batch delete hook. Deletes multiple rows from a Supabase table by ID.
|
|
3920
|
+
*
|
|
3921
|
+
* @param tableName - Supabase table name (e.g. 'acq_social_posts')
|
|
3922
|
+
* @param invalidateQueryKeys - Array of query key prefixes to invalidate on success
|
|
3923
|
+
*/
|
|
3924
|
+
declare function useBatchDelete(tableName: string, invalidateQueryKeys: readonly (readonly unknown[])[]): _tanstack_react_query.UseMutationResult<void, Error, string[], unknown>;
|
|
3925
|
+
|
|
1580
3926
|
interface SessionListItem {
|
|
1581
3927
|
sessionId: string;
|
|
1582
3928
|
resourceId: string;
|
|
@@ -1649,5 +3995,286 @@ declare class OperationsService {
|
|
|
1649
3995
|
archiveSession(sessionId: string): Promise<void>;
|
|
1650
3996
|
}
|
|
1651
3997
|
|
|
1652
|
-
|
|
1653
|
-
|
|
3998
|
+
/**
|
|
3999
|
+
* Shared hook for pagination state management.
|
|
4000
|
+
* Encapsulates page state, offset calculation, and reset-on-filter-change.
|
|
4001
|
+
*
|
|
4002
|
+
* @param pageSize - Number of items per page
|
|
4003
|
+
* @param resetDeps - When any dependency changes, page resets to 1. Omit to disable auto-reset.
|
|
4004
|
+
* @param total - When provided, automatically retreats to the last valid page if the current page becomes empty (e.g., after bulk deletion).
|
|
4005
|
+
*/
|
|
4006
|
+
declare function usePaginationState(pageSize: number, resetDeps?: unknown[], total?: number): {
|
|
4007
|
+
page: number;
|
|
4008
|
+
setPage: react.Dispatch<react.SetStateAction<number>>;
|
|
4009
|
+
offset: number;
|
|
4010
|
+
totalPages: (total: number) => number;
|
|
4011
|
+
};
|
|
4012
|
+
|
|
4013
|
+
/**
|
|
4014
|
+
* Generic table row selection hook.
|
|
4015
|
+
* Tracks selected IDs, provides toggle/toggleAll/clear, and computes selection state.
|
|
4016
|
+
*
|
|
4017
|
+
* @param items - Current page items (must have `id: string`)
|
|
4018
|
+
* @param allItems - All items across all pages (for "select all" to work across pages). Defaults to `items`.
|
|
4019
|
+
*/
|
|
4020
|
+
declare function useTableSelection<T extends {
|
|
4021
|
+
id: string;
|
|
4022
|
+
}>(items: T[], allItems?: T[]): {
|
|
4023
|
+
selectedIds: Set<string>;
|
|
4024
|
+
toggle: (id: string) => void;
|
|
4025
|
+
togglePage: () => void;
|
|
4026
|
+
clear: () => void;
|
|
4027
|
+
isPageAllSelected: boolean;
|
|
4028
|
+
isPagePartiallySelected: boolean;
|
|
4029
|
+
selectedCount: number;
|
|
4030
|
+
isSelected: (id: string) => boolean;
|
|
4031
|
+
};
|
|
4032
|
+
|
|
4033
|
+
type SortDirection = 'asc' | 'desc';
|
|
4034
|
+
interface SortState {
|
|
4035
|
+
column: string;
|
|
4036
|
+
direction: SortDirection;
|
|
4037
|
+
}
|
|
4038
|
+
/**
|
|
4039
|
+
* Generic table sorting hook.
|
|
4040
|
+
* Manages sort column + direction, and provides a sort utility for client-side data.
|
|
4041
|
+
*/
|
|
4042
|
+
declare function useTableSort(defaultColumn: string, defaultDirection?: SortDirection): {
|
|
4043
|
+
sort: SortState;
|
|
4044
|
+
toggleSort: (column: string) => void;
|
|
4045
|
+
};
|
|
4046
|
+
/**
|
|
4047
|
+
* Sort an array of items by a column using accessor functions.
|
|
4048
|
+
*
|
|
4049
|
+
* @param data - Array to sort (not mutated)
|
|
4050
|
+
* @param sort - Current sort state
|
|
4051
|
+
* @param accessors - Map of column name → accessor function
|
|
4052
|
+
*/
|
|
4053
|
+
declare function sortData<T>(data: T[], sort: SortState, accessors: Record<string, (item: T) => string | number | boolean | null | undefined>): T[];
|
|
4054
|
+
/**
|
|
4055
|
+
* Hook that combines useTableSort with memoized sortData.
|
|
4056
|
+
* Returns the sort state, toggle function, and a memoized sort function.
|
|
4057
|
+
*/
|
|
4058
|
+
declare function useSortedData<T>(data: T[], defaultColumn: string, accessors: Record<string, (item: T) => string | number | boolean | null | undefined>, defaultDirection?: SortDirection): {
|
|
4059
|
+
sorted: T[];
|
|
4060
|
+
sort: SortState;
|
|
4061
|
+
toggleSort: (column: string) => void;
|
|
4062
|
+
};
|
|
4063
|
+
|
|
4064
|
+
interface InitializationError {
|
|
4065
|
+
layer: 'auth' | 'profile' | 'organization';
|
|
4066
|
+
message: string;
|
|
4067
|
+
originalError?: Error;
|
|
4068
|
+
}
|
|
4069
|
+
interface AppInitializationState {
|
|
4070
|
+
userReady: boolean;
|
|
4071
|
+
organizationReady: boolean;
|
|
4072
|
+
allReady: boolean;
|
|
4073
|
+
isInitializing: boolean;
|
|
4074
|
+
error: InitializationError | null;
|
|
4075
|
+
retry: () => void;
|
|
4076
|
+
profile: SupabaseUserProfile | null;
|
|
4077
|
+
}
|
|
4078
|
+
|
|
4079
|
+
/**
|
|
4080
|
+
* The value exposed by OrganizationProvider to all consumers.
|
|
4081
|
+
*/
|
|
4082
|
+
interface OrganizationContextValue {
|
|
4083
|
+
/** WorkOS organization ID of the currently selected organization. */
|
|
4084
|
+
currentWorkOSOrganizationId: string | null;
|
|
4085
|
+
/** Supabase (UUID) organization ID of the currently selected organization. */
|
|
4086
|
+
currentSupabaseOrganizationId: string | null;
|
|
4087
|
+
/** Full membership record for the currently selected organization. */
|
|
4088
|
+
currentMembership: MembershipWithDetails | null;
|
|
4089
|
+
/** All memberships for the authenticated user. */
|
|
4090
|
+
memberships: MembershipWithDetails[];
|
|
4091
|
+
/** True while the initial membership list is being fetched. */
|
|
4092
|
+
isInitializing: boolean;
|
|
4093
|
+
/** True while a subsequent org switch / refresh is in flight. */
|
|
4094
|
+
isOrgRefreshing: boolean;
|
|
4095
|
+
/** Error message if the membership fetch or org switch failed. */
|
|
4096
|
+
error: string | null;
|
|
4097
|
+
/**
|
|
4098
|
+
* Switch the active organization.
|
|
4099
|
+
*
|
|
4100
|
+
* Persists the selection to `last_visited_org` on the user profile and
|
|
4101
|
+
* invalidates all org-scoped TanStack Query cache entries.
|
|
4102
|
+
*
|
|
4103
|
+
* @param workosOrgId - WorkOS organization ID to switch to.
|
|
4104
|
+
*/
|
|
4105
|
+
switchOrganization: (workosOrgId: string) => void;
|
|
4106
|
+
/**
|
|
4107
|
+
* Re-fetch memberships and retry org selection after an error.
|
|
4108
|
+
*/
|
|
4109
|
+
retry: () => Promise<void>;
|
|
4110
|
+
}
|
|
4111
|
+
|
|
4112
|
+
type RestrictionSource = 'org' | 'membership' | null;
|
|
4113
|
+
interface FeatureAccessResult {
|
|
4114
|
+
allowed: boolean;
|
|
4115
|
+
restrictedBy: RestrictionSource;
|
|
4116
|
+
}
|
|
4117
|
+
/**
|
|
4118
|
+
* Factory that creates a `useFeatureAccess` hook scoped to the consumer's
|
|
4119
|
+
* feature configuration.
|
|
4120
|
+
*
|
|
4121
|
+
* @param useInitialization - Initialization hook providing `profile` and `organizationReady`
|
|
4122
|
+
* @param useOrganization - Organization hook providing `currentMembership`
|
|
4123
|
+
* @param optInFeatures - Feature keys that are disabled by default (must be explicitly enabled)
|
|
4124
|
+
* @param getCoursesByGroup - Resolver that maps a course group name to its course slugs
|
|
4125
|
+
*
|
|
4126
|
+
* @example
|
|
4127
|
+
* ```typescript
|
|
4128
|
+
* // In your app's feature-access module
|
|
4129
|
+
* import { createUseFeatureAccess } from '@repo/ui/hooks'
|
|
4130
|
+
* import { useInitialization } from '@repo/ui/initialization'
|
|
4131
|
+
* import { useOrganization } from '@repo/ui/organization'
|
|
4132
|
+
* import { getCoursesByGroup } from './training/registry'
|
|
4133
|
+
*
|
|
4134
|
+
* export const useFeatureAccess = createUseFeatureAccess({
|
|
4135
|
+
* useInitialization,
|
|
4136
|
+
* useOrganization,
|
|
4137
|
+
* optInFeatures: ['acquisition', 'calibration'],
|
|
4138
|
+
* getCoursesByGroup,
|
|
4139
|
+
* })
|
|
4140
|
+
* ```
|
|
4141
|
+
*/
|
|
4142
|
+
declare function createUseFeatureAccess({ useInitialization, useOrganization, optInFeatures, getCoursesByGroup }: {
|
|
4143
|
+
useInitialization: () => Pick<AppInitializationState, 'profile' | 'organizationReady'>;
|
|
4144
|
+
useOrganization: () => Pick<OrganizationContextValue, 'currentMembership'>;
|
|
4145
|
+
optInFeatures?: string[];
|
|
4146
|
+
getCoursesByGroup?: (group: CourseGroup) => string[];
|
|
4147
|
+
}): () => {
|
|
4148
|
+
orgConfig: OrgFeatureConfig | undefined;
|
|
4149
|
+
membershipConfig: OrgFeatureConfig | undefined;
|
|
4150
|
+
userConfig: UserConfig | undefined;
|
|
4151
|
+
hasFeature: (featureKey: string) => boolean;
|
|
4152
|
+
checkFeature: (featureKey: string) => FeatureAccessResult;
|
|
4153
|
+
hasTrainingAccess: () => boolean;
|
|
4154
|
+
getAllowedCourses: () => string[] | null;
|
|
4155
|
+
getResolvedCourseAccess: () => string[] | null;
|
|
4156
|
+
hasAccessToCourse: (courseSlug: string) => boolean;
|
|
4157
|
+
getEnabledGroups: () => CourseGroup[];
|
|
4158
|
+
isReady: boolean;
|
|
4159
|
+
};
|
|
4160
|
+
|
|
4161
|
+
interface EventSourceMessage {
|
|
4162
|
+
id: string;
|
|
4163
|
+
event: string;
|
|
4164
|
+
data: string;
|
|
4165
|
+
retry?: number;
|
|
4166
|
+
}
|
|
4167
|
+
|
|
4168
|
+
interface FetchEventSourceWithTokenRefreshOptions {
|
|
4169
|
+
url: string;
|
|
4170
|
+
getToken: () => Promise<string | undefined>;
|
|
4171
|
+
headers?: Record<string, string>;
|
|
4172
|
+
signal: AbortSignal;
|
|
4173
|
+
/** Delay in ms before reconnecting after token refresh. Defaults to 2000. */
|
|
4174
|
+
tokenRefreshDelayMs?: number;
|
|
4175
|
+
onopen?: (response: Response) => void | Promise<void>;
|
|
4176
|
+
onmessage?: (event: EventSourceMessage) => void;
|
|
4177
|
+
onerror?: (error: unknown) => void;
|
|
4178
|
+
onclose?: () => void;
|
|
4179
|
+
}
|
|
4180
|
+
|
|
4181
|
+
interface SSEConnectionManagerOptions {
|
|
4182
|
+
/** Grace period in ms before closing idle connections. Defaults to 5000. */
|
|
4183
|
+
closeGracePeriodMs?: number;
|
|
4184
|
+
}
|
|
4185
|
+
/**
|
|
4186
|
+
* SSE Connection Manager
|
|
4187
|
+
*
|
|
4188
|
+
* Ensures only ONE SSE connection exists per endpoint, preventing duplicate
|
|
4189
|
+
* connections when components re-render or remount.
|
|
4190
|
+
*
|
|
4191
|
+
* Benefits:
|
|
4192
|
+
* - Prevents resource waste from duplicate connections
|
|
4193
|
+
* - Eliminates race conditions from overlapping connections
|
|
4194
|
+
* - Automatically manages connection lifecycle
|
|
4195
|
+
* - Shares single connection across multiple subscribers
|
|
4196
|
+
*/
|
|
4197
|
+
declare class SSEConnectionManager {
|
|
4198
|
+
private connections;
|
|
4199
|
+
private closeGracePeriodMs;
|
|
4200
|
+
constructor(options?: SSEConnectionManagerOptions);
|
|
4201
|
+
/**
|
|
4202
|
+
* Subscribe to an SSE endpoint
|
|
4203
|
+
*
|
|
4204
|
+
* If a connection already exists for this endpoint, reuses it.
|
|
4205
|
+
* Otherwise, creates a new connection.
|
|
4206
|
+
*
|
|
4207
|
+
* @param key - Unique identifier for the connection (e.g., 'notifications', 'resource-executive-agent')
|
|
4208
|
+
* @param subscriberId - Unique identifier for this subscriber (usually component instance)
|
|
4209
|
+
* @param options - SSE connection options
|
|
4210
|
+
* @returns Unsubscribe function to call when component unmounts
|
|
4211
|
+
*/
|
|
4212
|
+
subscribe(key: string, subscriberId: string, options: Omit<FetchEventSourceWithTokenRefreshOptions, 'signal'>): () => void;
|
|
4213
|
+
/**
|
|
4214
|
+
* Unsubscribe from an SSE endpoint
|
|
4215
|
+
*
|
|
4216
|
+
* If this is the last subscriber, closes the connection after grace period.
|
|
4217
|
+
*/
|
|
4218
|
+
private unsubscribe;
|
|
4219
|
+
/**
|
|
4220
|
+
* Force close a connection and all its subscribers
|
|
4221
|
+
*/
|
|
4222
|
+
closeConnection(key: string): void;
|
|
4223
|
+
/**
|
|
4224
|
+
* Get current connection status
|
|
4225
|
+
*/
|
|
4226
|
+
getConnectionInfo(): Map<string, {
|
|
4227
|
+
url: string;
|
|
4228
|
+
subscribers: number;
|
|
4229
|
+
}>;
|
|
4230
|
+
}
|
|
4231
|
+
|
|
4232
|
+
interface UseSSEConnectionOptions {
|
|
4233
|
+
manager: SSEConnectionManager;
|
|
4234
|
+
/** Shared connection key — all subscribers with the same key share ONE connection. */
|
|
4235
|
+
connectionKey: string;
|
|
4236
|
+
url: string;
|
|
4237
|
+
/** When false the subscription is skipped. Defaults to true. */
|
|
4238
|
+
enabled?: boolean;
|
|
4239
|
+
headers?: Record<string, string>;
|
|
4240
|
+
/** Called for each non-empty SSE message with the raw `event.data` string. */
|
|
4241
|
+
onmessage: (data: string) => void;
|
|
4242
|
+
/**
|
|
4243
|
+
* Called when the connection opens. Return a non-empty string to set it as
|
|
4244
|
+
* the error state (e.g. `response.status === 403 ? 'Access denied' : undefined`).
|
|
4245
|
+
*/
|
|
4246
|
+
onopen?: (response: Response) => string | void;
|
|
4247
|
+
onerror?: (err: Error) => void;
|
|
4248
|
+
onclose?: () => void;
|
|
4249
|
+
}
|
|
4250
|
+
/**
|
|
4251
|
+
* Generic SSE subscription hook.
|
|
4252
|
+
*
|
|
4253
|
+
* Handles token refresh, connection state, subscriber ID generation, and
|
|
4254
|
+
* subscribe/cleanup lifecycle via the shared SSEConnectionManager.
|
|
4255
|
+
*
|
|
4256
|
+
* Domain-specific event parsing (e.g. `ExecutionSSEEvent`) stays in the
|
|
4257
|
+
* caller's `onmessage` handler.
|
|
4258
|
+
*
|
|
4259
|
+
* @example
|
|
4260
|
+
* ```typescript
|
|
4261
|
+
* const { connected, error } = useSSEConnection({
|
|
4262
|
+
* manager: sseConnectionManager,
|
|
4263
|
+
* connectionKey: `resource-${resourceId}`,
|
|
4264
|
+
* url: `${API_URL}/api/execution-engine/sse/${resourceId}`,
|
|
4265
|
+
* enabled: isOrganizationReady,
|
|
4266
|
+
* headers: { [HTTP_HEADERS.WORKOS_ORGANIZATION_ID]: orgId },
|
|
4267
|
+
* onmessage: (data) => {
|
|
4268
|
+
* const event = JSON.parse(data)
|
|
4269
|
+
* // handle domain-specific event
|
|
4270
|
+
* },
|
|
4271
|
+
* })
|
|
4272
|
+
* ```
|
|
4273
|
+
*/
|
|
4274
|
+
declare function useSSEConnection({ manager, connectionKey, url, enabled, headers, onmessage, onopen, onerror, onclose }: UseSSEConnectionOptions): {
|
|
4275
|
+
connected: boolean;
|
|
4276
|
+
error: string | null;
|
|
4277
|
+
};
|
|
4278
|
+
|
|
4279
|
+
export { OperationsService, createUseFeatureAccess, executionsKeys, observabilityKeys, scheduleKeys, sortData, useActivities, useActivityTrend, useBatchDelete, useBulkDeleteExecutions, useBusinessImpact, useCancelExecution, useCancelSchedule, useCostBreakdown, useCostByModel, useCostSummary, useCostTrends, useCreateSchedule, useDashboardMetrics, useDeleteExecution, useDeleteSchedule, useErrorAnalysis, useErrorDetail, useErrorDetails, useErrorDistribution, useErrorNotification, useErrorTrends, useExecuteAsync, useExecution, useExecutionHealth, useExecutionLogs, useExecutions, useGetExecutionHistory, useGetSchedule, useListSchedules, useMarkAllAsRead, useMarkAsRead, useNotificationCount, useNotifications, usePaginationState, usePauseSchedule, useResolveAllErrors, useResolveError, useResolveErrorsByExecution, useResourceDefinition, useResources, useResumeSchedule, useRetryExecution, useSSEConnection, useSortedData, useSuccessNotification, useTableSelection, useTableSort, useTopFailingResources, useUnresolveError, useUpdateAnchor, useUpdateSchedule, useWarningNotification };
|
|
4280
|
+
export type { ActivityTrendResponse, BulkDeleteExecutionsParams, BulkDeleteExecutionsResult, BusinessImpactMetrics, CancelExecutionParams, CancelExecutionResult, CostBreakdownItem, CreateScheduleInput, CreateSessionResponse, DeleteExecutionParams, ErrorDistributionItem, ErrorDistributionParams, ErrorFilters, ErrorTrendsParams, ExecuteAsyncParams, ExecuteAsyncResult, ExecutionHistoryItem, ExecutionHistoryResponse, ExecutionLogsPageResponse, FailingResource, ListActivitiesResponse, ListSchedulesFilters, ListSchedulesResponse, ResourcesResponse, RetryExecutionParams, SessionListItem, SortDirection, SortState, TaskSchedule, TopFailingResourcesParams, UpdateScheduleInput, UseActivitiesParams, UseActivityTrendParams, UseExecutionHealthParams, UseExecutionLogsParams, UseSSEConnectionOptions };
|