@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.
package/dist/index.d.ts CHANGED
@@ -1114,7 +1114,7 @@ type Json = string | number | boolean | null | {
1114
1114
  } | Json[];
1115
1115
  type Database = {
1116
1116
  __InternalSupabase: {
1117
- PostgrestVersion: "12.2.3 (519615d)";
1117
+ PostgrestVersion: '12.2.3 (519615d)';
1118
1118
  };
1119
1119
  public: {
1120
1120
  Tables: {
@@ -1157,11 +1157,11 @@ type Database = {
1157
1157
  };
1158
1158
  Relationships: [
1159
1159
  {
1160
- foreignKeyName: "acq_artifacts_organization_id_fkey";
1161
- columns: ["organization_id"];
1160
+ foreignKeyName: 'acq_artifacts_organization_id_fkey';
1161
+ columns: ['organization_id'];
1162
1162
  isOneToOne: false;
1163
- referencedRelation: "organizations";
1164
- referencedColumns: ["id"];
1163
+ referencedRelation: 'organizations';
1164
+ referencedColumns: ['id'];
1165
1165
  }
1166
1166
  ];
1167
1167
  };
@@ -1246,11 +1246,11 @@ type Database = {
1246
1246
  };
1247
1247
  Relationships: [
1248
1248
  {
1249
- foreignKeyName: "acq_companies_organization_id_fkey";
1250
- columns: ["organization_id"];
1249
+ foreignKeyName: 'acq_companies_organization_id_fkey';
1250
+ columns: ['organization_id'];
1251
1251
  isOneToOne: false;
1252
- referencedRelation: "organizations";
1253
- referencedColumns: ["id"];
1252
+ referencedRelation: 'organizations';
1253
+ referencedColumns: ['id'];
1254
1254
  }
1255
1255
  ];
1256
1256
  };
@@ -1341,18 +1341,18 @@ type Database = {
1341
1341
  };
1342
1342
  Relationships: [
1343
1343
  {
1344
- foreignKeyName: "acq_contacts_company_id_fkey";
1345
- columns: ["company_id"];
1344
+ foreignKeyName: 'acq_contacts_company_id_fkey';
1345
+ columns: ['company_id'];
1346
1346
  isOneToOne: false;
1347
- referencedRelation: "acq_companies";
1348
- referencedColumns: ["id"];
1347
+ referencedRelation: 'acq_companies';
1348
+ referencedColumns: ['id'];
1349
1349
  },
1350
1350
  {
1351
- foreignKeyName: "acq_contacts_organization_id_fkey";
1352
- columns: ["organization_id"];
1351
+ foreignKeyName: 'acq_contacts_organization_id_fkey';
1352
+ columns: ['organization_id'];
1353
1353
  isOneToOne: false;
1354
- referencedRelation: "organizations";
1355
- referencedColumns: ["id"];
1354
+ referencedRelation: 'organizations';
1355
+ referencedColumns: ['id'];
1356
1356
  }
1357
1357
  ];
1358
1358
  };
@@ -1389,11 +1389,11 @@ type Database = {
1389
1389
  };
1390
1390
  Relationships: [
1391
1391
  {
1392
- foreignKeyName: "acq_content_organization_id_fkey";
1393
- columns: ["organization_id"];
1392
+ foreignKeyName: 'acq_content_organization_id_fkey';
1393
+ columns: ['organization_id'];
1394
1394
  isOneToOne: false;
1395
- referencedRelation: "organizations";
1396
- referencedColumns: ["id"];
1395
+ referencedRelation: 'organizations';
1396
+ referencedColumns: ['id'];
1397
1397
  }
1398
1398
  ];
1399
1399
  };
@@ -1457,18 +1457,18 @@ type Database = {
1457
1457
  };
1458
1458
  Relationships: [
1459
1459
  {
1460
- foreignKeyName: "acq_content_distributions_content_id_fkey";
1461
- columns: ["content_id"];
1460
+ foreignKeyName: 'acq_content_distributions_content_id_fkey';
1461
+ columns: ['content_id'];
1462
1462
  isOneToOne: false;
1463
- referencedRelation: "acq_content";
1464
- referencedColumns: ["id"];
1463
+ referencedRelation: 'acq_content';
1464
+ referencedColumns: ['id'];
1465
1465
  },
1466
1466
  {
1467
- foreignKeyName: "acq_content_distributions_organization_id_fkey";
1468
- columns: ["organization_id"];
1467
+ foreignKeyName: 'acq_content_distributions_organization_id_fkey';
1468
+ columns: ['organization_id'];
1469
1469
  isOneToOne: false;
1470
- referencedRelation: "organizations";
1471
- referencedColumns: ["id"];
1470
+ referencedRelation: 'organizations';
1471
+ referencedColumns: ['id'];
1472
1472
  }
1473
1473
  ];
1474
1474
  };
@@ -1502,18 +1502,18 @@ type Database = {
1502
1502
  };
1503
1503
  Relationships: [
1504
1504
  {
1505
- foreignKeyName: "acq_deal_notes_deal_id_fkey";
1506
- columns: ["deal_id"];
1505
+ foreignKeyName: 'acq_deal_notes_deal_id_fkey';
1506
+ columns: ['deal_id'];
1507
1507
  isOneToOne: false;
1508
- referencedRelation: "acq_deals";
1509
- referencedColumns: ["id"];
1508
+ referencedRelation: 'acq_deals';
1509
+ referencedColumns: ['id'];
1510
1510
  },
1511
1511
  {
1512
- foreignKeyName: "acq_deal_notes_organization_id_fkey";
1513
- columns: ["organization_id"];
1512
+ foreignKeyName: 'acq_deal_notes_organization_id_fkey';
1513
+ columns: ['organization_id'];
1514
1514
  isOneToOne: false;
1515
- referencedRelation: "organizations";
1516
- referencedColumns: ["id"];
1515
+ referencedRelation: 'organizations';
1516
+ referencedColumns: ['id'];
1517
1517
  }
1518
1518
  ];
1519
1519
  };
@@ -1565,18 +1565,18 @@ type Database = {
1565
1565
  };
1566
1566
  Relationships: [
1567
1567
  {
1568
- foreignKeyName: "acq_deal_tasks_deal_id_fkey";
1569
- columns: ["deal_id"];
1568
+ foreignKeyName: 'acq_deal_tasks_deal_id_fkey';
1569
+ columns: ['deal_id'];
1570
1570
  isOneToOne: false;
1571
- referencedRelation: "acq_deals";
1572
- referencedColumns: ["id"];
1571
+ referencedRelation: 'acq_deals';
1572
+ referencedColumns: ['id'];
1573
1573
  },
1574
1574
  {
1575
- foreignKeyName: "acq_deal_tasks_organization_id_fkey";
1576
- columns: ["organization_id"];
1575
+ foreignKeyName: 'acq_deal_tasks_organization_id_fkey';
1576
+ columns: ['organization_id'];
1577
1577
  isOneToOne: false;
1578
- referencedRelation: "organizations";
1579
- referencedColumns: ["id"];
1578
+ referencedRelation: 'organizations';
1579
+ referencedColumns: ['id'];
1580
1580
  }
1581
1581
  ];
1582
1582
  };
@@ -1688,25 +1688,25 @@ type Database = {
1688
1688
  };
1689
1689
  Relationships: [
1690
1690
  {
1691
- foreignKeyName: "acq_deals_contact_id_fkey";
1692
- columns: ["contact_id"];
1691
+ foreignKeyName: 'acq_deals_contact_id_fkey';
1692
+ columns: ['contact_id'];
1693
1693
  isOneToOne: false;
1694
- referencedRelation: "acq_contacts";
1695
- referencedColumns: ["id"];
1694
+ referencedRelation: 'acq_contacts';
1695
+ referencedColumns: ['id'];
1696
1696
  },
1697
1697
  {
1698
- foreignKeyName: "acq_deals_organization_id_fkey";
1699
- columns: ["organization_id"];
1698
+ foreignKeyName: 'acq_deals_organization_id_fkey';
1699
+ columns: ['organization_id'];
1700
1700
  isOneToOne: false;
1701
- referencedRelation: "organizations";
1702
- referencedColumns: ["id"];
1701
+ referencedRelation: 'organizations';
1702
+ referencedColumns: ['id'];
1703
1703
  },
1704
1704
  {
1705
- foreignKeyName: "acq_deals_source_list_id_fkey";
1706
- columns: ["source_list_id"];
1705
+ foreignKeyName: 'acq_deals_source_list_id_fkey';
1706
+ columns: ['source_list_id'];
1707
1707
  isOneToOne: false;
1708
- referencedRelation: "acq_lists";
1709
- referencedColumns: ["id"];
1708
+ referencedRelation: 'acq_lists';
1709
+ referencedColumns: ['id'];
1710
1710
  }
1711
1711
  ];
1712
1712
  };
