@elevasis/core 0.12.0 → 0.14.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 (50) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +9 -2
  3. package/dist/organization-model/index.d.ts +1 -1
  4. package/dist/organization-model/index.js +9 -2
  5. package/dist/test-utils/index.d.ts +480 -389
  6. package/dist/test-utils/index.js +28 -2
  7. package/package.json +1 -1
  8. package/src/_gen/__tests__/__snapshots__/contracts.md.snap +2324 -0
  9. package/src/auth/multi-tenancy/credentials/__tests__/encryption.test.ts +217 -216
  10. package/src/auth/multi-tenancy/credentials/server/encryption.ts +5 -19
  11. package/src/auth/multi-tenancy/credentials/server/kek-loader.ts +3 -13
  12. package/src/auth/multi-tenancy/permissions.ts +12 -5
  13. package/src/business/acquisition/activity-events.test.ts +250 -0
  14. package/src/business/acquisition/activity-events.ts +84 -0
  15. package/src/business/acquisition/api-schemas.test.ts +1180 -0
  16. package/src/business/acquisition/api-schemas.ts +456 -235
  17. package/src/business/acquisition/crm-state-actions.test.ts +160 -0
  18. package/src/business/acquisition/derive-actions.test.ts +518 -0
  19. package/src/business/acquisition/derive-actions.ts +103 -0
  20. package/src/business/acquisition/index.ts +51 -11
  21. package/src/business/acquisition/stateful.ts +30 -0
  22. package/src/business/acquisition/types.ts +44 -77
  23. package/src/execution/engine/index.ts +4 -1
  24. package/src/execution/engine/tools/integration/server/adapters/apify/__tests__/apify-run-actor.integration.test.ts +1 -2
  25. package/src/execution/engine/tools/integration/server/adapters/attio/__tests__/attio-crud.integration.test.ts +363 -361
  26. package/src/execution/engine/tools/integration/server/adapters/attio/fetch/get-record/index.test.ts +162 -186
  27. package/src/execution/engine/tools/integration/server/adapters/attio/fetch/list-records/index.test.ts +316 -338
  28. package/src/execution/engine/tools/integration/server/adapters/gmail/gmail-adapter.ts +204 -210
  29. package/src/execution/engine/tools/integration/server/adapters/resend/fetch/send-email/index.test.ts +88 -0
  30. package/src/execution/engine/tools/integration/server/adapters/resend/fetch/send-email/index.ts +141 -134
  31. package/src/execution/engine/tools/integration/server/adapters/resend/fetch/utils/types.ts +76 -75
  32. package/src/execution/engine/tools/integration/service.test.ts +34 -9
  33. package/src/execution/engine/tools/integration/service.ts +6 -3
  34. package/src/execution/engine/tools/lead-service-types.ts +90 -30
  35. package/src/execution/engine/tools/platform/acquisition/types.ts +266 -260
  36. package/src/execution/engine/tools/registry.ts +5 -4
  37. package/src/execution/engine/tools/tool-maps.ts +43 -21
  38. package/src/execution/engine/workflow/types.ts +11 -0
  39. package/src/organization-model/contracts.ts +4 -4
  40. package/src/organization-model/domains/navigation.ts +62 -62
  41. package/src/organization-model/domains/sales.ts +272 -0
  42. package/src/organization-model/organization-graph.mdx +2 -2
  43. package/src/organization-model/published.ts +21 -21
  44. package/src/organization-model/resolve.ts +21 -8
  45. package/src/platform/constants/versions.ts +1 -1
  46. package/src/reference/_generated/contracts.md +2324 -0
  47. package/src/scaffold-registry/index.ts +10 -9
  48. package/src/scaffold-registry/schema.ts +68 -62
  49. package/src/supabase/database.types.ts +2958 -2884
  50. package/src/test-utils/rls/RLSTestContext.ts +585 -553
@@ -9,10 +9,57 @@ type Json = string | number | boolean | null | {
9
9
  } | Json[];
