@elevasis/sdk 1.13.2 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -895,7 +895,7 @@ type Json = string | number | boolean | null | {
895
895
  } | Json[];
896
896
  type Database = {
897
897
  __InternalSupabase: {
898
- PostgrestVersion: "12.2.3 (519615d)";
898
+ PostgrestVersion: '12.2.3 (519615d)';
899
899
  };
900
900
  public: {
901
901
  Tables: {
@@ -938,11 +938,11 @@ type Database = {
938
938
  };
939
939
  Relationships: [
940
940
  {
941
- foreignKeyName: "acq_artifacts_organization_id_fkey";
942
- columns: ["organization_id"];
941
+ foreignKeyName: 'acq_artifacts_organization_id_fkey';
942
+ columns: ['organization_id'];
943
943
  isOneToOne: false;
944
- referencedRelation: "organizations";
945
- referencedColumns: ["id"];
944
+ referencedRelation: 'organizations';
945
+ referencedColumns: ['id'];
946
946
  }
947
947
  ];
948
948
  };
@@ -1027,11 +1027,11 @@ type Database = {
1027
1027
  };
1028
1028
  Relationships: [
1029
1029
  {
1030
- foreignKeyName: "acq_companies_organization_id_fkey";
1031
- columns: ["organization_id"];
1030
+ foreignKeyName: 'acq_companies_organization_id_fkey';
1031
+ columns: ['organization_id'];
1032
1032
  isOneToOne: false;
1033
- referencedRelation: "organizations";
1034
- referencedColumns: ["id"];
1033
+ referencedRelation: 'organizations';
1034
+ referencedColumns: ['id'];
1035
1035
  }
1036
1036
  ];
1037
1037
  };
@@ -1122,18 +1122,18 @@ type Database = {
1122
1122
  };
1123
1123
  Relationships: [
1124
1124
  {
1125
- foreignKeyName: "acq_contacts_company_id_fkey";
1126
- columns: ["company_id"];
1125
+ foreignKeyName: 'acq_contacts_company_id_fkey';
1126
+ columns: ['company_id'];
1127
1127
  isOneToOne: false;
1128
- referencedRelation: "acq_companies";
1129
- referencedColumns: ["id"];
1128
+ referencedRelation: 'acq_companies';
1129
+ referencedColumns: ['id'];
1130
1130
  },
1131
1131
  {
1132
- foreignKeyName: "acq_contacts_organization_id_fkey";
1133
- columns: ["organization_id"];
1132
+ foreignKeyName: 'acq_contacts_organization_id_fkey';
1133
+ columns: ['organization_id'];
1134
1134
  isOneToOne: false;
1135
- referencedRelation: "organizations";
1136
- referencedColumns: ["id"];
1135
+ referencedRelation: 'organizations';
1136
+ referencedColumns: ['id'];
1137
1137
  }
1138
1138
  ];
1139
1139
  };
@@ -1170,11 +1170,11 @@ type Database = {
1170
1170
  };
1171
1171
  Relationships: [
1172
1172
  {
1173
- foreignKeyName: "acq_content_organization_id_fkey";
1174
- columns: ["organization_id"];
1173
+ foreignKeyName: 'acq_content_organization_id_fkey';
1174
+ columns: ['organization_id'];
1175
1175
  isOneToOne: false;
1176
- referencedRelation: "organizations";
1177
- referencedColumns: ["id"];
1176
+ referencedRelation: 'organizations';
1177
+ referencedColumns: ['id'];
1178
1178
  }
1179
1179
  ];
1180
1180
  };
@@ -1238,18 +1238,18 @@ type Database = {
1238
1238
  };
1239
1239
  Relationships: [
1240
1240
  {
1241
- foreignKeyName: "acq_content_distributions_content_id_fkey";
1242
- columns: ["content_id"];
1241
+ foreignKeyName: 'acq_content_distributions_content_id_fkey';
1242
+ columns: ['content_id'];
1243
1243
  isOneToOne: false;
1244
- referencedRelation: "acq_content";
1245
- referencedColumns: ["id"];
1244
+ referencedRelation: 'acq_content';
1245
+ referencedColumns: ['id'];
1246
1246
  },
1247
1247
  {
1248
- foreignKeyName: "acq_content_distributions_organization_id_fkey";
1249
- columns: ["organization_id"];
1248
+ foreignKeyName: 'acq_content_distributions_organization_id_fkey';
1249
+ columns: ['organization_id'];
1250
1250
  isOneToOne: false;
1251
- referencedRelation: "organizations";
1252
- referencedColumns: ["id"];
1251
+ referencedRelation: 'organizations';
1252
+ referencedColumns: ['id'];
1253
1253
  }
1254
1254
  ];
1255
1255
  };
@@ -1283,18 +1283,18 @@ type Database = {
1283
1283
  };
1284
1284
  Relationships: [
1285
1285
  {
1286
- foreignKeyName: "acq_deal_notes_deal_id_fkey";
1287
- columns: ["deal_id"];
1286
+ foreignKeyName: 'acq_deal_notes_deal_id_fkey';
1287
+ columns: ['deal_id'];
1288
1288
  isOneToOne: false;
1289
- referencedRelation: "acq_deals";
1290
- referencedColumns: ["id"];
1289
+ referencedRelation: 'acq_deals';
1290
+ referencedColumns: ['id'];
1291
1291
  },
1292
1292
  {
1293
- foreignKeyName: "acq_deal_notes_organization_id_fkey";
1294
- columns: ["organization_id"];
1293
+ foreignKeyName: 'acq_deal_notes_organization_id_fkey';
1294
+ columns: ['organization_id'];
1295
1295
  isOneToOne: false;
1296
- referencedRelation: "organizations";
1297
- referencedColumns: ["id"];
1296
+ referencedRelation: 'organizations';
1297
+ referencedColumns: ['id'];
1298
1298
  }
1299
1299
  ];
1300
1300
  };
@@ -1346,18 +1346,18 @@ type Database = {
1346
1346
  };
1347
1347
  Relationships: [
1348
1348
  {
1349
- foreignKeyName: "acq_deal_tasks_deal_id_fkey";
1350
- columns: ["deal_id"];
1349
+ foreignKeyName: 'acq_deal_tasks_deal_id_fkey';
1350
+ columns: ['deal_id'];
1351
1351
  isOneToOne: false;
1352
- referencedRelation: "acq_deals";
1353
- referencedColumns: ["id"];
1352
+ referencedRelation: 'acq_deals';
1353
+ referencedColumns: ['id'];
1354
1354
  },
1355
1355
  {
1356
- foreignKeyName: "acq_deal_tasks_organization_id_fkey";
1357
- columns: ["organization_id"];
1356
+ foreignKeyName: 'acq_deal_tasks_organization_id_fkey';
1357
+ columns: ['organization_id'];
1358
1358
  isOneToOne: false;
1359
- referencedRelation: "organizations";
1360
- referencedColumns: ["id"];
1359
+ referencedRelation: 'organizations';
1360
+ referencedColumns: ['id'];
1361
1361
  }
1362
1362
  ];
1363
1363
  };
@@ -1469,25 +1469,25 @@ type Database = {
1469
1469
  };
1470
1470
  Relationships: [
1471
1471
  {
1472
- foreignKeyName: "acq_deals_contact_id_fkey";
1473
- columns: ["contact_id"];
1472
+ foreignKeyName: 'acq_deals_contact_id_fkey';
1473
+ columns: ['contact_id'];
1474
1474
  isOneToOne: false;
1475
- referencedRelation: "acq_contacts";
1476
- referencedColumns: ["id"];
1475
+ referencedRelation: 'acq_contacts';
1476
+ referencedColumns: ['id'];
1477
1477
  },
1478
1478
  {
1479
- foreignKeyName: "acq_deals_organization_id_fkey";
1480
- columns: ["organization_id"];
1479
+ foreignKeyName: 'acq_deals_organization_id_fkey';
1480
+ columns: ['organization_id'];
1481
1481
  isOneToOne: false;
1482
- referencedRelation: "organizations";
1483
- referencedColumns: ["id"];
1482
+ referencedRelation: 'organizations';
1483
+ referencedColumns: ['id'];
1484
1484
  },
1485
1485
  {
1486
- foreignKeyName: "acq_deals_source_list_id_fkey";
1487
- columns: ["source_list_id"];
1486
+ foreignKeyName: 'acq_deals_source_list_id_fkey';
1487
+ columns: ['source_list_id'];
1488
1488
  isOneToOne: false;
1489
- referencedRelation: "acq_lists";
1490
- referencedColumns: ["id"];
1489
+ referencedRelation: 'acq_lists';
1490
+ referencedColumns: ['id'];
1491
1491
  }
1492
1492
  ];
1493
1493
  };