@@ -1719,6 +1719,7 @@ type Database = {
1719
1719
  id: string;
1720
1720
  list_id: string;
1721
1721
  pipeline_key: string;
1722
+ processing_state: Json;
1722
1723
  source_execution_id: string | null;
1723
1724
  source_input_hash: string | null;
1724
1725
  source_resource_id: string | null;
@@ -1733,6 +1734,7 @@ type Database = {
1733
1734
  id?: string;
1734
1735
  list_id: string;
1735
1736
  pipeline_key?: string;
1737
+ processing_state?: Json;
1736
1738
  source_execution_id?: string | null;
1737
1739
  source_input_hash?: string | null;
1738
1740
  source_resource_id?: string | null;
@@ -1747,6 +1749,7 @@ type Database = {
1747
1749
  id?: string;
1748
1750
  list_id?: string;
1749
1751
  pipeline_key?: string;
1752
+ processing_state?: Json;
1750
1753
  source_execution_id?: string | null;
1751
1754
  source_input_hash?: string | null;
1752
1755
  source_resource_id?: string | null;
@@ -1755,25 +1758,25 @@ type Database = {
1755
1758
  };
1756
1759
  Relationships: [
1757
1760
  {
1758
- foreignKeyName: "acq_list_companies_company_id_fkey";
1759
- columns: ["company_id"];
1761
+ foreignKeyName: 'acq_list_companies_company_id_fkey';
1762
+ columns: ['company_id'];
1760
1763
  isOneToOne: false;
1761
- referencedRelation: "acq_companies";
1762
- referencedColumns: ["id"];
1764
+ referencedRelation: 'acq_companies';
1765
+ referencedColumns: ['id'];
1763
1766
  },
1764
1767
  {
1765
- foreignKeyName: "acq_list_companies_list_id_fkey";
1766
- columns: ["list_id"];
1768
+ foreignKeyName: 'acq_list_companies_list_id_fkey';
1769
+ columns: ['list_id'];
1767
1770
  isOneToOne: false;
1768
- referencedRelation: "acq_lists";
1769
- referencedColumns: ["id"];
1771
+ referencedRelation: 'acq_lists';
1772
+ referencedColumns: ['id'];
1770
1773
  },
1771
1774
  {
1772
- foreignKeyName: "acq_list_companies_source_execution_id_fkey";
1773
- columns: ["source_execution_id"];
1775
+ foreignKeyName: 'acq_list_companies_source_execution_id_fkey';
1776
+ columns: ['source_execution_id'];
1774
1777
  isOneToOne: false;
1775
- referencedRelation: "execution_logs";
1776
- referencedColumns: ["execution_id"];
1778
+ referencedRelation: 'execution_logs';
1779
+ referencedColumns: ['execution_id'];
1777
1780
  }
1778
1781
  ];
1779
1782
  };
@@ -1801,18 +1804,18 @@ type Database = {
1801
1804
  };
1802
1805
  Relationships: [
1803
1806
  {
1804
- foreignKeyName: "acq_list_executions_execution_id_fkey";
1805
- columns: ["execution_id"];
1807
+ foreignKeyName: 'acq_list_executions_execution_id_fkey';
1808
+ columns: ['execution_id'];
1806
1809
  isOneToOne: false;
1807
- referencedRelation: "execution_logs";
1808
- referencedColumns: ["execution_id"];
1810
+ referencedRelation: 'execution_logs';
1811
+ referencedColumns: ['execution_id'];
1809
1812
  },
1810
1813
  {
1811
- foreignKeyName: "acq_list_executions_list_id_fkey";
1812
- columns: ["list_id"];
1814
+ foreignKeyName: 'acq_list_executions_list_id_fkey';
1815
+ columns: ['list_id'];
1813
1816
  isOneToOne: false;
1814
- referencedRelation: "acq_lists";
1815
- referencedColumns: ["id"];
1817
+ referencedRelation: 'acq_lists';
1818
+ referencedColumns: ['id'];
1816
1819
  }
1817
1820
  ];
1818
1821
  };
@@ -1825,6 +1828,7 @@ type Database = {
1825
1828
  id: string;
1826
1829
  list_id: string;
1827
1830
  pipeline_key: string;
1831
+ processing_state: Json;
1828
1832
  source_execution_id: string | null;
1829
1833
  source_input_hash: string | null;
1830
1834
  source_resource_id: string | null;
@@ -1839,6 +1843,7 @@ type Database = {
1839
1843
  id?: string;
1840
1844
  list_id: string;
1841
1845
  pipeline_key?: string;
1846
+ processing_state?: Json;
1842
1847
  source_execution_id?: string | null;
1843
1848
  source_input_hash?: string | null;
1844
1849
  source_resource_id?: string | null;
@@ -1853,6 +1858,7 @@ type Database = {
1853
1858
  id?: string;
1854
1859
  list_id?: string;
1855
1860
  pipeline_key?: string;
1861
+ processing_state?: Json;
1856
1862
  source_execution_id?: string | null;
1857
1863
  source_input_hash?: string | null;
1858
1864
  source_resource_id?: string | null;
@@ -1861,25 +1867,25 @@ type Database = {
1861
1867
  };
1862
1868
  Relationships: [
1863
1869
  {
1864
- foreignKeyName: "acq_list_members_contact_id_fkey";
1865
- columns: ["contact_id"];
1870
+ foreignKeyName: 'acq_list_members_contact_id_fkey';
1871
+ columns: ['contact_id'];
1866
1872
  isOneToOne: false;
1867
- referencedRelation: "acq_contacts";
1868
- referencedColumns: ["id"];
1873
+ referencedRelation: 'acq_contacts';
1874
+ referencedColumns: ['id'];
1869
1875
  },
1870
1876
  {
1871
- foreignKeyName: "acq_list_members_list_id_fkey";
1872
- columns: ["list_id"];
1877
+ foreignKeyName: 'acq_list_members_list_id_fkey';
1878
+ columns: ['list_id'];
1873
1879
  isOneToOne: false;
1874
- referencedRelation: "acq_lists";
1875
- referencedColumns: ["id"];
1880
+ referencedRelation: 'acq_lists';
1881
+ referencedColumns: ['id'];
1876
1882
  },
1877
1883
  {
1878
- foreignKeyName: "acq_list_members_source_execution_id_fkey";
1879
- columns: ["source_execution_id"];
1884
+ foreignKeyName: 'acq_list_members_source_execution_id_fkey';
1885
+ columns: ['source_execution_id'];
1880
1886
  isOneToOne: false;
1881
- referencedRelation: "execution_logs";
1882
- referencedColumns: ["execution_id"];
1887
+ referencedRelation: 'execution_logs';
1888
+ referencedColumns: ['execution_id'];
1883
1889
  }
1884
1890
  ];
1885
1891
  };
@@ -1899,7 +1905,6 @@ type Database = {
1899
1905
  pipeline_config: Json;
1900
1906
  scraping_config: Json;
1901
1907
  status: string;
1902
- type: string;
1903
1908
  };
1904
1909
  Insert: {
1905
1910
  batch_ids?: string[];
@@ -1916,7 +1921,6 @@ type Database = {
1916
1921
  pipeline_config?: Json;
1917
1922
  scraping_config?: Json;
1918
1923
  status?: string;
1919
- type?: string;
1920
1924
  };
1921
1925
  Update: {
1922
1926
  batch_ids?: string[];
@@ -1933,15 +1937,14 @@ type Database = {
1933
1937
  pipeline_config?: Json;
1934
1938
  scraping_config?: Json;
1935
1939
  status?: string;
1936
- type?: string;
1937
1940
  };
1938
1941
  Relationships: [
1939
1942
  {
1940
- foreignKeyName: "acq_lists_organization_id_fkey";
1941
- columns: ["organization_id"];
1943
+ foreignKeyName: 'acq_lists_organization_id_fkey';
1944
+ columns: ['organization_id'];
1942
1945
  isOneToOne: false;
1943
- referencedRelation: "organizations";
1944
- referencedColumns: ["id"];
1946
+ referencedRelation: 'organizations';
1947
+ referencedColumns: ['id'];
1945
1948
  }
1946
1949
  ];
1947
1950
  };
@@ -2017,18 +2020,18 @@ type Database = {
2017
2020
  };
2018
2021
  Relationships: [
2019
2022
  {
2020
- foreignKeyName: "acq_seo_metrics_organization_id_fkey";
2021
- columns: ["organization_id"];
2023
+ foreignKeyName: 'acq_seo_metrics_organization_id_fkey';
2024
+ columns: ['organization_id'];
2022
2025
  isOneToOne: false;
2023
- referencedRelation: "organizations";
2024
- referencedColumns: ["id"];
2026
+ referencedRelation: 'organizations';
2027
+ referencedColumns: ['id'];
2025
2028
  },
2026
2029
  {
2027
- foreignKeyName: "acq_seo_metrics_seo_page_id_fkey";
2028
- columns: ["seo_page_id"];
2030
+ foreignKeyName: 'acq_seo_metrics_seo_page_id_fkey';
2031
+ columns: ['seo_page_id'];
2029
2032
  isOneToOne: false;
2030
- referencedRelation: "acq_seo_pages";
2031
- referencedColumns: ["id"];
2033
+ referencedRelation: 'acq_seo_pages';
2034
+ referencedColumns: ['id'];
2032
2035
  }
2033
2036
  ];
2034
2037
  };
@@ -2104,11 +2107,11 @@ type Database = {
2104
2107
  };
2105
2108
  Relationships: [
2106
2109
  {
2107
- foreignKeyName: "acq_seo_pages_organization_id_fkey";
2108
- columns: ["organization_id"];
2110
+ foreignKeyName: 'acq_seo_pages_organization_id_fkey';
2111
+ columns: ['organization_id'];
2109
2112
  isOneToOne: false;
2110
- referencedRelation: "organizations";
2111
- referencedColumns: ["id"];
2113
+ referencedRelation: 'organizations';
2114
+ referencedColumns: ['id'];
2112
2115
  }
2113
2116
  ];
2114
2117
  };
@@ -2205,67 +2208,11 @@ type Database = {
2205
2208
  };
2206
2209
  Relationships: [
2207
2210
  {
2208
- foreignKeyName: "acq_social_posts_organization_id_fkey";
2209
- columns: ["organization_id"];
2210
- isOneToOne: false;
2211
- referencedRelation: "organizations";
2212
- referencedColumns: ["id"];
2213
- }
2214
- ];
2215
- };
2216
- acq_touchpoints: {
2217
- Row: {
2218
- artifact_id: string | null;
2219
- channel: string;
2220
- contact_id: string | null;
2221
- created_at: string;
2222
- direction: string;
2223
- id: string;
2224
- kind: string;
2225
- list_id: string | null;
2226
- list_member_id: string | null;
2227
- occurred_at: string;
2228
- organization_id: string;
2229
- payload: Json | null;
2230
- source_execution_id: string | null;
2231
- };
2232
- Insert: {
2233
- artifact_id?: string | null;
2234
- channel: string;
2235
- contact_id?: string | null;
2236
- created_at?: string;
2237
- direction: string;
2238
- id?: string;
2239
- kind: string;
2240
- list_id?: string | null;
2241
- list_member_id?: string | null;
2242
- occurred_at: string;
2243
- organization_id: string;
2244
- payload?: Json | null;
2245
- source_execution_id?: string | null;
2246
- };
2247
- Update: {
2248
- artifact_id?: string | null;
2249
- channel?: string;
2250
- contact_id?: string | null;
2251
- created_at?: string;
2252
- direction?: string;
2253
- id?: string;
2254
- kind?: string;
2255
- list_id?: string | null;
2256
- list_member_id?: string | null;
2257
- occurred_at?: string;
2258
- organization_id?: string;
2259
- payload?: Json | null;
2260
- source_execution_id?: string | null;
2261
- };
2262
- Relationships: [
2263
- {
2264
- foreignKeyName: "acq_touchpoints_organization_id_fkey";
2265
- columns: ["organization_id"];
2211
+ foreignKeyName: 'acq_social_posts_organization_id_fkey';
2212
+ columns: ['organization_id'];
2266
2213
  isOneToOne: false;
2267
- referencedRelation: "organizations";
2268
- referencedColumns: ["id"];
2214
+ referencedRelation: 'organizations';
2215
+ referencedColumns: ['id'];
2269
2216
  }
2270
2217
  ];
2271
2218
  };
@@ -2320,11 +2267,11 @@ type Database = {
2320
2267
  };
2321
2268
  Relationships: [
2322
2269
  {
2323
- foreignKeyName: "activities_organization_id_fkey";
2324
- columns: ["organization_id"];
2270
+ foreignKeyName: 'activities_organization_id_fkey';
2271
+ columns: ['organization_id'];
2325
2272
  isOneToOne: false;
2326
- referencedRelation: "organizations";
2327
- referencedColumns: ["id"];
2273
+ referencedRelation: 'organizations';
2274
+ referencedColumns: ['id'];
2328
2275
  }
2329
2276
  ];
2330
2277
  };
@@ -2355,11 +2302,11 @@ type Database = {
2355
2302
  };
2356
2303
  Relationships: [
2357
2304
  {
2358
- foreignKeyName: "api_keys_organization_id_fkey";
2359
- columns: ["organization_id"];
2305
+ foreignKeyName: 'api_keys_organization_id_fkey';
2306
+ columns: ['organization_id'];
2360
2307
  isOneToOne: false;
2361
- referencedRelation: "organizations";
2362
- referencedColumns: ["id"];
2308
+ referencedRelation: 'organizations';
2309
+ referencedColumns: ['id'];
2363
2310
  }
2364
2311
  ];
2365
2312
  };
@@ -2438,25 +2385,25 @@ type Database = {
2438
2385
  };
2439
2386
  Relationships: [
2440
2387
  {
2441
- foreignKeyName: "command_queue_completed_by_fkey";
2442
- columns: ["completed_by"];
2388
+ foreignKeyName: 'command_queue_completed_by_fkey';
2389
+ columns: ['completed_by'];
2443
2390
  isOneToOne: false;
2444
- referencedRelation: "users";
2445
- referencedColumns: ["id"];
2391
+ referencedRelation: 'users';
2392
+ referencedColumns: ['id'];
2446
2393
  },
2447
2394
  {
2448
- foreignKeyName: "command_queue_organization_id_fkey";
2449
- columns: ["organization_id"];
2395
+ foreignKeyName: 'command_queue_organization_id_fkey';
2396
+ columns: ['organization_id'];
2450
2397
  isOneToOne: false;
2451
- referencedRelation: "organizations";
2452
- referencedColumns: ["id"];
2398
+ referencedRelation: 'organizations';
2399
+ referencedColumns: ['id'];
2453
2400
  },
2454
2401
  {
2455
- foreignKeyName: "command_queue_target_execution_id_fkey";
2456
- columns: ["target_execution_id"];
2402
+ foreignKeyName: 'command_queue_target_execution_id_fkey';
2403
+ columns: ['target_execution_id'];
2457
2404
  isOneToOne: false;
2458
- referencedRelation: "execution_logs";
2459
- referencedColumns: ["execution_id"];
2405
+ referencedRelation: 'execution_logs';
2406
+ referencedColumns: ['execution_id'];
2460
2407
  }
2461
2408
  ];
2462
2409
  };
@@ -2496,18 +2443,18 @@ type Database = {
2496
2443
  };
2497
2444
  Relationships: [
2498
2445
  {
2499
- foreignKeyName: "credentials_created_by_fkey";
2500
- columns: ["created_by"];
2446
+ foreignKeyName: 'credentials_created_by_fkey';
2447
+ columns: ['created_by'];
2501
2448
  isOneToOne: false;
2502
- referencedRelation: "users";
2503
- referencedColumns: ["id"];
2449
+ referencedRelation: 'users';
2450
+ referencedColumns: ['id'];
2504
2451
  },
2505
2452
  {
2506
- foreignKeyName: "credentials_organization_id_fkey";
2507
- columns: ["organization_id"];
2453
+ foreignKeyName: 'credentials_organization_id_fkey';
2454
+ columns: ['organization_id'];
2508
2455
  isOneToOne: false;
2509
- referencedRelation: "organizations";
2510
- referencedColumns: ["id"];
2456
+ referencedRelation: 'organizations';
2457
+ referencedColumns: ['id'];
2511
2458
  }
2512
2459
  ];
2513
2460
  };
@@ -2553,11 +2500,11 @@ type Database = {
2553
2500
  };
2554
2501
  Relationships: [
2555
2502
  {
2556
- foreignKeyName: "deployments_organization_id_fkey";
2557
- columns: ["organization_id"];
2503
+ foreignKeyName: 'deployments_organization_id_fkey';
2504
+ columns: ['organization_id'];
2558
2505
  isOneToOne: false;
2559
- referencedRelation: "organizations";
2560
- referencedColumns: ["id"];
2506
+ referencedRelation: 'organizations';
2507
+ referencedColumns: ['id'];
2561
2508
  }
2562
2509
  ];
2563
2510
  };
@@ -2612,25 +2559,25 @@ type Database = {
2612
2559
  };