10
10
  type Database = {
11
11
  __InternalSupabase: {
12
- PostgrestVersion: "12.2.3 (519615d)";
12
+ PostgrestVersion: '12.2.3 (519615d)';
13
13
  };
14
14
  public: {
15
15
  Tables: {
16
+ acq_artifacts: {
17
+ Row: {
18
+ content: Json;
19
+ created_at: string;
20
+ created_by: string | null;
21
+ id: string;
22
+ kind: string;
23
+ organization_id: string;
24
+ owner_id: string;
25
+ owner_kind: string;
26
+ source_execution_id: string | null;
27
+ version: number;
28
+ };
29
+ Insert: {
30
+ content: Json;
31
+ created_at?: string;
32
+ created_by?: string | null;
33
+ id?: string;
34
+ kind: string;
35
+ organization_id: string;
36
+ owner_id: string;
37
+ owner_kind: string;
38
+ source_execution_id?: string | null;
39
+ version?: number;
40
+ };
41
+ Update: {
42
+ content?: Json;
43
+ created_at?: string;
44
+ created_by?: string | null;
45
+ id?: string;
46
+ kind?: string;
47
+ organization_id?: string;
48
+ owner_id?: string;
49
+ owner_kind?: string;
50
+ source_execution_id?: string | null;
51
+ version?: number;
52
+ };
53
+ Relationships: [
54
+ {
55
+ foreignKeyName: 'acq_artifacts_organization_id_fkey';
56
+ columns: ['organization_id'];
57
+ isOneToOne: false;
58
+ referencedRelation: 'organizations';
59
+ referencedColumns: ['id'];
60
+ }
61
+ ];
62
+ };
16
63
  acq_companies: {
17
64
  Row: {
18
65
  batch_id: string | null;
@@ -31,6 +78,9 @@ type Database = {
31
78
  num_employees: number | null;
32
79
  organization_id: string;
33
80
  pipeline_status: Json;
81
+ qualification_rubric_key: string | null;
82
+ qualification_score: number | null;
83
+ qualification_signals: Json | null;
34
84
  segment: string | null;
35
85
  source: string | null;
36
86
  status: string;
@@ -54,6 +104,9 @@ type Database = {
54
104
  num_employees?: number | null;
55
105
  organization_id: string;
56
106
  pipeline_status?: Json;
107
+ qualification_rubric_key?: string | null;
108
+ qualification_score?: number | null;
109
+ qualification_signals?: Json | null;
57
110
  segment?: string | null;
58
111
  source?: string | null;
59
112
  status?: string;
@@ -77,6 +130,9 @@ type Database = {
77
130
  num_employees?: number | null;
78
131
  organization_id?: string;
79
132
  pipeline_status?: Json;
133
+ qualification_rubric_key?: string | null;
134
+ qualification_score?: number | null;
135
+ qualification_signals?: Json | null;
80
136
  segment?: string | null;
81
137
  source?: string | null;
82
138
  status?: string;
@@ -85,11 +141,11 @@ type Database = {
85
141
  };
86
142
  Relationships: [
87
143
  {
88
- foreignKeyName: "acq_companies_organization_id_fkey";
89
- columns: ["organization_id"];
144
+ foreignKeyName: 'acq_companies_organization_id_fkey';
145
+ columns: ['organization_id'];
90
146
  isOneToOne: false;
91
- referencedRelation: "organizations";
92
- referencedColumns: ["id"];
147
+ referencedRelation: 'organizations';
148
+ referencedColumns: ['id'];
93
149
  }
94
150
  ];
95
151
  };
@@ -113,6 +169,9 @@ type Database = {
113
169
  opening_line: string | null;
114
170
  organization_id: string;
115
171
  pipeline_status: Json;
172
+ qualification_rubric_key: string | null;
173
+ qualification_score: number | null;
174
+ qualification_signals: Json | null;
116
175
  source: string | null;
117
176
  source_id: string | null;
118
177
  status: string;
@@ -138,6 +197,9 @@ type Database = {
138
197
  opening_line?: string | null;
139
198
  organization_id: string;
140
199
  pipeline_status?: Json;
200
+ qualification_rubric_key?: string | null;
201
+ qualification_score?: number | null;
202
+ qualification_signals?: Json | null;
141
203
  source?: string | null;
142
204
  source_id?: string | null;
143
205
  status?: string;
@@ -163,6 +225,9 @@ type Database = {
163
225
  opening_line?: string | null;
164
226
  organization_id?: string;
165
227
  pipeline_status?: Json;
228
+ qualification_rubric_key?: string | null;
229
+ qualification_score?: number | null;
230
+ qualification_signals?: Json | null;
166
231
  source?: string | null;
167
232
  source_id?: string | null;
168
233
  status?: string;
@@ -171,18 +236,18 @@ type Database = {
171
236
  };
172
237
  Relationships: [
173
238
  {
174
- foreignKeyName: "acq_contacts_company_id_fkey";
175
- columns: ["company_id"];
239
+ foreignKeyName: 'acq_contacts_company_id_fkey';
240
+ columns: ['company_id'];
176
241
  isOneToOne: false;
177
- referencedRelation: "acq_companies";
178
- referencedColumns: ["id"];
242
+ referencedRelation: 'acq_companies';
243
+ referencedColumns: ['id'];
179
244
  },
180
245
  {
181
- foreignKeyName: "acq_contacts_organization_id_fkey";
182
- columns: ["organization_id"];
246
+ foreignKeyName: 'acq_contacts_organization_id_fkey';
247
+ columns: ['organization_id'];
183
248
  isOneToOne: false;
184
- referencedRelation: "organizations";
185
- referencedColumns: ["id"];
249
+ referencedRelation: 'organizations';
250
+ referencedColumns: ['id'];
186
251
  }
187
252
  ];
188
253
  };
@@ -219,11 +284,11 @@ type Database = {
219
284
  };
220
285
  Relationships: [
221
286
  {
222
- foreignKeyName: "acq_content_organization_id_fkey";
223
- columns: ["organization_id"];
287
+ foreignKeyName: 'acq_content_organization_id_fkey';
288
+ columns: ['organization_id'];
224
289
  isOneToOne: false;
225
- referencedRelation: "organizations";
226
- referencedColumns: ["id"];
290
+ referencedRelation: 'organizations';
291
+ referencedColumns: ['id'];
227
292
  }
228
293
  ];
229
294
  };
@@ -287,18 +352,18 @@ type Database = {
287
352
  };
288
353
  Relationships: [
289
354
  {
290
- foreignKeyName: "acq_content_distributions_content_id_fkey";
291
- columns: ["content_id"];
355
+ foreignKeyName: 'acq_content_distributions_content_id_fkey';
356
+ columns: ['content_id'];
292
357
  isOneToOne: false;
293
- referencedRelation: "acq_content";
294
- referencedColumns: ["id"];
358
+ referencedRelation: 'acq_content';
359
+ referencedColumns: ['id'];
295
360
  },
296
361
  {
297
- foreignKeyName: "acq_content_distributions_organization_id_fkey";
298
- columns: ["organization_id"];
362
+ foreignKeyName: 'acq_content_distributions_organization_id_fkey';
363
+ columns: ['organization_id'];
299
364
  isOneToOne: false;
300
- referencedRelation: "organizations";
301
- referencedColumns: ["id"];
365
+ referencedRelation: 'organizations';
366
+ referencedColumns: ['id'];
302
367
  }
303
368
  ];
304
369
  };
@@ -332,18 +397,18 @@ type Database = {
332
397
  };
333
398
  Relationships: [
334
399
  {
335
- foreignKeyName: "acq_deal_notes_deal_id_fkey";
336
- columns: ["deal_id"];
400
+ foreignKeyName: 'acq_deal_notes_deal_id_fkey';
401
+ columns: ['deal_id'];
337
402
  isOneToOne: false;
338
- referencedRelation: "acq_deals";
339
- referencedColumns: ["id"];
403
+ referencedRelation: 'acq_deals';
404
+ referencedColumns: ['id'];
340
405
  },
341
406
  {
342
- foreignKeyName: "acq_deal_notes_organization_id_fkey";
343
- columns: ["organization_id"];
407
+ foreignKeyName: 'acq_deal_notes_organization_id_fkey';
408
+ columns: ['organization_id'];
344
409
  isOneToOne: false;
345
- referencedRelation: "organizations";
346
- referencedColumns: ["id"];
410
+ referencedRelation: 'organizations';
411
+ referencedColumns: ['id'];
347
412
  }
348
413
  ];
349
414
  };
@@ -395,25 +460,24 @@ type Database = {
395
460
  };
396
461
  Relationships: [
397
462
  {
398
- foreignKeyName: "acq_deal_tasks_deal_id_fkey";
399
- columns: ["deal_id"];
463
+ foreignKeyName: 'acq_deal_tasks_deal_id_fkey';
464
+ columns: ['deal_id'];
400
465
  isOneToOne: false;
401
- referencedRelation: "acq_deals";
402
- referencedColumns: ["id"];
466
+ referencedRelation: 'acq_deals';
467
+ referencedColumns: ['id'];
403
468
  },
404
469
  {
405
- foreignKeyName: "acq_deal_tasks_organization_id_fkey";
406
- columns: ["organization_id"];
470
+ foreignKeyName: 'acq_deal_tasks_organization_id_fkey';
471
+ columns: ['organization_id'];
407
472
  isOneToOne: false;
408
- referencedRelation: "organizations";
409
- referencedColumns: ["id"];
473
+ referencedRelation: 'organizations';
474
+ referencedColumns: ['id'];
410
475
  }
411
476
  ];
412
477
  };
413
478
  acq_deals: {
414
479
  Row: {
415
480
  activity_log: Json;
416
- cached_stage: string | null;
417
481
  closed_lost_at: string | null;
418
482
  closed_lost_reason: string | null;
419
483
  contact_email: string;
@@ -428,6 +492,7 @@ type Database = {
428
492
  organization_id: string;
429
493
  payment_link_sent_at: string | null;
430
494
  payment_received_at: string | null;
495
+ pipeline_key: string;
431
496
  proposal_data: Json | null;
432
497
  proposal_generated_at: string | null;
433
498
  proposal_pdf_url: string | null;
@@ -435,10 +500,11 @@ type Database = {
435
500
  proposal_reviewed_by: string | null;
436
501
  proposal_sent_at: string | null;
437
502
  proposal_signed_at: string | null;
438
- proposal_status: string | null;
439
503
  signature_envelope_id: string | null;
440
504
  source_list_id: string | null;
441
505
  source_type: string | null;
506
+ stage_key: string | null;
507
+ state_key: string | null;
442
508
  stripe_payment_id: string | null;
443
509
  stripe_payment_link: string | null;
444
510
  stripe_payment_link_id: string | null;
@@ -447,7 +513,6 @@ type Database = {
447
513
  };
448
514
  Insert: {
449
515
  activity_log?: Json;
450
- cached_stage?: string | null;
451
516
  closed_lost_at?: string | null;
452
517
  closed_lost_reason?: string | null;
453
518
  contact_email: string;
@@ -462,6 +527,7 @@ type Database = {
462
527
  organization_id: string;
463
528
  payment_link_sent_at?: string | null;
464
529
  payment_received_at?: string | null;
530
+ pipeline_key?: string;
465
531
  proposal_data?: Json | null;
466
532
  proposal_generated_at?: string | null;
467
533
  proposal_pdf_url?: string | null;
@@ -469,10 +535,11 @@ type Database = {
469
535
  proposal_reviewed_by?: string | null;
470
536
  proposal_sent_at?: string | null;
471
537
  proposal_signed_at?: string | null;
472
- proposal_status?: string | null;
473
538
  signature_envelope_id?: string | null;
474
539
  source_list_id?: string | null;
475
540
  source_type?: string | null;
541
+ stage_key?: string | null;
542
+ state_key?: string | null;
476
543
  stripe_payment_id?: string | null;
477
544
  stripe_payment_link?: string | null;
478
545
  stripe_payment_link_id?: string | null;
@@ -481,7 +548,6 @@ type Database = {
481
548
  };
482
549
  Update: {
483
550
  activity_log?: Json;
484
- cached_stage?: string | null;
485
551
  closed_lost_at?: string | null;
486
552
  closed_lost_reason?: string | null;
487
553
  contact_email?: string;
@@ -496,6 +562,7 @@ type Database = {
496
562
  organization_id?: string;
497
563
  payment_link_sent_at?: string | null;
498
564
  payment_received_at?: string | null;
565
+ pipeline_key?: string;
499
566
  proposal_data?: Json | null;
500
567
  proposal_generated_at?: string | null;
501
568
  proposal_pdf_url?: string | null;
@@ -503,10 +570,11 @@ type Database = {
503
570
  proposal_reviewed_by?: string | null;
504
571
  proposal_sent_at?: string | null;
505
572
  proposal_signed_at?: string | null;
506
- proposal_status?: string | null;
507
573
  signature_envelope_id?: string | null;
508
574
  source_list_id?: string | null;
509
575
  source_type?: string | null;
576
+ stage_key?: string | null;
577
+ state_key?: string | null;
510
578
  stripe_payment_id?: string | null;
511
579
  stripe_payment_link?: string | null;
512
580
  stripe_payment_link_id?: string | null;
@@ -515,86 +583,95 @@ type Database = {
515
583
  };
516
584
  Relationships: [
517
585
  {
518
- foreignKeyName: "acq_deals_contact_id_fkey";
519
- columns: ["contact_id"];
586
+ foreignKeyName: 'acq_deals_contact_id_fkey';
587
+ columns: ['contact_id'];
520
588
  isOneToOne: false;
521
- referencedRelation: "acq_contacts";
522
- referencedColumns: ["id"];
589
+ referencedRelation: 'acq_contacts';
590
+ referencedColumns: ['id'];
523
591
  },
524
592
  {
525
- foreignKeyName: "acq_deals_organization_id_fkey";
526
- columns: ["organization_id"];
593
+ foreignKeyName: 'acq_deals_organization_id_fkey';
594
+ columns: ['organization_id'];
527
595
  isOneToOne: false;
528
- referencedRelation: "organizations";
529
- referencedColumns: ["id"];
596
+ referencedRelation: 'organizations';
597
+ referencedColumns: ['id'];
530
598
  },
531
599
  {
532
- foreignKeyName: "acq_deals_source_list_id_fkey";
533
- columns: ["source_list_id"];
600
+ foreignKeyName: 'acq_deals_source_list_id_fkey';
601
+ columns: ['source_list_id'];
534
602
  isOneToOne: false;
535
- referencedRelation: "acq_lists";
536
- referencedColumns: ["id"];
603
+ referencedRelation: 'acq_lists';
604
+ referencedColumns: ['id'];
537
605
  }
538
606
  ];
539
607
  };
540
608
  acq_list_companies: {
541
609
  Row: {
610
+ activity_log: Json;
542
611
  added_at: string;
543
612
  added_by: string | null;
544
613
  company_id: string;
545
614
  id: string;
546
615
  list_id: string;
616
+ pipeline_key: string;
617
+ processing_state: Json;
547
618
  source_execution_id: string | null;
548
619
  source_input_hash: string | null;
549
620
  source_resource_id: string | null;
550
- stage: string | null;
551
- stage_updated_at: string | null;
621
+ stage_key: string;
622
+ state_key: string;
552
623
  };
553
624
  Insert: {
625
+ activity_log?: Json;
554
626
  added_at?: string;
555
627
  added_by?: string | null;
556
628
  company_id: string;
557
629
  id?: string;
558
630
  list_id: string;
631
+ pipeline_key?: string;
632
+ processing_state?: Json;
559
633
  source_execution_id?: string | null;
560
634
  source_input_hash?: string | null;
561
635
  source_resource_id?: string | null;
562
- stage?: string | null;
563
- stage_updated_at?: string | null;
636
+ stage_key: string;
637
+ state_key: string;
564
638
  };
565
639
  Update: {
640
+ activity_log?: Json;
566
641
  added_at?: string;
567
642
  added_by?: string | null;
568
643
  company_id?: string;
569
644
  id?: string;
570
645
  list_id?: string;
646
+ pipeline_key?: string;
647
+ processing_state?: Json;
571
648
  source_execution_id?: string | null;
572
649
  source_input_hash?: string | null;
573
650
  source_resource_id?: string | null;
574
- stage?: string | null;
575
- stage_updated_at?: string | null;
651
+ stage_key?: string;
652
+ state_key?: string;
576
653
  };
577
654
  Relationships: [
578
655
  {
579
- foreignKeyName: "acq_list_companies_company_id_fkey";
580
- columns: ["company_id"];
656
+ foreignKeyName: 'acq_list_companies_company_id_fkey';
657
+ columns: ['company_id'];
581
658
  isOneToOne: false;
582
- referencedRelation: "acq_companies";
583
- referencedColumns: ["id"];
659
+ referencedRelation: 'acq_companies';
660
+ referencedColumns: ['id'];
584
661
  },
585
662
  {
586
- foreignKeyName: "acq_list_companies_list_id_fkey";
587
- columns: ["list_id"];
663
+ foreignKeyName: 'acq_list_companies_list_id_fkey';
664
+ columns: ['list_id'];
588
665
  isOneToOne: false;
589
- referencedRelation: "acq_lists";
590
- referencedColumns: ["id"];
666
+ referencedRelation: 'acq_lists';
667
+ referencedColumns: ['id'];
591
668
  },
592
669
  {
593
- foreignKeyName: "acq_list_companies_source_execution_id_fkey";
594
- columns: ["source_execution_id"];
670
+ foreignKeyName: 'acq_list_companies_source_execution_id_fkey';
671
+ columns: ['source_execution_id'];
595
672
  isOneToOne: false;
596
- referencedRelation: "execution_logs";
597
- referencedColumns: ["execution_id"];
673
+ referencedRelation: 'execution_logs';
674
+ referencedColumns: ['execution_id'];
598
675
  }
599
676
  ];
600
677
  };
@@ -622,79 +699,88 @@ type Database = {
622
699
  };
623
700
  Relationships: [
624
701
  {
625
- foreignKeyName: "acq_list_executions_execution_id_fkey";
626
- columns: ["execution_id"];
702
+ foreignKeyName: 'acq_list_executions_execution_id_fkey';
703
+ columns: ['execution_id'];
627
704
  isOneToOne: false;
628
- referencedRelation: "execution_logs";
629
- referencedColumns: ["execution_id"];
705
+ referencedRelation: 'execution_logs';
706
+ referencedColumns: ['execution_id'];
630
707
  },
631
708
  {
632
- foreignKeyName: "acq_list_executions_list_id_fkey";
633
- columns: ["list_id"];
709
+ foreignKeyName: 'acq_list_executions_list_id_fkey';
710
+ columns: ['list_id'];
634
711
  isOneToOne: false;
635
- referencedRelation: "acq_lists";
636
- referencedColumns: ["id"];
712
+ referencedRelation: 'acq_lists';
713
+ referencedColumns: ['id'];
637
714
  }
638
715
  ];
639
716
  };
640
717
  acq_list_members: {
641
718
  Row: {
719
+ activity_log: Json;
642
720
  added_at: string;
643
721
  added_by: string | null;
644
722
  contact_id: string;
645
723
  id: string;
646
724
  list_id: string;
725
+ pipeline_key: string;
726
+ processing_state: Json;
647
727
  source_execution_id: string | null;
648
728
  source_input_hash: string | null;
649
729
  source_resource_id: string | null;
650
- stage: string | null;
651
- stage_updated_at: string | null;
730
+ stage_key: string;
731
+ state_key: string;
652
732
  };
653
733
  Insert: {
734
+ activity_log?: Json;
654
735
  added_at?: string;
655
736
  added_by?: string | null;
656
737
  contact_id: string;
657
738
  id?: string;
658
739
  list_id: string;
740
+ pipeline_key?: string;
741
+ processing_state?: Json;
659
742
  source_execution_id?: string | null;
660
743
  source_input_hash?: string | null;
661
744
  source_resource_id?: string | null;
662
- stage?: string | null;
663
- stage_updated_at?: string | null;
745
+ stage_key: string;
746
+ state_key: string;
664
747
  };
665
748
  Update: {
749
+ activity_log?: Json;
666
750
  added_at?: string;
667
751
  added_by?: string | null;
668
752
  contact_id?: string;
669
753
  id?: string;
670
754
  list_id?: string;
755
+ pipeline_key?: string;
756
+ processing_state?: Json;
671
757
  source_execution_id?: string | null;
672
758
  source_input_hash?: string | null;
673
759
  source_resource_id?: string | null;
674
- stage?: string | null;
675
- stage_updated_at?: string | null;
760
+ stage_key?: string;
761
+ state_key?: string;
676
762
  };
677
763
  Relationships: [
678
764
  {
679
- foreignKeyName: "acq_list_members_contact_id_fkey";
680
- columns: ["contact_id"];
765
+ foreignKeyName: 'acq_list_members_contact_id_fkey';
766
+ columns: ['contact_id'];
681
767
  isOneToOne: false;
682
- referencedRelation: "acq_contacts";
683
- referencedColumns: ["id"];
768
+ referencedRelation: 'acq_contacts';
769
+ referencedColumns: ['id'];
684
770
  },
685
771
  {
686
- foreignKeyName: "acq_list_members_list_id_fkey";
687
- columns: ["list_id"];
772
+ foreignKeyName: 'acq_list_members_list_id_fkey';
773
+ columns: ['list_id'];
688
774
  isOneToOne: false;
689
- referencedRelation: "acq_lists";
690
- referencedColumns: ["id"];
775
+ referencedRelation: 'acq_lists';
776
+ referencedColumns: ['id'];
691
777
  },
692
778
  {
693
- foreignKeyName: "acq_list_members_source_execution_id_fkey";
694
- columns: ["source_execution_id"];
779
+ foreignKeyName: 'acq_list_members_source_execution_id_fkey';
780
+ columns: ['source_execution_id'];
695
781
  isOneToOne: false;
696
- referencedRelation: "execution_logs";
697
- referencedColumns: ["execution_id"];
782
+ referencedRelation: 'execution_logs';
783
+ referencedColumns: ['execution_id'];
698
784
  }
699
785
  ];
700
786
  };
@@ -702,55 +788,58 @@ type Database = {
702
788
  Row: {
703
789
  batch_ids: string[];
704
790
  completed_at: string | null;
705
- config: Json;
706
791
  created_at: string;
707
792
  description: string | null;
793
+ icp: Json;
708
794
  id: string;
709
795
  instantly_campaign_id: string | null;
710
796
  launched_at: string | null;
711
797
  metadata: Json;
712
798
  name: string;
713
799
  organization_id: string;
800
+ pipeline_config: Json;
801
+ scraping_config: Json;
714
802
  status: string;
715
- type: string;
716
803
  };
717
804
  Insert: {
718
805
  batch_ids?: string[];
719
806
  completed_at?: string | null;
720
- config?: Json;
721
807
  created_at?: string;
722
808
  description?: string | null;
809
+ icp?: Json;
723
810
  id?: string;
724
811
  instantly_campaign_id?: string | null;
725
812
  launched_at?: string | null;
726
813
  metadata?: Json;
727
814
  name: string;
728
815
  organization_id: string;
816
+ pipeline_config?: Json;
817
+ scraping_config?: Json;
729
818
  status?: string;
730
- type?: string;
731
819
  };
732
820
  Update: {
733
821
  batch_ids?: string[];
734
822
  completed_at?: string | null;
735
- config?: Json;
736
823
  created_at?: string;
737
824
  description?: string | null;
825
+ icp?: Json;
738
826
  id?: string;
739
827
  instantly_campaign_id?: string | null;
740
828
  launched_at?: string | null;
741
829
  metadata?: Json;
742
830
  name?: string;
743
831
  organization_id?: string;
832
+ pipeline_config?: Json;
833
+ scraping_config?: Json;
744
834
  status?: string;
745
- type?: string;
746
835
  };
747
836
  Relationships: [
748
837
  {
749
- foreignKeyName: "acq_lists_organization_id_fkey";
750
- columns: ["organization_id"];
838
+ foreignKeyName: 'acq_lists_organization_id_fkey';
839
+ columns: ['organization_id'];
751
840
  isOneToOne: false;
752
- referencedRelation: "organizations";
753
- referencedColumns: ["id"];
841
+ referencedRelation: 'organizations';
842
+ referencedColumns: ['id'];
754
843
  }
755
844
  ];
756
845
  };
@@ -826,18 +915,18 @@ type Database = {
826
915
  };
827
916
  Relationships: [
828
917
  {
829
- foreignKeyName: "acq_seo_metrics_organization_id_fkey";
830
- columns: ["organization_id"];
918
+ foreignKeyName: 'acq_seo_metrics_organization_id_fkey';
919
+ columns: ['organization_id'];
831
920
  isOneToOne: false;
832
- referencedRelation: "organizations";
833
- referencedColumns: ["id"];
921
+ referencedRelation: 'organizations';
922
+ referencedColumns: ['id'];
834
923
  },
835
924
  {
836
- foreignKeyName: "acq_seo_metrics_seo_page_id_fkey";
837
- columns: ["seo_page_id"];
925
+ foreignKeyName: 'acq_seo_metrics_seo_page_id_fkey';
926
+ columns: ['seo_page_id'];
838
927
  isOneToOne: false;
839
- referencedRelation: "acq_seo_pages";
840
- referencedColumns: ["id"];
928
+ referencedRelation: 'acq_seo_pages';
929
+ referencedColumns: ['id'];
841
930
  }
842
931
  ];
843
932
  };
@@ -913,11 +1002,11 @@ type Database = {
913
1002
  };
914
1003
  Relationships: [
915
1004
  {
916
- foreignKeyName: "acq_seo_pages_organization_id_fkey";
917
- columns: ["organization_id"];
1005
+ foreignKeyName: 'acq_seo_pages_organization_id_fkey';
1006
+ columns: ['organization_id'];
918
1007
  isOneToOne: false;
919
- referencedRelation: "organizations";
920
- referencedColumns: ["id"];
1008
+ referencedRelation: 'organizations';
1009
+ referencedColumns: ['id'];
921
1010
  }
922
1011
  ];
923
1012
  };
@@ -1014,11 +1103,11 @@ type Database = {
1014
1103
  };
1015
1104
  Relationships: [
1016
1105
  {
1017
- foreignKeyName: "acq_social_posts_organization_id_fkey";
1018
- columns: ["organization_id"];
1106
+ foreignKeyName: 'acq_social_posts_organization_id_fkey';
1107
+ columns: ['organization_id'];
1019
1108
  isOneToOne: false;
1020
- referencedRelation: "organizations";
1021
- referencedColumns: ["id"];
1109
+ referencedRelation: 'organizations';
1110
+ referencedColumns: ['id'];
1022
1111
  }
1023
1112
  ];
1024
1113
  };
@@ -1073,11 +1162,11 @@ type Database = {
1073
1162
  };
1074
1163
  Relationships: [
1075
1164
  {
1076
- foreignKeyName: "activities_organization_id_fkey";
1077
- columns: ["organization_id"];
1165
+ foreignKeyName: 'activities_organization_id_fkey';
1166
+ columns: ['organization_id'];
1078
1167
  isOneToOne: false;
1079
- referencedRelation: "organizations";
1080
- referencedColumns: ["id"];
1168
+ referencedRelation: 'organizations';
1169
+ referencedColumns: ['id'];
1081
1170
  }
1082
1171
  ];
1083
1172
  };
@@ -1108,11 +1197,11 @@ type Database = {
1108
1197
  };
1109
1198
  Relationships: [
1110
1199
  {
1111
- foreignKeyName: "api_keys_organization_id_fkey";
1112
- columns: ["organization_id"];
1200
+ foreignKeyName: 'api_keys_organization_id_fkey';
1201
+ columns: ['organization_id'];
1113
1202
  isOneToOne: false;
1114
- referencedRelation: "organizations";
1115
- referencedColumns: ["id"];
1203
+ referencedRelation: 'organizations';
1204
+ referencedColumns: ['id'];
1116
1205
  }
1117
1206
  ];
1118
1207
  };
@@ -1191,25 +1280,25 @@ type Database = {
1191
1280
  };
1192
1281
  Relationships: [
1193
1282
  {
1194
- foreignKeyName: "command_queue_completed_by_fkey";
1195
- columns: ["completed_by"];
1283
+ foreignKeyName: 'command_queue_completed_by_fkey';
1284
+ columns: ['completed_by'];
1196
1285
  isOneToOne: false;
1197
- referencedRelation: "users";
1198
- referencedColumns: ["id"];
1286
+ referencedRelation: 'users';
1287
+ referencedColumns: ['id'];
1199
1288
  },
1200
1289
  {
1201
- foreignKeyName: "command_queue_organization_id_fkey";
1202
- columns: ["organization_id"];
1290
+ foreignKeyName: 'command_queue_organization_id_fkey';
1291
+ columns: ['organization_id'];
1203
1292
  isOneToOne: false;
1204
- referencedRelation: "organizations";
1205
- referencedColumns: ["id"];
1293
+ referencedRelation: 'organizations';
1294
+ referencedColumns: ['id'];
1206
1295
  },
1207
1296
  {
1208
- foreignKeyName: "command_queue_target_execution_id_fkey";
1209
- columns: ["target_execution_id"];
1297
+ foreignKeyName: 'command_queue_target_execution_id_fkey';
1298
+ columns: ['target_execution_id'];
1210
1299
  isOneToOne: false;
1211
- referencedRelation: "execution_logs";
1212
- referencedColumns: ["execution_id"];
1300
+ referencedRelation: 'execution_logs';
1301
+ referencedColumns: ['execution_id'];
1213
1302
  }
1214
1303
  ];
1215
1304
  };
@@ -1249,18 +1338,18 @@ type Database = {
1249
1338
  };
1250
1339
  Relationships: [
1251
1340
  {
1252
- foreignKeyName: "credentials_created_by_fkey";
1253
- columns: ["created_by"];
1341
+ foreignKeyName: 'credentials_created_by_fkey';
1342
+ columns: ['created_by'];
1254
1343
  isOneToOne: false;
1255
- referencedRelation: "users";
1256
- referencedColumns: ["id"];
1344
+ referencedRelation: 'users';
1345
+ referencedColumns: ['id'];
1257
1346
  },
1258
1347
  {
1259
- foreignKeyName: "credentials_organization_id_fkey";
1260
- columns: ["organization_id"];
1348
+ foreignKeyName: 'credentials_organization_id_fkey';
1349
+ columns: ['organization_id'];
1261
1350
  isOneToOne: false;
1262
- referencedRelation: "organizations";
1263
- referencedColumns: ["id"];
1351
+ referencedRelation: 'organizations';
1352
+ referencedColumns: ['id'];
1264
1353
  }
1265
1354
  ];
1266
1355
  };
@@ -1306,11 +1395,11 @@ type Database = {
1306
1395
  };
1307
1396
  Relationships: [
1308
1397
  {
1309
- foreignKeyName: "deployments_organization_id_fkey";
1310
- columns: ["organization_id"];
1398
+ foreignKeyName: 'deployments_organization_id_fkey';
1399
+ columns: ['organization_id'];
1311
1400
  isOneToOne: false;
1312
- referencedRelation: "organizations";
1313
- referencedColumns: ["id"];
1401
+ referencedRelation: 'organizations';
1402
+ referencedColumns: ['id'];
1314
1403
  }
1315
1404
  ];
1316
1405
  };
@@ -1365,25 +1454,25 @@ type Database = {
1365
1454
  };
1366
1455
  Relationships: [
1367
1456
  {
1368
- foreignKeyName: "execution_errors_execution_id_fkey";
1369
- columns: ["execution_id"];
1457
+ foreignKeyName: 'execution_errors_execution_id_fkey';
1458
+ columns: ['execution_id'];
1370
1459
  isOneToOne: false;
1371
- referencedRelation: "execution_logs";
1372
- referencedColumns: ["execution_id"];
1460
+ referencedRelation: 'execution_logs';
1461
+ referencedColumns: ['execution_id'];
1373
1462
  },
1374
1463
  {
1375
- foreignKeyName: "execution_errors_organization_id_fkey";
1376
- columns: ["organization_id"];
1464
+ foreignKeyName: 'execution_errors_organization_id_fkey';
1465
+ columns: ['organization_id'];
1377
1466
  isOneToOne: false;
1378
- referencedRelation: "organizations";
1379
- referencedColumns: ["id"];
1467
+ referencedRelation: 'organizations';
1468
+ referencedColumns: ['id'];
1380
1469
  },
1381
1470
  {
1382
- foreignKeyName: "execution_errors_resolved_by_fkey";
1383
- columns: ["resolved_by"];
1471
+ foreignKeyName: 'execution_errors_resolved_by_fkey';
1472
+ columns: ['resolved_by'];
1384
1473
  isOneToOne: false;
1385
- referencedRelation: "users";
1386
- referencedColumns: ["id"];
1474
+ referencedRelation: 'users';
1475
+ referencedColumns: ['id'];
1387
1476
  }
1388
1477
  ];
1389
1478
  };
@@ -1465,32 +1554,32 @@ type Database = {
1465
1554
  };
1466
1555
  Relationships: [
1467
1556
  {
1468
- foreignKeyName: "execution_history_organization_id_fkey";
1469
- columns: ["organization_id"];
1557
+ foreignKeyName: 'execution_history_organization_id_fkey';
1558
+ columns: ['organization_id'];
1470
1559
  isOneToOne: false;
1471
- referencedRelation: "organizations";
1472
- referencedColumns: ["id"];
1560
+ referencedRelation: 'organizations';
1561
+ referencedColumns: ['id'];
1473
1562
  },
1474
1563
  {
1475
- foreignKeyName: "execution_logs_origin_execution_id_fkey";
1476
- columns: ["origin_execution_id"];
1564
+ foreignKeyName: 'execution_logs_origin_execution_id_fkey';
1565
+ columns: ['origin_execution_id'];
1477
1566
  isOneToOne: false;
1478
- referencedRelation: "execution_logs";
1479
- referencedColumns: ["execution_id"];
1567
+ referencedRelation: 'execution_logs';
1568
+ referencedColumns: ['execution_id'];
1480
1569
  },
1481
1570
  {
1482
- foreignKeyName: "execution_logs_session_id_fkey";
1483
- columns: ["session_id"];
1571
+ foreignKeyName: 'execution_logs_session_id_fkey';
1572
+ columns: ['session_id'];
1484
1573
  isOneToOne: false;
1485
- referencedRelation: "sessions";
1486
- referencedColumns: ["session_id"];
1574
+ referencedRelation: 'sessions';
1575
+ referencedColumns: ['session_id'];
1487
1576
  },
1488
1577
  {
1489
- foreignKeyName: "execution_logs_user_id_fkey";
1490
- columns: ["user_id"];
1578
+ foreignKeyName: 'execution_logs_user_id_fkey';
1579
+ columns: ['user_id'];
1491
1580
  isOneToOne: false;
1492
- referencedRelation: "users";
1493
- referencedColumns: ["id"];
1581
+ referencedRelation: 'users';
1582
+ referencedColumns: ['id'];
1494
1583
  }
1495
1584
  ];
1496
1585
  };
@@ -1536,18 +1625,18 @@ type Database = {
1536
1625
  };
1537
1626
  Relationships: [
1538
1627
  {
1539
- foreignKeyName: "execution_metrics_execution_id_fkey";
1540
- columns: ["execution_id"];
1628
+ foreignKeyName: 'execution_metrics_execution_id_fkey';
1629
+ columns: ['execution_id'];
1541
1630
  isOneToOne: true;
1542
- referencedRelation: "execution_logs";
1543
- referencedColumns: ["execution_id"];
1631
+ referencedRelation: 'execution_logs';
1632
+ referencedColumns: ['execution_id'];
1544
1633
  },
1545
1634
  {
1546
- foreignKeyName: "execution_metrics_organization_id_fkey";
1547
- columns: ["organization_id"];
1635
+ foreignKeyName: 'execution_metrics_organization_id_fkey';
1636
+ columns: ['organization_id'];
1548
1637
  isOneToOne: false;
1549
- referencedRelation: "organizations";
1550
- referencedColumns: ["id"];
1638
+ referencedRelation: 'organizations';
1639
+ referencedColumns: ['id'];
1551
1640
  }
1552
1641
  ];
1553
1642
  };
@@ -1590,18 +1679,18 @@ type Database = {
1590
1679
  };
1591
1680
  Relationships: [
1592
1681
  {
1593
- foreignKeyName: "notifications_organization_id_fkey";
1594
- columns: ["organization_id"];
1682
+ foreignKeyName: 'notifications_organization_id_fkey';
1683
+ columns: ['organization_id'];
1595
1684
  isOneToOne: false;
1596
- referencedRelation: "organizations";
1597
- referencedColumns: ["id"];
1685
+ referencedRelation: 'organizations';
1686
+ referencedColumns: ['id'];
1598
1687
  },
1599
1688
  {
1600
- foreignKeyName: "notifications_user_id_fkey";
1601
- columns: ["user_id"];
1689
+ foreignKeyName: 'notifications_user_id_fkey';
1690
+ columns: ['user_id'];
1602
1691
  isOneToOne: false;
1603
- referencedRelation: "users";
1604
- referencedColumns: ["id"];
1692
+ referencedRelation: 'users';
1693
+ referencedColumns: ['id'];
1605
1694
  }
1606
1695
  ];
1607
1696
  };
@@ -1656,18 +1745,18 @@ type Database = {
1656
1745
  };
1657
1746
  Relationships: [
1658
1747
  {
1659
- foreignKeyName: "org_invitations_inviter_user_id_fkey";
1660
- columns: ["inviter_user_id"];
1748
+ foreignKeyName: 'org_invitations_inviter_user_id_fkey';
1749
+ columns: ['inviter_user_id'];
1661
1750
  isOneToOne: false;
1662
- referencedRelation: "users";
1663
- referencedColumns: ["id"];
1751
+ referencedRelation: 'users';
1752
+ referencedColumns: ['id'];
1664
1753
  },
1665
1754
  {
1666
- foreignKeyName: "org_invitations_organization_id_fkey";
1667
- columns: ["organization_id"];
1755
+ foreignKeyName: 'org_invitations_organization_id_fkey';
1756
+ columns: ['organization_id'];
1668
1757
  isOneToOne: false;
1669
- referencedRelation: "organizations";
1670
- referencedColumns: ["id"];
1758
+ referencedRelation: 'organizations';
1759
+ referencedColumns: ['id'];
1671
1760
  }
1672
1761
  ];
1673
1762
  };
