@elevasis/ui 2.3.1 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2833 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { z } from 'zod';
3
+ import { ReactNode, ComponentType } from 'react';
4
+
5
+ declare const CrmSidebar: () => react_jsx_runtime.JSX.Element;
6
+
7
+ declare const CrmSidebarTop: () => react_jsx_runtime.JSX.Element;
8
+
9
+ declare const CrmSidebarMiddle: () => react_jsx_runtime.JSX.Element;
10
+
11
+ type Json = string | number | boolean | null | {
12
+ [key: string]: Json | undefined;
13
+ } | Json[];
14
+ type Database = {
15
+ __InternalSupabase: {
16
+ PostgrestVersion: "12.2.3 (519615d)";
17
+ };
18
+ public: {
19
+ Tables: {
20
+ acq_companies: {
21
+ Row: {
22
+ batch_id: string | null;
23
+ category: string | null;
24
+ category_pain: string | null;
25
+ created_at: string;
26
+ domain: string | null;
27
+ enrichment_data: Json | null;
28
+ filter_reason: string | null;
29
+ founded_year: number | null;
30
+ id: string;
31
+ linkedin_url: string | null;
32
+ location_city: string | null;
33
+ location_state: string | null;
34
+ name: string;
35
+ num_employees: number | null;
36
+ organization_id: string;
37
+ pipeline_status: Json;
38
+ segment: string | null;
39
+ source: string | null;
40
+ status: string;
41
+ updated_at: string;
42
+ website: string | null;
43
+ };
44
+ Insert: {
45
+ batch_id?: string | null;
46
+ category?: string | null;
47
+ category_pain?: string | null;
48
+ created_at?: string;
49
+ domain?: string | null;
50
+ enrichment_data?: Json | null;
51
+ filter_reason?: string | null;
52
+ founded_year?: number | null;
53
+ id?: string;
54
+ linkedin_url?: string | null;
55
+ location_city?: string | null;
56
+ location_state?: string | null;
57
+ name: string;
58
+ num_employees?: number | null;
59
+ organization_id: string;
60
+ pipeline_status?: Json;
61
+ segment?: string | null;
62
+ source?: string | null;
63
+ status?: string;
64
+ updated_at?: string;
65
+ website?: string | null;
66
+ };
67
+ Update: {
68
+ batch_id?: string | null;
69
+ category?: string | null;
70
+ category_pain?: string | null;
71
+ created_at?: string;
72
+ domain?: string | null;
73
+ enrichment_data?: Json | null;
74
+ filter_reason?: string | null;
75
+ founded_year?: number | null;
76
+ id?: string;
77
+ linkedin_url?: string | null;
78
+ location_city?: string | null;
79
+ location_state?: string | null;
80
+ name?: string;
81
+ num_employees?: number | null;
82
+ organization_id?: string;
83
+ pipeline_status?: Json;
84
+ segment?: string | null;
85
+ source?: string | null;
86
+ status?: string;
87
+ updated_at?: string;
88
+ website?: string | null;
89
+ };
90
+ Relationships: [
91
+ {
92
+ foreignKeyName: "acq_companies_organization_id_fkey";
93
+ columns: ["organization_id"];
94
+ isOneToOne: false;
95
+ referencedRelation: "organizations";
96
+ referencedColumns: ["id"];
97
+ }
98
+ ];
99
+ };
100
+ acq_contacts: {
101
+ Row: {
102
+ batch_id: string | null;
103
+ brochure_first_viewed_at: string | null;
104
+ brochure_view_count: number;
105
+ company_id: string | null;
106
+ created_at: string;
107
+ email: string;
108
+ email_valid: string | null;
109
+ enrichment_data: Json;
110
+ filter_reason: string | null;
111
+ first_name: string | null;
112
+ headline: string | null;
113
+ id: string;
114
+ last_name: string | null;
115
+ linkedin_url: string | null;
116
+ nurture: boolean;
117
+ opening_line: string | null;
118
+ organization_id: string;
119
+ pipeline_status: Json;
120
+ source: string | null;
121
+ source_id: string | null;
122
+ status: string;
123
+ title: string | null;
124
+ updated_at: string;
125
+ };
126
+ Insert: {
127
+ batch_id?: string | null;
128
+ brochure_first_viewed_at?: string | null;
129
+ brochure_view_count?: number;
130
+ company_id?: string | null;
131
+ created_at?: string;
132
+ email: string;
133
+ email_valid?: string | null;
134
+ enrichment_data?: Json;
135
+ filter_reason?: string | null;
136
+ first_name?: string | null;
137
+ headline?: string | null;
138
+ id?: string;
139
+ last_name?: string | null;
140
+ linkedin_url?: string | null;
141
+ nurture?: boolean;
142
+ opening_line?: string | null;
143
+ organization_id: string;
144
+ pipeline_status?: Json;
145
+ source?: string | null;
146
+ source_id?: string | null;
147
+ status?: string;
148
+ title?: string | null;
149
+ updated_at?: string;
150
+ };
151
+ Update: {
152
+ batch_id?: string | null;
153
+ brochure_first_viewed_at?: string | null;
154
+ brochure_view_count?: number;
155
+ company_id?: string | null;
156
+ created_at?: string;
157
+ email?: string;
158
+ email_valid?: string | null;
159
+ enrichment_data?: Json;
160
+ filter_reason?: string | null;
161
+ first_name?: string | null;
162
+ headline?: string | null;
163
+ id?: string;
164
+ last_name?: string | null;
165
+ linkedin_url?: string | null;
166
+ nurture?: boolean;
167
+ opening_line?: string | null;
168
+ organization_id?: string;
169
+ pipeline_status?: Json;
170
+ source?: string | null;
171
+ source_id?: string | null;
172
+ status?: string;
173
+ title?: string | null;
174
+ updated_at?: string;
175
+ };
176
+ Relationships: [
177
+ {
178
+ foreignKeyName: "acq_contacts_company_id_fkey";
179
+ columns: ["company_id"];
180
+ isOneToOne: false;
181
+ referencedRelation: "acq_companies";
182
+ referencedColumns: ["id"];
183
+ },
184
+ {
185
+ foreignKeyName: "acq_contacts_organization_id_fkey";
186
+ columns: ["organization_id"];
187
+ isOneToOne: false;
188
+ referencedRelation: "organizations";
189
+ referencedColumns: ["id"];
190
+ }
191
+ ];
192
+ };
193
+ acq_content: {
194
+ Row: {
195
+ body: string | null;
196
+ created_at: string;
197
+ id: string;
198
+ organization_id: string;
199
+ pillar: string;
200
+ status: string;
201
+ title: string;
202
+ updated_at: string;
203
+ };
204
+ Insert: {
205
+ body?: string | null;
206
+ created_at?: string;
207
+ id?: string;
208
+ organization_id: string;
209
+ pillar: string;
210
+ status?: string;
211
+ title: string;
212
+ updated_at?: string;
213
+ };
214
+ Update: {
215
+ body?: string | null;
216
+ created_at?: string;
217
+ id?: string;
218
+ organization_id?: string;
219
+ pillar?: string;
220
+ status?: string;
221
+ title?: string;
222
+ updated_at?: string;
223
+ };
224
+ Relationships: [
225
+ {
226
+ foreignKeyName: "acq_content_organization_id_fkey";
227
+ columns: ["organization_id"];
228
+ isOneToOne: false;
229
+ referencedRelation: "organizations";
230
+ referencedColumns: ["id"];
231
+ }
232
+ ];
233
+ };
234
+ acq_content_distributions: {
235
+ Row: {
236
+ adapted_body: string | null;
237
+ checklist: Json | null;
238
+ content_id: string;
239
+ created_at: string;
240
+ format: string;
241
+ id: string;
242
+ media_urls: Json;
243
+ metrics: Json;
244
+ metrics_updated_at: string | null;
245
+ organization_id: string;
246
+ platform: string;
247
+ platform_content: Json | null;
248
+ platform_post_id: string | null;
249
+ platform_url: string | null;
250
+ published_at: string | null;
251
+ status: string;
252
+ updated_at: string;
253
+ };
254
+ Insert: {
255
+ adapted_body?: string | null;
256
+ checklist?: Json | null;
257
+ content_id: string;
258
+ created_at?: string;
259
+ format: string;
260
+ id?: string;
261
+ media_urls?: Json;
262
+ metrics?: Json;
263
+ metrics_updated_at?: string | null;
264
+ organization_id: string;
265
+ platform: string;
266
+ platform_content?: Json | null;
267
+ platform_post_id?: string | null;
268
+ platform_url?: string | null;
269
+ published_at?: string | null;
270
+ status?: string;
271
+ updated_at?: string;
272
+ };
273
+ Update: {
274
+ adapted_body?: string | null;
275
+ checklist?: Json | null;
276
+ content_id?: string;
277
+ created_at?: string;
278
+ format?: string;
279
+ id?: string;
280
+ media_urls?: Json;
281
+ metrics?: Json;
282
+ metrics_updated_at?: string | null;
283
+ organization_id?: string;
284
+ platform?: string;
285
+ platform_content?: Json | null;
286
+ platform_post_id?: string | null;
287
+ platform_url?: string | null;
288
+ published_at?: string | null;
289
+ status?: string;
290
+ updated_at?: string;
291
+ };
292
+ Relationships: [
293
+ {
294
+ foreignKeyName: "acq_content_distributions_content_id_fkey";
295
+ columns: ["content_id"];
296
+ isOneToOne: false;
297
+ referencedRelation: "acq_content";
298
+ referencedColumns: ["id"];
299
+ },
300
+ {
301
+ foreignKeyName: "acq_content_distributions_organization_id_fkey";
302
+ columns: ["organization_id"];
303
+ isOneToOne: false;
304
+ referencedRelation: "organizations";
305
+ referencedColumns: ["id"];
306
+ }
307
+ ];
308
+ };
309
+ acq_deal_notes: {
310
+ Row: {
311
+ author_user_id: string | null;
312
+ body: string;
313
+ created_at: string;
314
+ deal_id: string;
315
+ id: string;
316
+ organization_id: string;
317
+ updated_at: string;
318
+ };
319
+ Insert: {
320
+ author_user_id?: string | null;
321
+ body: string;
322
+ created_at?: string;
323
+ deal_id: string;
324
+ id?: string;
325
+ organization_id: string;
326
+ updated_at?: string;
327
+ };
328
+ Update: {
329
+ author_user_id?: string | null;
330
+ body?: string;
331
+ created_at?: string;
332
+ deal_id?: string;
333
+ id?: string;
334
+ organization_id?: string;
335
+ updated_at?: string;
336
+ };
337
+ Relationships: [
338
+ {
339
+ foreignKeyName: "acq_deal_notes_deal_id_fkey";
340
+ columns: ["deal_id"];
341
+ isOneToOne: false;
342
+ referencedRelation: "acq_deals";
343
+ referencedColumns: ["id"];
344
+ },
345
+ {
346
+ foreignKeyName: "acq_deal_notes_organization_id_fkey";
347
+ columns: ["organization_id"];
348
+ isOneToOne: false;
349
+ referencedRelation: "organizations";
350
+ referencedColumns: ["id"];
351
+ }
352
+ ];
353
+ };
354
+ acq_deal_tasks: {
355
+ Row: {
356
+ assignee_user_id: string | null;
357
+ completed_at: string | null;
358
+ completed_by_user_id: string | null;
359
+ created_at: string;
360
+ created_by_user_id: string | null;
361
+ deal_id: string;
362
+ description: string | null;
363
+ due_at: string | null;
364
+ id: string;
365
+ kind: string;
366
+ organization_id: string;
367
+ title: string;
368
+ updated_at: string;
369
+ };
370
+ Insert: {
371
+ assignee_user_id?: string | null;
372
+ completed_at?: string | null;
373
+ completed_by_user_id?: string | null;
374
+ created_at?: string;
375
+ created_by_user_id?: string | null;
376
+ deal_id: string;
377
+ description?: string | null;
378
+ due_at?: string | null;
379
+ id?: string;
380
+ kind?: string;
381
+ organization_id: string;
382
+ title: string;
383
+ updated_at?: string;
384
+ };
385
+ Update: {
386
+ assignee_user_id?: string | null;
387
+ completed_at?: string | null;
388
+ completed_by_user_id?: string | null;
389
+ created_at?: string;
390
+ created_by_user_id?: string | null;
391
+ deal_id?: string;
392
+ description?: string | null;
393
+ due_at?: string | null;
394
+ id?: string;
395
+ kind?: string;
396
+ organization_id?: string;
397
+ title?: string;
398
+ updated_at?: string;
399
+ };
400
+ Relationships: [
401
+ {
402
+ foreignKeyName: "acq_deal_tasks_deal_id_fkey";
403
+ columns: ["deal_id"];
404
+ isOneToOne: false;
405
+ referencedRelation: "acq_deals";
406
+ referencedColumns: ["id"];
407
+ },
408
+ {
409
+ foreignKeyName: "acq_deal_tasks_organization_id_fkey";
410
+ columns: ["organization_id"];
411
+ isOneToOne: false;
412
+ referencedRelation: "organizations";
413
+ referencedColumns: ["id"];
414
+ }
415
+ ];
416
+ };
417
+ acq_deals: {
418
+ Row: {
419
+ activity_log: Json;
420
+ cached_stage: string | null;
421
+ closed_lost_at: string | null;
422
+ closed_lost_reason: string | null;
423
+ contact_email: string;
424
+ contact_id: string | null;
425
+ created_at: string;
426
+ discovery_data: Json | null;
427
+ discovery_submitted_at: string | null;
428
+ discovery_submitted_by: string | null;
429
+ id: string;
430
+ initial_fee: number | null;
431
+ monthly_fee: number | null;
432
+ organization_id: string;
433
+ payment_link_sent_at: string | null;
434
+ payment_received_at: string | null;
435
+ proposal_data: Json | null;
436
+ proposal_generated_at: string | null;
437
+ proposal_pdf_url: string | null;
438
+ proposal_reviewed_at: string | null;
439
+ proposal_reviewed_by: string | null;
440
+ proposal_sent_at: string | null;
441
+ proposal_signed_at: string | null;
442
+ proposal_status: string | null;
443
+ signature_envelope_id: string | null;
444
+ source_list_id: string | null;
445
+ source_type: string | null;
446
+ stripe_payment_id: string | null;
447
+ stripe_payment_link: string | null;
448
+ stripe_payment_link_id: string | null;
449
+ stripe_subscription_id: string | null;
450
+ updated_at: string;
451
+ };
452
+ Insert: {
453
+ activity_log?: Json;
454
+ cached_stage?: string | null;
455
+ closed_lost_at?: string | null;
456
+ closed_lost_reason?: string | null;
457
+ contact_email: string;
458
+ contact_id?: string | null;
459
+ created_at?: string;
460
+ discovery_data?: Json | null;
461
+ discovery_submitted_at?: string | null;
462
+ discovery_submitted_by?: string | null;
463
+ id?: string;
464
+ initial_fee?: number | null;
465
+ monthly_fee?: number | null;
466
+ organization_id: string;
467
+ payment_link_sent_at?: string | null;
468
+ payment_received_at?: string | null;
469
+ proposal_data?: Json | null;
470
+ proposal_generated_at?: string | null;
471
+ proposal_pdf_url?: string | null;
472
+ proposal_reviewed_at?: string | null;
473
+ proposal_reviewed_by?: string | null;
474
+ proposal_sent_at?: string | null;
475
+ proposal_signed_at?: string | null;
476
+ proposal_status?: string | null;
477
+ signature_envelope_id?: string | null;
478
+ source_list_id?: string | null;
479
+ source_type?: string | null;
480
+ stripe_payment_id?: string | null;
481
+ stripe_payment_link?: string | null;
482
+ stripe_payment_link_id?: string | null;
483
+ stripe_subscription_id?: string | null;
484
+ updated_at?: string;
485
+ };
486
+ Update: {
487
+ activity_log?: Json;
488
+ cached_stage?: string | null;
489
+ closed_lost_at?: string | null;
490
+ closed_lost_reason?: string | null;
491
+ contact_email?: string;
492
+ contact_id?: string | null;
493
+ created_at?: string;
494
+ discovery_data?: Json | null;
495
+ discovery_submitted_at?: string | null;
496
+ discovery_submitted_by?: string | null;
497
+ id?: string;
498
+ initial_fee?: number | null;
499
+ monthly_fee?: number | null;
500
+ organization_id?: string;
501
+ payment_link_sent_at?: string | null;
502
+ payment_received_at?: string | null;
503
+ proposal_data?: Json | null;
504
+ proposal_generated_at?: string | null;
505
+ proposal_pdf_url?: string | null;
506
+ proposal_reviewed_at?: string | null;
507
+ proposal_reviewed_by?: string | null;
508
+ proposal_sent_at?: string | null;
509
+ proposal_signed_at?: string | null;
510
+ proposal_status?: string | null;
511
+ signature_envelope_id?: string | null;
512
+ source_list_id?: string | null;
513
+ source_type?: string | null;
514
+ stripe_payment_id?: string | null;
515
+ stripe_payment_link?: string | null;
516
+ stripe_payment_link_id?: string | null;
517
+ stripe_subscription_id?: string | null;
518
+ updated_at?: string;
519
+ };
520
+ Relationships: [
521
+ {
522
+ foreignKeyName: "acq_deals_contact_id_fkey";
523
+ columns: ["contact_id"];
524
+ isOneToOne: false;
525
+ referencedRelation: "acq_contacts";
526
+ referencedColumns: ["id"];
527
+ },
528
+ {
529
+ foreignKeyName: "acq_deals_organization_id_fkey";
530
+ columns: ["organization_id"];
531
+ isOneToOne: false;
532
+ referencedRelation: "organizations";
533
+ referencedColumns: ["id"];
534
+ },
535
+ {
536
+ foreignKeyName: "acq_deals_source_list_id_fkey";
537
+ columns: ["source_list_id"];
538
+ isOneToOne: false;
539
+ referencedRelation: "acq_lists";
540
+ referencedColumns: ["id"];
541
+ }
542
+ ];
543
+ };
544
+ acq_list_companies: {
545
+ Row: {
546
+ added_at: string;
547
+ added_by: string | null;
548
+ company_id: string;
549
+ id: string;
550
+ list_id: string;
551
+ source_execution_id: string | null;
552
+ source_input_hash: string | null;
553
+ source_resource_id: string | null;
554
+ stage: string | null;
555
+ stage_updated_at: string | null;
556
+ };
557
+ Insert: {
558
+ added_at?: string;
559
+ added_by?: string | null;
560
+ company_id: string;
561
+ id?: string;
562
+ list_id: string;
563
+ source_execution_id?: string | null;
564
+ source_input_hash?: string | null;
565
+ source_resource_id?: string | null;
566
+ stage?: string | null;
567
+ stage_updated_at?: string | null;
568
+ };
569
+ Update: {
570
+ added_at?: string;
571
+ added_by?: string | null;
572
+ company_id?: string;
573
+ id?: string;
574
+ list_id?: string;
575
+ source_execution_id?: string | null;
576
+ source_input_hash?: string | null;
577
+ source_resource_id?: string | null;
578
+ stage?: string | null;
579
+ stage_updated_at?: string | null;
580
+ };
581
+ Relationships: [
582
+ {
583
+ foreignKeyName: "acq_list_companies_company_id_fkey";
584
+ columns: ["company_id"];
585
+ isOneToOne: false;
586
+ referencedRelation: "acq_companies";
587
+ referencedColumns: ["id"];
588
+ },
589
+ {
590
+ foreignKeyName: "acq_list_companies_list_id_fkey";
591
+ columns: ["list_id"];
592
+ isOneToOne: false;
593
+ referencedRelation: "acq_lists";
594
+ referencedColumns: ["id"];
595
+ },
596
+ {
597
+ foreignKeyName: "acq_list_companies_source_execution_id_fkey";
598
+ columns: ["source_execution_id"];
599
+ isOneToOne: false;
600
+ referencedRelation: "execution_logs";
601
+ referencedColumns: ["execution_id"];
602
+ }
603
+ ];
604
+ };
605
+ acq_list_executions: {
606
+ Row: {
607
+ created_at: string;
608
+ execution_id: string;
609
+ id: string;
610
+ list_id: string;
611
+ payload: Json;
612
+ };
613
+ Insert: {
614
+ created_at?: string;
615
+ execution_id: string;
616
+ id?: string;
617
+ list_id: string;
618
+ payload?: Json;
619
+ };
620
+ Update: {
621
+ created_at?: string;
622
+ execution_id?: string;
623
+ id?: string;
624
+ list_id?: string;
625
+ payload?: Json;
626
+ };
627
+ Relationships: [
628
+ {
629
+ foreignKeyName: "acq_list_executions_execution_id_fkey";
630
+ columns: ["execution_id"];
631
+ isOneToOne: false;
632
+ referencedRelation: "execution_logs";
633
+ referencedColumns: ["execution_id"];
634
+ },
635
+ {
636
+ foreignKeyName: "acq_list_executions_list_id_fkey";
637
+ columns: ["list_id"];
638
+ isOneToOne: false;
639
+ referencedRelation: "acq_lists";
640
+ referencedColumns: ["id"];
641
+ }
642
+ ];
643
+ };
644
+ acq_list_members: {
645
+ Row: {
646
+ added_at: string;
647
+ added_by: string | null;
648
+ contact_id: string;
649
+ id: string;
650
+ list_id: string;
651
+ source_execution_id: string | null;
652
+ source_input_hash: string | null;
653
+ source_resource_id: string | null;
654
+ stage: string | null;
655
+ stage_updated_at: string | null;
656
+ };
657
+ Insert: {
658
+ added_at?: string;
659
+ added_by?: string | null;
660
+ contact_id: string;
661
+ id?: string;
662
+ list_id: string;
663
+ source_execution_id?: string | null;
664
+ source_input_hash?: string | null;
665
+ source_resource_id?: string | null;
666
+ stage?: string | null;
667
+ stage_updated_at?: string | null;
668
+ };
669
+ Update: {
670
+ added_at?: string;
671
+ added_by?: string | null;
672
+ contact_id?: string;
673
+ id?: string;
674
+ list_id?: string;
675
+ source_execution_id?: string | null;
676
+ source_input_hash?: string | null;
677
+ source_resource_id?: string | null;
678
+ stage?: string | null;
679
+ stage_updated_at?: string | null;
680
+ };
681
+ Relationships: [
682
+ {
683
+ foreignKeyName: "acq_list_members_contact_id_fkey";
684
+ columns: ["contact_id"];
685
+ isOneToOne: false;
686
+ referencedRelation: "acq_contacts";
687
+ referencedColumns: ["id"];
688
+ },
689
+ {
690
+ foreignKeyName: "acq_list_members_list_id_fkey";
691
+ columns: ["list_id"];
692
+ isOneToOne: false;
693
+ referencedRelation: "acq_lists";
694
+ referencedColumns: ["id"];
695
+ },
696
+ {
697
+ foreignKeyName: "acq_list_members_source_execution_id_fkey";
698
+ columns: ["source_execution_id"];
699
+ isOneToOne: false;
700
+ referencedRelation: "execution_logs";
701
+ referencedColumns: ["execution_id"];
702
+ }
703
+ ];
704
+ };
705
+ acq_lists: {
706
+ Row: {
707
+ batch_ids: string[];
708
+ completed_at: string | null;
709
+ config: Json;
710
+ created_at: string;
711
+ description: string | null;
712
+ id: string;
713
+ instantly_campaign_id: string | null;
714
+ launched_at: string | null;
715
+ metadata: Json;
716
+ name: string;
717
+ organization_id: string;
718
+ status: string;
719
+ type: string;
720
+ };
721
+ Insert: {
722
+ batch_ids?: string[];
723
+ completed_at?: string | null;
724
+ config?: Json;
725
+ created_at?: string;
726
+ description?: string | null;
727
+ id?: string;
728
+ instantly_campaign_id?: string | null;
729
+ launched_at?: string | null;
730
+ metadata?: Json;
731
+ name: string;
732
+ organization_id: string;
733
+ status?: string;
734
+ type?: string;
735
+ };
736
+ Update: {
737
+ batch_ids?: string[];
738
+ completed_at?: string | null;
739
+ config?: Json;
740
+ created_at?: string;
741
+ description?: string | null;
742
+ id?: string;
743
+ instantly_campaign_id?: string | null;
744
+ launched_at?: string | null;
745
+ metadata?: Json;
746
+ name?: string;
747
+ organization_id?: string;
748
+ status?: string;
749
+ type?: string;
750
+ };
751
+ Relationships: [
752
+ {
753
+ foreignKeyName: "acq_lists_organization_id_fkey";
754
+ columns: ["organization_id"];
755
+ isOneToOne: false;
756
+ referencedRelation: "organizations";
757
+ referencedColumns: ["id"];
758
+ }
759
+ ];
760
+ };
761
+ acq_seo_metrics: {
762
+ Row: {
763
+ ai_citations: Json | null;
764
+ avg_position: number | null;
765
+ clicks: number | null;
766
+ created_at: string;
767
+ cta_clicks: number | null;
768
+ ctr: number | null;
769
+ data_point_count: number | null;
770
+ faq_count: number | null;
771
+ form_submissions: number | null;
772
+ id: string;
773
+ impressions: number | null;
774
+ organization_id: string;
775
+ period: string;
776
+ quality_score: number | null;
777
+ readability: number | null;
778
+ scroll_100: number | null;
779
+ scroll_25: number | null;
780
+ scroll_50: number | null;
781
+ scroll_75: number | null;
782
+ seo_page_id: string;
783
+ word_count: number | null;
784
+ };
785
+ Insert: {
786
+ ai_citations?: Json | null;
787
+ avg_position?: number | null;
788
+ clicks?: number | null;
789
+ created_at?: string;
790
+ cta_clicks?: number | null;
791
+ ctr?: number | null;
792
+ data_point_count?: number | null;
793
+ faq_count?: number | null;
794
+ form_submissions?: number | null;
795
+ id?: string;
796
+ impressions?: number | null;
797
+ organization_id: string;
798
+ period: string;
799
+ quality_score?: number | null;
800
+ readability?: number | null;
801
+ scroll_100?: number | null;
802
+ scroll_25?: number | null;
803
+ scroll_50?: number | null;
804
+ scroll_75?: number | null;
805
+ seo_page_id: string;
806
+ word_count?: number | null;
807
+ };
808
+ Update: {
809
+ ai_citations?: Json | null;
810
+ avg_position?: number | null;
811
+ clicks?: number | null;
812
+ created_at?: string;
813
+ cta_clicks?: number | null;
814
+ ctr?: number | null;
815
+ data_point_count?: number | null;
816
+ faq_count?: number | null;
817
+ form_submissions?: number | null;
818
+ id?: string;
819
+ impressions?: number | null;
820
+ organization_id?: string;
821
+ period?: string;
822
+ quality_score?: number | null;
823
+ readability?: number | null;
824
+ scroll_100?: number | null;
825
+ scroll_25?: number | null;
826
+ scroll_50?: number | null;
827
+ scroll_75?: number | null;
828
+ seo_page_id?: string;
829
+ word_count?: number | null;
830
+ };
831
+ Relationships: [
832
+ {
833
+ foreignKeyName: "acq_seo_metrics_organization_id_fkey";
834
+ columns: ["organization_id"];
835
+ isOneToOne: false;
836
+ referencedRelation: "organizations";
837
+ referencedColumns: ["id"];
838
+ },
839
+ {
840
+ foreignKeyName: "acq_seo_metrics_seo_page_id_fkey";
841
+ columns: ["seo_page_id"];
842
+ isOneToOne: false;
843
+ referencedRelation: "acq_seo_pages";
844
+ referencedColumns: ["id"];
845
+ }
846
+ ];
847
+ };
848
+ acq_seo_pages: {
849
+ Row: {
850
+ city: string | null;
851
+ content: Json | null;
852
+ created_at: string;
853
+ faq_items: Json | null;
854
+ hero_image_url: string | null;
855
+ id: string;
856
+ internal_links: Json | null;
857
+ local_data: Json | null;
858
+ meta_description: string | null;
859
+ organization_id: string;
860
+ page_type: string;
861
+ published_at: string | null;
862
+ refreshed_at: string | null;
863
+ schema_markup: Json | null;
864
+ slug: string;
865
+ state: string | null;
866
+ status: string;
867
+ title: string;
868
+ updated_at: string;
869
+ use_case: string | null;
870
+ vertical: string;
871
+ };
872
+ Insert: {
873
+ city?: string | null;
874
+ content?: Json | null;
875
+ created_at?: string;
876
+ faq_items?: Json | null;
877
+ hero_image_url?: string | null;
878
+ id?: string;
879
+ internal_links?: Json | null;
880
+ local_data?: Json | null;
881
+ meta_description?: string | null;
882
+ organization_id: string;
883
+ page_type: string;
884
+ published_at?: string | null;
885
+ refreshed_at?: string | null;
886
+ schema_markup?: Json | null;
887
+ slug: string;
888
+ state?: string | null;
889
+ status?: string;
890
+ title: string;
891
+ updated_at?: string;
892
+ use_case?: string | null;
893
+ vertical: string;
894
+ };
895
+ Update: {
896
+ city?: string | null;
897
+ content?: Json | null;
898
+ created_at?: string;
899
+ faq_items?: Json | null;
900
+ hero_image_url?: string | null;
901
+ id?: string;
902
+ internal_links?: Json | null;
903
+ local_data?: Json | null;
904
+ meta_description?: string | null;
905
+ organization_id?: string;
906
+ page_type?: string;
907
+ published_at?: string | null;
908
+ refreshed_at?: string | null;
909
+ schema_markup?: Json | null;
910
+ slug?: string;
911
+ state?: string | null;
912
+ status?: string;
913
+ title?: string;
914
+ updated_at?: string;
915
+ use_case?: string | null;
916
+ vertical?: string;
917
+ };
918
+ Relationships: [
919
+ {
920
+ foreignKeyName: "acq_seo_pages_organization_id_fkey";
921
+ columns: ["organization_id"];
922
+ isOneToOne: false;
923
+ referencedRelation: "organizations";
924
+ referencedColumns: ["id"];
925
+ }
926
+ ];
927
+ };
928
+ acq_social_posts: {
929
+ Row: {
930
+ author_name: string;
931
+ author_url: string | null;
932
+ comments_count: number;
933
+ created_at: string;
934
+ discovered_at: string;
935
+ engagement_count: number;
936
+ feedback: string | null;
937
+ final_response: string | null;
938
+ fully_reviewed: boolean;
939
+ id: string;
940
+ initial_draft: string | null;
941
+ matched_keywords: string[];
942
+ matched_query: string | null;
943
+ metadata: Json;
944
+ organization_id: string;
945
+ platform: string;
946
+ platform_post_id: string;
947
+ post_text: string;
948
+ post_title: string;
949
+ post_url: string;
950
+ posted_at: string;
951
+ relevance_score: number;
952
+ responded_at: string | null;
953
+ reviewed_at: string | null;
954
+ skip_reason: string | null;
955
+ source_category: string | null;
956
+ status: string;
957
+ updated_at: string;
958
+ };
959
+ Insert: {
960
+ author_name: string;
961
+ author_url?: string | null;
962
+ comments_count?: number;
963
+ created_at?: string;
964
+ discovered_at?: string;
965
+ engagement_count?: number;
966
+ feedback?: string | null;
967
+ final_response?: string | null;
968
+ fully_reviewed?: boolean;
969
+ id?: string;
970
+ initial_draft?: string | null;
971
+ matched_keywords?: string[];
972
+ matched_query?: string | null;
973
+ metadata?: Json;
974
+ organization_id: string;
975
+ platform: string;
976
+ platform_post_id: string;
977
+ post_text: string;
978
+ post_title: string;
979
+ post_url: string;
980
+ posted_at: string;
981
+ relevance_score?: number;
982
+ responded_at?: string | null;
983
+ reviewed_at?: string | null;
984
+ skip_reason?: string | null;
985
+ source_category?: string | null;
986
+ status?: string;
987
+ updated_at?: string;
988
+ };
989
+ Update: {
990
+ author_name?: string;
991
+ author_url?: string | null;
992
+ comments_count?: number;
993
+ created_at?: string;
994
+ discovered_at?: string;
995
+ engagement_count?: number;
996
+ feedback?: string | null;
997
+ final_response?: string | null;
998
+ fully_reviewed?: boolean;
999
+ id?: string;
1000
+ initial_draft?: string | null;
1001
+ matched_keywords?: string[];
1002
+ matched_query?: string | null;
1003
+ metadata?: Json;
1004
+ organization_id?: string;
1005
+ platform?: string;
1006
+ platform_post_id?: string;
1007
+ post_text?: string;
1008
+ post_title?: string;
1009
+ post_url?: string;
1010
+ posted_at?: string;
1011
+ relevance_score?: number;
1012
+ responded_at?: string | null;
1013
+ reviewed_at?: string | null;
1014
+ skip_reason?: string | null;
1015
+ source_category?: string | null;
1016
+ status?: string;
1017
+ updated_at?: string;
1018
+ };
1019
+ Relationships: [
1020
+ {
1021
+ foreignKeyName: "acq_social_posts_organization_id_fkey";
1022
+ columns: ["organization_id"];
1023
+ isOneToOne: false;
1024
+ referencedRelation: "organizations";
1025
+ referencedColumns: ["id"];
1026
+ }
1027
+ ];
1028
+ };
1029
+ activities: {
1030
+ Row: {
1031
+ activity_type: string;
1032
+ actor_id: string | null;
1033
+ actor_type: string | null;
1034
+ created_at: string;
1035
+ description: string | null;
1036
+ entity_id: string;
1037
+ entity_name: string | null;
1038
+ entity_type: string;
1039
+ id: string;
1040
+ metadata: Json | null;
1041
+ occurred_at: string;
1042
+ organization_id: string;
1043
+ status: string;
1044
+ title: string;
1045
+ };
1046
+ Insert: {
1047
+ activity_type: string;
1048
+ actor_id?: string | null;
1049
+ actor_type?: string | null;
1050
+ created_at?: string;
1051
+ description?: string | null;
1052
+ entity_id: string;
1053
+ entity_name?: string | null;
1054
+ entity_type: string;
1055
+ id?: string;
1056
+ metadata?: Json | null;
1057
+ occurred_at?: string;
1058
+ organization_id: string;
1059
+ status: string;
1060
+ title: string;
1061
+ };
1062
+ Update: {
1063
+ activity_type?: string;
1064
+ actor_id?: string | null;
1065
+ actor_type?: string | null;
1066
+ created_at?: string;
1067
+ description?: string | null;
1068
+ entity_id?: string;
1069
+ entity_name?: string | null;
1070
+ entity_type?: string;
1071
+ id?: string;
1072
+ metadata?: Json | null;
1073
+ occurred_at?: string;
1074
+ organization_id?: string;
1075
+ status?: string;
1076
+ title?: string;
1077
+ };
1078
+ Relationships: [
1079
+ {
1080
+ foreignKeyName: "activities_organization_id_fkey";
1081
+ columns: ["organization_id"];
1082
+ isOneToOne: false;
1083
+ referencedRelation: "organizations";
1084
+ referencedColumns: ["id"];
1085
+ }
1086
+ ];
1087
+ };
1088
+ api_keys: {
1089
+ Row: {
1090
+ created_at: string | null;
1091
+ id: string;
1092
+ key_hash: string;
1093
+ last_used_at: string | null;
1094
+ name: string;
1095
+ organization_id: string;
1096
+ };
1097
+ Insert: {
1098
+ created_at?: string | null;
1099
+ id?: string;
1100
+ key_hash: string;
1101
+ last_used_at?: string | null;
1102
+ name: string;
1103
+ organization_id: string;
1104
+ };
1105
+ Update: {
1106
+ created_at?: string | null;
1107
+ id?: string;
1108
+ key_hash?: string;
1109
+ last_used_at?: string | null;
1110
+ name?: string;
1111
+ organization_id?: string;
1112
+ };
1113
+ Relationships: [
1114
+ {
1115
+ foreignKeyName: "api_keys_organization_id_fkey";
1116
+ columns: ["organization_id"];
1117
+ isOneToOne: false;
1118
+ referencedRelation: "organizations";
1119
+ referencedColumns: ["id"];
1120
+ }
1121
+ ];
1122
+ };
1123
+ calibration_projects: {
1124
+ Row: {
1125
+ created_at: string | null;
1126
+ description: string | null;
1127
+ id: string;
1128
+ name: string;
1129
+ organization_id: string;
1130
+ resource_id: string;
1131
+ resource_type: string;
1132
+ updated_at: string | null;
1133
+ };
1134
+ Insert: {
1135
+ created_at?: string | null;
1136
+ description?: string | null;
1137
+ id?: string;
1138
+ name: string;
1139
+ organization_id: string;
1140
+ resource_id: string;
1141
+ resource_type: string;
1142
+ updated_at?: string | null;
1143
+ };
1144
+ Update: {
1145
+ created_at?: string | null;
1146
+ description?: string | null;
1147
+ id?: string;
1148
+ name?: string;
1149
+ organization_id?: string;
1150
+ resource_id?: string;
1151
+ resource_type?: string;
1152
+ updated_at?: string | null;
1153
+ };
1154
+ Relationships: [
1155
+ {
1156
+ foreignKeyName: "calibration_projects_organization_id_fkey";
1157
+ columns: ["organization_id"];
1158
+ isOneToOne: false;
1159
+ referencedRelation: "organizations";
1160
+ referencedColumns: ["id"];
1161
+ }
1162
+ ];
1163
+ };
1164
+ calibration_runs: {
1165
+ Row: {
1166
+ completed_at: string | null;
1167
+ config_variants: Json;
1168
+ created_at: string | null;
1169
+ description: string | null;
1170
+ execution_mode: string;
1171
+ grader_model: string | null;
1172
+ grading_rubric: Json | null;
1173
+ id: string;
1174
+ name: string;
1175
+ organization_id: string;
1176
+ project_id: string;
1177
+ results: Json;
1178
+ status: string;
1179
+ test_inputs: Json;
1180
+ };
1181
+ Insert: {
1182
+ completed_at?: string | null;
1183
+ config_variants: Json;
1184
+ created_at?: string | null;
1185
+ description?: string | null;
1186
+ execution_mode?: string;
1187
+ grader_model?: string | null;
1188
+ grading_rubric?: Json | null;
1189
+ id?: string;
1190
+ name: string;
1191
+ organization_id: string;
1192
+ project_id: string;
1193
+ results?: Json;
1194
+ status?: string;
1195
+ test_inputs: Json;
1196
+ };
1197
+ Update: {
1198
+ completed_at?: string | null;
1199
+ config_variants?: Json;
1200
+ created_at?: string | null;
1201
+ description?: string | null;
1202
+ execution_mode?: string;
1203
+ grader_model?: string | null;
1204
+ grading_rubric?: Json | null;
1205
+ id?: string;
1206
+ name?: string;
1207
+ organization_id?: string;
1208
+ project_id?: string;
1209
+ results?: Json;
1210
+ status?: string;
1211
+ test_inputs?: Json;
1212
+ };
1213
+ Relationships: [
1214
+ {
1215
+ foreignKeyName: "calibration_runs_organization_id_fkey";
1216
+ columns: ["organization_id"];
1217
+ isOneToOne: false;
1218
+ referencedRelation: "organizations";
1219
+ referencedColumns: ["id"];
1220
+ },
1221
+ {
1222
+ foreignKeyName: "calibration_runs_project_id_fkey";
1223
+ columns: ["project_id"];
1224
+ isOneToOne: false;
1225
+ referencedRelation: "calibration_projects";
1226
+ referencedColumns: ["id"];
1227
+ }
1228
+ ];
1229
+ };
1230
+ command_queue: {
1231
+ Row: {
1232
+ action_payload: Json | null;
1233
+ actions: Json;
1234
+ completed_at: string | null;
1235
+ completed_by: string | null;
1236
+ context: Json;
1237
+ created_at: string;
1238
+ description: string | null;
1239
+ expires_at: string | null;
1240
+ human_checkpoint: string | null;
1241
+ id: string;
1242
+ idempotency_key: string | null;
1243
+ metadata: Json | null;
1244
+ organization_id: string;
1245
+ origin_execution_id: string;
1246
+ origin_resource_id: string;
1247
+ origin_resource_type: string;
1248
+ priority: number;
1249
+ selected_action: string | null;
1250
+ status: string;
1251
+ target_execution_id: string | null;
1252
+ target_resource_id: string | null;
1253
+ target_resource_type: string | null;
1254
+ };
1255
+ Insert: {
1256
+ action_payload?: Json | null;
1257
+ actions: Json;
1258
+ completed_at?: string | null;
1259
+ completed_by?: string | null;
1260
+ context: Json;
1261
+ created_at?: string;
1262
+ description?: string | null;
1263
+ expires_at?: string | null;
1264
+ human_checkpoint?: string | null;
1265
+ id?: string;
1266
+ idempotency_key?: string | null;
1267
+ metadata?: Json | null;
1268
+ organization_id: string;
1269
+ origin_execution_id: string;
1270
+ origin_resource_id: string;
1271
+ origin_resource_type: string;
1272
+ priority?: number;
1273
+ selected_action?: string | null;
1274
+ status?: string;
1275
+ target_execution_id?: string | null;
1276
+ target_resource_id?: string | null;
1277
+ target_resource_type?: string | null;
1278
+ };
1279
+ Update: {
1280
+ action_payload?: Json | null;
1281
+ actions?: Json;
1282
+ completed_at?: string | null;
1283
+ completed_by?: string | null;
1284
+ context?: Json;
1285
+ created_at?: string;
1286
+ description?: string | null;
1287
+ expires_at?: string | null;
1288
+ human_checkpoint?: string | null;
1289
+ id?: string;
1290
+ idempotency_key?: string | null;
1291
+ metadata?: Json | null;
1292
+ organization_id?: string;
1293
+ origin_execution_id?: string;
1294
+ origin_resource_id?: string;
1295
+ origin_resource_type?: string;
1296
+ priority?: number;
1297
+ selected_action?: string | null;
1298
+ status?: string;
1299
+ target_execution_id?: string | null;
1300
+ target_resource_id?: string | null;
1301
+ target_resource_type?: string | null;
1302
+ };
1303
+ Relationships: [
1304
+ {
1305
+ foreignKeyName: "command_queue_completed_by_fkey";
1306
+ columns: ["completed_by"];
1307
+ isOneToOne: false;
1308
+ referencedRelation: "users";
1309
+ referencedColumns: ["id"];
1310
+ },
1311
+ {
1312
+ foreignKeyName: "command_queue_organization_id_fkey";
1313
+ columns: ["organization_id"];
1314
+ isOneToOne: false;
1315
+ referencedRelation: "organizations";
1316
+ referencedColumns: ["id"];
1317
+ },
1318
+ {
1319
+ foreignKeyName: "command_queue_target_execution_id_fkey";
1320
+ columns: ["target_execution_id"];
1321
+ isOneToOne: false;
1322
+ referencedRelation: "execution_logs";
1323
+ referencedColumns: ["execution_id"];
1324
+ }
1325
+ ];
1326
+ };
1327
+ credentials: {
1328
+ Row: {
1329
+ created_at: string;
1330
+ created_by: string | null;
1331
+ encrypted_value: string;
1332
+ id: string;
1333
+ name: string;
1334
+ organization_id: string;
1335
+ provider: string | null;
1336
+ type: string;
1337
+ updated_at: string;
1338
+ };
1339
+ Insert: {
1340
+ created_at?: string;
1341
+ created_by?: string | null;
1342
+ encrypted_value: string;
1343
+ id?: string;
1344
+ name: string;
1345
+ organization_id: string;
1346
+ provider?: string | null;
1347
+ type?: string;
1348
+ updated_at?: string;
1349
+ };
1350
+ Update: {
1351
+ created_at?: string;
1352
+ created_by?: string | null;
1353
+ encrypted_value?: string;
1354
+ id?: string;
1355
+ name?: string;
1356
+ organization_id?: string;
1357
+ provider?: string | null;
1358
+ type?: string;
1359
+ updated_at?: string;
1360
+ };
1361
+ Relationships: [
1362
+ {
1363
+ foreignKeyName: "credentials_created_by_fkey";
1364
+ columns: ["created_by"];
1365
+ isOneToOne: false;
1366
+ referencedRelation: "users";
1367
+ referencedColumns: ["id"];
1368
+ },
1369
+ {
1370
+ foreignKeyName: "credentials_organization_id_fkey";
1371
+ columns: ["organization_id"];
1372
+ isOneToOne: false;
1373
+ referencedRelation: "organizations";
1374
+ referencedColumns: ["id"];
1375
+ }
1376
+ ];
1377
+ };
1378
+ deployments: {
1379
+ Row: {
1380
+ compiled_docs: Json | null;
1381
+ created_at: string;
1382
+ deployment_version: string | null;
1383
+ documentation: Json | null;
1384
+ error_message: string | null;
1385
+ id: string;
1386
+ organization_id: string;
1387
+ pid: number | null;
1388
+ port: number | null;
1389
+ sdk_version: string;
1390
+ status: string;
1391
+ tarball_path: string | null;
1392
+ updated_at: string;
1393
+ };
1394
+ Insert: {
1395
+ compiled_docs?: Json | null;
1396
+ created_at?: string;
1397
+ deployment_version?: string | null;
1398
+ documentation?: Json | null;
1399
+ error_message?: string | null;
1400
+ id?: string;
1401
+ organization_id: string;
1402
+ pid?: number | null;
1403
+ port?: number | null;
1404
+ sdk_version: string;
1405
+ status?: string;
1406
+ tarball_path?: string | null;
1407
+ updated_at?: string;
1408
+ };
1409
+ Update: {
1410
+ compiled_docs?: Json | null;
1411
+ created_at?: string;
1412
+ deployment_version?: string | null;
1413
+ documentation?: Json | null;
1414
+ error_message?: string | null;
1415
+ id?: string;
1416
+ organization_id?: string;
1417
+ pid?: number | null;
1418
+ port?: number | null;
1419
+ sdk_version?: string;
1420
+ status?: string;
1421
+ tarball_path?: string | null;
1422
+ updated_at?: string;
1423
+ };
1424
+ Relationships: [
1425
+ {
1426
+ foreignKeyName: "deployments_organization_id_fkey";
1427
+ columns: ["organization_id"];
1428
+ isOneToOne: false;
1429
+ referencedRelation: "organizations";
1430
+ referencedColumns: ["id"];
1431
+ }
1432
+ ];
1433
+ };
1434
+ execution_errors: {
1435
+ Row: {
1436
+ created_at: string | null;
1437
+ error_category: string;
1438
+ error_message: string;
1439
+ error_severity: string;
1440
+ error_stack_trace: string | null;
1441
+ error_type: string;
1442
+ execution_id: string;
1443
+ id: string;
1444
+ metadata: Json | null;
1445
+ occurred_at: string;
1446
+ organization_id: string;
1447
+ resolved: boolean;
1448
+ resolved_at: string | null;
1449
+ resolved_by: string | null;
1450
+ };
1451
+ Insert: {
1452
+ created_at?: string | null;
1453
+ error_category: string;
1454
+ error_message: string;
1455
+ error_severity: string;
1456
+ error_stack_trace?: string | null;
1457
+ error_type: string;
1458
+ execution_id: string;
1459
+ id?: string;
1460
+ metadata?: Json | null;
1461
+ occurred_at?: string;
1462
+ organization_id: string;
1463
+ resolved?: boolean;
1464
+ resolved_at?: string | null;
1465
+ resolved_by?: string | null;
1466
+ };
1467
+ Update: {
1468
+ created_at?: string | null;
1469
+ error_category?: string;
1470
+ error_message?: string;
1471
+ error_severity?: string;
1472
+ error_stack_trace?: string | null;
1473
+ error_type?: string;
1474
+ execution_id?: string;
1475
+ id?: string;
1476
+ metadata?: Json | null;
1477
+ occurred_at?: string;
1478
+ organization_id?: string;
1479
+ resolved?: boolean;
1480
+ resolved_at?: string | null;
1481
+ resolved_by?: string | null;
1482
+ };
1483
+ Relationships: [
1484
+ {
1485
+ foreignKeyName: "execution_errors_execution_id_fkey";
1486
+ columns: ["execution_id"];
1487
+ isOneToOne: false;
1488
+ referencedRelation: "execution_logs";
1489
+ referencedColumns: ["execution_id"];
1490
+ },
1491
+ {
1492
+ foreignKeyName: "execution_errors_organization_id_fkey";
1493
+ columns: ["organization_id"];
1494
+ isOneToOne: false;
1495
+ referencedRelation: "organizations";
1496
+ referencedColumns: ["id"];
1497
+ },
1498
+ {
1499
+ foreignKeyName: "execution_errors_resolved_by_fkey";
1500
+ columns: ["resolved_by"];
1501
+ isOneToOne: false;
1502
+ referencedRelation: "users";
1503
+ referencedColumns: ["id"];
1504
+ }
1505
+ ];
1506
+ };
1507
+ execution_logs: {
1508
+ Row: {
1509
+ api_version: string | null;
1510
+ completed_at: string | null;
1511
+ created_at: string | null;
1512
+ error: string | null;
1513
+ execution_id: string;
1514
+ input: Json | null;
1515
+ last_heartbeat_at: string | null;
1516
+ logs: Json | null;
1517
+ organization_id: string;
1518
+ origin_execution_id: string | null;
1519
+ output: Json | null;
1520
+ resource_id: string;
1521
+ resource_status: string;
1522
+ resource_type: string;
1523
+ resource_version: string | null;
1524
+ sdk_version: string | null;
1525
+ session_id: string | null;
1526
+ session_turn_number: number | null;
1527
+ started_at: string;
1528
+ status: string;
1529
+ trigger_type: string | null;
1530
+ updated_at: string | null;
1531
+ user_id: string | null;
1532
+ };
1533
+ Insert: {
1534
+ api_version?: string | null;
1535
+ completed_at?: string | null;
1536
+ created_at?: string | null;
1537
+ error?: string | null;
1538
+ execution_id?: string;
1539
+ input?: Json | null;
1540
+ last_heartbeat_at?: string | null;
1541
+ logs?: Json | null;
1542
+ organization_id: string;
1543
+ origin_execution_id?: string | null;
1544
+ output?: Json | null;
1545
+ resource_id: string;
1546
+ resource_status?: string;
1547
+ resource_type?: string;
1548
+ resource_version?: string | null;
1549
+ sdk_version?: string | null;
1550
+ session_id?: string | null;
1551
+ session_turn_number?: number | null;
1552
+ started_at?: string;
1553
+ status: string;
1554
+ trigger_type?: string | null;
1555
+ updated_at?: string | null;
1556
+ user_id?: string | null;
1557
+ };
1558
+ Update: {
1559
+ api_version?: string | null;
1560
+ completed_at?: string | null;
1561
+ created_at?: string | null;
1562
+ error?: string | null;
1563
+ execution_id?: string;
1564
+ input?: Json | null;
1565
+ last_heartbeat_at?: string | null;
1566
+ logs?: Json | null;
1567
+ organization_id?: string;
1568
+ origin_execution_id?: string | null;
1569
+ output?: Json | null;
1570
+ resource_id?: string;
1571
+ resource_status?: string;
1572
+ resource_type?: string;
1573
+ resource_version?: string | null;
1574
+ sdk_version?: string | null;
1575
+ session_id?: string | null;
1576
+ session_turn_number?: number | null;
1577
+ started_at?: string;
1578
+ status?: string;
1579
+ trigger_type?: string | null;
1580
+ updated_at?: string | null;
1581
+ user_id?: string | null;
1582
+ };
1583
+ Relationships: [
1584
+ {
1585
+ foreignKeyName: "execution_history_organization_id_fkey";
1586
+ columns: ["organization_id"];
1587
+ isOneToOne: false;
1588
+ referencedRelation: "organizations";
1589
+ referencedColumns: ["id"];
1590
+ },
1591
+ {
1592
+ foreignKeyName: "execution_logs_origin_execution_id_fkey";
1593
+ columns: ["origin_execution_id"];
1594
+ isOneToOne: false;
1595
+ referencedRelation: "execution_logs";
1596
+ referencedColumns: ["execution_id"];
1597
+ },
1598
+ {
1599
+ foreignKeyName: "execution_logs_session_id_fkey";
1600
+ columns: ["session_id"];
1601
+ isOneToOne: false;
1602
+ referencedRelation: "sessions";
1603
+ referencedColumns: ["session_id"];
1604
+ },
1605
+ {
1606
+ foreignKeyName: "execution_logs_user_id_fkey";
1607
+ columns: ["user_id"];
1608
+ isOneToOne: false;
1609
+ referencedRelation: "users";
1610
+ referencedColumns: ["id"];
1611
+ }
1612
+ ];
1613
+ };
1614
+ execution_metrics: {
1615
+ Row: {
1616
+ ai_call_count: number;
1617
+ ai_calls: Json | null;
1618
+ automation_savings_usd: number | null;
1619
+ created_at: string | null;
1620
+ duration_ms: number | null;
1621
+ execution_id: string;
1622
+ organization_id: string;
1623
+ resource_id: string;
1624
+ total_cost_usd: number;
1625
+ total_input_tokens: number;
1626
+ total_output_tokens: number;
1627
+ };
1628
+ Insert: {
1629
+ ai_call_count: number;
1630
+ ai_calls?: Json | null;
1631
+ automation_savings_usd?: number | null;
1632
+ created_at?: string | null;
1633
+ duration_ms?: number | null;
1634
+ execution_id: string;
1635
+ organization_id: string;
1636
+ resource_id: string;
1637
+ total_cost_usd: number;
1638
+ total_input_tokens: number;
1639
+ total_output_tokens: number;
1640
+ };
1641
+ Update: {
1642
+ ai_call_count?: number;
1643
+ ai_calls?: Json | null;
1644
+ automation_savings_usd?: number | null;
1645
+ created_at?: string | null;
1646
+ duration_ms?: number | null;
1647
+ execution_id?: string;
1648
+ organization_id?: string;
1649
+ resource_id?: string;
1650
+ total_cost_usd?: number;
1651
+ total_input_tokens?: number;
1652
+ total_output_tokens?: number;
1653
+ };
1654
+ Relationships: [
1655
+ {
1656
+ foreignKeyName: "execution_metrics_execution_id_fkey";
1657
+ columns: ["execution_id"];
1658
+ isOneToOne: true;
1659
+ referencedRelation: "execution_logs";
1660
+ referencedColumns: ["execution_id"];
1661
+ },
1662
+ {
1663
+ foreignKeyName: "execution_metrics_organization_id_fkey";
1664
+ columns: ["organization_id"];
1665
+ isOneToOne: false;
1666
+ referencedRelation: "organizations";
1667
+ referencedColumns: ["id"];
1668
+ }
1669
+ ];
1670
+ };
1671
+ notifications: {
1672
+ Row: {
1673
+ action_url: string | null;
1674
+ category: string;
1675
+ created_at: string | null;
1676
+ id: string;
1677
+ message: string;
1678
+ organization_id: string;
1679
+ read: boolean | null;
1680
+ read_at: string | null;
1681
+ title: string;
1682
+ user_id: string;
1683
+ };
1684
+ Insert: {
1685
+ action_url?: string | null;
1686
+ category: string;
1687
+ created_at?: string | null;
1688
+ id?: string;
1689
+ message: string;
1690
+ organization_id: string;
1691
+ read?: boolean | null;
1692
+ read_at?: string | null;
1693
+ title: string;
1694
+ user_id: string;
1695
+ };
1696
+ Update: {
1697
+ action_url?: string | null;
1698
+ category?: string;
1699
+ created_at?: string | null;
1700
+ id?: string;
1701
+ message?: string;
1702
+ organization_id?: string;
1703
+ read?: boolean | null;
1704
+ read_at?: string | null;
1705
+ title?: string;
1706
+ user_id?: string;
1707
+ };
1708
+ Relationships: [
1709
+ {
1710
+ foreignKeyName: "notifications_organization_id_fkey";
1711
+ columns: ["organization_id"];
1712
+ isOneToOne: false;
1713
+ referencedRelation: "organizations";
1714
+ referencedColumns: ["id"];
1715
+ },
1716
+ {
1717
+ foreignKeyName: "notifications_user_id_fkey";
1718
+ columns: ["user_id"];
1719
+ isOneToOne: false;
1720
+ referencedRelation: "users";
1721
+ referencedColumns: ["id"];
1722
+ }
1723
+ ];
1724
+ };
1725
+ org_invitations: {
1726
+ Row: {
1727
+ accept_invitation_url: string | null;
1728
+ accepted_at: string | null;
1729
+ created_at: string | null;
1730
+ email: string;
1731
+ expires_at: string;
1732
+ id: string;
1733
+ invitation_state: string | null;
1734
+ invitation_token: string | null;
1735
+ inviter_user_id: string | null;
1736
+ organization_id: string | null;
1737
+ revoked_at: string | null;
1738
+ role_slug: string | null;
1739
+ updated_at: string | null;
1740
+ workos_invitation_id: string;
1741
+ };
1742
+ Insert: {
1743
+ accept_invitation_url?: string | null;
1744
+ accepted_at?: string | null;
1745
+ created_at?: string | null;
1746
+ email: string;
1747
+ expires_at: string;
1748
+ id?: string;
1749
+ invitation_state?: string | null;
1750
+ invitation_token?: string | null;
1751
+ inviter_user_id?: string | null;
1752
+ organization_id?: string | null;
1753
+ revoked_at?: string | null;
1754
+ role_slug?: string | null;
1755
+ updated_at?: string | null;
1756
+ workos_invitation_id: string;
1757
+ };
1758
+ Update: {
1759
+ accept_invitation_url?: string | null;
1760
+ accepted_at?: string | null;
1761
+ created_at?: string | null;
1762
+ email?: string;
1763
+ expires_at?: string;
1764
+ id?: string;
1765
+ invitation_state?: string | null;
1766
+ invitation_token?: string | null;
1767
+ inviter_user_id?: string | null;
1768
+ organization_id?: string | null;
1769
+ revoked_at?: string | null;
1770
+ role_slug?: string | null;
1771
+ updated_at?: string | null;
1772
+ workos_invitation_id?: string;
1773
+ };
1774
+ Relationships: [
1775
+ {
1776
+ foreignKeyName: "org_invitations_inviter_user_id_fkey";
1777
+ columns: ["inviter_user_id"];
1778
+ isOneToOne: false;
1779
+ referencedRelation: "users";
1780
+ referencedColumns: ["id"];
1781
+ },
1782
+ {
1783
+ foreignKeyName: "org_invitations_organization_id_fkey";
1784
+ columns: ["organization_id"];
1785
+ isOneToOne: false;
1786
+ referencedRelation: "organizations";
1787
+ referencedColumns: ["id"];
1788
+ }
1789
+ ];
1790
+ };
1791
+ org_memberships: {
1792
+ Row: {
1793
+ config: Json;
1794
+ created_at: string | null;
1795
+ id: string;
1796
+ membership_status: string | null;
1797
+ organization_id: string;
1798
+ role_slug: string | null;
1799
+ updated_at: string | null;
1800
+ user_id: string;
1801
+ workos_membership_id: string | null;
1802
+ };
1803
+ Insert: {
1804
+ config?: Json;
1805
+ created_at?: string | null;
1806
+ id?: string;
1807
+ membership_status?: string | null;
1808
+ organization_id: string;
1809
+ role_slug?: string | null;
1810
+ updated_at?: string | null;
1811
+ user_id: string;
1812
+ workos_membership_id?: string | null;
1813
+ };
1814
+ Update: {
1815
+ config?: Json;
1816
+ created_at?: string | null;
1817
+ id?: string;
1818
+ membership_status?: string | null;
1819
+ organization_id?: string;
1820
+ role_slug?: string | null;
1821
+ updated_at?: string | null;
1822
+ user_id?: string;
1823
+ workos_membership_id?: string | null;
1824
+ };
1825
+ Relationships: [
1826
+ {
1827
+ foreignKeyName: "org_memberships_organization_id_fkey";
1828
+ columns: ["organization_id"];
1829
+ isOneToOne: false;
1830
+ referencedRelation: "organizations";
1831
+ referencedColumns: ["id"];
1832
+ },
1833
+ {
1834
+ foreignKeyName: "org_memberships_user_id_fkey";
1835
+ columns: ["user_id"];
1836
+ isOneToOne: false;
1837
+ referencedRelation: "users";
1838
+ referencedColumns: ["id"];
1839
+ }
1840
+ ];
1841
+ };
1842
+ organizations: {
1843
+ Row: {
1844
+ config: Json;
1845
+ created_at: string;
1846
+ id: string;
1847
+ is_test: boolean;
1848
+ metadata: Json;
1849
+ name: string;
1850
+ status: string;
1851
+ updated_at: string;
1852
+ workos_org_id: string;
1853
+ };
1854
+ Insert: {
1855
+ config?: Json;
1856
+ created_at?: string;
1857
+ id?: string;
1858
+ is_test?: boolean;
1859
+ metadata?: Json;
1860
+ name: string;
1861
+ status?: string;
1862
+ updated_at?: string;
1863
+ workos_org_id: string;
1864
+ };
1865
+ Update: {
1866
+ config?: Json;
1867
+ created_at?: string;
1868
+ id?: string;
1869
+ is_test?: boolean;
1870
+ metadata?: Json;
1871
+ name?: string;
1872
+ status?: string;
1873
+ updated_at?: string;
1874
+ workos_org_id?: string;
1875
+ };
1876
+ Relationships: [];
1877
+ };
1878
+ prj_milestones: {
1879
+ Row: {
1880
+ checklist: Json | null;
1881
+ completed_at: string | null;
1882
+ created_at: string;
1883
+ description: string | null;
1884
+ due_date: string | null;
1885
+ id: string;
1886
+ metadata: Json | null;
1887
+ name: string;
1888
+ organization_id: string;
1889
+ project_id: string;
1890
+ sequence: number;
1891
+ status: string;
1892
+ updated_at: string;
1893
+ };
1894
+ Insert: {
1895
+ checklist?: Json | null;
1896
+ completed_at?: string | null;
1897
+ created_at?: string;
1898
+ description?: string | null;
1899
+ due_date?: string | null;
1900
+ id?: string;
1901
+ metadata?: Json | null;
1902
+ name: string;
1903
+ organization_id: string;
1904
+ project_id: string;
1905
+ sequence?: number;
1906
+ status?: string;
1907
+ updated_at?: string;
1908
+ };
1909
+ Update: {
1910
+ checklist?: Json | null;
1911
+ completed_at?: string | null;
1912
+ created_at?: string;
1913
+ description?: string | null;
1914
+ due_date?: string | null;
1915
+ id?: string;
1916
+ metadata?: Json | null;
1917
+ name?: string;
1918
+ organization_id?: string;
1919
+ project_id?: string;
1920
+ sequence?: number;
1921
+ status?: string;
1922
+ updated_at?: string;
1923
+ };
1924
+ Relationships: [
1925
+ {
1926
+ foreignKeyName: "prj_milestones_organization_id_fkey";
1927
+ columns: ["organization_id"];
1928
+ isOneToOne: false;
1929
+ referencedRelation: "organizations";
1930
+ referencedColumns: ["id"];
1931
+ },
1932
+ {
1933
+ foreignKeyName: "prj_milestones_project_id_fkey";
1934
+ columns: ["project_id"];
1935
+ isOneToOne: false;
1936
+ referencedRelation: "prj_projects";
1937
+ referencedColumns: ["id"];
1938
+ }
1939
+ ];
1940
+ };
1941
+ prj_notes: {
1942
+ Row: {
1943
+ content: string;
1944
+ created_at: string;
1945
+ created_by: string | null;
1946
+ id: string;
1947
+ metadata: Json | null;
1948
+ milestone_id: string | null;
1949
+ occurred_at: string;
1950
+ organization_id: string;
1951
+ project_id: string;
1952
+ summary: string | null;
1953
+ task_id: string | null;
1954
+ type: string;
1955
+ };
1956
+ Insert: {
1957
+ content: string;
1958
+ created_at?: string;
1959
+ created_by?: string | null;
1960
+ id?: string;
1961
+ metadata?: Json | null;
1962
+ milestone_id?: string | null;
1963
+ occurred_at?: string;
1964
+ organization_id: string;
1965
+ project_id: string;
1966
+ summary?: string | null;
1967
+ task_id?: string | null;
1968
+ type?: string;
1969
+ };
1970
+ Update: {
1971
+ content?: string;
1972
+ created_at?: string;
1973
+ created_by?: string | null;
1974
+ id?: string;
1975
+ metadata?: Json | null;
1976
+ milestone_id?: string | null;
1977
+ occurred_at?: string;
1978
+ organization_id?: string;
1979
+ project_id?: string;
1980
+ summary?: string | null;
1981
+ task_id?: string | null;
1982
+ type?: string;
1983
+ };
1984
+ Relationships: [
1985
+ {
1986
+ foreignKeyName: "prj_notes_created_by_fkey";
1987
+ columns: ["created_by"];
1988
+ isOneToOne: false;
1989
+ referencedRelation: "users";
1990
+ referencedColumns: ["id"];
1991
+ },
1992
+ {
1993
+ foreignKeyName: "prj_notes_milestone_id_fkey";
1994
+ columns: ["milestone_id"];
1995
+ isOneToOne: false;
1996
+ referencedRelation: "prj_milestones";
1997
+ referencedColumns: ["id"];
1998
+ },
1999
+ {
2000
+ foreignKeyName: "prj_notes_organization_id_fkey";
2001
+ columns: ["organization_id"];
2002
+ isOneToOne: false;
2003
+ referencedRelation: "organizations";
2004
+ referencedColumns: ["id"];
2005
+ },
2006
+ {
2007
+ foreignKeyName: "prj_notes_project_id_fkey";
2008
+ columns: ["project_id"];
2009
+ isOneToOne: false;
2010
+ referencedRelation: "prj_projects";
2011
+ referencedColumns: ["id"];
2012
+ },
2013
+ {
2014
+ foreignKeyName: "prj_notes_task_id_fkey";
2015
+ columns: ["task_id"];
2016
+ isOneToOne: false;
2017
+ referencedRelation: "prj_tasks";
2018
+ referencedColumns: ["id"];
2019
+ }
2020
+ ];
2021
+ };
2022
+ prj_projects: {
2023
+ Row: {
2024
+ actual_end_date: string | null;
2025
+ client_company_id: string | null;
2026
+ contract_value: number | null;
2027
+ created_at: string;
2028
+ deal_id: string | null;
2029
+ description: string | null;
2030
+ id: string;
2031
+ kind: string;
2032
+ metadata: Json | null;
2033
+ name: string;
2034
+ organization_id: string;
2035
+ start_date: string | null;
2036
+ status: string;
2037
+ target_end_date: string | null;
2038
+ updated_at: string;
2039
+ };
2040
+ Insert: {
2041
+ actual_end_date?: string | null;
2042
+ client_company_id?: string | null;
2043
+ contract_value?: number | null;
2044
+ created_at?: string;
2045
+ deal_id?: string | null;
2046
+ description?: string | null;
2047
+ id?: string;
2048
+ kind?: string;
2049
+ metadata?: Json | null;
2050
+ name: string;
2051
+ organization_id: string;
2052
+ start_date?: string | null;
2053
+ status?: string;
2054
+ target_end_date?: string | null;
2055
+ updated_at?: string;
2056
+ };
2057
+ Update: {
2058
+ actual_end_date?: string | null;
2059
+ client_company_id?: string | null;
2060
+ contract_value?: number | null;
2061
+ created_at?: string;
2062
+ deal_id?: string | null;
2063
+ description?: string | null;
2064
+ id?: string;
2065
+ kind?: string;
2066
+ metadata?: Json | null;
2067
+ name?: string;
2068
+ organization_id?: string;
2069
+ start_date?: string | null;
2070
+ status?: string;
2071
+ target_end_date?: string | null;
2072
+ updated_at?: string;
2073
+ };
2074
+ Relationships: [
2075
+ {
2076
+ foreignKeyName: "prj_projects_client_company_id_fkey";
2077
+ columns: ["client_company_id"];
2078
+ isOneToOne: false;
2079
+ referencedRelation: "acq_companies";
2080
+ referencedColumns: ["id"];
2081
+ },
2082
+ {
2083
+ foreignKeyName: "prj_projects_deal_id_fkey";
2084
+ columns: ["deal_id"];
2085
+ isOneToOne: false;
2086
+ referencedRelation: "acq_deals";
2087
+ referencedColumns: ["id"];
2088
+ },
2089
+ {
2090
+ foreignKeyName: "prj_projects_organization_id_fkey";
2091
+ columns: ["organization_id"];
2092
+ isOneToOne: false;
2093
+ referencedRelation: "organizations";
2094
+ referencedColumns: ["id"];
2095
+ }
2096
+ ];
2097
+ };
2098
+ prj_tasks: {
2099
+ Row: {
2100
+ checklist: Json;
2101
+ completed_at: string | null;
2102
+ created_at: string;
2103
+ description: string | null;
2104
+ due_date: string | null;
2105
+ file_url: string | null;
2106
+ id: string;
2107
+ metadata: Json | null;
2108
+ milestone_id: string | null;
2109
+ name: string;
2110
+ organization_id: string;
2111
+ parent_task_id: string | null;
2112
+ project_id: string;
2113
+ resume_context: Json | null;
2114
+ status: string;
2115
+ type: string;
2116
+ updated_at: string;
2117
+ };
2118
+ Insert: {
2119
+ checklist?: Json;
2120
+ completed_at?: string | null;
2121
+ created_at?: string;
2122
+ description?: string | null;
2123
+ due_date?: string | null;
2124
+ file_url?: string | null;
2125
+ id?: string;
2126
+ metadata?: Json | null;
2127
+ milestone_id?: string | null;
2128
+ name: string;
2129
+ organization_id: string;
2130
+ parent_task_id?: string | null;
2131
+ project_id: string;
2132
+ resume_context?: Json | null;
2133
+ status?: string;
2134
+ type?: string;
2135
+ updated_at?: string;
2136
+ };
2137
+ Update: {
2138
+ checklist?: Json;
2139
+ completed_at?: string | null;
2140
+ created_at?: string;
2141
+ description?: string | null;
2142
+ due_date?: string | null;
2143
+ file_url?: string | null;
2144
+ id?: string;
2145
+ metadata?: Json | null;
2146
+ milestone_id?: string | null;
2147
+ name?: string;
2148
+ organization_id?: string;
2149
+ parent_task_id?: string | null;
2150
+ project_id?: string;
2151
+ resume_context?: Json | null;
2152
+ status?: string;
2153
+ type?: string;
2154
+ updated_at?: string;
2155
+ };
2156
+ Relationships: [
2157
+ {
2158
+ foreignKeyName: "prj_tasks_milestone_id_fkey";
2159
+ columns: ["milestone_id"];
2160
+ isOneToOne: false;
2161
+ referencedRelation: "prj_milestones";
2162
+ referencedColumns: ["id"];
2163
+ },
2164
+ {
2165
+ foreignKeyName: "prj_tasks_organization_id_fkey";
2166
+ columns: ["organization_id"];
2167
+ isOneToOne: false;
2168
+ referencedRelation: "organizations";
2169
+ referencedColumns: ["id"];
2170
+ },
2171
+ {
2172
+ foreignKeyName: "prj_tasks_parent_task_id_fkey";
2173
+ columns: ["parent_task_id"];
2174
+ isOneToOne: false;
2175
+ referencedRelation: "prj_tasks";
2176
+ referencedColumns: ["id"];
2177
+ },
2178
+ {
2179
+ foreignKeyName: "prj_tasks_project_id_fkey";
2180
+ columns: ["project_id"];
2181
+ isOneToOne: false;
2182
+ referencedRelation: "prj_projects";
2183
+ referencedColumns: ["id"];
2184
+ }
2185
+ ];
2186
+ };
2187
+ session_messages: {
2188
+ Row: {
2189
+ created_at: string | null;
2190
+ id: string;
2191
+ message: string;
2192
+ message_index: number | null;
2193
+ message_type: string | null;
2194
+ metadata: Json | null;
2195
+ role: string;
2196
+ session_id: string;
2197
+ session_turn_number: number;
2198
+ };
2199
+ Insert: {
2200
+ created_at?: string | null;
2201
+ id: string;
2202
+ message: string;
2203
+ message_index?: number | null;
2204
+ message_type?: string | null;
2205
+ metadata?: Json | null;
2206
+ role: string;
2207
+ session_id: string;
2208
+ session_turn_number: number;
2209
+ };
2210
+ Update: {
2211
+ created_at?: string | null;
2212
+ id?: string;
2213
+ message?: string;
2214
+ message_index?: number | null;
2215
+ message_type?: string | null;
2216
+ metadata?: Json | null;
2217
+ role?: string;
2218
+ session_id?: string;
2219
+ session_turn_number?: number;
2220
+ };
2221
+ Relationships: [
2222
+ {
2223
+ foreignKeyName: "session_messages_session_id_fkey";
2224
+ columns: ["session_id"];
2225
+ isOneToOne: false;
2226
+ referencedRelation: "sessions";
2227
+ referencedColumns: ["session_id"];
2228
+ }
2229
+ ];
2230
+ };
2231
+ sessions: {
2232
+ Row: {
2233
+ context_window_size: number;
2234
+ created_at: string | null;
2235
+ cumulative_input_tokens: number;
2236
+ cumulative_output_tokens: number;
2237
+ deleted_at: string | null;
2238
+ ended_at: string | null;
2239
+ memory_snapshot: Json;
2240
+ metadata: Json | null;
2241
+ organization_id: string;
2242
+ resource_id: string;
2243
+ session_id: string;
2244
+ session_total_turns: number | null;
2245
+ updated_at: string | null;
2246
+ user_id: string | null;
2247
+ };
2248
+ Insert: {
2249
+ context_window_size?: number;
2250
+ created_at?: string | null;
2251
+ cumulative_input_tokens?: number;
2252
+ cumulative_output_tokens?: number;
2253
+ deleted_at?: string | null;
2254
+ ended_at?: string | null;
2255
+ memory_snapshot: Json;
2256
+ metadata?: Json | null;
2257
+ organization_id: string;
2258
+ resource_id: string;
2259
+ session_id?: string;
2260
+ session_total_turns?: number | null;
2261
+ updated_at?: string | null;
2262
+ user_id?: string | null;
2263
+ };
2264
+ Update: {
2265
+ context_window_size?: number;
2266
+ created_at?: string | null;
2267
+ cumulative_input_tokens?: number;
2268
+ cumulative_output_tokens?: number;
2269
+ deleted_at?: string | null;
2270
+ ended_at?: string | null;
2271
+ memory_snapshot?: Json;
2272
+ metadata?: Json | null;
2273
+ organization_id?: string;
2274
+ resource_id?: string;
2275
+ session_id?: string;
2276
+ session_total_turns?: number | null;
2277
+ updated_at?: string | null;
2278
+ user_id?: string | null;
2279
+ };
2280
+ Relationships: [
2281
+ {
2282
+ foreignKeyName: "fk_organization";
2283
+ columns: ["organization_id"];
2284
+ isOneToOne: false;
2285
+ referencedRelation: "organizations";
2286
+ referencedColumns: ["id"];
2287
+ },
2288
+ {
2289
+ foreignKeyName: "fk_user";
2290
+ columns: ["user_id"];
2291
+ isOneToOne: false;
2292
+ referencedRelation: "users";
2293
+ referencedColumns: ["id"];
2294
+ }
2295
+ ];
2296
+ };
2297
+ task_schedules: {
2298
+ Row: {
2299
+ created_at: string;
2300
+ current_step: number;
2301
+ description: string | null;
2302
+ id: string;
2303
+ idempotency_key: string | null;
2304
+ last_execution_id: string | null;
2305
+ last_run_at: string | null;
2306
+ max_retries: number;
2307
+ metadata: Json | null;
2308
+ name: string;
2309
+ next_run_at: string | null;
2310
+ organization_id: string;
2311
+ origin_execution_id: string | null;
2312
+ origin_resource_id: string | null;
2313
+ origin_resource_type: string | null;
2314
+ retry_count: number;
2315
+ schedule_config: Json;
2316
+ status: string;
2317
+ target_resource_id: string;
2318
+ target_resource_type: string;
2319
+ updated_at: string;
2320
+ };
2321
+ Insert: {
2322
+ created_at?: string;
2323
+ current_step?: number;
2324
+ description?: string | null;
2325
+ id?: string;
2326
+ idempotency_key?: string | null;
2327
+ last_execution_id?: string | null;
2328
+ last_run_at?: string | null;
2329
+ max_retries?: number;
2330
+ metadata?: Json | null;
2331
+ name: string;
2332
+ next_run_at?: string | null;
2333
+ organization_id: string;
2334
+ origin_execution_id?: string | null;
2335
+ origin_resource_id?: string | null;
2336
+ origin_resource_type?: string | null;
2337
+ retry_count?: number;
2338
+ schedule_config: Json;
2339
+ status?: string;
2340
+ target_resource_id: string;
2341
+ target_resource_type: string;
2342
+ updated_at?: string;
2343
+ };
2344
+ Update: {
2345
+ created_at?: string;
2346
+ current_step?: number;
2347
+ description?: string | null;
2348
+ id?: string;
2349
+ idempotency_key?: string | null;
2350
+ last_execution_id?: string | null;
2351
+ last_run_at?: string | null;
2352
+ max_retries?: number;
2353
+ metadata?: Json | null;
2354
+ name?: string;
2355
+ next_run_at?: string | null;
2356
+ organization_id?: string;
2357
+ origin_execution_id?: string | null;
2358
+ origin_resource_id?: string | null;
2359
+ origin_resource_type?: string | null;
2360
+ retry_count?: number;
2361
+ schedule_config?: Json;
2362
+ status?: string;
2363
+ target_resource_id?: string;
2364
+ target_resource_type?: string;
2365
+ updated_at?: string;
2366
+ };
2367
+ Relationships: [
2368
+ {
2369
+ foreignKeyName: "task_schedules_organization_id_fkey";
2370
+ columns: ["organization_id"];
2371
+ isOneToOne: false;
2372
+ referencedRelation: "organizations";
2373
+ referencedColumns: ["id"];
2374
+ }
2375
+ ];
2376
+ };
2377
+ users: {
2378
+ Row: {
2379
+ config: Json;
2380
+ created_at: string;
2381
+ display_name: string | null;
2382
+ email: string;
2383
+ first_name: string | null;
2384
+ id: string;
2385
+ is_active: boolean;
2386
+ is_platform_admin: boolean | null;
2387
+ last_login_at: string | null;
2388
+ last_name: string | null;
2389
+ last_visited_org: string | null;
2390
+ profile_picture_url: string | null;
2391
+ updated_at: string;
2392
+ workos_user_id: string | null;
2393
+ };
2394
+ Insert: {
2395
+ config?: Json;
2396
+ created_at?: string;
2397
+ display_name?: string | null;
2398
+ email: string;
2399
+ first_name?: string | null;
2400
+ id?: string;
2401
+ is_active?: boolean;
2402
+ is_platform_admin?: boolean | null;
2403
+ last_login_at?: string | null;
2404
+ last_name?: string | null;
2405
+ last_visited_org?: string | null;
2406
+ profile_picture_url?: string | null;
2407
+ updated_at?: string;
2408
+ workos_user_id?: string | null;
2409
+ };
2410
+ Update: {
2411
+ config?: Json;
2412
+ created_at?: string;
2413
+ display_name?: string | null;
2414
+ email?: string;
2415
+ first_name?: string | null;
2416
+ id?: string;
2417
+ is_active?: boolean;
2418
+ is_platform_admin?: boolean | null;
2419
+ last_login_at?: string | null;
2420
+ last_name?: string | null;
2421
+ last_visited_org?: string | null;
2422
+ profile_picture_url?: string | null;
2423
+ updated_at?: string;
2424
+ workos_user_id?: string | null;
2425
+ };
2426
+ Relationships: [
2427
+ {
2428
+ foreignKeyName: "user_profiles_last_visited_org_fkey";
2429
+ columns: ["last_visited_org"];
2430
+ isOneToOne: false;
2431
+ referencedRelation: "organizations";
2432
+ referencedColumns: ["id"];
2433
+ }
2434
+ ];
2435
+ };
2436
+ webhook_endpoints: {
2437
+ Row: {
2438
+ created_at: string;
2439
+ description: string | null;
2440
+ id: string;
2441
+ key: string;
2442
+ last_triggered_at: string | null;
2443
+ name: string;
2444
+ organization_id: string;
2445
+ request_count: number;
2446
+ resource_id: string | null;
2447
+ status: string;
2448
+ updated_at: string;
2449
+ };
2450
+ Insert: {
2451
+ created_at?: string;
2452
+ description?: string | null;
2453
+ id?: string;
2454
+ key: string;
2455
+ last_triggered_at?: string | null;
2456
+ name: string;
2457
+ organization_id: string;
2458
+ request_count?: number;
2459
+ resource_id?: string | null;
2460
+ status?: string;
2461
+ updated_at?: string;
2462
+ };
2463
+ Update: {
2464
+ created_at?: string;
2465
+ description?: string | null;
2466
+ id?: string;
2467
+ key?: string;
2468
+ last_triggered_at?: string | null;
2469
+ name?: string;
2470
+ organization_id?: string;
2471
+ request_count?: number;
2472
+ resource_id?: string | null;
2473
+ status?: string;
2474
+ updated_at?: string;
2475
+ };
2476
+ Relationships: [
2477
+ {
2478
+ foreignKeyName: "webhook_endpoints_organization_id_fkey";
2479
+ columns: ["organization_id"];
2480
+ isOneToOne: false;
2481
+ referencedRelation: "organizations";
2482
+ referencedColumns: ["id"];
2483
+ }
2484
+ ];
2485
+ };
2486
+ };
2487
+ Views: {
2488
+ [_ in never]: never;
2489
+ };
2490
+ Functions: {
2491
+ acq_default_checklist: {
2492
+ Args: {
2493
+ p_platform: string;
2494
+ };
2495
+ Returns: Json;
2496
+ };
2497
+ append_deal_activity: {
2498
+ Args: {
2499
+ p_activity: Json;
2500
+ p_deal_id: string;
2501
+ p_organization_id: string;
2502
+ };
2503
+ Returns: undefined;
2504
+ };
2505
+ auth_jwt_claims: {
2506
+ Args: never;
2507
+ Returns: Json;
2508
+ };
2509
+ auth_uid_safe: {
2510
+ Args: never;
2511
+ Returns: string;
2512
+ };
2513
+ current_user_is_platform_admin: {
2514
+ Args: never;
2515
+ Returns: boolean;
2516
+ };
2517
+ current_user_supabase_id: {
2518
+ Args: never;
2519
+ Returns: string;
2520
+ };
2521
+ detect_stalled_executions: {
2522
+ Args: never;
2523
+ Returns: undefined;
2524
+ };
2525
+ execute_session_turn: {
2526
+ Args: {
2527
+ p_session_id: string;
2528
+ };
2529
+ Returns: {
2530
+ created_at: string;
2531
+ ended_at: string;
2532
+ memory_snapshot: Json;
2533
+ metadata: Json;
2534
+ organization_id: string;
2535
+ resource_id: string;
2536
+ session_id: string;
2537
+ session_total_turns: number;
2538
+ updated_at: string;
2539
+ user_id: string;
2540
+ }[];
2541
+ };
2542
+ get_storage_org_id: {
2543
+ Args: {
2544
+ file_path: string;
2545
+ };
2546
+ Returns: string;
2547
+ };
2548
+ get_workos_user_id: {
2549
+ Args: never;
2550
+ Returns: string;
2551
+ };
2552
+ is_org_admin: {
2553
+ Args: {
2554
+ org_id: string;
2555
+ };
2556
+ Returns: boolean;
2557
+ };
2558
+ is_org_member: {
2559
+ Args: {
2560
+ org_id: string;
2561
+ };
2562
+ Returns: boolean;
2563
+ };
2564
+ link_workos_membership_on_accept: {
2565
+ Args: {
2566
+ p_email: string;
2567
+ p_organization_id: string;
2568
+ p_workos_membership_id: string;
2569
+ };
2570
+ Returns: boolean;
2571
+ };
2572
+ pre_provision_invited_user: {
2573
+ Args: {
2574
+ p_email: string;
2575
+ p_organization_id: string;
2576
+ p_role_slug?: string;
2577
+ };
2578
+ Returns: Json;
2579
+ };
2580
+ process_due_schedules: {
2581
+ Args: never;
2582
+ Returns: Json;
2583
+ };
2584
+ upsert_user_profile: {
2585
+ Args: never;
2586
+ Returns: {
2587
+ profile_display_name: string;
2588
+ profile_email: string;
2589
+ profile_id: string;
2590
+ profile_workos_user_id: string;
2591
+ }[];
2592
+ };
2593
+ };
2594
+ Enums: {
2595
+ [_ in never]: never;
2596
+ };
2597
+ CompositeTypes: {
2598
+ [_ in never]: never;
2599
+ };
2600
+ };
2601
+ };
2602
+
2603
+ /** Raw database row type for acq_deals table */
2604
+ type AcqDealRow = Database['public']['Tables']['acq_deals']['Row'];
2605
+ type DealStage = 'interested' | 'proposal' | 'closing' | 'closed_won' | 'closed_lost' | 'nurturing';
2606
+ interface DealContact {
2607
+ id: string;
2608
+ first_name: string | null;
2609
+ last_name: string | null;
2610
+ email: string;
2611
+ title: string | null;
2612
+ headline: string | null;
2613
+ linkedin_url: string | null;
2614
+ pipeline_status: Record<string, unknown> | null;
2615
+ enrichment_data: Record<string, unknown> | null;
2616
+ company: {
2617
+ id: string;
2618
+ name: string;
2619
+ domain: string | null;
2620
+ website: string | null;
2621
+ linkedin_url: string | null;
2622
+ segment: string | null;
2623
+ category: string | null;
2624
+ num_employees: number | null;
2625
+ } | null;
2626
+ }
2627
+ interface DealFilters {
2628
+ stage?: DealStage;
2629
+ search?: string;
2630
+ }
2631
+ /** Deal list item with joined contact and company data */
2632
+ interface DealListItem extends AcqDealRow {
2633
+ contact: DealContact | null;
2634
+ }
2635
+ type DealDetail = DealListItem;
2636
+
2637
+ interface PipelineStageSummary {
2638
+ stage: DealStage;
2639
+ count: number;
2640
+ totalValue: number;
2641
+ }
2642
+ declare const PIPELINE_FUNNEL_ORDER: DealStage[];
2643
+ declare function useCrmPipelineSummary(opts?: {
2644
+ getDealValue?: (deal: DealListItem) => number;
2645
+ }): {
2646
+ data: PipelineStageSummary[];
2647
+ isLoading: boolean;
2648
+ error: unknown;
2649
+ };
2650
+
2651
+ interface CrmQuickMetrics {
2652
+ totalDeals: number;
2653
+ openDeals: number;
2654
+ wonDeals: number;
2655
+ winRate: number;
2656
+ avgDealSize: number;
2657
+ totalPipelineValue: number;
2658
+ }
2659
+ declare function useCrmQuickMetrics(): {
2660
+ data: CrmQuickMetrics;
2661
+ isLoading: boolean;
2662
+ error: unknown;
2663
+ };
2664
+
2665
+ /**
2666
+ * CRM Overview API Schemas
2667
+ *
2668
+ * Request/response validation for /api/crm surface.
2669
+ * Covers recent activity feeds sourced from acq_deal_notes and deal
2670
+ * activity_log entries.
2671
+ *
2672
+ * The CrmActivityEntry discriminated union mirrors the CrmActivityEntry
2673
+ * interface defined in:
2674
+ * packages/ui/src/features/acquisition/overview/hooks/useRecentCrmActivity.ts
2675
+ */
2676
+
2677
+ // ---------------------------------------------------------------------------
2678
+ // Enum literals
2679
+ // ---------------------------------------------------------------------------
2680
+
2681
+ declare const CrmActivityKindSchema = z.enum(['note', 'stage_change', 'deal_created'])
2682
+
2683
+ // ---------------------------------------------------------------------------
2684
+ // Activity entry shapes
2685
+ // ---------------------------------------------------------------------------
2686
+
2687
+ /**
2688
+ * A single CRM activity entry (note, stage change, or deal creation).
2689
+ * Matches the CrmActivityEntry interface from useRecentCrmActivity.ts.
2690
+ */
2691
+ declare const RecentActivityEntrySchema = z.object({
2692
+ id: z.string(),
2693
+ kind: CrmActivityKindSchema,
2694
+ dealId: z.string(),
2695
+ occurredAt: z.string(),
2696
+ description: z.string(),
2697
+ contactName: z.string().nullable().optional(),
2698
+ companyName: z.string().nullable().optional(),
2699
+ stage: z.string().nullable().optional()
2700
+ })
2701
+
2702
+ // ---------------------------------------------------------------------------
2703
+ // Response schemas (no .strict() — forward-compatible)
2704
+ // ---------------------------------------------------------------------------
2705
+
2706
+ declare const GetRecentActivityResponseSchema = z.object({
2707
+ entries: z.array(RecentActivityEntrySchema)
2708
+ })
2709
+
2710
+ // ---------------------------------------------------------------------------
2711
+ // Inferred types
2712
+ // ---------------------------------------------------------------------------
2713
+
2714
+ type CrmActivityKind = z.infer<typeof CrmActivityKindSchema>
2715
+ type RecentActivityEntry = z.infer<typeof RecentActivityEntrySchema>
2716
+ type GetRecentActivityResponse = z.infer<typeof GetRecentActivityResponseSchema>
2717
+
2718
+ declare function useRecentCrmActivity(opts?: {
2719
+ limit?: number;
2720
+ }): {
2721
+ data: GetRecentActivityResponse['entries'];
2722
+ isLoading: boolean;
2723
+ error: unknown;
2724
+ };
2725
+
2726
+ interface PipelineFunnelWidgetProps {
2727
+ onStageClick: (stage: DealStage) => void;
2728
+ getDealValue?: (deal: DealListItem) => number;
2729
+ }
2730
+ declare function PipelineFunnelWidget({ onStageClick, getDealValue }: PipelineFunnelWidgetProps): react_jsx_runtime.JSX.Element;
2731
+
2732
+ interface TasksDueWidgetProps {
2733
+ onTaskClick: (dealId: string) => void;
2734
+ onSeeAll?: () => void;
2735
+ }
2736
+ declare function TasksDueWidget({ onTaskClick, onSeeAll }: TasksDueWidgetProps): react_jsx_runtime.JSX.Element;
2737
+
2738
+ interface ActivityFeedWidgetProps {
2739
+ onDealClick: (dealId: string) => void;
2740
+ limit?: number;
2741
+ }
2742
+ declare function ActivityFeedWidget({ onDealClick, limit }: ActivityFeedWidgetProps): react_jsx_runtime.JSX.Element;
2743
+
2744
+ declare function MetricsStrip(): react_jsx_runtime.JSX.Element;
2745
+
2746
+ interface CrmOverviewProps {
2747
+ onStageClick: (stage: DealStage) => void;
2748
+ onDealClick: (dealId: string) => void;
2749
+ onGoToPipeline: () => void;
2750
+ getDealValue?: (deal: DealListItem) => number;
2751
+ renderActions?: () => ReactNode;
2752
+ }
2753
+ declare function CrmOverview({ onStageClick, onDealClick, onGoToPipeline, getDealValue, renderActions }: CrmOverviewProps): react_jsx_runtime.JSX.Element;
2754
+
2755
+ interface SavedViewPreset {
2756
+ id: string;
2757
+ label: string;
2758
+ iconName: 'IconUser' | 'IconClockExclamation' | 'IconTrophy';
2759
+ target: '/crm/pipeline' | '/crm/deals';
2760
+ urlFilters?: DealFilters;
2761
+ }
2762
+ declare const SAVED_VIEW_PRESETS: SavedViewPreset[];
2763
+
2764
+ interface MyTasksPanelProps {
2765
+ onTaskClick: (dealId: string) => void;
2766
+ onSeeAll?: () => void;
2767
+ footer?: ReactNode;
2768
+ showSectionLabel?: boolean;
2769
+ }
2770
+ declare function MyTasksPanel({ onTaskClick, onSeeAll, footer, showSectionLabel }: MyTasksPanelProps): react_jsx_runtime.JSX.Element;
2771
+
2772
+ interface SavedViewsPanelProps {
2773
+ onViewClick: (preset: SavedViewPreset) => void;
2774
+ showSectionLabel?: boolean;
2775
+ }
2776
+ declare function SavedViewsPanel({ onViewClick, showSectionLabel }: SavedViewsPanelProps): react_jsx_runtime.JSX.Element;
2777
+
2778
+ interface QuickCreateActionsProps {
2779
+ /** Retained for compatibility; the shared sidebar no longer exposes a New Deal action. */
2780
+ onNewDeal?: () => void;
2781
+ showSectionLabel?: boolean;
2782
+ }
2783
+ declare function QuickCreateActions({ showSectionLabel }: QuickCreateActionsProps): react_jsx_runtime.JSX.Element;
2784
+
2785
+ interface FeatureNavLink {
2786
+ label: string;
2787
+ link: string;
2788
+ featureKey?: string;
2789
+ onClick?: () => void;
2790
+ links?: FeatureNavLink[];
2791
+ }
2792
+ interface FeatureNavEntry {
2793
+ label: string;
2794
+ icon: ComponentType;
2795
+ link?: string;
2796
+ featureKey?: string;
2797
+ requiresAdmin?: boolean;
2798
+ dataOnboardingTourId?: string;
2799
+ links?: FeatureNavLink[];
2800
+ }
2801
+ type FeatureSidebarComponent = ComponentType;
2802
+ interface FeatureModule {
2803
+ key: string;
2804
+ label?: string;
2805
+ navEntry?: FeatureNavEntry;
2806
+ sidebar?: FeatureSidebarComponent;
2807
+ subshellRoutes?: string[];
2808
+ organizationGraph?: OrganizationGraphFeatureBridge;
2809
+ }
2810
+ interface OrganizationGraphFeatureBridge {
2811
+ surfaceId: string;
2812
+ }
2813
+
2814
+ declare const crmManifest: FeatureModule;
2815
+
2816
+ declare const DEAL_STAGE_COLORS: Record<string, string>;
2817
+ declare const DEAL_STAGE_OPTIONS: {
2818
+ value: DealStage;
2819
+ label: string;
2820
+ }[];
2821
+ declare function formatDealStageLabel(stage: string | null): string;
2822
+
2823
+ declare function DealsListPage(): react_jsx_runtime.JSX.Element;
2824
+
2825
+ interface DealDetailPageProps {
2826
+ dealId: string;
2827
+ renderActions?: (deal: DealDetail) => ReactNode;
2828
+ onDealLoaded?: (deal: DealDetail) => void;
2829
+ }
2830
+ declare function DealDetailPage({ dealId, renderActions, onDealLoaded }: DealDetailPageProps): react_jsx_runtime.JSX.Element;
2831
+
2832
+ export { ActivityFeedWidget, CrmOverview, CrmSidebar, CrmSidebarMiddle, CrmSidebarTop, DEAL_STAGE_COLORS, DEAL_STAGE_OPTIONS, DealDetailPage, DealsListPage, MetricsStrip, MyTasksPanel, PIPELINE_FUNNEL_ORDER, PipelineFunnelWidget, QuickCreateActions, SAVED_VIEW_PRESETS, SavedViewsPanel, TasksDueWidget, crmManifest, formatDealStageLabel, useCrmPipelineSummary, useCrmQuickMetrics, useRecentCrmActivity };
2833
+ export type { ActivityFeedWidgetProps, RecentActivityEntry as CrmActivityEntry, CrmActivityKind, CrmOverviewProps, CrmQuickMetrics, MyTasksPanelProps, PipelineFunnelWidgetProps, PipelineStageSummary, QuickCreateActionsProps, SavedViewPreset, SavedViewsPanelProps, TasksDueWidgetProps };