2613
2560
  Relationships: [
2614
2561
  {
2615
- foreignKeyName: "execution_errors_execution_id_fkey";
2616
- columns: ["execution_id"];
2562
+ foreignKeyName: 'execution_errors_execution_id_fkey';
2563
+ columns: ['execution_id'];
2617
2564
  isOneToOne: false;
2618
- referencedRelation: "execution_logs";
2619
- referencedColumns: ["execution_id"];
2565
+ referencedRelation: 'execution_logs';
2566
+ referencedColumns: ['execution_id'];
2620
2567
  },
2621
2568
  {
2622
- foreignKeyName: "execution_errors_organization_id_fkey";
2623
- columns: ["organization_id"];
2569
+ foreignKeyName: 'execution_errors_organization_id_fkey';
2570
+ columns: ['organization_id'];
2624
2571
  isOneToOne: false;
2625
- referencedRelation: "organizations";
2626
- referencedColumns: ["id"];
2572
+ referencedRelation: 'organizations';
2573
+ referencedColumns: ['id'];
2627
2574
  },
2628
2575
  {
2629
- foreignKeyName: "execution_errors_resolved_by_fkey";
2630
- columns: ["resolved_by"];
2576
+ foreignKeyName: 'execution_errors_resolved_by_fkey';
2577
+ columns: ['resolved_by'];
2631
2578
  isOneToOne: false;
2632
- referencedRelation: "users";
2633
- referencedColumns: ["id"];
2579
+ referencedRelation: 'users';
2580
+ referencedColumns: ['id'];
2634
2581
  }
2635
2582
  ];
2636
2583
  };
@@ -2712,32 +2659,32 @@ type Database = {
2712
2659
  };
2713
2660
  Relationships: [
2714
2661
  {
2715
- foreignKeyName: "execution_history_organization_id_fkey";
2716
- columns: ["organization_id"];
2662
+ foreignKeyName: 'execution_history_organization_id_fkey';
2663
+ columns: ['organization_id'];
2717
2664
  isOneToOne: false;
2718
- referencedRelation: "organizations";
2719
- referencedColumns: ["id"];
2665
+ referencedRelation: 'organizations';
2666
+ referencedColumns: ['id'];
2720
2667
  },
2721
2668
  {
2722
- foreignKeyName: "execution_logs_origin_execution_id_fkey";
2723
- columns: ["origin_execution_id"];
2669
+ foreignKeyName: 'execution_logs_origin_execution_id_fkey';
2670
+ columns: ['origin_execution_id'];
2724
2671
  isOneToOne: false;
2725
- referencedRelation: "execution_logs";
2726
- referencedColumns: ["execution_id"];
2672
+ referencedRelation: 'execution_logs';
2673
+ referencedColumns: ['execution_id'];
2727
2674
  },
2728
2675
  {
2729
- foreignKeyName: "execution_logs_session_id_fkey";
2730
- columns: ["session_id"];
2676
+ foreignKeyName: 'execution_logs_session_id_fkey';
2677
+ columns: ['session_id'];
2731
2678
  isOneToOne: false;
2732
- referencedRelation: "sessions";
2733
- referencedColumns: ["session_id"];
2679
+ referencedRelation: 'sessions';
2680
+ referencedColumns: ['session_id'];
2734
2681
  },
2735
2682
  {
2736
- foreignKeyName: "execution_logs_user_id_fkey";
2737
- columns: ["user_id"];
2683
+ foreignKeyName: 'execution_logs_user_id_fkey';
2684
+ columns: ['user_id'];
2738
2685
  isOneToOne: false;
2739
- referencedRelation: "users";
2740
- referencedColumns: ["id"];
2686
+ referencedRelation: 'users';
2687
+ referencedColumns: ['id'];
2741
2688
  }
2742
2689
  ];
2743
2690
  };
@@ -2783,18 +2730,18 @@ type Database = {
2783
2730
  };
2784
2731
  Relationships: [
2785
2732
  {
2786
- foreignKeyName: "execution_metrics_execution_id_fkey";
2787
- columns: ["execution_id"];
2733
+ foreignKeyName: 'execution_metrics_execution_id_fkey';
2734
+ columns: ['execution_id'];
2788
2735
  isOneToOne: true;
2789
- referencedRelation: "execution_logs";
2790
- referencedColumns: ["execution_id"];
2736
+ referencedRelation: 'execution_logs';
2737
+ referencedColumns: ['execution_id'];
2791
2738
  },
2792
2739
  {
2793
- foreignKeyName: "execution_metrics_organization_id_fkey";
2794
- columns: ["organization_id"];
2740
+ foreignKeyName: 'execution_metrics_organization_id_fkey';
2741
+ columns: ['organization_id'];
2795
2742
  isOneToOne: false;
2796
- referencedRelation: "organizations";
2797
- referencedColumns: ["id"];
2743
+ referencedRelation: 'organizations';
2744
+ referencedColumns: ['id'];
2798
2745
  }
2799
2746
  ];
2800
2747
  };
@@ -2837,18 +2784,18 @@ type Database = {
2837
2784
  };
2838
2785
  Relationships: [
2839
2786
  {
2840
- foreignKeyName: "notifications_organization_id_fkey";
2841
- columns: ["organization_id"];
2787
+ foreignKeyName: 'notifications_organization_id_fkey';
2788
+ columns: ['organization_id'];
2842
2789
  isOneToOne: false;
2843
- referencedRelation: "organizations";
2844
- referencedColumns: ["id"];
2790
+ referencedRelation: 'organizations';
2791
+ referencedColumns: ['id'];
2845
2792
  },
2846
2793
  {
2847
- foreignKeyName: "notifications_user_id_fkey";
2848
- columns: ["user_id"];
2794
+ foreignKeyName: 'notifications_user_id_fkey';
2795
+ columns: ['user_id'];
2849
2796
  isOneToOne: false;
2850
- referencedRelation: "users";
2851
- referencedColumns: ["id"];
2797
+ referencedRelation: 'users';
2798
+ referencedColumns: ['id'];
2852
2799
  }
2853
2800
  ];
2854
2801
  };
@@ -2903,18 +2850,18 @@ type Database = {
2903
2850
  };
2904
2851
  Relationships: [
2905
2852
  {
2906
- foreignKeyName: "org_invitations_inviter_user_id_fkey";
2907
- columns: ["inviter_user_id"];
2853
+ foreignKeyName: 'org_invitations_inviter_user_id_fkey';
2854
+ columns: ['inviter_user_id'];
2908
2855
  isOneToOne: false;
2909
- referencedRelation: "users";
2910
- referencedColumns: ["id"];
2856
+ referencedRelation: 'users';
2857
+ referencedColumns: ['id'];
2911
2858
  },
2912
2859
  {
2913
- foreignKeyName: "org_invitations_organization_id_fkey";
2914
- columns: ["organization_id"];
2860
+ foreignKeyName: 'org_invitations_organization_id_fkey';
2861
+ columns: ['organization_id'];
2915
2862
  isOneToOne: false;
2916
- referencedRelation: "organizations";
2917
- referencedColumns: ["id"];
2863
+ referencedRelation: 'organizations';
2864
+ referencedColumns: ['id'];
2918
2865
  }
2919
2866
  ];
2920
2867
  };
@@ -2957,18 +2904,18 @@ type Database = {
2957
2904
  };
2958
2905
  Relationships: [
2959
2906
  {
2960
- foreignKeyName: "org_memberships_organization_id_fkey";
2961
- columns: ["organization_id"];
2907
+ foreignKeyName: 'org_memberships_organization_id_fkey';
2908
+ columns: ['organization_id'];
2962
2909
  isOneToOne: false;
2963
- referencedRelation: "organizations";
2964
- referencedColumns: ["id"];
2910
+ referencedRelation: 'organizations';
2911
+ referencedColumns: ['id'];
2965
2912
  },
2966
2913
  {
2967
- foreignKeyName: "org_memberships_user_id_fkey";
2968
- columns: ["user_id"];
2914
+ foreignKeyName: 'org_memberships_user_id_fkey';
2915
+ columns: ['user_id'];
2969
2916
  isOneToOne: false;
2970
- referencedRelation: "users";
2971
- referencedColumns: ["id"];
2917
+ referencedRelation: 'users';
2918
+ referencedColumns: ['id'];
2972
2919
  }
2973
2920
  ];
2974
2921
  };
@@ -2993,25 +2940,25 @@ type Database = {
2993
2940
  };
2994
2941
  Relationships: [
2995
2942
  {
2996
- foreignKeyName: "org_rol_assignments_granted_by_fkey";
2997
- columns: ["granted_by"];
2943
+ foreignKeyName: 'org_rol_assignments_granted_by_fkey';
2944
+ columns: ['granted_by'];
2998
2945
  isOneToOne: false;
2999
- referencedRelation: "users";
3000
- referencedColumns: ["id"];
2946
+ referencedRelation: 'users';
2947
+ referencedColumns: ['id'];
3001
2948
  },
3002
2949
  {
3003
- foreignKeyName: "org_rol_assignments_membership_id_fkey";
3004
- columns: ["membership_id"];
2950
+ foreignKeyName: 'org_rol_assignments_membership_id_fkey';
2951
+ columns: ['membership_id'];
3005
2952
  isOneToOne: false;
3006
- referencedRelation: "org_memberships";
3007
- referencedColumns: ["id"];
2953
+ referencedRelation: 'org_memberships';
2954
+ referencedColumns: ['id'];
3008
2955
  },
3009
2956
  {
3010
- foreignKeyName: "org_rol_assignments_role_id_fkey";
3011
- columns: ["role_id"];
2957
+ foreignKeyName: 'org_rol_assignments_role_id_fkey';
2958
+ columns: ['role_id'];
3012
2959
  isOneToOne: false;
3013
- referencedRelation: "org_rol_definitions";
3014
- referencedColumns: ["id"];
2960
+ referencedRelation: 'org_rol_definitions';
2961
+ referencedColumns: ['id'];
3015
2962
  }
3016
2963
  ];
3017
2964
  };
@@ -3048,11 +2995,11 @@ type Database = {
3048
2995
  };
3049
2996
  Relationships: [
3050
2997
  {
3051
- foreignKeyName: "org_rol_definitions_organization_id_fkey";
3052
- columns: ["organization_id"];
2998
+ foreignKeyName: 'org_rol_definitions_organization_id_fkey';
2999
+ columns: ['organization_id'];
3053
3000
  isOneToOne: false;
3054
- referencedRelation: "organizations";
3055
- referencedColumns: ["id"];
3001
+ referencedRelation: 'organizations';
3002
+ referencedColumns: ['id'];
3056
3003
  }
3057
3004
  ];
3058
3005
  };
@@ -3074,18 +3021,18 @@ type Database = {
3074
3021
  };
3075
3022
  Relationships: [
3076
3023
  {
3077
- foreignKeyName: "org_rol_grants_permission_key_fkey";
3078
- columns: ["permission_key"];
3024
+ foreignKeyName: 'org_rol_grants_permission_key_fkey';
3025
+ columns: ['permission_key'];
3079
3026
  isOneToOne: false;
3080
- referencedRelation: "org_rol_permissions";
3081
- referencedColumns: ["key"];
3027
+ referencedRelation: 'org_rol_permissions';
3028
+ referencedColumns: ['key'];
3082
3029
  },
3083
3030
  {
3084
- foreignKeyName: "org_rol_grants_role_id_fkey";
3085
- columns: ["role_id"];
3031
+ foreignKeyName: 'org_rol_grants_role_id_fkey';
3032
+ columns: ['role_id'];
3086
3033
  isOneToOne: false;
3087
- referencedRelation: "org_rol_definitions";
3088
- referencedColumns: ["id"];
3034
+ referencedRelation: 'org_rol_definitions';
3035
+ referencedColumns: ['id'];
3089
3036
  }
3090
3037
  ];
3091
3038
  };
@@ -3197,25 +3144,25 @@ type Database = {
3197
3144
  };
3198
3145
  Relationships: [
3199
3146
  {
3200
- foreignKeyName: "fk_milestones_project";
3201
- columns: ["project_id"];
3147
+ foreignKeyName: 'fk_milestones_project';
3148
+ columns: ['project_id'];
3202
3149
  isOneToOne: false;
3203
- referencedRelation: "prj_projects";
3204
- referencedColumns: ["id"];
3150
+ referencedRelation: 'prj_projects';
3151
+ referencedColumns: ['id'];
3205
3152
  },
3206
3153
  {
3207
- foreignKeyName: "prj_milestones_organization_id_fkey";
3208
- columns: ["organization_id"];
3154
+ foreignKeyName: 'prj_milestones_organization_id_fkey';
3155
+ columns: ['organization_id'];
3209
3156
  isOneToOne: false;
3210
- referencedRelation: "organizations";
3211
- referencedColumns: ["id"];
3157
+ referencedRelation: 'organizations';
3158
+ referencedColumns: ['id'];
3212
3159
  },
3213
3160
  {
3214
- foreignKeyName: "prj_milestones_project_id_fkey";
3215
- columns: ["project_id"];
3161
+ foreignKeyName: 'prj_milestones_project_id_fkey';
3162
+ columns: ['project_id'];
3216
3163
  isOneToOne: false;
3217
- referencedRelation: "prj_projects";
3218
- referencedColumns: ["id"];
3164
+ referencedRelation: 'prj_projects';
3165
+ referencedColumns: ['id'];
3219
3166
  }
3220
3167
  ];