@@ -1710,18 +1799,18 @@ type Database = {
1710
1799
  };
1711
1800
  Relationships: [
1712
1801
  {
1713
- foreignKeyName: "org_memberships_organization_id_fkey";
1714
- columns: ["organization_id"];
1802
+ foreignKeyName: 'org_memberships_organization_id_fkey';
1803
+ columns: ['organization_id'];
1715
1804
  isOneToOne: false;
1716
- referencedRelation: "organizations";
1717
- referencedColumns: ["id"];
1805
+ referencedRelation: 'organizations';
1806
+ referencedColumns: ['id'];
1718
1807
  },
1719
1808
  {
1720
- foreignKeyName: "org_memberships_user_id_fkey";
1721
- columns: ["user_id"];
1809
+ foreignKeyName: 'org_memberships_user_id_fkey';
1810
+ columns: ['user_id'];
1722
1811
  isOneToOne: false;
1723
- referencedRelation: "users";
1724
- referencedColumns: ["id"];
1812
+ referencedRelation: 'users';
1813
+ referencedColumns: ['id'];
1725
1814
  }
1726
1815
  ];
1727
1816
  };
@@ -1746,25 +1835,25 @@ type Database = {
1746
1835
  };
1747
1836
  Relationships: [
1748
1837
  {
1749
- foreignKeyName: "org_rol_assignments_granted_by_fkey";
1750
- columns: ["granted_by"];
1838
+ foreignKeyName: 'org_rol_assignments_granted_by_fkey';
1839
+ columns: ['granted_by'];
1751
1840
  isOneToOne: false;
1752
- referencedRelation: "users";
1753
- referencedColumns: ["id"];
1841
+ referencedRelation: 'users';
1842
+ referencedColumns: ['id'];
1754
1843
  },
1755
1844
  {
1756
- foreignKeyName: "org_rol_assignments_membership_id_fkey";
1757
- columns: ["membership_id"];
1845
+ foreignKeyName: 'org_rol_assignments_membership_id_fkey';
1846
+ columns: ['membership_id'];
1758
1847
  isOneToOne: false;
1759
- referencedRelation: "org_memberships";
1760
- referencedColumns: ["id"];
1848
+ referencedRelation: 'org_memberships';
1849
+ referencedColumns: ['id'];
1761
1850
  },
1762
1851
  {
1763
- foreignKeyName: "org_rol_assignments_role_id_fkey";
1764
- columns: ["role_id"];
1852
+ foreignKeyName: 'org_rol_assignments_role_id_fkey';
1853
+ columns: ['role_id'];
1765
1854
  isOneToOne: false;
1766
- referencedRelation: "org_rol_definitions";
1767
- referencedColumns: ["id"];
1855
+ referencedRelation: 'org_rol_definitions';
1856
+ referencedColumns: ['id'];
1768
1857
  }
1769
1858
  ];