@@ -1500,6 +1500,7 @@ type Database = {
1500
1500
  id: string;
1501
1501
  list_id: string;
1502
1502
  pipeline_key: string;
1503
+ processing_state: Json;
1503
1504
  source_execution_id: string | null;
1504
1505
  source_input_hash: string | null;
1505
1506
  source_resource_id: string | null;
@@ -1514,6 +1515,7 @@ type Database = {
1514
1515
  id?: string;
1515
1516
  list_id: string;
1516
1517
  pipeline_key?: string;
1518
+ processing_state?: Json;
1517
1519
  source_execution_id?: string | null;
1518
1520
  source_input_hash?: string | null;
1519
1521
  source_resource_id?: string | null;
@@ -1528,6 +1530,7 @@ type Database = {
1528
1530
  id?: string;
1529
1531
  list_id?: string;
1530
1532
  pipeline_key?: string;
1533
+ processing_state?: Json;
1531
1534
  source_execution_id?: string | null;
1532
1535
  source_input_hash?: string | null;
1533
1536
  source_resource_id?: string | null;
@@ -1536,25 +1539,25 @@ type Database = {
1536
1539
  };
1537
1540
  Relationships: [
1538
1541
  {
1539
- foreignKeyName: "acq_list_companies_company_id_fkey";
1540
- columns: ["company_id"];
1542
+ foreignKeyName: 'acq_list_companies_company_id_fkey';
1543
+ columns: ['company_id'];
1541
1544
  isOneToOne: false;
1542
- referencedRelation: "acq_companies";
1543
- referencedColumns: ["id"];
1545
+ referencedRelation: 'acq_companies';
1546
+ referencedColumns: ['id'];
1544
1547
  },
1545
1548
  {
1546
- foreignKeyName: "acq_list_companies_list_id_fkey";
1547
- columns: ["list_id"];
1549
+ foreignKeyName: 'acq_list_companies_list_id_fkey';
1550
+ columns: ['list_id'];
1548
1551
  isOneToOne: false;
1549
- referencedRelation: "acq_lists";
1550
- referencedColumns: ["id"];
1552
+ referencedRelation: 'acq_lists';
1553
+ referencedColumns: ['id'];
1551
1554
  },
1552
1555
  {
1553
- foreignKeyName: "acq_list_companies_source_execution_id_fkey";
1554
- columns: ["source_execution_id"];
1556
+ foreignKeyName: 'acq_list_companies_source_execution_id_fkey';
1557
+ columns: ['source_execution_id'];
1555
1558
  isOneToOne: false;
1556
- referencedRelation: "execution_logs";
1557
- referencedColumns: ["execution_id"];
1559
+ referencedRelation: 'execution_logs';
1560
+ referencedColumns: ['execution_id'];
1558
1561
  }
1559
1562
  ];
1560
1563
  };
@@ -1582,18 +1585,18 @@ type Database = {
1582
1585
  };
1583
1586
  Relationships: [
1584
1587
  {
1585
- foreignKeyName: "acq_list_executions_execution_id_fkey";
1586
- columns: ["execution_id"];
1588
+ foreignKeyName: 'acq_list_executions_execution_id_fkey';
1589
+ columns: ['execution_id'];
1587
1590
  isOneToOne: false;
1588
- referencedRelation: "execution_logs";
1589
- referencedColumns: ["execution_id"];
1591
+ referencedRelation: 'execution_logs';
1592
+ referencedColumns: ['execution_id'];
1590
1593
  },
1591
1594
  {
1592
- foreignKeyName: "acq_list_executions_list_id_fkey";
1593
- columns: ["list_id"];
1595
+ foreignKeyName: 'acq_list_executions_list_id_fkey';
1596
+ columns: ['list_id'];
1594
1597
  isOneToOne: false;
1595
- referencedRelation: "acq_lists";
1596
- referencedColumns: ["id"];
1598
+ referencedRelation: 'acq_lists';
1599
+ referencedColumns: ['id'];
1597
1600
  }
1598
1601
  ];
1599
1602
  };
@@ -1606,6 +1609,7 @@ type Database = {
1606
1609
  id: string;
1607
1610
  list_id: string;
1608
1611
  pipeline_key: string;
1612
+ processing_state: Json;
1609
1613
  source_execution_id: string | null;
1610
1614
  source_input_hash: string | null;
1611
1615
  source_resource_id: string | null;
@@ -1620,6 +1624,7 @@ type Database = {
1620
1624
  id?: string;
1621
1625
  list_id: string;
1622
1626
  pipeline_key?: string;
1627
+ processing_state?: Json;
1623
1628
  source_execution_id?: string | null;
1624
1629
  source_input_hash?: string | null;
1625
1630
  source_resource_id?: string | null;
@@ -1634,6 +1639,7 @@ type Database = {
1634
1639
  id?: string;
1635
1640
  list_id?: string;
1636
1641
  pipeline_key?: string;
1642
+ processing_state?: Json;
1637
1643
  source_execution_id?: string | null;
1638
1644
  source_input_hash?: string | null;
1639
1645
  source_resource_id?: string | null;
@@ -1642,25 +1648,25 @@ type Database = {
1642
1648
  };
1643
1649
  Relationships: [
1644
1650
  {
1645
- foreignKeyName: "acq_list_members_contact_id_fkey";
1646
- columns: ["contact_id"];
1651
+ foreignKeyName: 'acq_list_members_contact_id_fkey';
1652
+ columns: ['contact_id'];
1647
1653
  isOneToOne: false;
1648
- referencedRelation: "acq_contacts";
1649
- referencedColumns: ["id"];
1654
+ referencedRelation: 'acq_contacts';
1655
+ referencedColumns: ['id'];
1650
1656
  },
1651
1657
  {
1652
- foreignKeyName: "acq_list_members_list_id_fkey";
1653
- columns: ["list_id"];
1658
+ foreignKeyName: 'acq_list_members_list_id_fkey';
1659
+ columns: ['list_id'];
1654
1660
  isOneToOne: false;
1655
- referencedRelation: "acq_lists";
1656
- referencedColumns: ["id"];
1661
+ referencedRelation: 'acq_lists';
1662
+ referencedColumns: ['id'];
1657
1663
  },
1658
1664
  {
1659
- foreignKeyName: "acq_list_members_source_execution_id_fkey";
1660
- columns: ["source_execution_id"];
1665
+ foreignKeyName: 'acq_list_members_source_execution_id_fkey';
1666
+ columns: ['source_execution_id'];
1661
1667
  isOneToOne: false;
1662
- referencedRelation: "execution_logs";
1663
- referencedColumns: ["execution_id"];
1668
+ referencedRelation: 'execution_logs';
1669
+ referencedColumns: ['execution_id'];
1664
1670
  }
1665
1671
  ];
1666
1672
  };
@@ -1680,7 +1686,6 @@ type Database = {
1680
1686
  pipeline_config: Json;
1681
1687
  scraping_config: Json;
1682
1688
  status: string;
1683
- type: string;
1684
1689
  };
1685
1690
  Insert: {
1686
1691
  batch_ids?: string[];
@@ -1697,7 +1702,6 @@ type Database = {
1697
1702
  pipeline_config?: Json;
1698
1703
  scraping_config?: Json;
1699
1704
  status?: string;
1700
- type?: string;
1701
1705
  };
1702
1706
  Update: {
1703
1707
  batch_ids?: string[];
@@ -1714,15 +1718,14 @@ type Database = {
1714
1718
  pipeline_config?: Json;
1715
1719
  scraping_config?: Json;
1716
1720
  status?: string;
1717
- type?: string;
1718
1721
  };
1719
1722
  Relationships: [
1720
1723
  {
1721
- foreignKeyName: "acq_lists_organization_id_fkey";
1722
- columns: ["organization_id"];
1724
+ foreignKeyName: 'acq_lists_organization_id_fkey';
1725
+ columns: ['organization_id'];
1723
1726
  isOneToOne: false;
1724
- referencedRelation: "organizations";
1725
- referencedColumns: ["id"];
1727
+ referencedRelation: 'organizations';
1728
+ referencedColumns: ['id'];
1726
1729
  }
1727
1730
  ];
1728
1731
  };
@@ -1798,18 +1801,18 @@ type Database = {
1798
1801
  };
1799
1802
  Relationships: [
1800
1803
  {
1801
- foreignKeyName: "acq_seo_metrics_organization_id_fkey";
1802
- columns: ["organization_id"];
1804
+ foreignKeyName: 'acq_seo_metrics_organization_id_fkey';
1805
+ columns: ['organization_id'];
1803
1806
  isOneToOne: false;
1804
- referencedRelation: "organizations";
1805
- referencedColumns: ["id"];
1807
+ referencedRelation: 'organizations';
1808
+ referencedColumns: ['id'];
1806
1809
  },
1807
1810
  {
1808
- foreignKeyName: "acq_seo_metrics_seo_page_id_fkey";
1809
- columns: ["seo_page_id"];
1811
+ foreignKeyName: 'acq_seo_metrics_seo_page_id_fkey';
1812
+ columns: ['seo_page_id'];
1810
1813
  isOneToOne: false;
1811
- referencedRelation: "acq_seo_pages";
1812
- referencedColumns: ["id"];
1814
+ referencedRelation: 'acq_seo_pages';
1815
+ referencedColumns: ['id'];
1813
1816
  }
1814
1817
  ];
1815
1818
  };
@@ -1885,11 +1888,11 @@ type Database = {
1885
1888
  };
1886
1889
  Relationships: [
1887
1890
  {
1888
- foreignKeyName: "acq_seo_pages_organization_id_fkey";
1889
- columns: ["organization_id"];
1891
+ foreignKeyName: 'acq_seo_pages_organization_id_fkey';
1892
+ columns: ['organization_id'];
1890
1893
  isOneToOne: false;
1891
- referencedRelation: "organizations";
1892
- referencedColumns: ["id"];
1894
+ referencedRelation: 'organizations';
1895
+ referencedColumns: ['id'];
1893
1896
  }
1894
1897
  ];
1895
1898
  };
@@ -1986,67 +1989,11 @@ type Database = {
1986
1989
  };
1987
1990
  Relationships: [
1988
1991
  {
1989
- foreignKeyName: "acq_social_posts_organization_id_fkey";
1990
- columns: ["organization_id"];
1991
- isOneToOne: false;
1992
- referencedRelation: "organizations";
1993
- referencedColumns: ["id"];
1994
- }
1995
- ];
1996
- };
1997
- acq_touchpoints: {
1998
- Row: {
1999
- artifact_id: string | null;
2000
- channel: string;
2001
- contact_id: string | null;
2002
- created_at: string;
2003
- direction: string;
2004
- id: string;
2005
- kind: string;
2006
- list_id: string | null;
2007
- list_member_id: string | null;
2008
- occurred_at: string;
2009
- organization_id: string;
2010
- payload: Json | null;
2011
- source_execution_id: string | null;
2012
- };
2013
- Insert: {
2014
- artifact_id?: string | null;
2015
- channel: string;
2016
- contact_id?: string | null;
2017
- created_at?: string;
2018
- direction: string;
2019
- id?: string;
2020
- kind: string;
2021
- list_id?: string | null;
2022
- list_member_id?: string | null;
2023
- occurred_at: string;
2024
- organization_id: string;
2025
- payload?: Json | null;
2026
- source_execution_id?: string | null;
2027
- };
2028
- Update: {
2029
- artifact_id?: string | null;
2030
- channel?: string;
2031
- contact_id?: string | null;
2032
- created_at?: string;
2033
- direction?: string;
2034
- id?: string;
2035
- kind?: string;
2036
- list_id?: string | null;
2037
- list_member_id?: string | null;
2038
- occurred_at?: string;
2039
- organization_id?: string;
2040
- payload?: Json | null;
2041
- source_execution_id?: string | null;
2042
- };
2043
- Relationships: [
2044
- {
2045
- foreignKeyName: "acq_touchpoints_organization_id_fkey";
2046
- columns: ["organization_id"];
1992
+ foreignKeyName: 'acq_social_posts_organization_id_fkey';
1993
+ columns: ['organization_id'];
2047
1994
  isOneToOne: false;
2048
- referencedRelation: "organizations";
2049
- referencedColumns: ["id"];
1995
+ referencedRelation: 'organizations';
1996
+ referencedColumns: ['id'];
2050
1997
  }
2051
1998
  ];
2052
1999
  };
@@ -2101,11 +2048,11 @@ type Database = {
2101
2048
  };
2102
2049
  Relationships: [
2103
2050
  {
2104
- foreignKeyName: "activities_organization_id_fkey";
2105
- columns: ["organization_id"];
2051
+ foreignKeyName: 'activities_organization_id_fkey';
2052
+ columns: ['organization_id'];
2106
2053
  isOneToOne: false;
2107
- referencedRelation: "organizations";
2108
- referencedColumns: ["id"];
2054
+ referencedRelation: 'organizations';
2055
+ referencedColumns: ['id'];
2109
2056
  }
2110
2057
  ];
2111
2058
  };
@@ -2136,11 +2083,11 @@ type Database = {
2136
2083
  };
2137
2084
  Relationships: [
2138
2085
  {
2139
- foreignKeyName: "api_keys_organization_id_fkey";
2140
- columns: ["organization_id"];
2086
+ foreignKeyName: 'api_keys_organization_id_fkey';
2087
+ columns: ['organization_id'];
2141
2088
  isOneToOne: false;
2142
- referencedRelation: "organizations";
2143
- referencedColumns: ["id"];
2089
+ referencedRelation: 'organizations';
2090
+ referencedColumns: ['id'];
2144
2091
  }
2145
2092
  ];
2146
2093
  };
@@ -2219,25 +2166,25 @@ type Database = {
2219
2166
  };
2220
2167
  Relationships: [
2221
2168
  {
2222
- foreignKeyName: "command_queue_completed_by_fkey";
2223
- columns: ["completed_by"];
2169
+ foreignKeyName: 'command_queue_completed_by_fkey';
2170
+ columns: ['completed_by'];
2224
2171
  isOneToOne: false;
2225
- referencedRelation: "users";
2226
- referencedColumns: ["id"];
2172
+ referencedRelation: 'users';
2173
+ referencedColumns: ['id'];
2227
2174
  },
2228
2175
  {
2229
- foreignKeyName: "command_queue_organization_id_fkey";
2230
- columns: ["organization_id"];
2176
+ foreignKeyName: 'command_queue_organization_id_fkey';
2177
+ columns: ['organization_id'];
2231
2178
  isOneToOne: false;
2232
- referencedRelation: "organizations";
2233
- referencedColumns: ["id"];
2179
+ referencedRelation: 'organizations';
2180
+ referencedColumns: ['id'];
2234
2181
  },
2235
2182
  {
2236
- foreignKeyName: "command_queue_target_execution_id_fkey";
2237
- columns: ["target_execution_id"];
2183
+ foreignKeyName: 'command_queue_target_execution_id_fkey';
2184
+ columns: ['target_execution_id'];
2238
2185
  isOneToOne: false;
2239
- referencedRelation: "execution_logs";
2240
- referencedColumns: ["execution_id"];
2186
+ referencedRelation: 'execution_logs';
2187
+ referencedColumns: ['execution_id'];
2241
2188
  }
2242
2189
  ];
2243
2190
  };
@@ -2277,18 +2224,18 @@ type Database = {
2277
2224
  };