3221
3168
  };
@@ -3264,67 +3211,67 @@ type Database = {
3264
3211
  };
3265
3212
  Relationships: [
3266
3213
  {
3267
- foreignKeyName: "fk_notes_created_by";
3268
- columns: ["created_by"];
3214
+ foreignKeyName: 'fk_notes_created_by';
3215
+ columns: ['created_by'];
3269
3216
  isOneToOne: false;
3270
- referencedRelation: "users";
3271
- referencedColumns: ["id"];
3217
+ referencedRelation: 'users';
3218
+ referencedColumns: ['id'];
3272
3219
  },
3273
3220
  {
3274
- foreignKeyName: "fk_notes_milestone";
3275
- columns: ["milestone_id"];
3221
+ foreignKeyName: 'fk_notes_milestone';
3222
+ columns: ['milestone_id'];
3276
3223
  isOneToOne: false;
3277
- referencedRelation: "prj_milestones";
3278
- referencedColumns: ["id"];
3224
+ referencedRelation: 'prj_milestones';
3225
+ referencedColumns: ['id'];
3279
3226
  },
3280
3227
  {
3281
- foreignKeyName: "fk_notes_project";
3282
- columns: ["project_id"];
3228
+ foreignKeyName: 'fk_notes_project';
3229
+ columns: ['project_id'];
3283
3230
  isOneToOne: false;
3284
- referencedRelation: "prj_projects";
3285
- referencedColumns: ["id"];
3231
+ referencedRelation: 'prj_projects';
3232
+ referencedColumns: ['id'];
3286
3233
  },
3287
3234
  {
3288
- foreignKeyName: "fk_notes_task";
3289
- columns: ["task_id"];
3235
+ foreignKeyName: 'fk_notes_task';
3236
+ columns: ['task_id'];
3290
3237
  isOneToOne: false;
3291
- referencedRelation: "prj_tasks";
3292
- referencedColumns: ["id"];
3238
+ referencedRelation: 'prj_tasks';
3239
+ referencedColumns: ['id'];
3293
3240
  },
3294
3241
  {
3295
- foreignKeyName: "prj_notes_created_by_fkey";
3296
- columns: ["created_by"];
3242
+ foreignKeyName: 'prj_notes_created_by_fkey';
3243
+ columns: ['created_by'];
3297
3244
  isOneToOne: false;
3298
- referencedRelation: "users";
3299
- referencedColumns: ["id"];
3245
+ referencedRelation: 'users';
3246
+ referencedColumns: ['id'];
3300
3247
  },
3301
3248
  {
3302
- foreignKeyName: "prj_notes_milestone_id_fkey";
3303
- columns: ["milestone_id"];
3249
+ foreignKeyName: 'prj_notes_milestone_id_fkey';
3250
+ columns: ['milestone_id'];
3304
3251
  isOneToOne: false;
3305
- referencedRelation: "prj_milestones";
3306
- referencedColumns: ["id"];
3252
+ referencedRelation: 'prj_milestones';
3253
+ referencedColumns: ['id'];
3307
3254
  },
3308
3255
  {
3309
- foreignKeyName: "prj_notes_organization_id_fkey";
3310
- columns: ["organization_id"];
3256
+ foreignKeyName: 'prj_notes_organization_id_fkey';
3257
+ columns: ['organization_id'];
3311
3258
  isOneToOne: false;
3312
- referencedRelation: "organizations";
3313
- referencedColumns: ["id"];
3259
+ referencedRelation: 'organizations';
3260
+ referencedColumns: ['id'];
3314
3261
  },
3315
3262
  {
3316
- foreignKeyName: "prj_notes_project_id_fkey";
3317
- columns: ["project_id"];
3263
+ foreignKeyName: 'prj_notes_project_id_fkey';
3264
+ columns: ['project_id'];
3318
3265
  isOneToOne: false;
3319
- referencedRelation: "prj_projects";
3320
- referencedColumns: ["id"];
3266
+ referencedRelation: 'prj_projects';
3267
+ referencedColumns: ['id'];
3321
3268
  },
3322
3269
  {
3323
- foreignKeyName: "prj_notes_task_id_fkey";
3324
- columns: ["task_id"];
3270
+ foreignKeyName: 'prj_notes_task_id_fkey';
3271
+ columns: ['task_id'];
3325
3272
  isOneToOne: false;
3326
- referencedRelation: "prj_tasks";
3327
- referencedColumns: ["id"];
3273
+ referencedRelation: 'prj_tasks';
3274
+ referencedColumns: ['id'];
3328
3275
  }
3329
3276
  ];
3330
3277
  };
@@ -3382,39 +3329,39 @@ type Database = {
3382
3329
  };
3383
3330
  Relationships: [
3384
3331
  {
3385
- foreignKeyName: "fk_projects_company";
3386
- columns: ["client_company_id"];
3332
+ foreignKeyName: 'fk_projects_company';
3333
+ columns: ['client_company_id'];
3387
3334
  isOneToOne: false;
3388
- referencedRelation: "acq_companies";
3389
- referencedColumns: ["id"];
3335
+ referencedRelation: 'acq_companies';
3336
+ referencedColumns: ['id'];
3390
3337
  },
3391
3338
  {
3392
- foreignKeyName: "fk_projects_deal";
3393
- columns: ["deal_id"];
3339
+ foreignKeyName: 'fk_projects_deal';
3340
+ columns: ['deal_id'];
3394
3341
  isOneToOne: false;
3395
- referencedRelation: "acq_deals";
3396
- referencedColumns: ["id"];
3342
+ referencedRelation: 'acq_deals';
3343
+ referencedColumns: ['id'];
3397
3344
  },
3398
3345
  {
3399
- foreignKeyName: "prj_projects_client_company_id_fkey";
3400
- columns: ["client_company_id"];
3346
+ foreignKeyName: 'prj_projects_client_company_id_fkey';
3347
+ columns: ['client_company_id'];
3401
3348
  isOneToOne: false;
3402
- referencedRelation: "acq_companies";
3403
- referencedColumns: ["id"];
3349
+ referencedRelation: 'acq_companies';
3350
+ referencedColumns: ['id'];
3404
3351
  },
3405
3352
  {
3406
- foreignKeyName: "prj_projects_deal_id_fkey";
3407
- columns: ["deal_id"];
3353
+ foreignKeyName: 'prj_projects_deal_id_fkey';
3354
+ columns: ['deal_id'];
3408
3355
  isOneToOne: false;
3409
- referencedRelation: "acq_deals";
3410
- referencedColumns: ["id"];
3356
+ referencedRelation: 'acq_deals';
3357
+ referencedColumns: ['id'];
3411
3358
  },
3412
3359
  {
3413
- foreignKeyName: "prj_projects_organization_id_fkey";
3414
- columns: ["organization_id"];
3360
+ foreignKeyName: 'prj_projects_organization_id_fkey';
3361
+ columns: ['organization_id'];
3415
3362
  isOneToOne: false;
3416
- referencedRelation: "organizations";
3417
- referencedColumns: ["id"];
3363
+ referencedRelation: 'organizations';
3364
+ referencedColumns: ['id'];
3418
3365
  }
3419
3366
  ];
3420
3367
  };
@@ -3478,53 +3425,53 @@ type Database = {
3478
3425
  };
3479
3426
  Relationships: [
3480
3427
  {
3481
- foreignKeyName: "fk_tasks_milestone";
3482
- columns: ["milestone_id"];
3428
+ foreignKeyName: 'fk_tasks_milestone';
3429
+ columns: ['milestone_id'];
3483
3430
  isOneToOne: false;
3484
- referencedRelation: "prj_milestones";
3485
- referencedColumns: ["id"];
3431
+ referencedRelation: 'prj_milestones';
3432
+ referencedColumns: ['id'];
3486
3433
  },
3487
3434
  {
3488
- foreignKeyName: "fk_tasks_parent";
3489
- columns: ["parent_task_id"];
3435
+ foreignKeyName: 'fk_tasks_parent';
3436
+ columns: ['parent_task_id'];
3490
3437
  isOneToOne: false;
3491
- referencedRelation: "prj_tasks";
3492
- referencedColumns: ["id"];
3438
+ referencedRelation: 'prj_tasks';
3439
+ referencedColumns: ['id'];
3493
3440
  },
3494
3441
  {
3495
- foreignKeyName: "fk_tasks_project";
3496
- columns: ["project_id"];
3442
+ foreignKeyName: 'fk_tasks_project';
3443
+ columns: ['project_id'];
3497
3444
  isOneToOne: false;
3498
- referencedRelation: "prj_projects";
3499
- referencedColumns: ["id"];
3445
+ referencedRelation: 'prj_projects';
3446
+ referencedColumns: ['id'];
3500
3447
  },
3501
3448
  {
3502
- foreignKeyName: "prj_tasks_milestone_id_fkey";
3503
- columns: ["milestone_id"];
3449
+ foreignKeyName: 'prj_tasks_milestone_id_fkey';
3450
+ columns: ['milestone_id'];
3504
3451
  isOneToOne: false;
3505
- referencedRelation: "prj_milestones";
3506
- referencedColumns: ["id"];
3452
+ referencedRelation: 'prj_milestones';
3453
+ referencedColumns: ['id'];
3507
3454
  },
3508
3455
  {
3509
- foreignKeyName: "prj_tasks_organization_id_fkey";
3510
- columns: ["organization_id"];
3456
+ foreignKeyName: 'prj_tasks_organization_id_fkey';
3457
+ columns: ['organization_id'];
3511
3458
  isOneToOne: false;
3512
- referencedRelation: "organizations";
3513
- referencedColumns: ["id"];
3459
+ referencedRelation: 'organizations';
3460
+ referencedColumns: ['id'];
3514
3461
  },
3515
3462
  {
3516
- foreignKeyName: "prj_tasks_parent_task_id_fkey";
3517
- columns: ["parent_task_id"];
3463
+ foreignKeyName: 'prj_tasks_parent_task_id_fkey';
3464
+ columns: ['parent_task_id'];
3518
3465
  isOneToOne: false;
3519
- referencedRelation: "prj_tasks";
3520
- referencedColumns: ["id"];
3466
+ referencedRelation: 'prj_tasks';
3467
+ referencedColumns: ['id'];
3521
3468
  },
3522
3469
  {
3523
- foreignKeyName: "prj_tasks_project_id_fkey";
3524
- columns: ["project_id"];
3470
+ foreignKeyName: 'prj_tasks_project_id_fkey';
3471
+ columns: ['project_id'];
3525
3472
  isOneToOne: false;
3526
- referencedRelation: "prj_projects";
3527
- referencedColumns: ["id"];
3473
+ referencedRelation: 'prj_projects';
3474
+ referencedColumns: ['id'];
3528
3475
  }
3529
3476
  ];
3530
3477
  };
@@ -3594,25 +3541,25 @@ type Database = {
3594
3541
  };
3595
3542
  Relationships: [
3596
3543
  {
3597
- foreignKeyName: "reported_requests_organization_id_fkey";
3598
- columns: ["organization_id"];
3544
+ foreignKeyName: 'reported_requests_organization_id_fkey';
3545
+ columns: ['organization_id'];
3599
3546
  isOneToOne: false;
3600
- referencedRelation: "organizations";
3601
- referencedColumns: ["id"];
3547
+ referencedRelation: 'organizations';
3548
+ referencedColumns: ['id'];
3602
3549
  },
3603
3550
  {
3604
- foreignKeyName: "reported_requests_project_id_fkey";
3605
- columns: ["project_id"];
3551
+ foreignKeyName: 'reported_requests_project_id_fkey';
3552
+ columns: ['project_id'];
3606
3553
  isOneToOne: false;
3607
- referencedRelation: "prj_projects";
3608
- referencedColumns: ["id"];
3554
+ referencedRelation: 'prj_projects';
3555
+ referencedColumns: ['id'];
3609
3556
  },
3610
3557
  {
3611
- foreignKeyName: "reported_requests_task_id_fkey";
3612
- columns: ["task_id"];
3558
+ foreignKeyName: 'reported_requests_task_id_fkey';
3559
+ columns: ['task_id'];
3613
3560
  isOneToOne: false;
3614
- referencedRelation: "prj_tasks";
3615
- referencedColumns: ["id"];
3561
+ referencedRelation: 'prj_tasks';
3562
+ referencedColumns: ['id'];
3616
3563
  }
3617
3564
  ];
3618
3565
  };
@@ -3652,11 +3599,11 @@ type Database = {
3652
3599
  };