1770
1859
  };
@@ -1801,11 +1890,11 @@ type Database = {
1801
1890
  };
1802
1891
  Relationships: [
1803
1892
  {
1804
- foreignKeyName: "org_rol_definitions_organization_id_fkey";
1805
- columns: ["organization_id"];
1893
+ foreignKeyName: 'org_rol_definitions_organization_id_fkey';
1894
+ columns: ['organization_id'];
1806
1895
  isOneToOne: false;
1807
- referencedRelation: "organizations";
1808
- referencedColumns: ["id"];
1896
+ referencedRelation: 'organizations';
1897
+ referencedColumns: ['id'];
1809
1898
  }
1810
1899
  ];
1811
1900
  };
@@ -1827,18 +1916,18 @@ type Database = {
1827
1916
  };
1828
1917
  Relationships: [
1829
1918
  {
1830
- foreignKeyName: "org_rol_grants_permission_key_fkey";
1831
- columns: ["permission_key"];
1919
+ foreignKeyName: 'org_rol_grants_permission_key_fkey';
1920
+ columns: ['permission_key'];
1832
1921
  isOneToOne: false;
1833
- referencedRelation: "org_rol_permissions";
1834
- referencedColumns: ["key"];
1922
+ referencedRelation: 'org_rol_permissions';
1923
+ referencedColumns: ['key'];
1835
1924
  },
1836
1925
  {
1837
- foreignKeyName: "org_rol_grants_role_id_fkey";
1838
- columns: ["role_id"];
1926
+ foreignKeyName: 'org_rol_grants_role_id_fkey';
1927
+ columns: ['role_id'];
1839
1928
  isOneToOne: false;
1840
- referencedRelation: "org_rol_definitions";
1841
- referencedColumns: ["id"];
1929
+ referencedRelation: 'org_rol_definitions';
1930
+ referencedColumns: ['id'];
1842
1931
  }
1843
1932
  ];
