@elevasis/ui 2.22.0 → 2.24.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.
Files changed (57) hide show
  1. package/dist/app/index.d.ts +2915 -0
  2. package/dist/app/index.js +5 -4
  3. package/dist/{chunk-3HEUGBOT.js → chunk-2WZ635SS.js} +2 -2
  4. package/dist/{chunk-GJ7EIABJ.js → chunk-4NWNS7TX.js} +1 -1
  5. package/dist/{chunk-LKVBEE63.js → chunk-FUEXGRFR.js} +2 -2
  6. package/dist/{chunk-6IA2OMAE.js → chunk-HC2KV6BU.js} +9 -0
  7. package/dist/{chunk-IBUYJXA3.js → chunk-KCJ6VATY.js} +1133 -578
  8. package/dist/{chunk-WWJ6S2HQ.js → chunk-KLFIJDTD.js} +1 -1
  9. package/dist/{chunk-COG4ABRI.js → chunk-M2HWJY6O.js} +704 -375
  10. package/dist/{chunk-LVJGPE6H.js → chunk-MTR6AN2C.js} +3 -12
  11. package/dist/chunk-OWHQ65EQ.js +211 -0
  12. package/dist/{chunk-XOTJNW4Q.js → chunk-QIW6OCEI.js} +18 -1
  13. package/dist/{chunk-B4FHWKEF.js → chunk-QULLZ5PE.js} +193 -10
  14. package/dist/{chunk-QZJM3RYI.js → chunk-SNHGSCKH.js} +1 -1
  15. package/dist/{chunk-LVUCBY7X.js → chunk-UDJE54WN.js} +85 -3
  16. package/dist/{chunk-IOTLB6ND.js → chunk-VGNAV3TH.js} +406 -195
  17. package/dist/{chunk-BSZRKBAW.js → chunk-YBZT7MJR.js} +3 -3
  18. package/dist/{chunk-SQ5JGELM.js → chunk-ZDKQNQ4X.js} +19 -1
  19. package/dist/components/index.d.ts +500 -466
  20. package/dist/components/index.js +75 -32
  21. package/dist/components/navigation/index.js +2 -2
  22. package/dist/features/auth/index.d.ts +472 -389
  23. package/dist/features/crm/index.d.ts +468 -391
  24. package/dist/features/crm/index.js +8 -8
  25. package/dist/features/dashboard/index.js +8 -8
  26. package/dist/features/delivery/index.d.ts +466 -383
  27. package/dist/features/delivery/index.js +8 -8
  28. package/dist/features/lead-gen/index.d.ts +213 -65
  29. package/dist/features/lead-gen/index.js +9 -8
  30. package/dist/features/monitoring/index.js +9 -9
  31. package/dist/features/monitoring/requests/index.js +7 -7
  32. package/dist/features/operations/index.js +11 -10
  33. package/dist/features/settings/index.d.ts +472 -389
  34. package/dist/features/settings/index.js +9 -9
  35. package/dist/hooks/delivery/index.d.ts +466 -383
  36. package/dist/hooks/index.d.ts +967 -744
  37. package/dist/hooks/index.js +7 -7
  38. package/dist/hooks/published.d.ts +967 -744
  39. package/dist/hooks/published.js +7 -7
  40. package/dist/index.d.ts +1360 -1069
  41. package/dist/index.js +8 -8
  42. package/dist/initialization/index.d.ts +472 -389
  43. package/dist/organization/index.d.ts +11 -1
  44. package/dist/organization/index.js +2 -2
  45. package/dist/profile/index.d.ts +472 -389
  46. package/dist/provider/index.d.ts +3132 -169
  47. package/dist/provider/index.js +6 -6
  48. package/dist/provider/published.d.ts +3098 -168
  49. package/dist/provider/published.js +3 -3
  50. package/dist/supabase/index.d.ts +577 -413
  51. package/dist/test-utils/index.d.ts +21 -1
  52. package/dist/test-utils/index.js +13 -4
  53. package/dist/theme/index.js +2 -2
  54. package/dist/types/index.d.ts +472 -389
  55. package/package.json +2 -2
  56. package/src/test-utils/README.md +2 -0
  57. /package/dist/{chunk-ZBCTB5CA.js → chunk-EIOJNUPL.js} +0 -0