3653
3600
  Relationships: [
3654
3601
  {
3655
- foreignKeyName: "session_messages_session_id_fkey";
3656
- columns: ["session_id"];
3602
+ foreignKeyName: 'session_messages_session_id_fkey';
3603
+ columns: ['session_id'];
3657
3604
  isOneToOne: false;
3658
- referencedRelation: "sessions";
3659
- referencedColumns: ["session_id"];
3605
+ referencedRelation: 'sessions';
3606
+ referencedColumns: ['session_id'];
3660
3607
  }
3661
3608
  ];
3662
3609
  };
@@ -3711,18 +3658,18 @@ type Database = {
3711
3658
  };
3712
3659
  Relationships: [
3713
3660
  {
3714
- foreignKeyName: "fk_organization";
3715
- columns: ["organization_id"];
3661
+ foreignKeyName: 'fk_organization';
3662
+ columns: ['organization_id'];
3716
3663
  isOneToOne: false;
3717
- referencedRelation: "organizations";
3718
- referencedColumns: ["id"];
3664
+ referencedRelation: 'organizations';
3665
+ referencedColumns: ['id'];
3719
3666
  },
3720
3667
  {
3721
- foreignKeyName: "fk_user";
3722
- columns: ["user_id"];
3668
+ foreignKeyName: 'fk_user';
3669
+ columns: ['user_id'];
3723
3670
  isOneToOne: false;
3724
- referencedRelation: "users";
3725
- referencedColumns: ["id"];
3671
+ referencedRelation: 'users';
3672
+ referencedColumns: ['id'];
3726
3673
  }
3727
3674
  ];
3728
3675
  };
@@ -3798,11 +3745,11 @@ type Database = {
3798
3745
  };
3799
3746
  Relationships: [
3800
3747
  {
3801
- foreignKeyName: "task_schedules_organization_id_fkey";
3802
- columns: ["organization_id"];
3748
+ foreignKeyName: 'task_schedules_organization_id_fkey';
3749
+ columns: ['organization_id'];
3803
3750
  isOneToOne: false;
3804
- referencedRelation: "organizations";
3805
- referencedColumns: ["id"];
3751
+ referencedRelation: 'organizations';
3752
+ referencedColumns: ['id'];
3806
3753
  }
3807
3754
  ];
3808
3755
  };
@@ -3857,11 +3804,11 @@ type Database = {
3857
3804
  };
3858
3805
  Relationships: [
3859
3806
  {
3860
- foreignKeyName: "user_profiles_last_visited_org_fkey";
3861
- columns: ["last_visited_org"];
3807
+ foreignKeyName: 'user_profiles_last_visited_org_fkey';
3808
+ columns: ['last_visited_org'];
3862
3809
  isOneToOne: false;
3863
- referencedRelation: "organizations";
3864
- referencedColumns: ["id"];
3810
+ referencedRelation: 'organizations';
3811
+ referencedColumns: ['id'];
3865
3812
  }
3866
3813
  ];
3867
3814
  };
@@ -3910,11 +3857,11 @@ type Database = {
3910
3857
  };
3911
3858
  Relationships: [
3912
3859
  {
3913
- foreignKeyName: "webhook_endpoints_organization_id_fkey";
3914
- columns: ["organization_id"];
3860
+ foreignKeyName: 'webhook_endpoints_organization_id_fkey';
3861
+ columns: ['organization_id'];
3915
3862
  isOneToOne: false;
3916
- referencedRelation: "organizations";
3917
- referencedColumns: ["id"];
3863
+ referencedRelation: 'organizations';
3864
+ referencedColumns: ['id'];
3918
3865
  }
3919
3866
  ];
3920
3867
  };