1844
1933
  };
@@ -1950,25 +2039,25 @@ type Database = {
1950
2039
  };
1951
2040
  Relationships: [
1952
2041
  {
1953
- foreignKeyName: "fk_milestones_project";
1954
- columns: ["project_id"];
2042
+ foreignKeyName: 'fk_milestones_project';
2043
+ columns: ['project_id'];
1955
2044
  isOneToOne: false;
1956
- referencedRelation: "prj_projects";
1957
- referencedColumns: ["id"];
2045
+ referencedRelation: 'prj_projects';
2046
+ referencedColumns: ['id'];
1958
2047
  },
1959
2048
  {
1960
- foreignKeyName: "prj_milestones_organization_id_fkey";
1961
- columns: ["organization_id"];
2049
+ foreignKeyName: 'prj_milestones_organization_id_fkey';
2050
+ columns: ['organization_id'];
1962
2051
  isOneToOne: false;
1963
- referencedRelation: "organizations";
1964
- referencedColumns: ["id"];
2052
+ referencedRelation: 'organizations';
2053
+ referencedColumns: ['id'];
1965
2054
  },
1966
2055
  {
1967
- foreignKeyName: "prj_milestones_project_id_fkey";
1968
- columns: ["project_id"];
2056
+ foreignKeyName: 'prj_milestones_project_id_fkey';
2057
+ columns: ['project_id'];
1969
2058
  isOneToOne: false;
1970
- referencedRelation: "prj_projects";
1971
- referencedColumns: ["id"];
2059
+ referencedRelation: 'prj_projects';
2060
+ referencedColumns: ['id'];
1972
2061
  }
1973
2062
  ];
