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