@@ -101,178 +101,2918 @@ declare function NotificationProvider({ adapter, children }: {
101
101
  */
102
102
  declare function useNotificationAdapter(): NotificationAdapter;
103
103
 
104
- /** Flat + per-scheme override pattern. Flat values apply to both; `light`/`dark` win over flat. */
105
- type WithSchemes<T> = T & {
106
- light?: T;
107
- dark?: T;
104
+ type Json = string | number | boolean | null | {
105
+ [key: string]: Json | undefined;
106
+ } | Json[];
107
+ type Database = {
108
+ __InternalSupabase: {
109
+ PostgrestVersion: '12.2.3 (519615d)';
110
+ };
111
+ public: {
112
+ Tables: {
113
+ acq_artifacts: {
114
+ Row: {
115
+ content: Json;
116
+ created_at: string;
117
+ created_by: string | null;
118
+ id: string;
119
+ kind: string;
120
+ organization_id: string;
121
+ owner_id: string;
122
+ owner_kind: string;
123
+ source_execution_id: string | null;
124
+ version: number;
125
+ };
126
+ Insert: {
127
+ content: Json;
128
+ created_at?: string;
129
+ created_by?: string | null;
130
+ id?: string;
131
+ kind: string;
132
+ organization_id: string;
133
+ owner_id: string;
134
+ owner_kind: string;
135
+ source_execution_id?: string | null;
136
+ version?: number;
137
+ };
138
+ Update: {
139
+ content?: Json;
140
+ created_at?: string;
141
+ created_by?: string | null;
142
+ id?: string;
143
+ kind?: string;
144
+ organization_id?: string;
145
+ owner_id?: string;
146
+ owner_kind?: string;
147
+ source_execution_id?: string | null;
148
+ version?: number;
149
+ };
150
+ Relationships: [
151
+ {
152
+ foreignKeyName: 'acq_artifacts_organization_id_fkey';
153
+ columns: ['organization_id'];
154
+ isOneToOne: false;
155
+ referencedRelation: 'organizations';
156
+ referencedColumns: ['id'];
157
+ }
158
+ ];
159
+ };
160
+ acq_companies: {
161
+ Row: {
162
+ batch_id: string | null;
163
+ category: string | null;
164
+ category_pain: string | null;
165
+ created_at: string;
166
+ domain: string | null;
167
+ enrichment_data: Json | null;
168
+ filter_reason: string | null;
169
+ founded_year: number | null;
170
+ id: string;
171
+ linkedin_url: string | null;
172
+ location_city: string | null;
173
+ location_state: string | null;
174
+ name: string;
175
+ num_employees: number | null;
176
+ organization_id: string;
177
+ pipeline_status: Json;
178
+ qualification_rubric_key: string | null;
179
+ qualification_score: number | null;
180
+ qualification_signals: Json | null;
181
+ segment: string | null;
182
+ source: string | null;
183
+ status: string;
184
+ updated_at: string;
185
+ website: string | null;
186
+ };
187
+ Insert: {
188
+ batch_id?: string | null;
189
+ category?: string | null;
190
+ category_pain?: string | null;
191
+ created_at?: string;
192
+ domain?: string | null;
193
+ enrichment_data?: Json | null;
194
+ filter_reason?: string | null;
195
+ founded_year?: number | null;
196
+ id?: string;
197
+ linkedin_url?: string | null;
198
+ location_city?: string | null;
199
+ location_state?: string | null;
200
+ name: string;
201
+ num_employees?: number | null;
202
+ organization_id: string;
203
+ pipeline_status?: Json;
204
+ qualification_rubric_key?: string | null;
205
+ qualification_score?: number | null;
206
+ qualification_signals?: Json | null;
207
+ segment?: string | null;
208
+ source?: string | null;
209
+ status?: string;
210
+ updated_at?: string;
211
+ website?: string | null;
212
+ };
213
+ Update: {
214
+ batch_id?: string | null;
215
+ category?: string | null;
216
+ category_pain?: string | null;
217
+ created_at?: string;
218
+ domain?: string | null;
219
+ enrichment_data?: Json | null;
220
+ filter_reason?: string | null;
221
+ founded_year?: number | null;
222
+ id?: string;
223
+ linkedin_url?: string | null;
224
+ location_city?: string | null;
225
+ location_state?: string | null;
226
+ name?: string;
227
+ num_employees?: number | null;
228
+ organization_id?: string;
229
+ pipeline_status?: Json;
230
+ qualification_rubric_key?: string | null;
231
+ qualification_score?: number | null;
232
+ qualification_signals?: Json | null;
233
+ segment?: string | null;
234
+ source?: string | null;
235
+ status?: string;
236
+ updated_at?: string;
237
+ website?: string | null;
238
+ };
239
+ Relationships: [
240
+ {
241
+ foreignKeyName: 'acq_companies_organization_id_fkey';
242
+ columns: ['organization_id'];
243
+ isOneToOne: false;
244
+ referencedRelation: 'organizations';
245
+ referencedColumns: ['id'];
246
+ }
247
+ ];
248
+ };
249
+ acq_contacts: {
250
+ Row: {
251
+ batch_id: string | null;
252
+ brochure_first_viewed_at: string | null;
253
+ brochure_view_count: number;
254
+ company_id: string | null;
255
+ created_at: string;
256
+ email: string;
257
+ email_valid: string | null;
258
+ enrichment_data: Json;
259
+ filter_reason: string | null;
260
+ first_name: string | null;
261
+ headline: string | null;
262
+ id: string;
263
+ last_name: string | null;
264
+ linkedin_url: string | null;
265
+ nurture: boolean;
266
+ opening_line: string | null;
267
+ organization_id: string;
268
+ pipeline_status: Json;
269
+ qualification_rubric_key: string | null;
270
+ qualification_score: number | null;
271
+ qualification_signals: Json | null;
272
+ source: string | null;
273
+ source_id: string | null;
274
+ status: string;
275
+ title: string | null;
276
+ updated_at: string;
277
+ };
278
+ Insert: {
279
+ batch_id?: string | null;
280
+ brochure_first_viewed_at?: string | null;
281
+ brochure_view_count?: number;
282
+ company_id?: string | null;
283
+ created_at?: string;
284
+ email: string;
285
+ email_valid?: string | null;
286
+ enrichment_data?: Json;
287
+ filter_reason?: string | null;
288
+ first_name?: string | null;
289
+ headline?: string | null;
290
+ id?: string;
291
+ last_name?: string | null;
292
+ linkedin_url?: string | null;
293
+ nurture?: boolean;
294
+ opening_line?: string | null;
295
+ organization_id: string;
296
+ pipeline_status?: Json;
297
+ qualification_rubric_key?: string | null;
298
+ qualification_score?: number | null;
299
+ qualification_signals?: Json | null;
300
+ source?: string | null;
301
+ source_id?: string | null;
302
+ status?: string;
303
+ title?: string | null;
304
+ updated_at?: string;
305
+ };
306
+ Update: {
307
+ batch_id?: string | null;
308
+ brochure_first_viewed_at?: string | null;
309
+ brochure_view_count?: number;
310
+ company_id?: string | null;
311
+ created_at?: string;
312
+ email?: string;
313
+ email_valid?: string | null;
314
+ enrichment_data?: Json;
315
+ filter_reason?: string | null;
316
+ first_name?: string | null;
317
+ headline?: string | null;
318
+ id?: string;
319
+ last_name?: string | null;
320
+ linkedin_url?: string | null;
321
+ nurture?: boolean;
322
+ opening_line?: string | null;
323
+ organization_id?: string;
324
+ pipeline_status?: Json;
325
+ qualification_rubric_key?: string | null;
326
+ qualification_score?: number | null;
327
+ qualification_signals?: Json | null;
328
+ source?: string | null;
329
+ source_id?: string | null;
330
+ status?: string;
331
+ title?: string | null;
332
+ updated_at?: string;
333
+ };
334
+ Relationships: [
335
+ {
336
+ foreignKeyName: 'acq_contacts_company_id_fkey';
337
+ columns: ['company_id'];
338
+ isOneToOne: false;
339
+ referencedRelation: 'acq_companies';
340
+ referencedColumns: ['id'];
341
+ },
342
+ {
343
+ foreignKeyName: 'acq_contacts_organization_id_fkey';
344
+ columns: ['organization_id'];
345
+ isOneToOne: false;
346
+ referencedRelation: 'organizations';
347
+ referencedColumns: ['id'];
348
+ }
349
+ ];
350
+ };
351
+ acq_content: {
352
+ Row: {
353
+ body: string | null;
354
+ created_at: string;
355
+ id: string;
356
+ organization_id: string;
357
+ pillar: string;
358
+ status: string;
359
+ title: string;
360
+ updated_at: string;
361
+ };
362
+ Insert: {
363
+ body?: string | null;
364
+ created_at?: string;
365
+ id?: string;
366
+ organization_id: string;
367
+ pillar: string;
368
+ status?: string;
369
+ title: string;
370
+ updated_at?: string;
371
+ };
372
+ Update: {
373
+ body?: string | null;
374
+ created_at?: string;
375
+ id?: string;
376
+ organization_id?: string;
377
+ pillar?: string;
378
+ status?: string;
379
+ title?: string;
380
+ updated_at?: string;
381
+ };
382
+ Relationships: [
383
+ {
384
+ foreignKeyName: 'acq_content_organization_id_fkey';
385
+ columns: ['organization_id'];
386
+ isOneToOne: false;
387
+ referencedRelation: 'organizations';
388
+ referencedColumns: ['id'];
389
+ }
390
+ ];
391
+ };
392
+ acq_content_distributions: {
393
+ Row: {
394
+ adapted_body: string | null;
395
+ checklist: Json | null;
396
+ content_id: string;
397
+ created_at: string;
398
+ format: string;
399
+ id: string;
400
+ media_urls: Json;
401
+ metrics: Json;
402
+ metrics_updated_at: string | null;
403
+ organization_id: string;
404
+ platform: string;
405
+ platform_content: Json | null;
406
+ platform_post_id: string | null;
407
+ platform_url: string | null;
408
+ published_at: string | null;
409
+ status: string;
410
+ updated_at: string;
411
+ };
412
+ Insert: {
413
+ adapted_body?: string | null;
414
+ checklist?: Json | null;
415
+ content_id: string;
416
+ created_at?: string;
417
+ format: string;
418
+ id?: string;
419
+ media_urls?: Json;
420
+ metrics?: Json;
421
+ metrics_updated_at?: string | null;
422
+ organization_id: string;
423
+ platform: string;
424
+ platform_content?: Json | null;
425
+ platform_post_id?: string | null;
426
+ platform_url?: string | null;
427
+ published_at?: string | null;
428
+ status?: string;
429
+ updated_at?: string;
430
+ };
431
+ Update: {
432
+ adapted_body?: string | null;
433
+ checklist?: Json | null;
434
+ content_id?: string;
435
+ created_at?: string;
436
+ format?: string;
437
+ id?: string;
438
+ media_urls?: Json;
439
+ metrics?: Json;
440
+ metrics_updated_at?: string | null;
441
+ organization_id?: string;
442
+ platform?: string;
443
+ platform_content?: Json | null;
444
+ platform_post_id?: string | null;
445
+ platform_url?: string | null;
446
+ published_at?: string | null;
447
+ status?: string;
448
+ updated_at?: string;
449
+ };
450
+ Relationships: [
451
+ {
452
+ foreignKeyName: 'acq_content_distributions_content_id_fkey';
453
+ columns: ['content_id'];
454
+ isOneToOne: false;
455
+ referencedRelation: 'acq_content';
456
+ referencedColumns: ['id'];
457
+ },
458
+ {
459
+ foreignKeyName: 'acq_content_distributions_organization_id_fkey';
460
+ columns: ['organization_id'];
461
+ isOneToOne: false;
462
+ referencedRelation: 'organizations';
463
+ referencedColumns: ['id'];
464
+ }
465
+ ];
466
+ };
467
+ acq_deal_notes: {
468
+ Row: {
469
+ author_user_id: string | null;
470
+ body: string;
471
+ created_at: string;
472
+ deal_id: string;
473
+ id: string;
474
+ organization_id: string;
475
+ updated_at: string;
476
+ };
477
+ Insert: {
478
+ author_user_id?: string | null;
479
+ body: string;
480
+ created_at?: string;
481
+ deal_id: string;
482
+ id?: string;
483
+ organization_id: string;
484
+ updated_at?: string;
485
+ };
486
+ Update: {
487
+ author_user_id?: string | null;
488
+ body?: string;
489
+ created_at?: string;
490
+ deal_id?: string;
491
+ id?: string;
492
+ organization_id?: string;
493
+ updated_at?: string;
494
+ };
495
+ Relationships: [
496
+ {
497
+ foreignKeyName: 'acq_deal_notes_deal_id_fkey';
498
+ columns: ['deal_id'];
499
+ isOneToOne: false;
500
+ referencedRelation: 'acq_deals';
501
+ referencedColumns: ['id'];
502
+ },
503
+ {
504
+ foreignKeyName: 'acq_deal_notes_organization_id_fkey';
505
+ columns: ['organization_id'];
506
+ isOneToOne: false;
507
+ referencedRelation: 'organizations';
508
+ referencedColumns: ['id'];
509
+ }
510
+ ];
511
+ };
512
+ acq_deal_tasks: {
513
+ Row: {
514
+ assignee_user_id: string | null;
515
+ completed_at: string | null;
516
+ completed_by_user_id: string | null;
517
+ created_at: string;
518
+ created_by_user_id: string | null;
519
+ deal_id: string;
520
+ description: string | null;
521
+ due_at: string | null;
522
+ id: string;
523
+ kind: string;
524
+ organization_id: string;
525
+ title: string;
526
+ updated_at: string;
527
+ };
528
+ Insert: {
529
+ assignee_user_id?: string | null;
530
+ completed_at?: string | null;
531
+ completed_by_user_id?: string | null;
532
+ created_at?: string;
533
+ created_by_user_id?: string | null;
534
+ deal_id: string;
535
+ description?: string | null;
536
+ due_at?: string | null;
537
+ id?: string;
538
+ kind?: string;
539
+ organization_id: string;
540
+ title: string;
541
+ updated_at?: string;
542
+ };
543
+ Update: {
544
+ assignee_user_id?: string | null;
545
+ completed_at?: string | null;
546
+ completed_by_user_id?: string | null;
547
+ created_at?: string;
548
+ created_by_user_id?: string | null;
549
+ deal_id?: string;
550
+ description?: string | null;
551
+ due_at?: string | null;
552
+ id?: string;
553
+ kind?: string;
554
+ organization_id?: string;
555
+ title?: string;
556
+ updated_at?: string;
557
+ };
558
+ Relationships: [
559
+ {
560
+ foreignKeyName: 'acq_deal_tasks_deal_id_fkey';
561
+ columns: ['deal_id'];
562
+ isOneToOne: false;
563
+ referencedRelation: 'acq_deals';
564
+ referencedColumns: ['id'];
565
+ },
566
+ {
567
+ foreignKeyName: 'acq_deal_tasks_organization_id_fkey';
568
+ columns: ['organization_id'];
569
+ isOneToOne: false;
570
+ referencedRelation: 'organizations';
571
+ referencedColumns: ['id'];
572
+ }
573
+ ];
574
+ };
575
+ acq_deals: {
576
+ Row: {
577
+ activity_log: Json;
578
+ closed_lost_at: string | null;
579
+ closed_lost_reason: string | null;
580
+ contact_email: string;
581
+ contact_id: string | null;
582
+ created_at: string;
583
+ discovery_data: Json | null;
584
+ discovery_submitted_at: string | null;
585
+ discovery_submitted_by: string | null;
586
+ id: string;
587
+ initial_fee: number | null;
588
+ monthly_fee: number | null;
589
+ organization_id: string;
590
+ payment_link_sent_at: string | null;
591
+ payment_received_at: string | null;
592
+ pipeline_key: string;
593
+ proposal_data: Json | null;
594
+ proposal_generated_at: string | null;
595
+ proposal_pdf_url: string | null;
596
+ proposal_reviewed_at: string | null;
597
+ proposal_reviewed_by: string | null;
598
+ proposal_sent_at: string | null;
599
+ proposal_signed_at: string | null;
600
+ signature_envelope_id: string | null;
601
+ source_list_id: string | null;
602
+ source_type: string | null;
603
+ stage_key: string | null;
604
+ state_key: string | null;
605
+ stripe_payment_id: string | null;
606
+ stripe_payment_link: string | null;
607
+ stripe_payment_link_id: string | null;
608
+ stripe_subscription_id: string | null;
609
+ updated_at: string;
610
+ };
611
+ Insert: {
612
+ activity_log?: Json;
613
+ closed_lost_at?: string | null;
614
+ closed_lost_reason?: string | null;
615
+ contact_email: string;
616
+ contact_id?: string | null;
617
+ created_at?: string;
618
+ discovery_data?: Json | null;
619
+ discovery_submitted_at?: string | null;
620
+ discovery_submitted_by?: string | null;
621
+ id?: string;
622
+ initial_fee?: number | null;
623
+ monthly_fee?: number | null;
624
+ organization_id: string;
625
+ payment_link_sent_at?: string | null;
626
+ payment_received_at?: string | null;
627
+ pipeline_key?: string;
628
+ proposal_data?: Json | null;
629
+ proposal_generated_at?: string | null;
630
+ proposal_pdf_url?: string | null;
631
+ proposal_reviewed_at?: string | null;
632
+ proposal_reviewed_by?: string | null;
633
+ proposal_sent_at?: string | null;
634
+ proposal_signed_at?: string | null;
635
+ signature_envelope_id?: string | null;
636
+ source_list_id?: string | null;
637
+ source_type?: string | null;
638
+ stage_key?: string | null;
639
+ state_key?: string | null;
640
+ stripe_payment_id?: string | null;
641
+ stripe_payment_link?: string | null;
642
+ stripe_payment_link_id?: string | null;
643
+ stripe_subscription_id?: string | null;
644
+ updated_at?: string;
645
+ };
646
+ Update: {
647
+ activity_log?: Json;
648
+ closed_lost_at?: string | null;
649
+ closed_lost_reason?: string | null;
650
+ contact_email?: string;
651
+ contact_id?: string | null;
652
+ created_at?: string;
653
+ discovery_data?: Json | null;
654
+ discovery_submitted_at?: string | null;
655
+ discovery_submitted_by?: string | null;
656
+ id?: string;
657
+ initial_fee?: number | null;
658
+ monthly_fee?: number | null;
659
+ organization_id?: string;
660
+ payment_link_sent_at?: string | null;
661
+ payment_received_at?: string | null;
662
+ pipeline_key?: string;
663
+ proposal_data?: Json | null;
664
+ proposal_generated_at?: string | null;
665
+ proposal_pdf_url?: string | null;
666
+ proposal_reviewed_at?: string | null;
667
+ proposal_reviewed_by?: string | null;
668
+ proposal_sent_at?: string | null;
669
+ proposal_signed_at?: string | null;
670
+ signature_envelope_id?: string | null;
671
+ source_list_id?: string | null;
672
+ source_type?: string | null;
673
+ stage_key?: string | null;
674
+ state_key?: string | null;
675
+ stripe_payment_id?: string | null;
676
+ stripe_payment_link?: string | null;
677
+ stripe_payment_link_id?: string | null;
678
+ stripe_subscription_id?: string | null;
679
+ updated_at?: string;
680
+ };
681
+ Relationships: [
682
+ {
683
+ foreignKeyName: 'acq_deals_contact_id_fkey';
684
+ columns: ['contact_id'];
685
+ isOneToOne: false;
686
+ referencedRelation: 'acq_contacts';
687
+ referencedColumns: ['id'];
688
+ },
689
+ {
690
+ foreignKeyName: 'acq_deals_organization_id_fkey';
691
+ columns: ['organization_id'];
692
+ isOneToOne: false;
693
+ referencedRelation: 'organizations';
694
+ referencedColumns: ['id'];
695
+ },
696
+ {
697
+ foreignKeyName: 'acq_deals_source_list_id_fkey';
698
+ columns: ['source_list_id'];
699
+ isOneToOne: false;
700
+ referencedRelation: 'acq_lists';
701
+ referencedColumns: ['id'];
702
+ }
703
+ ];
704
+ };
705
+ acq_list_companies: {
706
+ Row: {
707
+ activity_log: Json;
708
+ added_at: string;
709
+ added_by: string | null;
710
+ company_id: string;
711
+ id: string;
712
+ list_id: string;
713
+ pipeline_key: string;
714
+ processing_state: Json;
715
+ source_execution_id: string | null;
716
+ source_input_hash: string | null;
717
+ source_resource_id: string | null;
718
+ stage_key: string;
719
+ state_key: string;
720
+ };
721
+ Insert: {
722
+ activity_log?: Json;
723
+ added_at?: string;
724
+ added_by?: string | null;
725
+ company_id: string;
726
+ id?: string;
727
+ list_id: string;
728
+ pipeline_key?: string;
729
+ processing_state?: Json;
730
+ source_execution_id?: string | null;
731
+ source_input_hash?: string | null;
732
+ source_resource_id?: string | null;
733
+ stage_key: string;
734
+ state_key: string;
735
+ };
736
+ Update: {
737
+ activity_log?: Json;
738
+ added_at?: string;
739
+ added_by?: string | null;
740
+ company_id?: string;
741
+ id?: string;
742
+ list_id?: string;
743
+ pipeline_key?: string;
744
+ processing_state?: Json;
745
+ source_execution_id?: string | null;
746
+ source_input_hash?: string | null;
747
+ source_resource_id?: string | null;
748
+ stage_key?: string;
749
+ state_key?: string;
750
+ };
751
+ Relationships: [
752
+ {
753
+ foreignKeyName: 'acq_list_companies_company_id_fkey';
754
+ columns: ['company_id'];
755
+ isOneToOne: false;
756
+ referencedRelation: 'acq_companies';
757
+ referencedColumns: ['id'];
758
+ },
759
+ {
760
+ foreignKeyName: 'acq_list_companies_list_id_fkey';
761
+ columns: ['list_id'];
762
+ isOneToOne: false;
763
+ referencedRelation: 'acq_lists';
764
+ referencedColumns: ['id'];
765
+ },
766
+ {
767
+ foreignKeyName: 'acq_list_companies_source_execution_id_fkey';
768
+ columns: ['source_execution_id'];
769
+ isOneToOne: false;
770
+ referencedRelation: 'execution_logs';
771
+ referencedColumns: ['execution_id'];
772
+ }
773
+ ];
774
+ };
775
+ acq_list_executions: {
776
+ Row: {
777
+ created_at: string;
778
+ execution_id: string;
779
+ id: string;
780
+ list_id: string;
781
+ payload: Json;
782
+ };
783
+ Insert: {
784
+ created_at?: string;
785
+ execution_id: string;
786
+ id?: string;
787
+ list_id: string;
788
+ payload?: Json;
789
+ };
790
+ Update: {
791
+ created_at?: string;
792
+ execution_id?: string;
793
+ id?: string;
794
+ list_id?: string;
795
+ payload?: Json;
796
+ };
797
+ Relationships: [
798
+ {
799
+ foreignKeyName: 'acq_list_executions_execution_id_fkey';
800
+ columns: ['execution_id'];
801
+ isOneToOne: false;
802
+ referencedRelation: 'execution_logs';
803
+ referencedColumns: ['execution_id'];
804
+ },
805
+ {
806
+ foreignKeyName: 'acq_list_executions_list_id_fkey';
807
+ columns: ['list_id'];
808
+ isOneToOne: false;
809
+ referencedRelation: 'acq_lists';
810
+ referencedColumns: ['id'];
811
+ }
812
+ ];
813
+ };
814
+ acq_list_members: {
815
+ Row: {
816
+ activity_log: Json;
817
+ added_at: string;
818
+ added_by: string | null;
819
+ contact_id: string;
820
+ id: string;
821
+ list_id: string;
822
+ pipeline_key: string;
823
+ processing_state: Json;
824
+ source_execution_id: string | null;
825
+ source_input_hash: string | null;
826
+ source_resource_id: string | null;
827
+ stage_key: string;
828
+ state_key: string;
829
+ };
830
+ Insert: {
831
+ activity_log?: Json;
832
+ added_at?: string;
833
+ added_by?: string | null;
834
+ contact_id: string;
835
+ id?: string;
836
+ list_id: string;
837
+ pipeline_key?: string;
838
+ processing_state?: Json;
839
+ source_execution_id?: string | null;
840
+ source_input_hash?: string | null;
841
+ source_resource_id?: string | null;
842
+ stage_key: string;
843
+ state_key: string;
844
+ };
845
+ Update: {
846
+ activity_log?: Json;
847
+ added_at?: string;
848
+ added_by?: string | null;
849
+ contact_id?: string;
850
+ id?: string;
851
+ list_id?: string;
852
+ pipeline_key?: string;
853
+ processing_state?: Json;
854
+ source_execution_id?: string | null;
855
+ source_input_hash?: string | null;
856
+ source_resource_id?: string | null;
857
+ stage_key?: string;
858
+ state_key?: string;
859
+ };
860
+ Relationships: [
861
+ {
862
+ foreignKeyName: 'acq_list_members_contact_id_fkey';
863
+ columns: ['contact_id'];
864
+ isOneToOne: false;
865
+ referencedRelation: 'acq_contacts';
866
+ referencedColumns: ['id'];
867
+ },
868
+ {
869
+ foreignKeyName: 'acq_list_members_list_id_fkey';
870
+ columns: ['list_id'];
871
+ isOneToOne: false;
872
+ referencedRelation: 'acq_lists';
873
+ referencedColumns: ['id'];
874
+ },
875
+ {
876
+ foreignKeyName: 'acq_list_members_source_execution_id_fkey';
877
+ columns: ['source_execution_id'];
878
+ isOneToOne: false;
879
+ referencedRelation: 'execution_logs';
880
+ referencedColumns: ['execution_id'];
881
+ }
882
+ ];
883
+ };
884
+ acq_lists: {
885
+ Row: {
886
+ batch_ids: string[];
887
+ completed_at: string | null;
888
+ created_at: string;
889
+ description: string | null;
890
+ icp: Json;
891
+ id: string;
892
+ instantly_campaign_id: string | null;
893
+ launched_at: string | null;
894
+ metadata: Json;
895
+ name: string;
896
+ organization_id: string;
897
+ pipeline_config: Json;
898
+ scraping_config: Json;
899
+ status: string;
900
+ };
901
+ Insert: {
902
+ batch_ids?: string[];
903
+ completed_at?: string | null;
904
+ created_at?: string;
905
+ description?: string | null;
906
+ icp?: Json;
907
+ id?: string;
908
+ instantly_campaign_id?: string | null;
909
+ launched_at?: string | null;
910
+ metadata?: Json;
911
+ name: string;
912
+ organization_id: string;
913
+ pipeline_config?: Json;
914
+ scraping_config?: Json;
915
+ status?: string;
916
+ };
917
+ Update: {
918
+ batch_ids?: string[];
919
+ completed_at?: string | null;
920
+ created_at?: string;
921
+ description?: string | null;
922
+ icp?: Json;
923
+ id?: string;
924
+ instantly_campaign_id?: string | null;
925
+ launched_at?: string | null;
926
+ metadata?: Json;
927
+ name?: string;
928
+ organization_id?: string;
929
+ pipeline_config?: Json;
930
+ scraping_config?: Json;
931
+ status?: string;
932
+ };
933
+ Relationships: [
934
+ {
935
+ foreignKeyName: 'acq_lists_organization_id_fkey';
936
+ columns: ['organization_id'];
937
+ isOneToOne: false;
938
+ referencedRelation: 'organizations';
939
+ referencedColumns: ['id'];
940
+ }
941
+ ];
942
+ };
943
+ acq_seo_metrics: {
944
+ Row: {
945
+ ai_citations: Json | null;
946
+ avg_position: number | null;
947
+ clicks: number | null;
948
+ created_at: string;
949
+ cta_clicks: number | null;
950
+ ctr: number | null;
951
+ data_point_count: number | null;
952
+ faq_count: number | null;
953
+ form_submissions: number | null;
954
+ id: string;
955
+ impressions: number | null;
956
+ organization_id: string;
957
+ period: string;
958
+ quality_score: number | null;
959
+ readability: number | null;
960
+ scroll_100: number | null;
961
+ scroll_25: number | null;
962
+ scroll_50: number | null;
963
+ scroll_75: number | null;
964
+ seo_page_id: string;
965
+ word_count: number | null;
966
+ };
967
+ Insert: {
968
+ ai_citations?: Json | null;
969
+ avg_position?: number | null;
970
+ clicks?: number | null;
971
+ created_at?: string;
972
+ cta_clicks?: number | null;
973
+ ctr?: number | null;
974
+ data_point_count?: number | null;
975
+ faq_count?: number | null;
976
+ form_submissions?: number | null;
977
+ id?: string;
978
+ impressions?: number | null;
979
+ organization_id: string;
980
+ period: string;
981
+ quality_score?: number | null;
982
+ readability?: number | null;
983
+ scroll_100?: number | null;
984
+ scroll_25?: number | null;
985
+ scroll_50?: number | null;
986
+ scroll_75?: number | null;
987
+ seo_page_id: string;
988
+ word_count?: number | null;
989
+ };
990
+ Update: {
991
+ ai_citations?: Json | null;
992
+ avg_position?: number | null;
993
+ clicks?: number | null;
994
+ created_at?: string;
995
+ cta_clicks?: number | null;
996
+ ctr?: number | null;
997
+ data_point_count?: number | null;
998
+ faq_count?: number | null;
999
+ form_submissions?: number | null;
1000
+ id?: string;
1001
+ impressions?: number | null;
1002
+ organization_id?: string;
1003
+ period?: string;
1004
+ quality_score?: number | null;
1005
+ readability?: number | null;
1006
+ scroll_100?: number | null;
1007
+ scroll_25?: number | null;
1008
+ scroll_50?: number | null;
1009
+ scroll_75?: number | null;
1010
+ seo_page_id?: string;
1011
+ word_count?: number | null;
1012
+ };
1013
+ Relationships: [
1014
+ {
1015
+ foreignKeyName: 'acq_seo_metrics_organization_id_fkey';
1016
+ columns: ['organization_id'];
1017
+ isOneToOne: false;
1018
+ referencedRelation: 'organizations';
1019
+ referencedColumns: ['id'];
1020
+ },
1021
+ {
1022
+ foreignKeyName: 'acq_seo_metrics_seo_page_id_fkey';
1023
+ columns: ['seo_page_id'];
1024
+ isOneToOne: false;
1025
+ referencedRelation: 'acq_seo_pages';
1026
+ referencedColumns: ['id'];
1027
+ }
1028
+ ];
1029
+ };
1030
+ acq_seo_pages: {
1031
+ Row: {
1032
+ city: string | null;
1033
+ content: Json | null;
1034
+ created_at: string;
1035
+ faq_items: Json | null;
1036
+ hero_image_url: string | null;
1037
+ id: string;
1038
+ internal_links: Json | null;
1039
+ local_data: Json | null;
1040
+ meta_description: string | null;
1041
+ organization_id: string;
1042
+ page_type: string;
1043
+ published_at: string | null;
1044
+ refreshed_at: string | null;
1045
+ schema_markup: Json | null;
1046
+ slug: string;
1047
+ state: string | null;
1048
+ status: string;
1049
+ title: string;
1050
+ updated_at: string;
1051
+ use_case: string | null;
1052
+ vertical: string;
1053
+ };
1054
+ Insert: {
1055
+ city?: string | null;
1056
+ content?: Json | null;
1057
+ created_at?: string;
1058
+ faq_items?: Json | null;
1059
+ hero_image_url?: string | null;
1060
+ id?: string;
1061
+ internal_links?: Json | null;
1062
+ local_data?: Json | null;
1063
+ meta_description?: string | null;
1064
+ organization_id: string;
1065
+ page_type: string;
1066
+ published_at?: string | null;
1067
+ refreshed_at?: string | null;
1068
+ schema_markup?: Json | null;
1069
+ slug: string;
1070
+ state?: string | null;
1071
+ status?: string;
1072
+ title: string;
1073
+ updated_at?: string;
1074
+ use_case?: string | null;
1075
+ vertical: string;
1076
+ };
1077
+ Update: {
1078
+ city?: string | null;
1079
+ content?: Json | null;
1080
+ created_at?: string;
1081
+ faq_items?: Json | null;
1082
+ hero_image_url?: string | null;
1083
+ id?: string;
1084
+ internal_links?: Json | null;
1085
+ local_data?: Json | null;
1086
+ meta_description?: string | null;
1087
+ organization_id?: string;
1088
+ page_type?: string;
1089
+ published_at?: string | null;
1090
+ refreshed_at?: string | null;
1091
+ schema_markup?: Json | null;
1092
+ slug?: string;
1093
+ state?: string | null;
1094
+ status?: string;
1095
+ title?: string;
1096
+ updated_at?: string;
1097
+ use_case?: string | null;
1098
+ vertical?: string;
1099
+ };
1100
+ Relationships: [
1101
+ {
1102
+ foreignKeyName: 'acq_seo_pages_organization_id_fkey';
1103
+ columns: ['organization_id'];
1104
+ isOneToOne: false;
1105
+ referencedRelation: 'organizations';
1106
+ referencedColumns: ['id'];
1107
+ }
1108
+ ];
1109
+ };
1110
+ acq_social_posts: {
1111
+ Row: {
1112
+ author_name: string;
1113
+ author_url: string | null;
1114
+ comments_count: number;
1115
+ created_at: string;
1116
+ discovered_at: string;
1117
+ engagement_count: number;
1118
+ feedback: string | null;
1119
+ final_response: string | null;
1120
+ fully_reviewed: boolean;
1121
+ id: string;
1122
+ initial_draft: string | null;
1123
+ matched_keywords: string[];
1124
+ matched_query: string | null;
1125
+ metadata: Json;
1126
+ organization_id: string;
1127
+ platform: string;
1128
+ platform_post_id: string;
1129
+ post_text: string;
1130
+ post_title: string;
1131
+ post_url: string;
1132
+ posted_at: string;
1133
+ relevance_score: number;
1134
+ responded_at: string | null;
1135
+ reviewed_at: string | null;
1136
+ skip_reason: string | null;
1137
+ source_category: string | null;
1138
+ status: string;
1139
+ updated_at: string;
1140
+ };
1141
+ Insert: {
1142
+ author_name: string;
1143
+ author_url?: string | null;
1144
+ comments_count?: number;
1145
+ created_at?: string;
1146
+ discovered_at?: string;
1147
+ engagement_count?: number;
1148
+ feedback?: string | null;
1149
+ final_response?: string | null;
1150
+ fully_reviewed?: boolean;
1151
+ id?: string;
1152
+ initial_draft?: string | null;
1153
+ matched_keywords?: string[];
1154
+ matched_query?: string | null;
1155
+ metadata?: Json;
1156
+ organization_id: string;
1157
+ platform: string;
1158
+ platform_post_id: string;
1159
+ post_text: string;
1160
+ post_title: string;
1161
+ post_url: string;
1162
+ posted_at: string;
1163
+ relevance_score?: number;
1164
+ responded_at?: string | null;
1165
+ reviewed_at?: string | null;
1166
+ skip_reason?: string | null;
1167
+ source_category?: string | null;
1168
+ status?: string;
1169
+ updated_at?: string;
1170
+ };
1171
+ Update: {
1172
+ author_name?: string;
1173
+ author_url?: string | null;
1174
+ comments_count?: number;
1175
+ created_at?: string;
1176
+ discovered_at?: string;
1177
+ engagement_count?: number;
1178
+ feedback?: string | null;
1179
+ final_response?: string | null;
1180
+ fully_reviewed?: boolean;
1181
+ id?: string;
1182
+ initial_draft?: string | null;
1183
+ matched_keywords?: string[];
1184
+ matched_query?: string | null;
1185
+ metadata?: Json;
1186
+ organization_id?: string;
1187
+ platform?: string;
1188
+ platform_post_id?: string;
1189
+ post_text?: string;
1190
+ post_title?: string;
1191
+ post_url?: string;
1192
+ posted_at?: string;
1193
+ relevance_score?: number;
1194
+ responded_at?: string | null;
1195
+ reviewed_at?: string | null;
1196
+ skip_reason?: string | null;
1197
+ source_category?: string | null;
1198
+ status?: string;
1199
+ updated_at?: string;
1200
+ };
1201
+ Relationships: [
1202
+ {
1203
+ foreignKeyName: 'acq_social_posts_organization_id_fkey';
1204
+ columns: ['organization_id'];
1205
+ isOneToOne: false;
1206
+ referencedRelation: 'organizations';
1207
+ referencedColumns: ['id'];
1208
+ }
1209
+ ];
1210
+ };
1211
+ activities: {
1212
+ Row: {
1213
+ activity_type: string;
1214
+ actor_id: string | null;
1215
+ actor_type: string | null;
1216
+ created_at: string;
1217
+ description: string | null;
1218
+ entity_id: string;
1219
+ entity_name: string | null;
1220
+ entity_type: string;
1221
+ id: string;
1222
+ metadata: Json | null;
1223
+ occurred_at: string;
1224
+ organization_id: string;
1225
+ status: string;
1226
+ title: string;
1227
+ };
1228
+ Insert: {
1229
+ activity_type: string;
1230
+ actor_id?: string | null;
1231
+ actor_type?: string | null;
1232
+ created_at?: string;
1233
+ description?: string | null;
1234
+ entity_id: string;
1235
+ entity_name?: string | null;
1236
+ entity_type: string;
1237
+ id?: string;
1238
+ metadata?: Json | null;
1239
+ occurred_at?: string;
1240
+ organization_id: string;
1241
+ status: string;
1242
+ title: string;
1243
+ };
1244
+ Update: {
1245
+ activity_type?: string;
1246
+ actor_id?: string | null;
1247
+ actor_type?: string | null;
1248
+ created_at?: string;
1249
+ description?: string | null;
1250
+ entity_id?: string;
1251
+ entity_name?: string | null;
1252
+ entity_type?: string;
1253
+ id?: string;
1254
+ metadata?: Json | null;
1255
+ occurred_at?: string;
1256
+ organization_id?: string;
1257
+ status?: string;
1258
+ title?: string;
1259
+ };
1260
+ Relationships: [
1261
+ {
1262
+ foreignKeyName: 'activities_organization_id_fkey';
1263
+ columns: ['organization_id'];
1264
+ isOneToOne: false;
1265
+ referencedRelation: 'organizations';
1266
+ referencedColumns: ['id'];
1267
+ }
1268
+ ];
1269
+ };
1270
+ api_keys: {
1271
+ Row: {
1272
+ created_at: string | null;
1273
+ id: string;
1274
+ key_hash: string;
1275
+ last_used_at: string | null;
1276
+ name: string;
1277
+ organization_id: string;
1278
+ };
1279
+ Insert: {
1280
+ created_at?: string | null;
1281
+ id?: string;
1282
+ key_hash: string;
1283
+ last_used_at?: string | null;
1284
+ name: string;
1285
+ organization_id: string;
1286
+ };
1287
+ Update: {
1288
+ created_at?: string | null;
1289
+ id?: string;
1290
+ key_hash?: string;
1291
+ last_used_at?: string | null;
1292
+ name?: string;
1293
+ organization_id?: string;
1294
+ };
1295
+ Relationships: [
1296
+ {
1297
+ foreignKeyName: 'api_keys_organization_id_fkey';
1298
+ columns: ['organization_id'];
1299
+ isOneToOne: false;
1300
+ referencedRelation: 'organizations';
1301
+ referencedColumns: ['id'];
1302
+ }
1303
+ ];
1304
+ };
1305
+ command_queue: {
1306
+ Row: {
1307
+ action_payload: Json | null;
1308
+ actions: Json;
1309
+ completed_at: string | null;
1310
+ completed_by: string | null;
1311
+ context: Json;
1312
+ created_at: string;
1313
+ description: string | null;
1314
+ expires_at: string | null;
1315
+ human_checkpoint: string | null;
1316
+ id: string;
1317
+ idempotency_key: string | null;
1318
+ metadata: Json | null;
1319
+ organization_id: string;
1320
+ origin_execution_id: string;
1321
+ origin_resource_id: string;
1322
+ origin_resource_type: string;
1323
+ priority: number;
1324
+ selected_action: string | null;
1325
+ status: string;
1326
+ target_execution_id: string | null;
1327
+ target_resource_id: string | null;
1328
+ target_resource_type: string | null;
1329
+ };
1330
+ Insert: {
1331
+ action_payload?: Json | null;
1332
+ actions: Json;
1333
+ completed_at?: string | null;
1334
+ completed_by?: string | null;
1335
+ context: Json;
1336
+ created_at?: string;
1337
+ description?: string | null;
1338
+ expires_at?: string | null;
1339
+ human_checkpoint?: string | null;
1340
+ id?: string;
1341
+ idempotency_key?: string | null;
1342
+ metadata?: Json | null;
1343
+ organization_id: string;
1344
+ origin_execution_id: string;
1345
+ origin_resource_id: string;
1346
+ origin_resource_type: string;
1347
+ priority?: number;
1348
+ selected_action?: string | null;
1349
+ status?: string;
1350
+ target_execution_id?: string | null;
1351
+ target_resource_id?: string | null;
1352
+ target_resource_type?: string | null;
1353
+ };
1354
+ Update: {
1355
+ action_payload?: Json | null;
1356
+ actions?: Json;
1357
+ completed_at?: string | null;
1358
+ completed_by?: string | null;
1359
+ context?: Json;
1360
+ created_at?: string;
1361
+ description?: string | null;
1362
+ expires_at?: string | null;
1363
+ human_checkpoint?: string | null;
1364
+ id?: string;
1365
+ idempotency_key?: string | null;
1366
+ metadata?: Json | null;
1367
+ organization_id?: string;
1368
+ origin_execution_id?: string;
1369
+ origin_resource_id?: string;
1370
+ origin_resource_type?: string;
1371
+ priority?: number;
1372
+ selected_action?: string | null;
1373
+ status?: string;
1374
+ target_execution_id?: string | null;
1375
+ target_resource_id?: string | null;
1376
+ target_resource_type?: string | null;
1377
+ };
1378
+ Relationships: [
1379
+ {
1380
+ foreignKeyName: 'command_queue_completed_by_fkey';
1381
+ columns: ['completed_by'];
1382
+ isOneToOne: false;
1383
+ referencedRelation: 'users';
1384
+ referencedColumns: ['id'];
1385
+ },
1386
+ {
1387
+ foreignKeyName: 'command_queue_organization_id_fkey';
1388
+ columns: ['organization_id'];
1389
+ isOneToOne: false;
1390
+ referencedRelation: 'organizations';
1391
+ referencedColumns: ['id'];
1392
+ },
1393
+ {
1394
+ foreignKeyName: 'command_queue_target_execution_id_fkey';
1395
+ columns: ['target_execution_id'];
1396
+ isOneToOne: false;
1397
+ referencedRelation: 'execution_logs';
1398
+ referencedColumns: ['execution_id'];
1399
+ }
1400
+ ];
1401
+ };
1402
+ credentials: {
1403
+ Row: {
1404
+ created_at: string;
1405
+ created_by: string | null;
1406
+ encrypted_value: string;
1407
+ id: string;
1408
+ name: string;
1409
+ organization_id: string;
1410
+ provider: string | null;
1411
+ type: string;
1412
+ updated_at: string;
1413
+ };
1414
+ Insert: {
1415
+ created_at?: string;
1416
+ created_by?: string | null;
1417
+ encrypted_value: string;
1418
+ id?: string;
1419
+ name: string;
1420
+ organization_id: string;
1421
+ provider?: string | null;
1422
+ type?: string;
1423
+ updated_at?: string;
1424
+ };
1425
+ Update: {
1426
+ created_at?: string;
1427
+ created_by?: string | null;
1428
+ encrypted_value?: string;
1429
+ id?: string;
1430
+ name?: string;
1431
+ organization_id?: string;
1432
+ provider?: string | null;
1433
+ type?: string;
1434
+ updated_at?: string;
1435
+ };
1436
+ Relationships: [
1437
+ {
1438
+ foreignKeyName: 'credentials_created_by_fkey';
1439
+ columns: ['created_by'];
1440
+ isOneToOne: false;
1441
+ referencedRelation: 'users';
1442
+ referencedColumns: ['id'];
1443
+ },
1444
+ {
1445
+ foreignKeyName: 'credentials_organization_id_fkey';
1446
+ columns: ['organization_id'];
1447
+ isOneToOne: false;
1448
+ referencedRelation: 'organizations';
1449
+ referencedColumns: ['id'];
1450
+ }
1451
+ ];
1452
+ };
1453
+ deployments: {
1454
+ Row: {
1455
+ created_at: string;
1456
+ deployment_version: string | null;
1457
+ error_message: string | null;
1458
+ id: string;
1459
+ organization_id: string;
1460
+ pid: number | null;
1461
+ port: number | null;
1462
+ sdk_version: string;
1463
+ status: string;
1464
+ tarball_path: string | null;
1465
+ updated_at: string;
1466
+ };
1467
+ Insert: {
1468
+ created_at?: string;
1469
+ deployment_version?: string | null;
1470
+ error_message?: string | null;
1471
+ id?: string;
1472
+ organization_id: string;
1473
+ pid?: number | null;
1474
+ port?: number | null;
1475
+ sdk_version: string;
1476
+ status?: string;
1477
+ tarball_path?: string | null;
1478
+ updated_at?: string;
1479
+ };
1480
+ Update: {
1481
+ created_at?: string;
1482
+ deployment_version?: string | null;
1483
+ error_message?: string | null;
1484
+ id?: string;
1485
+ organization_id?: string;
1486
+ pid?: number | null;
1487
+ port?: number | null;
1488
+ sdk_version?: string;
1489
+ status?: string;
1490
+ tarball_path?: string | null;
1491
+ updated_at?: string;
1492
+ };
1493
+ Relationships: [
1494
+ {
1495
+ foreignKeyName: 'deployments_organization_id_fkey';
1496
+ columns: ['organization_id'];
1497
+ isOneToOne: false;
1498
+ referencedRelation: 'organizations';
1499
+ referencedColumns: ['id'];
1500
+ }
1501
+ ];
1502
+ };
1503
+ execution_errors: {
1504
+ Row: {
1505
+ created_at: string | null;
1506
+ error_category: string;
1507
+ error_message: string;
1508
+ error_severity: string;
1509
+ error_stack_trace: string | null;
1510
+ error_type: string;
1511
+ execution_id: string;
1512
+ id: string;
1513
+ metadata: Json | null;
1514
+ occurred_at: string;
1515
+ organization_id: string;
1516
+ resolved: boolean;
1517
+ resolved_at: string | null;
1518
+ resolved_by: string | null;
1519
+ };
1520
+ Insert: {
1521
+ created_at?: string | null;
1522
+ error_category: string;
1523
+ error_message: string;
1524
+ error_severity: string;
1525
+ error_stack_trace?: string | null;
1526
+ error_type: string;
1527
+ execution_id: string;
1528
+ id?: string;
1529
+ metadata?: Json | null;
1530
+ occurred_at?: string;
1531
+ organization_id: string;
1532
+ resolved?: boolean;
1533
+ resolved_at?: string | null;
1534
+ resolved_by?: string | null;
1535
+ };
1536
+ Update: {
1537
+ created_at?: string | null;
1538
+ error_category?: string;
1539
+ error_message?: string;
1540
+ error_severity?: string;
1541
+ error_stack_trace?: string | null;
1542
+ error_type?: string;
1543
+ execution_id?: string;
1544
+ id?: string;
1545
+ metadata?: Json | null;
1546
+ occurred_at?: string;
1547
+ organization_id?: string;
1548
+ resolved?: boolean;
1549
+ resolved_at?: string | null;
1550
+ resolved_by?: string | null;
1551
+ };
1552
+ Relationships: [
1553
+ {
1554
+ foreignKeyName: 'execution_errors_execution_id_fkey';
1555
+ columns: ['execution_id'];
1556
+ isOneToOne: false;
1557
+ referencedRelation: 'execution_logs';
1558
+ referencedColumns: ['execution_id'];
1559
+ },
1560
+ {
1561
+ foreignKeyName: 'execution_errors_organization_id_fkey';
1562
+ columns: ['organization_id'];
1563
+ isOneToOne: false;
1564
+ referencedRelation: 'organizations';
1565
+ referencedColumns: ['id'];
1566
+ },
1567
+ {
1568
+ foreignKeyName: 'execution_errors_resolved_by_fkey';
1569
+ columns: ['resolved_by'];
1570
+ isOneToOne: false;
1571
+ referencedRelation: 'users';
1572
+ referencedColumns: ['id'];
1573
+ }
1574
+ ];
1575
+ };
1576
+ execution_logs: {
1577
+ Row: {
1578
+ api_version: string | null;
1579
+ completed_at: string | null;
1580
+ created_at: string | null;
1581
+ error: string | null;
1582
+ execution_id: string;
1583
+ input: Json | null;
1584
+ last_heartbeat_at: string | null;
1585
+ logs: Json | null;
1586
+ organization_id: string;
1587
+ origin_execution_id: string | null;
1588
+ output: Json | null;
1589
+ resource_id: string;
1590
+ resource_status: string;
1591
+ resource_type: string;
1592
+ resource_version: string | null;
1593
+ sdk_version: string | null;
1594
+ session_id: string | null;
1595
+ session_turn_number: number | null;
1596
+ started_at: string;
1597
+ status: string;
1598
+ trigger_type: string | null;
1599
+ updated_at: string | null;
1600
+ user_id: string | null;
1601
+ };
1602
+ Insert: {
1603
+ api_version?: string | null;
1604
+ completed_at?: string | null;
1605
+ created_at?: string | null;
1606
+ error?: string | null;
1607
+ execution_id?: string;
1608
+ input?: Json | null;
1609
+ last_heartbeat_at?: string | null;
1610
+ logs?: Json | null;
1611
+ organization_id: string;
1612
+ origin_execution_id?: string | null;
1613
+ output?: Json | null;
1614
+ resource_id: string;
1615
+ resource_status?: string;
1616
+ resource_type?: string;
1617
+ resource_version?: string | null;
1618
+ sdk_version?: string | null;
1619
+ session_id?: string | null;
1620
+ session_turn_number?: number | null;
1621
+ started_at?: string;
1622
+ status: string;
1623
+ trigger_type?: string | null;
1624
+ updated_at?: string | null;
1625
+ user_id?: string | null;
1626
+ };
1627
+ Update: {
1628
+ api_version?: string | null;
1629
+ completed_at?: string | null;
1630
+ created_at?: string | null;
1631
+ error?: string | null;
1632
+ execution_id?: string;
1633
+ input?: Json | null;
1634
+ last_heartbeat_at?: string | null;
1635
+ logs?: Json | null;
1636
+ organization_id?: string;
1637
+ origin_execution_id?: string | null;
1638
+ output?: Json | null;
1639
+ resource_id?: string;
1640
+ resource_status?: string;
1641
+ resource_type?: string;
1642
+ resource_version?: string | null;
1643
+ sdk_version?: string | null;
1644
+ session_id?: string | null;
1645
+ session_turn_number?: number | null;
1646
+ started_at?: string;
1647
+ status?: string;
1648
+ trigger_type?: string | null;
1649
+ updated_at?: string | null;
1650
+ user_id?: string | null;
1651
+ };
1652
+ Relationships: [
1653
+ {
1654
+ foreignKeyName: 'execution_history_organization_id_fkey';
1655
+ columns: ['organization_id'];
1656
+ isOneToOne: false;
1657
+ referencedRelation: 'organizations';
1658
+ referencedColumns: ['id'];
1659
+ },
1660
+ {
1661
+ foreignKeyName: 'execution_logs_origin_execution_id_fkey';
1662
+ columns: ['origin_execution_id'];
1663
+ isOneToOne: false;
1664
+ referencedRelation: 'execution_logs';
1665
+ referencedColumns: ['execution_id'];
1666
+ },
1667
+ {
1668
+ foreignKeyName: 'execution_logs_session_id_fkey';
1669
+ columns: ['session_id'];
1670
+ isOneToOne: false;
1671
+ referencedRelation: 'sessions';
1672
+ referencedColumns: ['session_id'];
1673
+ },
1674
+ {
1675
+ foreignKeyName: 'execution_logs_user_id_fkey';
1676
+ columns: ['user_id'];
1677
+ isOneToOne: false;
1678
+ referencedRelation: 'users';
1679
+ referencedColumns: ['id'];
1680
+ }
1681
+ ];
1682
+ };
1683
+ execution_metrics: {
1684
+ Row: {
1685
+ ai_call_count: number;
1686
+ ai_calls: Json | null;
1687
+ automation_savings_usd: number | null;
1688
+ created_at: string | null;
1689
+ duration_ms: number | null;
1690
+ execution_id: string;
1691
+ organization_id: string;
1692
+ resource_id: string;
1693
+ total_cost_usd: number;
1694
+ total_input_tokens: number;
1695
+ total_output_tokens: number;
1696
+ };
1697
+ Insert: {
1698
+ ai_call_count: number;
1699
+ ai_calls?: Json | null;
1700
+ automation_savings_usd?: number | null;
1701
+ created_at?: string | null;
1702
+ duration_ms?: number | null;
1703
+ execution_id: string;
1704
+ organization_id: string;
1705
+ resource_id: string;
1706
+ total_cost_usd: number;
1707
+ total_input_tokens: number;
1708
+ total_output_tokens: number;
1709
+ };
1710
+ Update: {
1711
+ ai_call_count?: number;
1712
+ ai_calls?: Json | null;
1713
+ automation_savings_usd?: number | null;
1714
+ created_at?: string | null;
1715
+ duration_ms?: number | null;
1716
+ execution_id?: string;
1717
+ organization_id?: string;
1718
+ resource_id?: string;
1719
+ total_cost_usd?: number;
1720
+ total_input_tokens?: number;
1721
+ total_output_tokens?: number;
1722
+ };
1723
+ Relationships: [
1724
+ {
1725
+ foreignKeyName: 'execution_metrics_execution_id_fkey';
1726
+ columns: ['execution_id'];
1727
+ isOneToOne: true;
1728
+ referencedRelation: 'execution_logs';
1729
+ referencedColumns: ['execution_id'];
1730
+ },
1731
+ {
1732
+ foreignKeyName: 'execution_metrics_organization_id_fkey';
1733
+ columns: ['organization_id'];
1734
+ isOneToOne: false;
1735
+ referencedRelation: 'organizations';
1736
+ referencedColumns: ['id'];
1737
+ }
1738
+ ];
1739
+ };
1740
+ notifications: {
1741
+ Row: {
1742
+ action_url: string | null;
1743
+ category: string;
1744
+ created_at: string | null;
1745
+ id: string;
1746
+ message: string;
1747
+ organization_id: string;
1748
+ read: boolean | null;
1749
+ read_at: string | null;
1750
+ title: string;
1751
+ user_id: string;
1752
+ };
1753
+ Insert: {
1754
+ action_url?: string | null;
1755
+ category: string;
1756
+ created_at?: string | null;
1757
+ id?: string;
1758
+ message: string;
1759
+ organization_id: string;
1760
+ read?: boolean | null;
1761
+ read_at?: string | null;
1762
+ title: string;
1763
+ user_id: string;
1764
+ };
1765
+ Update: {
1766
+ action_url?: string | null;
1767
+ category?: string;
1768
+ created_at?: string | null;
1769
+ id?: string;
1770
+ message?: string;
1771
+ organization_id?: string;
1772
+ read?: boolean | null;
1773
+ read_at?: string | null;
1774
+ title?: string;
1775
+ user_id?: string;
1776
+ };
1777
+ Relationships: [
1778
+ {
1779
+ foreignKeyName: 'notifications_organization_id_fkey';
1780
+ columns: ['organization_id'];
1781
+ isOneToOne: false;
1782
+ referencedRelation: 'organizations';
1783
+ referencedColumns: ['id'];
1784
+ },
1785
+ {
1786
+ foreignKeyName: 'notifications_user_id_fkey';
1787
+ columns: ['user_id'];
1788
+ isOneToOne: false;
1789
+ referencedRelation: 'users';
1790
+ referencedColumns: ['id'];
1791
+ }
1792
+ ];
1793
+ };
1794
+ org_invitations: {
1795
+ Row: {
1796
+ accept_invitation_url: string | null;
1797
+ accepted_at: string | null;
1798
+ created_at: string | null;
1799
+ email: string;
1800
+ expires_at: string;
1801
+ id: string;
1802
+ invitation_state: string | null;
1803
+ invitation_token: string | null;
1804
+ inviter_user_id: string | null;
1805
+ organization_id: string | null;
1806
+ revoked_at: string | null;
1807
+ role_slug: string | null;
1808
+ updated_at: string | null;
1809
+ workos_invitation_id: string;
1810
+ };
1811
+ Insert: {
1812
+ accept_invitation_url?: string | null;
1813
+ accepted_at?: string | null;
1814
+ created_at?: string | null;
1815
+ email: string;
1816
+ expires_at: string;
1817
+ id?: string;
1818
+ invitation_state?: string | null;
1819
+ invitation_token?: string | null;
1820
+ inviter_user_id?: string | null;
1821
+ organization_id?: string | null;
1822
+ revoked_at?: string | null;
1823
+ role_slug?: string | null;
1824
+ updated_at?: string | null;
1825
+ workos_invitation_id: string;
1826
+ };
1827
+ Update: {
1828
+ accept_invitation_url?: string | null;
1829
+ accepted_at?: string | null;
1830
+ created_at?: string | null;
1831
+ email?: string;
1832
+ expires_at?: string;
1833
+ id?: string;
1834
+ invitation_state?: string | null;
1835
+ invitation_token?: string | null;
1836
+ inviter_user_id?: string | null;
1837
+ organization_id?: string | null;
1838
+ revoked_at?: string | null;
1839
+ role_slug?: string | null;
1840
+ updated_at?: string | null;
1841
+ workos_invitation_id?: string;
1842
+ };
1843
+ Relationships: [
1844
+ {
1845
+ foreignKeyName: 'org_invitations_inviter_user_id_fkey';
1846
+ columns: ['inviter_user_id'];
1847
+ isOneToOne: false;
1848
+ referencedRelation: 'users';
1849
+ referencedColumns: ['id'];
1850
+ },
1851
+ {
1852
+ foreignKeyName: 'org_invitations_organization_id_fkey';
1853
+ columns: ['organization_id'];
1854
+ isOneToOne: false;
1855
+ referencedRelation: 'organizations';
1856
+ referencedColumns: ['id'];
1857
+ }
1858
+ ];
1859
+ };
1860
+ org_memberships: {
1861
+ Row: {
1862
+ config: Json;
1863
+ created_at: string | null;
1864
+ effective_permissions: string[];
1865
+ id: string;
1866
+ membership_status: string | null;
1867
+ organization_id: string;
1868
+ role_slug: string | null;
1869
+ updated_at: string | null;
1870
+ user_id: string;
1871
+ workos_membership_id: string | null;
1872
+ };
1873
+ Insert: {
1874
+ config?: Json;
1875
+ created_at?: string | null;
1876
+ effective_permissions?: string[];
1877
+ id?: string;
1878
+ membership_status?: string | null;
1879
+ organization_id: string;
1880
+ role_slug?: string | null;
1881
+ updated_at?: string | null;
1882
+ user_id: string;
1883
+ workos_membership_id?: string | null;
1884
+ };
1885
+ Update: {
1886
+ config?: Json;
1887
+ created_at?: string | null;
1888
+ effective_permissions?: string[];
1889
+ id?: string;
1890
+ membership_status?: string | null;
1891
+ organization_id?: string;
1892
+ role_slug?: string | null;
1893
+ updated_at?: string | null;
1894
+ user_id?: string;
1895
+ workos_membership_id?: string | null;
1896
+ };
1897
+ Relationships: [
1898
+ {
1899
+ foreignKeyName: 'org_memberships_organization_id_fkey';
1900
+ columns: ['organization_id'];
1901
+ isOneToOne: false;
1902
+ referencedRelation: 'organizations';
1903
+ referencedColumns: ['id'];
1904
+ },
1905
+ {
1906
+ foreignKeyName: 'org_memberships_user_id_fkey';
1907
+ columns: ['user_id'];
1908
+ isOneToOne: false;
1909
+ referencedRelation: 'users';
1910
+ referencedColumns: ['id'];
1911
+ }
1912
+ ];
1913
+ };
1914
+ org_rol_assignments: {
1915
+ Row: {
1916
+ granted_at: string;
1917
+ granted_by: string | null;
1918
+ membership_id: string;
1919
+ role_id: string;
1920
+ };
1921
+ Insert: {
1922
+ granted_at?: string;
1923
+ granted_by?: string | null;
1924
+ membership_id: string;
1925
+ role_id: string;
1926
+ };
1927
+ Update: {
1928
+ granted_at?: string;
1929
+ granted_by?: string | null;
1930
+ membership_id?: string;
1931
+ role_id?: string;
1932
+ };
1933
+ Relationships: [
1934
+ {
1935
+ foreignKeyName: 'org_rol_assignments_granted_by_fkey';
1936
+ columns: ['granted_by'];
1937
+ isOneToOne: false;
1938
+ referencedRelation: 'users';
1939
+ referencedColumns: ['id'];
1940
+ },
1941
+ {
1942
+ foreignKeyName: 'org_rol_assignments_membership_id_fkey';
1943
+ columns: ['membership_id'];
1944
+ isOneToOne: false;
1945
+ referencedRelation: 'org_memberships';
1946
+ referencedColumns: ['id'];
1947
+ },
1948
+ {
1949
+ foreignKeyName: 'org_rol_assignments_role_id_fkey';
1950
+ columns: ['role_id'];
1951
+ isOneToOne: false;
1952
+ referencedRelation: 'org_rol_definitions';
1953
+ referencedColumns: ['id'];
1954
+ }
1955
+ ];
1956
+ };
1957
+ org_rol_definitions: {
1958
+ Row: {
1959
+ created_at: string;
1960
+ description: string | null;
1961
+ id: string;
1962
+ is_system: boolean;
1963
+ name: string;
1964
+ organization_id: string | null;
1965
+ slug: string;
1966
+ updated_at: string;
1967
+ };
1968
+ Insert: {
1969
+ created_at?: string;
1970
+ description?: string | null;
1971
+ id?: string;
1972
+ is_system?: boolean;
1973
+ name: string;
1974
+ organization_id?: string | null;
1975
+ slug: string;
1976
+ updated_at?: string;
1977
+ };
1978
+ Update: {
1979
+ created_at?: string;
1980
+ description?: string | null;
1981
+ id?: string;
1982
+ is_system?: boolean;
1983
+ name?: string;
1984
+ organization_id?: string | null;
1985
+ slug?: string;
1986
+ updated_at?: string;
1987
+ };
1988
+ Relationships: [
1989
+ {
1990
+ foreignKeyName: 'org_rol_definitions_organization_id_fkey';
1991
+ columns: ['organization_id'];
1992
+ isOneToOne: false;
1993
+ referencedRelation: 'organizations';
1994
+ referencedColumns: ['id'];
1995
+ }
1996
+ ];
1997
+ };
1998
+ org_rol_grants: {
1999
+ Row: {
2000
+ granted_at: string;
2001
+ permission_key: string;
2002
+ role_id: string;
2003
+ };
2004
+ Insert: {
2005
+ granted_at?: string;
2006
+ permission_key: string;
2007
+ role_id: string;
2008
+ };
2009
+ Update: {
2010
+ granted_at?: string;
2011
+ permission_key?: string;
2012
+ role_id?: string;
2013
+ };
2014
+ Relationships: [
2015
+ {
2016
+ foreignKeyName: 'org_rol_grants_permission_key_fkey';
2017
+ columns: ['permission_key'];
2018
+ isOneToOne: false;
2019
+ referencedRelation: 'org_rol_permissions';
2020
+ referencedColumns: ['key'];
2021
+ },
2022
+ {
2023
+ foreignKeyName: 'org_rol_grants_role_id_fkey';
2024
+ columns: ['role_id'];
2025
+ isOneToOne: false;
2026
+ referencedRelation: 'org_rol_definitions';
2027
+ referencedColumns: ['id'];
2028
+ }
2029
+ ];
2030
+ };
2031
+ org_rol_permissions: {
2032
+ Row: {
2033
+ created_at: string;
2034
+ description: string;
2035
+ is_org_grantable: boolean;
2036
+ key: string;
2037
+ updated_at: string;
2038
+ };
2039
+ Insert: {
2040
+ created_at?: string;
2041
+ description: string;
2042
+ is_org_grantable?: boolean;
2043
+ key: string;
2044
+ updated_at?: string;
2045
+ };
2046
+ Update: {
2047
+ created_at?: string;
2048
+ description?: string;
2049
+ is_org_grantable?: boolean;
2050
+ key?: string;
2051
+ updated_at?: string;
2052
+ };
2053
+ Relationships: [];
2054
+ };
2055
+ organizations: {
2056
+ Row: {
2057
+ config: Json;
2058
+ created_at: string;
2059
+ id: string;
2060
+ is_test: boolean;
2061
+ metadata: Json;
2062
+ name: string;
2063
+ status: string;
2064
+ updated_at: string;
2065
+ workos_org_id: string;
2066
+ };
2067
+ Insert: {
2068
+ config?: Json;
2069
+ created_at?: string;
2070
+ id?: string;
2071
+ is_test?: boolean;
2072
+ metadata?: Json;
2073
+ name: string;
2074
+ status?: string;
2075
+ updated_at?: string;
2076
+ workos_org_id: string;
2077
+ };
2078
+ Update: {
2079
+ config?: Json;
2080
+ created_at?: string;
2081
+ id?: string;
2082
+ is_test?: boolean;
2083
+ metadata?: Json;
2084
+ name?: string;
2085
+ status?: string;
2086
+ updated_at?: string;
2087
+ workos_org_id?: string;
2088
+ };
2089
+ Relationships: [];
2090
+ };
2091
+ prj_milestones: {
2092
+ Row: {
2093
+ checklist: Json | null;
2094
+ completed_at: string | null;
2095
+ created_at: string;
2096
+ description: string | null;
2097
+ due_date: string | null;
2098
+ id: string;
2099
+ metadata: Json | null;
2100
+ name: string;
2101
+ organization_id: string;
2102
+ project_id: string;
2103
+ sequence: number;
2104
+ status: string;
2105
+ updated_at: string;
2106
+ };
2107
+ Insert: {
2108
+ checklist?: Json | null;
2109
+ completed_at?: string | null;
2110
+ created_at?: string;
2111
+ description?: string | null;
2112
+ due_date?: string | null;
2113
+ id?: string;
2114
+ metadata?: Json | null;
2115
+ name: string;
2116
+ organization_id: string;
2117
+ project_id: string;
2118
+ sequence?: number;
2119
+ status?: string;
2120
+ updated_at?: string;
2121
+ };
2122
+ Update: {
2123
+ checklist?: Json | null;
2124
+ completed_at?: string | null;
2125
+ created_at?: string;
2126
+ description?: string | null;
2127
+ due_date?: string | null;
2128
+ id?: string;
2129
+ metadata?: Json | null;
2130
+ name?: string;
2131
+ organization_id?: string;
2132
+ project_id?: string;
2133
+ sequence?: number;
2134
+ status?: string;
2135
+ updated_at?: string;
2136
+ };
2137
+ Relationships: [
2138
+ {
2139
+ foreignKeyName: 'fk_milestones_project';
2140
+ columns: ['project_id'];
2141
+ isOneToOne: false;
2142
+ referencedRelation: 'prj_projects';
2143
+ referencedColumns: ['id'];
2144
+ },
2145
+ {
2146
+ foreignKeyName: 'prj_milestones_organization_id_fkey';
2147
+ columns: ['organization_id'];
2148
+ isOneToOne: false;
2149
+ referencedRelation: 'organizations';
2150
+ referencedColumns: ['id'];
2151
+ },
2152
+ {
2153
+ foreignKeyName: 'prj_milestones_project_id_fkey';
2154
+ columns: ['project_id'];
2155
+ isOneToOne: false;
2156
+ referencedRelation: 'prj_projects';
2157
+ referencedColumns: ['id'];
2158
+ }
2159
+ ];
2160
+ };
2161
+ prj_notes: {
2162
+ Row: {
2163
+ content: string;
2164
+ created_at: string;
2165
+ created_by: string | null;
2166
+ id: string;
2167
+ metadata: Json | null;
2168
+ milestone_id: string | null;
2169
+ occurred_at: string;
2170
+ organization_id: string;
2171
+ project_id: string;
2172
+ summary: string | null;
2173
+ task_id: string | null;
2174
+ type: string;
2175
+ };
2176
+ Insert: {
2177
+ content: string;
2178
+ created_at?: string;
2179
+ created_by?: string | null;
2180
+ id?: string;
2181
+ metadata?: Json | null;
2182
+ milestone_id?: string | null;
2183
+ occurred_at?: string;
2184
+ organization_id: string;
2185
+ project_id: string;
2186
+ summary?: string | null;
2187
+ task_id?: string | null;
2188
+ type?: string;
2189
+ };
2190
+ Update: {
2191
+ content?: string;
2192
+ created_at?: string;
2193
+ created_by?: string | null;
2194
+ id?: string;
2195
+ metadata?: Json | null;
2196
+ milestone_id?: string | null;
2197
+ occurred_at?: string;
2198
+ organization_id?: string;
2199
+ project_id?: string;
2200
+ summary?: string | null;
2201
+ task_id?: string | null;
2202
+ type?: string;
2203
+ };
2204
+ Relationships: [
2205
+ {
2206
+ foreignKeyName: 'fk_notes_created_by';
2207
+ columns: ['created_by'];
2208
+ isOneToOne: false;
2209
+ referencedRelation: 'users';
2210
+ referencedColumns: ['id'];
2211
+ },
2212
+ {
2213
+ foreignKeyName: 'fk_notes_milestone';
2214
+ columns: ['milestone_id'];
2215
+ isOneToOne: false;
2216
+ referencedRelation: 'prj_milestones';
2217
+ referencedColumns: ['id'];
2218
+ },
2219
+ {
2220
+ foreignKeyName: 'fk_notes_project';
2221
+ columns: ['project_id'];
2222
+ isOneToOne: false;
2223
+ referencedRelation: 'prj_projects';
2224
+ referencedColumns: ['id'];
2225
+ },
2226
+ {
2227
+ foreignKeyName: 'fk_notes_task';
2228
+ columns: ['task_id'];
2229
+ isOneToOne: false;
2230
+ referencedRelation: 'prj_tasks';
2231
+ referencedColumns: ['id'];
2232
+ },
2233
+ {
2234
+ foreignKeyName: 'prj_notes_created_by_fkey';
2235
+ columns: ['created_by'];
2236
+ isOneToOne: false;
2237
+ referencedRelation: 'users';
2238
+ referencedColumns: ['id'];
2239
+ },
2240
+ {
2241
+ foreignKeyName: 'prj_notes_milestone_id_fkey';
2242
+ columns: ['milestone_id'];
2243
+ isOneToOne: false;
2244
+ referencedRelation: 'prj_milestones';
2245
+ referencedColumns: ['id'];
2246
+ },
2247
+ {
2248
+ foreignKeyName: 'prj_notes_organization_id_fkey';
2249
+ columns: ['organization_id'];
2250
+ isOneToOne: false;
2251
+ referencedRelation: 'organizations';
2252
+ referencedColumns: ['id'];
2253
+ },
2254
+ {
2255
+ foreignKeyName: 'prj_notes_project_id_fkey';
2256
+ columns: ['project_id'];
2257
+ isOneToOne: false;
2258
+ referencedRelation: 'prj_projects';
2259
+ referencedColumns: ['id'];
2260
+ },
2261
+ {
2262
+ foreignKeyName: 'prj_notes_task_id_fkey';
2263
+ columns: ['task_id'];
2264
+ isOneToOne: false;
2265
+ referencedRelation: 'prj_tasks';
2266
+ referencedColumns: ['id'];
2267
+ }
2268
+ ];
2269
+ };
2270
+ prj_projects: {
2271
+ Row: {
2272
+ actual_end_date: string | null;
2273
+ client_company_id: string | null;
2274
+ contract_value: number | null;
2275
+ created_at: string;
2276
+ deal_id: string | null;
2277
+ description: string | null;
2278
+ id: string;
2279
+ kind: string;
2280
+ metadata: Json | null;
2281
+ name: string;
2282
+ organization_id: string;
2283
+ start_date: string | null;
2284
+ status: string;
2285
+ target_end_date: string | null;
2286
+ updated_at: string;
2287
+ };
2288
+ Insert: {
2289
+ actual_end_date?: string | null;
2290
+ client_company_id?: string | null;
2291
+ contract_value?: number | null;
2292
+ created_at?: string;
2293
+ deal_id?: string | null;
2294
+ description?: string | null;
2295
+ id?: string;
2296
+ kind?: string;
2297
+ metadata?: Json | null;
2298
+ name: string;
2299
+ organization_id: string;
2300
+ start_date?: string | null;
2301
+ status?: string;
2302
+ target_end_date?: string | null;
2303
+ updated_at?: string;
2304
+ };
2305
+ Update: {
2306
+ actual_end_date?: string | null;
2307
+ client_company_id?: string | null;
2308
+ contract_value?: number | null;
2309
+ created_at?: string;
2310
+ deal_id?: string | null;
2311
+ description?: string | null;
2312
+ id?: string;
2313
+ kind?: string;
2314
+ metadata?: Json | null;
2315
+ name?: string;
2316
+ organization_id?: string;
2317
+ start_date?: string | null;
2318
+ status?: string;
2319
+ target_end_date?: string | null;
2320
+ updated_at?: string;
2321
+ };
2322
+ Relationships: [
2323
+ {
2324
+ foreignKeyName: 'fk_projects_company';
2325
+ columns: ['client_company_id'];
2326
+ isOneToOne: false;
2327
+ referencedRelation: 'acq_companies';
2328
+ referencedColumns: ['id'];
2329
+ },
2330
+ {
2331
+ foreignKeyName: 'fk_projects_deal';
2332
+ columns: ['deal_id'];
2333
+ isOneToOne: false;
2334
+ referencedRelation: 'acq_deals';
2335
+ referencedColumns: ['id'];
2336
+ },
2337
+ {
2338
+ foreignKeyName: 'prj_projects_client_company_id_fkey';
2339
+ columns: ['client_company_id'];
2340
+ isOneToOne: false;
2341
+ referencedRelation: 'acq_companies';
2342
+ referencedColumns: ['id'];
2343
+ },
2344
+ {
2345
+ foreignKeyName: 'prj_projects_deal_id_fkey';
2346
+ columns: ['deal_id'];
2347
+ isOneToOne: false;
2348
+ referencedRelation: 'acq_deals';
2349
+ referencedColumns: ['id'];
2350
+ },
2351
+ {
2352
+ foreignKeyName: 'prj_projects_organization_id_fkey';
2353
+ columns: ['organization_id'];
2354
+ isOneToOne: false;
2355
+ referencedRelation: 'organizations';
2356
+ referencedColumns: ['id'];
2357
+ }
2358
+ ];
2359
+ };
2360
+ prj_tasks: {
2361
+ Row: {
2362
+ checklist: Json;
2363
+ completed_at: string | null;
2364
+ created_at: string;
2365
+ description: string | null;
2366
+ due_date: string | null;
2367
+ file_url: string | null;
2368
+ id: string;
2369
+ metadata: Json | null;
2370
+ milestone_id: string | null;
2371
+ name: string;
2372
+ organization_id: string;
2373
+ parent_task_id: string | null;
2374
+ project_id: string;
2375
+ resume_context: Json | null;
2376
+ status: string;
2377
+ type: string;
2378
+ updated_at: string;
2379
+ };
2380
+ Insert: {
2381
+ checklist?: Json;
2382
+ completed_at?: string | null;
2383
+ created_at?: string;
2384
+ description?: string | null;
2385
+ due_date?: string | null;
2386
+ file_url?: string | null;
2387
+ id?: string;
2388
+ metadata?: Json | null;
2389
+ milestone_id?: string | null;
2390
+ name: string;
2391
+ organization_id: string;
2392
+ parent_task_id?: string | null;
2393
+ project_id: string;
2394
+ resume_context?: Json | null;
2395
+ status?: string;
2396
+ type?: string;
2397
+ updated_at?: string;
2398
+ };
2399
+ Update: {
2400
+ checklist?: Json;
2401
+ completed_at?: string | null;
2402
+ created_at?: string;
2403
+ description?: string | null;
2404
+ due_date?: string | null;
2405
+ file_url?: string | null;
2406
+ id?: string;
2407
+ metadata?: Json | null;
2408
+ milestone_id?: string | null;
2409
+ name?: string;
2410
+ organization_id?: string;
2411
+ parent_task_id?: string | null;
2412
+ project_id?: string;
2413
+ resume_context?: Json | null;
2414
+ status?: string;
2415
+ type?: string;
2416
+ updated_at?: string;
2417
+ };
2418
+ Relationships: [
2419
+ {
2420
+ foreignKeyName: 'fk_tasks_milestone';
2421
+ columns: ['milestone_id'];
2422
+ isOneToOne: false;
2423
+ referencedRelation: 'prj_milestones';
2424
+ referencedColumns: ['id'];
2425
+ },
2426
+ {
2427
+ foreignKeyName: 'fk_tasks_parent';
2428
+ columns: ['parent_task_id'];
2429
+ isOneToOne: false;
2430
+ referencedRelation: 'prj_tasks';
2431
+ referencedColumns: ['id'];
2432
+ },
2433
+ {
2434
+ foreignKeyName: 'fk_tasks_project';
2435
+ columns: ['project_id'];
2436
+ isOneToOne: false;
2437
+ referencedRelation: 'prj_projects';
2438
+ referencedColumns: ['id'];
2439
+ },
2440
+ {
2441
+ foreignKeyName: 'prj_tasks_milestone_id_fkey';
2442
+ columns: ['milestone_id'];
2443
+ isOneToOne: false;
2444
+ referencedRelation: 'prj_milestones';
2445
+ referencedColumns: ['id'];
2446
+ },
2447
+ {
2448
+ foreignKeyName: 'prj_tasks_organization_id_fkey';
2449
+ columns: ['organization_id'];
2450
+ isOneToOne: false;
2451
+ referencedRelation: 'organizations';
2452
+ referencedColumns: ['id'];
2453
+ },
2454
+ {
2455
+ foreignKeyName: 'prj_tasks_parent_task_id_fkey';
2456
+ columns: ['parent_task_id'];
2457
+ isOneToOne: false;
2458
+ referencedRelation: 'prj_tasks';
2459
+ referencedColumns: ['id'];
2460
+ },
2461
+ {
2462
+ foreignKeyName: 'prj_tasks_project_id_fkey';
2463
+ columns: ['project_id'];
2464
+ isOneToOne: false;
2465
+ referencedRelation: 'prj_projects';
2466
+ referencedColumns: ['id'];
2467
+ }
2468
+ ];
2469
+ };
2470
+ reported_requests: {
2471
+ Row: {
2472
+ affected_page: string | null;
2473
+ category: string;
2474
+ context: Json | null;
2475
+ created_at: string;
2476
+ description: string;
2477
+ evidence: Json | null;
2478
+ id: string;
2479
+ organization_id: string;
2480
+ project_id: string | null;
2481
+ reported_at: string;
2482
+ reporter_id: string | null;
2483
+ resolved_at: string | null;
2484
+ severity: string;
2485
+ source: string;
2486
+ status: string;
2487
+ task_id: string | null;
2488
+ title: string;
2489
+ type: string;
2490
+ updated_at: string;
2491
+ };
2492
+ Insert: {
2493
+ affected_page?: string | null;
2494
+ category: string;
2495
+ context?: Json | null;
2496
+ created_at?: string;
2497
+ description: string;
2498
+ evidence?: Json | null;
2499
+ id?: string;
2500
+ organization_id: string;
2501
+ project_id?: string | null;
2502
+ reported_at?: string;
2503
+ reporter_id?: string | null;
2504
+ resolved_at?: string | null;
2505
+ severity: string;
2506
+ source: string;
2507
+ status?: string;
2508
+ task_id?: string | null;
2509
+ title: string;
2510
+ type: string;
2511
+ updated_at?: string;
2512
+ };
2513
+ Update: {
2514
+ affected_page?: string | null;
2515
+ category?: string;
2516
+ context?: Json | null;
2517
+ created_at?: string;
2518
+ description?: string;
2519
+ evidence?: Json | null;
2520
+ id?: string;
2521
+ organization_id?: string;
2522
+ project_id?: string | null;
2523
+ reported_at?: string;
2524
+ reporter_id?: string | null;
2525
+ resolved_at?: string | null;
2526
+ severity?: string;
2527
+ source?: string;
2528
+ status?: string;
2529
+ task_id?: string | null;
2530
+ title?: string;
2531
+ type?: string;
2532
+ updated_at?: string;
2533
+ };
2534
+ Relationships: [
2535
+ {
2536
+ foreignKeyName: 'reported_requests_organization_id_fkey';
2537
+ columns: ['organization_id'];
2538
+ isOneToOne: false;
2539
+ referencedRelation: 'organizations';
2540
+ referencedColumns: ['id'];
2541
+ },
2542
+ {
2543
+ foreignKeyName: 'reported_requests_project_id_fkey';
2544
+ columns: ['project_id'];
2545
+ isOneToOne: false;
2546
+ referencedRelation: 'prj_projects';
2547
+ referencedColumns: ['id'];
2548
+ },
2549
+ {
2550
+ foreignKeyName: 'reported_requests_task_id_fkey';
2551
+ columns: ['task_id'];
2552
+ isOneToOne: false;
2553
+ referencedRelation: 'prj_tasks';
2554
+ referencedColumns: ['id'];
2555
+ }
2556
+ ];
2557
+ };
2558
+ session_messages: {
2559
+ Row: {
2560
+ created_at: string | null;
2561
+ id: string;
2562
+ message: string;
2563
+ message_index: number | null;
2564
+ message_type: string | null;
2565
+ metadata: Json | null;
2566
+ role: string;
2567
+ session_id: string;
2568
+ session_turn_number: number;
2569
+ };
2570
+ Insert: {
2571
+ created_at?: string | null;
2572
+ id: string;
2573
+ message: string;
2574
+ message_index?: number | null;
2575
+ message_type?: string | null;
2576
+ metadata?: Json | null;
2577
+ role: string;
2578
+ session_id: string;
2579
+ session_turn_number: number;
2580
+ };
2581
+ Update: {
2582
+ created_at?: string | null;
2583
+ id?: string;
2584
+ message?: string;
2585
+ message_index?: number | null;
2586
+ message_type?: string | null;
2587
+ metadata?: Json | null;
2588
+ role?: string;
2589
+ session_id?: string;
2590
+ session_turn_number?: number;
2591
+ };
2592
+ Relationships: [
2593
+ {
2594
+ foreignKeyName: 'session_messages_session_id_fkey';
2595
+ columns: ['session_id'];
2596
+ isOneToOne: false;
2597
+ referencedRelation: 'sessions';
2598
+ referencedColumns: ['session_id'];
2599
+ }
2600
+ ];
2601
+ };
2602
+ sessions: {
2603
+ Row: {
2604
+ context_window_size: number;
2605
+ created_at: string | null;
2606
+ cumulative_input_tokens: number;
2607
+ cumulative_output_tokens: number;
2608
+ deleted_at: string | null;
2609
+ ended_at: string | null;
2610
+ memory_snapshot: Json;
2611
+ metadata: Json | null;
2612
+ organization_id: string;
2613
+ resource_id: string;
2614
+ session_id: string;
2615
+ session_total_turns: number | null;
2616
+ updated_at: string | null;
2617
+ user_id: string | null;
2618
+ };
2619
+ Insert: {
2620
+ context_window_size?: number;
2621
+ created_at?: string | null;
2622
+ cumulative_input_tokens?: number;
2623
+ cumulative_output_tokens?: number;
2624
+ deleted_at?: string | null;
2625
+ ended_at?: string | null;
2626
+ memory_snapshot: Json;
2627
+ metadata?: Json | null;
2628
+ organization_id: string;
2629
+ resource_id: string;
2630
+ session_id?: string;
2631
+ session_total_turns?: number | null;
2632
+ updated_at?: string | null;
2633
+ user_id?: string | null;
2634
+ };
2635
+ Update: {
2636
+ context_window_size?: number;
2637
+ created_at?: string | null;
2638
+ cumulative_input_tokens?: number;
2639
+ cumulative_output_tokens?: number;
2640
+ deleted_at?: string | null;
2641
+ ended_at?: string | null;
2642
+ memory_snapshot?: Json;
2643
+ metadata?: Json | null;
2644
+ organization_id?: string;
2645
+ resource_id?: string;
2646
+ session_id?: string;
2647
+ session_total_turns?: number | null;
2648
+ updated_at?: string | null;
2649
+ user_id?: string | null;
2650
+ };
2651
+ Relationships: [
2652
+ {
2653
+ foreignKeyName: 'fk_organization';
2654
+ columns: ['organization_id'];
2655
+ isOneToOne: false;
2656
+ referencedRelation: 'organizations';
2657
+ referencedColumns: ['id'];
2658
+ },
2659
+ {
2660
+ foreignKeyName: 'fk_user';
2661
+ columns: ['user_id'];
2662
+ isOneToOne: false;
2663
+ referencedRelation: 'users';
2664
+ referencedColumns: ['id'];
2665
+ }
2666
+ ];
2667
+ };
2668
+ task_schedules: {
2669
+ Row: {
2670
+ created_at: string;
2671
+ current_step: number;
2672
+ description: string | null;
2673
+ id: string;
2674
+ idempotency_key: string | null;
2675
+ last_execution_id: string | null;
2676
+ last_run_at: string | null;
2677
+ max_retries: number;
2678
+ metadata: Json | null;
2679
+ name: string;
2680
+ next_run_at: string | null;
2681
+ organization_id: string;
2682
+ origin_execution_id: string | null;
2683
+ origin_resource_id: string | null;
2684
+ origin_resource_type: string | null;
2685
+ retry_count: number;
2686
+ schedule_config: Json;
2687
+ status: string;
2688
+ target_resource_id: string;
2689
+ target_resource_type: string;
2690
+ updated_at: string;
2691
+ };
2692
+ Insert: {
2693
+ created_at?: string;
2694
+ current_step?: number;
2695
+ description?: string | null;
2696
+ id?: string;
2697
+ idempotency_key?: string | null;
2698
+ last_execution_id?: string | null;
2699
+ last_run_at?: string | null;
2700
+ max_retries?: number;
2701
+ metadata?: Json | null;
2702
+ name: string;
2703
+ next_run_at?: string | null;
2704
+ organization_id: string;
2705
+ origin_execution_id?: string | null;
2706
+ origin_resource_id?: string | null;
2707
+ origin_resource_type?: string | null;
2708
+ retry_count?: number;
2709
+ schedule_config: Json;
2710
+ status?: string;
2711
+ target_resource_id: string;
2712
+ target_resource_type: string;
2713
+ updated_at?: string;
2714
+ };
2715
+ Update: {
2716
+ created_at?: string;
2717
+ current_step?: number;
2718
+ description?: string | null;
2719
+ id?: string;
2720
+ idempotency_key?: string | null;
2721
+ last_execution_id?: string | null;
2722
+ last_run_at?: string | null;
2723
+ max_retries?: number;
2724
+ metadata?: Json | null;
2725
+ name?: string;
2726
+ next_run_at?: string | null;
2727
+ organization_id?: string;
2728
+ origin_execution_id?: string | null;
2729
+ origin_resource_id?: string | null;
2730
+ origin_resource_type?: string | null;
2731
+ retry_count?: number;
2732
+ schedule_config?: Json;
2733
+ status?: string;
2734
+ target_resource_id?: string;
2735
+ target_resource_type?: string;
2736
+ updated_at?: string;
2737
+ };
2738
+ Relationships: [
2739
+ {
2740
+ foreignKeyName: 'task_schedules_organization_id_fkey';
2741
+ columns: ['organization_id'];
2742
+ isOneToOne: false;
2743
+ referencedRelation: 'organizations';
2744
+ referencedColumns: ['id'];
2745
+ }
2746
+ ];
2747
+ };
2748
+ users: {
2749
+ Row: {
2750
+ config: Json;
2751
+ created_at: string;
2752
+ display_name: string | null;
2753
+ email: string;
2754
+ first_name: string | null;
2755
+ id: string;
2756
+ is_active: boolean;
2757
+ is_platform_admin: boolean | null;
2758
+ last_login_at: string | null;
2759
+ last_name: string | null;
2760
+ last_visited_org: string | null;
2761
+ profile_picture_url: string | null;
2762
+ updated_at: string;
2763
+ workos_user_id: string | null;
2764
+ };
2765
+ Insert: {
2766
+ config?: Json;
2767
+ created_at?: string;
2768
+ display_name?: string | null;
2769
+ email: string;
2770
+ first_name?: string | null;
2771
+ id?: string;
2772
+ is_active?: boolean;
2773
+ is_platform_admin?: boolean | null;
2774
+ last_login_at?: string | null;
2775
+ last_name?: string | null;
2776
+ last_visited_org?: string | null;
2777
+ profile_picture_url?: string | null;
2778
+ updated_at?: string;
2779
+ workos_user_id?: string | null;
2780
+ };
2781
+ Update: {
2782
+ config?: Json;
2783
+ created_at?: string;
2784
+ display_name?: string | null;
2785
+ email?: string;
2786
+ first_name?: string | null;
2787
+ id?: string;
2788
+ is_active?: boolean;
2789
+ is_platform_admin?: boolean | null;
2790
+ last_login_at?: string | null;
2791
+ last_name?: string | null;
2792
+ last_visited_org?: string | null;
2793
+ profile_picture_url?: string | null;
2794
+ updated_at?: string;
2795
+ workos_user_id?: string | null;
2796
+ };
2797
+ Relationships: [
2798
+ {
2799
+ foreignKeyName: 'user_profiles_last_visited_org_fkey';
2800
+ columns: ['last_visited_org'];
2801
+ isOneToOne: false;
2802
+ referencedRelation: 'organizations';
2803
+ referencedColumns: ['id'];
2804
+ }
2805
+ ];
2806
+ };
2807
+ webhook_endpoints: {
2808
+ Row: {
2809
+ created_at: string;
2810
+ description: string | null;
2811
+ id: string;
2812
+ key_hash: string;
2813
+ key_prefix: string | null;
2814
+ last_triggered_at: string | null;
2815
+ name: string;
2816
+ organization_id: string;
2817
+ request_count: number;
2818
+ resource_id: string | null;
2819
+ status: string;
2820
+ updated_at: string;
2821
+ };
2822
+ Insert: {
2823
+ created_at?: string;
2824
+ description?: string | null;
2825
+ id?: string;
2826
+ key_hash: string;
2827
+ key_prefix?: string | null;
2828
+ last_triggered_at?: string | null;
2829
+ name: string;
2830
+ organization_id: string;
2831
+ request_count?: number;
2832
+ resource_id?: string | null;
2833
+ status?: string;
2834
+ updated_at?: string;
2835
+ };
2836
+ Update: {
2837
+ created_at?: string;
2838
+ description?: string | null;
2839
+ id?: string;
2840
+ key_hash?: string;
2841
+ key_prefix?: string | null;
2842
+ last_triggered_at?: string | null;
2843
+ name?: string;
2844
+ organization_id?: string;
2845
+ request_count?: number;
2846
+ resource_id?: string | null;
2847
+ status?: string;
2848
+ updated_at?: string;
2849
+ };
2850
+ Relationships: [
2851
+ {
2852
+ foreignKeyName: 'webhook_endpoints_organization_id_fkey';
2853
+ columns: ['organization_id'];
2854
+ isOneToOne: false;
2855
+ referencedRelation: 'organizations';
2856
+ referencedColumns: ['id'];
2857
+ }
2858
+ ];
2859
+ };
2860
+ };
2861
+ Views: {
2862
+ [_ in never]: never;
2863
+ };
2864
+ Functions: {
2865
+ acq_default_checklist: {
2866
+ Args: {
2867
+ p_platform: string;
2868
+ };
2869
+ Returns: Json;
2870
+ };
2871
+ append_deal_activity: {
2872
+ Args: {
2873
+ p_activity: Json;
2874
+ p_deal_id: string;
2875
+ p_organization_id: string;
2876
+ };
2877
+ Returns: undefined;
2878
+ };
2879
+ auth_jwt_claims: {
2880
+ Args: never;
2881
+ Returns: Json;
2882
+ };
2883
+ auth_uid_safe: {
2884
+ Args: never;
2885
+ Returns: string;
2886
+ };
2887
+ can_assign_role_in_org: {
2888
+ Args: {
2889
+ p_role_id: string;
2890
+ p_target_membership_id: string;
2891
+ };
2892
+ Returns: boolean;
2893
+ };
2894
+ current_user_is_platform_admin: {
2895
+ Args: never;
2896
+ Returns: boolean;
2897
+ };
2898
+ current_user_supabase_id: {
2899
+ Args: never;
2900
+ Returns: string;
2901
+ };
2902
+ detect_stalled_executions: {
2903
+ Args: never;
2904
+ Returns: undefined;
2905
+ };
2906
+ execute_session_turn: {
2907
+ Args: {
2908
+ p_session_id: string;
2909
+ };
2910
+ Returns: {
2911
+ created_at: string;
2912
+ ended_at: string;
2913
+ memory_snapshot: Json;
2914
+ metadata: Json;
2915
+ organization_id: string;
2916
+ resource_id: string;
2917
+ session_id: string;
2918
+ session_total_turns: number;
2919
+ updated_at: string;
2920
+ user_id: string;
2921
+ }[];
2922
+ };
2923
+ get_platform_credential_kek: {
2924
+ Args: never;
2925
+ Returns: string;
2926
+ };
2927
+ get_storage_org_id: {
2928
+ Args: {
2929
+ file_path: string;
2930
+ };
2931
+ Returns: string;
2932
+ };
2933
+ get_workos_user_id: {
2934
+ Args: never;
2935
+ Returns: string;
2936
+ };
2937
+ has_org_permission: {
2938
+ Args: {
2939
+ org_id: string;
2940
+ perm_key: string;
2941
+ };
2942
+ Returns: boolean;
2943
+ };
2944
+ is_org_member: {
2945
+ Args: {
2946
+ org_id: string;
2947
+ };
2948
+ Returns: boolean;
2949
+ };
2950
+ link_workos_membership_on_accept: {
2951
+ Args: {
2952
+ p_email: string;
2953
+ p_organization_id: string;
2954
+ p_workos_membership_id: string;
2955
+ };
2956
+ Returns: boolean;
2957
+ };
2958
+ pre_provision_invited_user: {
2959
+ Args: {
2960
+ p_email: string;
2961
+ p_organization_id: string;
2962
+ p_role_slug?: string;
2963
+ };
2964
+ Returns: Json;
2965
+ };
2966
+ process_due_schedules: {
2967
+ Args: never;
2968
+ Returns: Json;
2969
+ };
2970
+ recompute_all_memberships: {
2971
+ Args: never;
2972
+ Returns: undefined;
2973
+ };
2974
+ sync_all_memberships_with_role: {
2975
+ Args: {
2976
+ p_role_id: string;
2977
+ };
2978
+ Returns: undefined;
2979
+ };
2980
+ sync_one_membership: {
2981
+ Args: {
2982
+ p_membership_id: string;
2983
+ };
2984
+ Returns: undefined;
2985
+ };
2986
+ upsert_user_profile: {
2987
+ Args: never;
2988
+ Returns: {
2989
+ profile_display_name: string;
2990
+ profile_email: string;
2991
+ profile_id: string;
2992
+ profile_workos_user_id: string;
2993
+ }[];
2994
+ };
2995
+ };
2996
+ Enums: {
2997
+ [_ in never]: never;
2998
+ };
2999
+ CompositeTypes: {
3000
+ [_ in never]: never;
3001
+ };
3002
+ };
108
3003
  };
109
- /**
110
- * Theme token overrides. Each key maps 1:1 to a CSS variable.
111
- * All optional — defaults come from Elevasis design system.
112
- */
113
- interface ElevasisTokenOverrides {
114
- primary?: string;
115
- /** Text color that contrasts with `primary`. Defaults to '#fff'. */
116
- primaryContrast?: string;
117
- background?: string;
118
- surface?: string;
119
- surfaceHover?: string;
120
- /** Opaque surface for floating overlays (modals, menus, popovers) — guarantees readable contrast against decorative backgrounds. */
121
- elevatedSurface?: string;
122
- text?: string;
123
- textDimmed?: string;
124
- textSubtle?: string;
125
- border?: string;
126
- error?: string;
127
- warning?: string;
128
- success?: string;
129
- glassBackground?: string;
130
- glassBlur?: string;
131
- shadow?: string;
132
- cardShadow?: string;
133
- durationFast?: string;
134
- durationNormal?: string;
135
- easing?: string;
136
- /** Foreground text color for destructive/error buttons. Defaults to '#fff'. */
137
- destructiveFg?: string;
138
- /** Heading font family — used for titles, section headers. */
139
- fontHeading?: string;
140
- /** Body font family — used for general text. */
141
- fontSans?: string;
142
- }
143
- /**
144
- * Core theme config — Mantine-free.
145
- * Used by ElevasisCoreProvider and as the base for ElevasisThemeConfig.
146
- */
147
- interface ElevasisCoreThemeConfig {
148
- /** Color scheme: 'light', 'dark', or 'auto'. Defaults to 'dark'. */
149
- colorScheme?: 'light' | 'dark' | 'auto';
150
- /** Named preset — bundles light/dark token defaults. Defaults to 'default'. Accepts built-in PresetName or custom preset key. */
151
- preset?: PresetName | (string & {});
152
- /**
153
- * Semantic token overrides fed into CSS variables.
154
- * Flat values apply to both schemes. `light`/`dark` nested values win over flat.
155
- */
156
- tokens?: WithSchemes<ElevasisTokenOverrides>;
157
- /** Custom presets map — when provided, used instead of built-in presets. Typically `{ ...presets, ...customPresets }`. */
158
- presets?: Record<string, ThemePreset>;
159
- }
160
- /**
161
- * Auth configuration union.
162
- * 'authkit' (WorkOS AuthKit) is the supported mode.
163
- * 'apiKey' is defined for forward type compatibility but will throw at runtime.
164
- */
165
- type AuthConfig = AuthKitConfig | ApiKeyConfig;
166
- interface AuthKitConfig {
167
- mode: 'authkit';
168
- clientId: string;
169
- /** AuthKit API hostname. Defaults to 'api.workos.com'. */
170
- apiHostname?: string;
171
- /** Redirect URI after auth. */
172
- redirectUri?: string;
173
- /** Keep refresh tokens in localStorage. Defaults to false. */
174
- devMode?: boolean;
175
- }
176
- /** Deferred -- will throw at runtime. */
177
- interface ApiKeyConfig {
178
- mode: 'apiKey';
3004
+
3005
+ /** Raw database row type for acq_deals table */
3006
+ type AcqDealRow = Database['public']['Tables']['acq_deals']['Row'];
3007
+
3008
+ interface ActionDef {
179
3009
  key: string;
180
- }
181
- interface ElevasisCoreProviderProps {
182
- /** Auth configuration. Supports 'authkit' mode. */
183
- auth: AuthConfig;
184
- /**
185
- * Elevasis core theme configuration (Mantine-free).
186
- * Set `colorScheme` ('light', 'dark', 'auto') and override `tokens` (design tokens).
187
- * Defaults: colorScheme='dark', Elevasis design system tokens.
188
- */
189
- theme?: ElevasisCoreThemeConfig;
190
- /**
191
- * @deprecated Organization ID is now resolved automatically via OrganizationProvider.
192
- * This prop is accepted for backwards compatibility during migration but is no longer
193
- * used when the full provider stack is active (apiUrl provided).
194
- */
195
- organizationId?: string | null;
196
- /** Custom QueryClient. If omitted, a default is created internally. */
197
- queryClient?: QueryClient;
198
- /**
199
- * API base URL (e.g., 'https://api.elevasis.com' or 'http://localhost:5170').
200
- * When provided, ElevasisCoreProvider composes the full provider stack:
201
- * ApiClientProvider + ElevasisServiceProvider + ProfileProvider +
202
- * OrganizationProvider + NotificationProvider + InitializationProvider.
203
- * When omitted, no service context is provided (theme-only mode).
204
- */
205
- apiUrl?: string;
206
- /**
207
- * Error callback for API responses with status >= 500.
208
- * Only used when apiUrl is provided.
209
- */
210
- onError?: (endpoint: string, error: Error, details?: ApiErrorDetails) => void;
211
- /**
212
- * @deprecated Organization readiness is now managed internally by OrganizationProvider.
213
- * Accepted for backwards compatibility but ignored when apiUrl is provided.
214
- */
215
- isOrganizationReady?: boolean;
216
- /**
217
- * Notification adapter for displaying success/error/info messages.
218
- * When provided, wraps the subtree in a NotificationProvider with this adapter.
219
- * When omitted, the console fallback adapter is used automatically.
220
- *
221
- * ElevasisUIProvider (Mantine variant) passes a Mantine-backed adapter here automatically.
222
- * Headless/SDK consumers can pass a custom adapter or omit for console output.
223
- */
224
- notifications?: NotificationAdapter;
225
- /**
226
- * Whether to inject CSS variables, `data-elevasis-scheme` attribute, and font links.
227
- * Set to `false` when the consumer has its own complete design system and only
228
- * needs auth + API from this provider. Defaults to `true`.
229
- */
230
- injectStyles?: boolean;
231
- children: ReactNode;
232
- }
233
- /**
234
- * Service context value exposed by ElevasisServiceProvider.
235
- * Provides a ready-to-use apiRequest function and organization state.
236
- *
237
- * For standalone usage (testing, embedding), use ElevasisServiceProvider directly.
238
- * For standard SDK usage, ElevasisUIProvider composes this automatically when apiUrl is provided.
239
- */
240
- interface ElevasisServiceContextValue {
241
- apiRequest: <T>(endpoint: string, options?: RequestInit) => Promise<T>;
242
- organizationId: string | null;
243
- isReady: boolean;
244
- }
245
- interface ElevasisServiceProviderProps {
246
- apiRequest: <T>(endpoint: string, options?: RequestInit) => Promise<T>;
247
- organizationId: string | null;
248
- isReady: boolean;
249
- children: ReactNode;
3010
+ label: string;
3011
+ isAvailableFor: (deal: AcqDealRow) => boolean;
3012
+ workflowId: string;
3013
+ payloadSchema?: z.ZodTypeAny;
250
3014
  }
251
3015
 
252
- /**
253
- * Headless root provider for Elevasis-powered applications.
254
- *
255
- * Pure auth + API provider with no style side-effects. Does not inject CSS
256
- * variables, set `data-elevasis-scheme`, or load fonts. Consumers that need
257
- * Elevasis theming should use `ElevasisUIProvider` (Mantine) instead.
258
- *
259
- * When `apiUrl` is provided, composes the full provider stack:
260
- * QueryClientProvider -> AuthProvider -> ApiClientProvider ->
261
- * ProfileProvider -> OrganizationProvider -> ElevasisServiceProvider ->
262
- * NotificationProvider -> InitializationProvider
263
- *
264
- * @example Headless SDK consumer
265
- * ```tsx
266
- * <ElevasisCoreProvider
267
- * auth={{ mode: 'authkit', clientId: '...', redirectUri: '/' }}
268
- * apiUrl="https://api.elevasis.com"
269
- * >
270
- * <Dashboard />
271
- * </ElevasisCoreProvider>
272
- * ```
273
- */
274
- declare function ElevasisCoreProvider({ auth, queryClient, apiUrl, onError, notifications, children }: ElevasisCoreProviderProps): react_jsx_runtime.JSX.Element;
275
-
276
3016
  /**
277
3017
  * Time range selector for dashboard metrics
278
3018
  */
@@ -566,6 +3306,196 @@ declare const OrganizationModelSchema: z.ZodObject<{
566
3306
  type OrganizationModel = z.infer<typeof OrganizationModelSchema>;
567
3307
  type OrganizationModelFeature = z.infer<typeof FeatureSchema>;
568
3308
 
3309
+ /** Flat + per-scheme override pattern. Flat values apply to both; `light`/`dark` win over flat. */
3310
+ type WithSchemes<T> = T & {
3311
+ light?: T;
3312
+ dark?: T;
3313
+ };
3314
+ /**
3315
+ * Theme token overrides. Each key maps 1:1 to a CSS variable.
3316
+ * All optional — defaults come from Elevasis design system.
3317
+ */
3318
+ interface ElevasisTokenOverrides {
3319
+ primary?: string;
3320
+ /** Text color that contrasts with `primary`. Defaults to '#fff'. */
3321
+ primaryContrast?: string;
3322
+ background?: string;
3323
+ surface?: string;
3324
+ surfaceHover?: string;
3325
+ /** Opaque surface for floating overlays (modals, menus, popovers) — guarantees readable contrast against decorative backgrounds. */
3326
+ elevatedSurface?: string;
3327
+ text?: string;
3328
+ textDimmed?: string;
3329
+ textSubtle?: string;
3330
+ border?: string;
3331
+ error?: string;
3332
+ warning?: string;
3333
+ success?: string;
3334
+ glassBackground?: string;
3335
+ glassBlur?: string;
3336
+ shadow?: string;
3337
+ cardShadow?: string;
3338
+ durationFast?: string;
3339
+ durationNormal?: string;
3340
+ easing?: string;
3341
+ /** Foreground text color for destructive/error buttons. Defaults to '#fff'. */
3342
+ destructiveFg?: string;
3343
+ /** Heading font family — used for titles, section headers. */
3344
+ fontHeading?: string;
3345
+ /** Body font family — used for general text. */
3346
+ fontSans?: string;
3347
+ }
3348
+ /**
3349
+ * Core theme config — Mantine-free.
3350
+ * Used by ElevasisCoreProvider and as the base for ElevasisThemeConfig.
3351
+ */
3352
+ interface ElevasisCoreThemeConfig {
3353
+ /** Color scheme: 'light', 'dark', or 'auto'. Defaults to 'dark'. */
3354
+ colorScheme?: 'light' | 'dark' | 'auto';
3355
+ /** Named preset — bundles light/dark token defaults. Defaults to 'default'. Accepts built-in PresetName or custom preset key. */
3356
+ preset?: PresetName | (string & {});
3357
+ /**
3358
+ * Semantic token overrides fed into CSS variables.
3359
+ * Flat values apply to both schemes. `light`/`dark` nested values win over flat.
3360
+ */
3361
+ tokens?: WithSchemes<ElevasisTokenOverrides>;
3362
+ /** Custom presets map — when provided, used instead of built-in presets. Typically `{ ...presets, ...customPresets }`. */
3363
+ presets?: Record<string, ThemePreset>;
3364
+ }
3365
+ /**
3366
+ * Auth configuration union.
3367
+ * 'authkit' (WorkOS AuthKit) is the supported mode.
3368
+ * 'apiKey' is defined for forward type compatibility but will throw at runtime.
3369
+ */
3370
+ type AuthConfig = AuthKitConfig | ApiKeyConfig;
3371
+ interface AuthKitConfig {
3372
+ mode: 'authkit';
3373
+ clientId: string;
3374
+ /** AuthKit API hostname. Defaults to 'api.workos.com'. */
3375
+ apiHostname?: string;
3376
+ /** Redirect URI after auth. */
3377
+ redirectUri?: string;
3378
+ /** Keep refresh tokens in localStorage. Defaults to false. */
3379
+ devMode?: boolean;
3380
+ }
3381
+ /** Deferred -- will throw at runtime. */
3382
+ interface ApiKeyConfig {
3383
+ mode: 'apiKey';
3384
+ key: string;
3385
+ }
3386
+ interface ElevasisCoreProviderProps {
3387
+ /** Auth configuration. Supports 'authkit' mode. */
3388
+ auth: AuthConfig;
3389
+ /**
3390
+ * Elevasis core theme configuration (Mantine-free).
3391
+ * Set `colorScheme` ('light', 'dark', 'auto') and override `tokens` (design tokens).
3392
+ * Defaults: colorScheme='dark', Elevasis design system tokens.
3393
+ */
3394
+ theme?: ElevasisCoreThemeConfig;
3395
+ /**
3396
+ * @deprecated Organization ID is now resolved automatically via OrganizationProvider.
3397
+ * This prop is accepted for backwards compatibility during migration but is no longer
3398
+ * used when the full provider stack is active (apiUrl provided).
3399
+ */
3400
+ organizationId?: string | null;
3401
+ /** Custom QueryClient. If omitted, a default is created internally. */
3402
+ queryClient?: QueryClient;
3403
+ /**
3404
+ * API base URL (e.g., 'https://api.elevasis.com' or 'http://localhost:5170').
3405
+ * When provided, ElevasisCoreProvider composes the full provider stack:
3406
+ * ApiClientProvider + ElevasisServiceProvider + ProfileProvider +
3407
+ * OrganizationProvider + NotificationProvider + InitializationProvider.
3408
+ * When omitted, no service context is provided (theme-only mode).
3409
+ */
3410
+ apiUrl?: string;
3411
+ /**
3412
+ * Error callback for API responses with status >= 500.
3413
+ * Only used when apiUrl is provided.
3414
+ */
3415
+ onError?: (endpoint: string, error: Error, details?: ApiErrorDetails) => void;
3416
+ /**
3417
+ * @deprecated Organization readiness is now managed internally by OrganizationProvider.
3418
+ * Accepted for backwards compatibility but ignored when apiUrl is provided.
3419
+ */
3420
+ isOrganizationReady?: boolean;
3421
+ /**
3422
+ * Notification adapter for displaying success/error/info messages.
3423
+ * When provided, wraps the subtree in a NotificationProvider with this adapter.
3424
+ * When omitted, the console fallback adapter is used automatically.
3425
+ *
3426
+ * ElevasisUIProvider (Mantine variant) passes a Mantine-backed adapter here automatically.
3427
+ * Headless/SDK consumers can pass a custom adapter or omit for console output.
3428
+ */
3429
+ notifications?: NotificationAdapter;
3430
+ /**
3431
+ * Whether to inject CSS variables, `data-elevasis-scheme` attribute, and font links.
3432
+ * Set to `false` when the consumer has its own complete design system and only
3433
+ * needs auth + API from this provider. Defaults to `true`.
3434
+ */
3435
+ injectStyles?: boolean;
3436
+ /**
3437
+ * CRM action definitions used by DealDetailPage and DealDrawer.
3438
+ * Defaults to DEFAULT_CRM_ACTIONS. Pass a custom array to override or extend
3439
+ * the default action set for your organization's sales flow.
3440
+ *
3441
+ * @example
3442
+ * ```tsx
3443
+ * import { DEFAULT_CRM_ACTIONS, type ActionDef } from '@elevasis/sdk'
3444
+ * const myActions: ActionDef[] = [
3445
+ * ...DEFAULT_CRM_ACTIONS,
3446
+ * { key: 'send_quote', label: 'Send Quote',
3447
+ * isAvailableFor: d => d.stage_key === 'proposal',
3448
+ * workflowId: 'send-quote-workflow' },
3449
+ * ]
3450
+ * <ElevasisUIProvider crmActions={myActions} ... />
3451
+ * ```
3452
+ */
3453
+ crmActions?: ActionDef[];
3454
+ children: ReactNode;
3455
+ }
3456
+ /**
3457
+ * Service context value exposed by ElevasisServiceProvider.
3458
+ * Provides a ready-to-use apiRequest function and organization state.
3459
+ *
3460
+ * For standalone usage (testing, embedding), use ElevasisServiceProvider directly.
3461
+ * For standard SDK usage, ElevasisUIProvider composes this automatically when apiUrl is provided.
3462
+ */
3463
+ interface ElevasisServiceContextValue {
3464
+ apiRequest: <T>(endpoint: string, options?: RequestInit) => Promise<T>;
3465
+ organizationId: string | null;
3466
+ isReady: boolean;
3467
+ }
3468
+ interface ElevasisServiceProviderProps {
3469
+ apiRequest: <T>(endpoint: string, options?: RequestInit) => Promise<T>;
3470
+ organizationId: string | null;
3471
+ isReady: boolean;
3472
+ children: ReactNode;
3473
+ }
3474
+
3475
+ /**
3476
+ * Headless root provider for Elevasis-powered applications.
3477
+ *
3478
+ * Pure auth + API provider with no style side-effects. Does not inject CSS
3479
+ * variables, set `data-elevasis-scheme`, or load fonts. Consumers that need
3480
+ * Elevasis theming should use `ElevasisUIProvider` (Mantine) instead.
3481
+ *
3482
+ * When `apiUrl` is provided, composes the full provider stack:
3483
+ * QueryClientProvider -> AuthProvider -> ApiClientProvider ->
3484
+ * ProfileProvider -> OrganizationProvider -> ElevasisServiceProvider ->
3485
+ * NotificationProvider -> InitializationProvider
3486
+ *
3487
+ * @example Headless SDK consumer
3488
+ * ```tsx
3489
+ * <ElevasisCoreProvider
3490
+ * auth={{ mode: 'authkit', clientId: '...', redirectUri: '/' }}
3491
+ * apiUrl="https://api.elevasis.com"
3492
+ * >
3493
+ * <Dashboard />
3494
+ * </ElevasisCoreProvider>
3495
+ * ```
3496
+ */
3497
+ declare function ElevasisCoreProvider({ auth, queryClient, apiUrl, onError, notifications, crmActions, children }: ElevasisCoreProviderProps): react_jsx_runtime.JSX.Element;
3498
+
569
3499
  interface FetchEventSourceWithTokenRefreshOptions {
570
3500
  url: string;
571
3501
  getToken: () => Promise<string | undefined>;