1974
2063
  };
@@ -2017,67 +2106,67 @@ type Database = {
2017
2106
  };
2018
2107
  Relationships: [
2019
2108
  {
2020
- foreignKeyName: "fk_notes_created_by";
2021
- columns: ["created_by"];
2109
+ foreignKeyName: 'fk_notes_created_by';
2110
+ columns: ['created_by'];
2022
2111
  isOneToOne: false;
2023
- referencedRelation: "users";
2024
- referencedColumns: ["id"];
2112
+ referencedRelation: 'users';
2113
+ referencedColumns: ['id'];
2025
2114
  },
2026
2115
  {
2027
- foreignKeyName: "fk_notes_milestone";
2028
- columns: ["milestone_id"];
2116
+ foreignKeyName: 'fk_notes_milestone';
2117
+ columns: ['milestone_id'];
2029
2118
  isOneToOne: false;
2030
- referencedRelation: "prj_milestones";
2031
- referencedColumns: ["id"];
2119
+ referencedRelation: 'prj_milestones';
2120
+ referencedColumns: ['id'];
2032
2121
  },
2033
2122
  {
2034
- foreignKeyName: "fk_notes_project";
2035
- columns: ["project_id"];
2123
+ foreignKeyName: 'fk_notes_project';
2124
+ columns: ['project_id'];
2036
2125
  isOneToOne: false;
2037
- referencedRelation: "prj_projects";
2038
- referencedColumns: ["id"];
2126
+ referencedRelation: 'prj_projects';
2127
+ referencedColumns: ['id'];
2039
2128
  },
2040
2129
  {
2041
- foreignKeyName: "fk_notes_task";
2042
- columns: ["task_id"];
2130
+ foreignKeyName: 'fk_notes_task';
2131
+ columns: ['task_id'];
2043
2132
  isOneToOne: false;
2044
- referencedRelation: "prj_tasks";
2045
- referencedColumns: ["id"];
2133
+ referencedRelation: 'prj_tasks';
2134
+ referencedColumns: ['id'];
2046
2135
  },
2047
2136
  {
2048
- foreignKeyName: "prj_notes_created_by_fkey";
2049
- columns: ["created_by"];
2137
+ foreignKeyName: 'prj_notes_created_by_fkey';
2138
+ columns: ['created_by'];
2050
2139
  isOneToOne: false;
2051
- referencedRelation: "users";
2052
- referencedColumns: ["id"];
2140
+ referencedRelation: 'users';
2141
+ referencedColumns: ['id'];
2053
2142
  },
2054
2143
  {
2055
- foreignKeyName: "prj_notes_milestone_id_fkey";
2056
- columns: ["milestone_id"];
2144
+ foreignKeyName: 'prj_notes_milestone_id_fkey';
2145
+ columns: ['milestone_id'];
2057
2146
  isOneToOne: false;
2058
- referencedRelation: "prj_milestones";
2059
- referencedColumns: ["id"];
2147
+ referencedRelation: 'prj_milestones';
2148
+ referencedColumns: ['id'];
2060
2149
  },
2061
2150
  {
2062
- foreignKeyName: "prj_notes_organization_id_fkey";
2063
- columns: ["organization_id"];
2151
+ foreignKeyName: 'prj_notes_organization_id_fkey';
2152
+ columns: ['organization_id'];
2064
2153
  isOneToOne: false;
2065
- referencedRelation: "organizations";
2066
- referencedColumns: ["id"];
2154
+ referencedRelation: 'organizations';
2155
+ referencedColumns: ['id'];
2067
2156
  },
2068
2157
  {
2069
- foreignKeyName: "prj_notes_project_id_fkey";
2070
- columns: ["project_id"];
2158
+ foreignKeyName: 'prj_notes_project_id_fkey';
2159
+ columns: ['project_id'];
2071
2160
  isOneToOne: false;
2072
- referencedRelation: "prj_projects";
2073
- referencedColumns: ["id"];
2161
+ referencedRelation: 'prj_projects';
2162
+ referencedColumns: ['id'];
2074
2163
  },
2075
2164
  {
2076
- foreignKeyName: "prj_notes_task_id_fkey";
2077
- columns: ["task_id"];
2165
+ foreignKeyName: 'prj_notes_task_id_fkey';
2166
+ columns: ['task_id'];
2078
2167
  isOneToOne: false;
2079
- referencedRelation: "prj_tasks";
2080
- referencedColumns: ["id"];
2168
+ referencedRelation: 'prj_tasks';
2169
+ referencedColumns: ['id'];
2081
2170
  }
2082
2171
  ];
