@elevasis/sdk 1.24.0 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +1178 -1039
- package/dist/index.d.ts +4760 -4567
- package/dist/index.js +989 -2332
- package/dist/node/index.d.ts +660 -1323
- package/dist/node/index.js +1 -1
- package/dist/test-utils/index.d.ts +4101 -4115
- package/dist/test-utils/index.js +1724 -3471
- package/dist/types/worker/index.d.ts +3 -2
- package/dist/types/worker/platform.d.ts +2 -2
- package/dist/worker/index.js +394 -2448
- package/package.json +2 -2
- package/reference/cli.mdx +1107 -808
- package/reference/scaffold/recipes/customize-crm-actions.md +45 -46
- package/reference/scaffold/recipes/extend-crm.md +253 -255
- package/reference/scaffold/recipes/index.md +43 -44
- package/reference/scaffold/reference/contracts.md +976 -1063
|
@@ -1581,54 +1581,24 @@ export type CrmPriorityBucketKey = 'needs_response' | 'follow_up_due' | 'waiting
|
|
|
1581
1581
|
### `CrmPriorityBucketDefinition`
|
|
1582
1582
|
|
|
1583
1583
|
```typescript
|
|
1584
|
-
export interface CrmPriorityBucketDefinition {
|
|
1585
|
-
bucketKey: CrmPriorityBucketKey
|
|
1586
|
-
label: string
|
|
1587
|
-
/** Lower ranks sort first in deal lists and pipeline columns. */
|
|
1588
|
-
rank: number
|
|
1589
|
-
/** UI color token. Consumers may map this to their design system. */
|
|
1590
|
-
color: string
|
|
1584
|
+
export interface CrmPriorityBucketDefinition {
|
|
1585
|
+
bucketKey: CrmPriorityBucketKey
|
|
1586
|
+
label: string
|
|
1587
|
+
/** Lower ranks sort first in deal lists and pipeline columns. */
|
|
1588
|
+
rank: number
|
|
1589
|
+
/** UI color token. Consumers may map this to their design system. */
|
|
1590
|
+
color: string
|
|
1591
1591
|
}
|
|
1592
1592
|
```
|
|
1593
1593
|
|
|
1594
1594
|
### `CrmPriorityRuleConfig`
|
|
1595
1595
|
|
|
1596
1596
|
```typescript
|
|
1597
|
-
export interface CrmPriorityRuleConfig {
|
|
1598
|
-
buckets: CrmPriorityBucketDefinition[]
|
|
1599
|
-
closedStageKeys: string[]
|
|
1600
|
-
followUpAfterDaysByStateKey: Record<string, number>
|
|
1601
|
-
staleAfterDays: number
|
|
1602
|
-
}
|
|
1603
|
-
```
|
|
1604
|
-
|
|
1605
|
-
### `CRM_PRIORITY_BUCKETS`
|
|
1606
|
-
|
|
1607
|
-
```typescript
|
|
1608
|
-
export const CRM_PRIORITY_BUCKETS: CrmPriorityBucketDefinition[] = [
|
|
1609
|
-
{ bucketKey: 'needs_response', label: 'Needs Response', rank: 10, color: 'red' },
|
|
1610
|
-
{ bucketKey: 'follow_up_due', label: 'Follow-up Due', rank: 20, color: 'orange' },
|
|
1611
|
-
{ bucketKey: 'waiting', label: 'Waiting', rank: 30, color: 'blue' },
|
|
1612
|
-
{ bucketKey: 'stale', label: 'Stale', rank: 40, color: 'gray' },
|
|
1613
|
-
{ bucketKey: 'closed_low', label: 'Closed', rank: 50, color: 'dark' }
|
|
1614
|
-
]
|
|
1615
|
-
```
|
|
1616
|
-
|
|
1617
|
-
### `DEFAULT_CRM_PRIORITY_RULE_CONFIG`
|
|
1618
|
-
|
|
1619
|
-
```typescript
|
|
1620
|
-
export const DEFAULT_CRM_PRIORITY_RULE_CONFIG: CrmPriorityRuleConfig = {
|
|
1621
|
-
buckets: CRM_PRIORITY_BUCKETS,
|
|
1622
|
-
closedStageKeys: ['closed_won', 'closed_lost'],
|
|
1623
|
-
followUpAfterDaysByStateKey: {
|
|
1624
|
-
discovery_link_sent: 3,
|
|
1625
|
-
discovery_nudging: 2,
|
|
1626
|
-
reply_sent: 3,
|
|
1627
|
-
followup_1_sent: 3,
|
|
1628
|
-
followup_2_sent: 5,
|
|
1629
|
-
followup_3_sent: 7
|
|
1630
|
-
},
|
|
1631
|
-
staleAfterDays: 14
|
|
1597
|
+
export interface CrmPriorityRuleConfig {
|
|
1598
|
+
buckets: CrmPriorityBucketDefinition[]
|
|
1599
|
+
closedStageKeys: string[]
|
|
1600
|
+
followUpAfterDaysByStateKey: Record<string, number>
|
|
1601
|
+
staleAfterDays: number
|
|
1632
1602
|
}
|
|
1633
1603
|
```
|
|
1634
1604
|
|
|
@@ -1647,242 +1617,242 @@ export const AcqDealTaskKindSchema = z.enum(['call', 'email', 'meeting', 'other'
|
|
|
1647
1617
|
### `DealIdParamsSchema`
|
|
1648
1618
|
|
|
1649
1619
|
```typescript
|
|
1650
|
-
export const DealIdParamsSchema = z.object({
|
|
1651
|
-
dealId: UuidSchema
|
|
1620
|
+
export const DealIdParamsSchema = z.object({
|
|
1621
|
+
dealId: UuidSchema
|
|
1652
1622
|
})
|
|
1653
1623
|
```
|
|
1654
1624
|
|
|
1655
1625
|
### `DealTaskIdParamsSchema`
|
|
1656
1626
|
|
|
1657
1627
|
```typescript
|
|
1658
|
-
export const DealTaskIdParamsSchema = z.object({
|
|
1659
|
-
dealId: UuidSchema,
|
|
1660
|
-
taskId: UuidSchema
|
|
1628
|
+
export const DealTaskIdParamsSchema = z.object({
|
|
1629
|
+
dealId: UuidSchema,
|
|
1630
|
+
taskId: UuidSchema
|
|
1661
1631
|
})
|
|
1662
1632
|
```
|
|
1663
1633
|
|
|
1664
1634
|
### `ListDealsQuerySchema`
|
|
1665
1635
|
|
|
1666
1636
|
```typescript
|
|
1667
|
-
export const ListDealsQuerySchema = z
|
|
1668
|
-
.object({
|
|
1669
|
-
stage: DealStageSchema.optional(),
|
|
1670
|
-
list: UuidSchema.optional(),
|
|
1671
|
-
batch: z.string().trim().min(1).max(255).optional(),
|
|
1672
|
-
staleSince: z.string().datetime().optional(),
|
|
1673
|
-
search: z.string().optional(),
|
|
1674
|
-
limit: z.coerce.number().int().positive().default(50),
|
|
1675
|
-
offset: z.coerce.number().int().min(0).default(0)
|
|
1676
|
-
})
|
|
1637
|
+
export const ListDealsQuerySchema = z
|
|
1638
|
+
.object({
|
|
1639
|
+
stage: DealStageSchema.optional(),
|
|
1640
|
+
list: UuidSchema.optional(),
|
|
1641
|
+
batch: z.string().trim().min(1).max(255).optional(),
|
|
1642
|
+
staleSince: z.string().datetime().optional(),
|
|
1643
|
+
search: z.string().optional(),
|
|
1644
|
+
limit: z.coerce.number().int().positive().default(50),
|
|
1645
|
+
offset: z.coerce.number().int().min(0).default(0)
|
|
1646
|
+
})
|
|
1677
1647
|
.strict()
|
|
1678
1648
|
```
|
|
1679
1649
|
|
|
1680
1650
|
### `DealLookupQuerySchema`
|
|
1681
1651
|
|
|
1682
1652
|
```typescript
|
|
1683
|
-
export const DealLookupQuerySchema = z
|
|
1684
|
-
.object({
|
|
1685
|
-
search: z.string().trim().min(1).max(200).optional(),
|
|
1686
|
-
limit: z.coerce.number().int().min(1).max(25).default(10)
|
|
1687
|
-
})
|
|
1653
|
+
export const DealLookupQuerySchema = z
|
|
1654
|
+
.object({
|
|
1655
|
+
search: z.string().trim().min(1).max(200).optional(),
|
|
1656
|
+
limit: z.coerce.number().int().min(1).max(25).default(10)
|
|
1657
|
+
})
|
|
1688
1658
|
.strict()
|
|
1689
1659
|
```
|
|
1690
1660
|
|
|
1691
1661
|
### `ListDealTasksDueQuerySchema`
|
|
1692
1662
|
|
|
1693
1663
|
```typescript
|
|
1694
|
-
export const ListDealTasksDueQuerySchema = z
|
|
1695
|
-
.object({
|
|
1696
|
-
window: z.enum(['overdue', 'today', 'today_and_overdue', 'upcoming']).optional(),
|
|
1697
|
-
assigneeUserId: UuidSchema.optional()
|
|
1698
|
-
})
|
|
1664
|
+
export const ListDealTasksDueQuerySchema = z
|
|
1665
|
+
.object({
|
|
1666
|
+
window: z.enum(['overdue', 'today', 'today_and_overdue', 'upcoming']).optional(),
|
|
1667
|
+
assigneeUserId: UuidSchema.optional()
|
|
1668
|
+
})
|
|
1699
1669
|
.strict()
|
|
1700
1670
|
```
|
|
1701
1671
|
|
|
1702
1672
|
### `CreateDealNoteRequestSchema`
|
|
1703
1673
|
|
|
1704
1674
|
```typescript
|
|
1705
|
-
export const CreateDealNoteRequestSchema = z
|
|
1706
|
-
.object({
|
|
1707
|
-
body: z.string().trim().min(1).max(10000)
|
|
1708
|
-
})
|
|
1675
|
+
export const CreateDealNoteRequestSchema = z
|
|
1676
|
+
.object({
|
|
1677
|
+
body: z.string().trim().min(1).max(10000)
|
|
1678
|
+
})
|
|
1709
1679
|
.strict()
|
|
1710
1680
|
```
|
|
1711
1681
|
|
|
1712
1682
|
### `CreateDealTaskRequestSchema`
|
|
1713
1683
|
|
|
1714
1684
|
```typescript
|
|
1715
|
-
export const CreateDealTaskRequestSchema = z
|
|
1716
|
-
.object({
|
|
1717
|
-
title: z.string().trim().min(1).max(255),
|
|
1718
|
-
description: z.string().nullable().optional(),
|
|
1719
|
-
kind: AcqDealTaskKindSchema.optional(),
|
|
1720
|
-
dueAt: z.string().datetime().nullable().optional(),
|
|
1721
|
-
assigneeUserId: UuidSchema.nullable().optional()
|
|
1722
|
-
})
|
|
1685
|
+
export const CreateDealTaskRequestSchema = z
|
|
1686
|
+
.object({
|
|
1687
|
+
title: z.string().trim().min(1).max(255),
|
|
1688
|
+
description: z.string().nullable().optional(),
|
|
1689
|
+
kind: AcqDealTaskKindSchema.optional(),
|
|
1690
|
+
dueAt: z.string().datetime().nullable().optional(),
|
|
1691
|
+
assigneeUserId: UuidSchema.nullable().optional()
|
|
1692
|
+
})
|
|
1723
1693
|
.strict()
|
|
1724
1694
|
```
|
|
1725
1695
|
|
|
1726
1696
|
### `TransitionItemRequestSchema`
|
|
1727
1697
|
|
|
1728
1698
|
```typescript
|
|
1729
|
-
export const TransitionItemRequestSchema = z
|
|
1730
|
-
.object({
|
|
1731
|
-
pipelineKey: z.string().min(1),
|
|
1732
|
-
stageKey: z.string().min(1),
|
|
1733
|
-
stateKey: z.string().min(1).nullable().optional(),
|
|
1734
|
-
reason: z.string().optional(),
|
|
1735
|
-
expectedUpdatedAt: z.string().datetime().optional()
|
|
1736
|
-
})
|
|
1699
|
+
export const TransitionItemRequestSchema = z
|
|
1700
|
+
.object({
|
|
1701
|
+
pipelineKey: z.string().min(1),
|
|
1702
|
+
stageKey: z.string().min(1),
|
|
1703
|
+
stateKey: z.string().min(1).nullable().optional(),
|
|
1704
|
+
reason: z.string().optional(),
|
|
1705
|
+
expectedUpdatedAt: z.string().datetime().optional()
|
|
1706
|
+
})
|
|
1737
1707
|
.strict()
|
|
1738
1708
|
```
|
|
1739
1709
|
|
|
1740
1710
|
### `ExecuteActionParamsSchema`
|
|
1741
1711
|
|
|
1742
1712
|
```typescript
|
|
1743
|
-
export const ExecuteActionParamsSchema = z
|
|
1744
|
-
.object({
|
|
1745
|
-
dealId: UuidSchema,
|
|
1746
|
-
actionKey: NonEmptyStringSchema
|
|
1747
|
-
})
|
|
1713
|
+
export const ExecuteActionParamsSchema = z
|
|
1714
|
+
.object({
|
|
1715
|
+
dealId: UuidSchema,
|
|
1716
|
+
actionKey: NonEmptyStringSchema
|
|
1717
|
+
})
|
|
1748
1718
|
.strict()
|
|
1749
1719
|
```
|
|
1750
1720
|
|
|
1751
1721
|
### `ExecuteActionRequestSchema`
|
|
1752
1722
|
|
|
1753
1723
|
```typescript
|
|
1754
|
-
export const ExecuteActionRequestSchema = z
|
|
1755
|
-
.object({
|
|
1756
|
-
payload: z.record(z.string(), z.unknown()).optional()
|
|
1757
|
-
})
|
|
1724
|
+
export const ExecuteActionRequestSchema = z
|
|
1725
|
+
.object({
|
|
1726
|
+
payload: z.record(z.string(), z.unknown()).optional()
|
|
1727
|
+
})
|
|
1758
1728
|
.strict()
|
|
1759
1729
|
```
|
|
1760
1730
|
|
|
1761
1731
|
### `DealContactSummarySchema`
|
|
1762
1732
|
|
|
1763
1733
|
```typescript
|
|
1764
|
-
/**
|
|
1765
|
-
* Contact summary nested inside DealListItem / DealDetailResponse.
|
|
1766
|
-
* Matches the joined shape returned by useDeals / useDealDetail Supabase queries.
|
|
1767
|
-
*/
|
|
1768
|
-
export const DealContactSummarySchema = z.object({
|
|
1769
|
-
id: z.string(),
|
|
1770
|
-
first_name: z.string().nullable(),
|
|
1771
|
-
last_name: z.string().nullable(),
|
|
1772
|
-
email: z.string(),
|
|
1773
|
-
title: z.string().nullable(),
|
|
1774
|
-
headline: z.string().nullable(),
|
|
1775
|
-
linkedin_url: z.string().nullable(),
|
|
1776
|
-
processing_state: ProcessingStateSchema.nullable(),
|
|
1777
|
-
enrichment_data: z.record(z.string(), z.unknown()).nullable(),
|
|
1778
|
-
company: z
|
|
1779
|
-
.object({
|
|
1780
|
-
id: z.string(),
|
|
1781
|
-
name: z.string(),
|
|
1782
|
-
domain: z.string().nullable(),
|
|
1783
|
-
website: z.string().nullable(),
|
|
1784
|
-
linkedin_url: z.string().nullable(),
|
|
1785
|
-
segment: z.string().nullable(),
|
|
1786
|
-
category: z.string().nullable(),
|
|
1787
|
-
num_employees: z.number().nullable()
|
|
1788
|
-
})
|
|
1789
|
-
.nullable()
|
|
1734
|
+
/**
|
|
1735
|
+
* Contact summary nested inside DealListItem / DealDetailResponse.
|
|
1736
|
+
* Matches the joined shape returned by useDeals / useDealDetail Supabase queries.
|
|
1737
|
+
*/
|
|
1738
|
+
export const DealContactSummarySchema = z.object({
|
|
1739
|
+
id: z.string(),
|
|
1740
|
+
first_name: z.string().nullable(),
|
|
1741
|
+
last_name: z.string().nullable(),
|
|
1742
|
+
email: z.string(),
|
|
1743
|
+
title: z.string().nullable(),
|
|
1744
|
+
headline: z.string().nullable(),
|
|
1745
|
+
linkedin_url: z.string().nullable(),
|
|
1746
|
+
processing_state: ProcessingStateSchema.nullable(),
|
|
1747
|
+
enrichment_data: z.record(z.string(), z.unknown()).nullable(),
|
|
1748
|
+
company: z
|
|
1749
|
+
.object({
|
|
1750
|
+
id: z.string(),
|
|
1751
|
+
name: z.string(),
|
|
1752
|
+
domain: z.string().nullable(),
|
|
1753
|
+
website: z.string().nullable(),
|
|
1754
|
+
linkedin_url: z.string().nullable(),
|
|
1755
|
+
segment: z.string().nullable(),
|
|
1756
|
+
category: z.string().nullable(),
|
|
1757
|
+
num_employees: z.number().nullable()
|
|
1758
|
+
})
|
|
1759
|
+
.nullable()
|
|
1790
1760
|
})
|
|
1791
1761
|
```
|
|
1792
1762
|
|
|
1793
1763
|
### `DealPrioritySchema`
|
|
1794
1764
|
|
|
1795
1765
|
```typescript
|
|
1796
|
-
export const DealPrioritySchema = z.object({
|
|
1797
|
-
bucketKey: z.enum(['needs_response', 'follow_up_due', 'waiting', 'stale', 'closed_low']),
|
|
1798
|
-
rank: z.number().int(),
|
|
1799
|
-
label: z.string(),
|
|
1800
|
-
color: z.string(),
|
|
1801
|
-
reason: z.string(),
|
|
1802
|
-
latestActivityAt: z.string().nullable(),
|
|
1803
|
-
nextActionAt: z.string().nullable()
|
|
1766
|
+
export const DealPrioritySchema = z.object({
|
|
1767
|
+
bucketKey: z.enum(['needs_response', 'follow_up_due', 'waiting', 'stale', 'closed_low']),
|
|
1768
|
+
rank: z.number().int(),
|
|
1769
|
+
label: z.string(),
|
|
1770
|
+
color: z.string(),
|
|
1771
|
+
reason: z.string(),
|
|
1772
|
+
latestActivityAt: z.string().nullable(),
|
|
1773
|
+
nextActionAt: z.string().nullable()
|
|
1804
1774
|
})
|
|
1805
1775
|
```
|
|
1806
1776
|
|
|
1807
1777
|
### `DealListItemSchema`
|
|
1808
1778
|
|
|
1809
1779
|
```typescript
|
|
1810
|
-
/**
|
|
1811
|
-
* Deal list item with joined contact (and company via contact).
|
|
1812
|
-
* Matches DealListItem from @repo/core types.
|
|
1813
|
-
*/
|
|
1814
|
-
export const DealListItemSchema = z.object({
|
|
1815
|
-
// acq_deals columns
|
|
1816
|
-
id: z.string(),
|
|
1817
|
-
organization_id: z.string(),
|
|
1818
|
-
client_id: z.string().nullable().optional(),
|
|
1819
|
-
contact_id: z.string().nullable(),
|
|
1820
|
-
contact_email: z.string(),
|
|
1821
|
-
pipeline_key: z.string(),
|
|
1822
|
-
stage_key: z.string().nullable(),
|
|
1823
|
-
state_key: z.string().nullable(),
|
|
1824
|
-
activity_log: z.unknown(),
|
|
1825
|
-
discovery_data: z.unknown().nullable(),
|
|
1826
|
-
discovery_submitted_at: z.string().nullable(),
|
|
1827
|
-
discovery_submitted_by: z.string().nullable(),
|
|
1828
|
-
proposal_data: z.unknown().nullable(),
|
|
1829
|
-
proposal_sent_at: z.string().nullable(),
|
|
1830
|
-
proposal_pdf_url: z.string().nullable(),
|
|
1831
|
-
signature_envelope_id: z.string().nullable(),
|
|
1832
|
-
source_list_id: z.string().nullable(),
|
|
1833
|
-
source_type: z.string().nullable(),
|
|
1834
|
-
initial_fee: z.number().nullable(),
|
|
1835
|
-
monthly_fee: z.number().nullable(),
|
|
1836
|
-
closed_lost_at: z.string().nullable(),
|
|
1837
|
-
closed_lost_reason: z.string().nullable(),
|
|
1838
|
-
created_at: z.string(),
|
|
1839
|
-
updated_at: z.string(),
|
|
1840
|
-
priority: DealPrioritySchema,
|
|
1841
|
-
ownership: z.enum(['us', 'them']).nullable(),
|
|
1842
|
-
nextAction: z.string().nullable(),
|
|
1843
|
-
// joined relation
|
|
1844
|
-
contact: DealContactSummarySchema.nullable()
|
|
1780
|
+
/**
|
|
1781
|
+
* Deal list item with joined contact (and company via contact).
|
|
1782
|
+
* Matches DealListItem from @repo/core types.
|
|
1783
|
+
*/
|
|
1784
|
+
export const DealListItemSchema = z.object({
|
|
1785
|
+
// acq_deals columns
|
|
1786
|
+
id: z.string(),
|
|
1787
|
+
organization_id: z.string(),
|
|
1788
|
+
client_id: z.string().nullable().optional(),
|
|
1789
|
+
contact_id: z.string().nullable(),
|
|
1790
|
+
contact_email: z.string(),
|
|
1791
|
+
pipeline_key: z.string(),
|
|
1792
|
+
stage_key: z.string().nullable(),
|
|
1793
|
+
state_key: z.string().nullable(),
|
|
1794
|
+
activity_log: z.unknown(),
|
|
1795
|
+
discovery_data: z.unknown().nullable(),
|
|
1796
|
+
discovery_submitted_at: z.string().nullable(),
|
|
1797
|
+
discovery_submitted_by: z.string().nullable(),
|
|
1798
|
+
proposal_data: z.unknown().nullable(),
|
|
1799
|
+
proposal_sent_at: z.string().nullable(),
|
|
1800
|
+
proposal_pdf_url: z.string().nullable(),
|
|
1801
|
+
signature_envelope_id: z.string().nullable(),
|
|
1802
|
+
source_list_id: z.string().nullable(),
|
|
1803
|
+
source_type: z.string().nullable(),
|
|
1804
|
+
initial_fee: z.number().nullable(),
|
|
1805
|
+
monthly_fee: z.number().nullable(),
|
|
1806
|
+
closed_lost_at: z.string().nullable(),
|
|
1807
|
+
closed_lost_reason: z.string().nullable(),
|
|
1808
|
+
created_at: z.string(),
|
|
1809
|
+
updated_at: z.string(),
|
|
1810
|
+
priority: DealPrioritySchema,
|
|
1811
|
+
ownership: z.enum(['us', 'them']).nullable(),
|
|
1812
|
+
nextAction: z.string().nullable(),
|
|
1813
|
+
// joined relation
|
|
1814
|
+
contact: DealContactSummarySchema.nullable()
|
|
1845
1815
|
})
|
|
1846
1816
|
```
|
|
1847
1817
|
|
|
1848
1818
|
### `DealListResponseSchema`
|
|
1849
1819
|
|
|
1850
1820
|
```typescript
|
|
1851
|
-
export const DealListResponseSchema = z.object({
|
|
1852
|
-
data: z.array(DealListItemSchema),
|
|
1853
|
-
total: z.number().int(),
|
|
1854
|
-
limit: z.number().int(),
|
|
1855
|
-
offset: z.number().int()
|
|
1821
|
+
export const DealListResponseSchema = z.object({
|
|
1822
|
+
data: z.array(DealListItemSchema),
|
|
1823
|
+
total: z.number().int(),
|
|
1824
|
+
limit: z.number().int(),
|
|
1825
|
+
offset: z.number().int()
|
|
1856
1826
|
})
|
|
1857
1827
|
```
|
|
1858
1828
|
|
|
1859
1829
|
### `DealDetailResponseSchema`
|
|
1860
1830
|
|
|
1861
1831
|
```typescript
|
|
1862
|
-
/**
|
|
1863
|
-
* Deal detail shape — currently the same as a list item (full joined record).
|
|
1864
|
-
* Additive fields keep existing DealListItem callers compatible.
|
|
1865
|
-
*/
|
|
1866
|
-
export const DealDetailResponseSchema = DealListItemSchema.extend({
|
|
1867
|
-
conversation: DealConversationSchema,
|
|
1868
|
-
lineage: DealLineageSchema.optional()
|
|
1832
|
+
/**
|
|
1833
|
+
* Deal detail shape — currently the same as a list item (full joined record).
|
|
1834
|
+
* Additive fields keep existing DealListItem callers compatible.
|
|
1835
|
+
*/
|
|
1836
|
+
export const DealDetailResponseSchema = DealListItemSchema.extend({
|
|
1837
|
+
conversation: DealConversationSchema,
|
|
1838
|
+
lineage: DealLineageSchema.optional()
|
|
1869
1839
|
})
|
|
1870
1840
|
```
|
|
1871
1841
|
|
|
1872
1842
|
### `DealNoteResponseSchema`
|
|
1873
1843
|
|
|
1874
1844
|
```typescript
|
|
1875
|
-
/**
|
|
1876
|
-
* Single acq_deal_notes row (camelCase API representation).
|
|
1877
|
-
*/
|
|
1878
|
-
export const DealNoteResponseSchema = z.object({
|
|
1879
|
-
id: z.string(),
|
|
1880
|
-
dealId: z.string(),
|
|
1881
|
-
organizationId: z.string(),
|
|
1882
|
-
authorUserId: z.string().nullable(),
|
|
1883
|
-
body: z.string(),
|
|
1884
|
-
createdAt: z.string(),
|
|
1885
|
-
updatedAt: z.string()
|
|
1845
|
+
/**
|
|
1846
|
+
* Single acq_deal_notes row (camelCase API representation).
|
|
1847
|
+
*/
|
|
1848
|
+
export const DealNoteResponseSchema = z.object({
|
|
1849
|
+
id: z.string(),
|
|
1850
|
+
dealId: z.string(),
|
|
1851
|
+
organizationId: z.string(),
|
|
1852
|
+
authorUserId: z.string().nullable(),
|
|
1853
|
+
body: z.string(),
|
|
1854
|
+
createdAt: z.string(),
|
|
1855
|
+
updatedAt: z.string()
|
|
1886
1856
|
})
|
|
1887
1857
|
```
|
|
1888
1858
|
|
|
@@ -1895,24 +1865,24 @@ export const DealNoteListResponseSchema = z.array(DealNoteResponseSchema)
|
|
|
1895
1865
|
### `DealTaskResponseSchema`
|
|
1896
1866
|
|
|
1897
1867
|
```typescript
|
|
1898
|
-
/**
|
|
1899
|
-
* Single acq_deal_tasks row (camelCase API representation).
|
|
1900
|
-
* Matches AcqDealTask domain type from types.ts.
|
|
1901
|
-
*/
|
|
1902
|
-
export const DealTaskResponseSchema = z.object({
|
|
1903
|
-
id: z.string(),
|
|
1904
|
-
organizationId: z.string(),
|
|
1905
|
-
dealId: z.string(),
|
|
1906
|
-
title: z.string(),
|
|
1907
|
-
description: z.string().nullable(),
|
|
1908
|
-
kind: AcqDealTaskKindSchema,
|
|
1909
|
-
dueAt: z.string().nullable(),
|
|
1910
|
-
assigneeUserId: z.string().nullable(),
|
|
1911
|
-
completedAt: z.string().nullable(),
|
|
1912
|
-
completedByUserId: z.string().nullable(),
|
|
1913
|
-
createdAt: z.string(),
|
|
1914
|
-
updatedAt: z.string(),
|
|
1915
|
-
createdByUserId: z.string().nullable()
|
|
1868
|
+
/**
|
|
1869
|
+
* Single acq_deal_tasks row (camelCase API representation).
|
|
1870
|
+
* Matches AcqDealTask domain type from types.ts.
|
|
1871
|
+
*/
|
|
1872
|
+
export const DealTaskResponseSchema = z.object({
|
|
1873
|
+
id: z.string(),
|
|
1874
|
+
organizationId: z.string(),
|
|
1875
|
+
dealId: z.string(),
|
|
1876
|
+
title: z.string(),
|
|
1877
|
+
description: z.string().nullable(),
|
|
1878
|
+
kind: AcqDealTaskKindSchema,
|
|
1879
|
+
dueAt: z.string().nullable(),
|
|
1880
|
+
assigneeUserId: z.string().nullable(),
|
|
1881
|
+
completedAt: z.string().nullable(),
|
|
1882
|
+
completedByUserId: z.string().nullable(),
|
|
1883
|
+
createdAt: z.string(),
|
|
1884
|
+
updatedAt: z.string(),
|
|
1885
|
+
createdByUserId: z.string().nullable()
|
|
1916
1886
|
})
|
|
1917
1887
|
```
|
|
1918
1888
|
|
|
@@ -1925,44 +1895,44 @@ export const DealTaskListResponseSchema = z.array(DealTaskResponseSchema)
|
|
|
1925
1895
|
### `DealSchemas`
|
|
1926
1896
|
|
|
1927
1897
|
```typescript
|
|
1928
|
-
export const DealSchemas = {
|
|
1929
|
-
// Primitives
|
|
1930
|
-
CrmStageKey: CrmStageKeySchema,
|
|
1931
|
-
CrmStateKey: CrmStateKeySchema,
|
|
1932
|
-
DealStage: DealStageSchema,
|
|
1933
|
-
|
|
1934
|
-
// Params
|
|
1935
|
-
DealIdParams: DealIdParamsSchema,
|
|
1936
|
-
DealTaskIdParams: DealTaskIdParamsSchema,
|
|
1937
|
-
|
|
1938
|
-
// Queries
|
|
1939
|
-
ListDealsQuery: ListDealsQuerySchema,
|
|
1940
|
-
DealLookupQuery: DealLookupQuerySchema,
|
|
1941
|
-
ListDealTasksDueQuery: ListDealTasksDueQuerySchema,
|
|
1942
|
-
|
|
1943
|
-
// Request bodies
|
|
1944
|
-
CreateDealNoteRequest: CreateDealNoteRequestSchema,
|
|
1945
|
-
CreateDealTaskRequest: CreateDealTaskRequestSchema,
|
|
1946
|
-
TransitionItemRequest: CrmTransitionItemRequestSchema,
|
|
1947
|
-
TransitionDealStateRequest: TransitionDealStateRequestSchema,
|
|
1948
|
-
ExecuteActionParams: ExecuteActionParamsSchema,
|
|
1949
|
-
ExecuteActionRequest: ExecuteActionRequestSchema,
|
|
1950
|
-
|
|
1951
|
-
// Responses
|
|
1952
|
-
DealPriority: DealPrioritySchema,
|
|
1953
|
-
DealListResponse: DealListResponseSchema,
|
|
1954
|
-
DealSummaryResponse: DealSummaryResponseSchema,
|
|
1955
|
-
DealLookupResponse: DealLookupResponseSchema,
|
|
1956
|
-
ConversationMessage: ConversationMessageSchema,
|
|
1957
|
-
DealLineageListRef: DealLineageListRefSchema,
|
|
1958
|
-
DealLineageProjectRef: DealLineageProjectRefSchema,
|
|
1959
|
-
DealLineageClientRef: DealLineageClientRefSchema,
|
|
1960
|
-
DealLineage: DealLineageSchema,
|
|
1961
|
-
DealDetailResponse: DealDetailResponseSchema,
|
|
1962
|
-
DealNoteResponse: DealNoteResponseSchema,
|
|
1963
|
-
DealNoteListResponse: DealNoteListResponseSchema,
|
|
1964
|
-
DealTaskResponse: DealTaskResponseSchema,
|
|
1965
|
-
DealTaskListResponse: DealTaskListResponseSchema
|
|
1898
|
+
export const DealSchemas = {
|
|
1899
|
+
// Primitives
|
|
1900
|
+
CrmStageKey: CrmStageKeySchema,
|
|
1901
|
+
CrmStateKey: CrmStateKeySchema,
|
|
1902
|
+
DealStage: DealStageSchema,
|
|
1903
|
+
|
|
1904
|
+
// Params
|
|
1905
|
+
DealIdParams: DealIdParamsSchema,
|
|
1906
|
+
DealTaskIdParams: DealTaskIdParamsSchema,
|
|
1907
|
+
|
|
1908
|
+
// Queries
|
|
1909
|
+
ListDealsQuery: ListDealsQuerySchema,
|
|
1910
|
+
DealLookupQuery: DealLookupQuerySchema,
|
|
1911
|
+
ListDealTasksDueQuery: ListDealTasksDueQuerySchema,
|
|
1912
|
+
|
|
1913
|
+
// Request bodies
|
|
1914
|
+
CreateDealNoteRequest: CreateDealNoteRequestSchema,
|
|
1915
|
+
CreateDealTaskRequest: CreateDealTaskRequestSchema,
|
|
1916
|
+
TransitionItemRequest: CrmTransitionItemRequestSchema,
|
|
1917
|
+
TransitionDealStateRequest: TransitionDealStateRequestSchema,
|
|
1918
|
+
ExecuteActionParams: ExecuteActionParamsSchema,
|
|
1919
|
+
ExecuteActionRequest: ExecuteActionRequestSchema,
|
|
1920
|
+
|
|
1921
|
+
// Responses
|
|
1922
|
+
DealPriority: DealPrioritySchema,
|
|
1923
|
+
DealListResponse: DealListResponseSchema,
|
|
1924
|
+
DealSummaryResponse: DealSummaryResponseSchema,
|
|
1925
|
+
DealLookupResponse: DealLookupResponseSchema,
|
|
1926
|
+
ConversationMessage: ConversationMessageSchema,
|
|
1927
|
+
DealLineageListRef: DealLineageListRefSchema,
|
|
1928
|
+
DealLineageProjectRef: DealLineageProjectRefSchema,
|
|
1929
|
+
DealLineageClientRef: DealLineageClientRefSchema,
|
|
1930
|
+
DealLineage: DealLineageSchema,
|
|
1931
|
+
DealDetailResponse: DealDetailResponseSchema,
|
|
1932
|
+
DealNoteResponse: DealNoteResponseSchema,
|
|
1933
|
+
DealNoteListResponse: DealNoteListResponseSchema,
|
|
1934
|
+
DealTaskResponse: DealTaskResponseSchema,
|
|
1935
|
+
DealTaskListResponse: DealTaskListResponseSchema
|
|
1966
1936
|
}
|
|
1967
1937
|
```
|
|
1968
1938
|
|
|
@@ -1988,79 +1958,22 @@ export interface ActionDef {
|
|
|
1988
1958
|
}
|
|
1989
1959
|
```
|
|
1990
1960
|
|
|
1991
|
-
### `DEFAULT_CRM_ACTIONS`
|
|
1992
|
-
|
|
1993
|
-
```typescript
|
|
1994
|
-
export const DEFAULT_CRM_ACTIONS: ActionDef[] = [
|
|
1995
|
-
crmAction('move_to_proposal', {
|
|
1996
|
-
isAvailableFor: (deal) => deal.stage_key === 'interested'
|
|
1997
|
-
}),
|
|
1998
|
-
crmAction('move_to_closing', {
|
|
1999
|
-
isAvailableFor: (deal) => deal.stage_key === 'proposal'
|
|
2000
|
-
}),
|
|
2001
|
-
crmAction('move_to_closed_won', {
|
|
2002
|
-
isAvailableFor: (deal) => deal.stage_key === 'closing'
|
|
2003
|
-
}),
|
|
2004
|
-
crmAction('move_to_closed_lost', {
|
|
2005
|
-
isAvailableFor: (deal) =>
|
|
2006
|
-
deal.stage_key === 'interested' || deal.stage_key === 'proposal' || deal.stage_key === 'closing'
|
|
2007
|
-
}),
|
|
2008
|
-
crmAction('move_to_nurturing', {
|
|
2009
|
-
isAvailableFor: (deal) =>
|
|
2010
|
-
deal.stage_key === 'interested' || deal.stage_key === 'proposal' || deal.stage_key === 'closing'
|
|
2011
|
-
}),
|
|
2012
|
-
crmAction('send_reply', {
|
|
2013
|
-
isAvailableFor: (deal) =>
|
|
2014
|
-
deal.stage_key === 'interested' &&
|
|
2015
|
-
isOurReplyAction(deal) &&
|
|
2016
|
-
(deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey ||
|
|
2017
|
-
deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey ||
|
|
2018
|
-
deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey),
|
|
2019
|
-
payloadSchema: SendReplyActionPayloadSchema
|
|
2020
|
-
}),
|
|
2021
|
-
crmAction('send_link', {
|
|
2022
|
-
isAvailableFor: (deal) =>
|
|
2023
|
-
deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey
|
|
2024
|
-
}),
|
|
2025
|
-
crmAction('send_nudge', {
|
|
2026
|
-
isAvailableFor: (deal) =>
|
|
2027
|
-
deal.stage_key === 'interested' &&
|
|
2028
|
-
(deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey ||
|
|
2029
|
-
deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey)
|
|
2030
|
-
}),
|
|
2031
|
-
{
|
|
2032
|
-
key: 'mark_no_show',
|
|
2033
|
-
label: 'Mark No-Show',
|
|
2034
|
-
isAvailableFor: (deal) =>
|
|
2035
|
-
deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey,
|
|
2036
|
-
// Mirrors the auto-timeout precedent in operations/sales/crm/pipeline/timeout-actions.ts:
|
|
2037
|
-
// both manual-click and timeout move the deal to closed_lost. The action_taken activity
|
|
2038
|
-
// event captures operator intent and distinguishes the manual variant from the timed one.
|
|
2039
|
-
workflowId: 'mark_no_show-workflow'
|
|
2040
|
-
},
|
|
2041
|
-
crmAction('rebook', {
|
|
2042
|
-
isAvailableFor: (deal) =>
|
|
2043
|
-
deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_BOOKING_CANCELLED_STATE.stateKey
|
|
2044
|
-
})
|
|
2045
|
-
]
|
|
2046
|
-
```
|
|
2047
|
-
|
|
2048
1961
|
### `CrmToolMap`
|
|
2049
1962
|
|
|
2050
1963
|
```typescript
|
|
2051
|
-
export type CrmToolMap = {
|
|
2052
|
-
getRecentActivity: { params: CrmRecentActivityParams; result: RecentActivityEntry[] }
|
|
2053
|
-
listDeals: { params: CrmListDealsParams; result: DealListItem[] }
|
|
2054
|
-
getDeal: { params: CrmGetDealParams; result: DealDetail | null }
|
|
2055
|
-
getDealByEmail: { params: CrmGetDealByEmailParams; result: DealDetail | null }
|
|
2056
|
-
createDealNote: { params: CrmDealNoteParams; result: AcqDealNote }
|
|
2057
|
-
listDealNotes: { params: Omit<ListDealNotesParams, 'organizationId'>; result: AcqDealNote[] }
|
|
2058
|
-
createDealTask: { params: CrmDealTaskParams; result: AcqDealTask }
|
|
2059
|
-
listDealTasks: { params: Omit<ListDealTasksParams, 'organizationId'>; result: AcqDealTask[] }
|
|
2060
|
-
listDealTasksDue: { params: CrmTaskDueParams; result: AcqDealTask[] }
|
|
2061
|
-
completeDealTask: { params: Omit<CompleteDealTaskParams, 'organizationId'>; result: AcqDealTask }
|
|
2062
|
-
recordActivity: { params: CrmRecordActivityParams; result: void }
|
|
2063
|
-
deleteDeal: { params: CrmDeleteDealParams; result: void }
|
|
1964
|
+
export type CrmToolMap = {
|
|
1965
|
+
getRecentActivity: { params: CrmRecentActivityParams; result: RecentActivityEntry[] }
|
|
1966
|
+
listDeals: { params: CrmListDealsParams; result: DealListItem[] }
|
|
1967
|
+
getDeal: { params: CrmGetDealParams; result: DealDetail | null }
|
|
1968
|
+
getDealByEmail: { params: CrmGetDealByEmailParams; result: DealDetail | null }
|
|
1969
|
+
createDealNote: { params: CrmDealNoteParams; result: AcqDealNote }
|
|
1970
|
+
listDealNotes: { params: Omit<ListDealNotesParams, 'organizationId'>; result: AcqDealNote[] }
|
|
1971
|
+
createDealTask: { params: CrmDealTaskParams; result: AcqDealTask }
|
|
1972
|
+
listDealTasks: { params: Omit<ListDealTasksParams, 'organizationId'>; result: AcqDealTask[] }
|
|
1973
|
+
listDealTasksDue: { params: CrmTaskDueParams; result: AcqDealTask[] }
|
|
1974
|
+
completeDealTask: { params: Omit<CompleteDealTaskParams, 'organizationId'>; result: AcqDealTask }
|
|
1975
|
+
recordActivity: { params: CrmRecordActivityParams; result: void }
|
|
1976
|
+
deleteDeal: { params: CrmDeleteDealParams; result: void }
|
|
2064
1977
|
}
|
|
2065
1978
|
```
|
|
2066
1979
|
|
|
@@ -2291,180 +2204,180 @@ export interface ListTelemetry {
|
|
|
2291
2204
|
### `ListStageCountsSchema`
|
|
2292
2205
|
|
|
2293
2206
|
```typescript
|
|
2294
|
-
export const ListStageCountsSchema = z.object({
|
|
2295
|
-
// Attempted counts by canonical lead-gen stage. The detailed status
|
|
2296
|
-
// distribution lives on ListProgress; telemetry keeps the overview payload small.
|
|
2297
|
-
stageCounts: z.object({
|
|
2298
|
-
populated: z.number().int(),
|
|
2299
|
-
extracted: z.number().int(),
|
|
2300
|
-
qualified: z.number().int(),
|
|
2301
|
-
discovered: z.number().int(),
|
|
2302
|
-
verified: z.number().int(),
|
|
2303
|
-
personalized: z.number().int(),
|
|
2304
|
-
uploaded: z.number().int()
|
|
2305
|
-
}),
|
|
2306
|
-
deliverability: z.object({
|
|
2307
|
-
valid: z.number().int(),
|
|
2308
|
-
risky: z.number().int(),
|
|
2309
|
-
invalid: z.number().int(),
|
|
2310
|
-
unknown: z.number().int(),
|
|
2311
|
-
bounced: z.number().int()
|
|
2312
|
-
})
|
|
2207
|
+
export const ListStageCountsSchema = z.object({
|
|
2208
|
+
// Attempted counts by canonical lead-gen stage. The detailed status
|
|
2209
|
+
// distribution lives on ListProgress; telemetry keeps the overview payload small.
|
|
2210
|
+
stageCounts: z.object({
|
|
2211
|
+
populated: z.number().int(),
|
|
2212
|
+
extracted: z.number().int(),
|
|
2213
|
+
qualified: z.number().int(),
|
|
2214
|
+
discovered: z.number().int(),
|
|
2215
|
+
verified: z.number().int(),
|
|
2216
|
+
personalized: z.number().int(),
|
|
2217
|
+
uploaded: z.number().int()
|
|
2218
|
+
}),
|
|
2219
|
+
deliverability: z.object({
|
|
2220
|
+
valid: z.number().int(),
|
|
2221
|
+
risky: z.number().int(),
|
|
2222
|
+
invalid: z.number().int(),
|
|
2223
|
+
unknown: z.number().int(),
|
|
2224
|
+
bounced: z.number().int()
|
|
2225
|
+
})
|
|
2313
2226
|
})
|
|
2314
2227
|
```
|
|
2315
2228
|
|
|
2316
2229
|
### `ListTelemetrySchema`
|
|
2317
2230
|
|
|
2318
2231
|
```typescript
|
|
2319
|
-
export const ListTelemetrySchema = z.object({
|
|
2320
|
-
listId: UuidSchema,
|
|
2321
|
-
totalCompanies: z.number().int(),
|
|
2322
|
-
totalContacts: z.number().int(),
|
|
2323
|
-
stageCounts: ListStageCountsSchema.shape.stageCounts,
|
|
2324
|
-
deliverability: ListStageCountsSchema.shape.deliverability,
|
|
2325
|
-
activeWorkflows: z.array(z.string()).optional()
|
|
2232
|
+
export const ListTelemetrySchema = z.object({
|
|
2233
|
+
listId: UuidSchema,
|
|
2234
|
+
totalCompanies: z.number().int(),
|
|
2235
|
+
totalContacts: z.number().int(),
|
|
2236
|
+
stageCounts: ListStageCountsSchema.shape.stageCounts,
|
|
2237
|
+
deliverability: ListStageCountsSchema.shape.deliverability,
|
|
2238
|
+
activeWorkflows: z.array(z.string()).optional()
|
|
2326
2239
|
})
|
|
2327
2240
|
```
|
|
2328
2241
|
|
|
2329
2242
|
### `ListIdParamsSchema`
|
|
2330
2243
|
|
|
2331
2244
|
```typescript
|
|
2332
|
-
export const ListIdParamsSchema = z.object({
|
|
2333
|
-
listId: UuidSchema
|
|
2245
|
+
export const ListIdParamsSchema = z.object({
|
|
2246
|
+
listId: UuidSchema
|
|
2334
2247
|
})
|
|
2335
2248
|
```
|
|
2336
2249
|
|
|
2337
2250
|
### `CreateListRequestSchema`
|
|
2338
2251
|
|
|
2339
2252
|
```typescript
|
|
2340
|
-
export const CreateListRequestSchema = z
|
|
2341
|
-
.object({
|
|
2342
|
-
name: z.string().trim().min(1).max(255),
|
|
2343
|
-
description: z.string().trim().nullable().optional(),
|
|
2344
|
-
status: ListStatusSchema.optional(),
|
|
2345
|
-
buildTemplateId: ProspectingBuildTemplateIdSchema.optional(),
|
|
2346
|
-
scrapingConfig: ScrapingConfigSchema.optional(),
|
|
2347
|
-
icp: IcpRubricSchema.optional(),
|
|
2348
|
-
pipelineConfig: PipelineConfigSchema.optional()
|
|
2349
|
-
})
|
|
2253
|
+
export const CreateListRequestSchema = z
|
|
2254
|
+
.object({
|
|
2255
|
+
name: z.string().trim().min(1).max(255),
|
|
2256
|
+
description: z.string().trim().nullable().optional(),
|
|
2257
|
+
status: ListStatusSchema.optional(),
|
|
2258
|
+
buildTemplateId: ProspectingBuildTemplateIdSchema.optional(),
|
|
2259
|
+
scrapingConfig: ScrapingConfigSchema.optional(),
|
|
2260
|
+
icp: IcpRubricSchema.optional(),
|
|
2261
|
+
pipelineConfig: PipelineConfigSchema.optional()
|
|
2262
|
+
})
|
|
2350
2263
|
.strict()
|
|
2351
2264
|
```
|
|
2352
2265
|
|
|
2353
2266
|
### `UpdateListRequestSchema`
|
|
2354
2267
|
|
|
2355
2268
|
```typescript
|
|
2356
|
-
export const UpdateListRequestSchema = z
|
|
2357
|
-
.object({
|
|
2358
|
-
name: z.string().trim().min(1).max(255).optional(),
|
|
2359
|
-
description: z.string().trim().nullable().optional(),
|
|
2360
|
-
batchIds: z.array(z.string()).optional(),
|
|
2361
|
-
buildTemplateId: ProspectingBuildTemplateIdSchema.optional(),
|
|
2362
|
-
confirmBuildTemplateChange: z.literal(true).optional()
|
|
2363
|
-
})
|
|
2364
|
-
.strict()
|
|
2365
|
-
.refine(
|
|
2366
|
-
(data) =>
|
|
2367
|
-
data.name !== undefined ||
|
|
2368
|
-
data.description !== undefined ||
|
|
2369
|
-
data.batchIds !== undefined ||
|
|
2370
|
-
data.buildTemplateId !== undefined,
|
|
2371
|
-
{
|
|
2372
|
-
message: 'At least one field (name, description, batchIds, or buildTemplateId) must be provided'
|
|
2373
|
-
}
|
|
2374
|
-
)
|
|
2375
|
-
.refine((data) => data.buildTemplateId === undefined || data.confirmBuildTemplateChange === true, {
|
|
2376
|
-
message: 'confirmBuildTemplateChange must be true when changing buildTemplateId',
|
|
2377
|
-
path: ['confirmBuildTemplateChange']
|
|
2269
|
+
export const UpdateListRequestSchema = z
|
|
2270
|
+
.object({
|
|
2271
|
+
name: z.string().trim().min(1).max(255).optional(),
|
|
2272
|
+
description: z.string().trim().nullable().optional(),
|
|
2273
|
+
batchIds: z.array(z.string()).optional(),
|
|
2274
|
+
buildTemplateId: ProspectingBuildTemplateIdSchema.optional(),
|
|
2275
|
+
confirmBuildTemplateChange: z.literal(true).optional()
|
|
2276
|
+
})
|
|
2277
|
+
.strict()
|
|
2278
|
+
.refine(
|
|
2279
|
+
(data) =>
|
|
2280
|
+
data.name !== undefined ||
|
|
2281
|
+
data.description !== undefined ||
|
|
2282
|
+
data.batchIds !== undefined ||
|
|
2283
|
+
data.buildTemplateId !== undefined,
|
|
2284
|
+
{
|
|
2285
|
+
message: 'At least one field (name, description, batchIds, or buildTemplateId) must be provided'
|
|
2286
|
+
}
|
|
2287
|
+
)
|
|
2288
|
+
.refine((data) => data.buildTemplateId === undefined || data.confirmBuildTemplateChange === true, {
|
|
2289
|
+
message: 'confirmBuildTemplateChange must be true when changing buildTemplateId',
|
|
2290
|
+
path: ['confirmBuildTemplateChange']
|
|
2378
2291
|
})
|
|
2379
2292
|
```
|
|
2380
2293
|
|
|
2381
2294
|
### `UpdateListConfigRequestSchema`
|
|
2382
2295
|
|
|
2383
2296
|
```typescript
|
|
2384
|
-
/**
|
|
2385
|
-
* Partial patch for the three jsonb config columns. UI sends only the edited
|
|
2386
|
-
* subtree; server writes the field as-is (no deep merge — each column is
|
|
2387
|
-
* replaced atomically when present in the patch).
|
|
2388
|
-
*/
|
|
2389
|
-
export const UpdateListConfigRequestSchema = z
|
|
2390
|
-
.object({
|
|
2391
|
-
scrapingConfig: ScrapingConfigSchema.partial().optional(),
|
|
2392
|
-
icp: IcpRubricSchema.partial().optional(),
|
|
2393
|
-
pipelineConfig: PipelineConfigSchema.partial().optional()
|
|
2394
|
-
})
|
|
2395
|
-
.strict()
|
|
2396
|
-
.refine((data) => data.scrapingConfig !== undefined || data.icp !== undefined || data.pipelineConfig !== undefined, {
|
|
2397
|
-
message: 'At least one of scrapingConfig, icp, or pipelineConfig must be provided'
|
|
2297
|
+
/**
|
|
2298
|
+
* Partial patch for the three jsonb config columns. UI sends only the edited
|
|
2299
|
+
* subtree; server writes the field as-is (no deep merge — each column is
|
|
2300
|
+
* replaced atomically when present in the patch).
|
|
2301
|
+
*/
|
|
2302
|
+
export const UpdateListConfigRequestSchema = z
|
|
2303
|
+
.object({
|
|
2304
|
+
scrapingConfig: ScrapingConfigSchema.partial().optional(),
|
|
2305
|
+
icp: IcpRubricSchema.partial().optional(),
|
|
2306
|
+
pipelineConfig: PipelineConfigSchema.partial().optional()
|
|
2307
|
+
})
|
|
2308
|
+
.strict()
|
|
2309
|
+
.refine((data) => data.scrapingConfig !== undefined || data.icp !== undefined || data.pipelineConfig !== undefined, {
|
|
2310
|
+
message: 'At least one of scrapingConfig, icp, or pipelineConfig must be provided'
|
|
2398
2311
|
})
|
|
2399
2312
|
```
|
|
2400
2313
|
|
|
2401
2314
|
### `AddCompaniesToListRequestSchema`
|
|
2402
2315
|
|
|
2403
2316
|
```typescript
|
|
2404
|
-
export const AddCompaniesToListRequestSchema = z
|
|
2405
|
-
.object({
|
|
2406
|
-
companyIds: z.array(UuidSchema).min(1).max(1000)
|
|
2407
|
-
})
|
|
2317
|
+
export const AddCompaniesToListRequestSchema = z
|
|
2318
|
+
.object({
|
|
2319
|
+
companyIds: z.array(UuidSchema).min(1).max(1000)
|
|
2320
|
+
})
|
|
2408
2321
|
.strict()
|
|
2409
2322
|
```
|
|
2410
2323
|
|
|
2411
2324
|
### `RemoveCompaniesFromListRequestSchema`
|
|
2412
2325
|
|
|
2413
2326
|
```typescript
|
|
2414
|
-
export const RemoveCompaniesFromListRequestSchema = z
|
|
2415
|
-
.object({
|
|
2416
|
-
companyIds: z.array(UuidSchema).min(1).max(1000)
|
|
2417
|
-
})
|
|
2327
|
+
export const RemoveCompaniesFromListRequestSchema = z
|
|
2328
|
+
.object({
|
|
2329
|
+
companyIds: z.array(UuidSchema).min(1).max(1000)
|
|
2330
|
+
})
|
|
2418
2331
|
.strict()
|
|
2419
2332
|
```
|
|
2420
2333
|
|
|
2421
2334
|
### `AddContactsToListRequestSchema`
|
|
2422
2335
|
|
|
2423
2336
|
```typescript
|
|
2424
|
-
export const AddContactsToListRequestSchema = z
|
|
2425
|
-
.object({
|
|
2426
|
-
contactIds: z.array(UuidSchema).min(1).max(1000)
|
|
2427
|
-
})
|
|
2337
|
+
export const AddContactsToListRequestSchema = z
|
|
2338
|
+
.object({
|
|
2339
|
+
contactIds: z.array(UuidSchema).min(1).max(1000)
|
|
2340
|
+
})
|
|
2428
2341
|
.strict()
|
|
2429
2342
|
```
|
|
2430
2343
|
|
|
2431
2344
|
### `RecordListExecutionRequestSchema`
|
|
2432
2345
|
|
|
2433
2346
|
```typescript
|
|
2434
|
-
export const RecordListExecutionRequestSchema = z
|
|
2435
|
-
.object({
|
|
2436
|
-
executionId: UuidSchema,
|
|
2437
|
-
configSnapshot: z.record(z.string(), z.unknown()).optional()
|
|
2438
|
-
})
|
|
2347
|
+
export const RecordListExecutionRequestSchema = z
|
|
2348
|
+
.object({
|
|
2349
|
+
executionId: UuidSchema,
|
|
2350
|
+
configSnapshot: z.record(z.string(), z.unknown()).optional()
|
|
2351
|
+
})
|
|
2439
2352
|
.strict()
|
|
2440
2353
|
```
|
|
2441
2354
|
|
|
2442
2355
|
### `AcqListResponseSchema`
|
|
2443
2356
|
|
|
2444
2357
|
```typescript
|
|
2445
|
-
/**
|
|
2446
|
-
* Single list as returned by /api/acquisition/lists/:id etc.
|
|
2447
|
-
* Camel-cased domain shape matching AcqList in types.ts.
|
|
2448
|
-
*/
|
|
2449
|
-
export const AcqListResponseSchema = z.object({
|
|
2450
|
-
id: z.string(),
|
|
2451
|
-
organizationId: z.string(),
|
|
2452
|
-
name: z.string(),
|
|
2453
|
-
description: z.string().nullable(),
|
|
2454
|
-
batchIds: z.array(z.string()),
|
|
2455
|
-
instantlyCampaignId: z.string().nullable(),
|
|
2456
|
-
/** Lifecycle status (draft | enriching | launched | closing | archived). */
|
|
2457
|
-
status: ListStatusSchema,
|
|
2458
|
-
metadata: AcqListMetadataSchema,
|
|
2459
|
-
launchedAt: z.string().nullable(),
|
|
2460
|
-
completedAt: z.string().nullable(),
|
|
2461
|
-
createdAt: z.string(),
|
|
2462
|
-
/** Scraping criteria stored as jsonb on the row. */
|
|
2463
|
-
scrapingConfig: ScrapingConfigSchema,
|
|
2464
|
-
/** ICP / qualification rubric stored as jsonb on the row. */
|
|
2465
|
-
icp: IcpRubricSchema,
|
|
2466
|
-
/** Pipeline presentation contract stored as jsonb on the row. */
|
|
2467
|
-
pipelineConfig: PipelineConfigSchema
|
|
2358
|
+
/**
|
|
2359
|
+
* Single list as returned by /api/acquisition/lists/:id etc.
|
|
2360
|
+
* Camel-cased domain shape matching AcqList in types.ts.
|
|
2361
|
+
*/
|
|
2362
|
+
export const AcqListResponseSchema = z.object({
|
|
2363
|
+
id: z.string(),
|
|
2364
|
+
organizationId: z.string(),
|
|
2365
|
+
name: z.string(),
|
|
2366
|
+
description: z.string().nullable(),
|
|
2367
|
+
batchIds: z.array(z.string()),
|
|
2368
|
+
instantlyCampaignId: z.string().nullable(),
|
|
2369
|
+
/** Lifecycle status (draft | enriching | launched | closing | archived). */
|
|
2370
|
+
status: ListStatusSchema,
|
|
2371
|
+
metadata: AcqListMetadataSchema,
|
|
2372
|
+
launchedAt: z.string().nullable(),
|
|
2373
|
+
completedAt: z.string().nullable(),
|
|
2374
|
+
createdAt: z.string(),
|
|
2375
|
+
/** Scraping criteria stored as jsonb on the row. */
|
|
2376
|
+
scrapingConfig: ScrapingConfigSchema,
|
|
2377
|
+
/** ICP / qualification rubric stored as jsonb on the row. */
|
|
2378
|
+
icp: IcpRubricSchema,
|
|
2379
|
+
/** Pipeline presentation contract stored as jsonb on the row. */
|
|
2380
|
+
pipelineConfig: PipelineConfigSchema
|
|
2468
2381
|
})
|
|
2469
2382
|
```
|
|
2470
2383
|
|
|
@@ -2489,18 +2402,18 @@ export const ListTelemetryListResponseSchema = z.array(ListTelemetrySchema)
|
|
|
2489
2402
|
### `ListExecutionSummarySchema`
|
|
2490
2403
|
|
|
2491
2404
|
```typescript
|
|
2492
|
-
/**
|
|
2493
|
-
* Row from acq_list_executions joined with the execution summary,
|
|
2494
|
-
* shaped for the /lists/:id/executions response.
|
|
2495
|
-
*/
|
|
2496
|
-
export const ListExecutionSummarySchema = z.object({
|
|
2497
|
-
executionId: z.string(),
|
|
2498
|
-
resourceId: z.string(),
|
|
2499
|
-
status: z.string(),
|
|
2500
|
-
createdAt: z.string(),
|
|
2501
|
-
completedAt: z.string().nullable(),
|
|
2502
|
-
durationMs: z.number().int().nullable(),
|
|
2503
|
-
input: z.unknown().nullable().optional()
|
|
2405
|
+
/**
|
|
2406
|
+
* Row from acq_list_executions joined with the execution summary,
|
|
2407
|
+
* shaped for the /lists/:id/executions response.
|
|
2408
|
+
*/
|
|
2409
|
+
export const ListExecutionSummarySchema = z.object({
|
|
2410
|
+
executionId: z.string(),
|
|
2411
|
+
resourceId: z.string(),
|
|
2412
|
+
status: z.string(),
|
|
2413
|
+
createdAt: z.string(),
|
|
2414
|
+
completedAt: z.string().nullable(),
|
|
2415
|
+
durationMs: z.number().int().nullable(),
|
|
2416
|
+
input: z.unknown().nullable().optional()
|
|
2504
2417
|
})
|
|
2505
2418
|
```
|
|
2506
2419
|
|
|
@@ -2531,299 +2444,299 @@ export const AcqEmailValidSchema = z.enum(['VALID', 'INVALID', 'RISKY', 'UNKNOWN
|
|
|
2531
2444
|
### `CompanyIdParamsSchema`
|
|
2532
2445
|
|
|
2533
2446
|
```typescript
|
|
2534
|
-
export const CompanyIdParamsSchema = z.object({
|
|
2535
|
-
companyId: UuidSchema
|
|
2447
|
+
export const CompanyIdParamsSchema = z.object({
|
|
2448
|
+
companyId: UuidSchema
|
|
2536
2449
|
})
|
|
2537
2450
|
```
|
|
2538
2451
|
|
|
2539
2452
|
### `ContactIdParamsSchema`
|
|
2540
2453
|
|
|
2541
2454
|
```typescript
|
|
2542
|
-
export const ContactIdParamsSchema = z.object({
|
|
2543
|
-
contactId: UuidSchema
|
|
2455
|
+
export const ContactIdParamsSchema = z.object({
|
|
2456
|
+
contactId: UuidSchema
|
|
2544
2457
|
})
|
|
2545
2458
|
```
|
|
2546
2459
|
|
|
2547
2460
|
### `ListCompaniesQuerySchema`
|
|
2548
2461
|
|
|
2549
2462
|
```typescript
|
|
2550
|
-
export const ListCompaniesQuerySchema = z
|
|
2551
|
-
.object({
|
|
2552
|
-
search: z.string().trim().min(1).max(200).optional(),
|
|
2553
|
-
listId: UuidSchema.optional(),
|
|
2554
|
-
domain: z.string().trim().min(1).max(255).optional(),
|
|
2555
|
-
website: z.string().trim().min(1).max(2048).optional(),
|
|
2556
|
-
segment: z.string().trim().min(1).max(255).optional(),
|
|
2557
|
-
category: z.string().trim().min(1).max(255).optional(),
|
|
2558
|
-
pipelineStatus: z.unknown().optional(),
|
|
2559
|
-
batchId: z.string().trim().min(1).max(255).optional(),
|
|
2560
|
-
status: AcqCompanyStatusSchema.optional(),
|
|
2561
|
-
includeAll: QueryBooleanSchema.optional(),
|
|
2562
|
-
limit: z.coerce.number().int().min(1).max(5000).default(50),
|
|
2563
|
-
offset: z.coerce.number().int().min(0).default(0)
|
|
2564
|
-
})
|
|
2463
|
+
export const ListCompaniesQuerySchema = z
|
|
2464
|
+
.object({
|
|
2465
|
+
search: z.string().trim().min(1).max(200).optional(),
|
|
2466
|
+
listId: UuidSchema.optional(),
|
|
2467
|
+
domain: z.string().trim().min(1).max(255).optional(),
|
|
2468
|
+
website: z.string().trim().min(1).max(2048).optional(),
|
|
2469
|
+
segment: z.string().trim().min(1).max(255).optional(),
|
|
2470
|
+
category: z.string().trim().min(1).max(255).optional(),
|
|
2471
|
+
pipelineStatus: z.unknown().optional(),
|
|
2472
|
+
batchId: z.string().trim().min(1).max(255).optional(),
|
|
2473
|
+
status: AcqCompanyStatusSchema.optional(),
|
|
2474
|
+
includeAll: QueryBooleanSchema.optional(),
|
|
2475
|
+
limit: z.coerce.number().int().min(1).max(5000).default(50),
|
|
2476
|
+
offset: z.coerce.number().int().min(0).default(0)
|
|
2477
|
+
})
|
|
2565
2478
|
.strict()
|
|
2566
2479
|
```
|
|
2567
2480
|
|
|
2568
2481
|
### `ListContactsQuerySchema`
|
|
2569
2482
|
|
|
2570
2483
|
```typescript
|
|
2571
|
-
export const ListContactsQuerySchema = z
|
|
2572
|
-
.object({
|
|
2573
|
-
search: z.string().trim().min(1).max(200).optional(),
|
|
2574
|
-
listId: UuidSchema.optional(),
|
|
2575
|
-
openingLineIsNull: QueryBooleanSchema.optional(),
|
|
2576
|
-
batchId: z.string().trim().min(1).max(255).optional(),
|
|
2577
|
-
contactStatus: AcqContactStatusSchema.optional(),
|
|
2578
|
-
limit: z.coerce.number().int().min(1).max(5000).default(5000),
|
|
2579
|
-
offset: z.coerce.number().int().min(0).default(0)
|
|
2580
|
-
})
|
|
2484
|
+
export const ListContactsQuerySchema = z
|
|
2485
|
+
.object({
|
|
2486
|
+
search: z.string().trim().min(1).max(200).optional(),
|
|
2487
|
+
listId: UuidSchema.optional(),
|
|
2488
|
+
openingLineIsNull: QueryBooleanSchema.optional(),
|
|
2489
|
+
batchId: z.string().trim().min(1).max(255).optional(),
|
|
2490
|
+
contactStatus: AcqContactStatusSchema.optional(),
|
|
2491
|
+
limit: z.coerce.number().int().min(1).max(5000).default(5000),
|
|
2492
|
+
offset: z.coerce.number().int().min(0).default(0)
|
|
2493
|
+
})
|
|
2581
2494
|
.strict()
|
|
2582
2495
|
```
|
|
2583
2496
|
|
|
2584
2497
|
### `CreateCompanyRequestSchema`
|
|
2585
2498
|
|
|
2586
2499
|
```typescript
|
|
2587
|
-
export const CreateCompanyRequestSchema = z
|
|
2588
|
-
.object({
|
|
2589
|
-
name: z.string().trim().min(1).max(255),
|
|
2590
|
-
clientId: UuidSchema.nullable().optional(),
|
|
2591
|
-
domain: z.string().trim().min(1).max(255).optional(),
|
|
2592
|
-
linkedinUrl: z.string().trim().url().optional(),
|
|
2593
|
-
website: z.string().trim().url().optional(),
|
|
2594
|
-
numEmployees: z.number().int().min(0).optional(),
|
|
2595
|
-
foundedYear: z.number().int().optional(),
|
|
2596
|
-
locationCity: z.string().trim().min(1).max(255).optional(),
|
|
2597
|
-
locationState: z.string().trim().min(1).max(255).optional(),
|
|
2598
|
-
category: z.string().trim().min(1).max(255).optional(),
|
|
2599
|
-
source: z.string().trim().min(1).max(255).optional(),
|
|
2600
|
-
batchId: z.string().trim().min(1).max(255).optional(),
|
|
2601
|
-
pipelineStatus: z.unknown().optional(),
|
|
2602
|
-
verticalResearch: z.string().trim().min(1).max(5000).optional()
|
|
2603
|
-
})
|
|
2500
|
+
export const CreateCompanyRequestSchema = z
|
|
2501
|
+
.object({
|
|
2502
|
+
name: z.string().trim().min(1).max(255),
|
|
2503
|
+
clientId: UuidSchema.nullable().optional(),
|
|
2504
|
+
domain: z.string().trim().min(1).max(255).optional(),
|
|
2505
|
+
linkedinUrl: z.string().trim().url().optional(),
|
|
2506
|
+
website: z.string().trim().url().optional(),
|
|
2507
|
+
numEmployees: z.number().int().min(0).optional(),
|
|
2508
|
+
foundedYear: z.number().int().optional(),
|
|
2509
|
+
locationCity: z.string().trim().min(1).max(255).optional(),
|
|
2510
|
+
locationState: z.string().trim().min(1).max(255).optional(),
|
|
2511
|
+
category: z.string().trim().min(1).max(255).optional(),
|
|
2512
|
+
source: z.string().trim().min(1).max(255).optional(),
|
|
2513
|
+
batchId: z.string().trim().min(1).max(255).optional(),
|
|
2514
|
+
pipelineStatus: z.unknown().optional(),
|
|
2515
|
+
verticalResearch: z.string().trim().min(1).max(5000).optional()
|
|
2516
|
+
})
|
|
2604
2517
|
.strict()
|
|
2605
2518
|
```
|
|
2606
2519
|
|
|
2607
2520
|
### `UpdateCompanyRequestSchema`
|
|
2608
2521
|
|
|
2609
2522
|
```typescript
|
|
2610
|
-
export const UpdateCompanyRequestSchema = z
|
|
2611
|
-
.object({
|
|
2612
|
-
name: z.string().trim().min(1).max(255).optional(),
|
|
2613
|
-
clientId: UuidSchema.nullable().optional(),
|
|
2614
|
-
domain: z.string().trim().min(1).max(255).optional(),
|
|
2615
|
-
linkedinUrl: z.string().trim().url().optional(),
|
|
2616
|
-
website: z.string().trim().url().optional(),
|
|
2617
|
-
numEmployees: z.number().int().min(0).optional(),
|
|
2618
|
-
foundedYear: z.number().int().optional(),
|
|
2619
|
-
locationCity: z.string().trim().min(1).max(255).optional(),
|
|
2620
|
-
locationState: z.string().trim().min(1).max(255).optional(),
|
|
2621
|
-
category: z.string().trim().min(1).max(255).optional(),
|
|
2622
|
-
segment: z.string().trim().min(1).max(255).optional(),
|
|
2623
|
-
processingState: CompanyProcessingStateSchema.optional(),
|
|
2624
|
-
pipelineStatus: z.unknown().optional(),
|
|
2625
|
-
enrichmentData: z.record(z.string(), z.unknown()).optional(),
|
|
2626
|
-
source: z.string().trim().min(1).max(255).optional(),
|
|
2627
|
-
batchId: z.string().trim().min(1).max(255).optional(),
|
|
2628
|
-
status: AcqCompanyStatusSchema.optional(),
|
|
2629
|
-
verticalResearch: z.string().trim().min(1).max(5000).nullable().optional()
|
|
2630
|
-
})
|
|
2631
|
-
.strict()
|
|
2632
|
-
.refine(
|
|
2633
|
-
(data) =>
|
|
2634
|
-
data.name !== undefined ||
|
|
2635
|
-
data.clientId !== undefined ||
|
|
2636
|
-
data.domain !== undefined ||
|
|
2637
|
-
data.linkedinUrl !== undefined ||
|
|
2638
|
-
data.website !== undefined ||
|
|
2639
|
-
data.numEmployees !== undefined ||
|
|
2640
|
-
data.foundedYear !== undefined ||
|
|
2641
|
-
data.locationCity !== undefined ||
|
|
2642
|
-
data.locationState !== undefined ||
|
|
2643
|
-
data.category !== undefined ||
|
|
2644
|
-
data.segment !== undefined ||
|
|
2645
|
-
data.processingState !== undefined ||
|
|
2646
|
-
data.pipelineStatus !== undefined ||
|
|
2647
|
-
data.enrichmentData !== undefined ||
|
|
2648
|
-
data.source !== undefined ||
|
|
2649
|
-
data.batchId !== undefined ||
|
|
2650
|
-
data.status !== undefined ||
|
|
2651
|
-
data.verticalResearch !== undefined,
|
|
2652
|
-
{
|
|
2653
|
-
message: 'At least one field must be provided'
|
|
2654
|
-
}
|
|
2523
|
+
export const UpdateCompanyRequestSchema = z
|
|
2524
|
+
.object({
|
|
2525
|
+
name: z.string().trim().min(1).max(255).optional(),
|
|
2526
|
+
clientId: UuidSchema.nullable().optional(),
|
|
2527
|
+
domain: z.string().trim().min(1).max(255).optional(),
|
|
2528
|
+
linkedinUrl: z.string().trim().url().optional(),
|
|
2529
|
+
website: z.string().trim().url().optional(),
|
|
2530
|
+
numEmployees: z.number().int().min(0).optional(),
|
|
2531
|
+
foundedYear: z.number().int().optional(),
|
|
2532
|
+
locationCity: z.string().trim().min(1).max(255).optional(),
|
|
2533
|
+
locationState: z.string().trim().min(1).max(255).optional(),
|
|
2534
|
+
category: z.string().trim().min(1).max(255).optional(),
|
|
2535
|
+
segment: z.string().trim().min(1).max(255).optional(),
|
|
2536
|
+
processingState: CompanyProcessingStateSchema.optional(),
|
|
2537
|
+
pipelineStatus: z.unknown().optional(),
|
|
2538
|
+
enrichmentData: z.record(z.string(), z.unknown()).optional(),
|
|
2539
|
+
source: z.string().trim().min(1).max(255).optional(),
|
|
2540
|
+
batchId: z.string().trim().min(1).max(255).optional(),
|
|
2541
|
+
status: AcqCompanyStatusSchema.optional(),
|
|
2542
|
+
verticalResearch: z.string().trim().min(1).max(5000).nullable().optional()
|
|
2543
|
+
})
|
|
2544
|
+
.strict()
|
|
2545
|
+
.refine(
|
|
2546
|
+
(data) =>
|
|
2547
|
+
data.name !== undefined ||
|
|
2548
|
+
data.clientId !== undefined ||
|
|
2549
|
+
data.domain !== undefined ||
|
|
2550
|
+
data.linkedinUrl !== undefined ||
|
|
2551
|
+
data.website !== undefined ||
|
|
2552
|
+
data.numEmployees !== undefined ||
|
|
2553
|
+
data.foundedYear !== undefined ||
|
|
2554
|
+
data.locationCity !== undefined ||
|
|
2555
|
+
data.locationState !== undefined ||
|
|
2556
|
+
data.category !== undefined ||
|
|
2557
|
+
data.segment !== undefined ||
|
|
2558
|
+
data.processingState !== undefined ||
|
|
2559
|
+
data.pipelineStatus !== undefined ||
|
|
2560
|
+
data.enrichmentData !== undefined ||
|
|
2561
|
+
data.source !== undefined ||
|
|
2562
|
+
data.batchId !== undefined ||
|
|
2563
|
+
data.status !== undefined ||
|
|
2564
|
+
data.verticalResearch !== undefined,
|
|
2565
|
+
{
|
|
2566
|
+
message: 'At least one field must be provided'
|
|
2567
|
+
}
|
|
2655
2568
|
)
|
|
2656
2569
|
```
|
|
2657
2570
|
|
|
2658
2571
|
### `CreateContactRequestSchema`
|
|
2659
2572
|
|
|
2660
2573
|
```typescript
|
|
2661
|
-
export const CreateContactRequestSchema = z
|
|
2662
|
-
.object({
|
|
2663
|
-
email: z.string().trim().email(),
|
|
2664
|
-
clientId: UuidSchema.nullable().optional(),
|
|
2665
|
-
companyId: UuidSchema.optional(),
|
|
2666
|
-
firstName: z.string().trim().min(1).max(255).optional(),
|
|
2667
|
-
lastName: z.string().trim().min(1).max(255).optional(),
|
|
2668
|
-
linkedinUrl: z.string().trim().url().optional(),
|
|
2669
|
-
title: z.string().trim().min(1).max(255).optional(),
|
|
2670
|
-
source: z.string().trim().min(1).max(255).optional(),
|
|
2671
|
-
sourceId: z.string().trim().min(1).max(255).optional(),
|
|
2672
|
-
batchId: z.string().trim().min(1).max(255).optional(),
|
|
2673
|
-
pipelineStatus: z.unknown().optional()
|
|
2674
|
-
})
|
|
2574
|
+
export const CreateContactRequestSchema = z
|
|
2575
|
+
.object({
|
|
2576
|
+
email: z.string().trim().email(),
|
|
2577
|
+
clientId: UuidSchema.nullable().optional(),
|
|
2578
|
+
companyId: UuidSchema.optional(),
|
|
2579
|
+
firstName: z.string().trim().min(1).max(255).optional(),
|
|
2580
|
+
lastName: z.string().trim().min(1).max(255).optional(),
|
|
2581
|
+
linkedinUrl: z.string().trim().url().optional(),
|
|
2582
|
+
title: z.string().trim().min(1).max(255).optional(),
|
|
2583
|
+
source: z.string().trim().min(1).max(255).optional(),
|
|
2584
|
+
sourceId: z.string().trim().min(1).max(255).optional(),
|
|
2585
|
+
batchId: z.string().trim().min(1).max(255).optional(),
|
|
2586
|
+
pipelineStatus: z.unknown().optional()
|
|
2587
|
+
})
|
|
2675
2588
|
.strict()
|
|
2676
2589
|
```
|
|
2677
2590
|
|
|
2678
2591
|
### `UpdateContactRequestSchema`
|
|
2679
2592
|
|
|
2680
2593
|
```typescript
|
|
2681
|
-
export const UpdateContactRequestSchema = z
|
|
2682
|
-
.object({
|
|
2683
|
-
companyId: UuidSchema.optional(),
|
|
2684
|
-
clientId: UuidSchema.nullable().optional(),
|
|
2685
|
-
emailValid: AcqEmailValidSchema.optional(),
|
|
2686
|
-
firstName: z.string().trim().min(1).max(255).optional(),
|
|
2687
|
-
lastName: z.string().trim().min(1).max(255).optional(),
|
|
2688
|
-
linkedinUrl: z.string().trim().url().optional(),
|
|
2689
|
-
title: z.string().trim().min(1).max(255).optional(),
|
|
2690
|
-
headline: z.string().trim().min(1).max(5000).optional(),
|
|
2691
|
-
filterReason: z.string().trim().min(1).max(5000).optional(),
|
|
2692
|
-
openingLine: z.string().trim().min(1).max(5000).optional(),
|
|
2693
|
-
processingState: ContactProcessingStateSchema.optional(),
|
|
2694
|
-
pipelineStatus: z.unknown().optional(),
|
|
2695
|
-
enrichmentData: z.record(z.string(), z.unknown()).optional(),
|
|
2696
|
-
status: AcqContactStatusSchema.optional()
|
|
2697
|
-
})
|
|
2698
|
-
.strict()
|
|
2699
|
-
.refine(
|
|
2700
|
-
(data) =>
|
|
2701
|
-
data.companyId !== undefined ||
|
|
2702
|
-
data.clientId !== undefined ||
|
|
2703
|
-
data.emailValid !== undefined ||
|
|
2704
|
-
data.firstName !== undefined ||
|
|
2705
|
-
data.lastName !== undefined ||
|
|
2706
|
-
data.linkedinUrl !== undefined ||
|
|
2707
|
-
data.title !== undefined ||
|
|
2708
|
-
data.headline !== undefined ||
|
|
2709
|
-
data.filterReason !== undefined ||
|
|
2710
|
-
data.openingLine !== undefined ||
|
|
2711
|
-
data.processingState !== undefined ||
|
|
2712
|
-
data.pipelineStatus !== undefined ||
|
|
2713
|
-
data.enrichmentData !== undefined ||
|
|
2714
|
-
data.status !== undefined,
|
|
2715
|
-
{
|
|
2716
|
-
message: 'At least one field must be provided'
|
|
2717
|
-
}
|
|
2594
|
+
export const UpdateContactRequestSchema = z
|
|
2595
|
+
.object({
|
|
2596
|
+
companyId: UuidSchema.optional(),
|
|
2597
|
+
clientId: UuidSchema.nullable().optional(),
|
|
2598
|
+
emailValid: AcqEmailValidSchema.optional(),
|
|
2599
|
+
firstName: z.string().trim().min(1).max(255).optional(),
|
|
2600
|
+
lastName: z.string().trim().min(1).max(255).optional(),
|
|
2601
|
+
linkedinUrl: z.string().trim().url().optional(),
|
|
2602
|
+
title: z.string().trim().min(1).max(255).optional(),
|
|
2603
|
+
headline: z.string().trim().min(1).max(5000).optional(),
|
|
2604
|
+
filterReason: z.string().trim().min(1).max(5000).optional(),
|
|
2605
|
+
openingLine: z.string().trim().min(1).max(5000).optional(),
|
|
2606
|
+
processingState: ContactProcessingStateSchema.optional(),
|
|
2607
|
+
pipelineStatus: z.unknown().optional(),
|
|
2608
|
+
enrichmentData: z.record(z.string(), z.unknown()).optional(),
|
|
2609
|
+
status: AcqContactStatusSchema.optional()
|
|
2610
|
+
})
|
|
2611
|
+
.strict()
|
|
2612
|
+
.refine(
|
|
2613
|
+
(data) =>
|
|
2614
|
+
data.companyId !== undefined ||
|
|
2615
|
+
data.clientId !== undefined ||
|
|
2616
|
+
data.emailValid !== undefined ||
|
|
2617
|
+
data.firstName !== undefined ||
|
|
2618
|
+
data.lastName !== undefined ||
|
|
2619
|
+
data.linkedinUrl !== undefined ||
|
|
2620
|
+
data.title !== undefined ||
|
|
2621
|
+
data.headline !== undefined ||
|
|
2622
|
+
data.filterReason !== undefined ||
|
|
2623
|
+
data.openingLine !== undefined ||
|
|
2624
|
+
data.processingState !== undefined ||
|
|
2625
|
+
data.pipelineStatus !== undefined ||
|
|
2626
|
+
data.enrichmentData !== undefined ||
|
|
2627
|
+
data.status !== undefined,
|
|
2628
|
+
{
|
|
2629
|
+
message: 'At least one field must be provided'
|
|
2630
|
+
}
|
|
2718
2631
|
)
|
|
2719
2632
|
```
|
|
2720
2633
|
|
|
2721
2634
|
### `AcqCompanyResponseSchema`
|
|
2722
2635
|
|
|
2723
2636
|
```typescript
|
|
2724
|
-
export const AcqCompanyResponseSchema = z.object({
|
|
2725
|
-
id: z.string(),
|
|
2726
|
-
organizationId: z.string(),
|
|
2727
|
-
clientId: z.string().nullable().optional(),
|
|
2728
|
-
name: z.string(),
|
|
2729
|
-
domain: z.string().nullable(),
|
|
2730
|
-
linkedinUrl: z.string().nullable(),
|
|
2731
|
-
website: z.string().nullable(),
|
|
2732
|
-
numEmployees: z.number().nullable(),
|
|
2733
|
-
foundedYear: z.number().nullable(),
|
|
2734
|
-
locationCity: z.string().nullable(),
|
|
2735
|
-
locationState: z.string().nullable(),
|
|
2736
|
-
category: z.string().nullable(),
|
|
2737
|
-
categoryPain: z.string().nullable(),
|
|
2738
|
-
segment: z.string().nullable(),
|
|
2739
|
-
processingState: CompanyProcessingStateSchema.nullable(),
|
|
2740
|
-
pipelineStatus: z.unknown().nullable().optional(),
|
|
2741
|
-
enrichmentData: z.record(z.string(), z.unknown()).nullable(),
|
|
2742
|
-
source: z.string().nullable(),
|
|
2743
|
-
batchId: z.string().nullable(),
|
|
2744
|
-
status: AcqCompanyStatusSchema,
|
|
2745
|
-
contactCount: z.number().int().min(0),
|
|
2746
|
-
verticalResearch: z.string().nullable(),
|
|
2747
|
-
createdAt: z.string(),
|
|
2748
|
-
updatedAt: z.string()
|
|
2637
|
+
export const AcqCompanyResponseSchema = z.object({
|
|
2638
|
+
id: z.string(),
|
|
2639
|
+
organizationId: z.string(),
|
|
2640
|
+
clientId: z.string().nullable().optional(),
|
|
2641
|
+
name: z.string(),
|
|
2642
|
+
domain: z.string().nullable(),
|
|
2643
|
+
linkedinUrl: z.string().nullable(),
|
|
2644
|
+
website: z.string().nullable(),
|
|
2645
|
+
numEmployees: z.number().nullable(),
|
|
2646
|
+
foundedYear: z.number().nullable(),
|
|
2647
|
+
locationCity: z.string().nullable(),
|
|
2648
|
+
locationState: z.string().nullable(),
|
|
2649
|
+
category: z.string().nullable(),
|
|
2650
|
+
categoryPain: z.string().nullable(),
|
|
2651
|
+
segment: z.string().nullable(),
|
|
2652
|
+
processingState: CompanyProcessingStateSchema.nullable(),
|
|
2653
|
+
pipelineStatus: z.unknown().nullable().optional(),
|
|
2654
|
+
enrichmentData: z.record(z.string(), z.unknown()).nullable(),
|
|
2655
|
+
source: z.string().nullable(),
|
|
2656
|
+
batchId: z.string().nullable(),
|
|
2657
|
+
status: AcqCompanyStatusSchema,
|
|
2658
|
+
contactCount: z.number().int().min(0),
|
|
2659
|
+
verticalResearch: z.string().nullable(),
|
|
2660
|
+
createdAt: z.string(),
|
|
2661
|
+
updatedAt: z.string()
|
|
2749
2662
|
})
|
|
2750
2663
|
```
|
|
2751
2664
|
|
|
2752
2665
|
### `AcqCompanyListResponseSchema`
|
|
2753
2666
|
|
|
2754
2667
|
```typescript
|
|
2755
|
-
export const AcqCompanyListResponseSchema = z.object({
|
|
2756
|
-
data: z.array(AcqCompanyResponseSchema),
|
|
2757
|
-
total: z.number().int(),
|
|
2758
|
-
limit: z.number().int(),
|
|
2759
|
-
offset: z.number().int()
|
|
2668
|
+
export const AcqCompanyListResponseSchema = z.object({
|
|
2669
|
+
data: z.array(AcqCompanyResponseSchema),
|
|
2670
|
+
total: z.number().int(),
|
|
2671
|
+
limit: z.number().int(),
|
|
2672
|
+
offset: z.number().int()
|
|
2760
2673
|
})
|
|
2761
2674
|
```
|
|
2762
2675
|
|
|
2763
2676
|
### `AcqCompanyFacetsResponseSchema`
|
|
2764
2677
|
|
|
2765
2678
|
```typescript
|
|
2766
|
-
export const AcqCompanyFacetsResponseSchema = z.object({
|
|
2767
|
-
segments: z.array(z.string()),
|
|
2768
|
-
categories: z.array(z.string()),
|
|
2769
|
-
statuses: z.array(AcqCompanyStatusSchema)
|
|
2679
|
+
export const AcqCompanyFacetsResponseSchema = z.object({
|
|
2680
|
+
segments: z.array(z.string()),
|
|
2681
|
+
categories: z.array(z.string()),
|
|
2682
|
+
statuses: z.array(AcqCompanyStatusSchema)
|
|
2770
2683
|
})
|
|
2771
2684
|
```
|
|
2772
2685
|
|
|
2773
2686
|
### `AcqContactCompanySummarySchema`
|
|
2774
2687
|
|
|
2775
2688
|
```typescript
|
|
2776
|
-
export const AcqContactCompanySummarySchema = z.object({
|
|
2777
|
-
id: z.string(),
|
|
2778
|
-
name: z.string(),
|
|
2779
|
-
domain: z.string().nullable(),
|
|
2780
|
-
website: z.string().nullable(),
|
|
2781
|
-
linkedinUrl: z.string().nullable(),
|
|
2782
|
-
segment: z.string().nullable(),
|
|
2783
|
-
category: z.string().nullable(),
|
|
2784
|
-
status: AcqCompanyStatusSchema
|
|
2689
|
+
export const AcqContactCompanySummarySchema = z.object({
|
|
2690
|
+
id: z.string(),
|
|
2691
|
+
name: z.string(),
|
|
2692
|
+
domain: z.string().nullable(),
|
|
2693
|
+
website: z.string().nullable(),
|
|
2694
|
+
linkedinUrl: z.string().nullable(),
|
|
2695
|
+
segment: z.string().nullable(),
|
|
2696
|
+
category: z.string().nullable(),
|
|
2697
|
+
status: AcqCompanyStatusSchema
|
|
2785
2698
|
})
|
|
2786
2699
|
```
|
|
2787
2700
|
|
|
2788
2701
|
### `AcqContactResponseSchema`
|
|
2789
2702
|
|
|
2790
2703
|
```typescript
|
|
2791
|
-
export const AcqContactResponseSchema = z.object({
|
|
2792
|
-
id: z.string(),
|
|
2793
|
-
organizationId: z.string(),
|
|
2794
|
-
clientId: z.string().nullable().optional(),
|
|
2795
|
-
companyId: z.string().nullable(),
|
|
2796
|
-
email: z.string(),
|
|
2797
|
-
emailValid: AcqEmailValidSchema.nullable(),
|
|
2798
|
-
firstName: z.string().nullable(),
|
|
2799
|
-
lastName: z.string().nullable(),
|
|
2800
|
-
linkedinUrl: z.string().nullable(),
|
|
2801
|
-
title: z.string().nullable(),
|
|
2802
|
-
headline: z.string().nullable(),
|
|
2803
|
-
filterReason: z.string().nullable(),
|
|
2804
|
-
openingLine: z.string().nullable(),
|
|
2805
|
-
source: z.string().nullable(),
|
|
2806
|
-
sourceId: z.string().nullable(),
|
|
2807
|
-
processingState: ContactProcessingStateSchema.nullable(),
|
|
2808
|
-
pipelineStatus: z.unknown().nullable().optional(),
|
|
2809
|
-
enrichmentData: z.record(z.string(), z.unknown()).nullable(),
|
|
2810
|
-
attioPersonId: z.string().nullable(),
|
|
2811
|
-
batchId: z.string().nullable(),
|
|
2812
|
-
status: AcqContactStatusSchema,
|
|
2813
|
-
company: AcqContactCompanySummarySchema.nullable().optional(),
|
|
2814
|
-
createdAt: z.string(),
|
|
2815
|
-
updatedAt: z.string()
|
|
2704
|
+
export const AcqContactResponseSchema = z.object({
|
|
2705
|
+
id: z.string(),
|
|
2706
|
+
organizationId: z.string(),
|
|
2707
|
+
clientId: z.string().nullable().optional(),
|
|
2708
|
+
companyId: z.string().nullable(),
|
|
2709
|
+
email: z.string(),
|
|
2710
|
+
emailValid: AcqEmailValidSchema.nullable(),
|
|
2711
|
+
firstName: z.string().nullable(),
|
|
2712
|
+
lastName: z.string().nullable(),
|
|
2713
|
+
linkedinUrl: z.string().nullable(),
|
|
2714
|
+
title: z.string().nullable(),
|
|
2715
|
+
headline: z.string().nullable(),
|
|
2716
|
+
filterReason: z.string().nullable(),
|
|
2717
|
+
openingLine: z.string().nullable(),
|
|
2718
|
+
source: z.string().nullable(),
|
|
2719
|
+
sourceId: z.string().nullable(),
|
|
2720
|
+
processingState: ContactProcessingStateSchema.nullable(),
|
|
2721
|
+
pipelineStatus: z.unknown().nullable().optional(),
|
|
2722
|
+
enrichmentData: z.record(z.string(), z.unknown()).nullable(),
|
|
2723
|
+
attioPersonId: z.string().nullable(),
|
|
2724
|
+
batchId: z.string().nullable(),
|
|
2725
|
+
status: AcqContactStatusSchema,
|
|
2726
|
+
company: AcqContactCompanySummarySchema.nullable().optional(),
|
|
2727
|
+
createdAt: z.string(),
|
|
2728
|
+
updatedAt: z.string()
|
|
2816
2729
|
})
|
|
2817
2730
|
```
|
|
2818
2731
|
|
|
2819
2732
|
### `AcqContactListResponseSchema`
|
|
2820
2733
|
|
|
2821
2734
|
```typescript
|
|
2822
|
-
export const AcqContactListResponseSchema = z.object({
|
|
2823
|
-
data: z.array(AcqContactResponseSchema),
|
|
2824
|
-
total: z.number().int(),
|
|
2825
|
-
limit: z.number().int(),
|
|
2826
|
-
offset: z.number().int()
|
|
2735
|
+
export const AcqContactListResponseSchema = z.object({
|
|
2736
|
+
data: z.array(AcqContactResponseSchema),
|
|
2737
|
+
total: z.number().int(),
|
|
2738
|
+
limit: z.number().int(),
|
|
2739
|
+
offset: z.number().int()
|
|
2827
2740
|
})
|
|
2828
2741
|
```
|
|
2829
2742
|
|
|
@@ -2836,242 +2749,242 @@ export const AcqArtifactOwnerKindSchema = z.enum(['company', 'contact', 'deal',
|
|
|
2836
2749
|
### `ListArtifactsQuerySchema`
|
|
2837
2750
|
|
|
2838
2751
|
```typescript
|
|
2839
|
-
export const ListArtifactsQuerySchema = z
|
|
2840
|
-
.object({
|
|
2841
|
-
ownerKind: AcqArtifactOwnerKindSchema,
|
|
2842
|
-
ownerId: UuidSchema
|
|
2843
|
-
})
|
|
2752
|
+
export const ListArtifactsQuerySchema = z
|
|
2753
|
+
.object({
|
|
2754
|
+
ownerKind: AcqArtifactOwnerKindSchema,
|
|
2755
|
+
ownerId: UuidSchema
|
|
2756
|
+
})
|
|
2844
2757
|
.strict()
|
|
2845
2758
|
```
|
|
2846
2759
|
|
|
2847
2760
|
### `CreateArtifactRequestSchema`
|
|
2848
2761
|
|
|
2849
2762
|
```typescript
|
|
2850
|
-
export const CreateArtifactRequestSchema = z
|
|
2851
|
-
.object({
|
|
2852
|
-
ownerKind: AcqArtifactOwnerKindSchema,
|
|
2853
|
-
ownerId: UuidSchema,
|
|
2854
|
-
kind: z.string().trim().min(1).max(255),
|
|
2855
|
-
content: z.record(z.string(), z.unknown()),
|
|
2856
|
-
sourceExecutionId: UuidSchema.optional()
|
|
2857
|
-
})
|
|
2763
|
+
export const CreateArtifactRequestSchema = z
|
|
2764
|
+
.object({
|
|
2765
|
+
ownerKind: AcqArtifactOwnerKindSchema,
|
|
2766
|
+
ownerId: UuidSchema,
|
|
2767
|
+
kind: z.string().trim().min(1).max(255),
|
|
2768
|
+
content: z.record(z.string(), z.unknown()),
|
|
2769
|
+
sourceExecutionId: UuidSchema.optional()
|
|
2770
|
+
})
|
|
2858
2771
|
.strict()
|
|
2859
2772
|
```
|
|
2860
2773
|
|
|
2861
2774
|
### `AcqArtifactResponseSchema`
|
|
2862
2775
|
|
|
2863
2776
|
```typescript
|
|
2864
|
-
export const AcqArtifactResponseSchema = z.object({
|
|
2865
|
-
id: z.string(),
|
|
2866
|
-
organizationId: z.string(),
|
|
2867
|
-
ownerKind: z.string(),
|
|
2868
|
-
ownerId: z.string(),
|
|
2869
|
-
kind: z.string(),
|
|
2870
|
-
content: z.record(z.string(), z.unknown()),
|
|
2871
|
-
sourceExecutionId: z.string().nullable(),
|
|
2872
|
-
createdBy: z.string().nullable(),
|
|
2873
|
-
createdAt: z.string(),
|
|
2874
|
-
version: z.number().int()
|
|
2777
|
+
export const AcqArtifactResponseSchema = z.object({
|
|
2778
|
+
id: z.string(),
|
|
2779
|
+
organizationId: z.string(),
|
|
2780
|
+
ownerKind: z.string(),
|
|
2781
|
+
ownerId: z.string(),
|
|
2782
|
+
kind: z.string(),
|
|
2783
|
+
content: z.record(z.string(), z.unknown()),
|
|
2784
|
+
sourceExecutionId: z.string().nullable(),
|
|
2785
|
+
createdBy: z.string().nullable(),
|
|
2786
|
+
createdAt: z.string(),
|
|
2787
|
+
version: z.number().int()
|
|
2875
2788
|
})
|
|
2876
2789
|
```
|
|
2877
2790
|
|
|
2878
2791
|
### `AcqArtifactListResponseSchema`
|
|
2879
2792
|
|
|
2880
2793
|
```typescript
|
|
2881
|
-
export const AcqArtifactListResponseSchema = z.object({
|
|
2882
|
-
artifacts: z.array(AcqArtifactResponseSchema)
|
|
2794
|
+
export const AcqArtifactListResponseSchema = z.object({
|
|
2795
|
+
artifacts: z.array(AcqArtifactResponseSchema)
|
|
2883
2796
|
})
|
|
2884
2797
|
```
|
|
2885
2798
|
|
|
2886
2799
|
### `ListMembersQuerySchema`
|
|
2887
2800
|
|
|
2888
2801
|
```typescript
|
|
2889
|
-
export const ListMembersQuerySchema = z
|
|
2890
|
-
.object({
|
|
2891
|
-
limit: z.coerce.number().int().min(1).max(500).default(50),
|
|
2892
|
-
offset: z.coerce.number().int().min(0).default(0)
|
|
2893
|
-
})
|
|
2802
|
+
export const ListMembersQuerySchema = z
|
|
2803
|
+
.object({
|
|
2804
|
+
limit: z.coerce.number().int().min(1).max(500).default(50),
|
|
2805
|
+
offset: z.coerce.number().int().min(0).default(0)
|
|
2806
|
+
})
|
|
2894
2807
|
.strict()
|
|
2895
2808
|
```
|
|
2896
2809
|
|
|
2897
2810
|
### `MemberIdParamsSchema`
|
|
2898
2811
|
|
|
2899
2812
|
```typescript
|
|
2900
|
-
export const MemberIdParamsSchema = z.object({
|
|
2901
|
-
memberId: UuidSchema
|
|
2813
|
+
export const MemberIdParamsSchema = z.object({
|
|
2814
|
+
memberId: UuidSchema
|
|
2902
2815
|
})
|
|
2903
2816
|
```
|
|
2904
2817
|
|
|
2905
2818
|
### `AcqListMemberContactSummarySchema`
|
|
2906
2819
|
|
|
2907
2820
|
```typescript
|
|
2908
|
-
export const AcqListMemberContactSummarySchema = z.object({
|
|
2909
|
-
id: z.string(),
|
|
2910
|
-
email: z.string(),
|
|
2911
|
-
firstName: z.string().nullable(),
|
|
2912
|
-
lastName: z.string().nullable(),
|
|
2913
|
-
title: z.string().nullable(),
|
|
2914
|
-
linkedinUrl: z.string().nullable(),
|
|
2915
|
-
companyId: z.string().nullable()
|
|
2821
|
+
export const AcqListMemberContactSummarySchema = z.object({
|
|
2822
|
+
id: z.string(),
|
|
2823
|
+
email: z.string(),
|
|
2824
|
+
firstName: z.string().nullable(),
|
|
2825
|
+
lastName: z.string().nullable(),
|
|
2826
|
+
title: z.string().nullable(),
|
|
2827
|
+
linkedinUrl: z.string().nullable(),
|
|
2828
|
+
companyId: z.string().nullable()
|
|
2916
2829
|
})
|
|
2917
2830
|
```
|
|
2918
2831
|
|
|
2919
2832
|
### `AcqListMemberResponseSchema`
|
|
2920
2833
|
|
|
2921
2834
|
```typescript
|
|
2922
|
-
export const AcqListMemberResponseSchema = z.object({
|
|
2923
|
-
id: z.string(),
|
|
2924
|
-
listId: z.string(),
|
|
2925
|
-
contactId: z.string(),
|
|
2926
|
-
pipelineKey: z.string(),
|
|
2927
|
-
stageKey: z.string(),
|
|
2928
|
-
stateKey: z.string(),
|
|
2929
|
-
activityLog: z.unknown(),
|
|
2930
|
-
addedAt: z.string(),
|
|
2931
|
-
addedBy: z.string().nullable(),
|
|
2932
|
-
sourceExecutionId: z.string().nullable(),
|
|
2933
|
-
contact: AcqListMemberContactSummarySchema.nullable()
|
|
2835
|
+
export const AcqListMemberResponseSchema = z.object({
|
|
2836
|
+
id: z.string(),
|
|
2837
|
+
listId: z.string(),
|
|
2838
|
+
contactId: z.string(),
|
|
2839
|
+
pipelineKey: z.string(),
|
|
2840
|
+
stageKey: z.string(),
|
|
2841
|
+
stateKey: z.string(),
|
|
2842
|
+
activityLog: z.unknown(),
|
|
2843
|
+
addedAt: z.string(),
|
|
2844
|
+
addedBy: z.string().nullable(),
|
|
2845
|
+
sourceExecutionId: z.string().nullable(),
|
|
2846
|
+
contact: AcqListMemberContactSummarySchema.nullable()
|
|
2934
2847
|
})
|
|
2935
2848
|
```
|
|
2936
2849
|
|
|
2937
2850
|
### `AcqListMembersResponseSchema`
|
|
2938
2851
|
|
|
2939
2852
|
```typescript
|
|
2940
|
-
export const AcqListMembersResponseSchema = z.object({
|
|
2941
|
-
members: z.array(AcqListMemberResponseSchema)
|
|
2853
|
+
export const AcqListMembersResponseSchema = z.object({
|
|
2854
|
+
members: z.array(AcqListMemberResponseSchema)
|
|
2942
2855
|
})
|
|
2943
2856
|
```
|
|
2944
2857
|
|
|
2945
2858
|
### `ListCompanyIdParamsSchema`
|
|
2946
2859
|
|
|
2947
2860
|
```typescript
|
|
2948
|
-
export const ListCompanyIdParamsSchema = z.object({
|
|
2949
|
-
listCompanyId: UuidSchema
|
|
2861
|
+
export const ListCompanyIdParamsSchema = z.object({
|
|
2862
|
+
listCompanyId: UuidSchema
|
|
2950
2863
|
})
|
|
2951
2864
|
```
|
|
2952
2865
|
|
|
2953
2866
|
### `AcqListCompanyResponseSchema`
|
|
2954
2867
|
|
|
2955
2868
|
```typescript
|
|
2956
|
-
export const AcqListCompanyResponseSchema = z.object({
|
|
2957
|
-
id: z.string(),
|
|
2958
|
-
listId: z.string(),
|
|
2959
|
-
companyId: z.string(),
|
|
2960
|
-
pipelineKey: z.string(),
|
|
2961
|
-
stageKey: z.string(),
|
|
2962
|
-
stateKey: z.string(),
|
|
2963
|
-
activityLog: z.unknown(),
|
|
2964
|
-
addedAt: z.string(),
|
|
2965
|
-
addedBy: z.string().nullable(),
|
|
2966
|
-
sourceExecutionId: z.string().nullable()
|
|
2869
|
+
export const AcqListCompanyResponseSchema = z.object({
|
|
2870
|
+
id: z.string(),
|
|
2871
|
+
listId: z.string(),
|
|
2872
|
+
companyId: z.string(),
|
|
2873
|
+
pipelineKey: z.string(),
|
|
2874
|
+
stageKey: z.string(),
|
|
2875
|
+
stateKey: z.string(),
|
|
2876
|
+
activityLog: z.unknown(),
|
|
2877
|
+
addedAt: z.string(),
|
|
2878
|
+
addedBy: z.string().nullable(),
|
|
2879
|
+
sourceExecutionId: z.string().nullable()
|
|
2967
2880
|
})
|
|
2968
2881
|
```
|
|
2969
2882
|
|
|
2970
2883
|
### `AcqCompanySchemas`
|
|
2971
2884
|
|
|
2972
2885
|
```typescript
|
|
2973
|
-
export const AcqCompanySchemas = {
|
|
2974
|
-
CompanyProcessingState: CompanyProcessingStateSchema,
|
|
2975
|
-
CompanyIdParams: CompanyIdParamsSchema,
|
|
2976
|
-
ListCompaniesQuery: ListCompaniesQuerySchema,
|
|
2977
|
-
CreateCompanyRequest: CreateCompanyRequestSchema,
|
|
2978
|
-
UpdateCompanyRequest: UpdateCompanyRequestSchema,
|
|
2979
|
-
AcqCompanyResponse: AcqCompanyResponseSchema,
|
|
2980
|
-
AcqCompanyListResponse: AcqCompanyListResponseSchema,
|
|
2981
|
-
AcqCompanyFacetsResponse: AcqCompanyFacetsResponseSchema
|
|
2886
|
+
export const AcqCompanySchemas = {
|
|
2887
|
+
CompanyProcessingState: CompanyProcessingStateSchema,
|
|
2888
|
+
CompanyIdParams: CompanyIdParamsSchema,
|
|
2889
|
+
ListCompaniesQuery: ListCompaniesQuerySchema,
|
|
2890
|
+
CreateCompanyRequest: CreateCompanyRequestSchema,
|
|
2891
|
+
UpdateCompanyRequest: UpdateCompanyRequestSchema,
|
|
2892
|
+
AcqCompanyResponse: AcqCompanyResponseSchema,
|
|
2893
|
+
AcqCompanyListResponse: AcqCompanyListResponseSchema,
|
|
2894
|
+
AcqCompanyFacetsResponse: AcqCompanyFacetsResponseSchema
|
|
2982
2895
|
}
|
|
2983
2896
|
```
|
|
2984
2897
|
|
|
2985
2898
|
### `AcqContactSchemas`
|
|
2986
2899
|
|
|
2987
2900
|
```typescript
|
|
2988
|
-
export const AcqContactSchemas = {
|
|
2989
|
-
ContactProcessingState: ContactProcessingStateSchema,
|
|
2990
|
-
ContactIdParams: ContactIdParamsSchema,
|
|
2991
|
-
ListContactsQuery: ListContactsQuerySchema,
|
|
2992
|
-
CreateContactRequest: CreateContactRequestSchema,
|
|
2993
|
-
UpdateContactRequest: UpdateContactRequestSchema,
|
|
2994
|
-
AcqContactResponse: AcqContactResponseSchema,
|
|
2995
|
-
AcqContactListResponse: AcqContactListResponseSchema
|
|
2901
|
+
export const AcqContactSchemas = {
|
|
2902
|
+
ContactProcessingState: ContactProcessingStateSchema,
|
|
2903
|
+
ContactIdParams: ContactIdParamsSchema,
|
|
2904
|
+
ListContactsQuery: ListContactsQuerySchema,
|
|
2905
|
+
CreateContactRequest: CreateContactRequestSchema,
|
|
2906
|
+
UpdateContactRequest: UpdateContactRequestSchema,
|
|
2907
|
+
AcqContactResponse: AcqContactResponseSchema,
|
|
2908
|
+
AcqContactListResponse: AcqContactListResponseSchema
|
|
2996
2909
|
}
|
|
2997
2910
|
```
|
|
2998
2911
|
|
|
2999
2912
|
### `AcqListSchemas`
|
|
3000
2913
|
|
|
3001
2914
|
```typescript
|
|
3002
|
-
export const AcqListSchemas = {
|
|
3003
|
-
// Params
|
|
3004
|
-
ListIdParams: ListIdParamsSchema,
|
|
3005
|
-
|
|
3006
|
-
// Primitives (for UI / tests)
|
|
3007
|
-
ListStatus: ListStatusSchema,
|
|
3008
|
-
ScrapingConfig: ScrapingConfigSchema,
|
|
3009
|
-
IcpRubric: IcpRubricSchema,
|
|
3010
|
-
PipelineConfig: PipelineConfigSchema,
|
|
3011
|
-
PipelineStage: PipelineStageSchema,
|
|
3012
|
-
BuildPlanSnapshot: BuildPlanSnapshotSchema,
|
|
3013
|
-
BuildPlanSnapshotStep: BuildPlanSnapshotStepSchema,
|
|
3014
|
-
AcqListMetadata: AcqListMetadataSchema,
|
|
3015
|
-
LeadGenStageKey: LeadGenStageKeySchema,
|
|
3016
|
-
LeadGenActionKey: LeadGenActionKeySchema,
|
|
3017
|
-
ProcessingStageStatus: ProcessingStageStatusSchema,
|
|
3018
|
-
ProcessingState: ProcessingStateSchema,
|
|
3019
|
-
ListStageCounts: ListStageCountsSchema,
|
|
3020
|
-
ListTelemetry: ListTelemetrySchema,
|
|
3021
|
-
|
|
3022
|
-
// Requests
|
|
3023
|
-
ListReadQuery: ListReadQuerySchema,
|
|
3024
|
-
GetListQuery: GetListQuerySchema,
|
|
3025
|
-
CreateListRequest: CreateListRequestSchema,
|
|
3026
|
-
UpdateListRequest: UpdateListRequestSchema,
|
|
3027
|
-
UpdateListStatusRequest: UpdateListStatusRequestSchema,
|
|
3028
|
-
UpdateListConfigRequest: UpdateListConfigRequestSchema,
|
|
3029
|
-
AddCompaniesToListRequest: AddCompaniesToListRequestSchema,
|
|
3030
|
-
RemoveCompaniesFromListRequest: RemoveCompaniesFromListRequestSchema,
|
|
3031
|
-
AddContactsToListRequest: AddContactsToListRequestSchema,
|
|
3032
|
-
RecordListExecutionRequest: RecordListExecutionRequestSchema,
|
|
3033
|
-
|
|
3034
|
-
// Responses
|
|
3035
|
-
AcqListResponse: AcqListResponseSchema,
|
|
3036
|
-
AcqListDetailResponse: AcqListDetailResponseSchema,
|
|
3037
|
-
AcqListListResponse: AcqListListResponseSchema,
|
|
3038
|
-
AcqListDealRef: AcqListDealRefSchema,
|
|
3039
|
-
AcqListLineage: AcqListLineageSchema,
|
|
3040
|
-
AcqListStatusResponse: AcqListStatusResponseSchema,
|
|
3041
|
-
ListTelemetryResponse: ListTelemetryResponseSchema,
|
|
3042
|
-
ListTelemetryListResponse: ListTelemetryListResponseSchema,
|
|
3043
|
-
ListExecutionsResponse: ListExecutionsResponseSchema,
|
|
3044
|
-
ListProgressResponse: ListProgressResponseSchema
|
|
2915
|
+
export const AcqListSchemas = {
|
|
2916
|
+
// Params
|
|
2917
|
+
ListIdParams: ListIdParamsSchema,
|
|
2918
|
+
|
|
2919
|
+
// Primitives (for UI / tests)
|
|
2920
|
+
ListStatus: ListStatusSchema,
|
|
2921
|
+
ScrapingConfig: ScrapingConfigSchema,
|
|
2922
|
+
IcpRubric: IcpRubricSchema,
|
|
2923
|
+
PipelineConfig: PipelineConfigSchema,
|
|
2924
|
+
PipelineStage: PipelineStageSchema,
|
|
2925
|
+
BuildPlanSnapshot: BuildPlanSnapshotSchema,
|
|
2926
|
+
BuildPlanSnapshotStep: BuildPlanSnapshotStepSchema,
|
|
2927
|
+
AcqListMetadata: AcqListMetadataSchema,
|
|
2928
|
+
LeadGenStageKey: LeadGenStageKeySchema,
|
|
2929
|
+
LeadGenActionKey: LeadGenActionKeySchema,
|
|
2930
|
+
ProcessingStageStatus: ProcessingStageStatusSchema,
|
|
2931
|
+
ProcessingState: ProcessingStateSchema,
|
|
2932
|
+
ListStageCounts: ListStageCountsSchema,
|
|
2933
|
+
ListTelemetry: ListTelemetrySchema,
|
|
2934
|
+
|
|
2935
|
+
// Requests
|
|
2936
|
+
ListReadQuery: ListReadQuerySchema,
|
|
2937
|
+
GetListQuery: GetListQuerySchema,
|
|
2938
|
+
CreateListRequest: CreateListRequestSchema,
|
|
2939
|
+
UpdateListRequest: UpdateListRequestSchema,
|
|
2940
|
+
UpdateListStatusRequest: UpdateListStatusRequestSchema,
|
|
2941
|
+
UpdateListConfigRequest: UpdateListConfigRequestSchema,
|
|
2942
|
+
AddCompaniesToListRequest: AddCompaniesToListRequestSchema,
|
|
2943
|
+
RemoveCompaniesFromListRequest: RemoveCompaniesFromListRequestSchema,
|
|
2944
|
+
AddContactsToListRequest: AddContactsToListRequestSchema,
|
|
2945
|
+
RecordListExecutionRequest: RecordListExecutionRequestSchema,
|
|
2946
|
+
|
|
2947
|
+
// Responses
|
|
2948
|
+
AcqListResponse: AcqListResponseSchema,
|
|
2949
|
+
AcqListDetailResponse: AcqListDetailResponseSchema,
|
|
2950
|
+
AcqListListResponse: AcqListListResponseSchema,
|
|
2951
|
+
AcqListDealRef: AcqListDealRefSchema,
|
|
2952
|
+
AcqListLineage: AcqListLineageSchema,
|
|
2953
|
+
AcqListStatusResponse: AcqListStatusResponseSchema,
|
|
2954
|
+
ListTelemetryResponse: ListTelemetryResponseSchema,
|
|
2955
|
+
ListTelemetryListResponse: ListTelemetryListResponseSchema,
|
|
2956
|
+
ListExecutionsResponse: ListExecutionsResponseSchema,
|
|
2957
|
+
ListProgressResponse: ListProgressResponseSchema
|
|
3045
2958
|
}
|
|
3046
2959
|
```
|
|
3047
2960
|
|
|
3048
2961
|
### `AcqSubstrateSchemas`
|
|
3049
2962
|
|
|
3050
2963
|
```typescript
|
|
3051
|
-
export const AcqSubstrateSchemas = {
|
|
3052
|
-
// Artifacts
|
|
3053
|
-
ListArtifactsQuery: ListArtifactsQuerySchema,
|
|
3054
|
-
CreateArtifactRequest: CreateArtifactRequestSchema,
|
|
3055
|
-
AcqArtifactResponse: AcqArtifactResponseSchema,
|
|
3056
|
-
AcqArtifactListResponse: AcqArtifactListResponseSchema,
|
|
3057
|
-
|
|
3058
|
-
// List members
|
|
3059
|
-
ListMembersQuery: ListMembersQuerySchema,
|
|
3060
|
-
ListRecordsQuery: ListRecordsQuerySchema,
|
|
3061
|
-
MemberIdParams: MemberIdParamsSchema,
|
|
3062
|
-
AcqListMemberResponse: AcqListMemberResponseSchema,
|
|
3063
|
-
AcqListMembersResponse: AcqListMembersResponseSchema,
|
|
3064
|
-
AcqListCompanyRecordRow: AcqListCompanyRecordRowSchema,
|
|
3065
|
-
AcqListContactRecordRow: AcqListContactRecordRowSchema,
|
|
3066
|
-
ListRecordRow: ListRecordRowSchema,
|
|
3067
|
-
ListRecordsResponse: ListRecordsResponseSchema,
|
|
3068
|
-
|
|
3069
|
-
// List companies
|
|
3070
|
-
ListCompanyIdParams: ListCompanyIdParamsSchema,
|
|
3071
|
-
AcqListCompanyResponse: AcqListCompanyResponseSchema,
|
|
3072
|
-
|
|
3073
|
-
// Transition (generic stateful substrate)
|
|
3074
|
-
TransitionItemRequest: TransitionItemRequestSchema
|
|
2964
|
+
export const AcqSubstrateSchemas = {
|
|
2965
|
+
// Artifacts
|
|
2966
|
+
ListArtifactsQuery: ListArtifactsQuerySchema,
|
|
2967
|
+
CreateArtifactRequest: CreateArtifactRequestSchema,
|
|
2968
|
+
AcqArtifactResponse: AcqArtifactResponseSchema,
|
|
2969
|
+
AcqArtifactListResponse: AcqArtifactListResponseSchema,
|
|
2970
|
+
|
|
2971
|
+
// List members
|
|
2972
|
+
ListMembersQuery: ListMembersQuerySchema,
|
|
2973
|
+
ListRecordsQuery: ListRecordsQuerySchema,
|
|
2974
|
+
MemberIdParams: MemberIdParamsSchema,
|
|
2975
|
+
AcqListMemberResponse: AcqListMemberResponseSchema,
|
|
2976
|
+
AcqListMembersResponse: AcqListMembersResponseSchema,
|
|
2977
|
+
AcqListCompanyRecordRow: AcqListCompanyRecordRowSchema,
|
|
2978
|
+
AcqListContactRecordRow: AcqListContactRecordRowSchema,
|
|
2979
|
+
ListRecordRow: ListRecordRowSchema,
|
|
2980
|
+
ListRecordsResponse: ListRecordsResponseSchema,
|
|
2981
|
+
|
|
2982
|
+
// List companies
|
|
2983
|
+
ListCompanyIdParams: ListCompanyIdParamsSchema,
|
|
2984
|
+
AcqListCompanyResponse: AcqListCompanyResponseSchema,
|
|
2985
|
+
|
|
2986
|
+
// Transition (generic stateful substrate)
|
|
2987
|
+
TransitionItemRequest: TransitionItemRequestSchema
|
|
3075
2988
|
}
|
|
3076
2989
|
```
|
|
3077
2990
|
|
|
@@ -3122,136 +3035,136 @@ export const StatefulSchema = z.object({
|
|
|
3122
3035
|
### `StatefulStateDefinition`
|
|
3123
3036
|
|
|
3124
3037
|
```typescript
|
|
3125
|
-
/** One state within a stage
|
|
3126
|
-
export interface StatefulStateDefinition {
|
|
3127
|
-
/** Matches state_key values written by workflow steps. */
|
|
3128
|
-
stateKey: string
|
|
3129
|
-
label: string
|
|
3038
|
+
/** One state within a stage: minimal shape of key + display label. */
|
|
3039
|
+
export interface StatefulStateDefinition {
|
|
3040
|
+
/** Matches state_key values written by workflow steps. */
|
|
3041
|
+
stateKey: string
|
|
3042
|
+
label: string
|
|
3130
3043
|
}
|
|
3131
3044
|
```
|
|
3132
3045
|
|
|
3133
3046
|
### `StatefulStageDefinition`
|
|
3134
3047
|
|
|
3135
3048
|
```typescript
|
|
3136
|
-
/** One stage within a pipeline
|
|
3137
|
-
export interface StatefulStageDefinition {
|
|
3138
|
-
/** Matches stage_key values written by workflow steps. */
|
|
3139
|
-
stageKey: string
|
|
3140
|
-
label: string
|
|
3141
|
-
/** UI color token. Consumers may map this to their design system. */
|
|
3142
|
-
color?: string
|
|
3143
|
-
states: StatefulStateDefinition[]
|
|
3049
|
+
/** One stage within a pipeline: has a stage_key and ordered valid states. */
|
|
3050
|
+
export interface StatefulStageDefinition {
|
|
3051
|
+
/** Matches stage_key values written by workflow steps. */
|
|
3052
|
+
stageKey: string
|
|
3053
|
+
label: string
|
|
3054
|
+
/** UI color token. Consumers may map this to their design system. */
|
|
3055
|
+
color?: string
|
|
3056
|
+
states: StatefulStateDefinition[]
|
|
3144
3057
|
}
|
|
3145
3058
|
```
|
|
3146
3059
|
|
|
3147
3060
|
### `StatefulPipelineDefinition`
|
|
3148
3061
|
|
|
3149
3062
|
```typescript
|
|
3150
|
-
/**
|
|
3151
|
-
* Pipeline definition for a single entity participating in the Stateful trait.
|
|
3152
|
-
* Parallel to acq_deals' pipeline_key concept but structured for
|
|
3153
|
-
*/
|
|
3154
|
-
export interface StatefulPipelineDefinition {
|
|
3155
|
-
/** Matches pipeline_key values in the database
|
|
3156
|
-
pipelineKey: string
|
|
3157
|
-
label: string
|
|
3158
|
-
/** Entity this pipeline applies to
|
|
3159
|
-
entityKey: string
|
|
3160
|
-
stages: StatefulStageDefinition[]
|
|
3063
|
+
/**
|
|
3064
|
+
* Pipeline definition for a single entity participating in the Stateful trait.
|
|
3065
|
+
* Parallel to acq_deals' pipeline_key concept but structured for any entity.
|
|
3066
|
+
*/
|
|
3067
|
+
export interface StatefulPipelineDefinition {
|
|
3068
|
+
/** Matches pipeline_key values in the database. */
|
|
3069
|
+
pipelineKey: string
|
|
3070
|
+
label: string
|
|
3071
|
+
/** Entity this pipeline applies to. */
|
|
3072
|
+
entityKey: string
|
|
3073
|
+
stages: StatefulStageDefinition[]
|
|
3161
3074
|
}
|
|
3162
3075
|
```
|
|
3163
3076
|
|
|
3164
3077
|
### `ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE`
|
|
3165
3078
|
|
|
3166
3079
|
```typescript
|
|
3167
|
-
/**
|
|
3168
|
-
* Lead-gen pipeline definition for acq_list_members (contacts).
|
|
3169
|
-
* Three stages matching the post-restructure sales subdomain tree.
|
|
3170
|
-
*
|
|
3171
|
-
* Note: members visit outreach and prospecting states depending on which
|
|
3172
|
-
* workflow last processed them. stage_key is set per-transition by the workflow.
|
|
3173
|
-
*/
|
|
3174
|
-
export const ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE: StatefulPipelineDefinition = {
|
|
3175
|
-
pipelineKey: 'lead-gen',
|
|
3176
|
-
label: 'Lead Generation',
|
|
3177
|
-
entityKey: 'acq.list-member',
|
|
3178
|
-
stages: [
|
|
3179
|
-
{
|
|
3180
|
-
stageKey: 'outreach',
|
|
3181
|
-
label: 'Outreach',
|
|
3182
|
-
states: [
|
|
3183
|
-
PENDING_STATE,
|
|
3184
|
-
{ stateKey: 'personalized', label: 'Personalized' },
|
|
3185
|
-
{ stateKey: 'uploaded', label: 'Uploaded' },
|
|
3186
|
-
{ stateKey: 'interested', label: 'Interested' }
|
|
3187
|
-
]
|
|
3188
|
-
},
|
|
3189
|
-
{
|
|
3190
|
-
stageKey: 'prospecting',
|
|
3191
|
-
label: 'Prospecting',
|
|
3192
|
-
states: [
|
|
3193
|
-
PENDING_STATE,
|
|
3194
|
-
{ stateKey: 'discovered', label: 'Discovered' },
|
|
3195
|
-
{ stateKey: 'verified', label: 'Verified' }
|
|
3196
|
-
]
|
|
3197
|
-
},
|
|
3198
|
-
{
|
|
3199
|
-
stageKey: 'qualification',
|
|
3200
|
-
label: 'Qualification',
|
|
3201
|
-
states: [PENDING_STATE]
|
|
3202
|
-
}
|
|
3203
|
-
]
|
|
3080
|
+
/**
|
|
3081
|
+
* Lead-gen pipeline definition for acq_list_members (contacts).
|
|
3082
|
+
* Three stages matching the post-restructure sales subdomain tree.
|
|
3083
|
+
*
|
|
3084
|
+
* Note: members visit outreach and prospecting states depending on which
|
|
3085
|
+
* workflow last processed them. stage_key is set per-transition by the workflow.
|
|
3086
|
+
*/
|
|
3087
|
+
export const ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE: StatefulPipelineDefinition = {
|
|
3088
|
+
pipelineKey: 'lead-gen',
|
|
3089
|
+
label: 'Lead Generation',
|
|
3090
|
+
entityKey: 'acq.list-member',
|
|
3091
|
+
stages: [
|
|
3092
|
+
{
|
|
3093
|
+
stageKey: 'outreach',
|
|
3094
|
+
label: 'Outreach',
|
|
3095
|
+
states: [
|
|
3096
|
+
PENDING_STATE,
|
|
3097
|
+
{ stateKey: 'personalized', label: 'Personalized' },
|
|
3098
|
+
{ stateKey: 'uploaded', label: 'Uploaded' },
|
|
3099
|
+
{ stateKey: 'interested', label: 'Interested' }
|
|
3100
|
+
]
|
|
3101
|
+
},
|
|
3102
|
+
{
|
|
3103
|
+
stageKey: 'prospecting',
|
|
3104
|
+
label: 'Prospecting',
|
|
3105
|
+
states: [
|
|
3106
|
+
PENDING_STATE,
|
|
3107
|
+
{ stateKey: 'discovered', label: 'Discovered' },
|
|
3108
|
+
{ stateKey: 'verified', label: 'Verified' }
|
|
3109
|
+
]
|
|
3110
|
+
},
|
|
3111
|
+
{
|
|
3112
|
+
stageKey: 'qualification',
|
|
3113
|
+
label: 'Qualification',
|
|
3114
|
+
states: [PENDING_STATE]
|
|
3115
|
+
}
|
|
3116
|
+
]
|
|
3204
3117
|
}
|
|
3205
3118
|
```
|
|
3206
3119
|
|
|
3207
3120
|
### `ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE`
|
|
3208
3121
|
|
|
3209
3122
|
```typescript
|
|
3210
|
-
/**
|
|
3211
|
-
* Lead-gen pipeline definition for acq_list_companies.
|
|
3212
|
-
* Three stages matching the post-restructure sales subdomain tree.
|
|
3213
|
-
*
|
|
3214
|
-
* Note: companies visit prospecting and qualification states depending on which
|
|
3215
|
-
* workflow last processed them. stage_key is set per-transition by the workflow.
|
|
3216
|
-
*/
|
|
3217
|
-
export const ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE: StatefulPipelineDefinition = {
|
|
3218
|
-
pipelineKey: 'lead-gen',
|
|
3219
|
-
label: 'Lead Generation',
|
|
3220
|
-
entityKey: 'acq.list-company',
|
|
3221
|
-
stages: [
|
|
3222
|
-
{
|
|
3223
|
-
stageKey: 'outreach',
|
|
3224
|
-
label: 'Outreach',
|
|
3225
|
-
states: [PENDING_STATE, { stateKey: 'uploaded', label: 'Uploaded' }]
|
|
3226
|
-
},
|
|
3227
|
-
{
|
|
3228
|
-
stageKey: 'prospecting',
|
|
3229
|
-
label: 'Prospecting',
|
|
3230
|
-
states: [
|
|
3231
|
-
PENDING_STATE,
|
|
3232
|
-
{ stateKey: 'populated', label: 'Populated' },
|
|
3233
|
-
{ stateKey: 'extracted', label: 'Extracted' }
|
|
3234
|
-
]
|
|
3235
|
-
},
|
|
3236
|
-
{
|
|
3237
|
-
stageKey: 'qualification',
|
|
3238
|
-
label: 'Qualification',
|
|
3239
|
-
states: [PENDING_STATE, { stateKey: 'qualified', label: 'Qualified' }]
|
|
3240
|
-
}
|
|
3241
|
-
]
|
|
3123
|
+
/**
|
|
3124
|
+
* Lead-gen pipeline definition for acq_list_companies.
|
|
3125
|
+
* Three stages matching the post-restructure sales subdomain tree.
|
|
3126
|
+
*
|
|
3127
|
+
* Note: companies visit prospecting and qualification states depending on which
|
|
3128
|
+
* workflow last processed them. stage_key is set per-transition by the workflow.
|
|
3129
|
+
*/
|
|
3130
|
+
export const ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE: StatefulPipelineDefinition = {
|
|
3131
|
+
pipelineKey: 'lead-gen',
|
|
3132
|
+
label: 'Lead Generation',
|
|
3133
|
+
entityKey: 'acq.list-company',
|
|
3134
|
+
stages: [
|
|
3135
|
+
{
|
|
3136
|
+
stageKey: 'outreach',
|
|
3137
|
+
label: 'Outreach',
|
|
3138
|
+
states: [PENDING_STATE, { stateKey: 'uploaded', label: 'Uploaded' }]
|
|
3139
|
+
},
|
|
3140
|
+
{
|
|
3141
|
+
stageKey: 'prospecting',
|
|
3142
|
+
label: 'Prospecting',
|
|
3143
|
+
states: [
|
|
3144
|
+
PENDING_STATE,
|
|
3145
|
+
{ stateKey: 'populated', label: 'Populated' },
|
|
3146
|
+
{ stateKey: 'extracted', label: 'Extracted' }
|
|
3147
|
+
]
|
|
3148
|
+
},
|
|
3149
|
+
{
|
|
3150
|
+
stageKey: 'qualification',
|
|
3151
|
+
label: 'Qualification',
|
|
3152
|
+
states: [PENDING_STATE, { stateKey: 'qualified', label: 'Qualified' }]
|
|
3153
|
+
}
|
|
3154
|
+
]
|
|
3242
3155
|
}
|
|
3243
3156
|
```
|
|
3244
3157
|
|
|
3245
3158
|
### `LEAD_GEN_PIPELINE_DEFINITIONS`
|
|
3246
3159
|
|
|
3247
3160
|
```typescript
|
|
3248
|
-
/**
|
|
3249
|
-
* All lead-gen pipeline definitions indexed by entity key.
|
|
3250
|
-
* Use findPipeline() to locate a definition by pipeline_key within any
|
|
3251
|
-
*/
|
|
3252
|
-
export const LEAD_GEN_PIPELINE_DEFINITIONS: Record<string, StatefulPipelineDefinition[]> = {
|
|
3253
|
-
'acq.list-member': [ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE],
|
|
3254
|
-
'acq.list-company': [ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE]
|
|
3161
|
+
/**
|
|
3162
|
+
* All lead-gen pipeline definitions indexed by entity key.
|
|
3163
|
+
* Use findPipeline() to locate a definition by pipeline_key within any array.
|
|
3164
|
+
*/
|
|
3165
|
+
export const LEAD_GEN_PIPELINE_DEFINITIONS: Record<string, StatefulPipelineDefinition[]> = {
|
|
3166
|
+
'acq.list-member': [ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE],
|
|
3167
|
+
'acq.list-company': [ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE]
|
|
3255
3168
|
}
|
|
3256
3169
|
```
|
|
3257
3170
|
|
|
@@ -3667,168 +3580,168 @@ export interface BulkImportCompaniesResult {
|
|
|
3667
3580
|
### `LeadToolMap`
|
|
3668
3581
|
|
|
3669
3582
|
```typescript
|
|
3670
|
-
export type LeadToolMap = {
|
|
3671
|
-
// List operations
|
|
3672
|
-
listLists: { params: Record<string, never>; result: AcqList[] }
|
|
3673
|
-
createList: { params: Omit<CreateListParams, 'organizationId'>; result: AcqList }
|
|
3674
|
-
updateList: { params: { id: string } & UpdateListParams; result: AcqList }
|
|
3675
|
-
deleteList: { params: { id: string }; result: void }
|
|
3676
|
-
addContactsToList: { params: Omit<AddContactsToListParams, 'organizationId'>; result: AddContactsToListResult }
|
|
3677
|
-
addCompaniesToList: { params: Omit<AddCompaniesToListParams, 'organizationId'>; result: AddCompaniesToListResult }
|
|
3678
|
-
updateCompanyStage: {
|
|
3679
|
-
params: Omit<UpdateCompanyStageParams, 'organizationId'>
|
|
3680
|
-
result: void
|
|
3681
|
-
}
|
|
3682
|
-
updateContactStage: {
|
|
3683
|
-
params: Omit<UpdateContactStageParams, 'organizationId'>
|
|
3684
|
-
result: void
|
|
3685
|
-
}
|
|
3686
|
-
// Company operations
|
|
3687
|
-
createCompany: { params: Omit<CreateCompanyParams, 'organizationId'>; result: AcqCompany }
|
|
3688
|
-
upsertCompany: { params: Omit<UpsertCompanyParams, 'organizationId'>; result: AcqCompany }
|
|
3689
|
-
updateCompany: { params: { id: string } & UpdateCompanyParams; result: AcqCompany }
|
|
3690
|
-
getCompany: { params: { id: string }; result: AcqCompany | null }
|
|
3691
|
-
listCompanies: { params: CompanyFilters; result: AcqCompany[] }
|
|
3692
|
-
deleteCompany: { params: { id: string }; result: void }
|
|
3693
|
-
// Contact operations
|
|
3694
|
-
createContact: { params: Omit<CreateContactParams, 'organizationId'>; result: AcqContact }
|
|
3695
|
-
upsertContact: { params: Omit<UpsertContactParams, 'organizationId'>; result: AcqContact }
|
|
3696
|
-
updateContact: { params: { id: string } & UpdateContactParams; result: AcqContact }
|
|
3697
|
-
getContact: { params: { id: string }; result: AcqContact | null }
|
|
3698
|
-
getContactByEmail: { params: { email: string }; result: AcqContact | null }
|
|
3699
|
-
listContacts: {
|
|
3700
|
-
params: ContactFilters & { limit?: number; offset?: number }
|
|
3701
|
-
result: PaginatedResult<AcqContact>
|
|
3702
|
-
}
|
|
3703
|
-
deleteContact: { params: { id: string }; result: void }
|
|
3704
|
-
bulkImportContacts: { params: Omit<BulkImportParams, 'organizationId'>; result: BulkImportResult }
|
|
3705
|
-
bulkImportCompanies: {
|
|
3706
|
-
params: Omit<BulkImportCompaniesParams, 'organizationId'>
|
|
3707
|
-
result: BulkImportCompaniesResult
|
|
3708
|
-
}
|
|
3709
|
-
deactivateContactsByCompany: {
|
|
3710
|
-
params: { companyId: string }
|
|
3711
|
-
result: { deactivated: number }
|
|
3712
|
-
}
|
|
3713
|
-
// Deal operations
|
|
3714
|
-
upsertDeal: { params: Omit<UpsertDealParams, 'organizationId'>; result: AcqDeal }
|
|
3715
|
-
getDealByEmail: { params: { email: string }; result: AcqDeal | null }
|
|
3716
|
-
getDealByEnvelopeId: { params: { envelopeId: string }; result: AcqDeal | null }
|
|
3717
|
-
updateDealEnvelopeId: { params: { dealId: string; envelopeId: string }; result: AcqDeal | null }
|
|
3718
|
-
getDealById: { params: Omit<GetDealByIdParams, 'organizationId'>; result: AcqDeal | null }
|
|
3719
|
-
getContactById: { params: Omit<GetContactByIdParams, 'organizationId'>; result: AcqContact | null }
|
|
3720
|
-
getCompanyById: { params: Omit<GetCompanyByIdParams, 'organizationId'>; result: AcqCompany | null }
|
|
3721
|
-
// Deal-sync operations
|
|
3722
|
-
updateDiscoveryData: { params: Omit<UpdateDiscoveryDataParams, 'organizationId'>; result: void }
|
|
3723
|
-
updateProposalData: { params: Omit<UpdateProposalDataParams, 'organizationId'>; result: void }
|
|
3724
|
-
markProposalSent: { params: Omit<MarkProposalSentParams, 'organizationId'>; result: void }
|
|
3725
|
-
markProposalReviewed: { params: Omit<MarkProposalReviewedParams, 'organizationId'>; result: void }
|
|
3726
|
-
updateCloseLostReason: { params: Omit<UpdateCloseLostReasonParams, 'organizationId'>; result: void }
|
|
3727
|
-
updateFees: { params: Omit<UpdateFeesParams, 'organizationId'>; result: void }
|
|
3728
|
-
cacheInstantlyThreadIds: { params: Omit<CacheInstantlyThreadIdsParams, 'organizationId'>; result: void }
|
|
3729
|
-
transitionItem: { params: Omit<TransitionItemParams, 'organizationId'>; result: void }
|
|
3730
|
-
setContactNurture: { params: Omit<SetContactNurtureParams, 'organizationId'>; result: void }
|
|
3731
|
-
cancelSchedulesAndHitlByEmail: {
|
|
3732
|
-
params: Omit<CancelSchedulesAndHitlByEmailParams, 'organizationId'>
|
|
3733
|
-
result: { schedulesCancelled: number; hitlDeleted: number }
|
|
3734
|
-
}
|
|
3735
|
-
cancelHitlByDealId: { params: Omit<CancelHitlByDealIdParams, 'organizationId'>; result: { hitlDeleted: number } }
|
|
3736
|
-
clearDealFields: { params: Omit<ClearDealFieldsParams, 'organizationId'>; result: void }
|
|
3737
|
-
deleteDeal: { params: Omit<DeleteDealParams, 'organizationId'>; result: void }
|
|
3738
|
-
recordDealActivity: {
|
|
3739
|
-
params: Omit<RecordDealActivityParams, 'organizationId'>
|
|
3740
|
-
result: void
|
|
3741
|
-
}
|
|
3742
|
-
// Deal note operations
|
|
3743
|
-
createDealNote: {
|
|
3744
|
-
params: Omit<CreateDealNoteParams, 'organizationId'>
|
|
3745
|
-
result: AcqDealNote
|
|
3746
|
-
}
|
|
3747
|
-
listDealNotes: {
|
|
3748
|
-
params: Omit<ListDealNotesParams, 'organizationId'>
|
|
3749
|
-
result: AcqDealNote[]
|
|
3750
|
-
}
|
|
3751
|
-
// Deal task operations
|
|
3752
|
-
createDealTask: {
|
|
3753
|
-
params: Omit<CreateDealTaskParams, 'organizationId'>
|
|
3754
|
-
result: AcqDealTask
|
|
3755
|
-
}
|
|
3756
|
-
listDealTasks: {
|
|
3757
|
-
params: Omit<ListDealTasksParams, 'organizationId'>
|
|
3758
|
-
result: AcqDealTask[]
|
|
3759
|
-
}
|
|
3760
|
-
listDealTasksDue: {
|
|
3761
|
-
params: Omit<ListDealTasksDueParams, 'organizationId'>
|
|
3762
|
-
result: AcqDealTask[]
|
|
3763
|
-
}
|
|
3764
|
-
completeDealTask: {
|
|
3765
|
-
params: Omit<CompleteDealTaskParams, 'organizationId'>
|
|
3766
|
-
result: AcqDealTask
|
|
3767
|
-
}
|
|
3768
|
-
// Deal query & analytics operations
|
|
3769
|
-
listDeals: { params: DealFilters; result: AcqDeal[] }
|
|
3770
|
-
getDealPipelineAnalytics: { params: { recentLimit?: number }; result: DealPipelineAnalytics }
|
|
3771
|
-
// Enrichment data operations
|
|
3772
|
-
mergeEnrichmentData: {
|
|
3773
|
-
params: { id: string; table: 'acq_companies' | 'acq_contacts'; data: Record<string, unknown> }
|
|
3774
|
-
result: void
|
|
3775
|
-
}
|
|
3776
|
-
// Social monitoring operations
|
|
3777
|
-
upsertSocialPosts: {
|
|
3778
|
-
params: { posts: Omit<UpsertSocialPostParams, 'organizationId'>[] }
|
|
3779
|
-
result: UpsertSocialPostsResult
|
|
3780
|
-
}
|
|
3781
|
-
setDealStateKey: {
|
|
3782
|
-
params: {
|
|
3783
|
-
dealId: string
|
|
3784
|
-
stateKey: string
|
|
3785
|
-
}
|
|
3786
|
-
result: { ok: true }
|
|
3787
|
-
}
|
|
3788
|
-
// CRM workflow helpers
|
|
3789
|
-
transitionDeal: {
|
|
3790
|
-
params: {
|
|
3791
|
-
dealId: string
|
|
3792
|
-
toStage: string
|
|
3793
|
-
toState?: string
|
|
3794
|
-
}
|
|
3795
|
-
result: { deal: AcqDeal }
|
|
3796
|
-
}
|
|
3797
|
-
loadDeal: {
|
|
3798
|
-
params: { dealId: string }
|
|
3799
|
-
result: DealDetail | null
|
|
3800
|
-
}
|
|
3583
|
+
export type LeadToolMap = {
|
|
3584
|
+
// List operations
|
|
3585
|
+
listLists: { params: Record<string, never>; result: AcqList[] }
|
|
3586
|
+
createList: { params: Omit<CreateListParams, 'organizationId'>; result: AcqList }
|
|
3587
|
+
updateList: { params: { id: string } & UpdateListParams; result: AcqList }
|
|
3588
|
+
deleteList: { params: { id: string }; result: void }
|
|
3589
|
+
addContactsToList: { params: Omit<AddContactsToListParams, 'organizationId'>; result: AddContactsToListResult }
|
|
3590
|
+
addCompaniesToList: { params: Omit<AddCompaniesToListParams, 'organizationId'>; result: AddCompaniesToListResult }
|
|
3591
|
+
updateCompanyStage: {
|
|
3592
|
+
params: Omit<UpdateCompanyStageParams, 'organizationId'>
|
|
3593
|
+
result: void
|
|
3594
|
+
}
|
|
3595
|
+
updateContactStage: {
|
|
3596
|
+
params: Omit<UpdateContactStageParams, 'organizationId'>
|
|
3597
|
+
result: void
|
|
3598
|
+
}
|
|
3599
|
+
// Company operations
|
|
3600
|
+
createCompany: { params: Omit<CreateCompanyParams, 'organizationId'>; result: AcqCompany }
|
|
3601
|
+
upsertCompany: { params: Omit<UpsertCompanyParams, 'organizationId'>; result: AcqCompany }
|
|
3602
|
+
updateCompany: { params: { id: string } & UpdateCompanyParams; result: AcqCompany }
|
|
3603
|
+
getCompany: { params: { id: string }; result: AcqCompany | null }
|
|
3604
|
+
listCompanies: { params: CompanyFilters; result: AcqCompany[] }
|
|
3605
|
+
deleteCompany: { params: { id: string }; result: void }
|
|
3606
|
+
// Contact operations
|
|
3607
|
+
createContact: { params: Omit<CreateContactParams, 'organizationId'>; result: AcqContact }
|
|
3608
|
+
upsertContact: { params: Omit<UpsertContactParams, 'organizationId'>; result: AcqContact }
|
|
3609
|
+
updateContact: { params: { id: string } & UpdateContactParams; result: AcqContact }
|
|
3610
|
+
getContact: { params: { id: string }; result: AcqContact | null }
|
|
3611
|
+
getContactByEmail: { params: { email: string }; result: AcqContact | null }
|
|
3612
|
+
listContacts: {
|
|
3613
|
+
params: ContactFilters & { limit?: number; offset?: number }
|
|
3614
|
+
result: PaginatedResult<AcqContact>
|
|
3615
|
+
}
|
|
3616
|
+
deleteContact: { params: { id: string }; result: void }
|
|
3617
|
+
bulkImportContacts: { params: Omit<BulkImportParams, 'organizationId'>; result: BulkImportResult }
|
|
3618
|
+
bulkImportCompanies: {
|
|
3619
|
+
params: Omit<BulkImportCompaniesParams, 'organizationId'>
|
|
3620
|
+
result: BulkImportCompaniesResult
|
|
3621
|
+
}
|
|
3622
|
+
deactivateContactsByCompany: {
|
|
3623
|
+
params: { companyId: string }
|
|
3624
|
+
result: { deactivated: number }
|
|
3625
|
+
}
|
|
3626
|
+
// Deal operations
|
|
3627
|
+
upsertDeal: { params: Omit<UpsertDealParams, 'organizationId'>; result: AcqDeal }
|
|
3628
|
+
getDealByEmail: { params: { email: string }; result: AcqDeal | null }
|
|
3629
|
+
getDealByEnvelopeId: { params: { envelopeId: string }; result: AcqDeal | null }
|
|
3630
|
+
updateDealEnvelopeId: { params: { dealId: string; envelopeId: string }; result: AcqDeal | null }
|
|
3631
|
+
getDealById: { params: Omit<GetDealByIdParams, 'organizationId'>; result: AcqDeal | null }
|
|
3632
|
+
getContactById: { params: Omit<GetContactByIdParams, 'organizationId'>; result: AcqContact | null }
|
|
3633
|
+
getCompanyById: { params: Omit<GetCompanyByIdParams, 'organizationId'>; result: AcqCompany | null }
|
|
3634
|
+
// Deal-sync operations
|
|
3635
|
+
updateDiscoveryData: { params: Omit<UpdateDiscoveryDataParams, 'organizationId'>; result: void }
|
|
3636
|
+
updateProposalData: { params: Omit<UpdateProposalDataParams, 'organizationId'>; result: void }
|
|
3637
|
+
markProposalSent: { params: Omit<MarkProposalSentParams, 'organizationId'>; result: void }
|
|
3638
|
+
markProposalReviewed: { params: Omit<MarkProposalReviewedParams, 'organizationId'>; result: void }
|
|
3639
|
+
updateCloseLostReason: { params: Omit<UpdateCloseLostReasonParams, 'organizationId'>; result: void }
|
|
3640
|
+
updateFees: { params: Omit<UpdateFeesParams, 'organizationId'>; result: void }
|
|
3641
|
+
cacheInstantlyThreadIds: { params: Omit<CacheInstantlyThreadIdsParams, 'organizationId'>; result: void }
|
|
3642
|
+
transitionItem: { params: Omit<TransitionItemParams, 'organizationId'>; result: void }
|
|
3643
|
+
setContactNurture: { params: Omit<SetContactNurtureParams, 'organizationId'>; result: void }
|
|
3644
|
+
cancelSchedulesAndHitlByEmail: {
|
|
3645
|
+
params: Omit<CancelSchedulesAndHitlByEmailParams, 'organizationId'>
|
|
3646
|
+
result: { schedulesCancelled: number; hitlDeleted: number }
|
|
3647
|
+
}
|
|
3648
|
+
cancelHitlByDealId: { params: Omit<CancelHitlByDealIdParams, 'organizationId'>; result: { hitlDeleted: number } }
|
|
3649
|
+
clearDealFields: { params: Omit<ClearDealFieldsParams, 'organizationId'>; result: void }
|
|
3650
|
+
deleteDeal: { params: Omit<DeleteDealParams, 'organizationId'>; result: void }
|
|
3651
|
+
recordDealActivity: {
|
|
3652
|
+
params: Omit<RecordDealActivityParams, 'organizationId'>
|
|
3653
|
+
result: void
|
|
3654
|
+
}
|
|
3655
|
+
// Deal note operations
|
|
3656
|
+
createDealNote: {
|
|
3657
|
+
params: Omit<CreateDealNoteParams, 'organizationId'>
|
|
3658
|
+
result: AcqDealNote
|
|
3659
|
+
}
|
|
3660
|
+
listDealNotes: {
|
|
3661
|
+
params: Omit<ListDealNotesParams, 'organizationId'>
|
|
3662
|
+
result: AcqDealNote[]
|
|
3663
|
+
}
|
|
3664
|
+
// Deal task operations
|
|
3665
|
+
createDealTask: {
|
|
3666
|
+
params: Omit<CreateDealTaskParams, 'organizationId'>
|
|
3667
|
+
result: AcqDealTask
|
|
3668
|
+
}
|
|
3669
|
+
listDealTasks: {
|
|
3670
|
+
params: Omit<ListDealTasksParams, 'organizationId'>
|
|
3671
|
+
result: AcqDealTask[]
|
|
3672
|
+
}
|
|
3673
|
+
listDealTasksDue: {
|
|
3674
|
+
params: Omit<ListDealTasksDueParams, 'organizationId'>
|
|
3675
|
+
result: AcqDealTask[]
|
|
3676
|
+
}
|
|
3677
|
+
completeDealTask: {
|
|
3678
|
+
params: Omit<CompleteDealTaskParams, 'organizationId'>
|
|
3679
|
+
result: AcqDealTask
|
|
3680
|
+
}
|
|
3681
|
+
// Deal query & analytics operations
|
|
3682
|
+
listDeals: { params: DealFilters; result: AcqDeal[] }
|
|
3683
|
+
getDealPipelineAnalytics: { params: { recentLimit?: number }; result: DealPipelineAnalytics }
|
|
3684
|
+
// Enrichment data operations
|
|
3685
|
+
mergeEnrichmentData: {
|
|
3686
|
+
params: { id: string; table: 'acq_companies' | 'acq_contacts'; data: Record<string, unknown> }
|
|
3687
|
+
result: void
|
|
3688
|
+
}
|
|
3689
|
+
// Social monitoring operations
|
|
3690
|
+
upsertSocialPosts: {
|
|
3691
|
+
params: { posts: Omit<UpsertSocialPostParams, 'organizationId'>[] }
|
|
3692
|
+
result: UpsertSocialPostsResult
|
|
3693
|
+
}
|
|
3694
|
+
setDealStateKey: {
|
|
3695
|
+
params: {
|
|
3696
|
+
dealId: string
|
|
3697
|
+
stateKey: string
|
|
3698
|
+
}
|
|
3699
|
+
result: { ok: true }
|
|
3700
|
+
}
|
|
3701
|
+
// CRM workflow helpers
|
|
3702
|
+
transitionDeal: {
|
|
3703
|
+
params: {
|
|
3704
|
+
dealId: string
|
|
3705
|
+
toStage: string
|
|
3706
|
+
toState?: string
|
|
3707
|
+
}
|
|
3708
|
+
result: { deal: AcqDeal }
|
|
3709
|
+
}
|
|
3710
|
+
loadDeal: {
|
|
3711
|
+
params: { dealId: string }
|
|
3712
|
+
result: DealDetail | null
|
|
3713
|
+
}
|
|
3801
3714
|
}
|
|
3802
3715
|
```
|
|
3803
3716
|
|
|
3804
3717
|
### `ListToolMap`
|
|
3805
3718
|
|
|
3806
3719
|
```typescript
|
|
3807
|
-
export type ListToolMap = {
|
|
3808
|
-
getConfig: {
|
|
3809
|
-
params: { listId: string }
|
|
3810
|
-
result: { scrapingConfig: ScrapingConfig; icp: IcpRubric; pipelineConfig: PipelineConfig }
|
|
3811
|
-
}
|
|
3812
|
-
recordExecution: {
|
|
3813
|
-
params: Omit<RecordListExecutionParams, 'organizationId'>
|
|
3814
|
-
result: void
|
|
3815
|
-
}
|
|
3816
|
-
updateCompanyStage: {
|
|
3817
|
-
params: Omit<UpdateCompanyStageParams, 'organizationId'>
|
|
3818
|
-
result: void
|
|
3819
|
-
}
|
|
3820
|
-
updateContactStage: {
|
|
3821
|
-
params: Omit<UpdateContactStageParams, 'organizationId'>
|
|
3822
|
-
result: void
|
|
3823
|
-
}
|
|
3824
|
-
listPendingCompanyIds: {
|
|
3825
|
-
params: Omit<ListPendingCompanyIdsParams, 'organizationId'>
|
|
3826
|
-
result: string[]
|
|
3827
|
-
}
|
|
3828
|
-
listPendingContactIds: {
|
|
3829
|
-
params: Omit<ListPendingContactIdsParams, 'organizationId'>
|
|
3830
|
-
result: string[]
|
|
3831
|
-
}
|
|
3720
|
+
export type ListToolMap = {
|
|
3721
|
+
getConfig: {
|
|
3722
|
+
params: { listId: string }
|
|
3723
|
+
result: { scrapingConfig: ScrapingConfig; icp: IcpRubric; pipelineConfig: PipelineConfig }
|
|
3724
|
+
}
|
|
3725
|
+
recordExecution: {
|
|
3726
|
+
params: Omit<RecordListExecutionParams, 'organizationId'>
|
|
3727
|
+
result: void
|
|
3728
|
+
}
|
|
3729
|
+
updateCompanyStage: {
|
|
3730
|
+
params: Omit<UpdateCompanyStageParams, 'organizationId'>
|
|
3731
|
+
result: void
|
|
3732
|
+
}
|
|
3733
|
+
updateContactStage: {
|
|
3734
|
+
params: Omit<UpdateContactStageParams, 'organizationId'>
|
|
3735
|
+
result: void
|
|
3736
|
+
}
|
|
3737
|
+
listPendingCompanyIds: {
|
|
3738
|
+
params: Omit<ListPendingCompanyIdsParams, 'organizationId'>
|
|
3739
|
+
result: string[]
|
|
3740
|
+
}
|
|
3741
|
+
listPendingContactIds: {
|
|
3742
|
+
params: Omit<ListPendingContactIdsParams, 'organizationId'>
|
|
3743
|
+
result: string[]
|
|
3744
|
+
}
|
|
3832
3745
|
}
|
|
3833
3746
|
```
|
|
3834
3747
|
|