2278
2225
  Relationships: [
2279
2226
  {
2280
- foreignKeyName: "credentials_created_by_fkey";
2281
- columns: ["created_by"];
2227
+ foreignKeyName: 'credentials_created_by_fkey';
2228
+ columns: ['created_by'];
2282
2229
  isOneToOne: false;
2283
- referencedRelation: "users";
2284
- referencedColumns: ["id"];
2230
+ referencedRelation: 'users';
2231
+ referencedColumns: ['id'];
2285
2232
  },
2286
2233
  {
2287
- foreignKeyName: "credentials_organization_id_fkey";
2288
- columns: ["organization_id"];
2234
+ foreignKeyName: 'credentials_organization_id_fkey';
2235
+ columns: ['organization_id'];
2289
2236
  isOneToOne: false;
2290
- referencedRelation: "organizations";
2291
- referencedColumns: ["id"];
2237
+ referencedRelation: 'organizations';
2238
+ referencedColumns: ['id'];
2292
2239
  }
2293
2240
  ];
2294
2241
  };
@@ -2334,11 +2281,11 @@ type Database = {
2334
2281
  };
2335
2282
  Relationships: [
2336
2283
  {
2337
- foreignKeyName: "deployments_organization_id_fkey";
2338
- columns: ["organization_id"];
2284
+ foreignKeyName: 'deployments_organization_id_fkey';
2285
+ columns: ['organization_id'];
2339
2286
  isOneToOne: false;
2340
- referencedRelation: "organizations";
2341
- referencedColumns: ["id"];
2287
+ referencedRelation: 'organizations';
2288
+ referencedColumns: ['id'];
2342
2289
  }
2343
2290
  ];
2344
2291
  };
@@ -2393,25 +2340,25 @@ type Database = {
2393
2340
  };
2394
2341
  Relationships: [
2395
2342
  {
2396
- foreignKeyName: "execution_errors_execution_id_fkey";
2397
- columns: ["execution_id"];
2343
+ foreignKeyName: 'execution_errors_execution_id_fkey';
2344
+ columns: ['execution_id'];
2398
2345
  isOneToOne: false;
2399
- referencedRelation: "execution_logs";
2400
- referencedColumns: ["execution_id"];
2346
+ referencedRelation: 'execution_logs';
2347
+ referencedColumns: ['execution_id'];
2401
2348
  },
2402
2349
  {
2403
- foreignKeyName: "execution_errors_organization_id_fkey";
2404
- columns: ["organization_id"];
2350
+ foreignKeyName: 'execution_errors_organization_id_fkey';
2351
+ columns: ['organization_id'];
2405
2352
  isOneToOne: false;
2406
- referencedRelation: "organizations";
2407
- referencedColumns: ["id"];
2353
+ referencedRelation: 'organizations';
2354
+ referencedColumns: ['id'];
2408
2355
  },
2409
2356
  {
2410
- foreignKeyName: "execution_errors_resolved_by_fkey";
2411
- columns: ["resolved_by"];
2357
+ foreignKeyName: 'execution_errors_resolved_by_fkey';
2358
+ columns: ['resolved_by'];
2412
2359
  isOneToOne: false;
2413
- referencedRelation: "users";
2414
- referencedColumns: ["id"];
2360
+ referencedRelation: 'users';
2361
+ referencedColumns: ['id'];
2415
2362
  }
2416
2363
  ];
2417
2364
  };
@@ -2493,32 +2440,32 @@ type Database = {
2493
2440
  };
2494
2441
  Relationships: [
2495
2442
  {
2496
- foreignKeyName: "execution_history_organization_id_fkey";
2497
- columns: ["organization_id"];
2443
+ foreignKeyName: 'execution_history_organization_id_fkey';
2444
+ columns: ['organization_id'];
2498
2445
  isOneToOne: false;
2499
- referencedRelation: "organizations";
2500
- referencedColumns: ["id"];
2446
+ referencedRelation: 'organizations';
2447
+ referencedColumns: ['id'];
2501
2448
  },
2502
2449
  {
2503
- foreignKeyName: "execution_logs_origin_execution_id_fkey";
2504
- columns: ["origin_execution_id"];
2450
+ foreignKeyName: 'execution_logs_origin_execution_id_fkey';
2451
+ columns: ['origin_execution_id'];
2505
2452
  isOneToOne: false;
2506
- referencedRelation: "execution_logs";
2507
- referencedColumns: ["execution_id"];
2453
+ referencedRelation: 'execution_logs';
2454
+ referencedColumns: ['execution_id'];
2508
2455
  },
2509
2456
  {
2510
- foreignKeyName: "execution_logs_session_id_fkey";
2511
- columns: ["session_id"];
2457
+ foreignKeyName: 'execution_logs_session_id_fkey';
2458
+ columns: ['session_id'];
2512
2459
  isOneToOne: false;
2513
- referencedRelation: "sessions";
2514
- referencedColumns: ["session_id"];
2460
+ referencedRelation: 'sessions';
2461
+ referencedColumns: ['session_id'];
2515
2462
  },
2516
2463
  {
2517
- foreignKeyName: "execution_logs_user_id_fkey";
2518
- columns: ["user_id"];
2464
+ foreignKeyName: 'execution_logs_user_id_fkey';
2465
+ columns: ['user_id'];
2519
2466
  isOneToOne: false;
2520
- referencedRelation: "users";
2521
- referencedColumns: ["id"];
2467
+ referencedRelation: 'users';
2468
+ referencedColumns: ['id'];
2522
2469
  }
2523
2470
  ];
2524
2471
  };
@@ -2564,18 +2511,18 @@ type Database = {
2564
2511
  };
2565
2512
  Relationships: [
2566
2513
  {
2567
- foreignKeyName: "execution_metrics_execution_id_fkey";
2568
- columns: ["execution_id"];
2514
+ foreignKeyName: 'execution_metrics_execution_id_fkey';
2515
+ columns: ['execution_id'];
2569
2516
  isOneToOne: true;
2570
- referencedRelation: "execution_logs";
2571
- referencedColumns: ["execution_id"];
2517
+ referencedRelation: 'execution_logs';
2518
+ referencedColumns: ['execution_id'];
2572
2519
  },
2573
2520
  {
2574
- foreignKeyName: "execution_metrics_organization_id_fkey";
2575
- columns: ["organization_id"];
2521
+ foreignKeyName: 'execution_metrics_organization_id_fkey';
2522
+ columns: ['organization_id'];
2576
2523
  isOneToOne: false;
2577
- referencedRelation: "organizations";
2578
- referencedColumns: ["id"];
2524
+ referencedRelation: 'organizations';
2525
+ referencedColumns: ['id'];
2579
2526
  }
2580
2527
  ];
2581
2528
  };
@@ -2618,18 +2565,18 @@ type Database = {
2618
2565
  };
2619
2566
  Relationships: [
2620
2567
  {
2621
- foreignKeyName: "notifications_organization_id_fkey";
2622
- columns: ["organization_id"];
2568
+ foreignKeyName: 'notifications_organization_id_fkey';
2569
+ columns: ['organization_id'];
2623
2570
  isOneToOne: false;
2624
- referencedRelation: "organizations";
2625
- referencedColumns: ["id"];
2571
+ referencedRelation: 'organizations';
2572
+ referencedColumns: ['id'];
2626
2573
  },
2627
2574
  {
2628
- foreignKeyName: "notifications_user_id_fkey";
2629
- columns: ["user_id"];
2575
+ foreignKeyName: 'notifications_user_id_fkey';
2576
+ columns: ['user_id'];
2630
2577
  isOneToOne: false;
2631
- referencedRelation: "users";
2632
- referencedColumns: ["id"];
2578
+ referencedRelation: 'users';
2579
+ referencedColumns: ['id'];
2633
2580
  }
2634
2581
  ];
2635
2582
  };
@@ -2684,18 +2631,18 @@ type Database = {
2684
2631
  };
2685
2632
  Relationships: [
2686
2633
  {
2687
- foreignKeyName: "org_invitations_inviter_user_id_fkey";
2688
- columns: ["inviter_user_id"];
2634
+ foreignKeyName: 'org_invitations_inviter_user_id_fkey';
2635
+ columns: ['inviter_user_id'];
2689
2636
  isOneToOne: false;
2690
- referencedRelation: "users";
2691
- referencedColumns: ["id"];
2637
+ referencedRelation: 'users';
2638
+ referencedColumns: ['id'];
2692
2639
  },
2693
2640
  {
2694
- foreignKeyName: "org_invitations_organization_id_fkey";
2695
- columns: ["organization_id"];
2641
+ foreignKeyName: 'org_invitations_organization_id_fkey';
2642
+ columns: ['organization_id'];
2696
2643
  isOneToOne: false;
2697
- referencedRelation: "organizations";
2698
- referencedColumns: ["id"];
2644
+ referencedRelation: 'organizations';
2645
+ referencedColumns: ['id'];
2699
2646
  }
2700
2647
  ];
2701
2648
  };
@@ -2738,18 +2685,18 @@ type Database = {
2738
2685
  };
2739
2686
  Relationships: [
2740
2687
  {
2741
- foreignKeyName: "org_memberships_organization_id_fkey";
2742
- columns: ["organization_id"];
2688
+ foreignKeyName: 'org_memberships_organization_id_fkey';
2689
+ columns: ['organization_id'];
2743
2690
  isOneToOne: false;
2744
- referencedRelation: "organizations";
2745
- referencedColumns: ["id"];
2691
+ referencedRelation: 'organizations';
2692
+ referencedColumns: ['id'];
2746
2693
  },
2747
2694
  {
2748
- foreignKeyName: "org_memberships_user_id_fkey";
2749
- columns: ["user_id"];
2695
+ foreignKeyName: 'org_memberships_user_id_fkey';
2696
+ columns: ['user_id'];
2750
2697
  isOneToOne: false;
2751
- referencedRelation: "users";
2752
- referencedColumns: ["id"];
2698
+ referencedRelation: 'users';
2699
+ referencedColumns: ['id'];
2753
2700
  }
2754
2701
  ];
2755
2702
  };
@@ -2774,25 +2721,25 @@ type Database = {
2774
2721
  };
2775
2722
  Relationships: [
2776
2723
  {
2777
- foreignKeyName: "org_rol_assignments_granted_by_fkey";
2778
- columns: ["granted_by"];
2724
+ foreignKeyName: 'org_rol_assignments_granted_by_fkey';
2725
+ columns: ['granted_by'];
2779
2726
  isOneToOne: false;
2780
- referencedRelation: "users";
2781
- referencedColumns: ["id"];
2727
+ referencedRelation: 'users';
2728
+ referencedColumns: ['id'];
2782
2729
  },
2783
2730
  {
2784
- foreignKeyName: "org_rol_assignments_membership_id_fkey";
2785
- columns: ["membership_id"];
2731
+ foreignKeyName: 'org_rol_assignments_membership_id_fkey';
2732
+ columns: ['membership_id'];
2786
2733
  isOneToOne: false;
2787
- referencedRelation: "org_memberships";
2788
- referencedColumns: ["id"];
2734
+ referencedRelation: 'org_memberships';
2735
+ referencedColumns: ['id'];
2789
2736
  },
2790
2737
  {
2791
- foreignKeyName: "org_rol_assignments_role_id_fkey";
2792
- columns: ["role_id"];
2738
+ foreignKeyName: 'org_rol_assignments_role_id_fkey';
2739
+ columns: ['role_id'];
2793
2740
  isOneToOne: false;
2794
- referencedRelation: "org_rol_definitions";
2795
- referencedColumns: ["id"];
2741
+ referencedRelation: 'org_rol_definitions';
2742
+ referencedColumns: ['id'];
2796
2743
  }
2797
2744
  ];
2798
2745
  };
@@ -2829,11 +2776,11 @@ type Database = {
2829
2776
  };
2830
2777
  Relationships: [
2831
2778
  {
2832
- foreignKeyName: "org_rol_definitions_organization_id_fkey";
2833
- columns: ["organization_id"];
2779
+ foreignKeyName: 'org_rol_definitions_organization_id_fkey';
2780
+ columns: ['organization_id'];
2834
2781
  isOneToOne: false;
2835
- referencedRelation: "organizations";
2836
- referencedColumns: ["id"];
2782
+ referencedRelation: 'organizations';
2783
+ referencedColumns: ['id'];
2837
2784
  }
2838
2785
  ];
2839
2786
  };
@@ -2855,18 +2802,18 @@ type Database = {
2855
2802
  };