2083
2172
  };
@@ -2135,39 +2224,39 @@ type Database = {
2135
2224
  };
2136
2225
  Relationships: [
2137
2226
  {
2138
- foreignKeyName: "fk_projects_company";
2139
- columns: ["client_company_id"];
2227
+ foreignKeyName: 'fk_projects_company';
2228
+ columns: ['client_company_id'];
2140
2229
  isOneToOne: false;
2141
- referencedRelation: "acq_companies";
2142
- referencedColumns: ["id"];
2230
+ referencedRelation: 'acq_companies';
2231
+ referencedColumns: ['id'];
2143
2232
  },
2144
2233
  {
2145
- foreignKeyName: "fk_projects_deal";
2146
- columns: ["deal_id"];
2234
+ foreignKeyName: 'fk_projects_deal';
2235
+ columns: ['deal_id'];
2147
2236
  isOneToOne: false;
2148
- referencedRelation: "acq_deals";
2149
- referencedColumns: ["id"];
2237
+ referencedRelation: 'acq_deals';
2238
+ referencedColumns: ['id'];
2150
2239
  },
2151
2240
  {
2152
- foreignKeyName: "prj_projects_client_company_id_fkey";
2153
- columns: ["client_company_id"];
2241
+ foreignKeyName: 'prj_projects_client_company_id_fkey';
2242
+ columns: ['client_company_id'];
2154
2243
  isOneToOne: false;
2155
- referencedRelation: "acq_companies";
2156
- referencedColumns: ["id"];
2244
+ referencedRelation: 'acq_companies';
2245
+ referencedColumns: ['id'];
2157
2246
  },
2158
2247
  {
2159
- foreignKeyName: "prj_projects_deal_id_fkey";
2160
- columns: ["deal_id"];
2248
+ foreignKeyName: 'prj_projects_deal_id_fkey';
2249
+ columns: ['deal_id'];
2161
2250
  isOneToOne: false;
2162
- referencedRelation: "acq_deals";
2163
- referencedColumns: ["id"];
2251
+ referencedRelation: 'acq_deals';
2252
+ referencedColumns: ['id'];
2164
2253
  },
2165
2254
  {
2166
- foreignKeyName: "prj_projects_organization_id_fkey";
2167
- columns: ["organization_id"];
2255
+ foreignKeyName: 'prj_projects_organization_id_fkey';
2256
+ columns: ['organization_id'];
2168
2257
  isOneToOne: false;
2169
- referencedRelation: "organizations";
2170
- referencedColumns: ["id"];
2258
+ referencedRelation: 'organizations';
2259
+ referencedColumns: ['id'];
2171
2260
  }
2172
2261
  ];
2173
2262
  };
@@ -2231,53 +2320,53 @@ type Database = {
2231
2320
  };
2232
2321
  Relationships: [
2233
2322
  {
2234
- foreignKeyName: "fk_tasks_milestone";
2235
- columns: ["milestone_id"];
2323
+ foreignKeyName: 'fk_tasks_milestone';
2324
+ columns: ['milestone_id'];
2236
2325
  isOneToOne: false;
2237
- referencedRelation: "prj_milestones";
2238
- referencedColumns: ["id"];
2326
+ referencedRelation: 'prj_milestones';
2327
+ referencedColumns: ['id'];
2239
2328
  },
2240
2329
  {
2241
- foreignKeyName: "fk_tasks_parent";
2242
- columns: ["parent_task_id"];
2330
+ foreignKeyName: 'fk_tasks_parent';
2331
+ columns: ['parent_task_id'];
2243
2332
  isOneToOne: false;
2244
- referencedRelation: "prj_tasks";
2245
- referencedColumns: ["id"];
2333
+ referencedRelation: 'prj_tasks';
2334
+ referencedColumns: ['id'];
2246
2335
  },
2247
2336
  {
2248
- foreignKeyName: "fk_tasks_project";
2249
- columns: ["project_id"];
2337
+ foreignKeyName: 'fk_tasks_project';
2338
+ columns: ['project_id'];
2250
2339
  isOneToOne: false;
2251
- referencedRelation: "prj_projects";
2252
- referencedColumns: ["id"];
2340
+ referencedRelation: 'prj_projects';
2341
+ referencedColumns: ['id'];
2253
2342
  },
2254
2343
  {
2255
- foreignKeyName: "prj_tasks_milestone_id_fkey";
2256
- columns: ["milestone_id"];
2344
+ foreignKeyName: 'prj_tasks_milestone_id_fkey';
2345
+ columns: ['milestone_id'];
2257
2346
  isOneToOne: false;
2258
- referencedRelation: "prj_milestones";
2259
- referencedColumns: ["id"];
2347
+ referencedRelation: 'prj_milestones';
2348
+ referencedColumns: ['id'];
2260
2349
  },
2261
2350
  {
2262
- foreignKeyName: "prj_tasks_organization_id_fkey";
2263
- columns: ["organization_id"];
2351
+ foreignKeyName: 'prj_tasks_organization_id_fkey';
2352
+ columns: ['organization_id'];
2264
2353
  isOneToOne: false;
2265
- referencedRelation: "organizations";
2266
- referencedColumns: ["id"];
2354
+ referencedRelation: 'organizations';
2355
+ referencedColumns: ['id'];
2267
2356
  },
2268
2357
  {
2269
- foreignKeyName: "prj_tasks_parent_task_id_fkey";
2270
- columns: ["parent_task_id"];
2358
+ foreignKeyName: 'prj_tasks_parent_task_id_fkey';
2359
+ columns: ['parent_task_id'];
2271
2360
  isOneToOne: false;
2272
- referencedRelation: "prj_tasks";
2273
- referencedColumns: ["id"];
2361
+ referencedRelation: 'prj_tasks';
2362
+ referencedColumns: ['id'];
2274
2363
  },
2275
2364
  {
2276
- foreignKeyName: "prj_tasks_project_id_fkey";
2277
- columns: ["project_id"];
2365
+ foreignKeyName: 'prj_tasks_project_id_fkey';
2366
+ columns: ['project_id'];
2278
2367
  isOneToOne: false;
2279
- referencedRelation: "prj_projects";
2280
- referencedColumns: ["id"];
2368
+ referencedRelation: 'prj_projects';
2369
+ referencedColumns: ['id'];
2281
2370
  }
2282
2371
  ];