@@ -4207,7 +4154,6 @@ interface AcqList {
4207
4154
  organizationId: string;
4208
4155
  name: string;
4209
4156
  description: string | null;
4210
- type: string;
4211
4157
  batchIds: string[];
4212
4158
  instantlyCampaignId: string | null;
4213
4159
  status: ListStatus;
@@ -4330,609 +4276,6 @@ interface AcqDealTask {
4330
4276
  createdByUserId: string | null;
4331
4277
  }
4332
4278
 
4333
- /**
4334
- * Lead Service Types
4335
- * CRUD operation types for the acquisition platform (lists, companies, contacts, deals)
4336
- *
4337
- * Implementation: apps/api/src/acquisition/lead-service.ts (LeadService class)
4338
- */
4339
-
4340
- interface PaginatedResult<T> {
4341
- data: T[];
4342
- total: number;
4343
- limit: number;
4344
- offset: number;
4345
- }
4346
- interface CreateListParams {
4347
- organizationId: string;
4348
- name: string;
4349
- description?: string;
4350
- type?: string;
4351
- batchIds?: string[];
4352
- instantlyCampaignId?: string;
4353
- status?: ListStatus;
4354
- metadata?: Record<string, unknown>;
4355
- scrapingConfig?: ScrapingConfig;
4356
- icp?: IcpRubric;
4357
- pipelineConfig?: PipelineConfig;
4358
- }
4359
- interface UpdateListParams {
4360
- name?: string;
4361
- description?: string;
4362
- batchIds?: string[];
4363
- }
4364
- interface CreateCompanyParams {
4365
- organizationId: string;
4366
- name: string;
4367
- domain?: string;
4368
- linkedinUrl?: string;
4369
- website?: string;
4370
- numEmployees?: number;
4371
- foundedYear?: number;
4372
- locationCity?: string;
4373
- locationState?: string;
4374
- category?: string;
4375
- source?: string;
4376
- batchId?: string;
4377
- verticalResearch?: string;
4378
- }
4379
- interface UpdateCompanyParams {
4380
- name?: string;
4381
- domain?: string;
4382
- linkedinUrl?: string;
4383
- website?: string;
4384
- numEmployees?: number;
4385
- foundedYear?: number;
4386
- locationCity?: string;
4387
- locationState?: string;
4388
- category?: string;
4389
- segment?: string;
4390
- pipelineStatus?: Record<string, unknown>;
4391
- enrichmentData?: Record<string, unknown>;
4392
- source?: string;
4393
- batchId?: string;
4394
- status?: 'active' | 'invalid';
4395
- verticalResearch?: string | null;
4396
- /** Track A: flat qualification score column (null until a scoring rubric is defined) */
4397
- qualificationScore?: number | null;
4398
- /** Track A: flat qualification signals jsonb — mirrors the former pipeline_status.qualification shape */
4399
- qualificationSignals?: Record<string, unknown> | null;
4400
- /** Track A: key identifying the rubric used for qualification */
4401
- qualificationRubricKey?: string | null;
4402
- }
4403
- type UpsertCompanyParams = CreateCompanyParams;
4404
- interface CompanyFilters {
4405
- listId?: string;
4406
- search?: string;
4407
- domain?: string;
4408
- website?: string;
4409
- segment?: string;
4410
- category?: string;
4411
- pipelineStatus?: Record<string, unknown>;
4412
- /** Exclude companies whose pipeline_status contains this value (PostgREST NOT contains) */
4413
- pipelineStatusNot?: Record<string, unknown>;
4414
- batchId?: string;
4415
- status?: 'active' | 'invalid';
4416
- includeAll?: boolean;
4417
- excludeColumns?: Array<'enrichmentData' | 'pipelineStatus'>;
4418
- }
4419
- interface CreateContactParams {
4420
- organizationId: string;
4421
- email: string;
4422
- companyId?: string;
4423
- firstName?: string;
4424
- lastName?: string;
4425
- linkedinUrl?: string;
4426
- title?: string;
4427
- source?: string;
4428
- sourceId?: string;
4429
- batchId?: string;
4430
- }
4431
- interface UpdateContactParams {
4432
- companyId?: string;
4433
- emailValid?: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN';
4434
- firstName?: string;
4435
- lastName?: string;
4436
- linkedinUrl?: string;
4437
- title?: string;
4438
- headline?: string;
4439
- filterReason?: string;
4440
- openingLine?: string;
4441
- pipelineStatus?: Record<string, unknown>;
4442
- enrichmentData?: Record<string, unknown>;
4443
- status?: 'active' | 'invalid';
4444
- }
4445
- type UpsertContactParams = CreateContactParams;
4446
- interface ContactFilters {
4447
- listId?: string;
4448
- search?: string;
4449
- openingLineIsNull?: boolean;
4450
- pipelineStatus?: Record<string, unknown>;
4451
- batchId?: string;
4452
- contactStatus?: 'active' | 'invalid';
4453
- }
4454
- interface UpsertDealParams {
4455
- organizationId: string;
4456
- /** Contact email — dedupe key together with organization_id */
4457
- contactEmail: string;
4458
- /** Optional contact ID for foreign key join */
4459
- contactId?: string;
4460
- /** Campaign list that generated this deal (FK to acq_lists) */
4461
- sourceListId?: string;
4462
- /** Deal origin: 'instantly', 'referral', 'inbound', 'manual' */
4463
- sourceType?: 'instantly' | 'referral' | 'inbound' | 'manual';
4464
- /** Optional discovery data JSONB to set on upsert */
4465
- discoveryData?: unknown;
4466
- /** Optional proposal data JSONB to set on upsert */
4467
- proposalData?: unknown;
4468
- }
4469
- interface UpdateDiscoveryDataParams {
4470
- organizationId: string;
4471
- contactEmail: string;
4472
- discoveryData: unknown;
4473
- submittedBy?: string;
4474
- }
4475
- interface UpdateProposalDataParams {
4476
- organizationId: string;
4477
- contactEmail: string;
4478
- proposalData: unknown;
4479
- proposalPdfUrl?: string;
4480
- }
4481
- interface MarkProposalSentParams {
4482
- organizationId: string;
4483
- contactEmail: string;
4484
- }
4485
- interface MarkProposalReviewedParams {
4486
- organizationId: string;
4487
- contactEmail: string;
4488
- reviewedBy: string;
4489
- proposalData?: unknown;
4490
- }
4491
- interface UpdateCloseLostReasonParams {
4492
- organizationId: string;
4493
- dealId: string;
4494
- reason: string;
4495
- }
4496
- interface UpdateFeesParams {
4497
- organizationId: string;
4498
- contactEmail?: string;
4499
- dealId?: string;
4500
- initialFee?: number;
4501
- monthlyFee?: number;
4502
- }
4503
- interface TransitionItemParams {
4504
- organizationId: string;
4505
- dealId: string;
4506
- pipelineKey: string;
4507
- stageKey: string;
4508
- stateKey?: string | null;
4509
- reason?: string;
4510
- expectedUpdatedAt?: string;
4511
- }
4512
- interface SetContactNurtureParams {
4513
- organizationId: string;
4514
- contactEmail: string;
4515
- nurture?: boolean;
4516
- }
4517
- interface CancelSchedulesAndHitlByEmailParams {
4518
- organizationId: string;
4519
- email: string;
4520
- }
4521
- interface CancelHitlByDealIdParams {
4522
- organizationId: string;
4523
- dealId: string;
4524
- }
4525
- interface ClearDealFieldsParams {
4526
- organizationId: string;
4527
- contactEmail?: string;
4528
- dealId?: string;
4529
- fields: ('proposalPdfUrl' | 'proposalGeneratedAt' | 'initialFee' | 'monthlyFee' | 'closedLostReason' | 'closedLostAt' | 'discoveryData' | 'discoverySubmittedAt')[];
4530
- }
4531
- interface DeleteDealParams {
4532
- organizationId: string;
4533
- dealId: string;
4534
- }
4535
- interface GetDealByIdParams {
4536
- dealId: string;
4537
- organizationId: string;
4538
- }
4539
- interface GetContactByIdParams {
4540
- contactId: string;
4541
- organizationId: string;
4542
- }
4543
- interface GetCompanyByIdParams {
4544
- companyId: string;
4545
- organizationId: string;
4546
- }
4547
- interface UpsertSocialPostParams {
4548
- organizationId: string;
4549
- platform: string;
4550
- platformPostId: string;
4551
- authorName: string;
4552
- authorUrl?: string | null;
4553
- postTitle: string;
4554
- postText: string;
4555
- postUrl: string;
4556
- engagementCount?: number;
4557
- commentsCount?: number;
4558
- postedAt: string;
4559
- metadata?: Record<string, unknown>;
4560
- relevanceScore?: number;
4561
- matchedKeywords?: string[];
4562
- matchedQuery?: string | null;
4563
- initialDraft?: string | null;
4564
- finalResponse?: string | null;
4565
- sourceCategory?: string | null;
4566
- }
4567
- interface UpsertSocialPostsResult {
4568
- inserted: number;
4569
- duplicatesSkipped: number;
4570
- }
4571
- interface AcqDeal {
4572
- id: string;
4573
- organizationId: string;
4574
- contactEmail: string;
4575
- pipelineKey: string;
4576
- stageKey?: string | null;
4577
- stateKey?: string | null;
4578
- discoveryData?: Json | null;
4579
- proposalData?: Json | null;
4580
- proposalSentAt?: string | null;
4581
- proposalPdfUrl?: string | null;
4582
- signatureEnvelopeId?: string | null;
4583
- sourceListId?: string | null;
4584
- sourceType?: string | null;
4585
- activityLog: DealActivityEntry[];
4586
- createdAt: Date;
4587
- updatedAt: Date;
4588
- }
4589
- interface DealActivityEntry {
4590
- type: string;
4591
- title: string;
4592
- description?: string;
4593
- payload?: Record<string, unknown>;
4594
- occurredAt: string;
4595
- }
4596
- interface AcqDealNote {
4597
- id: string;
4598
- dealId: string;
4599
- organizationId: string;
4600
- authorUserId: string | null;
4601
- body: string;
4602
- createdAt: string;
4603
- updatedAt: string;
4604
- }
4605
- interface CreateDealNoteParams {
4606
- organizationId: string;
4607
- dealId: string;
4608
- body: string;
4609
- authorUserId?: string;
4610
- }
4611
- interface ListDealNotesParams {
4612
- organizationId: string;
4613
- dealId: string;
4614
- }
4615
- interface CreateDealTaskParams {
4616
- organizationId: string;
4617
- dealId: string;
4618
- title: string;
4619
- description?: string | null;
4620
- kind?: AcqDealTaskKind;
4621
- dueAt?: string | null;
4622
- assigneeUserId?: string | null;
4623
- createdByUserId?: string | null;
4624
- }
4625
- interface ListDealTasksParams {
4626
- organizationId: string;
4627
- dealId: string;
4628
- }
4629
- interface ListDealTasksDueParams {
4630
- organizationId: string;
4631
- assigneeUserId?: string | null;
4632
- /** Window filter: 'overdue' = past due, 'today' = due today only, 'today_and_overdue' (default) = both, 'upcoming' = future */
4633
- window?: 'overdue' | 'today' | 'today_and_overdue' | 'upcoming';
4634
- }
4635
- interface CompleteDealTaskParams {
4636
- organizationId: string;
4637
- taskId: string;
4638
- completedByUserId: string | null;
4639
- }
4640
- interface RecordDealActivityParams {
4641
- organizationId: string;
4642
- dealId: string;
4643
- type: string;
4644
- title: string;
4645
- description?: string;
4646
- payload?: Record<string, unknown>;
4647
- }
4648
- interface DealStageSummary {
4649
- stage: string;
4650
- count: number;
4651
- oldestUpdatedAt: string | null;
4652
- newestUpdatedAt: string | null;
4653
- }
4654
- interface StaleDeal {
4655
- id: string;
4656
- contactEmail: string;
4657
- stageKey: string;
4658
- updatedAt: string;
4659
- daysStale: number;
4660
- }
4661
- interface DealPipelineAnalytics {
4662
- totalDeals: number;
4663
- stageSummary: DealStageSummary[];
4664
- staleDeals: StaleDeal[];
4665
- recentActivity: AcqDeal[];
4666
- }
4667
- interface DealFilters {
4668
- stage?: string;
4669
- search?: string;
4670
- limit?: number;
4671
- offset?: number;
4672
- }
4673
- interface AddContactsToListParams {
4674
- organizationId: string;
4675
- listId: string;
4676
- contactIds: string[];
4677
- }
4678
- interface AddContactsToListResult {
4679
- added: number;
4680
- alreadyExisted: number;
4681
- }
4682
- interface UpdateCompanyStageParams {
4683
- organizationId: string;
4684
- listId: string;
4685
- companyId: string;
4686
- stage: string;
4687
- executionId?: string;
4688
- }
4689
- interface UpdateContactStageParams {
4690
- organizationId: string;
4691
- listId: string;
4692
- contactId: string;
4693
- stage: string;
4694
- executionId?: string;
4695
- }
4696
- interface RecordListExecutionParams {
4697
- organizationId: string;
4698
- listId: string;
4699
- executionId: string;
4700
- configSnapshot?: Record<string, unknown>;
4701
- }
4702
- interface BulkImportParams {
4703
- organizationId: string;
4704
- contacts: CreateContactParams[];
4705
- listId?: string;
4706
- }
4707
- interface BulkImportResult {
4708
- created: number;
4709
- updated: number;
4710
- errors: Array<{
4711
- email: string;
4712
- error: string;
4713
- }>;
4714
- }
4715
- interface BulkImportCompanyEntry {
4716
- name: string;
4717
- domain: string;
4718
- website?: string;
4719
- locationCity?: string;
4720
- locationState?: string;
4721
- category?: string;
4722
- source?: string;
4723
- enrichmentData?: Record<string, unknown>;
4724
- pipelineStatus?: Record<string, unknown>;
4725
- }
4726
- interface BulkImportCompaniesParams {
4727
- organizationId: string;
4728
- batchId: string;
4729
- companies: BulkImportCompanyEntry[];
4730
- }
4731
- interface BulkImportCompaniesResult {
4732
- created: number;
4733
- skipped: number;
4734
- errors: Array<{
4735
- companyName: string;
4736
- error: string;
4737
- }>;
4738
- }
4739
-
4740
- /**
4741
- * Origin resource type - where an execution/task originated from.
4742
- * Used for audit trails and tracking execution lineage.
4743
- */
4744
- type OriginResourceType = 'agent' | 'workflow' | 'scheduler' | 'api';
4745
-
4746
- /**
4747
- * Target for schedule execution - identifies what resource to execute.
4748
- * Unlike ExecutionTarget, payload is NOT included here because schedules
4749
- * store payload in the scheduleConfig (varies per step/item).
4750
- */
4751
- interface ScheduleTarget {
4752
- resourceType: 'agent' | 'workflow';
4753
- resourceId: string;
4754
- }
4755
- /**
4756
- * Optional origin tracking for schedules.
4757
- * Unlike OriginTracking (which is required), these fields are all optional
4758
- * for schedules created directly via API (not triggered by another resource).
4759
- */
4760
- interface ScheduleOriginTracking {
4761
- originExecutionId?: string;
4762
- originResourceType?: OriginResourceType;
4763
- originResourceId?: string;
4764
- }
4765
- type TaskScheduleConfig = RecurringScheduleConfig | RelativeScheduleConfig | AbsoluteScheduleConfig;
4766
- interface RecurringScheduleConfig {
4767
- type: 'recurring';
4768
- cron?: string;
4769
- interval?: 'daily' | 'weekly' | 'monthly';
4770
- time?: string;
4771
- timezone: string;
4772
- payload: Record<string, unknown>;
4773
- endAt?: string | null;
4774
- overduePolicy?: 'skip' | 'execute';
4775
- }
4776
- interface RelativeScheduleConfig {
4777
- type: 'relative';
4778
- anchorAt: string;
4779
- anchorLabel?: string;
4780
- items: RelativeScheduleItem[];
4781
- overduePolicy?: 'skip' | 'execute';
4782
- }
4783
- interface RelativeScheduleItem {
4784
- offset: string;
4785
- payload: Record<string, unknown>;
4786
- label?: string;
4787
- }
4788
- interface AbsoluteScheduleConfig {
4789
- type: 'absolute';
4790
- items: AbsoluteScheduleItem[];
4791
- overduePolicy?: 'skip' | 'execute';
4792
- }
4793
- interface AbsoluteScheduleItem {
4794
- runAt: string;
4795
- payload: Record<string, unknown>;
4796
- label?: string;
4797
- }
4798
- interface TaskSchedule extends ScheduleOriginTracking {
4799
- id: string;
4800
- organizationId: string;
4801
- name: string;
4802
- description?: string;
4803
- target: ScheduleTarget;
4804
- scheduleConfig: TaskScheduleConfig;
4805
- nextRunAt?: Date;
4806
- currentStep: number;
4807
- status: 'active' | 'paused' | 'completed' | 'cancelled';
4808
- lastRunAt?: Date;
4809
- lastExecutionId?: string;
4810
- maxRetries: number;
4811
- idempotencyKey?: string;
4812
- createdAt: Date;
4813
- updatedAt: Date;
4814
- }
4815
- interface CreateScheduleInput extends ScheduleOriginTracking {
4816
- organizationId: string;
4817
- name: string;
4818
- description?: string;
4819
- target: ScheduleTarget;
4820
- scheduleConfig: TaskScheduleConfig;
4821
- maxRetries?: number;
4822
- idempotencyKey?: string;
4823
- metadata?: Record<string, unknown>;
4824
- }
4825
-
4826
- type NotificationRow = Database['public']['Tables']['notifications']['Row'];
4827
- interface CreateNotificationParams {
4828
- userId: string;
4829
- organizationId: string;
4830
- category: NotificationRow['category'];
4831
- title: string;
4832
- message: string;
4833
- actionUrl?: string;
4834
- }
4835
-
4836
- type ProjectRow = Database['public']['Tables']['prj_projects']['Row'];
4837
- type MilestoneRow = Database['public']['Tables']['prj_milestones']['Row'];
4838
- type TaskRow = Database['public']['Tables']['prj_tasks']['Row'];
4839
- type NoteRow = Database['public']['Tables']['prj_notes']['Row'];
4840
- interface ProjectWithCounts extends ProjectRow {
4841
- milestoneCount: number;
4842
- taskCount: number;
4843
- completedMilestones?: number;
4844
- completedTasks?: number;
4845
- }
4846
- interface ProjectDetail extends ProjectRow {
4847
- milestones: MilestoneRow[];
4848
- tasks: TaskRow[];
4849
- company: {
4850
- id: string;
4851
- name: string;
4852
- domain: string | null;
4853
- } | null;
4854
- }
4855
-
4856
- declare const ActivityEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4857
- type: z.ZodLiteral<"stage_change">;
4858
- timestamp: z.ZodString;
4859
- stageBefore: z.ZodString;
4860
- stageAfter: z.ZodString;
4861
- reason: z.ZodOptional<z.ZodString>;
4862
- }, z.core.$strip>, z.ZodObject<{
4863
- type: z.ZodLiteral<"state_change">;
4864
- timestamp: z.ZodString;
4865
- stateBefore: z.ZodNullable<z.ZodString>;
4866
- stateAfter: z.ZodNullable<z.ZodString>;
4867
- reason: z.ZodOptional<z.ZodString>;
4868
- }, z.core.$strip>, z.ZodObject<{
4869
- type: z.ZodLiteral<"action_taken">;
4870
- timestamp: z.ZodString;
4871
- actionKey: z.ZodString;
4872
- payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4873
- }, z.core.$strip>, z.ZodObject<{
4874
- type: z.ZodLiteral<"approval_created">;
4875
- timestamp: z.ZodString;
4876
- commandId: z.ZodString;
4877
- dealStageBefore: z.ZodOptional<z.ZodString>;
4878
- dealStageAfter: z.ZodOptional<z.ZodString>;
4879
- }, z.core.$strip>, z.ZodObject<{
4880
- type: z.ZodLiteral<"approval_resolved">;
4881
- timestamp: z.ZodString;
4882
- commandId: z.ZodString;
4883
- resolution: z.ZodEnum<{
4884
- superseded: "superseded";
4885
- }>;
4886
- originResourceType: z.ZodOptional<z.ZodString>;
4887
- }, z.core.$strip>, z.ZodObject<{
4888
- type: z.ZodLiteral<"approval_stale">;
4889
- timestamp: z.ZodString;
4890
- commandId: z.ZodString;
4891
- dealStageBefore: z.ZodOptional<z.ZodString>;
4892
- dealStageAfter: z.ZodOptional<z.ZodString>;
4893
- }, z.core.$strip>, z.ZodObject<{
4894
- type: z.ZodLiteral<"task_created">;
4895
- timestamp: z.ZodString;
4896
- taskId: z.ZodString;
4897
- }, z.core.$strip>, z.ZodObject<{
4898
- type: z.ZodLiteral<"deal_created">;
4899
- timestamp: z.ZodString;
4900
- }, z.core.$strip>], "type">;
4901
- type ActivityEvent = z.infer<typeof ActivityEventSchema>;
4902
-
4903
- interface Action {
4904
- key: string;
4905
- label: string;
4906
- payloadSchema?: z.ZodTypeAny;
4907
- }
4908
- interface ActionDef {
4909
- key: string;
4910
- label: string;
4911
- isAvailableFor: (deal: AcqDealRow) => boolean;
4912
- workflowId: string;
4913
- payloadSchema?: z.ZodTypeAny;
4914
- }
4915
- declare const DEFAULT_CRM_ACTIONS: ActionDef[];
4916
- declare function deriveActions(deal: AcqDealRow, actions?: ActionDef[]): Action[];
4917
-
4918
- /**
4919
- * Canonical vocabulary for `acq_touchpoints.kind`.
4920
- * DB CHECK constraint was dropped (Decision #9); validation lives here.
4921
- * Subtype/intent detail (e.g. triggered_by_action, subtype) goes in the touchpoint `payload` JSONB.
4922
- */
4923
-
4924
- declare const TouchpointKindSchema: z.ZodEnum<{
4925
- initial: "initial";
4926
- followup: "followup";
4927
- reply: "reply";
4928
- nudge: "nudge";
4929
- reminder: "reminder";
4930
- breakup: "breakup";
4931
- bounce: "bounce";
4932
- auto_reply: "auto_reply";
4933
- }>;
4934
- type TouchpointKind = z.infer<typeof TouchpointKindSchema>;
4935
-
4936
4279
  declare const DealSchemas: {
4937
4280
  DealIdParams: z.ZodObject<{
4938
4281
  dealId: z.ZodString;
@@ -5185,6 +4528,600 @@ declare const DealSchemas: {
5185
4528
  }, z.core.$strip>>;
5186
4529
  };
5187
4530
 
4531
+ /**
4532
+ * Lead Service Types
4533
+ * CRUD operation types for the acquisition platform (lists, companies, contacts, deals)
4534
+ *
4535
+ * Implementation: apps/api/src/acquisition/lead-service.ts (LeadService class)
4536
+ */
4537
+
4538
+ interface PaginatedResult<T> {
4539
+ data: T[];
4540
+ total: number;
4541
+ limit: number;
4542
+ offset: number;
4543
+ }
4544
+ interface CreateListParams {
4545
+ organizationId: string;
4546
+ name: string;
4547
+ description?: string;
4548
+ type?: string;
4549
+ batchIds?: string[];
4550
+ instantlyCampaignId?: string;
4551
+ status?: ListStatus;
4552
+ metadata?: Record<string, unknown>;
4553
+ scrapingConfig?: ScrapingConfig;
4554
+ icp?: IcpRubric;
4555
+ pipelineConfig?: PipelineConfig;
4556
+ }
4557
+ interface UpdateListParams {
4558
+ name?: string;
4559
+ description?: string;
4560
+ batchIds?: string[];
4561
+ }
4562
+ interface CreateCompanyParams {
4563
+ organizationId: string;
4564
+ name: string;
4565
+ domain?: string;
4566
+ linkedinUrl?: string;
4567
+ website?: string;
4568
+ numEmployees?: number;
4569
+ foundedYear?: number;
4570
+ locationCity?: string;
4571
+ locationState?: string;
4572
+ category?: string;
4573
+ source?: string;
4574
+ batchId?: string;
4575
+ verticalResearch?: string;
4576
+ }
4577
+ interface UpdateCompanyParams {
4578
+ name?: string;
4579
+ domain?: string;
4580
+ linkedinUrl?: string;
4581
+ website?: string;
4582
+ numEmployees?: number;
4583
+ foundedYear?: number;
4584
+ locationCity?: string;
4585
+ locationState?: string;
4586
+ category?: string;
4587
+ segment?: string;
4588
+ pipelineStatus?: Record<string, unknown>;
4589
+ enrichmentData?: Record<string, unknown>;
4590
+ source?: string;
4591
+ batchId?: string;
4592
+ status?: 'active' | 'invalid';
4593
+ verticalResearch?: string | null;
4594
+ /** Track A: flat qualification score column (null until a scoring rubric is defined) */
4595
+ qualificationScore?: number | null;
4596
+ /** Track A: flat qualification signals jsonb — mirrors the former pipeline_status.qualification shape */
4597
+ qualificationSignals?: Record<string, unknown> | null;
4598
+ /** Track A: key identifying the rubric used for qualification */
4599
+ qualificationRubricKey?: string | null;
4600
+ }
4601
+ type UpsertCompanyParams = CreateCompanyParams;
4602
+ interface CompanyFilters {
4603
+ listId?: string;
4604
+ search?: string;
4605
+ domain?: string;
4606
+ website?: string;
4607
+ segment?: string;
4608
+ category?: string;
4609
+ pipelineStatus?: Record<string, unknown>;
4610
+ /** Exclude companies whose pipeline_status contains this value (PostgREST NOT contains) */
4611
+ pipelineStatusNot?: Record<string, unknown>;
4612
+ batchId?: string;
4613
+ status?: 'active' | 'invalid';
4614
+ includeAll?: boolean;
4615
+ excludeColumns?: Array<'enrichmentData' | 'pipelineStatus'>;
4616
+ }
4617
+ interface CreateContactParams {
4618
+ organizationId: string;
4619
+ email: string;
4620
+ companyId?: string;
4621
+ firstName?: string;
4622
+ lastName?: string;
4623
+ linkedinUrl?: string;
4624
+ title?: string;
4625
+ source?: string;
4626
+ sourceId?: string;
4627
+ batchId?: string;
4628
+ }
4629
+ interface UpdateContactParams {
4630
+ companyId?: string;
4631
+ emailValid?: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN';
4632
+ firstName?: string;
4633
+ lastName?: string;
4634
+ linkedinUrl?: string;
4635
+ title?: string;
4636
+ headline?: string;
4637
+ filterReason?: string;
4638
+ openingLine?: string;
4639
+ pipelineStatus?: Record<string, unknown>;
4640
+ enrichmentData?: Record<string, unknown>;
4641
+ status?: 'active' | 'invalid';
4642
+ }
4643
+ type UpsertContactParams = CreateContactParams;
4644
+ interface ContactFilters {
4645
+ listId?: string;
4646
+ search?: string;
4647
+ openingLineIsNull?: boolean;
4648
+ pipelineStatus?: Record<string, unknown>;
4649
+ batchId?: string;
4650
+ contactStatus?: 'active' | 'invalid';
4651
+ }
4652
+ interface UpsertDealParams {
4653
+ organizationId: string;
4654
+ /** Contact email — dedupe key together with organization_id */
4655
+ contactEmail: string;
4656
+ /** Optional contact ID for foreign key join */
4657
+ contactId?: string;
4658
+ /** Campaign list that generated this deal (FK to acq_lists) */
4659
+ sourceListId?: string;
4660
+ /** Deal origin: 'instantly', 'referral', 'inbound', 'manual' */
4661
+ sourceType?: 'instantly' | 'referral' | 'inbound' | 'manual';
4662
+ /** Optional discovery data JSONB to set on upsert */
4663
+ discoveryData?: unknown;
4664
+ /** Optional proposal data JSONB to set on upsert */
4665
+ proposalData?: unknown;
4666
+ }
4667
+ interface UpdateDiscoveryDataParams {
4668
+ organizationId: string;
4669
+ contactEmail: string;
4670
+ discoveryData: unknown;
4671
+ submittedBy?: string;
4672
+ }
4673
+ interface UpdateProposalDataParams {
4674
+ organizationId: string;
4675
+ contactEmail: string;
4676
+ proposalData: unknown;
4677
+ proposalPdfUrl?: string;
4678
+ }
4679
+ interface MarkProposalSentParams {
4680
+ organizationId: string;
4681
+ contactEmail: string;
4682
+ }
4683
+ interface MarkProposalReviewedParams {
4684
+ organizationId: string;
4685
+ contactEmail: string;
4686
+ reviewedBy: string;
4687
+ proposalData?: unknown;
4688
+ }
4689
+ interface UpdateCloseLostReasonParams {
4690
+ organizationId: string;
4691
+ dealId: string;
4692
+ reason: string;
4693
+ }
4694
+ interface UpdateFeesParams {
4695
+ organizationId: string;
4696
+ contactEmail?: string;
4697
+ dealId?: string;
4698
+ initialFee?: number;
4699
+ monthlyFee?: number;
4700
+ }
4701
+ interface TransitionItemParams {
4702
+ organizationId: string;
4703
+ dealId: string;
4704
+ pipelineKey: string;
4705
+ stageKey: string;
4706
+ stateKey?: string | null;
4707
+ reason?: string;
4708
+ expectedUpdatedAt?: string;
4709
+ }
4710
+ interface SetContactNurtureParams {
4711
+ organizationId: string;
4712
+ contactEmail: string;
4713
+ nurture?: boolean;
4714
+ }
4715
+ interface CancelSchedulesAndHitlByEmailParams {
4716
+ organizationId: string;
4717
+ email: string;
4718
+ }
4719
+ interface CancelHitlByDealIdParams {
4720
+ organizationId: string;
4721
+ dealId: string;
4722
+ }
4723
+ interface ClearDealFieldsParams {
4724
+ organizationId: string;
4725
+ contactEmail?: string;
4726
+ dealId?: string;
4727
+ fields: ('proposalPdfUrl' | 'proposalGeneratedAt' | 'initialFee' | 'monthlyFee' | 'closedLostReason' | 'closedLostAt' | 'discoveryData' | 'discoverySubmittedAt')[];
4728
+ }
4729
+ interface DeleteDealParams {
4730
+ organizationId: string;
4731
+ dealId: string;
4732
+ }
4733
+ interface GetDealByIdParams {
4734
+ dealId: string;
4735
+ organizationId: string;
4736
+ }
4737
+ interface GetContactByIdParams {
4738
+ contactId: string;
4739
+ organizationId: string;
4740
+ }
4741
+ interface GetCompanyByIdParams {
4742
+ companyId: string;
4743
+ organizationId: string;
4744
+ }
4745
+ interface UpsertSocialPostParams {
4746
+ organizationId: string;
4747
+ platform: string;
4748
+ platformPostId: string;
4749
+ authorName: string;
4750
+ authorUrl?: string | null;
4751
+ postTitle: string;
4752
+ postText: string;
4753
+ postUrl: string;
4754
+ engagementCount?: number;
4755
+ commentsCount?: number;
4756
+ postedAt: string;
4757
+ metadata?: Record<string, unknown>;
4758
+ relevanceScore?: number;
4759
+ matchedKeywords?: string[];
4760
+ matchedQuery?: string | null;
4761
+ initialDraft?: string | null;
4762
+ finalResponse?: string | null;
4763
+ sourceCategory?: string | null;
4764
+ }
4765
+ interface UpsertSocialPostsResult {
4766
+ inserted: number;
4767
+ duplicatesSkipped: number;
4768
+ }
4769
+ interface AcqDeal {
4770
+ id: string;
4771
+ organizationId: string;
4772
+ contactEmail: string;
4773
+ pipelineKey: string;
4774
+ stageKey?: string | null;
4775
+ stateKey?: string | null;
4776
+ discoveryData?: Json | null;
4777
+ proposalData?: Json | null;
4778
+ proposalSentAt?: string | null;
4779
+ proposalPdfUrl?: string | null;
4780
+ signatureEnvelopeId?: string | null;
4781
+ sourceListId?: string | null;
4782
+ sourceType?: string | null;
4783
+ activityLog: DealActivityEntry[];
4784
+ createdAt: Date;
4785
+ updatedAt: Date;
4786
+ }
4787
+ interface DealActivityEntry {
4788
+ type: string;
4789
+ title: string;
4790
+ description?: string;
4791
+ payload?: Record<string, unknown>;
4792
+ occurredAt: string;
4793
+ }
4794
+ interface AcqDealNote {
4795
+ id: string;
4796
+ dealId: string;
4797
+ organizationId: string;
4798
+ authorUserId: string | null;
4799
+ body: string;
4800
+ createdAt: string;
4801
+ updatedAt: string;
4802
+ }
4803
+ interface CreateDealNoteParams {
4804
+ organizationId: string;
4805
+ dealId: string;
4806
+ body: string;
4807
+ authorUserId?: string;
4808
+ }
4809
+ interface ListDealNotesParams {
4810
+ organizationId: string;
4811
+ dealId: string;
4812
+ }
4813
+ interface CreateDealTaskParams {
4814
+ organizationId: string;
4815
+ dealId: string;
4816
+ title: string;
4817
+ description?: string | null;
4818
+ kind?: AcqDealTaskKind;
4819
+ dueAt?: string | null;
4820
+ assigneeUserId?: string | null;
4821
+ createdByUserId?: string | null;
4822
+ }
4823
+ interface ListDealTasksParams {
4824
+ organizationId: string;
4825
+ dealId: string;
4826
+ }
4827
+ interface ListDealTasksDueParams {
4828
+ organizationId: string;
4829
+ assigneeUserId?: string | null;
4830
+ /** Window filter: 'overdue' = past due, 'today' = due today only, 'today_and_overdue' (default) = both, 'upcoming' = future */
4831
+ window?: 'overdue' | 'today' | 'today_and_overdue' | 'upcoming';
4832
+ }
4833
+ interface CompleteDealTaskParams {
4834
+ organizationId: string;
4835
+ taskId: string;
4836
+ completedByUserId: string | null;
4837
+ }
4838
+ interface RecordDealActivityParams {
4839
+ organizationId: string;
4840
+ dealId: string;
4841
+ type: string;
4842
+ title: string;
4843
+ description?: string;
4844
+ payload?: Record<string, unknown>;
4845
+ }
4846
+ interface DealStageSummary {
4847
+ stage: string;
4848
+ count: number;
4849
+ oldestUpdatedAt: string | null;
4850
+ newestUpdatedAt: string | null;
4851
+ }
4852
+ interface StaleDeal {
4853
+ id: string;
4854
+ contactEmail: string;
4855
+ stageKey: string;
4856
+ updatedAt: string;
4857
+ daysStale: number;
4858
+ }
4859
+ interface DealPipelineAnalytics {
4860
+ totalDeals: number;
4861
+ stageSummary: DealStageSummary[];
4862
+ staleDeals: StaleDeal[];
4863
+ recentActivity: AcqDeal[];
4864
+ }
4865
+ interface DealFilters {
4866
+ stage?: string;
4867
+ search?: string;
4868
+ limit?: number;
4869
+ offset?: number;
4870
+ }
4871
+ interface AddContactsToListParams {
4872
+ organizationId: string;
4873
+ listId: string;
4874
+ contactIds: string[];
4875
+ }
4876
+ interface AddContactsToListResult {
4877
+ added: number;
4878
+ alreadyExisted: number;
4879
+ }
4880
+ interface UpdateCompanyStageParams {
4881
+ organizationId: string;
4882
+ listId: string;
4883
+ companyId: string;
4884
+ stage: string;
4885
+ executionId?: string;
4886
+ }
4887
+ interface UpdateContactStageParams {
4888
+ organizationId: string;
4889
+ listId: string;
4890
+ contactId: string;
4891
+ stage: string;
4892
+ executionId?: string;
4893
+ }
4894
+ interface AddCompaniesToListParams {
4895
+ organizationId: string;
4896
+ listId: string;
4897
+ companyIds: string[];
4898
+ }
4899
+ interface AddCompaniesToListResult {
4900
+ added: number;
4901
+ alreadyExisted: number;
4902
+ }
4903
+ interface RecordListExecutionParams {
4904
+ organizationId: string;
4905
+ listId: string;
4906
+ executionId: string;
4907
+ configSnapshot?: Record<string, unknown>;
4908
+ }
4909
+ interface BulkImportParams {
4910
+ organizationId: string;
4911
+ contacts: CreateContactParams[];
4912
+ listId?: string;
4913
+ }
4914
+ interface BulkImportResult {
4915
+ created: number;
4916
+ updated: number;
4917
+ errors: Array<{
4918
+ email: string;
4919
+ error: string;
4920
+ }>;
4921
+ }
4922
+ interface BulkImportCompanyEntry {
4923
+ name: string;
4924
+ domain: string;
4925
+ website?: string;
4926
+ locationCity?: string;
4927
+ locationState?: string;
4928
+ category?: string;
4929
+ source?: string;
4930
+ enrichmentData?: Record<string, unknown>;
4931
+ pipelineStatus?: Record<string, unknown>;
4932
+ }
4933
+ interface BulkImportCompaniesParams {
4934
+ organizationId: string;
4935
+ batchId: string;
4936
+ companies: BulkImportCompanyEntry[];
4937
+ }
4938
+ interface BulkImportCompaniesResult {
4939
+ created: number;
4940
+ skipped: number;
4941
+ errors: Array<{
4942
+ companyName: string;
4943
+ error: string;
4944
+ }>;
4945
+ }
4946
+
4947
+ /**
4948
+ * Origin resource type - where an execution/task originated from.
4949
+ * Used for audit trails and tracking execution lineage.
4950
+ */
4951
+ type OriginResourceType = 'agent' | 'workflow' | 'scheduler' | 'api';
4952
+
4953
+ /**
4954
+ * Target for schedule execution - identifies what resource to execute.
4955
+ * Unlike ExecutionTarget, payload is NOT included here because schedules
4956
+ * store payload in the scheduleConfig (varies per step/item).
4957
+ */
4958
+ interface ScheduleTarget {
4959
+ resourceType: 'agent' | 'workflow';
4960
+ resourceId: string;
4961
+ }
4962
+ /**
4963
+ * Optional origin tracking for schedules.
4964
+ * Unlike OriginTracking (which is required), these fields are all optional
4965
+ * for schedules created directly via API (not triggered by another resource).
4966
+ */
4967
+ interface ScheduleOriginTracking {
4968
+ originExecutionId?: string;
4969
+ originResourceType?: OriginResourceType;
4970
+ originResourceId?: string;
4971
+ }
4972
+ type TaskScheduleConfig = RecurringScheduleConfig | RelativeScheduleConfig | AbsoluteScheduleConfig;
4973
+ interface RecurringScheduleConfig {
4974
+ type: 'recurring';
4975
+ cron?: string;
4976
+ interval?: 'daily' | 'weekly' | 'monthly';
4977
+ time?: string;
4978
+ timezone: string;
4979
+ payload: Record<string, unknown>;
4980
+ endAt?: string | null;
4981
+ overduePolicy?: 'skip' | 'execute';
4982
+ }
4983
+ interface RelativeScheduleConfig {
4984
+ type: 'relative';
4985
+ anchorAt: string;
4986
+ anchorLabel?: string;
4987
+ items: RelativeScheduleItem[];
4988
+ overduePolicy?: 'skip' | 'execute';
4989
+ }
4990
+ interface RelativeScheduleItem {
4991
+ offset: string;
4992
+ payload: Record<string, unknown>;
4993
+ label?: string;
4994
+ }
4995
+ interface AbsoluteScheduleConfig {
4996
+ type: 'absolute';
4997
+ items: AbsoluteScheduleItem[];
4998
+ overduePolicy?: 'skip' | 'execute';
4999
+ }
5000
+ interface AbsoluteScheduleItem {
5001
+ runAt: string;
5002
+ payload: Record<string, unknown>;
5003
+ label?: string;
5004
+ }
5005
+ interface TaskSchedule extends ScheduleOriginTracking {
5006
+ id: string;
5007
+ organizationId: string;
5008
+ name: string;
5009
+ description?: string;
5010
+ target: ScheduleTarget;
5011
+ scheduleConfig: TaskScheduleConfig;
5012
+ nextRunAt?: Date;
5013
+ currentStep: number;
5014
+ status: 'active' | 'paused' | 'completed' | 'cancelled';
5015
+ lastRunAt?: Date;
5016
+ lastExecutionId?: string;
5017
+ maxRetries: number;
5018
+ idempotencyKey?: string;
5019
+ createdAt: Date;
5020
+ updatedAt: Date;
5021
+ }
5022
+ interface CreateScheduleInput extends ScheduleOriginTracking {
5023
+ organizationId: string;
5024
+ name: string;
5025
+ description?: string;
5026
+ target: ScheduleTarget;
5027
+ scheduleConfig: TaskScheduleConfig;
5028
+ maxRetries?: number;
5029
+ idempotencyKey?: string;
5030
+ metadata?: Record<string, unknown>;
5031
+ }
5032
+
5033
+ type NotificationRow = Database['public']['Tables']['notifications']['Row'];
5034
+ interface CreateNotificationParams {
5035
+ userId: string;
5036
+ organizationId: string;
5037
+ category: NotificationRow['category'];
5038
+ title: string;
5039
+ message: string;
5040
+ actionUrl?: string;
5041
+ }
5042
+
5043
+ type ProjectRow = Database['public']['Tables']['prj_projects']['Row'];
5044
+ type MilestoneRow = Database['public']['Tables']['prj_milestones']['Row'];
5045
+ type TaskRow = Database['public']['Tables']['prj_tasks']['Row'];
5046
+ type NoteRow = Database['public']['Tables']['prj_notes']['Row'];
5047
+ interface ProjectWithCounts extends ProjectRow {
5048
+ milestoneCount: number;
5049
+ taskCount: number;
5050
+ completedMilestones?: number;
5051
+ completedTasks?: number;
5052
+ }
5053
+ interface ProjectDetail extends ProjectRow {
5054
+ milestones: MilestoneRow[];
5055
+ tasks: TaskRow[];
5056
+ company: {
5057
+ id: string;
5058
+ name: string;
5059
+ domain: string | null;
5060
+ } | null;
5061
+ }
5062
+
5063
+ declare const ActivityEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
5064
+ type: z.ZodLiteral<"stage_change">;
5065
+ timestamp: z.ZodString;
5066
+ stageBefore: z.ZodString;
5067
+ stageAfter: z.ZodString;
5068
+ reason: z.ZodOptional<z.ZodString>;
5069
+ }, z.core.$strip>, z.ZodObject<{
5070
+ type: z.ZodLiteral<"state_change">;
5071
+ timestamp: z.ZodString;
5072
+ stateBefore: z.ZodNullable<z.ZodString>;
5073
+ stateAfter: z.ZodNullable<z.ZodString>;
5074
+ reason: z.ZodOptional<z.ZodString>;
5075
+ }, z.core.$strip>, z.ZodObject<{
5076
+ type: z.ZodLiteral<"action_taken">;
5077
+ timestamp: z.ZodString;
5078
+ actionKey: z.ZodString;
5079
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5080
+ }, z.core.$strip>, z.ZodObject<{
5081
+ type: z.ZodLiteral<"approval_created">;
5082
+ timestamp: z.ZodString;
5083
+ commandId: z.ZodString;
5084
+ dealStageBefore: z.ZodOptional<z.ZodString>;
5085
+ dealStageAfter: z.ZodOptional<z.ZodString>;
5086
+ }, z.core.$strip>, z.ZodObject<{
5087
+ type: z.ZodLiteral<"approval_resolved">;
5088
+ timestamp: z.ZodString;
5089
+ commandId: z.ZodString;
5090
+ resolution: z.ZodEnum<{
5091
+ superseded: "superseded";
5092
+ }>;
5093
+ originResourceType: z.ZodOptional<z.ZodString>;
5094
+ }, z.core.$strip>, z.ZodObject<{
5095
+ type: z.ZodLiteral<"approval_stale">;
5096
+ timestamp: z.ZodString;
5097
+ commandId: z.ZodString;
5098
+ dealStageBefore: z.ZodOptional<z.ZodString>;
5099
+ dealStageAfter: z.ZodOptional<z.ZodString>;
5100
+ }, z.core.$strip>, z.ZodObject<{
5101
+ type: z.ZodLiteral<"task_created">;
5102
+ timestamp: z.ZodString;
5103
+ taskId: z.ZodString;
5104
+ }, z.core.$strip>, z.ZodObject<{
5105
+ type: z.ZodLiteral<"deal_created">;
5106
+ timestamp: z.ZodString;
5107
+ }, z.core.$strip>], "type">;
5108
+ type ActivityEvent = z.infer<typeof ActivityEventSchema>;
5109
+
5110
+ interface Action {
5111
+ key: string;
5112
+ label: string;
5113
+ payloadSchema?: z.ZodTypeAny;
5114
+ }
5115
+ interface ActionDef {
5116
+ key: string;
5117
+ label: string;
5118
+ isAvailableFor: (deal: AcqDealRow) => boolean;
5119
+ workflowId: string;
5120
+ payloadSchema?: z.ZodTypeAny;
5121
+ }
5122
+ declare const DEFAULT_CRM_ACTIONS: ActionDef[];
5123
+ declare function deriveActions(deal: AcqDealRow, actions?: ActionDef[]): Action[];
5124
+
5188
5125
  /**
5189
5126
  * A single CRM activity entry (note, stage change, or deal creation).
5190
5127
  * Matches the CrmActivityEntry interface from useRecentCrmActivity.ts.
@@ -7736,6 +7673,10 @@ type LeadToolMap = {
7736
7673
  params: Omit<AddContactsToListParams, 'organizationId'>;
7737
7674
  result: AddContactsToListResult;
7738
7675
  };
7676
+ addCompaniesToList: {
7677
+ params: Omit<AddCompaniesToListParams, 'organizationId'>;
7678
+ result: AddCompaniesToListResult;
7679
+ };
7739
7680
  updateCompanyStage: {
7740
7681
  params: Omit<UpdateCompanyStageParams, 'organizationId'>;
7741
7682
  result: void;
@@ -7969,23 +7910,6 @@ type LeadToolMap = {
7969
7910
  };
7970
7911
  result: UpsertSocialPostsResult;
7971
7912
  };
7972
- recordTouchpoint: {
7973
- params: {
7974
- contactId?: string;
7975
- listMemberId?: string;
7976
- listId?: string;
7977
- direction: 'inbound' | 'outbound';
7978
- channel: string;
7979
- kind: TouchpointKind;
7980
- payload?: Record<string, unknown>;
7981
- artifactId?: string;
7982
- sourceExecutionId?: string;
7983
- occurredAt?: string;
7984
- };
7985
- result: {
7986
- id: string;
7987
- };
7988
- };
7989
7913
  setDealStateKey: {
7990
7914
  params: {
7991
7915
  dealId: string;
@@ -8011,28 +7935,6 @@ type LeadToolMap = {
8011
7935
  };
8012
7936
  result: DealDetail | null;
8013
7937
  };
8014
- listDealTouchpoints: {
8015
- params: {
8016
- dealId: string;
8017
- kind?: string;
8018
- limit?: number;
8019
- };
8020
- result: Array<{
8021
- id: string;
8022
- organization_id: string;
8023
- contact_id: string | null;
8024
- list_id: string | null;
8025
- list_member_id: string | null;
8026
- direction: string;
8027
- channel: string;
8028
- kind: string;
8029
- payload: Record<string, unknown> | null;
8030
- artifact_id: string | null;
8031
- source_execution_id: string | null;
8032
- occurred_at: string;
8033
- created_at: string;
8034
- }>;
8035
- };
8036
7938
  };
8037
7939
  type ListToolMap = {
8038
7940
  getConfig: {