2856
2803
  Relationships: [
2857
2804
  {
2858
- foreignKeyName: "org_rol_grants_permission_key_fkey";
2859
- columns: ["permission_key"];
2805
+ foreignKeyName: 'org_rol_grants_permission_key_fkey';
2806
+ columns: ['permission_key'];
2860
2807
  isOneToOne: false;
2861
- referencedRelation: "org_rol_permissions";
2862
- referencedColumns: ["key"];
2808
+ referencedRelation: 'org_rol_permissions';
2809
+ referencedColumns: ['key'];
2863
2810
  },
2864
2811
  {
2865
- foreignKeyName: "org_rol_grants_role_id_fkey";
2866
- columns: ["role_id"];
2812
+ foreignKeyName: 'org_rol_grants_role_id_fkey';
2813
+ columns: ['role_id'];
2867
2814
  isOneToOne: false;
2868
- referencedRelation: "org_rol_definitions";
2869
- referencedColumns: ["id"];
2815
+ referencedRelation: 'org_rol_definitions';
2816
+ referencedColumns: ['id'];
2870
2817
  }
2871
2818
  ];
2872
2819
  };
@@ -2978,25 +2925,25 @@ type Database = {
2978
2925
  };
2979
2926
  Relationships: [
2980
2927
  {
2981
- foreignKeyName: "fk_milestones_project";
2982
- columns: ["project_id"];
2928
+ foreignKeyName: 'fk_milestones_project';
2929
+ columns: ['project_id'];
2983
2930
  isOneToOne: false;
2984
- referencedRelation: "prj_projects";
2985
- referencedColumns: ["id"];
2931
+ referencedRelation: 'prj_projects';
2932
+ referencedColumns: ['id'];
2986
2933
  },
2987
2934
  {
2988
- foreignKeyName: "prj_milestones_organization_id_fkey";
2989
- columns: ["organization_id"];
2935
+ foreignKeyName: 'prj_milestones_organization_id_fkey';
2936
+ columns: ['organization_id'];
2990
2937
  isOneToOne: false;
2991
- referencedRelation: "organizations";
2992
- referencedColumns: ["id"];
2938
+ referencedRelation: 'organizations';
2939
+ referencedColumns: ['id'];
2993
2940
  },
2994
2941
  {
2995
- foreignKeyName: "prj_milestones_project_id_fkey";
2996
- columns: ["project_id"];
2942
+ foreignKeyName: 'prj_milestones_project_id_fkey';
2943
+ columns: ['project_id'];
2997
2944
  isOneToOne: false;
2998
- referencedRelation: "prj_projects";
2999
- referencedColumns: ["id"];
2945
+ referencedRelation: 'prj_projects';
2946
+ referencedColumns: ['id'];
3000
2947
  }
3001
2948
  ];
3002
2949
  };
@@ -3045,67 +2992,67 @@ type Database = {
3045
2992
  };
3046
2993
  Relationships: [
3047
2994
  {
3048
- foreignKeyName: "fk_notes_created_by";
3049
- columns: ["created_by"];
2995
+ foreignKeyName: 'fk_notes_created_by';
2996
+ columns: ['created_by'];
3050
2997
  isOneToOne: false;
3051
- referencedRelation: "users";
3052
- referencedColumns: ["id"];
2998
+ referencedRelation: 'users';
2999
+ referencedColumns: ['id'];
3053
3000
  },
3054
3001
  {
3055
- foreignKeyName: "fk_notes_milestone";
3056
- columns: ["milestone_id"];
3002
+ foreignKeyName: 'fk_notes_milestone';
3003
+ columns: ['milestone_id'];
3057
3004
  isOneToOne: false;
3058
- referencedRelation: "prj_milestones";
3059
- referencedColumns: ["id"];
3005
+ referencedRelation: 'prj_milestones';
3006
+ referencedColumns: ['id'];
3060
3007
  },
3061
3008
  {
3062
- foreignKeyName: "fk_notes_project";
3063
- columns: ["project_id"];
3009
+ foreignKeyName: 'fk_notes_project';
3010
+ columns: ['project_id'];
3064
3011
  isOneToOne: false;
3065
- referencedRelation: "prj_projects";
3066
- referencedColumns: ["id"];
3012
+ referencedRelation: 'prj_projects';
3013
+ referencedColumns: ['id'];
3067
3014
  },
3068
3015
  {
3069
- foreignKeyName: "fk_notes_task";
3070
- columns: ["task_id"];
3016
+ foreignKeyName: 'fk_notes_task';
3017
+ columns: ['task_id'];
3071
3018
  isOneToOne: false;
3072
- referencedRelation: "prj_tasks";
3073
- referencedColumns: ["id"];
3019
+ referencedRelation: 'prj_tasks';
3020
+ referencedColumns: ['id'];
3074
3021
  },
3075
3022
  {
3076
- foreignKeyName: "prj_notes_created_by_fkey";
3077
- columns: ["created_by"];
3023
+ foreignKeyName: 'prj_notes_created_by_fkey';
3024
+ columns: ['created_by'];
3078
3025
  isOneToOne: false;
3079
- referencedRelation: "users";
3080
- referencedColumns: ["id"];
3026
+ referencedRelation: 'users';
3027
+ referencedColumns: ['id'];
3081
3028
  },
3082
3029
  {
3083
- foreignKeyName: "prj_notes_milestone_id_fkey";
3084
- columns: ["milestone_id"];
3030
+ foreignKeyName: 'prj_notes_milestone_id_fkey';
3031
+ columns: ['milestone_id'];
3085
3032
  isOneToOne: false;
3086
- referencedRelation: "prj_milestones";
3087
- referencedColumns: ["id"];
3033
+ referencedRelation: 'prj_milestones';
3034
+ referencedColumns: ['id'];
3088
3035
  },
3089
3036
  {
3090
- foreignKeyName: "prj_notes_organization_id_fkey";
3091
- columns: ["organization_id"];
3037
+ foreignKeyName: 'prj_notes_organization_id_fkey';
3038
+ columns: ['organization_id'];
3092
3039
  isOneToOne: false;
3093
- referencedRelation: "organizations";
3094
- referencedColumns: ["id"];
3040
+ referencedRelation: 'organizations';
3041
+ referencedColumns: ['id'];
3095
3042
  },
3096
3043
  {
3097
- foreignKeyName: "prj_notes_project_id_fkey";
3098
- columns: ["project_id"];
3044
+ foreignKeyName: 'prj_notes_project_id_fkey';
3045
+ columns: ['project_id'];
3099
3046
  isOneToOne: false;
3100
- referencedRelation: "prj_projects";
3101
- referencedColumns: ["id"];
3047
+ referencedRelation: 'prj_projects';
3048
+ referencedColumns: ['id'];
3102
3049
  },
3103
3050
  {
3104
- foreignKeyName: "prj_notes_task_id_fkey";
3105
- columns: ["task_id"];
3051
+ foreignKeyName: 'prj_notes_task_id_fkey';
3052
+ columns: ['task_id'];
3106
3053
  isOneToOne: false;
3107
- referencedRelation: "prj_tasks";
3108
- referencedColumns: ["id"];
3054
+ referencedRelation: 'prj_tasks';
3055
+ referencedColumns: ['id'];
3109
3056
  }
3110
3057
  ];
3111
3058
  };
@@ -3163,39 +3110,39 @@ type Database = {
3163
3110
  };
3164
3111
  Relationships: [
3165
3112
  {
3166
- foreignKeyName: "fk_projects_company";
3167
- columns: ["client_company_id"];
3113
+ foreignKeyName: 'fk_projects_company';
3114
+ columns: ['client_company_id'];
3168
3115
  isOneToOne: false;
3169
- referencedRelation: "acq_companies";
3170
- referencedColumns: ["id"];
3116
+ referencedRelation: 'acq_companies';
3117
+ referencedColumns: ['id'];
3171
3118
  },
3172
3119
  {
3173
- foreignKeyName: "fk_projects_deal";
3174
- columns: ["deal_id"];
3120
+ foreignKeyName: 'fk_projects_deal';
3121
+ columns: ['deal_id'];
3175
3122
  isOneToOne: false;
3176
- referencedRelation: "acq_deals";
3177
- referencedColumns: ["id"];
3123
+ referencedRelation: 'acq_deals';
3124
+ referencedColumns: ['id'];
3178
3125
  },
3179
3126
  {
3180
- foreignKeyName: "prj_projects_client_company_id_fkey";
3181
- columns: ["client_company_id"];
3127
+ foreignKeyName: 'prj_projects_client_company_id_fkey';
3128
+ columns: ['client_company_id'];
3182
3129
  isOneToOne: false;
3183
- referencedRelation: "acq_companies";
3184
- referencedColumns: ["id"];
3130
+ referencedRelation: 'acq_companies';
3131
+ referencedColumns: ['id'];
3185
3132
  },
3186
3133
  {
3187
- foreignKeyName: "prj_projects_deal_id_fkey";
3188
- columns: ["deal_id"];
3134
+ foreignKeyName: 'prj_projects_deal_id_fkey';
3135
+ columns: ['deal_id'];
3189
3136
  isOneToOne: false;
3190
- referencedRelation: "acq_deals";
3191
- referencedColumns: ["id"];
3137
+ referencedRelation: 'acq_deals';
3138
+ referencedColumns: ['id'];
3192
3139
  },
3193
3140
  {
3194
- foreignKeyName: "prj_projects_organization_id_fkey";
3195
- columns: ["organization_id"];
3141
+ foreignKeyName: 'prj_projects_organization_id_fkey';
3142
+ columns: ['organization_id'];
3196
3143
  isOneToOne: false;
3197
- referencedRelation: "organizations";
3198
- referencedColumns: ["id"];
3144
+ referencedRelation: 'organizations';
3145
+ referencedColumns: ['id'];
3199
3146
  }
3200
3147
  ];
3201
3148
  };
@@ -3259,53 +3206,53 @@ type Database = {
3259
3206
  };
3260
3207
  Relationships: [
3261
3208
  {
3262
- foreignKeyName: "fk_tasks_milestone";
3263
- columns: ["milestone_id"];
3209
+ foreignKeyName: 'fk_tasks_milestone';
3210
+ columns: ['milestone_id'];
3264
3211
  isOneToOne: false;
3265
- referencedRelation: "prj_milestones";
3266
- referencedColumns: ["id"];
3212
+ referencedRelation: 'prj_milestones';
3213
+ referencedColumns: ['id'];
3267
3214
  },
3268
3215
  {
3269
- foreignKeyName: "fk_tasks_parent";
3270
- columns: ["parent_task_id"];
3216
+ foreignKeyName: 'fk_tasks_parent';
3217
+ columns: ['parent_task_id'];
3271
3218
  isOneToOne: false;
3272
- referencedRelation: "prj_tasks";
3273
- referencedColumns: ["id"];
3219
+ referencedRelation: 'prj_tasks';
3220
+ referencedColumns: ['id'];
3274
3221
  },
3275
3222
  {
3276
- foreignKeyName: "fk_tasks_project";
3277
- columns: ["project_id"];
3223
+ foreignKeyName: 'fk_tasks_project';
3224
+ columns: ['project_id'];
3278
3225
  isOneToOne: false;
3279
- referencedRelation: "prj_projects";
3280
- referencedColumns: ["id"];
3226
+ referencedRelation: 'prj_projects';
3227
+ referencedColumns: ['id'];
3281
3228
  },
3282
3229
  {
3283
- foreignKeyName: "prj_tasks_milestone_id_fkey";
3284
- columns: ["milestone_id"];
3230
+ foreignKeyName: 'prj_tasks_milestone_id_fkey';
3231
+ columns: ['milestone_id'];
3285
3232
  isOneToOne: false;
3286
- referencedRelation: "prj_milestones";
3287
- referencedColumns: ["id"];
3233
+ referencedRelation: 'prj_milestones';
3234
+ referencedColumns: ['id'];
3288
3235
  },
3289
3236
  {
3290
- foreignKeyName: "prj_tasks_organization_id_fkey";
3291
- columns: ["organization_id"];
3237
+ foreignKeyName: 'prj_tasks_organization_id_fkey';
3238
+ columns: ['organization_id'];
3292
3239
  isOneToOne: false;
3293
- referencedRelation: "organizations";
3294
- referencedColumns: ["id"];
3240
+ referencedRelation: 'organizations';
3241
+ referencedColumns: ['id'];
3295
3242
  },
3296
3243
  {
3297
- foreignKeyName: "prj_tasks_parent_task_id_fkey";
3298
- columns: ["parent_task_id"];
3244
+ foreignKeyName: 'prj_tasks_parent_task_id_fkey';
3245
+ columns: ['parent_task_id'];
3299
3246
  isOneToOne: false;
3300
- referencedRelation: "prj_tasks";
3301
- referencedColumns: ["id"];
3247
+ referencedRelation: 'prj_tasks';
3248
+ referencedColumns: ['id'];
3302
3249
  },
3303
3250
  {
3304
- foreignKeyName: "prj_tasks_project_id_fkey";
3305
- columns: ["project_id"];
3251
+ foreignKeyName: 'prj_tasks_project_id_fkey';
3252
+ columns: ['project_id'];
3306
3253
  isOneToOne: false;
3307
- referencedRelation: "prj_projects";
3308
- referencedColumns: ["id"];
3254
+ referencedRelation: 'prj_projects';
3255
+ referencedColumns: ['id'];
3309
3256
  }
3310
3257
  ];