2283
2372
  };
@@ -2347,25 +2436,25 @@ type Database = {
2347
2436
  };
2348
2437
  Relationships: [
2349
2438
  {
2350
- foreignKeyName: "reported_requests_organization_id_fkey";
2351
- columns: ["organization_id"];
2439
+ foreignKeyName: 'reported_requests_organization_id_fkey';
2440
+ columns: ['organization_id'];
2352
2441
  isOneToOne: false;
2353
- referencedRelation: "organizations";
2354
- referencedColumns: ["id"];
2442
+ referencedRelation: 'organizations';
2443
+ referencedColumns: ['id'];
2355
2444
  },
2356
2445
  {
2357
- foreignKeyName: "reported_requests_project_id_fkey";
2358
- columns: ["project_id"];
2446
+ foreignKeyName: 'reported_requests_project_id_fkey';
2447
+ columns: ['project_id'];
2359
2448
  isOneToOne: false;
2360
- referencedRelation: "prj_projects";
2361
- referencedColumns: ["id"];
2449
+ referencedRelation: 'prj_projects';
2450
+ referencedColumns: ['id'];
2362
2451
  },
2363
2452
  {
2364
- foreignKeyName: "reported_requests_task_id_fkey";
2365
- columns: ["task_id"];
2453
+ foreignKeyName: 'reported_requests_task_id_fkey';
2454
+ columns: ['task_id'];
2366
2455
  isOneToOne: false;
2367
- referencedRelation: "prj_tasks";
2368
- referencedColumns: ["id"];
2456
+ referencedRelation: 'prj_tasks';
2457
+ referencedColumns: ['id'];
2369
2458
  }
2370
2459
  ];
2371
2460
  };
@@ -2405,11 +2494,11 @@ type Database = {
2405
2494
  };
2406
2495
  Relationships: [
2407
2496
  {
2408
- foreignKeyName: "session_messages_session_id_fkey";
2409
- columns: ["session_id"];
2497
+ foreignKeyName: 'session_messages_session_id_fkey';
2498
+ columns: ['session_id'];
2410
2499
  isOneToOne: false;
2411
- referencedRelation: "sessions";
2412
- referencedColumns: ["session_id"];
2500
+ referencedRelation: 'sessions';
2501
+ referencedColumns: ['session_id'];
2413
2502
  }
2414
2503
  ];
2415
2504
  };
@@ -2464,18 +2553,18 @@ type Database = {
2464
2553
  };
2465
2554
  Relationships: [
2466
2555
  {
2467
- foreignKeyName: "fk_organization";
2468
- columns: ["organization_id"];
2556
+ foreignKeyName: 'fk_organization';
2557
+ columns: ['organization_id'];
2469
2558
  isOneToOne: false;
2470
- referencedRelation: "organizations";
2471
- referencedColumns: ["id"];
2559
+ referencedRelation: 'organizations';
2560
+ referencedColumns: ['id'];
2472
2561
  },
2473
2562
  {
2474
- foreignKeyName: "fk_user";
2475
- columns: ["user_id"];
2563
+ foreignKeyName: 'fk_user';
2564
+ columns: ['user_id'];
2476
2565
  isOneToOne: false;
2477
- referencedRelation: "users";
2478
- referencedColumns: ["id"];
2566
+ referencedRelation: 'users';
2567
+ referencedColumns: ['id'];
2479
2568
  }
2480
2569
  ];
2481
2570
  };
@@ -2551,11 +2640,11 @@ type Database = {
2551
2640
  };
2552
2641
  Relationships: [
2553
2642
  {
2554
- foreignKeyName: "task_schedules_organization_id_fkey";
2555
- columns: ["organization_id"];
2643
+ foreignKeyName: 'task_schedules_organization_id_fkey';
2644
+ columns: ['organization_id'];
2556
2645
  isOneToOne: false;
2557
- referencedRelation: "organizations";
2558
- referencedColumns: ["id"];
2646
+ referencedRelation: 'organizations';
2647
+ referencedColumns: ['id'];
2559
2648
  }
2560
2649
  ];
2561
2650
  };
@@ -2610,11 +2699,11 @@ type Database = {
2610
2699
  };
2611
2700
  Relationships: [
2612
2701
  {
2613
- foreignKeyName: "user_profiles_last_visited_org_fkey";
2614
- columns: ["last_visited_org"];
2702
+ foreignKeyName: 'user_profiles_last_visited_org_fkey';
2703
+ columns: ['last_visited_org'];
2615
2704
  isOneToOne: false;
2616
- referencedRelation: "organizations";
2617
- referencedColumns: ["id"];
2705
+ referencedRelation: 'organizations';
2706
+ referencedColumns: ['id'];
2618
2707
  }
2619
2708
  ];
2620
2709
  };
@@ -2663,11 +2752,11 @@ type Database = {
2663
2752
  };
2664
2753
  Relationships: [
2665
2754
  {
2666
- foreignKeyName: "webhook_endpoints_organization_id_fkey";
2667
- columns: ["organization_id"];
2755
+ foreignKeyName: 'webhook_endpoints_organization_id_fkey';
2756
+ columns: ['organization_id'];
2668
2757
  isOneToOne: false;
2669
- referencedRelation: "organizations";
2670
- referencedColumns: ["id"];
2758
+ referencedRelation: 'organizations';
2759
+ referencedColumns: ['id'];
2671
2760
  }
2672
2761
  ];
2673
2762
  };
@@ -2755,12 +2844,6 @@ type Database = {
2755
2844
  };
2756
2845
  Returns: boolean;
2757
2846
  };
2758
- is_org_admin: {
2759
- Args: {
2760
- org_id: string;
2761
- };
2762
- Returns: boolean;
2763
- };
2764
2847
  is_org_member: {
2765
2848
  Args: {
2766
2849
  org_id: string;
@@ -2821,17 +2904,17 @@ type Database = {
2821
2904
  };
2822
2905
  };
2823
2906
  };
2824
- type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">;
2825
- type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">];
2826
- type Tables<DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) | {
2907
+ type DatabaseWithoutInternals = Omit<Database, '__InternalSupabase'>;
2908
+ type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, 'public'>];
2909
+ type Tables<DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema['Tables'] & DefaultSchema['Views']) | {
2827
2910
  schema: keyof DatabaseWithoutInternals;
2828
2911
  }, TableName extends DefaultSchemaTableNameOrOptions extends {
2829
2912
  schema: keyof DatabaseWithoutInternals;
2830
- } ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"]) : never = never> = DefaultSchemaTableNameOrOptions extends {
2913
+ } ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Views']) : never = never> = DefaultSchemaTableNameOrOptions extends {
2831
2914
  schema: keyof DatabaseWithoutInternals;
2832
- } ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
2915
+ } ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Views'])[TableName] extends {
2833
2916
  Row: infer R;
2834
- } ? R : never : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) ? (DefaultSchema["Tables"] & DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
2917
+ } ? R : never : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema['Tables'] & DefaultSchema['Views']) ? (DefaultSchema['Tables'] & DefaultSchema['Views'])[DefaultSchemaTableNameOrOptions] extends {
2835
2918
  Row: infer R;
2836
2919
  } ? R : never : never;
2837
2920
 
@@ -2915,6 +2998,14 @@ declare class RLSTestContext {
2915
2998
  * Create an organization membership
2916
2999
  */
2917
3000
  createMembership(userId: string, organizationId: string, role: Role): Promise<Membership>;
3001
+ /**
3002
+ * Assign a system role to a membership via org_rol_assignments.
3003
+ * After the 2026-04-25 auth refactor, RLS policies read `effective_permissions[]`
3004
+ * (materialized by trigger from org_rol_assignments → org_rol_grants).
3005
+ * Without this assignment, role_slug is informational only and the membership
3006
+ * has zero permissions, causing all has_org_permission() checks to deny.
3007
+ */
3008
+ private assignSystemRole;
2918
3009
  /**
2919
3010
  * Create a pre-provisioned organization membership (without WorkOS membership ID)
2920
3011
  * Used for testing invitation flows where memberships are created before user accepts