3311
3258
  };
@@ -3375,25 +3322,25 @@ type Database = {
3375
3322
  };
3376
3323
  Relationships: [
3377
3324
  {
3378
- foreignKeyName: "reported_requests_organization_id_fkey";
3379
- columns: ["organization_id"];
3325
+ foreignKeyName: 'reported_requests_organization_id_fkey';
3326
+ columns: ['organization_id'];
3380
3327
  isOneToOne: false;
3381
- referencedRelation: "organizations";
3382
- referencedColumns: ["id"];
3328
+ referencedRelation: 'organizations';
3329
+ referencedColumns: ['id'];
3383
3330
  },
3384
3331
  {
3385
- foreignKeyName: "reported_requests_project_id_fkey";
3386
- columns: ["project_id"];
3332
+ foreignKeyName: 'reported_requests_project_id_fkey';
3333
+ columns: ['project_id'];
3387
3334
  isOneToOne: false;
3388
- referencedRelation: "prj_projects";
3389
- referencedColumns: ["id"];
3335
+ referencedRelation: 'prj_projects';
3336
+ referencedColumns: ['id'];
3390
3337
  },
3391
3338
  {
3392
- foreignKeyName: "reported_requests_task_id_fkey";
3393
- columns: ["task_id"];
3339
+ foreignKeyName: 'reported_requests_task_id_fkey';
3340
+ columns: ['task_id'];
3394
3341
  isOneToOne: false;
3395
- referencedRelation: "prj_tasks";
3396
- referencedColumns: ["id"];
3342
+ referencedRelation: 'prj_tasks';
3343
+ referencedColumns: ['id'];
3397
3344
  }
3398
3345
  ];
3399
3346
  };
@@ -3433,11 +3380,11 @@ type Database = {
3433
3380
  };
3434
3381
  Relationships: [
3435
3382
  {
3436
- foreignKeyName: "session_messages_session_id_fkey";
3437
- columns: ["session_id"];
3383
+ foreignKeyName: 'session_messages_session_id_fkey';
3384
+ columns: ['session_id'];
3438
3385
  isOneToOne: false;
3439
- referencedRelation: "sessions";
3440
- referencedColumns: ["session_id"];
3386
+ referencedRelation: 'sessions';
3387
+ referencedColumns: ['session_id'];
3441
3388
  }
3442
3389
  ];
3443
3390
  };
@@ -3492,18 +3439,18 @@ type Database = {
3492
3439
  };
3493
3440
  Relationships: [
3494
3441
  {
3495
- foreignKeyName: "fk_organization";
3496
- columns: ["organization_id"];
3442
+ foreignKeyName: 'fk_organization';
3443
+ columns: ['organization_id'];
3497
3444
  isOneToOne: false;
3498
- referencedRelation: "organizations";
3499
- referencedColumns: ["id"];
3445
+ referencedRelation: 'organizations';
3446
+ referencedColumns: ['id'];
3500
3447
  },
3501
3448
  {
3502
- foreignKeyName: "fk_user";
3503
- columns: ["user_id"];
3449
+ foreignKeyName: 'fk_user';
3450
+ columns: ['user_id'];
3504
3451
  isOneToOne: false;
3505
- referencedRelation: "users";
3506
- referencedColumns: ["id"];
3452
+ referencedRelation: 'users';
3453
+ referencedColumns: ['id'];
3507
3454
  }
3508
3455
  ];
3509
3456
  };
@@ -3579,11 +3526,11 @@ type Database = {
3579
3526
  };
3580
3527
  Relationships: [
3581
3528
  {
3582
- foreignKeyName: "task_schedules_organization_id_fkey";
3583
- columns: ["organization_id"];
3529
+ foreignKeyName: 'task_schedules_organization_id_fkey';
3530
+ columns: ['organization_id'];
3584
3531
  isOneToOne: false;
3585
- referencedRelation: "organizations";
3586
- referencedColumns: ["id"];
3532
+ referencedRelation: 'organizations';
3533
+ referencedColumns: ['id'];
3587
3534
  }
3588
3535
  ];
3589
3536
  };
@@ -3638,11 +3585,11 @@ type Database = {
3638
3585
  };
3639
3586
  Relationships: [
3640
3587
  {
3641
- foreignKeyName: "user_profiles_last_visited_org_fkey";
3642
- columns: ["last_visited_org"];
3588
+ foreignKeyName: 'user_profiles_last_visited_org_fkey';
3589
+ columns: ['last_visited_org'];
3643
3590
  isOneToOne: false;
3644
- referencedRelation: "organizations";
3645
- referencedColumns: ["id"];
3591
+ referencedRelation: 'organizations';
3592
+ referencedColumns: ['id'];
3646
3593
  }
3647
3594
  ];
3648
3595
  };
@@ -3691,11 +3638,11 @@ type Database = {
3691
3638
  };
3692
3639
  Relationships: [
3693
3640
  {
3694
- foreignKeyName: "webhook_endpoints_organization_id_fkey";
3695
- columns: ["organization_id"];
3641
+ foreignKeyName: 'webhook_endpoints_organization_id_fkey';
3642
+ columns: ['organization_id'];
3696
3643
  isOneToOne: false;
3697
- referencedRelation: "organizations";
3698
- referencedColumns: ["id"];
3644
+ referencedRelation: 'organizations';
3645
+ referencedColumns: ['id'];
3699
3646
  }
3700
3647
  ];
3701
3648
  };
@@ -3988,7 +3935,6 @@ interface AcqList {
3988
3935
  organizationId: string;
3989
3936
  name: string;
3990
3937
  description: string | null;
3991
- type: string;
3992
3938
  batchIds: string[];
3993
3939
  instantlyCampaignId: string | null;
3994
3940
  status: ListStatus;
@@ -4111,547 +4057,6 @@ interface AcqDealTask {
4111
4057
  createdByUserId: string | null;
4112
4058
  }
4113
4059
 
4114
- /**
4115
- * Lead Service Types
4116
- * CRUD operation types for the acquisition platform (lists, companies, contacts, deals)
4117
- *
4118
- * Implementation: apps/api/src/acquisition/lead-service.ts (LeadService class)
4119
- */
4120
-
4121
- interface PaginatedResult<T> {
4122
- data: T[];
4123
- total: number;
4124
- limit: number;
4125
- offset: number;
4126
- }
4127
- interface CreateListParams {
4128
- organizationId: string;
4129
- name: string;
4130
- description?: string;
4131
- type?: string;
4132
- batchIds?: string[];
4133
- instantlyCampaignId?: string;
4134
- status?: ListStatus;
4135
- metadata?: Record<string, unknown>;
4136
- scrapingConfig?: ScrapingConfig;
4137
- icp?: IcpRubric;
4138
- pipelineConfig?: PipelineConfig;
4139
- }
4140
- interface UpdateListParams {
4141
- name?: string;
4142
- description?: string;
4143
- batchIds?: string[];
4144
- }
4145
- interface CreateCompanyParams {
4146
- organizationId: string;
4147
- name: string;
4148
- domain?: string;
4149
- linkedinUrl?: string;
4150
- website?: string;
4151
- numEmployees?: number;
4152
- foundedYear?: number;
4153
- locationCity?: string;
4154
- locationState?: string;
4155
- category?: string;
4156
- source?: string;
4157
- batchId?: string;
4158
- verticalResearch?: string;
4159
- }
4160
- interface UpdateCompanyParams {
4161
- name?: string;
4162
- domain?: string;
4163
- linkedinUrl?: string;
4164
- website?: string;
4165
- numEmployees?: number;
4166
- foundedYear?: number;
4167
- locationCity?: string;
4168
- locationState?: string;
4169
- category?: string;
4170
- segment?: string;
4171
- pipelineStatus?: Record<string, unknown>;
4172
- enrichmentData?: Record<string, unknown>;
4173
- source?: string;
4174
- batchId?: string;
4175
- status?: 'active' | 'invalid';
4176
- verticalResearch?: string | null;
4177
- /** Track A: flat qualification score column (null until a scoring rubric is defined) */
4178
- qualificationScore?: number | null;
4179
- /** Track A: flat qualification signals jsonb — mirrors the former pipeline_status.qualification shape */
4180
- qualificationSignals?: Record<string, unknown> | null;
4181
- /** Track A: key identifying the rubric used for qualification */
4182
- qualificationRubricKey?: string | null;
4183
- }
4184
- type UpsertCompanyParams = CreateCompanyParams;
4185
- interface CompanyFilters {
4186
- listId?: string;
4187
- search?: string;
4188
- domain?: string;
4189
- website?: string;
4190
- segment?: string;
4191
- category?: string;
4192
- pipelineStatus?: Record<string, unknown>;
4193
- /** Exclude companies whose pipeline_status contains this value (PostgREST NOT contains) */
4194
- pipelineStatusNot?: Record<string, unknown>;
4195
- batchId?: string;
4196
- status?: 'active' | 'invalid';
4197
- includeAll?: boolean;
4198
- excludeColumns?: Array<'enrichmentData' | 'pipelineStatus'>;
4199
- }
4200
- interface CreateContactParams {
4201
- organizationId: string;
4202
- email: string;
4203
- companyId?: string;
4204
- firstName?: string;
4205
- lastName?: string;
4206
- linkedinUrl?: string;
4207
- title?: string;
4208
- source?: string;
4209
- sourceId?: string;
4210
- batchId?: string;
4211
- }
4212
- interface UpdateContactParams {
4213
- companyId?: string;
4214
- emailValid?: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN';
4215
- firstName?: string;
4216
- lastName?: string;
4217
- linkedinUrl?: string;
4218
- title?: string;
4219
- headline?: string;
4220
- filterReason?: string;
4221
- openingLine?: string;
4222
- pipelineStatus?: Record<string, unknown>;
4223
- enrichmentData?: Record<string, unknown>;
4224
- status?: 'active' | 'invalid';
4225
- }
4226
- type UpsertContactParams = CreateContactParams;
4227
- interface ContactFilters {
4228
- listId?: string;
4229
- search?: string;
4230
- openingLineIsNull?: boolean;
4231
- pipelineStatus?: Record<string, unknown>;
4232
- batchId?: string;
4233
- contactStatus?: 'active' | 'invalid';
4234
- }
4235
- interface UpsertDealParams {
4236
- organizationId: string;
4237
- /** Contact email — dedupe key together with organization_id */
4238
- contactEmail: string;
4239
- /** Optional contact ID for foreign key join */
4240
- contactId?: string;
4241
- /** Campaign list that generated this deal (FK to acq_lists) */
4242
- sourceListId?: string;
4243
- /** Deal origin: 'instantly', 'referral', 'inbound', 'manual' */
4244
- sourceType?: 'instantly' | 'referral' | 'inbound' | 'manual';
4245
- /** Optional discovery data JSONB to set on upsert */
4246
- discoveryData?: unknown;
4247
- /** Optional proposal data JSONB to set on upsert */
4248
- proposalData?: unknown;
4249
- }
4250
- interface UpdateDiscoveryDataParams {
4251
- organizationId: string;
4252
- contactEmail: string;
4253
- discoveryData: unknown;
4254
- submittedBy?: string;
4255
- }
4256
- interface UpdateProposalDataParams {
4257
- organizationId: string;
4258
- contactEmail: string;
4259
- proposalData: unknown;
4260
- proposalPdfUrl?: string;
4261
- }
4262
- interface MarkProposalSentParams {
4263
- organizationId: string;
4264
- contactEmail: string;
4265
- }
4266
- interface MarkProposalReviewedParams {
4267
- organizationId: string;
4268
- contactEmail: string;
4269
- reviewedBy: string;
4270
- proposalData?: unknown;
4271
- }
4272
- interface UpdateCloseLostReasonParams {
4273
- organizationId: string;
4274
- dealId: string;
4275
- reason: string;
4276
- }
4277
- interface UpdateFeesParams {
4278
- organizationId: string;
4279
- contactEmail?: string;
4280
- dealId?: string;
4281
- initialFee?: number;
4282
- monthlyFee?: number;
4283
- }
4284
- interface TransitionItemParams {
4285
- organizationId: string;
4286
- dealId: string;
4287
- pipelineKey: string;
4288
- stageKey: string;
4289
- stateKey?: string | null;
4290
- reason?: string;
4291
- expectedUpdatedAt?: string;
4292
- }
4293
- interface SetContactNurtureParams {
4294
- organizationId: string;
4295
- contactEmail: string;
4296
- nurture?: boolean;
4297
- }
4298
- interface CancelSchedulesAndHitlByEmailParams {
4299
- organizationId: string;
4300
- email: string;
4301
- }
4302
- interface CancelHitlByDealIdParams {
4303
- organizationId: string;
4304
- dealId: string;
4305
- }
4306
- interface ClearDealFieldsParams {
4307
- organizationId: string;
4308
- contactEmail?: string;
4309
- dealId?: string;
4310
- fields: ('proposalPdfUrl' | 'proposalGeneratedAt' | 'initialFee' | 'monthlyFee' | 'closedLostReason' | 'closedLostAt' | 'discoveryData' | 'discoverySubmittedAt')[];
4311
- }
4312
- interface DeleteDealParams {
4313
- organizationId: string;
4314
- dealId: string;
4315
- }
4316
- interface GetDealByIdParams {
4317
- dealId: string;
4318
- organizationId: string;
4319
- }
4320
- interface GetContactByIdParams {
4321
- contactId: string;
4322
- organizationId: string;
4323
- }
4324
- interface GetCompanyByIdParams {
4325
- companyId: string;
4326
- organizationId: string;
4327
- }
4328
- interface UpsertSocialPostParams {
4329
- organizationId: string;
4330
- platform: string;
4331
- platformPostId: string;
4332
- authorName: string;
4333
- authorUrl?: string | null;
4334
- postTitle: string;
4335
- postText: string;
4336
- postUrl: string;
4337
- engagementCount?: number;
4338
- commentsCount?: number;
4339
- postedAt: string;
4340
- metadata?: Record<string, unknown>;
4341
- relevanceScore?: number;
4342
- matchedKeywords?: string[];
4343
- matchedQuery?: string | null;
4344
- initialDraft?: string | null;
4345
- finalResponse?: string | null;
4346
- sourceCategory?: string | null;
4347
- }
4348
- interface UpsertSocialPostsResult {
4349
- inserted: number;
4350
- duplicatesSkipped: number;
4351
- }
4352
- interface AcqDeal {
4353
- id: string;
4354
- organizationId: string;
4355
- contactEmail: string;
4356
- pipelineKey: string;
4357
- stageKey?: string | null;
4358
- stateKey?: string | null;
4359
- discoveryData?: Json | null;
4360
- proposalData?: Json | null;
4361
- proposalSentAt?: string | null;
4362
- proposalPdfUrl?: string | null;
4363
- signatureEnvelopeId?: string | null;
4364
- sourceListId?: string | null;
4365
- sourceType?: string | null;
4366
- activityLog: DealActivityEntry[];
4367
- createdAt: Date;
4368
- updatedAt: Date;
4369
- }
4370
- interface DealActivityEntry {
4371
- type: string;
4372
- title: string;
4373
- description?: string;
4374
- payload?: Record<string, unknown>;
4375
- occurredAt: string;
4376
- }
4377
- interface AcqDealNote {
4378
- id: string;
4379
- dealId: string;
4380
- organizationId: string;
4381
- authorUserId: string | null;
4382
- body: string;
4383
- createdAt: string;
4384
- updatedAt: string;
4385
- }
4386
- interface CreateDealNoteParams {
4387
- organizationId: string;
4388
- dealId: string;
4389
- body: string;
4390
- authorUserId?: string;
4391
- }
4392
- interface ListDealNotesParams {
4393
- organizationId: string;
4394
- dealId: string;
4395
- }
4396
- interface CreateDealTaskParams {
4397
- organizationId: string;
4398
- dealId: string;
4399
- title: string;
4400
- description?: string | null;
4401
- kind?: AcqDealTaskKind;
4402
- dueAt?: string | null;
4403
- assigneeUserId?: string | null;
4404
- createdByUserId?: string | null;
4405
- }
4406
- interface ListDealTasksParams {
4407
- organizationId: string;
4408
- dealId: string;
4409
- }
4410
- interface ListDealTasksDueParams {
4411
- organizationId: string;
4412
- assigneeUserId?: string | null;
4413
- /** Window filter: 'overdue' = past due, 'today' = due today only, 'today_and_overdue' (default) = both, 'upcoming' = future */
4414
- window?: 'overdue' | 'today' | 'today_and_overdue' | 'upcoming';
4415
- }
4416
- interface CompleteDealTaskParams {
4417
- organizationId: string;
4418
- taskId: string;
4419
- completedByUserId: string | null;
4420
- }
4421
- interface RecordDealActivityParams {
4422
- organizationId: string;
4423
- dealId: string;
4424
- type: string;
4425
- title: string;
4426
- description?: string;
4427
- payload?: Record<string, unknown>;
4428
- }
4429
- interface DealStageSummary {
4430
- stage: string;
4431
- count: number;
4432
- oldestUpdatedAt: string | null;
4433
- newestUpdatedAt: string | null;
4434
- }
4435
- interface StaleDeal {
4436
- id: string;
4437
- contactEmail: string;
4438
- stageKey: string;
4439
- updatedAt: string;
4440
- daysStale: number;
4441
- }
4442
- interface DealPipelineAnalytics {
4443
- totalDeals: number;
4444
- stageSummary: DealStageSummary[];
4445
- staleDeals: StaleDeal[];
4446
- recentActivity: AcqDeal[];
4447
- }
4448
- interface DealFilters {
4449
- stage?: string;
4450
- search?: string;
4451
- limit?: number;
4452
- offset?: number;
4453
- }
4454
- interface AddContactsToListParams {
4455
- organizationId: string;
4456
- listId: string;
4457
- contactIds: string[];
4458
- }
4459
- interface AddContactsToListResult {
4460
- added: number;
4461
- alreadyExisted: number;
4462
- }
4463
- interface UpdateCompanyStageParams {
4464
- organizationId: string;
4465
- listId: string;
4466
- companyId: string;
4467
- stage: string;
4468
- executionId?: string;
4469
- }
4470
- interface UpdateContactStageParams {
4471
- organizationId: string;
4472
- listId: string;
4473
- contactId: string;
4474
- stage: string;
4475
- executionId?: string;
4476
- }
4477
- interface RecordListExecutionParams {
4478
- organizationId: string;
4479
- listId: string;
4480
- executionId: string;
4481
- configSnapshot?: Record<string, unknown>;
4482
- }
4483
- interface BulkImportParams {
4484
- organizationId: string;
4485
- contacts: CreateContactParams[];
4486
- listId?: string;
4487
- }
4488
- interface BulkImportResult {
4489
- created: number;
4490
- updated: number;
4491
- errors: Array<{
4492
- email: string;
4493
- error: string;
4494
- }>;
4495
- }
4496
- interface BulkImportCompanyEntry {
4497
- name: string;
4498
- domain: string;
4499
- website?: string;
4500
- locationCity?: string;
4501
- locationState?: string;
4502
- category?: string;
4503
- source?: string;
4504
- enrichmentData?: Record<string, unknown>;
4505
- pipelineStatus?: Record<string, unknown>;
4506
- }
4507
- interface BulkImportCompaniesParams {
4508
- organizationId: string;
4509
- batchId: string;
4510
- companies: BulkImportCompanyEntry[];
4511
- }
4512
- interface BulkImportCompaniesResult {
4513
- created: number;
4514
- skipped: number;
4515
- errors: Array<{
4516
- companyName: string;
4517
- error: string;
4518
- }>;
4519
- }
4520
-
4521
- /**
4522
- * Origin resource type - where an execution/task originated from.
4523
- * Used for audit trails and tracking execution lineage.
4524
- */
4525
- type OriginResourceType = 'agent' | 'workflow' | 'scheduler' | 'api';
4526
-
4527
- /**
4528
- * Target for schedule execution - identifies what resource to execute.
4529
- * Unlike ExecutionTarget, payload is NOT included here because schedules
4530
- * store payload in the scheduleConfig (varies per step/item).
4531
- */
4532
- interface ScheduleTarget {
4533
- resourceType: 'agent' | 'workflow';
4534
- resourceId: string;
4535
- }
4536
- /**
4537
- * Optional origin tracking for schedules.
4538
- * Unlike OriginTracking (which is required), these fields are all optional
4539
- * for schedules created directly via API (not triggered by another resource).
4540
- */
4541
- interface ScheduleOriginTracking {
4542
- originExecutionId?: string;
4543
- originResourceType?: OriginResourceType;
4544
- originResourceId?: string;
4545
- }
4546
- type TaskScheduleConfig = RecurringScheduleConfig | RelativeScheduleConfig | AbsoluteScheduleConfig;
4547
- interface RecurringScheduleConfig {
4548
- type: 'recurring';
4549
- cron?: string;
4550
- interval?: 'daily' | 'weekly' | 'monthly';
4551
- time?: string;
4552
- timezone: string;
4553
- payload: Record<string, unknown>;
4554
- endAt?: string | null;
4555
- overduePolicy?: 'skip' | 'execute';
4556
- }
4557
- interface RelativeScheduleConfig {
4558
- type: 'relative';
4559
- anchorAt: string;
4560
- anchorLabel?: string;
4561
- items: RelativeScheduleItem[];
4562
- overduePolicy?: 'skip' | 'execute';
4563
- }
4564
- interface RelativeScheduleItem {
4565
- offset: string;
4566
- payload: Record<string, unknown>;
4567
- label?: string;
4568
- }
4569
- interface AbsoluteScheduleConfig {
4570
- type: 'absolute';
4571
- items: AbsoluteScheduleItem[];
4572
- overduePolicy?: 'skip' | 'execute';
4573
- }
4574
- interface AbsoluteScheduleItem {
4575
- runAt: string;
4576
- payload: Record<string, unknown>;
4577
- label?: string;
4578
- }
4579
- interface TaskSchedule extends ScheduleOriginTracking {
4580
- id: string;
4581
- organizationId: string;
4582
- name: string;
4583
- description?: string;
4584
- target: ScheduleTarget;
4585
- scheduleConfig: TaskScheduleConfig;
4586
- nextRunAt?: Date;
4587
- currentStep: number;
4588
- status: 'active' | 'paused' | 'completed' | 'cancelled';
4589
- lastRunAt?: Date;
4590
- lastExecutionId?: string;
4591
- maxRetries: number;
4592
- idempotencyKey?: string;
4593
- createdAt: Date;
4594
- updatedAt: Date;
4595
- }
4596
- interface CreateScheduleInput extends ScheduleOriginTracking {
4597
- organizationId: string;
4598
- name: string;
4599
- description?: string;
4600
- target: ScheduleTarget;
4601
- scheduleConfig: TaskScheduleConfig;
4602
- maxRetries?: number;
4603
- idempotencyKey?: string;
4604
- metadata?: Record<string, unknown>;
4605
- }
4606
-
4607
- type NotificationRow = Database['public']['Tables']['notifications']['Row'];
4608
- interface CreateNotificationParams {
4609
- userId: string;
4610
- organizationId: string;
4611
- category: NotificationRow['category'];
4612
- title: string;
4613
- message: string;
4614
- actionUrl?: string;
4615
- }
4616
-
4617
- type ProjectRow = Database['public']['Tables']['prj_projects']['Row'];
4618
- type MilestoneRow = Database['public']['Tables']['prj_milestones']['Row'];
4619
- type TaskRow = Database['public']['Tables']['prj_tasks']['Row'];
4620
- type NoteRow = Database['public']['Tables']['prj_notes']['Row'];
4621
- interface ProjectWithCounts extends ProjectRow {
4622
- milestoneCount: number;
4623
- taskCount: number;
4624
- completedMilestones?: number;
4625
- completedTasks?: number;
4626
- }
4627
- interface ProjectDetail extends ProjectRow {
4628
- milestones: MilestoneRow[];
4629
- tasks: TaskRow[];
4630
- company: {
4631
- id: string;
4632
- name: string;
4633
- domain: string | null;
4634
- } | null;
4635
- }
4636
-
4637
- /**
4638
- * Canonical vocabulary for `acq_touchpoints.kind`.
4639
- * DB CHECK constraint was dropped (Decision #9); validation lives here.
4640
- * Subtype/intent detail (e.g. triggered_by_action, subtype) goes in the touchpoint `payload` JSONB.
4641
- */
4642
-
4643
- declare const TouchpointKindSchema: z.ZodEnum<{
4644
- initial: "initial";
4645
- followup: "followup";
4646
- reply: "reply";
4647
- nudge: "nudge";
4648
- reminder: "reminder";
4649
- breakup: "breakup";
4650
- bounce: "bounce";
4651
- auto_reply: "auto_reply";
4652
- }>;
4653
- type TouchpointKind = z.infer<typeof TouchpointKindSchema>;
4654
-
4655
4060
  declare const DealSchemas: {
4656
4061
  DealIdParams: z.ZodObject<{
4657
4062
  dealId: z.ZodString;
@@ -4904,6 +4309,538 @@ declare const DealSchemas: {
4904
4309
  }, z.core.$strip>>;
4905
4310
  };
4906
4311
 
4312
+ /**
4313
+ * Lead Service Types
4314
+ * CRUD operation types for the acquisition platform (lists, companies, contacts, deals)
4315
+ *
4316
+ * Implementation: apps/api/src/acquisition/lead-service.ts (LeadService class)
4317
+ */
4318
+
4319
+ interface PaginatedResult<T> {
4320
+ data: T[];
4321
+ total: number;
4322
+ limit: number;
4323
+ offset: number;
4324
+ }
4325
+ interface CreateListParams {
4326
+ organizationId: string;
4327
+ name: string;
4328
+ description?: string;
4329
+ type?: string;
4330
+ batchIds?: string[];
4331
+ instantlyCampaignId?: string;
4332
+ status?: ListStatus;
4333
+ metadata?: Record<string, unknown>;
4334
+ scrapingConfig?: ScrapingConfig;
4335
+ icp?: IcpRubric;
4336
+ pipelineConfig?: PipelineConfig;
4337
+ }
4338
+ interface UpdateListParams {
4339
+ name?: string;
4340
+ description?: string;
4341
+ batchIds?: string[];
4342
+ }
4343
+ interface CreateCompanyParams {
4344
+ organizationId: string;
4345
+ name: string;
4346
+ domain?: string;
4347
+ linkedinUrl?: string;
4348
+ website?: string;
4349
+ numEmployees?: number;
4350
+ foundedYear?: number;
4351
+ locationCity?: string;
4352
+ locationState?: string;
4353
+ category?: string;
4354
+ source?: string;
4355
+ batchId?: string;
4356
+ verticalResearch?: string;
4357
+ }
4358
+ interface UpdateCompanyParams {
4359
+ name?: string;
4360
+ domain?: string;
4361
+ linkedinUrl?: string;
4362
+ website?: string;
4363
+ numEmployees?: number;
4364
+ foundedYear?: number;
4365
+ locationCity?: string;
4366
+ locationState?: string;
4367
+ category?: string;
4368
+ segment?: string;
4369
+ pipelineStatus?: Record<string, unknown>;
4370
+ enrichmentData?: Record<string, unknown>;
4371
+ source?: string;
4372
+ batchId?: string;
4373
+ status?: 'active' | 'invalid';
4374
+ verticalResearch?: string | null;
4375
+ /** Track A: flat qualification score column (null until a scoring rubric is defined) */
4376
+ qualificationScore?: number | null;
4377
+ /** Track A: flat qualification signals jsonb — mirrors the former pipeline_status.qualification shape */
4378
+ qualificationSignals?: Record<string, unknown> | null;
4379
+ /** Track A: key identifying the rubric used for qualification */
4380
+ qualificationRubricKey?: string | null;
4381
+ }
4382
+ type UpsertCompanyParams = CreateCompanyParams;
4383
+ interface CompanyFilters {
4384
+ listId?: string;
4385
+ search?: string;
4386
+ domain?: string;
4387
+ website?: string;
4388
+ segment?: string;
4389
+ category?: string;
4390
+ pipelineStatus?: Record<string, unknown>;
4391
+ /** Exclude companies whose pipeline_status contains this value (PostgREST NOT contains) */
4392
+ pipelineStatusNot?: Record<string, unknown>;
4393
+ batchId?: string;
4394
+ status?: 'active' | 'invalid';
4395
+ includeAll?: boolean;
4396
+ excludeColumns?: Array<'enrichmentData' | 'pipelineStatus'>;
4397
+ }
4398
+ interface CreateContactParams {
4399
+ organizationId: string;
4400
+ email: string;
4401
+ companyId?: string;
4402
+ firstName?: string;
4403
+ lastName?: string;
4404
+ linkedinUrl?: string;
4405
+ title?: string;
4406
+ source?: string;
4407
+ sourceId?: string;
4408
+ batchId?: string;
4409
+ }
4410
+ interface UpdateContactParams {
4411
+ companyId?: string;
4412
+ emailValid?: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN';
4413
+ firstName?: string;
4414
+ lastName?: string;
4415
+ linkedinUrl?: string;
4416
+ title?: string;
4417
+ headline?: string;
4418
+ filterReason?: string;
4419
+ openingLine?: string;
4420
+ pipelineStatus?: Record<string, unknown>;
4421
+ enrichmentData?: Record<string, unknown>;
4422
+ status?: 'active' | 'invalid';
4423
+ }
4424
+ type UpsertContactParams = CreateContactParams;
4425
+ interface ContactFilters {
4426
+ listId?: string;
4427
+ search?: string;
4428
+ openingLineIsNull?: boolean;
4429
+ pipelineStatus?: Record<string, unknown>;
4430
+ batchId?: string;
4431
+ contactStatus?: 'active' | 'invalid';
4432
+ }
4433
+ interface UpsertDealParams {
4434
+ organizationId: string;
4435
+ /** Contact email — dedupe key together with organization_id */
4436
+ contactEmail: string;
4437
+ /** Optional contact ID for foreign key join */
4438
+ contactId?: string;
4439
+ /** Campaign list that generated this deal (FK to acq_lists) */
4440
+ sourceListId?: string;
4441
+ /** Deal origin: 'instantly', 'referral', 'inbound', 'manual' */
4442
+ sourceType?: 'instantly' | 'referral' | 'inbound' | 'manual';
4443
+ /** Optional discovery data JSONB to set on upsert */
4444
+ discoveryData?: unknown;
4445
+ /** Optional proposal data JSONB to set on upsert */
4446
+ proposalData?: unknown;
4447
+ }
4448
+ interface UpdateDiscoveryDataParams {
4449
+ organizationId: string;
4450
+ contactEmail: string;
4451
+ discoveryData: unknown;
4452
+ submittedBy?: string;
4453
+ }
4454
+ interface UpdateProposalDataParams {
4455
+ organizationId: string;
4456
+ contactEmail: string;
4457
+ proposalData: unknown;
4458
+ proposalPdfUrl?: string;
4459
+ }
4460
+ interface MarkProposalSentParams {
4461
+ organizationId: string;
4462
+ contactEmail: string;
4463
+ }
4464
+ interface MarkProposalReviewedParams {
4465
+ organizationId: string;
4466
+ contactEmail: string;
4467
+ reviewedBy: string;
4468
+ proposalData?: unknown;
4469
+ }
4470
+ interface UpdateCloseLostReasonParams {
4471
+ organizationId: string;
4472
+ dealId: string;
4473
+ reason: string;
4474
+ }
4475
+ interface UpdateFeesParams {
4476
+ organizationId: string;
4477
+ contactEmail?: string;
4478
+ dealId?: string;
4479
+ initialFee?: number;
4480
+ monthlyFee?: number;
4481
+ }
4482
+ interface TransitionItemParams {
4483
+ organizationId: string;
4484
+ dealId: string;
4485
+ pipelineKey: string;
4486
+ stageKey: string;
4487
+ stateKey?: string | null;
4488
+ reason?: string;
4489
+ expectedUpdatedAt?: string;
4490
+ }
4491
+ interface SetContactNurtureParams {
4492
+ organizationId: string;
4493
+ contactEmail: string;
4494
+ nurture?: boolean;
4495
+ }
4496
+ interface CancelSchedulesAndHitlByEmailParams {
4497
+ organizationId: string;
4498
+ email: string;
4499
+ }
4500
+ interface CancelHitlByDealIdParams {
4501
+ organizationId: string;
4502
+ dealId: string;
4503
+ }
4504
+ interface ClearDealFieldsParams {
4505
+ organizationId: string;
4506
+ contactEmail?: string;
4507
+ dealId?: string;
4508
+ fields: ('proposalPdfUrl' | 'proposalGeneratedAt' | 'initialFee' | 'monthlyFee' | 'closedLostReason' | 'closedLostAt' | 'discoveryData' | 'discoverySubmittedAt')[];
4509
+ }
4510
+ interface DeleteDealParams {
4511
+ organizationId: string;
4512
+ dealId: string;
4513
+ }
4514
+ interface GetDealByIdParams {
4515
+ dealId: string;
4516
+ organizationId: string;
4517
+ }
4518
+ interface GetContactByIdParams {
4519
+ contactId: string;
4520
+ organizationId: string;
4521
+ }
4522
+ interface GetCompanyByIdParams {
4523
+ companyId: string;
4524
+ organizationId: string;
4525
+ }
4526
+ interface UpsertSocialPostParams {
4527
+ organizationId: string;
4528
+ platform: string;
4529
+ platformPostId: string;
4530
+ authorName: string;
4531
+ authorUrl?: string | null;
4532
+ postTitle: string;
4533
+ postText: string;
4534
+ postUrl: string;
4535
+ engagementCount?: number;
4536
+ commentsCount?: number;
4537
+ postedAt: string;
4538
+ metadata?: Record<string, unknown>;
4539
+ relevanceScore?: number;
4540
+ matchedKeywords?: string[];
4541
+ matchedQuery?: string | null;
4542
+ initialDraft?: string | null;
4543
+ finalResponse?: string | null;
4544
+ sourceCategory?: string | null;
4545
+ }
4546
+ interface UpsertSocialPostsResult {
4547
+ inserted: number;
4548
+ duplicatesSkipped: number;
4549
+ }
4550
+ interface AcqDeal {
4551
+ id: string;
4552
+ organizationId: string;
4553
+ contactEmail: string;
4554
+ pipelineKey: string;
4555
+ stageKey?: string | null;
4556
+ stateKey?: string | null;
4557
+ discoveryData?: Json | null;
4558
+ proposalData?: Json | null;
4559
+ proposalSentAt?: string | null;
4560
+ proposalPdfUrl?: string | null;
4561
+ signatureEnvelopeId?: string | null;
4562
+ sourceListId?: string | null;
4563
+ sourceType?: string | null;
4564
+ activityLog: DealActivityEntry[];
4565
+ createdAt: Date;
4566
+ updatedAt: Date;
4567
+ }
4568
+ interface DealActivityEntry {
4569
+ type: string;
4570
+ title: string;
4571
+ description?: string;
4572
+ payload?: Record<string, unknown>;
4573
+ occurredAt: string;
4574
+ }
4575
+ interface AcqDealNote {
4576
+ id: string;
4577
+ dealId: string;
4578
+ organizationId: string;
4579
+ authorUserId: string | null;
4580
+ body: string;
4581
+ createdAt: string;
4582
+ updatedAt: string;
4583
+ }
4584
+ interface CreateDealNoteParams {
4585
+ organizationId: string;
4586
+ dealId: string;
4587
+ body: string;
4588
+ authorUserId?: string;
4589
+ }
4590
+ interface ListDealNotesParams {
4591
+ organizationId: string;
4592
+ dealId: string;
4593
+ }
4594
+ interface CreateDealTaskParams {
4595
+ organizationId: string;
4596
+ dealId: string;
4597
+ title: string;
4598
+ description?: string | null;
4599
+ kind?: AcqDealTaskKind;
4600
+ dueAt?: string | null;
4601
+ assigneeUserId?: string | null;
4602
+ createdByUserId?: string | null;
4603
+ }
4604
+ interface ListDealTasksParams {
4605
+ organizationId: string;
4606
+ dealId: string;
4607
+ }
4608
+ interface ListDealTasksDueParams {
4609
+ organizationId: string;
4610
+ assigneeUserId?: string | null;
4611
+ /** Window filter: 'overdue' = past due, 'today' = due today only, 'today_and_overdue' (default) = both, 'upcoming' = future */
4612
+ window?: 'overdue' | 'today' | 'today_and_overdue' | 'upcoming';
4613
+ }
4614
+ interface CompleteDealTaskParams {
4615
+ organizationId: string;
4616
+ taskId: string;
4617
+ completedByUserId: string | null;
4618
+ }
4619
+ interface RecordDealActivityParams {
4620
+ organizationId: string;
4621
+ dealId: string;
4622
+ type: string;
4623
+ title: string;
4624
+ description?: string;
4625
+ payload?: Record<string, unknown>;
4626
+ }
4627
+ interface DealStageSummary {
4628
+ stage: string;
4629
+ count: number;
4630
+ oldestUpdatedAt: string | null;
4631
+ newestUpdatedAt: string | null;
4632
+ }
4633
+ interface StaleDeal {
4634
+ id: string;
4635
+ contactEmail: string;
4636
+ stageKey: string;
4637
+ updatedAt: string;
4638
+ daysStale: number;
4639
+ }
4640
+ interface DealPipelineAnalytics {
4641
+ totalDeals: number;
4642
+ stageSummary: DealStageSummary[];
4643
+ staleDeals: StaleDeal[];
4644
+ recentActivity: AcqDeal[];
4645
+ }
4646
+ interface DealFilters {
4647
+ stage?: string;
4648
+ search?: string;
4649
+ limit?: number;
4650
+ offset?: number;
4651
+ }
4652
+ interface AddContactsToListParams {
4653
+ organizationId: string;
4654
+ listId: string;
4655
+ contactIds: string[];
4656
+ }
4657
+ interface AddContactsToListResult {
4658
+ added: number;
4659
+ alreadyExisted: number;
4660
+ }
4661
+ interface UpdateCompanyStageParams {
4662
+ organizationId: string;
4663
+ listId: string;
4664
+ companyId: string;
4665
+ stage: string;
4666
+ executionId?: string;
4667
+ }
4668
+ interface UpdateContactStageParams {
4669
+ organizationId: string;
4670
+ listId: string;
4671
+ contactId: string;
4672
+ stage: string;
4673
+ executionId?: string;
4674
+ }
4675
+ interface AddCompaniesToListParams {
4676
+ organizationId: string;
4677
+ listId: string;
4678
+ companyIds: string[];
4679
+ }
4680
+ interface AddCompaniesToListResult {
4681
+ added: number;
4682
+ alreadyExisted: number;
4683
+ }
4684
+ interface RecordListExecutionParams {
4685
+ organizationId: string;
4686
+ listId: string;
4687
+ executionId: string;
4688
+ configSnapshot?: Record<string, unknown>;
4689
+ }
4690
+ interface BulkImportParams {
4691
+ organizationId: string;
4692
+ contacts: CreateContactParams[];
4693
+ listId?: string;
4694
+ }
4695
+ interface BulkImportResult {
4696
+ created: number;
4697
+ updated: number;
4698
+ errors: Array<{
4699
+ email: string;
4700
+ error: string;
4701
+ }>;
4702
+ }
4703
+ interface BulkImportCompanyEntry {
4704
+ name: string;
4705
+ domain: string;
4706
+ website?: string;
4707
+ locationCity?: string;
4708
+ locationState?: string;
4709
+ category?: string;
4710
+ source?: string;
4711
+ enrichmentData?: Record<string, unknown>;
4712
+ pipelineStatus?: Record<string, unknown>;
4713
+ }
4714
+ interface BulkImportCompaniesParams {
4715
+ organizationId: string;
4716
+ batchId: string;
4717
+ companies: BulkImportCompanyEntry[];
4718
+ }
4719
+ interface BulkImportCompaniesResult {
4720
+ created: number;
4721
+ skipped: number;
4722
+ errors: Array<{
4723
+ companyName: string;
4724
+ error: string;
4725
+ }>;
4726
+ }
4727
+
4728
+ /**
4729
+ * Origin resource type - where an execution/task originated from.
4730
+ * Used for audit trails and tracking execution lineage.
4731
+ */
4732
+ type OriginResourceType = 'agent' | 'workflow' | 'scheduler' | 'api';
4733
+
4734
+ /**
4735
+ * Target for schedule execution - identifies what resource to execute.
4736
+ * Unlike ExecutionTarget, payload is NOT included here because schedules
4737
+ * store payload in the scheduleConfig (varies per step/item).
4738
+ */
4739
+ interface ScheduleTarget {
4740
+ resourceType: 'agent' | 'workflow';
4741
+ resourceId: string;
4742
+ }
4743
+ /**
4744
+ * Optional origin tracking for schedules.
4745
+ * Unlike OriginTracking (which is required), these fields are all optional
4746
+ * for schedules created directly via API (not triggered by another resource).
4747
+ */
4748
+ interface ScheduleOriginTracking {
4749
+ originExecutionId?: string;
4750
+ originResourceType?: OriginResourceType;
4751
+ originResourceId?: string;
4752
+ }
4753
+ type TaskScheduleConfig = RecurringScheduleConfig | RelativeScheduleConfig | AbsoluteScheduleConfig;
4754
+ interface RecurringScheduleConfig {
4755
+ type: 'recurring';
4756
+ cron?: string;
4757
+ interval?: 'daily' | 'weekly' | 'monthly';
4758
+ time?: string;
4759
+ timezone: string;
4760
+ payload: Record<string, unknown>;
4761
+ endAt?: string | null;
4762
+ overduePolicy?: 'skip' | 'execute';
4763
+ }
4764
+ interface RelativeScheduleConfig {
4765
+ type: 'relative';
4766
+ anchorAt: string;
4767
+ anchorLabel?: string;
4768
+ items: RelativeScheduleItem[];
4769
+ overduePolicy?: 'skip' | 'execute';
4770
+ }
4771
+ interface RelativeScheduleItem {
4772
+ offset: string;
4773
+ payload: Record<string, unknown>;
4774
+ label?: string;
4775
+ }
4776
+ interface AbsoluteScheduleConfig {
4777
+ type: 'absolute';
4778
+ items: AbsoluteScheduleItem[];
4779
+ overduePolicy?: 'skip' | 'execute';
4780
+ }
4781
+ interface AbsoluteScheduleItem {
4782
+ runAt: string;
4783
+ payload: Record<string, unknown>;
4784
+ label?: string;
4785
+ }
4786
+ interface TaskSchedule extends ScheduleOriginTracking {
4787
+ id: string;
4788
+ organizationId: string;
4789
+ name: string;
4790
+ description?: string;
4791
+ target: ScheduleTarget;
4792
+ scheduleConfig: TaskScheduleConfig;
4793
+ nextRunAt?: Date;
4794
+ currentStep: number;
4795
+ status: 'active' | 'paused' | 'completed' | 'cancelled';
4796
+ lastRunAt?: Date;
4797
+ lastExecutionId?: string;
4798
+ maxRetries: number;
4799
+ idempotencyKey?: string;
4800
+ createdAt: Date;
4801
+ updatedAt: Date;
4802
+ }
4803
+ interface CreateScheduleInput extends ScheduleOriginTracking {
4804
+ organizationId: string;
4805
+ name: string;
4806
+ description?: string;
4807
+ target: ScheduleTarget;
4808
+ scheduleConfig: TaskScheduleConfig;
4809
+ maxRetries?: number;
4810
+ idempotencyKey?: string;
4811
+ metadata?: Record<string, unknown>;
4812
+ }
4813
+
4814
+ type NotificationRow = Database['public']['Tables']['notifications']['Row'];
4815
+ interface CreateNotificationParams {
4816
+ userId: string;
4817
+ organizationId: string;
4818
+ category: NotificationRow['category'];
4819
+ title: string;
4820
+ message: string;
4821
+ actionUrl?: string;
4822
+ }
4823
+
4824
+ type ProjectRow = Database['public']['Tables']['prj_projects']['Row'];
4825
+ type MilestoneRow = Database['public']['Tables']['prj_milestones']['Row'];
4826
+ type TaskRow = Database['public']['Tables']['prj_tasks']['Row'];
4827
+ type NoteRow = Database['public']['Tables']['prj_notes']['Row'];
4828
+ interface ProjectWithCounts extends ProjectRow {
4829
+ milestoneCount: number;
4830
+ taskCount: number;
4831
+ completedMilestones?: number;
4832
+ completedTasks?: number;
4833
+ }
4834
+ interface ProjectDetail extends ProjectRow {
4835
+ milestones: MilestoneRow[];
4836
+ tasks: TaskRow[];
4837
+ company: {
4838
+ id: string;
4839
+ name: string;
4840
+ domain: string | null;
4841
+ } | null;
4842
+ }
4843
+
4907
4844
  /**
4908
4845
  * A single CRM activity entry (note, stage change, or deal creation).
4909
4846
  * Matches the CrmActivityEntry interface from useRecentCrmActivity.ts.
@@ -7448,6 +7385,10 @@ type LeadToolMap = {
7448
7385
  params: Omit<AddContactsToListParams, 'organizationId'>;
7449
7386
  result: AddContactsToListResult;
7450
7387
  };
7388
+ addCompaniesToList: {
7389
+ params: Omit<AddCompaniesToListParams, 'organizationId'>;
7390
+ result: AddCompaniesToListResult;
7391
+ };
7451
7392
  updateCompanyStage: {
7452
7393
  params: Omit<UpdateCompanyStageParams, 'organizationId'>;
7453
7394
  result: void;
@@ -7681,23 +7622,6 @@ type LeadToolMap = {
7681
7622
  };
7682
7623
  result: UpsertSocialPostsResult;
7683
7624
  };
7684
- recordTouchpoint: {
7685
- params: {
7686
- contactId?: string;
7687
- listMemberId?: string;
7688
- listId?: string;
7689
- direction: 'inbound' | 'outbound';
7690
- channel: string;
7691
- kind: TouchpointKind;
7692
- payload?: Record<string, unknown>;
7693
- artifactId?: string;
7694
- sourceExecutionId?: string;
7695
- occurredAt?: string;
7696
- };
7697
- result: {
7698
- id: string;
7699
- };
7700
- };
7701
7625
  setDealStateKey: {
7702
7626
  params: {
7703
7627
  dealId: string;
@@ -7723,28 +7647,6 @@ type LeadToolMap = {
7723
7647
  };
7724
7648
  result: DealDetail | null;
7725
7649
  };
7726
- listDealTouchpoints: {
7727
- params: {
7728
- dealId: string;
7729
- kind?: string;
7730
- limit?: number;
7731
- };
7732
- result: Array<{
7733
- id: string;
7734
- organization_id: string;
7735
- contact_id: string | null;
7736
- list_id: string | null;
7737
- list_member_id: string | null;
7738
- direction: string;
7739
- channel: string;
7740
- kind: string;
7741
- payload: Record<string, unknown> | null;
7742
- artifact_id: string | null;
7743
- source_execution_id: string | null;
7744
- occurred_at: string;
7745
- created_at: string;
7746
- }>;
7747
- };
7748
7650
  };
7749
7651
  type ListToolMap = {
7750
7652
  getConfig: {