@elevasis/sdk 1.13.2 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +1 -1
- package/dist/index.d.ts +961 -1059
- package/dist/index.js +1 -1
- package/dist/test-utils/index.d.ts +899 -997
- package/dist/test-utils/index.js +6 -3
- package/dist/worker/index.js +1 -2
- package/package.json +2 -2
- package/reference/claude-config/rules/ui.md +8 -8
- package/reference/claude-config/rules/vibe.md +11 -11
- package/reference/scaffold/index.mdx +8 -8
- package/reference/scaffold/recipes/customize-crm-actions.md +408 -408
- package/reference/scaffold/recipes/extend-crm.md +252 -252
- package/reference/scaffold/recipes/index.md +20 -20
- package/reference/scaffold/reference/contracts.md +1478 -1561
|
@@ -812,73 +812,73 @@ export interface DeploymentSpec {
|
|
|
812
812
|
### `AcqCompany`
|
|
813
813
|
|
|
814
814
|
```typescript
|
|
815
|
-
/**
|
|
816
|
-
* Company record in the acquisition database.
|
|
817
|
-
* Contains enriched company data from various sources.
|
|
818
|
-
* Transformed from AcqCompanyRow with camelCase properties.
|
|
819
|
-
*/
|
|
820
|
-
export interface AcqCompany {
|
|
821
|
-
id: string
|
|
822
|
-
organizationId: string
|
|
823
|
-
name: string
|
|
824
|
-
domain: string | null
|
|
825
|
-
linkedinUrl: string | null
|
|
826
|
-
website: string | null
|
|
827
|
-
numEmployees: number | null
|
|
828
|
-
foundedYear: number | null
|
|
829
|
-
locationCity: string | null
|
|
830
|
-
locationState: string | null
|
|
831
|
-
category: string | null
|
|
832
|
-
categoryPain: string | null
|
|
833
|
-
segment: string | null
|
|
834
|
-
pipelineStatus: CompanyPipelineStatus | null
|
|
835
|
-
enrichmentData: CompanyEnrichmentData | null
|
|
836
|
-
source: string | null
|
|
837
|
-
batchId: string | null
|
|
838
|
-
status: 'active' | 'invalid'
|
|
839
|
-
verticalResearch: string | null
|
|
840
|
-
/** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
|
|
841
|
-
qualificationScore: number | null
|
|
842
|
-
/** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
|
|
843
|
-
qualificationSignals: Record<string, unknown> | null
|
|
844
|
-
/** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
|
|
845
|
-
qualificationRubricKey: string | null
|
|
846
|
-
createdAt: Date
|
|
847
|
-
updatedAt: Date
|
|
815
|
+
/**
|
|
816
|
+
* Company record in the acquisition database.
|
|
817
|
+
* Contains enriched company data from various sources.
|
|
818
|
+
* Transformed from AcqCompanyRow with camelCase properties.
|
|
819
|
+
*/
|
|
820
|
+
export interface AcqCompany {
|
|
821
|
+
id: string
|
|
822
|
+
organizationId: string
|
|
823
|
+
name: string
|
|
824
|
+
domain: string | null
|
|
825
|
+
linkedinUrl: string | null
|
|
826
|
+
website: string | null
|
|
827
|
+
numEmployees: number | null
|
|
828
|
+
foundedYear: number | null
|
|
829
|
+
locationCity: string | null
|
|
830
|
+
locationState: string | null
|
|
831
|
+
category: string | null
|
|
832
|
+
categoryPain: string | null
|
|
833
|
+
segment: string | null
|
|
834
|
+
pipelineStatus: CompanyPipelineStatus | null
|
|
835
|
+
enrichmentData: CompanyEnrichmentData | null
|
|
836
|
+
source: string | null
|
|
837
|
+
batchId: string | null
|
|
838
|
+
status: 'active' | 'invalid'
|
|
839
|
+
verticalResearch: string | null
|
|
840
|
+
/** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
|
|
841
|
+
qualificationScore: number | null
|
|
842
|
+
/** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
|
|
843
|
+
qualificationSignals: Record<string, unknown> | null
|
|
844
|
+
/** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
|
|
845
|
+
qualificationRubricKey: string | null
|
|
846
|
+
createdAt: Date
|
|
847
|
+
updatedAt: Date
|
|
848
848
|
}
|
|
849
849
|
```
|
|
850
850
|
|
|
851
851
|
### `AcqContact`
|
|
852
852
|
|
|
853
853
|
```typescript
|
|
854
|
-
/**
|
|
855
|
-
* Contact record in the acquisition database.
|
|
856
|
-
* Contains enriched contact data and personalization content.
|
|
857
|
-
* Transformed from AcqContactRow with camelCase properties.
|
|
858
|
-
*/
|
|
859
|
-
export interface AcqContact {
|
|
860
|
-
id: string
|
|
861
|
-
organizationId: string
|
|
862
|
-
companyId: string | null
|
|
863
|
-
email: string
|
|
864
|
-
emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null
|
|
865
|
-
firstName: string | null
|
|
866
|
-
lastName: string | null
|
|
867
|
-
linkedinUrl: string | null
|
|
868
|
-
title: string | null
|
|
869
|
-
headline: string | null
|
|
870
|
-
filterReason: string | null
|
|
871
|
-
openingLine: string | null
|
|
872
|
-
source: string | null
|
|
873
|
-
sourceId: string | null
|
|
874
|
-
pipelineStatus: ContactPipelineStatus | null
|
|
875
|
-
enrichmentData: ContactEnrichmentData | null
|
|
876
|
-
/** Attio Person record ID - set when contact responds and is added to CRM */
|
|
877
|
-
attioPersonId: string | null
|
|
878
|
-
batchId: string | null
|
|
879
|
-
status: 'active' | 'invalid'
|
|
880
|
-
createdAt: Date
|
|
881
|
-
updatedAt: Date
|
|
854
|
+
/**
|
|
855
|
+
* Contact record in the acquisition database.
|
|
856
|
+
* Contains enriched contact data and personalization content.
|
|
857
|
+
* Transformed from AcqContactRow with camelCase properties.
|
|
858
|
+
*/
|
|
859
|
+
export interface AcqContact {
|
|
860
|
+
id: string
|
|
861
|
+
organizationId: string
|
|
862
|
+
companyId: string | null
|
|
863
|
+
email: string
|
|
864
|
+
emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null
|
|
865
|
+
firstName: string | null
|
|
866
|
+
lastName: string | null
|
|
867
|
+
linkedinUrl: string | null
|
|
868
|
+
title: string | null
|
|
869
|
+
headline: string | null
|
|
870
|
+
filterReason: string | null
|
|
871
|
+
openingLine: string | null
|
|
872
|
+
source: string | null
|
|
873
|
+
sourceId: string | null
|
|
874
|
+
pipelineStatus: ContactPipelineStatus | null
|
|
875
|
+
enrichmentData: ContactEnrichmentData | null
|
|
876
|
+
/** Attio Person record ID - set when contact responds and is added to CRM */
|
|
877
|
+
attioPersonId: string | null
|
|
878
|
+
batchId: string | null
|
|
879
|
+
status: 'active' | 'invalid'
|
|
880
|
+
createdAt: Date
|
|
881
|
+
updatedAt: Date
|
|
882
882
|
}
|
|
883
883
|
```
|
|
884
884
|
|
|
@@ -891,9 +891,9 @@ export type DealStage = 'interested' | 'proposal' | 'closing' | 'closed_won' | '
|
|
|
891
891
|
### `KanbanStageConfig`
|
|
892
892
|
|
|
893
893
|
```typescript
|
|
894
|
-
export interface KanbanStageConfig {
|
|
895
|
-
color: string // Mantine color token (e.g. 'blue', 'teal')
|
|
896
|
-
label?: string // Optional display label override
|
|
894
|
+
export interface KanbanStageConfig {
|
|
895
|
+
color: string // Mantine color token (e.g. 'blue', 'teal')
|
|
896
|
+
label?: string // Optional display label override
|
|
897
897
|
}
|
|
898
898
|
```
|
|
899
899
|
|
|
@@ -906,46 +906,46 @@ export type KanbanBoardConfig = Partial<Record<DealStage, KanbanStageConfig>>
|
|
|
906
906
|
### `DealContact`
|
|
907
907
|
|
|
908
908
|
```typescript
|
|
909
|
-
export interface DealContact {
|
|
910
|
-
id: string
|
|
911
|
-
first_name: string | null
|
|
912
|
-
last_name: string | null
|
|
913
|
-
email: string
|
|
914
|
-
title: string | null
|
|
915
|
-
headline: string | null
|
|
916
|
-
linkedin_url: string | null
|
|
917
|
-
pipeline_status: Record<string, unknown> | null
|
|
918
|
-
enrichment_data: Record<string, unknown> | null
|
|
919
|
-
company: {
|
|
920
|
-
id: string
|
|
921
|
-
name: string
|
|
922
|
-
domain: string | null
|
|
923
|
-
website: string | null
|
|
924
|
-
linkedin_url: string | null
|
|
925
|
-
segment: string | null
|
|
926
|
-
category: string | null
|
|
927
|
-
num_employees: number | null
|
|
928
|
-
} | null
|
|
909
|
+
export interface DealContact {
|
|
910
|
+
id: string
|
|
911
|
+
first_name: string | null
|
|
912
|
+
last_name: string | null
|
|
913
|
+
email: string
|
|
914
|
+
title: string | null
|
|
915
|
+
headline: string | null
|
|
916
|
+
linkedin_url: string | null
|
|
917
|
+
pipeline_status: Record<string, unknown> | null
|
|
918
|
+
enrichment_data: Record<string, unknown> | null
|
|
919
|
+
company: {
|
|
920
|
+
id: string
|
|
921
|
+
name: string
|
|
922
|
+
domain: string | null
|
|
923
|
+
website: string | null
|
|
924
|
+
linkedin_url: string | null
|
|
925
|
+
segment: string | null
|
|
926
|
+
category: string | null
|
|
927
|
+
num_employees: number | null
|
|
928
|
+
} | null
|
|
929
929
|
}
|
|
930
930
|
```
|
|
931
931
|
|
|
932
932
|
### `DealFilters`
|
|
933
933
|
|
|
934
934
|
```typescript
|
|
935
|
-
export interface DealFilters {
|
|
936
|
-
stage?: DealStage
|
|
937
|
-
search?: string
|
|
938
|
-
limit?: number
|
|
939
|
-
offset?: number
|
|
935
|
+
export interface DealFilters {
|
|
936
|
+
stage?: DealStage
|
|
937
|
+
search?: string
|
|
938
|
+
limit?: number
|
|
939
|
+
offset?: number
|
|
940
940
|
}
|
|
941
941
|
```
|
|
942
942
|
|
|
943
943
|
### `DealListItem`
|
|
944
944
|
|
|
945
945
|
```typescript
|
|
946
|
-
/** Deal list item with joined contact and company data */
|
|
947
|
-
export interface DealListItem extends AcqDealRow {
|
|
948
|
-
contact: DealContact | null
|
|
946
|
+
/** Deal list item with joined contact and company data */
|
|
947
|
+
export interface DealListItem extends AcqDealRow {
|
|
948
|
+
contact: DealContact | null
|
|
949
949
|
}
|
|
950
950
|
```
|
|
951
951
|
|
|
@@ -958,31 +958,31 @@ export type DealDetail = DealListItem
|
|
|
958
958
|
### `AcqDealTaskKind`
|
|
959
959
|
|
|
960
960
|
```typescript
|
|
961
|
-
/** Task kind options for a deal task (human follow-up action type) */
|
|
961
|
+
/** Task kind options for a deal task (human follow-up action type) */
|
|
962
962
|
export type AcqDealTaskKind = 'call' | 'email' | 'meeting' | 'other'
|
|
963
963
|
```
|
|
964
964
|
|
|
965
965
|
### `AcqDealTask`
|
|
966
966
|
|
|
967
967
|
```typescript
|
|
968
|
-
/**
|
|
969
|
-
* A CRM to-do item attached to a deal representing a human follow-up action.
|
|
970
|
-
* Transformed from AcqDealTaskRow with camelCase properties.
|
|
971
|
-
*/
|
|
972
|
-
export interface AcqDealTask {
|
|
973
|
-
id: string
|
|
974
|
-
organizationId: string
|
|
975
|
-
dealId: string
|
|
976
|
-
title: string
|
|
977
|
-
description: string | null
|
|
978
|
-
kind: AcqDealTaskKind
|
|
979
|
-
dueAt: string | null
|
|
980
|
-
assigneeUserId: string | null
|
|
981
|
-
completedAt: string | null
|
|
982
|
-
completedByUserId: string | null
|
|
983
|
-
createdAt: string
|
|
984
|
-
updatedAt: string
|
|
985
|
-
createdByUserId: string | null
|
|
968
|
+
/**
|
|
969
|
+
* A CRM to-do item attached to a deal representing a human follow-up action.
|
|
970
|
+
* Transformed from AcqDealTaskRow with camelCase properties.
|
|
971
|
+
*/
|
|
972
|
+
export interface AcqDealTask {
|
|
973
|
+
id: string
|
|
974
|
+
organizationId: string
|
|
975
|
+
dealId: string
|
|
976
|
+
title: string
|
|
977
|
+
description: string | null
|
|
978
|
+
kind: AcqDealTaskKind
|
|
979
|
+
dueAt: string | null
|
|
980
|
+
assigneeUserId: string | null
|
|
981
|
+
completedAt: string | null
|
|
982
|
+
completedByUserId: string | null
|
|
983
|
+
createdAt: string
|
|
984
|
+
updatedAt: string
|
|
985
|
+
createdByUserId: string | null
|
|
986
986
|
}
|
|
987
987
|
```
|
|
988
988
|
|
|
@@ -1001,218 +1001,218 @@ export const AcqDealTaskKindSchema = z.enum(['call', 'email', 'meeting', 'other'
|
|
|
1001
1001
|
### `DealIdParamsSchema`
|
|
1002
1002
|
|
|
1003
1003
|
```typescript
|
|
1004
|
-
export const DealIdParamsSchema = z.object({
|
|
1005
|
-
dealId: UuidSchema
|
|
1004
|
+
export const DealIdParamsSchema = z.object({
|
|
1005
|
+
dealId: UuidSchema
|
|
1006
1006
|
})
|
|
1007
1007
|
```
|
|
1008
1008
|
|
|
1009
1009
|
### `DealTaskIdParamsSchema`
|
|
1010
1010
|
|
|
1011
1011
|
```typescript
|
|
1012
|
-
export const DealTaskIdParamsSchema = z.object({
|
|
1013
|
-
dealId: UuidSchema,
|
|
1014
|
-
taskId: UuidSchema
|
|
1012
|
+
export const DealTaskIdParamsSchema = z.object({
|
|
1013
|
+
dealId: UuidSchema,
|
|
1014
|
+
taskId: UuidSchema
|
|
1015
1015
|
})
|
|
1016
1016
|
```
|
|
1017
1017
|
|
|
1018
1018
|
### `ListDealsQuerySchema`
|
|
1019
1019
|
|
|
1020
1020
|
```typescript
|
|
1021
|
-
export const ListDealsQuerySchema = z
|
|
1022
|
-
.object({
|
|
1023
|
-
stage: DealStageSchema.optional(),
|
|
1024
|
-
search: z.string().optional(),
|
|
1025
|
-
limit: z.coerce.number().int().positive().default(50),
|
|
1026
|
-
offset: z.coerce.number().int().min(0).default(0)
|
|
1027
|
-
})
|
|
1021
|
+
export const ListDealsQuerySchema = z
|
|
1022
|
+
.object({
|
|
1023
|
+
stage: DealStageSchema.optional(),
|
|
1024
|
+
search: z.string().optional(),
|
|
1025
|
+
limit: z.coerce.number().int().positive().default(50),
|
|
1026
|
+
offset: z.coerce.number().int().min(0).default(0)
|
|
1027
|
+
})
|
|
1028
1028
|
.strict()
|
|
1029
1029
|
```
|
|
1030
1030
|
|
|
1031
1031
|
### `DealLookupQuerySchema`
|
|
1032
1032
|
|
|
1033
1033
|
```typescript
|
|
1034
|
-
export const DealLookupQuerySchema = z
|
|
1035
|
-
.object({
|
|
1036
|
-
search: z.string().trim().min(1).max(200).optional(),
|
|
1037
|
-
limit: z.coerce.number().int().min(1).max(25).default(10)
|
|
1038
|
-
})
|
|
1034
|
+
export const DealLookupQuerySchema = z
|
|
1035
|
+
.object({
|
|
1036
|
+
search: z.string().trim().min(1).max(200).optional(),
|
|
1037
|
+
limit: z.coerce.number().int().min(1).max(25).default(10)
|
|
1038
|
+
})
|
|
1039
1039
|
.strict()
|
|
1040
1040
|
```
|
|
1041
1041
|
|
|
1042
1042
|
### `ListDealTasksDueQuerySchema`
|
|
1043
1043
|
|
|
1044
1044
|
```typescript
|
|
1045
|
-
export const ListDealTasksDueQuerySchema = z
|
|
1046
|
-
.object({
|
|
1047
|
-
window: z.enum(['overdue', 'today', 'today_and_overdue', 'upcoming']).optional(),
|
|
1048
|
-
assigneeUserId: UuidSchema.optional()
|
|
1049
|
-
})
|
|
1045
|
+
export const ListDealTasksDueQuerySchema = z
|
|
1046
|
+
.object({
|
|
1047
|
+
window: z.enum(['overdue', 'today', 'today_and_overdue', 'upcoming']).optional(),
|
|
1048
|
+
assigneeUserId: UuidSchema.optional()
|
|
1049
|
+
})
|
|
1050
1050
|
.strict()
|
|
1051
1051
|
```
|
|
1052
1052
|
|
|
1053
1053
|
### `CreateDealNoteRequestSchema`
|
|
1054
1054
|
|
|
1055
1055
|
```typescript
|
|
1056
|
-
export const CreateDealNoteRequestSchema = z
|
|
1057
|
-
.object({
|
|
1058
|
-
body: z.string().trim().min(1).max(10000)
|
|
1059
|
-
})
|
|
1056
|
+
export const CreateDealNoteRequestSchema = z
|
|
1057
|
+
.object({
|
|
1058
|
+
body: z.string().trim().min(1).max(10000)
|
|
1059
|
+
})
|
|
1060
1060
|
.strict()
|
|
1061
1061
|
```
|
|
1062
1062
|
|
|
1063
1063
|
### `CreateDealTaskRequestSchema`
|
|
1064
1064
|
|
|
1065
1065
|
```typescript
|
|
1066
|
-
export const CreateDealTaskRequestSchema = z
|
|
1067
|
-
.object({
|
|
1068
|
-
title: z.string().trim().min(1).max(255),
|
|
1069
|
-
description: z.string().nullable().optional(),
|
|
1070
|
-
kind: AcqDealTaskKindSchema.optional(),
|
|
1071
|
-
dueAt: z.string().datetime().nullable().optional(),
|
|
1072
|
-
assigneeUserId: UuidSchema.nullable().optional()
|
|
1073
|
-
})
|
|
1066
|
+
export const CreateDealTaskRequestSchema = z
|
|
1067
|
+
.object({
|
|
1068
|
+
title: z.string().trim().min(1).max(255),
|
|
1069
|
+
description: z.string().nullable().optional(),
|
|
1070
|
+
kind: AcqDealTaskKindSchema.optional(),
|
|
1071
|
+
dueAt: z.string().datetime().nullable().optional(),
|
|
1072
|
+
assigneeUserId: UuidSchema.nullable().optional()
|
|
1073
|
+
})
|
|
1074
1074
|
.strict()
|
|
1075
1075
|
```
|
|
1076
1076
|
|
|
1077
1077
|
### `TransitionItemRequestSchema`
|
|
1078
1078
|
|
|
1079
1079
|
```typescript
|
|
1080
|
-
export const TransitionItemRequestSchema = z
|
|
1081
|
-
.object({
|
|
1082
|
-
pipelineKey: z.string().min(1),
|
|
1083
|
-
stageKey: z.string().min(1),
|
|
1084
|
-
stateKey: z.string().nullable().optional(),
|
|
1085
|
-
reason: z.string().optional(),
|
|
1086
|
-
expectedUpdatedAt: z.string().datetime().optional()
|
|
1087
|
-
})
|
|
1080
|
+
export const TransitionItemRequestSchema = z
|
|
1081
|
+
.object({
|
|
1082
|
+
pipelineKey: z.string().min(1),
|
|
1083
|
+
stageKey: z.string().min(1),
|
|
1084
|
+
stateKey: z.string().nullable().optional(),
|
|
1085
|
+
reason: z.string().optional(),
|
|
1086
|
+
expectedUpdatedAt: z.string().datetime().optional()
|
|
1087
|
+
})
|
|
1088
1088
|
.strict()
|
|
1089
1089
|
```
|
|
1090
1090
|
|
|
1091
1091
|
### `ExecuteActionParamsSchema`
|
|
1092
1092
|
|
|
1093
1093
|
```typescript
|
|
1094
|
-
export const ExecuteActionParamsSchema = z
|
|
1095
|
-
.object({
|
|
1096
|
-
dealId: UuidSchema,
|
|
1097
|
-
actionKey: NonEmptyStringSchema
|
|
1098
|
-
})
|
|
1094
|
+
export const ExecuteActionParamsSchema = z
|
|
1095
|
+
.object({
|
|
1096
|
+
dealId: UuidSchema,
|
|
1097
|
+
actionKey: NonEmptyStringSchema
|
|
1098
|
+
})
|
|
1099
1099
|
.strict()
|
|
1100
1100
|
```
|
|
1101
1101
|
|
|
1102
1102
|
### `ExecuteActionRequestSchema`
|
|
1103
1103
|
|
|
1104
1104
|
```typescript
|
|
1105
|
-
export const ExecuteActionRequestSchema = z
|
|
1106
|
-
.object({
|
|
1107
|
-
payload: z.record(z.string(), z.unknown()).optional()
|
|
1108
|
-
})
|
|
1105
|
+
export const ExecuteActionRequestSchema = z
|
|
1106
|
+
.object({
|
|
1107
|
+
payload: z.record(z.string(), z.unknown()).optional()
|
|
1108
|
+
})
|
|
1109
1109
|
.strict()
|
|
1110
1110
|
```
|
|
1111
1111
|
|
|
1112
1112
|
### `DealContactSummarySchema`
|
|
1113
1113
|
|
|
1114
1114
|
```typescript
|
|
1115
|
-
/**
|
|
1116
|
-
* Contact summary nested inside DealListItem / DealDetailResponse.
|
|
1117
|
-
* Matches the joined shape returned by useDeals / useDealDetail Supabase queries.
|
|
1118
|
-
*/
|
|
1119
|
-
export const DealContactSummarySchema = z.object({
|
|
1120
|
-
id: z.string(),
|
|
1121
|
-
first_name: z.string().nullable(),
|
|
1122
|
-
last_name: z.string().nullable(),
|
|
1123
|
-
email: z.string(),
|
|
1124
|
-
title: z.string().nullable(),
|
|
1125
|
-
headline: z.string().nullable(),
|
|
1126
|
-
linkedin_url: z.string().nullable(),
|
|
1127
|
-
pipeline_status: z.record(z.string(), z.unknown()).nullable(),
|
|
1128
|
-
enrichment_data: z.record(z.string(), z.unknown()).nullable(),
|
|
1129
|
-
company: z
|
|
1130
|
-
.object({
|
|
1131
|
-
id: z.string(),
|
|
1132
|
-
name: z.string(),
|
|
1133
|
-
domain: z.string().nullable(),
|
|
1134
|
-
website: z.string().nullable(),
|
|
1135
|
-
linkedin_url: z.string().nullable(),
|
|
1136
|
-
segment: z.string().nullable(),
|
|
1137
|
-
category: z.string().nullable(),
|
|
1138
|
-
num_employees: z.number().nullable()
|
|
1139
|
-
})
|
|
1140
|
-
.nullable()
|
|
1115
|
+
/**
|
|
1116
|
+
* Contact summary nested inside DealListItem / DealDetailResponse.
|
|
1117
|
+
* Matches the joined shape returned by useDeals / useDealDetail Supabase queries.
|
|
1118
|
+
*/
|
|
1119
|
+
export const DealContactSummarySchema = z.object({
|
|
1120
|
+
id: z.string(),
|
|
1121
|
+
first_name: z.string().nullable(),
|
|
1122
|
+
last_name: z.string().nullable(),
|
|
1123
|
+
email: z.string(),
|
|
1124
|
+
title: z.string().nullable(),
|
|
1125
|
+
headline: z.string().nullable(),
|
|
1126
|
+
linkedin_url: z.string().nullable(),
|
|
1127
|
+
pipeline_status: z.record(z.string(), z.unknown()).nullable(),
|
|
1128
|
+
enrichment_data: z.record(z.string(), z.unknown()).nullable(),
|
|
1129
|
+
company: z
|
|
1130
|
+
.object({
|
|
1131
|
+
id: z.string(),
|
|
1132
|
+
name: z.string(),
|
|
1133
|
+
domain: z.string().nullable(),
|
|
1134
|
+
website: z.string().nullable(),
|
|
1135
|
+
linkedin_url: z.string().nullable(),
|
|
1136
|
+
segment: z.string().nullable(),
|
|
1137
|
+
category: z.string().nullable(),
|
|
1138
|
+
num_employees: z.number().nullable()
|
|
1139
|
+
})
|
|
1140
|
+
.nullable()
|
|
1141
1141
|
})
|
|
1142
1142
|
```
|
|
1143
1143
|
|
|
1144
1144
|
### `DealListItemSchema`
|
|
1145
1145
|
|
|
1146
1146
|
```typescript
|
|
1147
|
-
/**
|
|
1148
|
-
* Deal list item with joined contact (and company via contact).
|
|
1149
|
-
* Matches DealListItem from @repo/core types.
|
|
1150
|
-
*/
|
|
1151
|
-
export const DealListItemSchema = z.object({
|
|
1152
|
-
// acq_deals columns
|
|
1153
|
-
id: z.string(),
|
|
1154
|
-
organization_id: z.string(),
|
|
1155
|
-
contact_id: z.string().nullable(),
|
|
1156
|
-
contact_email: z.string(),
|
|
1157
|
-
pipeline_key: z.string(),
|
|
1158
|
-
stage_key: z.string().nullable(),
|
|
1159
|
-
state_key: z.string().nullable(),
|
|
1160
|
-
activity_log: z.unknown(),
|
|
1161
|
-
discovery_data: z.unknown().nullable(),
|
|
1162
|
-
discovery_submitted_at: z.string().nullable(),
|
|
1163
|
-
discovery_submitted_by: z.string().nullable(),
|
|
1164
|
-
proposal_data: z.unknown().nullable(),
|
|
1165
|
-
proposal_sent_at: z.string().nullable(),
|
|
1166
|
-
proposal_pdf_url: z.string().nullable(),
|
|
1167
|
-
signature_envelope_id: z.string().nullable(),
|
|
1168
|
-
source_list_id: z.string().nullable(),
|
|
1169
|
-
source_type: z.string().nullable(),
|
|
1170
|
-
initial_fee: z.number().nullable(),
|
|
1171
|
-
monthly_fee: z.number().nullable(),
|
|
1172
|
-
closed_lost_at: z.string().nullable(),
|
|
1173
|
-
closed_lost_reason: z.string().nullable(),
|
|
1174
|
-
created_at: z.string(),
|
|
1175
|
-
updated_at: z.string(),
|
|
1176
|
-
// joined relation
|
|
1177
|
-
contact: DealContactSummarySchema.nullable()
|
|
1147
|
+
/**
|
|
1148
|
+
* Deal list item with joined contact (and company via contact).
|
|
1149
|
+
* Matches DealListItem from @repo/core types.
|
|
1150
|
+
*/
|
|
1151
|
+
export const DealListItemSchema = z.object({
|
|
1152
|
+
// acq_deals columns
|
|
1153
|
+
id: z.string(),
|
|
1154
|
+
organization_id: z.string(),
|
|
1155
|
+
contact_id: z.string().nullable(),
|
|
1156
|
+
contact_email: z.string(),
|
|
1157
|
+
pipeline_key: z.string(),
|
|
1158
|
+
stage_key: z.string().nullable(),
|
|
1159
|
+
state_key: z.string().nullable(),
|
|
1160
|
+
activity_log: z.unknown(),
|
|
1161
|
+
discovery_data: z.unknown().nullable(),
|
|
1162
|
+
discovery_submitted_at: z.string().nullable(),
|
|
1163
|
+
discovery_submitted_by: z.string().nullable(),
|
|
1164
|
+
proposal_data: z.unknown().nullable(),
|
|
1165
|
+
proposal_sent_at: z.string().nullable(),
|
|
1166
|
+
proposal_pdf_url: z.string().nullable(),
|
|
1167
|
+
signature_envelope_id: z.string().nullable(),
|
|
1168
|
+
source_list_id: z.string().nullable(),
|
|
1169
|
+
source_type: z.string().nullable(),
|
|
1170
|
+
initial_fee: z.number().nullable(),
|
|
1171
|
+
monthly_fee: z.number().nullable(),
|
|
1172
|
+
closed_lost_at: z.string().nullable(),
|
|
1173
|
+
closed_lost_reason: z.string().nullable(),
|
|
1174
|
+
created_at: z.string(),
|
|
1175
|
+
updated_at: z.string(),
|
|
1176
|
+
// joined relation
|
|
1177
|
+
contact: DealContactSummarySchema.nullable()
|
|
1178
1178
|
})
|
|
1179
1179
|
```
|
|
1180
1180
|
|
|
1181
1181
|
### `DealListResponseSchema`
|
|
1182
1182
|
|
|
1183
1183
|
```typescript
|
|
1184
|
-
export const DealListResponseSchema = z.object({
|
|
1185
|
-
data: z.array(DealListItemSchema),
|
|
1186
|
-
total: z.number().int(),
|
|
1187
|
-
limit: z.number().int(),
|
|
1188
|
-
offset: z.number().int()
|
|
1184
|
+
export const DealListResponseSchema = z.object({
|
|
1185
|
+
data: z.array(DealListItemSchema),
|
|
1186
|
+
total: z.number().int(),
|
|
1187
|
+
limit: z.number().int(),
|
|
1188
|
+
offset: z.number().int()
|
|
1189
1189
|
})
|
|
1190
1190
|
```
|
|
1191
1191
|
|
|
1192
1192
|
### `DealDetailResponseSchema`
|
|
1193
1193
|
|
|
1194
1194
|
```typescript
|
|
1195
|
-
/**
|
|
1196
|
-
* Deal detail shape — currently the same as a list item (full joined record).
|
|
1197
|
-
* useDealDetail returns DealDetail which is typed as DealListItem.
|
|
1198
|
-
*/
|
|
1195
|
+
/**
|
|
1196
|
+
* Deal detail shape — currently the same as a list item (full joined record).
|
|
1197
|
+
* useDealDetail returns DealDetail which is typed as DealListItem.
|
|
1198
|
+
*/
|
|
1199
1199
|
export const DealDetailResponseSchema = DealListItemSchema
|
|
1200
1200
|
```
|
|
1201
1201
|
|
|
1202
1202
|
### `DealNoteResponseSchema`
|
|
1203
1203
|
|
|
1204
1204
|
```typescript
|
|
1205
|
-
/**
|
|
1206
|
-
* Single acq_deal_notes row (camelCase API representation).
|
|
1207
|
-
*/
|
|
1208
|
-
export const DealNoteResponseSchema = z.object({
|
|
1209
|
-
id: z.string(),
|
|
1210
|
-
dealId: z.string(),
|
|
1211
|
-
organizationId: z.string(),
|
|
1212
|
-
authorUserId: z.string().nullable(),
|
|
1213
|
-
body: z.string(),
|
|
1214
|
-
createdAt: z.string(),
|
|
1215
|
-
updatedAt: z.string()
|
|
1205
|
+
/**
|
|
1206
|
+
* Single acq_deal_notes row (camelCase API representation).
|
|
1207
|
+
*/
|
|
1208
|
+
export const DealNoteResponseSchema = z.object({
|
|
1209
|
+
id: z.string(),
|
|
1210
|
+
dealId: z.string(),
|
|
1211
|
+
organizationId: z.string(),
|
|
1212
|
+
authorUserId: z.string().nullable(),
|
|
1213
|
+
body: z.string(),
|
|
1214
|
+
createdAt: z.string(),
|
|
1215
|
+
updatedAt: z.string()
|
|
1216
1216
|
})
|
|
1217
1217
|
```
|
|
1218
1218
|
|
|
@@ -1225,24 +1225,24 @@ export const DealNoteListResponseSchema = z.array(DealNoteResponseSchema)
|
|
|
1225
1225
|
### `DealTaskResponseSchema`
|
|
1226
1226
|
|
|
1227
1227
|
```typescript
|
|
1228
|
-
/**
|
|
1229
|
-
* Single acq_deal_tasks row (camelCase API representation).
|
|
1230
|
-
* Matches AcqDealTask domain type from types.ts.
|
|
1231
|
-
*/
|
|
1232
|
-
export const DealTaskResponseSchema = z.object({
|
|
1233
|
-
id: z.string(),
|
|
1234
|
-
organizationId: z.string(),
|
|
1235
|
-
dealId: z.string(),
|
|
1236
|
-
title: z.string(),
|
|
1237
|
-
description: z.string().nullable(),
|
|
1238
|
-
kind: AcqDealTaskKindSchema,
|
|
1239
|
-
dueAt: z.string().nullable(),
|
|
1240
|
-
assigneeUserId: z.string().nullable(),
|
|
1241
|
-
completedAt: z.string().nullable(),
|
|
1242
|
-
completedByUserId: z.string().nullable(),
|
|
1243
|
-
createdAt: z.string(),
|
|
1244
|
-
updatedAt: z.string(),
|
|
1245
|
-
createdByUserId: z.string().nullable()
|
|
1228
|
+
/**
|
|
1229
|
+
* Single acq_deal_tasks row (camelCase API representation).
|
|
1230
|
+
* Matches AcqDealTask domain type from types.ts.
|
|
1231
|
+
*/
|
|
1232
|
+
export const DealTaskResponseSchema = z.object({
|
|
1233
|
+
id: z.string(),
|
|
1234
|
+
organizationId: z.string(),
|
|
1235
|
+
dealId: z.string(),
|
|
1236
|
+
title: z.string(),
|
|
1237
|
+
description: z.string().nullable(),
|
|
1238
|
+
kind: AcqDealTaskKindSchema,
|
|
1239
|
+
dueAt: z.string().nullable(),
|
|
1240
|
+
assigneeUserId: z.string().nullable(),
|
|
1241
|
+
completedAt: z.string().nullable(),
|
|
1242
|
+
completedByUserId: z.string().nullable(),
|
|
1243
|
+
createdAt: z.string(),
|
|
1244
|
+
updatedAt: z.string(),
|
|
1245
|
+
createdByUserId: z.string().nullable()
|
|
1246
1246
|
})
|
|
1247
1247
|
```
|
|
1248
1248
|
|
|
@@ -1255,148 +1255,152 @@ export const DealTaskListResponseSchema = z.array(DealTaskResponseSchema)
|
|
|
1255
1255
|
### `DealSchemas`
|
|
1256
1256
|
|
|
1257
1257
|
```typescript
|
|
1258
|
-
export const DealSchemas = {
|
|
1259
|
-
// Params
|
|
1260
|
-
DealIdParams: DealIdParamsSchema,
|
|
1261
|
-
DealTaskIdParams: DealTaskIdParamsSchema,
|
|
1262
|
-
|
|
1263
|
-
// Queries
|
|
1264
|
-
ListDealsQuery: ListDealsQuerySchema,
|
|
1265
|
-
DealLookupQuery: DealLookupQuerySchema,
|
|
1266
|
-
ListDealTasksDueQuery: ListDealTasksDueQuerySchema,
|
|
1267
|
-
|
|
1268
|
-
// Request bodies
|
|
1269
|
-
CreateDealNoteRequest: CreateDealNoteRequestSchema,
|
|
1270
|
-
CreateDealTaskRequest: CreateDealTaskRequestSchema,
|
|
1271
|
-
TransitionItemRequest: TransitionItemRequestSchema,
|
|
1272
|
-
ExecuteActionParams: ExecuteActionParamsSchema,
|
|
1273
|
-
ExecuteActionRequest: ExecuteActionRequestSchema,
|
|
1274
|
-
|
|
1275
|
-
// Responses
|
|
1276
|
-
DealListResponse: DealListResponseSchema,
|
|
1277
|
-
DealSummaryResponse: DealSummaryResponseSchema,
|
|
1278
|
-
DealLookupResponse: DealLookupResponseSchema,
|
|
1279
|
-
DealDetailResponse: DealDetailResponseSchema,
|
|
1280
|
-
DealNoteResponse: DealNoteResponseSchema,
|
|
1281
|
-
DealNoteListResponse: DealNoteListResponseSchema,
|
|
1282
|
-
DealTaskResponse: DealTaskResponseSchema,
|
|
1283
|
-
DealTaskListResponse: DealTaskListResponseSchema
|
|
1258
|
+
export const DealSchemas = {
|
|
1259
|
+
// Params
|
|
1260
|
+
DealIdParams: DealIdParamsSchema,
|
|
1261
|
+
DealTaskIdParams: DealTaskIdParamsSchema,
|
|
1262
|
+
|
|
1263
|
+
// Queries
|
|
1264
|
+
ListDealsQuery: ListDealsQuerySchema,
|
|
1265
|
+
DealLookupQuery: DealLookupQuerySchema,
|
|
1266
|
+
ListDealTasksDueQuery: ListDealTasksDueQuerySchema,
|
|
1267
|
+
|
|
1268
|
+
// Request bodies
|
|
1269
|
+
CreateDealNoteRequest: CreateDealNoteRequestSchema,
|
|
1270
|
+
CreateDealTaskRequest: CreateDealTaskRequestSchema,
|
|
1271
|
+
TransitionItemRequest: TransitionItemRequestSchema,
|
|
1272
|
+
ExecuteActionParams: ExecuteActionParamsSchema,
|
|
1273
|
+
ExecuteActionRequest: ExecuteActionRequestSchema,
|
|
1274
|
+
|
|
1275
|
+
// Responses
|
|
1276
|
+
DealListResponse: DealListResponseSchema,
|
|
1277
|
+
DealSummaryResponse: DealSummaryResponseSchema,
|
|
1278
|
+
DealLookupResponse: DealLookupResponseSchema,
|
|
1279
|
+
DealDetailResponse: DealDetailResponseSchema,
|
|
1280
|
+
DealNoteResponse: DealNoteResponseSchema,
|
|
1281
|
+
DealNoteListResponse: DealNoteListResponseSchema,
|
|
1282
|
+
DealTaskResponse: DealTaskResponseSchema,
|
|
1283
|
+
DealTaskListResponse: DealTaskListResponseSchema
|
|
1284
1284
|
}
|
|
1285
1285
|
```
|
|
1286
1286
|
|
|
1287
1287
|
### `Action`
|
|
1288
1288
|
|
|
1289
1289
|
```typescript
|
|
1290
|
-
export interface Action {
|
|
1291
|
-
key: string
|
|
1292
|
-
label: string
|
|
1293
|
-
payloadSchema?: z.ZodTypeAny
|
|
1290
|
+
export interface Action {
|
|
1291
|
+
key: string
|
|
1292
|
+
label: string
|
|
1293
|
+
payloadSchema?: z.ZodTypeAny
|
|
1294
1294
|
}
|
|
1295
1295
|
```
|
|
1296
1296
|
|
|
1297
1297
|
### `ActionDef`
|
|
1298
1298
|
|
|
1299
1299
|
```typescript
|
|
1300
|
-
export interface ActionDef {
|
|
1301
|
-
key: string
|
|
1302
|
-
label: string
|
|
1303
|
-
isAvailableFor: (deal: AcqDealRow) => boolean
|
|
1304
|
-
workflowId: string
|
|
1305
|
-
payloadSchema?: z.ZodTypeAny
|
|
1300
|
+
export interface ActionDef {
|
|
1301
|
+
key: string
|
|
1302
|
+
label: string
|
|
1303
|
+
isAvailableFor: (deal: AcqDealRow) => boolean
|
|
1304
|
+
workflowId: string
|
|
1305
|
+
payloadSchema?: z.ZodTypeAny
|
|
1306
1306
|
}
|
|
1307
1307
|
```
|
|
1308
1308
|
|
|
1309
1309
|
### `DEFAULT_CRM_ACTIONS`
|
|
1310
1310
|
|
|
1311
1311
|
```typescript
|
|
1312
|
-
export const DEFAULT_CRM_ACTIONS: ActionDef[] = [
|
|
1313
|
-
{
|
|
1314
|
-
key: 'move_to_proposal',
|
|
1315
|
-
label: 'Move to Proposal',
|
|
1316
|
-
isAvailableFor: (deal) => deal.stage_key === 'interested',
|
|
1317
|
-
workflowId: 'move_to_proposal-workflow'
|
|
1318
|
-
},
|
|
1319
|
-
{
|
|
1320
|
-
key: 'move_to_closing',
|
|
1321
|
-
label: 'Move to Closing',
|
|
1322
|
-
isAvailableFor: (deal) => deal.stage_key === 'proposal',
|
|
1323
|
-
workflowId: 'move_to_closing-workflow'
|
|
1324
|
-
},
|
|
1325
|
-
{
|
|
1326
|
-
key: 'move_to_closed_won',
|
|
1327
|
-
label: 'Close Won',
|
|
1328
|
-
isAvailableFor: (deal) => deal.stage_key === 'closing',
|
|
1329
|
-
workflowId: 'move_to_closed_won-workflow'
|
|
1330
|
-
},
|
|
1331
|
-
{
|
|
1332
|
-
key: 'move_to_closed_lost',
|
|
1333
|
-
label: 'Close Lost',
|
|
1334
|
-
isAvailableFor: (deal) =>
|
|
1335
|
-
deal.stage_key === 'interested' || deal.stage_key === 'proposal' || deal.stage_key === 'closing',
|
|
1336
|
-
workflowId: 'move_to_closed_lost-workflow'
|
|
1337
|
-
},
|
|
1338
|
-
{
|
|
1339
|
-
key: 'move_to_nurturing',
|
|
1340
|
-
label: 'Move to Nurturing',
|
|
1341
|
-
isAvailableFor: (deal) =>
|
|
1342
|
-
deal.stage_key === 'interested' || deal.stage_key === 'proposal' || deal.stage_key === 'closing',
|
|
1343
|
-
workflowId: 'move_to_nurturing-workflow'
|
|
1344
|
-
},
|
|
1345
|
-
{
|
|
1346
|
-
key: 'send_reply',
|
|
1347
|
-
label: 'Send Reply',
|
|
1348
|
-
isAvailableFor: (deal) =>
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1312
|
+
export const DEFAULT_CRM_ACTIONS: ActionDef[] = [
|
|
1313
|
+
{
|
|
1314
|
+
key: 'move_to_proposal',
|
|
1315
|
+
label: 'Move to Proposal',
|
|
1316
|
+
isAvailableFor: (deal) => deal.stage_key === 'interested',
|
|
1317
|
+
workflowId: 'move_to_proposal-workflow'
|
|
1318
|
+
},
|
|
1319
|
+
{
|
|
1320
|
+
key: 'move_to_closing',
|
|
1321
|
+
label: 'Move to Closing',
|
|
1322
|
+
isAvailableFor: (deal) => deal.stage_key === 'proposal',
|
|
1323
|
+
workflowId: 'move_to_closing-workflow'
|
|
1324
|
+
},
|
|
1325
|
+
{
|
|
1326
|
+
key: 'move_to_closed_won',
|
|
1327
|
+
label: 'Close Won',
|
|
1328
|
+
isAvailableFor: (deal) => deal.stage_key === 'closing',
|
|
1329
|
+
workflowId: 'move_to_closed_won-workflow'
|
|
1330
|
+
},
|
|
1331
|
+
{
|
|
1332
|
+
key: 'move_to_closed_lost',
|
|
1333
|
+
label: 'Close Lost',
|
|
1334
|
+
isAvailableFor: (deal) =>
|
|
1335
|
+
deal.stage_key === 'interested' || deal.stage_key === 'proposal' || deal.stage_key === 'closing',
|
|
1336
|
+
workflowId: 'move_to_closed_lost-workflow'
|
|
1337
|
+
},
|
|
1338
|
+
{
|
|
1339
|
+
key: 'move_to_nurturing',
|
|
1340
|
+
label: 'Move to Nurturing',
|
|
1341
|
+
isAvailableFor: (deal) =>
|
|
1342
|
+
deal.stage_key === 'interested' || deal.stage_key === 'proposal' || deal.stage_key === 'closing',
|
|
1343
|
+
workflowId: 'move_to_nurturing-workflow'
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
key: 'send_reply',
|
|
1347
|
+
label: 'Send Reply',
|
|
1348
|
+
isAvailableFor: (deal) =>
|
|
1349
|
+
deal.stage_key === 'interested' &&
|
|
1350
|
+
(deal.state_key === 'discovery_replied' ||
|
|
1351
|
+
deal.state_key === 'discovery_link_sent' ||
|
|
1352
|
+
deal.state_key === 'discovery_nudging'),
|
|
1353
|
+
workflowId: 'crm-send-reply-workflow',
|
|
1354
|
+
payloadSchema: SendReplyActionPayloadSchema
|
|
1355
|
+
},
|
|
1356
|
+
{
|
|
1357
|
+
key: 'send_link',
|
|
1358
|
+
label: 'Send Booking Link',
|
|
1359
|
+
isAvailableFor: (deal) => deal.stage_key === 'interested' && deal.state_key === 'discovery_replied',
|
|
1360
|
+
workflowId: 'crm-send-booking-link-workflow'
|
|
1361
|
+
},
|
|
1362
|
+
{
|
|
1363
|
+
key: 'send_nudge',
|
|
1364
|
+
label: 'Send Nudge',
|
|
1365
|
+
isAvailableFor: (deal) =>
|
|
1366
|
+
deal.stage_key === 'interested' &&
|
|
1367
|
+
(deal.state_key === 'discovery_link_sent' || deal.state_key === 'discovery_nudging'),
|
|
1368
|
+
workflowId: 'crm-send-nudge-workflow'
|
|
1369
|
+
},
|
|
1370
|
+
{
|
|
1371
|
+
key: 'mark_no_show',
|
|
1372
|
+
label: 'Mark No-Show',
|
|
1373
|
+
isAvailableFor: (deal) => deal.stage_key === 'interested' && deal.state_key === 'discovery_nudging',
|
|
1374
|
+
// Mirrors the auto-timeout precedent in operations/sales/crm/pipeline/timeout-actions.ts:
|
|
1375
|
+
// both manual-click and timeout move the deal to closed_lost. The action_taken activity
|
|
1376
|
+
// event captures operator intent and distinguishes the manual variant from the timed one.
|
|
1377
|
+
workflowId: 'mark_no_show-workflow'
|
|
1378
|
+
},
|
|
1379
|
+
{
|
|
1380
|
+
key: 'rebook',
|
|
1381
|
+
label: 'Rebook',
|
|
1382
|
+
isAvailableFor: (deal) => deal.stage_key === 'interested' && deal.state_key === 'discovery_booking_cancelled',
|
|
1383
|
+
workflowId: 'crm-rebook-workflow'
|
|
1384
|
+
}
|
|
1381
1385
|
]
|
|
1382
1386
|
```
|
|
1383
1387
|
|
|
1384
1388
|
### `CrmToolMap`
|
|
1385
1389
|
|
|
1386
1390
|
```typescript
|
|
1387
|
-
export type CrmToolMap = {
|
|
1388
|
-
getRecentActivity: { params: CrmRecentActivityParams; result: RecentActivityEntry[] }
|
|
1389
|
-
listDeals: { params: CrmListDealsParams; result: DealListItem[] }
|
|
1390
|
-
getDeal: { params: CrmGetDealParams; result: DealDetail | null }
|
|
1391
|
-
getDealByEmail: { params: CrmGetDealByEmailParams; result: DealDetail | null }
|
|
1392
|
-
createDealNote: { params: CrmDealNoteParams; result: AcqDealNote }
|
|
1393
|
-
listDealNotes: { params: Omit<ListDealNotesParams, 'organizationId'>; result: AcqDealNote[] }
|
|
1394
|
-
createDealTask: { params: CrmDealTaskParams; result: AcqDealTask }
|
|
1395
|
-
listDealTasks: { params: Omit<ListDealTasksParams, 'organizationId'>; result: AcqDealTask[] }
|
|
1396
|
-
listDealTasksDue: { params: CrmTaskDueParams; result: AcqDealTask[] }
|
|
1397
|
-
completeDealTask: { params: Omit<CompleteDealTaskParams, 'organizationId'>; result: AcqDealTask }
|
|
1398
|
-
recordActivity: { params: CrmRecordActivityParams; result: void }
|
|
1399
|
-
deleteDeal: { params: CrmDeleteDealParams; result: void }
|
|
1391
|
+
export type CrmToolMap = {
|
|
1392
|
+
getRecentActivity: { params: CrmRecentActivityParams; result: RecentActivityEntry[] }
|
|
1393
|
+
listDeals: { params: CrmListDealsParams; result: DealListItem[] }
|
|
1394
|
+
getDeal: { params: CrmGetDealParams; result: DealDetail | null }
|
|
1395
|
+
getDealByEmail: { params: CrmGetDealByEmailParams; result: DealDetail | null }
|
|
1396
|
+
createDealNote: { params: CrmDealNoteParams; result: AcqDealNote }
|
|
1397
|
+
listDealNotes: { params: Omit<ListDealNotesParams, 'organizationId'>; result: AcqDealNote[] }
|
|
1398
|
+
createDealTask: { params: CrmDealTaskParams; result: AcqDealTask }
|
|
1399
|
+
listDealTasks: { params: Omit<ListDealTasksParams, 'organizationId'>; result: AcqDealTask[] }
|
|
1400
|
+
listDealTasksDue: { params: CrmTaskDueParams; result: AcqDealTask[] }
|
|
1401
|
+
completeDealTask: { params: Omit<CompleteDealTaskParams, 'organizationId'>; result: AcqDealTask }
|
|
1402
|
+
recordActivity: { params: CrmRecordActivityParams; result: void }
|
|
1403
|
+
deleteDeal: { params: CrmDeleteDealParams; result: void }
|
|
1400
1404
|
}
|
|
1401
1405
|
```
|
|
1402
1406
|
|
|
@@ -1405,429 +1409,427 @@ export type CrmToolMap = {
|
|
|
1405
1409
|
### `WebPost`
|
|
1406
1410
|
|
|
1407
1411
|
```typescript
|
|
1408
|
-
/**
|
|
1409
|
-
* Represents a web post from company website scraping.
|
|
1410
|
-
* Used for recent blog posts, news, or announcements.
|
|
1411
|
-
*/
|
|
1412
|
-
export interface WebPost {
|
|
1413
|
-
/** ISO date string of when the post was published */
|
|
1414
|
-
date: string
|
|
1415
|
-
/** Title of the web post */
|
|
1416
|
-
title: string
|
|
1417
|
-
/** Brief summary of the post content */
|
|
1418
|
-
summary: string
|
|
1419
|
-
/** AI-generated insight about the post's relevance */
|
|
1420
|
-
aiInsight?: string
|
|
1412
|
+
/**
|
|
1413
|
+
* Represents a web post from company website scraping.
|
|
1414
|
+
* Used for recent blog posts, news, or announcements.
|
|
1415
|
+
*/
|
|
1416
|
+
export interface WebPost {
|
|
1417
|
+
/** ISO date string of when the post was published */
|
|
1418
|
+
date: string
|
|
1419
|
+
/** Title of the web post */
|
|
1420
|
+
title: string
|
|
1421
|
+
/** Brief summary of the post content */
|
|
1422
|
+
summary: string
|
|
1423
|
+
/** AI-generated insight about the post's relevance */
|
|
1424
|
+
aiInsight?: string
|
|
1421
1425
|
}
|
|
1422
1426
|
```
|
|
1423
1427
|
|
|
1424
1428
|
### `CompanyPipelineStatus`
|
|
1425
1429
|
|
|
1426
1430
|
```typescript
|
|
1427
|
-
/**
|
|
1428
|
-
* Tracks pipeline status for a company across all processing stages.
|
|
1429
|
-
*/
|
|
1430
|
-
export interface CompanyPipelineStatus {
|
|
1431
|
-
acquired: boolean
|
|
1432
|
-
enrichment: {
|
|
1433
|
-
[source: string]: {
|
|
1434
|
-
status: 'pending' | 'complete' | 'failed' | 'skipped'
|
|
1435
|
-
completedAt?: string
|
|
1436
|
-
error?: string
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1431
|
+
/**
|
|
1432
|
+
* Tracks pipeline status for a company across all processing stages.
|
|
1433
|
+
*/
|
|
1434
|
+
export interface CompanyPipelineStatus {
|
|
1435
|
+
acquired: boolean
|
|
1436
|
+
enrichment: {
|
|
1437
|
+
[source: string]: {
|
|
1438
|
+
status: 'pending' | 'complete' | 'failed' | 'skipped'
|
|
1439
|
+
completedAt?: string
|
|
1440
|
+
error?: string
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1439
1443
|
}
|
|
1440
1444
|
```
|
|
1441
1445
|
|
|
1442
1446
|
### `ContactPipelineStatus`
|
|
1443
1447
|
|
|
1444
1448
|
```typescript
|
|
1445
|
-
/**
|
|
1446
|
-
* Tracks pipeline status for a contact across all processing stages.
|
|
1447
|
-
*/
|
|
1448
|
-
export interface ContactPipelineStatus {
|
|
1449
|
-
enrichment: {
|
|
1450
|
-
[source: string]: {
|
|
1451
|
-
status: 'pending' | 'complete' | 'failed' | 'skipped'
|
|
1452
|
-
completedAt?: string
|
|
1453
|
-
error?: string
|
|
1454
|
-
}
|
|
1455
|
-
}
|
|
1456
|
-
personalization: {
|
|
1457
|
-
status: 'pending' | 'complete' | 'failed' | 'skipped'
|
|
1458
|
-
completedAt?: string
|
|
1459
|
-
}
|
|
1460
|
-
outreach: {
|
|
1461
|
-
status: 'pending' | 'sent' | 'replied' | 'bounced' | 'opted-out'
|
|
1462
|
-
sentAt?: string
|
|
1463
|
-
channel?: string
|
|
1464
|
-
campaignId?: string
|
|
1465
|
-
}
|
|
1449
|
+
/**
|
|
1450
|
+
* Tracks pipeline status for a contact across all processing stages.
|
|
1451
|
+
*/
|
|
1452
|
+
export interface ContactPipelineStatus {
|
|
1453
|
+
enrichment: {
|
|
1454
|
+
[source: string]: {
|
|
1455
|
+
status: 'pending' | 'complete' | 'failed' | 'skipped'
|
|
1456
|
+
completedAt?: string
|
|
1457
|
+
error?: string
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
personalization: {
|
|
1461
|
+
status: 'pending' | 'complete' | 'failed' | 'skipped'
|
|
1462
|
+
completedAt?: string
|
|
1463
|
+
}
|
|
1464
|
+
outreach: {
|
|
1465
|
+
status: 'pending' | 'sent' | 'replied' | 'bounced' | 'opted-out'
|
|
1466
|
+
sentAt?: string
|
|
1467
|
+
channel?: string
|
|
1468
|
+
campaignId?: string
|
|
1469
|
+
}
|
|
1466
1470
|
}
|
|
1467
1471
|
```
|
|
1468
1472
|
|
|
1469
1473
|
### `CompanyEnrichmentData`
|
|
1470
1474
|
|
|
1471
1475
|
```typescript
|
|
1472
|
-
/**
|
|
1473
|
-
* Enrichment data collected for a company from various sources.
|
|
1474
|
-
*/
|
|
1475
|
-
export interface CompanyEnrichmentData {
|
|
1476
|
-
googleMaps?: {
|
|
1477
|
-
placeId?: string
|
|
1478
|
-
totalScore?: number
|
|
1479
|
-
reviewsCount?: number
|
|
1480
|
-
address?: string
|
|
1481
|
-
phone?: string
|
|
1482
|
-
categoryName?: string
|
|
1483
|
-
googleMapsUrl?: string
|
|
1484
|
-
scrapedAt?: string
|
|
1485
|
-
}
|
|
1486
|
-
websiteCrawl?: {
|
|
1487
|
-
companyDescription?: string
|
|
1488
|
-
services?: string[]
|
|
1489
|
-
specialties?: string[]
|
|
1490
|
-
staff?: Array<{ name: string; title?: string; email?: string }>
|
|
1491
|
-
automationGaps?: string[]
|
|
1492
|
-
targetAudience?: string
|
|
1493
|
-
category?: string
|
|
1494
|
-
segment?: string
|
|
1495
|
-
recentWin?: string
|
|
1496
|
-
emailCount?: number
|
|
1497
|
-
pageCount?: number
|
|
1498
|
-
totalChars?: number
|
|
1499
|
-
crawledAt?: string
|
|
1500
|
-
extractedAt?: string
|
|
1501
|
-
}
|
|
1502
|
-
website?: {
|
|
1503
|
-
missionVision?: string
|
|
1504
|
-
uniqueAttributes?: string
|
|
1505
|
-
coreOfferings?: string
|
|
1506
|
-
targetAudience?: string
|
|
1507
|
-
companyValues?: string
|
|
1508
|
-
businessDescription?: string
|
|
1509
|
-
recentPosts?: Array<{ date?: string; title?: string; summary?: string; aiInsight?: string }>
|
|
1510
|
-
}
|
|
1511
|
-
tomba?: {
|
|
1512
|
-
waterfallEmail?: {
|
|
1513
|
-
email: string
|
|
1514
|
-
name?: string
|
|
1515
|
-
title?: string
|
|
1516
|
-
department?: string
|
|
1517
|
-
} | null
|
|
1518
|
-
genericEmail?: string | null
|
|
1519
|
-
totalFound?: number
|
|
1520
|
-
searchedAt?: string
|
|
1521
|
-
}
|
|
1476
|
+
/**
|
|
1477
|
+
* Enrichment data collected for a company from various sources.
|
|
1478
|
+
*/
|
|
1479
|
+
export interface CompanyEnrichmentData {
|
|
1480
|
+
googleMaps?: {
|
|
1481
|
+
placeId?: string
|
|
1482
|
+
totalScore?: number
|
|
1483
|
+
reviewsCount?: number
|
|
1484
|
+
address?: string
|
|
1485
|
+
phone?: string
|
|
1486
|
+
categoryName?: string
|
|
1487
|
+
googleMapsUrl?: string
|
|
1488
|
+
scrapedAt?: string
|
|
1489
|
+
}
|
|
1490
|
+
websiteCrawl?: {
|
|
1491
|
+
companyDescription?: string
|
|
1492
|
+
services?: string[]
|
|
1493
|
+
specialties?: string[]
|
|
1494
|
+
staff?: Array<{ name: string; title?: string; email?: string }>
|
|
1495
|
+
automationGaps?: string[]
|
|
1496
|
+
targetAudience?: string
|
|
1497
|
+
category?: string
|
|
1498
|
+
segment?: string
|
|
1499
|
+
recentWin?: string
|
|
1500
|
+
emailCount?: number
|
|
1501
|
+
pageCount?: number
|
|
1502
|
+
totalChars?: number
|
|
1503
|
+
crawledAt?: string
|
|
1504
|
+
extractedAt?: string
|
|
1505
|
+
}
|
|
1506
|
+
website?: {
|
|
1507
|
+
missionVision?: string
|
|
1508
|
+
uniqueAttributes?: string
|
|
1509
|
+
coreOfferings?: string
|
|
1510
|
+
targetAudience?: string
|
|
1511
|
+
companyValues?: string
|
|
1512
|
+
businessDescription?: string
|
|
1513
|
+
recentPosts?: Array<{ date?: string; title?: string; summary?: string; aiInsight?: string }>
|
|
1514
|
+
}
|
|
1515
|
+
tomba?: {
|
|
1516
|
+
waterfallEmail?: {
|
|
1517
|
+
email: string
|
|
1518
|
+
name?: string
|
|
1519
|
+
title?: string
|
|
1520
|
+
department?: string
|
|
1521
|
+
} | null
|
|
1522
|
+
genericEmail?: string | null
|
|
1523
|
+
totalFound?: number
|
|
1524
|
+
searchedAt?: string
|
|
1525
|
+
}
|
|
1522
1526
|
}
|
|
1523
1527
|
```
|
|
1524
1528
|
|
|
1525
1529
|
### `ContactEnrichmentData`
|
|
1526
1530
|
|
|
1527
1531
|
```typescript
|
|
1528
|
-
/**
|
|
1529
|
-
* Enrichment data collected for a contact from various sources.
|
|
1530
|
-
*/
|
|
1531
|
-
export interface ContactEnrichmentData {
|
|
1532
|
-
linkedin?: {
|
|
1533
|
-
summary?: string
|
|
1534
|
-
pastExperience?: string
|
|
1535
|
-
education?: string
|
|
1536
|
-
activity?: Array<{ date?: string; content?: string }>
|
|
1537
|
-
}
|
|
1532
|
+
/**
|
|
1533
|
+
* Enrichment data collected for a contact from various sources.
|
|
1534
|
+
*/
|
|
1535
|
+
export interface ContactEnrichmentData {
|
|
1536
|
+
linkedin?: {
|
|
1537
|
+
summary?: string
|
|
1538
|
+
pastExperience?: string
|
|
1539
|
+
education?: string
|
|
1540
|
+
activity?: Array<{ date?: string; content?: string }>
|
|
1541
|
+
}
|
|
1538
1542
|
}
|
|
1539
1543
|
```
|
|
1540
1544
|
|
|
1541
1545
|
### `AcqList`
|
|
1542
1546
|
|
|
1543
1547
|
```typescript
|
|
1544
|
-
export interface AcqList {
|
|
1545
|
-
id: string
|
|
1546
|
-
organizationId: string
|
|
1547
|
-
name: string
|
|
1548
|
-
description: string | null
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
createdAt: Date
|
|
1548
|
+
export interface AcqList {
|
|
1549
|
+
id: string
|
|
1550
|
+
organizationId: string
|
|
1551
|
+
name: string
|
|
1552
|
+
description: string | null
|
|
1553
|
+
batchIds: string[]
|
|
1554
|
+
instantlyCampaignId: string | null
|
|
1555
|
+
status: ListStatus
|
|
1556
|
+
scrapingConfig: ScrapingConfig
|
|
1557
|
+
icp: IcpRubric
|
|
1558
|
+
pipelineConfig: PipelineConfig
|
|
1559
|
+
metadata: Record<string, unknown>
|
|
1560
|
+
launchedAt: Date | null
|
|
1561
|
+
completedAt: Date | null
|
|
1562
|
+
createdAt: Date
|
|
1560
1563
|
}
|
|
1561
1564
|
```
|
|
1562
1565
|
|
|
1563
1566
|
### `AcqCompany`
|
|
1564
1567
|
|
|
1565
1568
|
```typescript
|
|
1566
|
-
/**
|
|
1567
|
-
* Company record in the acquisition database.
|
|
1568
|
-
* Contains enriched company data from various sources.
|
|
1569
|
-
* Transformed from AcqCompanyRow with camelCase properties.
|
|
1570
|
-
*/
|
|
1571
|
-
export interface AcqCompany {
|
|
1572
|
-
id: string
|
|
1573
|
-
organizationId: string
|
|
1574
|
-
name: string
|
|
1575
|
-
domain: string | null
|
|
1576
|
-
linkedinUrl: string | null
|
|
1577
|
-
website: string | null
|
|
1578
|
-
numEmployees: number | null
|
|
1579
|
-
foundedYear: number | null
|
|
1580
|
-
locationCity: string | null
|
|
1581
|
-
locationState: string | null
|
|
1582
|
-
category: string | null
|
|
1583
|
-
categoryPain: string | null
|
|
1584
|
-
segment: string | null
|
|
1585
|
-
pipelineStatus: CompanyPipelineStatus | null
|
|
1586
|
-
enrichmentData: CompanyEnrichmentData | null
|
|
1587
|
-
source: string | null
|
|
1588
|
-
batchId: string | null
|
|
1589
|
-
status: 'active' | 'invalid'
|
|
1590
|
-
verticalResearch: string | null
|
|
1591
|
-
/** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
|
|
1592
|
-
qualificationScore: number | null
|
|
1593
|
-
/** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
|
|
1594
|
-
qualificationSignals: Record<string, unknown> | null
|
|
1595
|
-
/** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
|
|
1596
|
-
qualificationRubricKey: string | null
|
|
1597
|
-
createdAt: Date
|
|
1598
|
-
updatedAt: Date
|
|
1569
|
+
/**
|
|
1570
|
+
* Company record in the acquisition database.
|
|
1571
|
+
* Contains enriched company data from various sources.
|
|
1572
|
+
* Transformed from AcqCompanyRow with camelCase properties.
|
|
1573
|
+
*/
|
|
1574
|
+
export interface AcqCompany {
|
|
1575
|
+
id: string
|
|
1576
|
+
organizationId: string
|
|
1577
|
+
name: string
|
|
1578
|
+
domain: string | null
|
|
1579
|
+
linkedinUrl: string | null
|
|
1580
|
+
website: string | null
|
|
1581
|
+
numEmployees: number | null
|
|
1582
|
+
foundedYear: number | null
|
|
1583
|
+
locationCity: string | null
|
|
1584
|
+
locationState: string | null
|
|
1585
|
+
category: string | null
|
|
1586
|
+
categoryPain: string | null
|
|
1587
|
+
segment: string | null
|
|
1588
|
+
pipelineStatus: CompanyPipelineStatus | null
|
|
1589
|
+
enrichmentData: CompanyEnrichmentData | null
|
|
1590
|
+
source: string | null
|
|
1591
|
+
batchId: string | null
|
|
1592
|
+
status: 'active' | 'invalid'
|
|
1593
|
+
verticalResearch: string | null
|
|
1594
|
+
/** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
|
|
1595
|
+
qualificationScore: number | null
|
|
1596
|
+
/** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
|
|
1597
|
+
qualificationSignals: Record<string, unknown> | null
|
|
1598
|
+
/** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
|
|
1599
|
+
qualificationRubricKey: string | null
|
|
1600
|
+
createdAt: Date
|
|
1601
|
+
updatedAt: Date
|
|
1599
1602
|
}
|
|
1600
1603
|
```
|
|
1601
1604
|
|
|
1602
1605
|
### `AcqContact`
|
|
1603
1606
|
|
|
1604
1607
|
```typescript
|
|
1605
|
-
/**
|
|
1606
|
-
* Contact record in the acquisition database.
|
|
1607
|
-
* Contains enriched contact data and personalization content.
|
|
1608
|
-
* Transformed from AcqContactRow with camelCase properties.
|
|
1609
|
-
*/
|
|
1610
|
-
export interface AcqContact {
|
|
1611
|
-
id: string
|
|
1612
|
-
organizationId: string
|
|
1613
|
-
companyId: string | null
|
|
1614
|
-
email: string
|
|
1615
|
-
emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null
|
|
1616
|
-
firstName: string | null
|
|
1617
|
-
lastName: string | null
|
|
1618
|
-
linkedinUrl: string | null
|
|
1619
|
-
title: string | null
|
|
1620
|
-
headline: string | null
|
|
1621
|
-
filterReason: string | null
|
|
1622
|
-
openingLine: string | null
|
|
1623
|
-
source: string | null
|
|
1624
|
-
sourceId: string | null
|
|
1625
|
-
pipelineStatus: ContactPipelineStatus | null
|
|
1626
|
-
enrichmentData: ContactEnrichmentData | null
|
|
1627
|
-
/** Attio Person record ID - set when contact responds and is added to CRM */
|
|
1628
|
-
attioPersonId: string | null
|
|
1629
|
-
batchId: string | null
|
|
1630
|
-
status: 'active' | 'invalid'
|
|
1631
|
-
createdAt: Date
|
|
1632
|
-
updatedAt: Date
|
|
1608
|
+
/**
|
|
1609
|
+
* Contact record in the acquisition database.
|
|
1610
|
+
* Contains enriched contact data and personalization content.
|
|
1611
|
+
* Transformed from AcqContactRow with camelCase properties.
|
|
1612
|
+
*/
|
|
1613
|
+
export interface AcqContact {
|
|
1614
|
+
id: string
|
|
1615
|
+
organizationId: string
|
|
1616
|
+
companyId: string | null
|
|
1617
|
+
email: string
|
|
1618
|
+
emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null
|
|
1619
|
+
firstName: string | null
|
|
1620
|
+
lastName: string | null
|
|
1621
|
+
linkedinUrl: string | null
|
|
1622
|
+
title: string | null
|
|
1623
|
+
headline: string | null
|
|
1624
|
+
filterReason: string | null
|
|
1625
|
+
openingLine: string | null
|
|
1626
|
+
source: string | null
|
|
1627
|
+
sourceId: string | null
|
|
1628
|
+
pipelineStatus: ContactPipelineStatus | null
|
|
1629
|
+
enrichmentData: ContactEnrichmentData | null
|
|
1630
|
+
/** Attio Person record ID - set when contact responds and is added to CRM */
|
|
1631
|
+
attioPersonId: string | null
|
|
1632
|
+
batchId: string | null
|
|
1633
|
+
status: 'active' | 'invalid'
|
|
1634
|
+
createdAt: Date
|
|
1635
|
+
updatedAt: Date
|
|
1633
1636
|
}
|
|
1634
1637
|
```
|
|
1635
1638
|
|
|
1636
1639
|
### `ListTelemetry`
|
|
1637
1640
|
|
|
1638
1641
|
```typescript
|
|
1639
|
-
/**
|
|
1640
|
-
* Live-scan aggregate telemetry for a single list, computed on demand from
|
|
1641
|
-
* the list junction tables and current contact deliverability state.
|
|
1642
|
-
*/
|
|
1643
|
-
export interface ListTelemetry {
|
|
1644
|
-
listId: string
|
|
1645
|
-
totalCompanies: number
|
|
1646
|
-
totalContacts: number
|
|
1647
|
-
stageCounts: {
|
|
1648
|
-
populated: number
|
|
1649
|
-
extracted: number
|
|
1650
|
-
qualified: number
|
|
1651
|
-
discovered: number
|
|
1652
|
-
verified: number
|
|
1653
|
-
personalized: number
|
|
1654
|
-
uploaded: number
|
|
1655
|
-
}
|
|
1656
|
-
deliverability: {
|
|
1657
|
-
valid: number
|
|
1658
|
-
risky: number
|
|
1659
|
-
invalid: number
|
|
1660
|
-
unknown: number
|
|
1661
|
-
bounced: number
|
|
1662
|
-
}
|
|
1663
|
-
/** Reserved -- active workflow IDs associated with this list. */
|
|
1664
|
-
activeWorkflows?: string[]
|
|
1642
|
+
/**
|
|
1643
|
+
* Live-scan aggregate telemetry for a single list, computed on demand from
|
|
1644
|
+
* the list junction tables and current contact deliverability state.
|
|
1645
|
+
*/
|
|
1646
|
+
export interface ListTelemetry {
|
|
1647
|
+
listId: string
|
|
1648
|
+
totalCompanies: number
|
|
1649
|
+
totalContacts: number
|
|
1650
|
+
stageCounts: {
|
|
1651
|
+
populated: number
|
|
1652
|
+
extracted: number
|
|
1653
|
+
qualified: number
|
|
1654
|
+
discovered: number
|
|
1655
|
+
verified: number
|
|
1656
|
+
personalized: number
|
|
1657
|
+
uploaded: number
|
|
1658
|
+
}
|
|
1659
|
+
deliverability: {
|
|
1660
|
+
valid: number
|
|
1661
|
+
risky: number
|
|
1662
|
+
invalid: number
|
|
1663
|
+
unknown: number
|
|
1664
|
+
bounced: number
|
|
1665
|
+
}
|
|
1666
|
+
/** Reserved -- active workflow IDs associated with this list. */
|
|
1667
|
+
activeWorkflows?: string[]
|
|
1665
1668
|
}
|
|
1666
1669
|
```
|
|
1667
1670
|
|
|
1668
1671
|
### `ListStageCountsSchema`
|
|
1669
1672
|
|
|
1670
1673
|
```typescript
|
|
1671
|
-
export const ListStageCountsSchema = z.object({
|
|
1672
|
-
stageCounts: z.object({
|
|
1673
|
-
populated: z.number().int(),
|
|
1674
|
-
extracted: z.number().int(),
|
|
1675
|
-
qualified: z.number().int(),
|
|
1676
|
-
discovered: z.number().int(),
|
|
1677
|
-
verified: z.number().int(),
|
|
1678
|
-
personalized: z.number().int(),
|
|
1679
|
-
uploaded: z.number().int()
|
|
1680
|
-
}),
|
|
1681
|
-
deliverability: z.object({
|
|
1682
|
-
valid: z.number().int(),
|
|
1683
|
-
risky: z.number().int(),
|
|
1684
|
-
invalid: z.number().int(),
|
|
1685
|
-
unknown: z.number().int(),
|
|
1686
|
-
bounced: z.number().int()
|
|
1687
|
-
})
|
|
1674
|
+
export const ListStageCountsSchema = z.object({
|
|
1675
|
+
stageCounts: z.object({
|
|
1676
|
+
populated: z.number().int(),
|
|
1677
|
+
extracted: z.number().int(),
|
|
1678
|
+
qualified: z.number().int(),
|
|
1679
|
+
discovered: z.number().int(),
|
|
1680
|
+
verified: z.number().int(),
|
|
1681
|
+
personalized: z.number().int(),
|
|
1682
|
+
uploaded: z.number().int()
|
|
1683
|
+
}),
|
|
1684
|
+
deliverability: z.object({
|
|
1685
|
+
valid: z.number().int(),
|
|
1686
|
+
risky: z.number().int(),
|
|
1687
|
+
invalid: z.number().int(),
|
|
1688
|
+
unknown: z.number().int(),
|
|
1689
|
+
bounced: z.number().int()
|
|
1690
|
+
})
|
|
1688
1691
|
})
|
|
1689
1692
|
```
|
|
1690
1693
|
|
|
1691
1694
|
### `ListTelemetrySchema`
|
|
1692
1695
|
|
|
1693
1696
|
```typescript
|
|
1694
|
-
export const ListTelemetrySchema = z.object({
|
|
1695
|
-
listId: UuidSchema,
|
|
1696
|
-
totalCompanies: z.number().int(),
|
|
1697
|
-
totalContacts: z.number().int(),
|
|
1698
|
-
stageCounts: ListStageCountsSchema.shape.stageCounts,
|
|
1699
|
-
deliverability: ListStageCountsSchema.shape.deliverability,
|
|
1700
|
-
activeWorkflows: z.array(z.string()).optional()
|
|
1697
|
+
export const ListTelemetrySchema = z.object({
|
|
1698
|
+
listId: UuidSchema,
|
|
1699
|
+
totalCompanies: z.number().int(),
|
|
1700
|
+
totalContacts: z.number().int(),
|
|
1701
|
+
stageCounts: ListStageCountsSchema.shape.stageCounts,
|
|
1702
|
+
deliverability: ListStageCountsSchema.shape.deliverability,
|
|
1703
|
+
activeWorkflows: z.array(z.string()).optional()
|
|
1701
1704
|
})
|
|
1702
1705
|
```
|
|
1703
1706
|
|
|
1704
1707
|
### `ListIdParamsSchema`
|
|
1705
1708
|
|
|
1706
1709
|
```typescript
|
|
1707
|
-
export const ListIdParamsSchema = z.object({
|
|
1708
|
-
listId: UuidSchema
|
|
1710
|
+
export const ListIdParamsSchema = z.object({
|
|
1711
|
+
listId: UuidSchema
|
|
1709
1712
|
})
|
|
1710
1713
|
```
|
|
1711
1714
|
|
|
1712
1715
|
### `CreateListRequestSchema`
|
|
1713
1716
|
|
|
1714
1717
|
```typescript
|
|
1715
|
-
export const CreateListRequestSchema = z
|
|
1716
|
-
.object({
|
|
1717
|
-
name: z.string().trim().min(1).max(255),
|
|
1718
|
-
description: z.string().trim().nullable().optional(),
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
})
|
|
1718
|
+
export const CreateListRequestSchema = z
|
|
1719
|
+
.object({
|
|
1720
|
+
name: z.string().trim().min(1).max(255),
|
|
1721
|
+
description: z.string().trim().nullable().optional(),
|
|
1722
|
+
status: ListStatusSchema.optional(),
|
|
1723
|
+
scrapingConfig: ScrapingConfigSchema.optional(),
|
|
1724
|
+
icp: IcpRubricSchema.optional(),
|
|
1725
|
+
pipelineConfig: PipelineConfigSchema.optional()
|
|
1726
|
+
})
|
|
1725
1727
|
.strict()
|
|
1726
1728
|
```
|
|
1727
1729
|
|
|
1728
1730
|
### `UpdateListRequestSchema`
|
|
1729
1731
|
|
|
1730
1732
|
```typescript
|
|
1731
|
-
export const UpdateListRequestSchema = z
|
|
1732
|
-
.object({
|
|
1733
|
-
name: z.string().trim().min(1).max(255).optional(),
|
|
1734
|
-
description: z.string().trim().nullable().optional(),
|
|
1735
|
-
batchIds: z.array(z.string()).optional()
|
|
1736
|
-
})
|
|
1737
|
-
.strict()
|
|
1738
|
-
.refine((data) => data.name !== undefined || data.description !== undefined || data.batchIds !== undefined, {
|
|
1739
|
-
message: 'At least one field (name, description, or batchIds) must be provided'
|
|
1733
|
+
export const UpdateListRequestSchema = z
|
|
1734
|
+
.object({
|
|
1735
|
+
name: z.string().trim().min(1).max(255).optional(),
|
|
1736
|
+
description: z.string().trim().nullable().optional(),
|
|
1737
|
+
batchIds: z.array(z.string()).optional()
|
|
1738
|
+
})
|
|
1739
|
+
.strict()
|
|
1740
|
+
.refine((data) => data.name !== undefined || data.description !== undefined || data.batchIds !== undefined, {
|
|
1741
|
+
message: 'At least one field (name, description, or batchIds) must be provided'
|
|
1740
1742
|
})
|
|
1741
1743
|
```
|
|
1742
1744
|
|
|
1743
1745
|
### `UpdateListConfigRequestSchema`
|
|
1744
1746
|
|
|
1745
1747
|
```typescript
|
|
1746
|
-
/**
|
|
1747
|
-
* Partial patch for the three jsonb config columns. UI sends only the edited
|
|
1748
|
-
* subtree; server writes the field as-is (no deep merge — each column is
|
|
1749
|
-
* replaced atomically when present in the patch).
|
|
1750
|
-
*/
|
|
1751
|
-
export const UpdateListConfigRequestSchema = z
|
|
1752
|
-
.object({
|
|
1753
|
-
scrapingConfig: ScrapingConfigSchema.partial().optional(),
|
|
1754
|
-
icp: IcpRubricSchema.partial().optional(),
|
|
1755
|
-
pipelineConfig: PipelineConfigSchema.partial().optional()
|
|
1756
|
-
})
|
|
1757
|
-
.strict()
|
|
1758
|
-
.refine((data) => data.scrapingConfig !== undefined || data.icp !== undefined || data.pipelineConfig !== undefined, {
|
|
1759
|
-
message: 'At least one of scrapingConfig, icp, or pipelineConfig must be provided'
|
|
1748
|
+
/**
|
|
1749
|
+
* Partial patch for the three jsonb config columns. UI sends only the edited
|
|
1750
|
+
* subtree; server writes the field as-is (no deep merge — each column is
|
|
1751
|
+
* replaced atomically when present in the patch).
|
|
1752
|
+
*/
|
|
1753
|
+
export const UpdateListConfigRequestSchema = z
|
|
1754
|
+
.object({
|
|
1755
|
+
scrapingConfig: ScrapingConfigSchema.partial().optional(),
|
|
1756
|
+
icp: IcpRubricSchema.partial().optional(),
|
|
1757
|
+
pipelineConfig: PipelineConfigSchema.partial().optional()
|
|
1758
|
+
})
|
|
1759
|
+
.strict()
|
|
1760
|
+
.refine((data) => data.scrapingConfig !== undefined || data.icp !== undefined || data.pipelineConfig !== undefined, {
|
|
1761
|
+
message: 'At least one of scrapingConfig, icp, or pipelineConfig must be provided'
|
|
1760
1762
|
})
|
|
1761
1763
|
```
|
|
1762
1764
|
|
|
1763
1765
|
### `AddCompaniesToListRequestSchema`
|
|
1764
1766
|
|
|
1765
1767
|
```typescript
|
|
1766
|
-
export const AddCompaniesToListRequestSchema = z
|
|
1767
|
-
.object({
|
|
1768
|
-
companyIds: z.array(UuidSchema).min(1).max(1000)
|
|
1769
|
-
})
|
|
1768
|
+
export const AddCompaniesToListRequestSchema = z
|
|
1769
|
+
.object({
|
|
1770
|
+
companyIds: z.array(UuidSchema).min(1).max(1000)
|
|
1771
|
+
})
|
|
1770
1772
|
.strict()
|
|
1771
1773
|
```
|
|
1772
1774
|
|
|
1773
1775
|
### `RemoveCompaniesFromListRequestSchema`
|
|
1774
1776
|
|
|
1775
1777
|
```typescript
|
|
1776
|
-
export const RemoveCompaniesFromListRequestSchema = z
|
|
1777
|
-
.object({
|
|
1778
|
-
companyIds: z.array(UuidSchema).min(1).max(1000)
|
|
1779
|
-
})
|
|
1778
|
+
export const RemoveCompaniesFromListRequestSchema = z
|
|
1779
|
+
.object({
|
|
1780
|
+
companyIds: z.array(UuidSchema).min(1).max(1000)
|
|
1781
|
+
})
|
|
1780
1782
|
.strict()
|
|
1781
1783
|
```
|
|
1782
1784
|
|
|
1783
1785
|
### `AddContactsToListRequestSchema`
|
|
1784
1786
|
|
|
1785
1787
|
```typescript
|
|
1786
|
-
export const AddContactsToListRequestSchema = z
|
|
1787
|
-
.object({
|
|
1788
|
-
contactIds: z.array(UuidSchema).min(1).max(1000)
|
|
1789
|
-
})
|
|
1788
|
+
export const AddContactsToListRequestSchema = z
|
|
1789
|
+
.object({
|
|
1790
|
+
contactIds: z.array(UuidSchema).min(1).max(1000)
|
|
1791
|
+
})
|
|
1790
1792
|
.strict()
|
|
1791
1793
|
```
|
|
1792
1794
|
|
|
1793
1795
|
### `RecordListExecutionRequestSchema`
|
|
1794
1796
|
|
|
1795
1797
|
```typescript
|
|
1796
|
-
export const RecordListExecutionRequestSchema = z
|
|
1797
|
-
.object({
|
|
1798
|
-
executionId: UuidSchema,
|
|
1799
|
-
configSnapshot: z.record(z.string(), z.unknown()).optional()
|
|
1800
|
-
})
|
|
1798
|
+
export const RecordListExecutionRequestSchema = z
|
|
1799
|
+
.object({
|
|
1800
|
+
executionId: UuidSchema,
|
|
1801
|
+
configSnapshot: z.record(z.string(), z.unknown()).optional()
|
|
1802
|
+
})
|
|
1801
1803
|
.strict()
|
|
1802
1804
|
```
|
|
1803
1805
|
|
|
1804
1806
|
### `AcqListResponseSchema`
|
|
1805
1807
|
|
|
1806
1808
|
```typescript
|
|
1807
|
-
/**
|
|
1808
|
-
* Single list as returned by /api/acquisition/lists/:id etc.
|
|
1809
|
-
* Camel-cased domain shape matching AcqList in types.ts.
|
|
1810
|
-
*/
|
|
1811
|
-
export const AcqListResponseSchema = z.object({
|
|
1812
|
-
id: z.string(),
|
|
1813
|
-
organizationId: z.string(),
|
|
1814
|
-
name: z.string(),
|
|
1815
|
-
description: z.string().nullable(),
|
|
1816
|
-
type: z.string(),
|
|
1817
|
-
batchIds: z.array(z.string()),
|
|
1818
|
-
instantlyCampaignId: z.string().nullable(),
|
|
1819
|
-
/** Lifecycle status (draft | enriching | launched | closing | archived). */
|
|
1820
|
-
status: ListStatusSchema,
|
|
1821
|
-
metadata: z.record(z.string(), z.unknown()),
|
|
1822
|
-
launchedAt: z.string().nullable(),
|
|
1823
|
-
completedAt: z.string().nullable(),
|
|
1824
|
-
createdAt: z.string(),
|
|
1825
|
-
/** Scraping criteria stored as jsonb on the row. */
|
|
1826
|
-
scrapingConfig: ScrapingConfigSchema,
|
|
1827
|
-
/** ICP / qualification rubric stored as jsonb on the row. */
|
|
1828
|
-
icp: IcpRubricSchema,
|
|
1829
|
-
/** Pipeline presentation contract stored as jsonb on the row. */
|
|
1830
|
-
pipelineConfig: PipelineConfigSchema
|
|
1809
|
+
/**
|
|
1810
|
+
* Single list as returned by /api/acquisition/lists/:id etc.
|
|
1811
|
+
* Camel-cased domain shape matching AcqList in types.ts.
|
|
1812
|
+
*/
|
|
1813
|
+
export const AcqListResponseSchema = z.object({
|
|
1814
|
+
id: z.string(),
|
|
1815
|
+
organizationId: z.string(),
|
|
1816
|
+
name: z.string(),
|
|
1817
|
+
description: z.string().nullable(),
|
|
1818
|
+
type: z.string(),
|
|
1819
|
+
batchIds: z.array(z.string()),
|
|
1820
|
+
instantlyCampaignId: z.string().nullable(),
|
|
1821
|
+
/** Lifecycle status (draft | enriching | launched | closing | archived). */
|
|
1822
|
+
status: ListStatusSchema,
|
|
1823
|
+
metadata: z.record(z.string(), z.unknown()),
|
|
1824
|
+
launchedAt: z.string().nullable(),
|
|
1825
|
+
completedAt: z.string().nullable(),
|
|
1826
|
+
createdAt: z.string(),
|
|
1827
|
+
/** Scraping criteria stored as jsonb on the row. */
|
|
1828
|
+
scrapingConfig: ScrapingConfigSchema,
|
|
1829
|
+
/** ICP / qualification rubric stored as jsonb on the row. */
|
|
1830
|
+
icp: IcpRubricSchema,
|
|
1831
|
+
/** Pipeline presentation contract stored as jsonb on the row. */
|
|
1832
|
+
pipelineConfig: PipelineConfigSchema
|
|
1831
1833
|
})
|
|
1832
1834
|
```
|
|
1833
1835
|
|
|
@@ -1852,17 +1854,17 @@ export const ListTelemetryListResponseSchema = z.array(ListTelemetrySchema)
|
|
|
1852
1854
|
### `ListExecutionSummarySchema`
|
|
1853
1855
|
|
|
1854
1856
|
```typescript
|
|
1855
|
-
/**
|
|
1856
|
-
* Row from acq_list_executions joined with the execution summary,
|
|
1857
|
-
* shaped for the /lists/:id/executions response.
|
|
1858
|
-
*/
|
|
1859
|
-
export const ListExecutionSummarySchema = z.object({
|
|
1860
|
-
executionId: z.string(),
|
|
1861
|
-
resourceId: z.string(),
|
|
1862
|
-
status: z.string(),
|
|
1863
|
-
createdAt: z.string(),
|
|
1864
|
-
completedAt: z.string().nullable(),
|
|
1865
|
-
durationMs: z.number().int().nullable()
|
|
1857
|
+
/**
|
|
1858
|
+
* Row from acq_list_executions joined with the execution summary,
|
|
1859
|
+
* shaped for the /lists/:id/executions response.
|
|
1860
|
+
*/
|
|
1861
|
+
export const ListExecutionSummarySchema = z.object({
|
|
1862
|
+
executionId: z.string(),
|
|
1863
|
+
resourceId: z.string(),
|
|
1864
|
+
status: z.string(),
|
|
1865
|
+
createdAt: z.string(),
|
|
1866
|
+
completedAt: z.string().nullable(),
|
|
1867
|
+
durationMs: z.number().int().nullable()
|
|
1866
1868
|
})
|
|
1867
1869
|
```
|
|
1868
1870
|
|
|
@@ -1893,282 +1895,282 @@ export const AcqEmailValidSchema = z.enum(['VALID', 'INVALID', 'RISKY', 'UNKNOWN
|
|
|
1893
1895
|
### `CompanyIdParamsSchema`
|
|
1894
1896
|
|
|
1895
1897
|
```typescript
|
|
1896
|
-
export const CompanyIdParamsSchema = z.object({
|
|
1897
|
-
companyId: UuidSchema
|
|
1898
|
+
export const CompanyIdParamsSchema = z.object({
|
|
1899
|
+
companyId: UuidSchema
|
|
1898
1900
|
})
|
|
1899
1901
|
```
|
|
1900
1902
|
|
|
1901
1903
|
### `ContactIdParamsSchema`
|
|
1902
1904
|
|
|
1903
1905
|
```typescript
|
|
1904
|
-
export const ContactIdParamsSchema = z.object({
|
|
1905
|
-
contactId: UuidSchema
|
|
1906
|
+
export const ContactIdParamsSchema = z.object({
|
|
1907
|
+
contactId: UuidSchema
|
|
1906
1908
|
})
|
|
1907
1909
|
```
|
|
1908
1910
|
|
|
1909
1911
|
### `ListCompaniesQuerySchema`
|
|
1910
1912
|
|
|
1911
1913
|
```typescript
|
|
1912
|
-
export const ListCompaniesQuerySchema = z
|
|
1913
|
-
.object({
|
|
1914
|
-
search: z.string().trim().min(1).max(200).optional(),
|
|
1915
|
-
listId: UuidSchema.optional(),
|
|
1916
|
-
domain: z.string().trim().min(1).max(255).optional(),
|
|
1917
|
-
website: z.string().trim().min(1).max(2048).optional(),
|
|
1918
|
-
segment: z.string().trim().min(1).max(255).optional(),
|
|
1919
|
-
category: z.string().trim().min(1).max(255).optional(),
|
|
1920
|
-
batchId: z.string().trim().min(1).max(255).optional(),
|
|
1921
|
-
status: AcqCompanyStatusSchema.optional(),
|
|
1922
|
-
includeAll: QueryBooleanSchema.optional(),
|
|
1923
|
-
limit: z.coerce.number().int().min(1).max(5000).default(50),
|
|
1924
|
-
offset: z.coerce.number().int().min(0).default(0)
|
|
1925
|
-
})
|
|
1914
|
+
export const ListCompaniesQuerySchema = z
|
|
1915
|
+
.object({
|
|
1916
|
+
search: z.string().trim().min(1).max(200).optional(),
|
|
1917
|
+
listId: UuidSchema.optional(),
|
|
1918
|
+
domain: z.string().trim().min(1).max(255).optional(),
|
|
1919
|
+
website: z.string().trim().min(1).max(2048).optional(),
|
|
1920
|
+
segment: z.string().trim().min(1).max(255).optional(),
|
|
1921
|
+
category: z.string().trim().min(1).max(255).optional(),
|
|
1922
|
+
batchId: z.string().trim().min(1).max(255).optional(),
|
|
1923
|
+
status: AcqCompanyStatusSchema.optional(),
|
|
1924
|
+
includeAll: QueryBooleanSchema.optional(),
|
|
1925
|
+
limit: z.coerce.number().int().min(1).max(5000).default(50),
|
|
1926
|
+
offset: z.coerce.number().int().min(0).default(0)
|
|
1927
|
+
})
|
|
1926
1928
|
.strict()
|
|
1927
1929
|
```
|
|
1928
1930
|
|
|
1929
1931
|
### `ListContactsQuerySchema`
|
|
1930
1932
|
|
|
1931
1933
|
```typescript
|
|
1932
|
-
export const ListContactsQuerySchema = z
|
|
1933
|
-
.object({
|
|
1934
|
-
search: z.string().trim().min(1).max(200).optional(),
|
|
1935
|
-
listId: UuidSchema.optional(),
|
|
1936
|
-
openingLineIsNull: QueryBooleanSchema.optional(),
|
|
1937
|
-
batchId: z.string().trim().min(1).max(255).optional(),
|
|
1938
|
-
contactStatus: AcqContactStatusSchema.optional(),
|
|
1939
|
-
limit: z.coerce.number().int().min(1).max(5000).default(5000),
|
|
1940
|
-
offset: z.coerce.number().int().min(0).default(0)
|
|
1941
|
-
})
|
|
1934
|
+
export const ListContactsQuerySchema = z
|
|
1935
|
+
.object({
|
|
1936
|
+
search: z.string().trim().min(1).max(200).optional(),
|
|
1937
|
+
listId: UuidSchema.optional(),
|
|
1938
|
+
openingLineIsNull: QueryBooleanSchema.optional(),
|
|
1939
|
+
batchId: z.string().trim().min(1).max(255).optional(),
|
|
1940
|
+
contactStatus: AcqContactStatusSchema.optional(),
|
|
1941
|
+
limit: z.coerce.number().int().min(1).max(5000).default(5000),
|
|
1942
|
+
offset: z.coerce.number().int().min(0).default(0)
|
|
1943
|
+
})
|
|
1942
1944
|
.strict()
|
|
1943
1945
|
```
|
|
1944
1946
|
|
|
1945
1947
|
### `CreateCompanyRequestSchema`
|
|
1946
1948
|
|
|
1947
1949
|
```typescript
|
|
1948
|
-
export const CreateCompanyRequestSchema = z
|
|
1949
|
-
.object({
|
|
1950
|
-
name: z.string().trim().min(1).max(255),
|
|
1951
|
-
domain: z.string().trim().min(1).max(255).optional(),
|
|
1952
|
-
linkedinUrl: z.string().trim().url().optional(),
|
|
1953
|
-
website: z.string().trim().url().optional(),
|
|
1954
|
-
numEmployees: z.number().int().min(0).optional(),
|
|
1955
|
-
foundedYear: z.number().int().optional(),
|
|
1956
|
-
locationCity: z.string().trim().min(1).max(255).optional(),
|
|
1957
|
-
locationState: z.string().trim().min(1).max(255).optional(),
|
|
1958
|
-
category: z.string().trim().min(1).max(255).optional(),
|
|
1959
|
-
source: z.string().trim().min(1).max(255).optional(),
|
|
1960
|
-
batchId: z.string().trim().min(1).max(255).optional(),
|
|
1961
|
-
verticalResearch: z.string().trim().min(1).max(5000).optional()
|
|
1962
|
-
})
|
|
1950
|
+
export const CreateCompanyRequestSchema = z
|
|
1951
|
+
.object({
|
|
1952
|
+
name: z.string().trim().min(1).max(255),
|
|
1953
|
+
domain: z.string().trim().min(1).max(255).optional(),
|
|
1954
|
+
linkedinUrl: z.string().trim().url().optional(),
|
|
1955
|
+
website: z.string().trim().url().optional(),
|
|
1956
|
+
numEmployees: z.number().int().min(0).optional(),
|
|
1957
|
+
foundedYear: z.number().int().optional(),
|
|
1958
|
+
locationCity: z.string().trim().min(1).max(255).optional(),
|
|
1959
|
+
locationState: z.string().trim().min(1).max(255).optional(),
|
|
1960
|
+
category: z.string().trim().min(1).max(255).optional(),
|
|
1961
|
+
source: z.string().trim().min(1).max(255).optional(),
|
|
1962
|
+
batchId: z.string().trim().min(1).max(255).optional(),
|
|
1963
|
+
verticalResearch: z.string().trim().min(1).max(5000).optional()
|
|
1964
|
+
})
|
|
1963
1965
|
.strict()
|
|
1964
1966
|
```
|
|
1965
1967
|
|
|
1966
1968
|
### `UpdateCompanyRequestSchema`
|
|
1967
1969
|
|
|
1968
1970
|
```typescript
|
|
1969
|
-
export const UpdateCompanyRequestSchema = z
|
|
1970
|
-
.object({
|
|
1971
|
-
name: z.string().trim().min(1).max(255).optional(),
|
|
1972
|
-
domain: z.string().trim().min(1).max(255).optional(),
|
|
1973
|
-
linkedinUrl: z.string().trim().url().optional(),
|
|
1974
|
-
website: z.string().trim().url().optional(),
|
|
1975
|
-
numEmployees: z.number().int().min(0).optional(),
|
|
1976
|
-
foundedYear: z.number().int().optional(),
|
|
1977
|
-
locationCity: z.string().trim().min(1).max(255).optional(),
|
|
1978
|
-
locationState: z.string().trim().min(1).max(255).optional(),
|
|
1979
|
-
category: z.string().trim().min(1).max(255).optional(),
|
|
1980
|
-
segment: z.string().trim().min(1).max(255).optional(),
|
|
1981
|
-
pipelineStatus: z.record(z.string(), z.unknown()).optional(),
|
|
1982
|
-
enrichmentData: z.record(z.string(), z.unknown()).optional(),
|
|
1983
|
-
source: z.string().trim().min(1).max(255).optional(),
|
|
1984
|
-
batchId: z.string().trim().min(1).max(255).optional(),
|
|
1985
|
-
status: AcqCompanyStatusSchema.optional(),
|
|
1986
|
-
verticalResearch: z.string().trim().min(1).max(5000).nullable().optional()
|
|
1987
|
-
})
|
|
1988
|
-
.strict()
|
|
1989
|
-
.refine(
|
|
1990
|
-
(data) =>
|
|
1991
|
-
data.name !== undefined ||
|
|
1992
|
-
data.domain !== undefined ||
|
|
1993
|
-
data.linkedinUrl !== undefined ||
|
|
1994
|
-
data.website !== undefined ||
|
|
1995
|
-
data.numEmployees !== undefined ||
|
|
1996
|
-
data.foundedYear !== undefined ||
|
|
1997
|
-
data.locationCity !== undefined ||
|
|
1998
|
-
data.locationState !== undefined ||
|
|
1999
|
-
data.category !== undefined ||
|
|
2000
|
-
data.segment !== undefined ||
|
|
2001
|
-
data.pipelineStatus !== undefined ||
|
|
2002
|
-
data.enrichmentData !== undefined ||
|
|
2003
|
-
data.source !== undefined ||
|
|
2004
|
-
data.batchId !== undefined ||
|
|
2005
|
-
data.status !== undefined ||
|
|
2006
|
-
data.verticalResearch !== undefined,
|
|
2007
|
-
{
|
|
2008
|
-
message: 'At least one field must be provided'
|
|
2009
|
-
}
|
|
1971
|
+
export const UpdateCompanyRequestSchema = z
|
|
1972
|
+
.object({
|
|
1973
|
+
name: z.string().trim().min(1).max(255).optional(),
|
|
1974
|
+
domain: z.string().trim().min(1).max(255).optional(),
|
|
1975
|
+
linkedinUrl: z.string().trim().url().optional(),
|
|
1976
|
+
website: z.string().trim().url().optional(),
|
|
1977
|
+
numEmployees: z.number().int().min(0).optional(),
|
|
1978
|
+
foundedYear: z.number().int().optional(),
|
|
1979
|
+
locationCity: z.string().trim().min(1).max(255).optional(),
|
|
1980
|
+
locationState: z.string().trim().min(1).max(255).optional(),
|
|
1981
|
+
category: z.string().trim().min(1).max(255).optional(),
|
|
1982
|
+
segment: z.string().trim().min(1).max(255).optional(),
|
|
1983
|
+
pipelineStatus: z.record(z.string(), z.unknown()).optional(),
|
|
1984
|
+
enrichmentData: z.record(z.string(), z.unknown()).optional(),
|
|
1985
|
+
source: z.string().trim().min(1).max(255).optional(),
|
|
1986
|
+
batchId: z.string().trim().min(1).max(255).optional(),
|
|
1987
|
+
status: AcqCompanyStatusSchema.optional(),
|
|
1988
|
+
verticalResearch: z.string().trim().min(1).max(5000).nullable().optional()
|
|
1989
|
+
})
|
|
1990
|
+
.strict()
|
|
1991
|
+
.refine(
|
|
1992
|
+
(data) =>
|
|
1993
|
+
data.name !== undefined ||
|
|
1994
|
+
data.domain !== undefined ||
|
|
1995
|
+
data.linkedinUrl !== undefined ||
|
|
1996
|
+
data.website !== undefined ||
|
|
1997
|
+
data.numEmployees !== undefined ||
|
|
1998
|
+
data.foundedYear !== undefined ||
|
|
1999
|
+
data.locationCity !== undefined ||
|
|
2000
|
+
data.locationState !== undefined ||
|
|
2001
|
+
data.category !== undefined ||
|
|
2002
|
+
data.segment !== undefined ||
|
|
2003
|
+
data.pipelineStatus !== undefined ||
|
|
2004
|
+
data.enrichmentData !== undefined ||
|
|
2005
|
+
data.source !== undefined ||
|
|
2006
|
+
data.batchId !== undefined ||
|
|
2007
|
+
data.status !== undefined ||
|
|
2008
|
+
data.verticalResearch !== undefined,
|
|
2009
|
+
{
|
|
2010
|
+
message: 'At least one field must be provided'
|
|
2011
|
+
}
|
|
2010
2012
|
)
|
|
2011
2013
|
```
|
|
2012
2014
|
|
|
2013
2015
|
### `CreateContactRequestSchema`
|
|
2014
2016
|
|
|
2015
2017
|
```typescript
|
|
2016
|
-
export const CreateContactRequestSchema = z
|
|
2017
|
-
.object({
|
|
2018
|
-
email: z.string().trim().email(),
|
|
2019
|
-
companyId: UuidSchema.optional(),
|
|
2020
|
-
firstName: z.string().trim().min(1).max(255).optional(),
|
|
2021
|
-
lastName: z.string().trim().min(1).max(255).optional(),
|
|
2022
|
-
linkedinUrl: z.string().trim().url().optional(),
|
|
2023
|
-
title: z.string().trim().min(1).max(255).optional(),
|
|
2024
|
-
source: z.string().trim().min(1).max(255).optional(),
|
|
2025
|
-
sourceId: z.string().trim().min(1).max(255).optional(),
|
|
2026
|
-
batchId: z.string().trim().min(1).max(255).optional()
|
|
2027
|
-
})
|
|
2018
|
+
export const CreateContactRequestSchema = z
|
|
2019
|
+
.object({
|
|
2020
|
+
email: z.string().trim().email(),
|
|
2021
|
+
companyId: UuidSchema.optional(),
|
|
2022
|
+
firstName: z.string().trim().min(1).max(255).optional(),
|
|
2023
|
+
lastName: z.string().trim().min(1).max(255).optional(),
|
|
2024
|
+
linkedinUrl: z.string().trim().url().optional(),
|
|
2025
|
+
title: z.string().trim().min(1).max(255).optional(),
|
|
2026
|
+
source: z.string().trim().min(1).max(255).optional(),
|
|
2027
|
+
sourceId: z.string().trim().min(1).max(255).optional(),
|
|
2028
|
+
batchId: z.string().trim().min(1).max(255).optional()
|
|
2029
|
+
})
|
|
2028
2030
|
.strict()
|
|
2029
2031
|
```
|
|
2030
2032
|
|
|
2031
2033
|
### `UpdateContactRequestSchema`
|
|
2032
2034
|
|
|
2033
2035
|
```typescript
|
|
2034
|
-
export const UpdateContactRequestSchema = z
|
|
2035
|
-
.object({
|
|
2036
|
-
companyId: UuidSchema.optional(),
|
|
2037
|
-
emailValid: AcqEmailValidSchema.optional(),
|
|
2038
|
-
firstName: z.string().trim().min(1).max(255).optional(),
|
|
2039
|
-
lastName: z.string().trim().min(1).max(255).optional(),
|
|
2040
|
-
linkedinUrl: z.string().trim().url().optional(),
|
|
2041
|
-
title: z.string().trim().min(1).max(255).optional(),
|
|
2042
|
-
headline: z.string().trim().min(1).max(5000).optional(),
|
|
2043
|
-
filterReason: z.string().trim().min(1).max(5000).optional(),
|
|
2044
|
-
openingLine: z.string().trim().min(1).max(5000).optional(),
|
|
2045
|
-
pipelineStatus: z.record(z.string(), z.unknown()).optional(),
|
|
2046
|
-
enrichmentData: z.record(z.string(), z.unknown()).optional(),
|
|
2047
|
-
status: AcqContactStatusSchema.optional()
|
|
2048
|
-
})
|
|
2049
|
-
.strict()
|
|
2050
|
-
.refine(
|
|
2051
|
-
(data) =>
|
|
2052
|
-
data.companyId !== undefined ||
|
|
2053
|
-
data.emailValid !== undefined ||
|
|
2054
|
-
data.firstName !== undefined ||
|
|
2055
|
-
data.lastName !== undefined ||
|
|
2056
|
-
data.linkedinUrl !== undefined ||
|
|
2057
|
-
data.title !== undefined ||
|
|
2058
|
-
data.headline !== undefined ||
|
|
2059
|
-
data.filterReason !== undefined ||
|
|
2060
|
-
data.openingLine !== undefined ||
|
|
2061
|
-
data.pipelineStatus !== undefined ||
|
|
2062
|
-
data.enrichmentData !== undefined ||
|
|
2063
|
-
data.status !== undefined,
|
|
2064
|
-
{
|
|
2065
|
-
message: 'At least one field must be provided'
|
|
2066
|
-
}
|
|
2036
|
+
export const UpdateContactRequestSchema = z
|
|
2037
|
+
.object({
|
|
2038
|
+
companyId: UuidSchema.optional(),
|
|
2039
|
+
emailValid: AcqEmailValidSchema.optional(),
|
|
2040
|
+
firstName: z.string().trim().min(1).max(255).optional(),
|
|
2041
|
+
lastName: z.string().trim().min(1).max(255).optional(),
|
|
2042
|
+
linkedinUrl: z.string().trim().url().optional(),
|
|
2043
|
+
title: z.string().trim().min(1).max(255).optional(),
|
|
2044
|
+
headline: z.string().trim().min(1).max(5000).optional(),
|
|
2045
|
+
filterReason: z.string().trim().min(1).max(5000).optional(),
|
|
2046
|
+
openingLine: z.string().trim().min(1).max(5000).optional(),
|
|
2047
|
+
pipelineStatus: z.record(z.string(), z.unknown()).optional(),
|
|
2048
|
+
enrichmentData: z.record(z.string(), z.unknown()).optional(),
|
|
2049
|
+
status: AcqContactStatusSchema.optional()
|
|
2050
|
+
})
|
|
2051
|
+
.strict()
|
|
2052
|
+
.refine(
|
|
2053
|
+
(data) =>
|
|
2054
|
+
data.companyId !== undefined ||
|
|
2055
|
+
data.emailValid !== undefined ||
|
|
2056
|
+
data.firstName !== undefined ||
|
|
2057
|
+
data.lastName !== undefined ||
|
|
2058
|
+
data.linkedinUrl !== undefined ||
|
|
2059
|
+
data.title !== undefined ||
|
|
2060
|
+
data.headline !== undefined ||
|
|
2061
|
+
data.filterReason !== undefined ||
|
|
2062
|
+
data.openingLine !== undefined ||
|
|
2063
|
+
data.pipelineStatus !== undefined ||
|
|
2064
|
+
data.enrichmentData !== undefined ||
|
|
2065
|
+
data.status !== undefined,
|
|
2066
|
+
{
|
|
2067
|
+
message: 'At least one field must be provided'
|
|
2068
|
+
}
|
|
2067
2069
|
)
|
|
2068
2070
|
```
|
|
2069
2071
|
|
|
2070
2072
|
### `AcqCompanyResponseSchema`
|
|
2071
2073
|
|
|
2072
2074
|
```typescript
|
|
2073
|
-
export const AcqCompanyResponseSchema = z.object({
|
|
2074
|
-
id: z.string(),
|
|
2075
|
-
organizationId: z.string(),
|
|
2076
|
-
name: z.string(),
|
|
2077
|
-
domain: z.string().nullable(),
|
|
2078
|
-
linkedinUrl: z.string().nullable(),
|
|
2079
|
-
website: z.string().nullable(),
|
|
2080
|
-
numEmployees: z.number().nullable(),
|
|
2081
|
-
foundedYear: z.number().nullable(),
|
|
2082
|
-
locationCity: z.string().nullable(),
|
|
2083
|
-
locationState: z.string().nullable(),
|
|
2084
|
-
category: z.string().nullable(),
|
|
2085
|
-
categoryPain: z.string().nullable(),
|
|
2086
|
-
segment: z.string().nullable(),
|
|
2087
|
-
pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
|
|
2088
|
-
enrichmentData: z.record(z.string(), z.unknown()).nullable(),
|
|
2089
|
-
source: z.string().nullable(),
|
|
2090
|
-
batchId: z.string().nullable(),
|
|
2091
|
-
status: AcqCompanyStatusSchema,
|
|
2092
|
-
contactCount: z.number().int().min(0),
|
|
2093
|
-
verticalResearch: z.string().nullable(),
|
|
2094
|
-
createdAt: z.string(),
|
|
2095
|
-
updatedAt: z.string()
|
|
2075
|
+
export const AcqCompanyResponseSchema = z.object({
|
|
2076
|
+
id: z.string(),
|
|
2077
|
+
organizationId: z.string(),
|
|
2078
|
+
name: z.string(),
|
|
2079
|
+
domain: z.string().nullable(),
|
|
2080
|
+
linkedinUrl: z.string().nullable(),
|
|
2081
|
+
website: z.string().nullable(),
|
|
2082
|
+
numEmployees: z.number().nullable(),
|
|
2083
|
+
foundedYear: z.number().nullable(),
|
|
2084
|
+
locationCity: z.string().nullable(),
|
|
2085
|
+
locationState: z.string().nullable(),
|
|
2086
|
+
category: z.string().nullable(),
|
|
2087
|
+
categoryPain: z.string().nullable(),
|
|
2088
|
+
segment: z.string().nullable(),
|
|
2089
|
+
pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
|
|
2090
|
+
enrichmentData: z.record(z.string(), z.unknown()).nullable(),
|
|
2091
|
+
source: z.string().nullable(),
|
|
2092
|
+
batchId: z.string().nullable(),
|
|
2093
|
+
status: AcqCompanyStatusSchema,
|
|
2094
|
+
contactCount: z.number().int().min(0),
|
|
2095
|
+
verticalResearch: z.string().nullable(),
|
|
2096
|
+
createdAt: z.string(),
|
|
2097
|
+
updatedAt: z.string()
|
|
2096
2098
|
})
|
|
2097
2099
|
```
|
|
2098
2100
|
|
|
2099
2101
|
### `AcqCompanyListResponseSchema`
|
|
2100
2102
|
|
|
2101
2103
|
```typescript
|
|
2102
|
-
export const AcqCompanyListResponseSchema = z.object({
|
|
2103
|
-
data: z.array(AcqCompanyResponseSchema),
|
|
2104
|
-
total: z.number().int(),
|
|
2105
|
-
limit: z.number().int(),
|
|
2106
|
-
offset: z.number().int()
|
|
2104
|
+
export const AcqCompanyListResponseSchema = z.object({
|
|
2105
|
+
data: z.array(AcqCompanyResponseSchema),
|
|
2106
|
+
total: z.number().int(),
|
|
2107
|
+
limit: z.number().int(),
|
|
2108
|
+
offset: z.number().int()
|
|
2107
2109
|
})
|
|
2108
2110
|
```
|
|
2109
2111
|
|
|
2110
2112
|
### `AcqCompanyFacetsResponseSchema`
|
|
2111
2113
|
|
|
2112
2114
|
```typescript
|
|
2113
|
-
export const AcqCompanyFacetsResponseSchema = z.object({
|
|
2114
|
-
segments: z.array(z.string()),
|
|
2115
|
-
categories: z.array(z.string()),
|
|
2116
|
-
statuses: z.array(AcqCompanyStatusSchema)
|
|
2115
|
+
export const AcqCompanyFacetsResponseSchema = z.object({
|
|
2116
|
+
segments: z.array(z.string()),
|
|
2117
|
+
categories: z.array(z.string()),
|
|
2118
|
+
statuses: z.array(AcqCompanyStatusSchema)
|
|
2117
2119
|
})
|
|
2118
2120
|
```
|
|
2119
2121
|
|
|
2120
2122
|
### `AcqContactCompanySummarySchema`
|
|
2121
2123
|
|
|
2122
2124
|
```typescript
|
|
2123
|
-
export const AcqContactCompanySummarySchema = z.object({
|
|
2124
|
-
id: z.string(),
|
|
2125
|
-
name: z.string(),
|
|
2126
|
-
domain: z.string().nullable(),
|
|
2127
|
-
website: z.string().nullable(),
|
|
2128
|
-
linkedinUrl: z.string().nullable(),
|
|
2129
|
-
segment: z.string().nullable(),
|
|
2130
|
-
category: z.string().nullable(),
|
|
2131
|
-
status: AcqCompanyStatusSchema
|
|
2125
|
+
export const AcqContactCompanySummarySchema = z.object({
|
|
2126
|
+
id: z.string(),
|
|
2127
|
+
name: z.string(),
|
|
2128
|
+
domain: z.string().nullable(),
|
|
2129
|
+
website: z.string().nullable(),
|
|
2130
|
+
linkedinUrl: z.string().nullable(),
|
|
2131
|
+
segment: z.string().nullable(),
|
|
2132
|
+
category: z.string().nullable(),
|
|
2133
|
+
status: AcqCompanyStatusSchema
|
|
2132
2134
|
})
|
|
2133
2135
|
```
|
|
2134
2136
|
|
|
2135
2137
|
### `AcqContactResponseSchema`
|
|
2136
2138
|
|
|
2137
2139
|
```typescript
|
|
2138
|
-
export const AcqContactResponseSchema = z.object({
|
|
2139
|
-
id: z.string(),
|
|
2140
|
-
organizationId: z.string(),
|
|
2141
|
-
companyId: z.string().nullable(),
|
|
2142
|
-
email: z.string(),
|
|
2143
|
-
emailValid: AcqEmailValidSchema.nullable(),
|
|
2144
|
-
firstName: z.string().nullable(),
|
|
2145
|
-
lastName: z.string().nullable(),
|
|
2146
|
-
linkedinUrl: z.string().nullable(),
|
|
2147
|
-
title: z.string().nullable(),
|
|
2148
|
-
headline: z.string().nullable(),
|
|
2149
|
-
filterReason: z.string().nullable(),
|
|
2150
|
-
openingLine: z.string().nullable(),
|
|
2151
|
-
source: z.string().nullable(),
|
|
2152
|
-
sourceId: z.string().nullable(),
|
|
2153
|
-
pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
|
|
2154
|
-
enrichmentData: z.record(z.string(), z.unknown()).nullable(),
|
|
2155
|
-
attioPersonId: z.string().nullable(),
|
|
2156
|
-
batchId: z.string().nullable(),
|
|
2157
|
-
status: AcqContactStatusSchema,
|
|
2158
|
-
company: AcqContactCompanySummarySchema.nullable().optional(),
|
|
2159
|
-
createdAt: z.string(),
|
|
2160
|
-
updatedAt: z.string()
|
|
2140
|
+
export const AcqContactResponseSchema = z.object({
|
|
2141
|
+
id: z.string(),
|
|
2142
|
+
organizationId: z.string(),
|
|
2143
|
+
companyId: z.string().nullable(),
|
|
2144
|
+
email: z.string(),
|
|
2145
|
+
emailValid: AcqEmailValidSchema.nullable(),
|
|
2146
|
+
firstName: z.string().nullable(),
|
|
2147
|
+
lastName: z.string().nullable(),
|
|
2148
|
+
linkedinUrl: z.string().nullable(),
|
|
2149
|
+
title: z.string().nullable(),
|
|
2150
|
+
headline: z.string().nullable(),
|
|
2151
|
+
filterReason: z.string().nullable(),
|
|
2152
|
+
openingLine: z.string().nullable(),
|
|
2153
|
+
source: z.string().nullable(),
|
|
2154
|
+
sourceId: z.string().nullable(),
|
|
2155
|
+
pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
|
|
2156
|
+
enrichmentData: z.record(z.string(), z.unknown()).nullable(),
|
|
2157
|
+
attioPersonId: z.string().nullable(),
|
|
2158
|
+
batchId: z.string().nullable(),
|
|
2159
|
+
status: AcqContactStatusSchema,
|
|
2160
|
+
company: AcqContactCompanySummarySchema.nullable().optional(),
|
|
2161
|
+
createdAt: z.string(),
|
|
2162
|
+
updatedAt: z.string()
|
|
2161
2163
|
})
|
|
2162
2164
|
```
|
|
2163
2165
|
|
|
2164
2166
|
### `AcqContactListResponseSchema`
|
|
2165
2167
|
|
|
2166
2168
|
```typescript
|
|
2167
|
-
export const AcqContactListResponseSchema = z.object({
|
|
2168
|
-
data: z.array(AcqContactResponseSchema),
|
|
2169
|
-
total: z.number().int(),
|
|
2170
|
-
limit: z.number().int(),
|
|
2171
|
-
offset: z.number().int()
|
|
2169
|
+
export const AcqContactListResponseSchema = z.object({
|
|
2170
|
+
data: z.array(AcqContactResponseSchema),
|
|
2171
|
+
total: z.number().int(),
|
|
2172
|
+
limit: z.number().int(),
|
|
2173
|
+
offset: z.number().int()
|
|
2172
2174
|
})
|
|
2173
2175
|
```
|
|
2174
2176
|
|
|
@@ -2181,269 +2183,222 @@ export const AcqArtifactOwnerKindSchema = z.enum(['company', 'contact', 'deal',
|
|
|
2181
2183
|
### `ListArtifactsQuerySchema`
|
|
2182
2184
|
|
|
2183
2185
|
```typescript
|
|
2184
|
-
export const ListArtifactsQuerySchema = z
|
|
2185
|
-
.object({
|
|
2186
|
-
ownerKind: AcqArtifactOwnerKindSchema,
|
|
2187
|
-
ownerId: UuidSchema
|
|
2188
|
-
})
|
|
2186
|
+
export const ListArtifactsQuerySchema = z
|
|
2187
|
+
.object({
|
|
2188
|
+
ownerKind: AcqArtifactOwnerKindSchema,
|
|
2189
|
+
ownerId: UuidSchema
|
|
2190
|
+
})
|
|
2189
2191
|
.strict()
|
|
2190
2192
|
```
|
|
2191
2193
|
|
|
2192
2194
|
### `CreateArtifactRequestSchema`
|
|
2193
2195
|
|
|
2194
2196
|
```typescript
|
|
2195
|
-
export const CreateArtifactRequestSchema = z
|
|
2196
|
-
.object({
|
|
2197
|
-
ownerKind: AcqArtifactOwnerKindSchema,
|
|
2198
|
-
ownerId: UuidSchema,
|
|
2199
|
-
kind: z.string().trim().min(1).max(255),
|
|
2200
|
-
content: z.record(z.string(), z.unknown()),
|
|
2201
|
-
sourceExecutionId: UuidSchema.optional()
|
|
2202
|
-
})
|
|
2197
|
+
export const CreateArtifactRequestSchema = z
|
|
2198
|
+
.object({
|
|
2199
|
+
ownerKind: AcqArtifactOwnerKindSchema,
|
|
2200
|
+
ownerId: UuidSchema,
|
|
2201
|
+
kind: z.string().trim().min(1).max(255),
|
|
2202
|
+
content: z.record(z.string(), z.unknown()),
|
|
2203
|
+
sourceExecutionId: UuidSchema.optional()
|
|
2204
|
+
})
|
|
2203
2205
|
.strict()
|
|
2204
2206
|
```
|
|
2205
2207
|
|
|
2206
2208
|
### `AcqArtifactResponseSchema`
|
|
2207
2209
|
|
|
2208
2210
|
```typescript
|
|
2209
|
-
export const AcqArtifactResponseSchema = z.object({
|
|
2210
|
-
id: z.string(),
|
|
2211
|
-
organizationId: z.string(),
|
|
2212
|
-
ownerKind: z.string(),
|
|
2213
|
-
ownerId: z.string(),
|
|
2214
|
-
kind: z.string(),
|
|
2215
|
-
content: z.record(z.string(), z.unknown()),
|
|
2216
|
-
sourceExecutionId: z.string().nullable(),
|
|
2217
|
-
createdBy: z.string().nullable(),
|
|
2218
|
-
createdAt: z.string(),
|
|
2219
|
-
version: z.number().int()
|
|
2211
|
+
export const AcqArtifactResponseSchema = z.object({
|
|
2212
|
+
id: z.string(),
|
|
2213
|
+
organizationId: z.string(),
|
|
2214
|
+
ownerKind: z.string(),
|
|
2215
|
+
ownerId: z.string(),
|
|
2216
|
+
kind: z.string(),
|
|
2217
|
+
content: z.record(z.string(), z.unknown()),
|
|
2218
|
+
sourceExecutionId: z.string().nullable(),
|
|
2219
|
+
createdBy: z.string().nullable(),
|
|
2220
|
+
createdAt: z.string(),
|
|
2221
|
+
version: z.number().int()
|
|
2220
2222
|
})
|
|
2221
2223
|
```
|
|
2222
2224
|
|
|
2223
2225
|
### `AcqArtifactListResponseSchema`
|
|
2224
2226
|
|
|
2225
2227
|
```typescript
|
|
2226
|
-
export const AcqArtifactListResponseSchema = z.object({
|
|
2227
|
-
artifacts: z.array(AcqArtifactResponseSchema)
|
|
2228
|
-
})
|
|
2229
|
-
```
|
|
2230
|
-
|
|
2231
|
-
### `ListTouchpointsQuerySchema`
|
|
2232
|
-
|
|
2233
|
-
```typescript
|
|
2234
|
-
export const ListTouchpointsQuerySchema = z
|
|
2235
|
-
.object({
|
|
2236
|
-
listId: UuidSchema.optional(),
|
|
2237
|
-
listMemberId: UuidSchema.optional(),
|
|
2238
|
-
contactId: UuidSchema.optional()
|
|
2239
|
-
})
|
|
2240
|
-
.strict()
|
|
2241
|
-
.refine((data) => data.listId !== undefined || data.listMemberId !== undefined || data.contactId !== undefined, {
|
|
2242
|
-
message: 'At least one filter (listId, listMemberId, or contactId) must be provided'
|
|
2243
|
-
})
|
|
2244
|
-
```
|
|
2245
|
-
|
|
2246
|
-
### `AcqTouchpointResponseSchema`
|
|
2247
|
-
|
|
2248
|
-
```typescript
|
|
2249
|
-
export const AcqTouchpointResponseSchema = z.object({
|
|
2250
|
-
id: z.string(),
|
|
2251
|
-
organizationId: z.string(),
|
|
2252
|
-
listId: z.string().nullable(),
|
|
2253
|
-
listMemberId: z.string().nullable(),
|
|
2254
|
-
contactId: z.string().nullable(),
|
|
2255
|
-
artifactId: z.string().nullable(),
|
|
2256
|
-
channel: z.string(),
|
|
2257
|
-
kind: z.string(),
|
|
2258
|
-
direction: z.string(),
|
|
2259
|
-
occurredAt: z.string(),
|
|
2260
|
-
payload: z.record(z.string(), z.unknown()).nullable(),
|
|
2261
|
-
sourceExecutionId: z.string().nullable(),
|
|
2262
|
-
createdAt: z.string()
|
|
2263
|
-
})
|
|
2264
|
-
```
|
|
2265
|
-
|
|
2266
|
-
### `AcqTouchpointListResponseSchema`
|
|
2267
|
-
|
|
2268
|
-
```typescript
|
|
2269
|
-
export const AcqTouchpointListResponseSchema = z.object({
|
|
2270
|
-
touchpoints: z.array(AcqTouchpointResponseSchema)
|
|
2228
|
+
export const AcqArtifactListResponseSchema = z.object({
|
|
2229
|
+
artifacts: z.array(AcqArtifactResponseSchema)
|
|
2271
2230
|
})
|
|
2272
2231
|
```
|
|
2273
2232
|
|
|
2274
2233
|
### `ListMembersQuerySchema`
|
|
2275
2234
|
|
|
2276
2235
|
```typescript
|
|
2277
|
-
export const ListMembersQuerySchema = z
|
|
2278
|
-
.object({
|
|
2279
|
-
limit: z.coerce.number().int().min(1).max(500).default(50),
|
|
2280
|
-
offset: z.coerce.number().int().min(0).default(0)
|
|
2281
|
-
})
|
|
2236
|
+
export const ListMembersQuerySchema = z
|
|
2237
|
+
.object({
|
|
2238
|
+
limit: z.coerce.number().int().min(1).max(500).default(50),
|
|
2239
|
+
offset: z.coerce.number().int().min(0).default(0)
|
|
2240
|
+
})
|
|
2282
2241
|
.strict()
|
|
2283
2242
|
```
|
|
2284
2243
|
|
|
2285
2244
|
### `MemberIdParamsSchema`
|
|
2286
2245
|
|
|
2287
2246
|
```typescript
|
|
2288
|
-
export const MemberIdParamsSchema = z.object({
|
|
2289
|
-
memberId: UuidSchema
|
|
2247
|
+
export const MemberIdParamsSchema = z.object({
|
|
2248
|
+
memberId: UuidSchema
|
|
2290
2249
|
})
|
|
2291
2250
|
```
|
|
2292
2251
|
|
|
2293
2252
|
### `AcqListMemberContactSummarySchema`
|
|
2294
2253
|
|
|
2295
2254
|
```typescript
|
|
2296
|
-
export const AcqListMemberContactSummarySchema = z.object({
|
|
2297
|
-
id: z.string(),
|
|
2298
|
-
email: z.string(),
|
|
2299
|
-
firstName: z.string().nullable(),
|
|
2300
|
-
lastName: z.string().nullable(),
|
|
2301
|
-
title: z.string().nullable(),
|
|
2302
|
-
linkedinUrl: z.string().nullable(),
|
|
2303
|
-
companyId: z.string().nullable()
|
|
2255
|
+
export const AcqListMemberContactSummarySchema = z.object({
|
|
2256
|
+
id: z.string(),
|
|
2257
|
+
email: z.string(),
|
|
2258
|
+
firstName: z.string().nullable(),
|
|
2259
|
+
lastName: z.string().nullable(),
|
|
2260
|
+
title: z.string().nullable(),
|
|
2261
|
+
linkedinUrl: z.string().nullable(),
|
|
2262
|
+
companyId: z.string().nullable()
|
|
2304
2263
|
})
|
|
2305
2264
|
```
|
|
2306
2265
|
|
|
2307
2266
|
### `AcqListMemberResponseSchema`
|
|
2308
2267
|
|
|
2309
2268
|
```typescript
|
|
2310
|
-
export const AcqListMemberResponseSchema = z.object({
|
|
2311
|
-
id: z.string(),
|
|
2312
|
-
listId: z.string(),
|
|
2313
|
-
contactId: z.string(),
|
|
2314
|
-
pipelineKey: z.string(),
|
|
2315
|
-
stageKey: z.string(),
|
|
2316
|
-
stateKey: z.string(),
|
|
2317
|
-
activityLog: z.unknown(),
|
|
2318
|
-
addedAt: z.string(),
|
|
2319
|
-
addedBy: z.string().nullable(),
|
|
2320
|
-
sourceExecutionId: z.string().nullable(),
|
|
2321
|
-
contact: AcqListMemberContactSummarySchema.nullable()
|
|
2269
|
+
export const AcqListMemberResponseSchema = z.object({
|
|
2270
|
+
id: z.string(),
|
|
2271
|
+
listId: z.string(),
|
|
2272
|
+
contactId: z.string(),
|
|
2273
|
+
pipelineKey: z.string(),
|
|
2274
|
+
stageKey: z.string(),
|
|
2275
|
+
stateKey: z.string(),
|
|
2276
|
+
activityLog: z.unknown(),
|
|
2277
|
+
addedAt: z.string(),
|
|
2278
|
+
addedBy: z.string().nullable(),
|
|
2279
|
+
sourceExecutionId: z.string().nullable(),
|
|
2280
|
+
contact: AcqListMemberContactSummarySchema.nullable()
|
|
2322
2281
|
})
|
|
2323
2282
|
```
|
|
2324
2283
|
|
|
2325
2284
|
### `AcqListMembersResponseSchema`
|
|
2326
2285
|
|
|
2327
2286
|
```typescript
|
|
2328
|
-
export const AcqListMembersResponseSchema = z.object({
|
|
2329
|
-
members: z.array(AcqListMemberResponseSchema)
|
|
2287
|
+
export const AcqListMembersResponseSchema = z.object({
|
|
2288
|
+
members: z.array(AcqListMemberResponseSchema)
|
|
2330
2289
|
})
|
|
2331
2290
|
```
|
|
2332
2291
|
|
|
2333
2292
|
### `ListCompanyIdParamsSchema`
|
|
2334
2293
|
|
|
2335
2294
|
```typescript
|
|
2336
|
-
export const ListCompanyIdParamsSchema = z.object({
|
|
2337
|
-
listCompanyId: UuidSchema
|
|
2295
|
+
export const ListCompanyIdParamsSchema = z.object({
|
|
2296
|
+
listCompanyId: UuidSchema
|
|
2338
2297
|
})
|
|
2339
2298
|
```
|
|
2340
2299
|
|
|
2341
2300
|
### `AcqListCompanyResponseSchema`
|
|
2342
2301
|
|
|
2343
2302
|
```typescript
|
|
2344
|
-
export const AcqListCompanyResponseSchema = z.object({
|
|
2345
|
-
id: z.string(),
|
|
2346
|
-
listId: z.string(),
|
|
2347
|
-
companyId: z.string(),
|
|
2348
|
-
pipelineKey: z.string(),
|
|
2349
|
-
stageKey: z.string(),
|
|
2350
|
-
stateKey: z.string(),
|
|
2351
|
-
activityLog: z.unknown(),
|
|
2352
|
-
addedAt: z.string(),
|
|
2353
|
-
addedBy: z.string().nullable(),
|
|
2354
|
-
sourceExecutionId: z.string().nullable()
|
|
2303
|
+
export const AcqListCompanyResponseSchema = z.object({
|
|
2304
|
+
id: z.string(),
|
|
2305
|
+
listId: z.string(),
|
|
2306
|
+
companyId: z.string(),
|
|
2307
|
+
pipelineKey: z.string(),
|
|
2308
|
+
stageKey: z.string(),
|
|
2309
|
+
stateKey: z.string(),
|
|
2310
|
+
activityLog: z.unknown(),
|
|
2311
|
+
addedAt: z.string(),
|
|
2312
|
+
addedBy: z.string().nullable(),
|
|
2313
|
+
sourceExecutionId: z.string().nullable()
|
|
2355
2314
|
})
|
|
2356
2315
|
```
|
|
2357
2316
|
|
|
2358
2317
|
### `AcqCompanySchemas`
|
|
2359
2318
|
|
|
2360
2319
|
```typescript
|
|
2361
|
-
export const AcqCompanySchemas = {
|
|
2362
|
-
CompanyIdParams: CompanyIdParamsSchema,
|
|
2363
|
-
ListCompaniesQuery: ListCompaniesQuerySchema,
|
|
2364
|
-
CreateCompanyRequest: CreateCompanyRequestSchema,
|
|
2365
|
-
UpdateCompanyRequest: UpdateCompanyRequestSchema,
|
|
2366
|
-
AcqCompanyResponse: AcqCompanyResponseSchema,
|
|
2367
|
-
AcqCompanyListResponse: AcqCompanyListResponseSchema,
|
|
2368
|
-
AcqCompanyFacetsResponse: AcqCompanyFacetsResponseSchema
|
|
2320
|
+
export const AcqCompanySchemas = {
|
|
2321
|
+
CompanyIdParams: CompanyIdParamsSchema,
|
|
2322
|
+
ListCompaniesQuery: ListCompaniesQuerySchema,
|
|
2323
|
+
CreateCompanyRequest: CreateCompanyRequestSchema,
|
|
2324
|
+
UpdateCompanyRequest: UpdateCompanyRequestSchema,
|
|
2325
|
+
AcqCompanyResponse: AcqCompanyResponseSchema,
|
|
2326
|
+
AcqCompanyListResponse: AcqCompanyListResponseSchema,
|
|
2327
|
+
AcqCompanyFacetsResponse: AcqCompanyFacetsResponseSchema
|
|
2369
2328
|
}
|
|
2370
2329
|
```
|
|
2371
2330
|
|
|
2372
2331
|
### `AcqContactSchemas`
|
|
2373
2332
|
|
|
2374
2333
|
```typescript
|
|
2375
|
-
export const AcqContactSchemas = {
|
|
2376
|
-
ContactIdParams: ContactIdParamsSchema,
|
|
2377
|
-
ListContactsQuery: ListContactsQuerySchema,
|
|
2378
|
-
CreateContactRequest: CreateContactRequestSchema,
|
|
2379
|
-
UpdateContactRequest: UpdateContactRequestSchema,
|
|
2380
|
-
AcqContactResponse: AcqContactResponseSchema,
|
|
2381
|
-
AcqContactListResponse: AcqContactListResponseSchema
|
|
2334
|
+
export const AcqContactSchemas = {
|
|
2335
|
+
ContactIdParams: ContactIdParamsSchema,
|
|
2336
|
+
ListContactsQuery: ListContactsQuerySchema,
|
|
2337
|
+
CreateContactRequest: CreateContactRequestSchema,
|
|
2338
|
+
UpdateContactRequest: UpdateContactRequestSchema,
|
|
2339
|
+
AcqContactResponse: AcqContactResponseSchema,
|
|
2340
|
+
AcqContactListResponse: AcqContactListResponseSchema
|
|
2382
2341
|
}
|
|
2383
2342
|
```
|
|
2384
2343
|
|
|
2385
2344
|
### `AcqListSchemas`
|
|
2386
2345
|
|
|
2387
2346
|
```typescript
|
|
2388
|
-
export const AcqListSchemas = {
|
|
2389
|
-
// Params
|
|
2390
|
-
ListIdParams: ListIdParamsSchema,
|
|
2391
|
-
|
|
2392
|
-
// Primitives (for UI / tests)
|
|
2393
|
-
ListStatus: ListStatusSchema,
|
|
2394
|
-
ScrapingConfig: ScrapingConfigSchema,
|
|
2395
|
-
IcpRubric: IcpRubricSchema,
|
|
2396
|
-
PipelineConfig: PipelineConfigSchema,
|
|
2397
|
-
PipelineStage: PipelineStageSchema,
|
|
2398
|
-
ListStageCounts: ListStageCountsSchema,
|
|
2399
|
-
ListTelemetry: ListTelemetrySchema,
|
|
2400
|
-
|
|
2401
|
-
// Requests
|
|
2402
|
-
CreateListRequest: CreateListRequestSchema,
|
|
2403
|
-
UpdateListRequest: UpdateListRequestSchema,
|
|
2404
|
-
UpdateListStatusRequest: UpdateListStatusRequestSchema,
|
|
2405
|
-
UpdateListConfigRequest: UpdateListConfigRequestSchema,
|
|
2406
|
-
AddCompaniesToListRequest: AddCompaniesToListRequestSchema,
|
|
2407
|
-
RemoveCompaniesFromListRequest: RemoveCompaniesFromListRequestSchema,
|
|
2408
|
-
AddContactsToListRequest: AddContactsToListRequestSchema,
|
|
2409
|
-
RecordListExecutionRequest: RecordListExecutionRequestSchema,
|
|
2410
|
-
|
|
2411
|
-
// Responses
|
|
2412
|
-
AcqListResponse: AcqListResponseSchema,
|
|
2413
|
-
AcqListListResponse: AcqListListResponseSchema,
|
|
2414
|
-
ListTelemetryResponse: ListTelemetryResponseSchema,
|
|
2415
|
-
ListTelemetryListResponse: ListTelemetryListResponseSchema,
|
|
2416
|
-
ListExecutionsResponse: ListExecutionsResponseSchema
|
|
2347
|
+
export const AcqListSchemas = {
|
|
2348
|
+
// Params
|
|
2349
|
+
ListIdParams: ListIdParamsSchema,
|
|
2350
|
+
|
|
2351
|
+
// Primitives (for UI / tests)
|
|
2352
|
+
ListStatus: ListStatusSchema,
|
|
2353
|
+
ScrapingConfig: ScrapingConfigSchema,
|
|
2354
|
+
IcpRubric: IcpRubricSchema,
|
|
2355
|
+
PipelineConfig: PipelineConfigSchema,
|
|
2356
|
+
PipelineStage: PipelineStageSchema,
|
|
2357
|
+
ListStageCounts: ListStageCountsSchema,
|
|
2358
|
+
ListTelemetry: ListTelemetrySchema,
|
|
2359
|
+
|
|
2360
|
+
// Requests
|
|
2361
|
+
CreateListRequest: CreateListRequestSchema,
|
|
2362
|
+
UpdateListRequest: UpdateListRequestSchema,
|
|
2363
|
+
UpdateListStatusRequest: UpdateListStatusRequestSchema,
|
|
2364
|
+
UpdateListConfigRequest: UpdateListConfigRequestSchema,
|
|
2365
|
+
AddCompaniesToListRequest: AddCompaniesToListRequestSchema,
|
|
2366
|
+
RemoveCompaniesFromListRequest: RemoveCompaniesFromListRequestSchema,
|
|
2367
|
+
AddContactsToListRequest: AddContactsToListRequestSchema,
|
|
2368
|
+
RecordListExecutionRequest: RecordListExecutionRequestSchema,
|
|
2369
|
+
|
|
2370
|
+
// Responses
|
|
2371
|
+
AcqListResponse: AcqListResponseSchema,
|
|
2372
|
+
AcqListListResponse: AcqListListResponseSchema,
|
|
2373
|
+
ListTelemetryResponse: ListTelemetryResponseSchema,
|
|
2374
|
+
ListTelemetryListResponse: ListTelemetryListResponseSchema,
|
|
2375
|
+
ListExecutionsResponse: ListExecutionsResponseSchema,
|
|
2376
|
+
ListProgressResponse: ListProgressResponseSchema
|
|
2417
2377
|
}
|
|
2418
2378
|
```
|
|
2419
2379
|
|
|
2420
2380
|
### `AcqSubstrateSchemas`
|
|
2421
2381
|
|
|
2422
2382
|
```typescript
|
|
2423
|
-
export const AcqSubstrateSchemas = {
|
|
2424
|
-
// Artifacts
|
|
2425
|
-
ListArtifactsQuery: ListArtifactsQuerySchema,
|
|
2426
|
-
CreateArtifactRequest: CreateArtifactRequestSchema,
|
|
2427
|
-
AcqArtifactResponse: AcqArtifactResponseSchema,
|
|
2428
|
-
AcqArtifactListResponse: AcqArtifactListResponseSchema,
|
|
2429
|
-
|
|
2430
|
-
//
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
ListCompanyIdParams: ListCompanyIdParamsSchema,
|
|
2443
|
-
AcqListCompanyResponse: AcqListCompanyResponseSchema,
|
|
2444
|
-
|
|
2445
|
-
// Transition (shared with deals — TransitionItemRequestSchema)
|
|
2446
|
-
TransitionItemRequest: TransitionItemRequestSchema
|
|
2383
|
+
export const AcqSubstrateSchemas = {
|
|
2384
|
+
// Artifacts
|
|
2385
|
+
ListArtifactsQuery: ListArtifactsQuerySchema,
|
|
2386
|
+
CreateArtifactRequest: CreateArtifactRequestSchema,
|
|
2387
|
+
AcqArtifactResponse: AcqArtifactResponseSchema,
|
|
2388
|
+
AcqArtifactListResponse: AcqArtifactListResponseSchema,
|
|
2389
|
+
|
|
2390
|
+
// List members
|
|
2391
|
+
ListMembersQuery: ListMembersQuerySchema,
|
|
2392
|
+
MemberIdParams: MemberIdParamsSchema,
|
|
2393
|
+
AcqListMemberResponse: AcqListMemberResponseSchema,
|
|
2394
|
+
AcqListMembersResponse: AcqListMembersResponseSchema,
|
|
2395
|
+
|
|
2396
|
+
// List companies
|
|
2397
|
+
ListCompanyIdParams: ListCompanyIdParamsSchema,
|
|
2398
|
+
AcqListCompanyResponse: AcqListCompanyResponseSchema,
|
|
2399
|
+
|
|
2400
|
+
// Transition (shared with deals — TransitionItemRequestSchema)
|
|
2401
|
+
TransitionItemRequest: TransitionItemRequestSchema
|
|
2447
2402
|
}
|
|
2448
2403
|
```
|
|
2449
2404
|
|
|
@@ -2494,231 +2449,231 @@ export const StatefulSchema = z.object({
|
|
|
2494
2449
|
### `StatefulStateDefinition`
|
|
2495
2450
|
|
|
2496
2451
|
```typescript
|
|
2497
|
-
/** One state within a stage — minimal shape: key + display label. */
|
|
2498
|
-
export interface StatefulStateDefinition {
|
|
2499
|
-
/** Matches state_key values written by workflow steps. */
|
|
2500
|
-
stateKey: string
|
|
2501
|
-
label: string
|
|
2452
|
+
/** One state within a stage — minimal shape: key + display label. */
|
|
2453
|
+
export interface StatefulStateDefinition {
|
|
2454
|
+
/** Matches state_key values written by workflow steps. */
|
|
2455
|
+
stateKey: string
|
|
2456
|
+
label: string
|
|
2502
2457
|
}
|
|
2503
2458
|
```
|
|
2504
2459
|
|
|
2505
2460
|
### `StatefulStageDefinition`
|
|
2506
2461
|
|
|
2507
2462
|
```typescript
|
|
2508
|
-
/** One stage within a pipeline — has a stage_key and an ordered list of valid states. */
|
|
2509
|
-
export interface StatefulStageDefinition {
|
|
2510
|
-
/** Matches stage_key values written by workflow steps. */
|
|
2511
|
-
stageKey: string
|
|
2512
|
-
label: string
|
|
2513
|
-
states: StatefulStateDefinition[]
|
|
2463
|
+
/** One stage within a pipeline — has a stage_key and an ordered list of valid states. */
|
|
2464
|
+
export interface StatefulStageDefinition {
|
|
2465
|
+
/** Matches stage_key values written by workflow steps. */
|
|
2466
|
+
stageKey: string
|
|
2467
|
+
label: string
|
|
2468
|
+
states: StatefulStateDefinition[]
|
|
2514
2469
|
}
|
|
2515
2470
|
```
|
|
2516
2471
|
|
|
2517
2472
|
### `StatefulPipelineDefinition`
|
|
2518
2473
|
|
|
2519
2474
|
```typescript
|
|
2520
|
-
/**
|
|
2521
|
-
* Pipeline definition for a single entity participating in the Stateful trait.
|
|
2522
|
-
* Parallel to acq_deals' pipeline_key concept but structured for lead-gen entities.
|
|
2523
|
-
*/
|
|
2524
|
-
export interface StatefulPipelineDefinition {
|
|
2525
|
-
/** Matches pipeline_key values in the database (e.g. 'lead-gen'). */
|
|
2526
|
-
pipelineKey: string
|
|
2527
|
-
label: string
|
|
2528
|
-
/** Entity this pipeline applies to (e.g. 'acq.list', 'acq.list-member', 'acq.list-company'). */
|
|
2529
|
-
entityKey: string
|
|
2530
|
-
stages: StatefulStageDefinition[]
|
|
2475
|
+
/**
|
|
2476
|
+
* Pipeline definition for a single entity participating in the Stateful trait.
|
|
2477
|
+
* Parallel to acq_deals' pipeline_key concept but structured for lead-gen entities.
|
|
2478
|
+
*/
|
|
2479
|
+
export interface StatefulPipelineDefinition {
|
|
2480
|
+
/** Matches pipeline_key values in the database (e.g. 'lead-gen'). */
|
|
2481
|
+
pipelineKey: string
|
|
2482
|
+
label: string
|
|
2483
|
+
/** Entity this pipeline applies to (e.g. 'acq.list', 'acq.list-member', 'acq.list-company'). */
|
|
2484
|
+
entityKey: string
|
|
2485
|
+
stages: StatefulStageDefinition[]
|
|
2531
2486
|
}
|
|
2532
2487
|
```
|
|
2533
2488
|
|
|
2534
2489
|
### `ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE`
|
|
2535
2490
|
|
|
2536
2491
|
```typescript
|
|
2537
|
-
/**
|
|
2538
|
-
* Lead-gen pipeline definition for acq_list_members (contacts).
|
|
2539
|
-
* Three stages matching the post-restructure sales subdomain tree.
|
|
2540
|
-
*
|
|
2541
|
-
* Note: members visit outreach and prospecting states depending on which
|
|
2542
|
-
* workflow last processed them. stage_key is set per-transition by the workflow.
|
|
2543
|
-
*/
|
|
2544
|
-
export const ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE: StatefulPipelineDefinition = {
|
|
2545
|
-
pipelineKey: 'lead-gen',
|
|
2546
|
-
label: 'Lead Generation',
|
|
2547
|
-
entityKey: 'acq.list-member',
|
|
2548
|
-
stages: [
|
|
2549
|
-
{
|
|
2550
|
-
stageKey: 'outreach',
|
|
2551
|
-
label: 'Outreach',
|
|
2552
|
-
states: [
|
|
2553
|
-
PENDING_STATE,
|
|
2554
|
-
{ stateKey: 'personalized', label: 'Personalized' },
|
|
2555
|
-
{ stateKey: 'uploaded', label: 'Uploaded' },
|
|
2556
|
-
{ stateKey: 'interested', label: 'Interested' }
|
|
2557
|
-
]
|
|
2558
|
-
},
|
|
2559
|
-
{
|
|
2560
|
-
stageKey: 'prospecting',
|
|
2561
|
-
label: 'Prospecting',
|
|
2562
|
-
states: [
|
|
2563
|
-
PENDING_STATE,
|
|
2564
|
-
{ stateKey: 'discovered', label: 'Discovered' },
|
|
2565
|
-
{ stateKey: 'verified', label: 'Verified' }
|
|
2566
|
-
]
|
|
2567
|
-
},
|
|
2568
|
-
{
|
|
2569
|
-
stageKey: 'qualification',
|
|
2570
|
-
label: 'Qualification',
|
|
2571
|
-
states: [PENDING_STATE]
|
|
2572
|
-
}
|
|
2573
|
-
]
|
|
2492
|
+
/**
|
|
2493
|
+
* Lead-gen pipeline definition for acq_list_members (contacts).
|
|
2494
|
+
* Three stages matching the post-restructure sales subdomain tree.
|
|
2495
|
+
*
|
|
2496
|
+
* Note: members visit outreach and prospecting states depending on which
|
|
2497
|
+
* workflow last processed them. stage_key is set per-transition by the workflow.
|
|
2498
|
+
*/
|
|
2499
|
+
export const ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE: StatefulPipelineDefinition = {
|
|
2500
|
+
pipelineKey: 'lead-gen',
|
|
2501
|
+
label: 'Lead Generation',
|
|
2502
|
+
entityKey: 'acq.list-member',
|
|
2503
|
+
stages: [
|
|
2504
|
+
{
|
|
2505
|
+
stageKey: 'outreach',
|
|
2506
|
+
label: 'Outreach',
|
|
2507
|
+
states: [
|
|
2508
|
+
PENDING_STATE,
|
|
2509
|
+
{ stateKey: 'personalized', label: 'Personalized' },
|
|
2510
|
+
{ stateKey: 'uploaded', label: 'Uploaded' },
|
|
2511
|
+
{ stateKey: 'interested', label: 'Interested' }
|
|
2512
|
+
]
|
|
2513
|
+
},
|
|
2514
|
+
{
|
|
2515
|
+
stageKey: 'prospecting',
|
|
2516
|
+
label: 'Prospecting',
|
|
2517
|
+
states: [
|
|
2518
|
+
PENDING_STATE,
|
|
2519
|
+
{ stateKey: 'discovered', label: 'Discovered' },
|
|
2520
|
+
{ stateKey: 'verified', label: 'Verified' }
|
|
2521
|
+
]
|
|
2522
|
+
},
|
|
2523
|
+
{
|
|
2524
|
+
stageKey: 'qualification',
|
|
2525
|
+
label: 'Qualification',
|
|
2526
|
+
states: [PENDING_STATE]
|
|
2527
|
+
}
|
|
2528
|
+
]
|
|
2574
2529
|
}
|
|
2575
2530
|
```
|
|
2576
2531
|
|
|
2577
2532
|
### `ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE`
|
|
2578
2533
|
|
|
2579
2534
|
```typescript
|
|
2580
|
-
/**
|
|
2581
|
-
* Lead-gen pipeline definition for acq_list_companies.
|
|
2582
|
-
* Three stages matching the post-restructure sales subdomain tree.
|
|
2583
|
-
*
|
|
2584
|
-
* Note: companies visit prospecting and qualification states depending on which
|
|
2585
|
-
* workflow last processed them. stage_key is set per-transition by the workflow.
|
|
2586
|
-
*/
|
|
2587
|
-
export const ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE: StatefulPipelineDefinition = {
|
|
2588
|
-
pipelineKey: 'lead-gen',
|
|
2589
|
-
label: 'Lead Generation',
|
|
2590
|
-
entityKey: 'acq.list-company',
|
|
2591
|
-
stages: [
|
|
2592
|
-
{
|
|
2593
|
-
stageKey: 'outreach',
|
|
2594
|
-
label: 'Outreach',
|
|
2595
|
-
states: [PENDING_STATE]
|
|
2596
|
-
},
|
|
2597
|
-
{
|
|
2598
|
-
stageKey: 'prospecting',
|
|
2599
|
-
label: 'Prospecting',
|
|
2600
|
-
states: [
|
|
2601
|
-
PENDING_STATE,
|
|
2602
|
-
{ stateKey: 'populated', label: 'Populated' },
|
|
2603
|
-
{ stateKey: 'extracted', label: 'Extracted' }
|
|
2604
|
-
]
|
|
2605
|
-
},
|
|
2606
|
-
{
|
|
2607
|
-
stageKey: 'qualification',
|
|
2608
|
-
label: 'Qualification',
|
|
2609
|
-
states: [PENDING_STATE, { stateKey: 'qualified', label: 'Qualified' }]
|
|
2610
|
-
}
|
|
2611
|
-
]
|
|
2535
|
+
/**
|
|
2536
|
+
* Lead-gen pipeline definition for acq_list_companies.
|
|
2537
|
+
* Three stages matching the post-restructure sales subdomain tree.
|
|
2538
|
+
*
|
|
2539
|
+
* Note: companies visit prospecting and qualification states depending on which
|
|
2540
|
+
* workflow last processed them. stage_key is set per-transition by the workflow.
|
|
2541
|
+
*/
|
|
2542
|
+
export const ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE: StatefulPipelineDefinition = {
|
|
2543
|
+
pipelineKey: 'lead-gen',
|
|
2544
|
+
label: 'Lead Generation',
|
|
2545
|
+
entityKey: 'acq.list-company',
|
|
2546
|
+
stages: [
|
|
2547
|
+
{
|
|
2548
|
+
stageKey: 'outreach',
|
|
2549
|
+
label: 'Outreach',
|
|
2550
|
+
states: [PENDING_STATE]
|
|
2551
|
+
},
|
|
2552
|
+
{
|
|
2553
|
+
stageKey: 'prospecting',
|
|
2554
|
+
label: 'Prospecting',
|
|
2555
|
+
states: [
|
|
2556
|
+
PENDING_STATE,
|
|
2557
|
+
{ stateKey: 'populated', label: 'Populated' },
|
|
2558
|
+
{ stateKey: 'extracted', label: 'Extracted' }
|
|
2559
|
+
]
|
|
2560
|
+
},
|
|
2561
|
+
{
|
|
2562
|
+
stageKey: 'qualification',
|
|
2563
|
+
label: 'Qualification',
|
|
2564
|
+
states: [PENDING_STATE, { stateKey: 'qualified', label: 'Qualified' }]
|
|
2565
|
+
}
|
|
2566
|
+
]
|
|
2612
2567
|
}
|
|
2613
2568
|
```
|
|
2614
2569
|
|
|
2615
2570
|
### `LEAD_GEN_PIPELINE_DEFINITIONS`
|
|
2616
2571
|
|
|
2617
2572
|
```typescript
|
|
2618
|
-
/**
|
|
2619
|
-
* All lead-gen pipeline definitions indexed by entity key.
|
|
2620
|
-
* Use findPipeline() to locate a definition by pipeline_key within any of these arrays.
|
|
2621
|
-
*/
|
|
2622
|
-
export const LEAD_GEN_PIPELINE_DEFINITIONS: Record<string, StatefulPipelineDefinition[]> = {
|
|
2623
|
-
'acq.list-member': [ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE],
|
|
2624
|
-
'acq.list-company': [ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE]
|
|
2573
|
+
/**
|
|
2574
|
+
* All lead-gen pipeline definitions indexed by entity key.
|
|
2575
|
+
* Use findPipeline() to locate a definition by pipeline_key within any of these arrays.
|
|
2576
|
+
*/
|
|
2577
|
+
export const LEAD_GEN_PIPELINE_DEFINITIONS: Record<string, StatefulPipelineDefinition[]> = {
|
|
2578
|
+
'acq.list-member': [ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE],
|
|
2579
|
+
'acq.list-company': [ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE]
|
|
2625
2580
|
}
|
|
2626
2581
|
```
|
|
2627
2582
|
|
|
2628
2583
|
### `PaginationParams`
|
|
2629
2584
|
|
|
2630
2585
|
```typescript
|
|
2631
|
-
export interface PaginationParams {
|
|
2632
|
-
limit: number
|
|
2633
|
-
offset: number
|
|
2586
|
+
export interface PaginationParams {
|
|
2587
|
+
limit: number
|
|
2588
|
+
offset: number
|
|
2634
2589
|
}
|
|
2635
2590
|
```
|
|
2636
2591
|
|
|
2637
2592
|
### `PaginatedResult`
|
|
2638
2593
|
|
|
2639
2594
|
```typescript
|
|
2640
|
-
export interface PaginatedResult<T> {
|
|
2641
|
-
data: T[]
|
|
2642
|
-
total: number
|
|
2643
|
-
limit: number
|
|
2644
|
-
offset: number
|
|
2595
|
+
export interface PaginatedResult<T> {
|
|
2596
|
+
data: T[]
|
|
2597
|
+
total: number
|
|
2598
|
+
limit: number
|
|
2599
|
+
offset: number
|
|
2645
2600
|
}
|
|
2646
2601
|
```
|
|
2647
2602
|
|
|
2648
2603
|
### `CreateListParams`
|
|
2649
2604
|
|
|
2650
2605
|
```typescript
|
|
2651
|
-
export interface CreateListParams {
|
|
2652
|
-
organizationId: string
|
|
2653
|
-
name: string
|
|
2654
|
-
description?: string
|
|
2655
|
-
type?: string
|
|
2656
|
-
batchIds?: string[]
|
|
2657
|
-
instantlyCampaignId?: string
|
|
2658
|
-
status?: ListStatus
|
|
2659
|
-
metadata?: Record<string, unknown>
|
|
2660
|
-
scrapingConfig?: ScrapingConfig
|
|
2661
|
-
icp?: IcpRubric
|
|
2662
|
-
pipelineConfig?: PipelineConfig
|
|
2606
|
+
export interface CreateListParams {
|
|
2607
|
+
organizationId: string
|
|
2608
|
+
name: string
|
|
2609
|
+
description?: string
|
|
2610
|
+
type?: string
|
|
2611
|
+
batchIds?: string[]
|
|
2612
|
+
instantlyCampaignId?: string
|
|
2613
|
+
status?: ListStatus
|
|
2614
|
+
metadata?: Record<string, unknown>
|
|
2615
|
+
scrapingConfig?: ScrapingConfig
|
|
2616
|
+
icp?: IcpRubric
|
|
2617
|
+
pipelineConfig?: PipelineConfig
|
|
2663
2618
|
}
|
|
2664
2619
|
```
|
|
2665
2620
|
|
|
2666
2621
|
### `UpdateListParams`
|
|
2667
2622
|
|
|
2668
2623
|
```typescript
|
|
2669
|
-
export interface UpdateListParams {
|
|
2670
|
-
name?: string
|
|
2671
|
-
description?: string
|
|
2672
|
-
batchIds?: string[]
|
|
2624
|
+
export interface UpdateListParams {
|
|
2625
|
+
name?: string
|
|
2626
|
+
description?: string
|
|
2627
|
+
batchIds?: string[]
|
|
2673
2628
|
}
|
|
2674
2629
|
```
|
|
2675
2630
|
|
|
2676
2631
|
### `CreateCompanyParams`
|
|
2677
2632
|
|
|
2678
2633
|
```typescript
|
|
2679
|
-
export interface CreateCompanyParams {
|
|
2680
|
-
organizationId: string
|
|
2681
|
-
name: string
|
|
2682
|
-
domain?: string
|
|
2683
|
-
linkedinUrl?: string
|
|
2684
|
-
website?: string
|
|
2685
|
-
numEmployees?: number
|
|
2686
|
-
foundedYear?: number
|
|
2687
|
-
locationCity?: string
|
|
2688
|
-
locationState?: string
|
|
2689
|
-
category?: string
|
|
2690
|
-
source?: string
|
|
2691
|
-
batchId?: string
|
|
2692
|
-
verticalResearch?: string
|
|
2634
|
+
export interface CreateCompanyParams {
|
|
2635
|
+
organizationId: string
|
|
2636
|
+
name: string
|
|
2637
|
+
domain?: string
|
|
2638
|
+
linkedinUrl?: string
|
|
2639
|
+
website?: string
|
|
2640
|
+
numEmployees?: number
|
|
2641
|
+
foundedYear?: number
|
|
2642
|
+
locationCity?: string
|
|
2643
|
+
locationState?: string
|
|
2644
|
+
category?: string
|
|
2645
|
+
source?: string
|
|
2646
|
+
batchId?: string
|
|
2647
|
+
verticalResearch?: string
|
|
2693
2648
|
}
|
|
2694
2649
|
```
|
|
2695
2650
|
|
|
2696
2651
|
### `UpdateCompanyParams`
|
|
2697
2652
|
|
|
2698
2653
|
```typescript
|
|
2699
|
-
export interface UpdateCompanyParams {
|
|
2700
|
-
name?: string
|
|
2701
|
-
domain?: string
|
|
2702
|
-
linkedinUrl?: string
|
|
2703
|
-
website?: string
|
|
2704
|
-
numEmployees?: number
|
|
2705
|
-
foundedYear?: number
|
|
2706
|
-
locationCity?: string
|
|
2707
|
-
locationState?: string
|
|
2708
|
-
category?: string
|
|
2709
|
-
segment?: string
|
|
2710
|
-
pipelineStatus?: Record<string, unknown>
|
|
2711
|
-
enrichmentData?: Record<string, unknown>
|
|
2712
|
-
source?: string
|
|
2713
|
-
batchId?: string
|
|
2714
|
-
status?: 'active' | 'invalid'
|
|
2715
|
-
verticalResearch?: string | null
|
|
2716
|
-
/** Track A: flat qualification score column (null until a scoring rubric is defined) */
|
|
2717
|
-
qualificationScore?: number | null
|
|
2718
|
-
/** Track A: flat qualification signals jsonb — mirrors the former pipeline_status.qualification shape */
|
|
2719
|
-
qualificationSignals?: Record<string, unknown> | null
|
|
2720
|
-
/** Track A: key identifying the rubric used for qualification */
|
|
2721
|
-
qualificationRubricKey?: string | null
|
|
2654
|
+
export interface UpdateCompanyParams {
|
|
2655
|
+
name?: string
|
|
2656
|
+
domain?: string
|
|
2657
|
+
linkedinUrl?: string
|
|
2658
|
+
website?: string
|
|
2659
|
+
numEmployees?: number
|
|
2660
|
+
foundedYear?: number
|
|
2661
|
+
locationCity?: string
|
|
2662
|
+
locationState?: string
|
|
2663
|
+
category?: string
|
|
2664
|
+
segment?: string
|
|
2665
|
+
pipelineStatus?: Record<string, unknown>
|
|
2666
|
+
enrichmentData?: Record<string, unknown>
|
|
2667
|
+
source?: string
|
|
2668
|
+
batchId?: string
|
|
2669
|
+
status?: 'active' | 'invalid'
|
|
2670
|
+
verticalResearch?: string | null
|
|
2671
|
+
/** Track A: flat qualification score column (null until a scoring rubric is defined) */
|
|
2672
|
+
qualificationScore?: number | null
|
|
2673
|
+
/** Track A: flat qualification signals jsonb — mirrors the former pipeline_status.qualification shape */
|
|
2674
|
+
qualificationSignals?: Record<string, unknown> | null
|
|
2675
|
+
/** Track A: key identifying the rubric used for qualification */
|
|
2676
|
+
qualificationRubricKey?: string | null
|
|
2722
2677
|
}
|
|
2723
2678
|
```
|
|
2724
2679
|
|
|
@@ -2731,56 +2686,56 @@ export type UpsertCompanyParams = CreateCompanyParams
|
|
|
2731
2686
|
### `CompanyFilters`
|
|
2732
2687
|
|
|
2733
2688
|
```typescript
|
|
2734
|
-
export interface CompanyFilters {
|
|
2735
|
-
listId?: string // Filter to companies in a specific list (via acq_list_companies)
|
|
2736
|
-
search?: string
|
|
2737
|
-
domain?: string
|
|
2738
|
-
website?: string
|
|
2739
|
-
segment?: string
|
|
2740
|
-
category?: string
|
|
2741
|
-
pipelineStatus?: Record<string, unknown>
|
|
2742
|
-
/** Exclude companies whose pipeline_status contains this value (PostgREST NOT contains) */
|
|
2743
|
-
pipelineStatusNot?: Record<string, unknown>
|
|
2744
|
-
batchId?: string
|
|
2745
|
-
status?: 'active' | 'invalid'
|
|
2746
|
-
includeAll?: boolean
|
|
2747
|
-
excludeColumns?: Array<'enrichmentData' | 'pipelineStatus'>
|
|
2689
|
+
export interface CompanyFilters {
|
|
2690
|
+
listId?: string // Filter to companies in a specific list (via acq_list_companies)
|
|
2691
|
+
search?: string
|
|
2692
|
+
domain?: string
|
|
2693
|
+
website?: string
|
|
2694
|
+
segment?: string
|
|
2695
|
+
category?: string
|
|
2696
|
+
pipelineStatus?: Record<string, unknown>
|
|
2697
|
+
/** Exclude companies whose pipeline_status contains this value (PostgREST NOT contains) */
|
|
2698
|
+
pipelineStatusNot?: Record<string, unknown>
|
|
2699
|
+
batchId?: string
|
|
2700
|
+
status?: 'active' | 'invalid'
|
|
2701
|
+
includeAll?: boolean
|
|
2702
|
+
excludeColumns?: Array<'enrichmentData' | 'pipelineStatus'>
|
|
2748
2703
|
}
|
|
2749
2704
|
```
|
|
2750
2705
|
|
|
2751
2706
|
### `CreateContactParams`
|
|
2752
2707
|
|
|
2753
2708
|
```typescript
|
|
2754
|
-
export interface CreateContactParams {
|
|
2755
|
-
organizationId: string
|
|
2756
|
-
email: string
|
|
2757
|
-
companyId?: string
|
|
2758
|
-
firstName?: string
|
|
2759
|
-
lastName?: string
|
|
2760
|
-
linkedinUrl?: string
|
|
2761
|
-
title?: string
|
|
2762
|
-
source?: string
|
|
2763
|
-
sourceId?: string
|
|
2764
|
-
batchId?: string
|
|
2709
|
+
export interface CreateContactParams {
|
|
2710
|
+
organizationId: string
|
|
2711
|
+
email: string
|
|
2712
|
+
companyId?: string
|
|
2713
|
+
firstName?: string
|
|
2714
|
+
lastName?: string
|
|
2715
|
+
linkedinUrl?: string
|
|
2716
|
+
title?: string
|
|
2717
|
+
source?: string
|
|
2718
|
+
sourceId?: string
|
|
2719
|
+
batchId?: string
|
|
2765
2720
|
}
|
|
2766
2721
|
```
|
|
2767
2722
|
|
|
2768
2723
|
### `UpdateContactParams`
|
|
2769
2724
|
|
|
2770
2725
|
```typescript
|
|
2771
|
-
export interface UpdateContactParams {
|
|
2772
|
-
companyId?: string
|
|
2773
|
-
emailValid?: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN'
|
|
2774
|
-
firstName?: string
|
|
2775
|
-
lastName?: string
|
|
2776
|
-
linkedinUrl?: string
|
|
2777
|
-
title?: string
|
|
2778
|
-
headline?: string
|
|
2779
|
-
filterReason?: string
|
|
2780
|
-
openingLine?: string
|
|
2781
|
-
pipelineStatus?: Record<string, unknown>
|
|
2782
|
-
enrichmentData?: Record<string, unknown>
|
|
2783
|
-
status?: 'active' | 'invalid'
|
|
2726
|
+
export interface UpdateContactParams {
|
|
2727
|
+
companyId?: string
|
|
2728
|
+
emailValid?: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN'
|
|
2729
|
+
firstName?: string
|
|
2730
|
+
lastName?: string
|
|
2731
|
+
linkedinUrl?: string
|
|
2732
|
+
title?: string
|
|
2733
|
+
headline?: string
|
|
2734
|
+
filterReason?: string
|
|
2735
|
+
openingLine?: string
|
|
2736
|
+
pipelineStatus?: Record<string, unknown>
|
|
2737
|
+
enrichmentData?: Record<string, unknown>
|
|
2738
|
+
status?: 'active' | 'invalid'
|
|
2784
2739
|
}
|
|
2785
2740
|
```
|
|
2786
2741
|
|
|
@@ -2793,423 +2748,385 @@ export type UpsertContactParams = CreateContactParams
|
|
|
2793
2748
|
### `ContactFilters`
|
|
2794
2749
|
|
|
2795
2750
|
```typescript
|
|
2796
|
-
export interface ContactFilters {
|
|
2797
|
-
listId?: string // Filter to contacts in a specific list (via acq_list_members)
|
|
2798
|
-
search?: string
|
|
2799
|
-
openingLineIsNull?: boolean // Filter to contacts without personalization
|
|
2800
|
-
pipelineStatus?: Record<string, unknown>
|
|
2801
|
-
batchId?: string
|
|
2802
|
-
contactStatus?: 'active' | 'invalid' // Filter by contact status (soft-delete flag)
|
|
2751
|
+
export interface ContactFilters {
|
|
2752
|
+
listId?: string // Filter to contacts in a specific list (via acq_list_members)
|
|
2753
|
+
search?: string
|
|
2754
|
+
openingLineIsNull?: boolean // Filter to contacts without personalization
|
|
2755
|
+
pipelineStatus?: Record<string, unknown>
|
|
2756
|
+
batchId?: string
|
|
2757
|
+
contactStatus?: 'active' | 'invalid' // Filter by contact status (soft-delete flag)
|
|
2803
2758
|
}
|
|
2804
2759
|
```
|
|
2805
2760
|
|
|
2806
2761
|
### `UpsertSocialPostParams`
|
|
2807
2762
|
|
|
2808
2763
|
```typescript
|
|
2809
|
-
export interface UpsertSocialPostParams {
|
|
2810
|
-
organizationId: string
|
|
2811
|
-
platform: string
|
|
2812
|
-
platformPostId: string
|
|
2813
|
-
authorName: string
|
|
2814
|
-
authorUrl?: string | null
|
|
2815
|
-
postTitle: string
|
|
2816
|
-
postText: string
|
|
2817
|
-
postUrl: string
|
|
2818
|
-
engagementCount?: number
|
|
2819
|
-
commentsCount?: number
|
|
2820
|
-
postedAt: string
|
|
2821
|
-
metadata?: Record<string, unknown>
|
|
2822
|
-
relevanceScore?: number
|
|
2823
|
-
matchedKeywords?: string[]
|
|
2824
|
-
matchedQuery?: string | null
|
|
2825
|
-
initialDraft?: string | null
|
|
2826
|
-
finalResponse?: string | null
|
|
2827
|
-
sourceCategory?: string | null
|
|
2764
|
+
export interface UpsertSocialPostParams {
|
|
2765
|
+
organizationId: string
|
|
2766
|
+
platform: string
|
|
2767
|
+
platformPostId: string
|
|
2768
|
+
authorName: string
|
|
2769
|
+
authorUrl?: string | null
|
|
2770
|
+
postTitle: string
|
|
2771
|
+
postText: string
|
|
2772
|
+
postUrl: string
|
|
2773
|
+
engagementCount?: number
|
|
2774
|
+
commentsCount?: number
|
|
2775
|
+
postedAt: string
|
|
2776
|
+
metadata?: Record<string, unknown>
|
|
2777
|
+
relevanceScore?: number
|
|
2778
|
+
matchedKeywords?: string[]
|
|
2779
|
+
matchedQuery?: string | null
|
|
2780
|
+
initialDraft?: string | null
|
|
2781
|
+
finalResponse?: string | null
|
|
2782
|
+
sourceCategory?: string | null
|
|
2828
2783
|
}
|
|
2829
2784
|
```
|
|
2830
2785
|
|
|
2831
2786
|
### `UpsertSocialPostsParams`
|
|
2832
2787
|
|
|
2833
2788
|
```typescript
|
|
2834
|
-
export interface UpsertSocialPostsParams {
|
|
2835
|
-
organizationId: string
|
|
2836
|
-
posts: Omit<UpsertSocialPostParams, 'organizationId'>[]
|
|
2789
|
+
export interface UpsertSocialPostsParams {
|
|
2790
|
+
organizationId: string
|
|
2791
|
+
posts: Omit<UpsertSocialPostParams, 'organizationId'>[]
|
|
2837
2792
|
}
|
|
2838
2793
|
```
|
|
2839
2794
|
|
|
2840
2795
|
### `UpsertSocialPostsResult`
|
|
2841
2796
|
|
|
2842
2797
|
```typescript
|
|
2843
|
-
export interface UpsertSocialPostsResult {
|
|
2844
|
-
inserted: number
|
|
2845
|
-
duplicatesSkipped: number
|
|
2798
|
+
export interface UpsertSocialPostsResult {
|
|
2799
|
+
inserted: number
|
|
2800
|
+
duplicatesSkipped: number
|
|
2846
2801
|
}
|
|
2847
2802
|
```
|
|
2848
2803
|
|
|
2849
2804
|
### `AddContactsToListParams`
|
|
2850
2805
|
|
|
2851
2806
|
```typescript
|
|
2852
|
-
export interface AddContactsToListParams {
|
|
2853
|
-
organizationId: string
|
|
2854
|
-
listId: string
|
|
2855
|
-
contactIds: string[]
|
|
2807
|
+
export interface AddContactsToListParams {
|
|
2808
|
+
organizationId: string
|
|
2809
|
+
listId: string
|
|
2810
|
+
contactIds: string[]
|
|
2856
2811
|
}
|
|
2857
2812
|
```
|
|
2858
2813
|
|
|
2859
2814
|
### `AddContactsToListResult`
|
|
2860
2815
|
|
|
2861
2816
|
```typescript
|
|
2862
|
-
export interface AddContactsToListResult {
|
|
2863
|
-
added: number
|
|
2864
|
-
alreadyExisted: number
|
|
2817
|
+
export interface AddContactsToListResult {
|
|
2818
|
+
added: number
|
|
2819
|
+
alreadyExisted: number
|
|
2865
2820
|
}
|
|
2866
2821
|
```
|
|
2867
2822
|
|
|
2868
2823
|
### `UpdateListConfigParams`
|
|
2869
2824
|
|
|
2870
2825
|
```typescript
|
|
2871
|
-
export interface UpdateListConfigParams {
|
|
2872
|
-
organizationId: string
|
|
2873
|
-
listId: string
|
|
2874
|
-
scrapingConfig?: ScrapingConfig
|
|
2875
|
-
icp?: IcpRubric
|
|
2876
|
-
pipelineConfig?: PipelineConfig
|
|
2826
|
+
export interface UpdateListConfigParams {
|
|
2827
|
+
organizationId: string
|
|
2828
|
+
listId: string
|
|
2829
|
+
scrapingConfig?: ScrapingConfig
|
|
2830
|
+
icp?: IcpRubric
|
|
2831
|
+
pipelineConfig?: PipelineConfig
|
|
2877
2832
|
}
|
|
2878
2833
|
```
|
|
2879
2834
|
|
|
2880
2835
|
### `UpdateCompanyStageParams`
|
|
2881
2836
|
|
|
2882
2837
|
```typescript
|
|
2883
|
-
export interface UpdateCompanyStageParams {
|
|
2884
|
-
organizationId: string
|
|
2885
|
-
listId: string
|
|
2886
|
-
companyId: string
|
|
2887
|
-
stage: string
|
|
2888
|
-
executionId?: string
|
|
2838
|
+
export interface UpdateCompanyStageParams {
|
|
2839
|
+
organizationId: string
|
|
2840
|
+
listId: string
|
|
2841
|
+
companyId: string
|
|
2842
|
+
stage: string
|
|
2843
|
+
executionId?: string
|
|
2889
2844
|
}
|
|
2890
2845
|
```
|
|
2891
2846
|
|
|
2892
2847
|
### `UpdateContactStageParams`
|
|
2893
2848
|
|
|
2894
2849
|
```typescript
|
|
2895
|
-
export interface UpdateContactStageParams {
|
|
2896
|
-
organizationId: string
|
|
2897
|
-
listId: string
|
|
2898
|
-
contactId: string
|
|
2899
|
-
stage: string
|
|
2900
|
-
executionId?: string
|
|
2850
|
+
export interface UpdateContactStageParams {
|
|
2851
|
+
organizationId: string
|
|
2852
|
+
listId: string
|
|
2853
|
+
contactId: string
|
|
2854
|
+
stage: string
|
|
2855
|
+
executionId?: string
|
|
2901
2856
|
}
|
|
2902
2857
|
```
|
|
2903
2858
|
|
|
2904
2859
|
### `AddCompaniesToListParams`
|
|
2905
2860
|
|
|
2906
2861
|
```typescript
|
|
2907
|
-
export interface AddCompaniesToListParams {
|
|
2908
|
-
organizationId: string
|
|
2909
|
-
listId: string
|
|
2910
|
-
companyIds: string[]
|
|
2862
|
+
export interface AddCompaniesToListParams {
|
|
2863
|
+
organizationId: string
|
|
2864
|
+
listId: string
|
|
2865
|
+
companyIds: string[]
|
|
2911
2866
|
}
|
|
2912
2867
|
```
|
|
2913
2868
|
|
|
2914
2869
|
### `AddCompaniesToListResult`
|
|
2915
2870
|
|
|
2916
2871
|
```typescript
|
|
2917
|
-
export interface AddCompaniesToListResult {
|
|
2918
|
-
added: number
|
|
2919
|
-
alreadyExisted: number
|
|
2872
|
+
export interface AddCompaniesToListResult {
|
|
2873
|
+
added: number
|
|
2874
|
+
alreadyExisted: number
|
|
2920
2875
|
}
|
|
2921
2876
|
```
|
|
2922
2877
|
|
|
2923
2878
|
### `RemoveCompaniesFromListParams`
|
|
2924
2879
|
|
|
2925
2880
|
```typescript
|
|
2926
|
-
export interface RemoveCompaniesFromListParams {
|
|
2927
|
-
organizationId: string
|
|
2928
|
-
listId: string
|
|
2929
|
-
companyIds: string[]
|
|
2881
|
+
export interface RemoveCompaniesFromListParams {
|
|
2882
|
+
organizationId: string
|
|
2883
|
+
listId: string
|
|
2884
|
+
companyIds: string[]
|
|
2930
2885
|
}
|
|
2931
2886
|
```
|
|
2932
2887
|
|
|
2933
2888
|
### `RemoveCompaniesFromListResult`
|
|
2934
2889
|
|
|
2935
2890
|
```typescript
|
|
2936
|
-
export interface RemoveCompaniesFromListResult {
|
|
2937
|
-
removed: number
|
|
2891
|
+
export interface RemoveCompaniesFromListResult {
|
|
2892
|
+
removed: number
|
|
2938
2893
|
}
|
|
2939
2894
|
```
|
|
2940
2895
|
|
|
2941
2896
|
### `RecordListExecutionParams`
|
|
2942
2897
|
|
|
2943
2898
|
```typescript
|
|
2944
|
-
export interface RecordListExecutionParams {
|
|
2945
|
-
organizationId: string
|
|
2946
|
-
listId: string
|
|
2947
|
-
executionId: string
|
|
2948
|
-
configSnapshot?: Record<string, unknown>
|
|
2899
|
+
export interface RecordListExecutionParams {
|
|
2900
|
+
organizationId: string
|
|
2901
|
+
listId: string
|
|
2902
|
+
executionId: string
|
|
2903
|
+
configSnapshot?: Record<string, unknown>
|
|
2949
2904
|
}
|
|
2950
2905
|
```
|
|
2951
2906
|
|
|
2952
2907
|
### `ListExecutionSummary`
|
|
2953
2908
|
|
|
2954
2909
|
```typescript
|
|
2955
|
-
export interface ListExecutionSummary {
|
|
2956
|
-
executionId: string
|
|
2957
|
-
resourceId: string
|
|
2958
|
-
status: string
|
|
2959
|
-
createdAt: string
|
|
2960
|
-
completedAt: string | null
|
|
2961
|
-
durationMs: number | null
|
|
2910
|
+
export interface ListExecutionSummary {
|
|
2911
|
+
executionId: string
|
|
2912
|
+
resourceId: string
|
|
2913
|
+
status: string
|
|
2914
|
+
createdAt: string
|
|
2915
|
+
completedAt: string | null
|
|
2916
|
+
durationMs: number | null
|
|
2962
2917
|
}
|
|
2963
2918
|
```
|
|
2964
2919
|
|
|
2965
2920
|
### `BulkImportParams`
|
|
2966
2921
|
|
|
2967
2922
|
```typescript
|
|
2968
|
-
export interface BulkImportParams {
|
|
2969
|
-
organizationId: string
|
|
2970
|
-
contacts: CreateContactParams[]
|
|
2971
|
-
listId?: string
|
|
2923
|
+
export interface BulkImportParams {
|
|
2924
|
+
organizationId: string
|
|
2925
|
+
contacts: CreateContactParams[]
|
|
2926
|
+
listId?: string
|
|
2972
2927
|
}
|
|
2973
2928
|
```
|
|
2974
2929
|
|
|
2975
2930
|
### `BulkImportResult`
|
|
2976
2931
|
|
|
2977
2932
|
```typescript
|
|
2978
|
-
export interface BulkImportResult {
|
|
2979
|
-
created: number
|
|
2980
|
-
updated: number
|
|
2981
|
-
errors: Array<{ email: string; error: string }>
|
|
2933
|
+
export interface BulkImportResult {
|
|
2934
|
+
created: number
|
|
2935
|
+
updated: number
|
|
2936
|
+
errors: Array<{ email: string; error: string }>
|
|
2982
2937
|
}
|
|
2983
2938
|
```
|
|
2984
2939
|
|
|
2985
2940
|
### `BulkImportCompanyEntry`
|
|
2986
2941
|
|
|
2987
2942
|
```typescript
|
|
2988
|
-
export interface BulkImportCompanyEntry {
|
|
2989
|
-
name: string
|
|
2990
|
-
domain: string
|
|
2991
|
-
website?: string
|
|
2992
|
-
locationCity?: string
|
|
2993
|
-
locationState?: string
|
|
2994
|
-
category?: string
|
|
2995
|
-
source?: string
|
|
2996
|
-
enrichmentData?: Record<string, unknown>
|
|
2997
|
-
pipelineStatus?: Record<string, unknown>
|
|
2943
|
+
export interface BulkImportCompanyEntry {
|
|
2944
|
+
name: string
|
|
2945
|
+
domain: string
|
|
2946
|
+
website?: string
|
|
2947
|
+
locationCity?: string
|
|
2948
|
+
locationState?: string
|
|
2949
|
+
category?: string
|
|
2950
|
+
source?: string
|
|
2951
|
+
enrichmentData?: Record<string, unknown>
|
|
2952
|
+
pipelineStatus?: Record<string, unknown>
|
|
2998
2953
|
}
|
|
2999
2954
|
```
|
|
3000
2955
|
|
|
3001
2956
|
### `BulkImportCompaniesParams`
|
|
3002
2957
|
|
|
3003
2958
|
```typescript
|
|
3004
|
-
export interface BulkImportCompaniesParams {
|
|
3005
|
-
organizationId: string
|
|
3006
|
-
batchId: string
|
|
3007
|
-
companies: BulkImportCompanyEntry[]
|
|
2959
|
+
export interface BulkImportCompaniesParams {
|
|
2960
|
+
organizationId: string
|
|
2961
|
+
batchId: string
|
|
2962
|
+
companies: BulkImportCompanyEntry[]
|
|
3008
2963
|
}
|
|
3009
2964
|
```
|
|
3010
2965
|
|
|
3011
2966
|
### `BulkImportCompaniesResult`
|
|
3012
2967
|
|
|
3013
2968
|
```typescript
|
|
3014
|
-
export interface BulkImportCompaniesResult {
|
|
3015
|
-
created: number
|
|
3016
|
-
skipped: number
|
|
3017
|
-
errors: Array<{ companyName: string; error: string }>
|
|
2969
|
+
export interface BulkImportCompaniesResult {
|
|
2970
|
+
created: number
|
|
2971
|
+
skipped: number
|
|
2972
|
+
errors: Array<{ companyName: string; error: string }>
|
|
3018
2973
|
}
|
|
3019
2974
|
```
|
|
3020
2975
|
|
|
3021
2976
|
### `LeadToolMap`
|
|
3022
2977
|
|
|
3023
2978
|
```typescript
|
|
3024
|
-
export type LeadToolMap = {
|
|
3025
|
-
// List operations
|
|
3026
|
-
listLists: { params: Record<string, never>; result: AcqList[] }
|
|
3027
|
-
createList: { params: Omit<CreateListParams, 'organizationId'>; result: AcqList }
|
|
3028
|
-
updateList: { params: { id: string } & UpdateListParams; result: AcqList }
|
|
3029
|
-
deleteList: { params: { id: string }; result: void }
|
|
3030
|
-
addContactsToList: { params: Omit<AddContactsToListParams, 'organizationId'>; result: AddContactsToListResult }
|
|
3031
|
-
updateCompanyStage: {
|
|
3032
|
-
params: Omit<UpdateCompanyStageParams, 'organizationId'>
|
|
3033
|
-
result: void
|
|
3034
|
-
}
|
|
3035
|
-
updateContactStage: {
|
|
3036
|
-
params: Omit<UpdateContactStageParams, 'organizationId'>
|
|
3037
|
-
result: void
|
|
3038
|
-
}
|
|
3039
|
-
// Company operations
|
|
3040
|
-
createCompany: { params: Omit<CreateCompanyParams, 'organizationId'>; result: AcqCompany }
|
|
3041
|
-
upsertCompany: { params: Omit<UpsertCompanyParams, 'organizationId'>; result: AcqCompany }
|
|
3042
|
-
updateCompany: { params: { id: string } & UpdateCompanyParams; result: AcqCompany }
|
|
3043
|
-
getCompany: { params: { id: string }; result: AcqCompany | null }
|
|
3044
|
-
listCompanies: { params: CompanyFilters; result: AcqCompany[] }
|
|
3045
|
-
deleteCompany: { params: { id: string }; result: void }
|
|
3046
|
-
// Contact operations
|
|
3047
|
-
createContact: { params: Omit<CreateContactParams, 'organizationId'>; result: AcqContact }
|
|
3048
|
-
upsertContact: { params: Omit<UpsertContactParams, 'organizationId'>; result: AcqContact }
|
|
3049
|
-
updateContact: { params: { id: string } & UpdateContactParams; result: AcqContact }
|
|
3050
|
-
getContact: { params: { id: string }; result: AcqContact | null }
|
|
3051
|
-
getContactByEmail: { params: { email: string }; result: AcqContact | null }
|
|
3052
|
-
listContacts: {
|
|
3053
|
-
params: ContactFilters & { limit?: number; offset?: number }
|
|
3054
|
-
result: PaginatedResult<AcqContact>
|
|
3055
|
-
}
|
|
3056
|
-
deleteContact: { params: { id: string }; result: void }
|
|
3057
|
-
bulkImportContacts: { params: Omit<BulkImportParams, 'organizationId'>; result: BulkImportResult }
|
|
3058
|
-
bulkImportCompanies: {
|
|
3059
|
-
params: Omit<BulkImportCompaniesParams, 'organizationId'>
|
|
3060
|
-
result: BulkImportCompaniesResult
|
|
3061
|
-
}
|
|
3062
|
-
deactivateContactsByCompany: {
|
|
3063
|
-
params: { companyId: string }
|
|
3064
|
-
result: { deactivated: number }
|
|
3065
|
-
}
|
|
3066
|
-
// Deal operations
|
|
3067
|
-
upsertDeal: { params: Omit<UpsertDealParams, 'organizationId'>; result: AcqDeal }
|
|
3068
|
-
getDealByEmail: { params: { email: string }; result: AcqDeal | null }
|
|
3069
|
-
getDealByEnvelopeId: { params: { envelopeId: string }; result: AcqDeal | null }
|
|
3070
|
-
updateDealEnvelopeId: { params: { dealId: string; envelopeId: string }; result: AcqDeal | null }
|
|
3071
|
-
getDealById: { params: Omit<GetDealByIdParams, 'organizationId'>; result: AcqDeal | null }
|
|
3072
|
-
getContactById: { params: Omit<GetContactByIdParams, 'organizationId'>; result: AcqContact | null }
|
|
3073
|
-
getCompanyById: { params: Omit<GetCompanyByIdParams, 'organizationId'>; result: AcqCompany | null }
|
|
3074
|
-
// Deal-sync operations
|
|
3075
|
-
updateDiscoveryData: { params: Omit<UpdateDiscoveryDataParams, 'organizationId'>; result: void }
|
|
3076
|
-
updateProposalData: { params: Omit<UpdateProposalDataParams, 'organizationId'>; result: void }
|
|
3077
|
-
markProposalSent: { params: Omit<MarkProposalSentParams, 'organizationId'>; result: void }
|
|
3078
|
-
markProposalReviewed: { params: Omit<MarkProposalReviewedParams, 'organizationId'>; result: void }
|
|
3079
|
-
updateCloseLostReason: { params: Omit<UpdateCloseLostReasonParams, 'organizationId'>; result: void }
|
|
3080
|
-
updateFees: { params: Omit<UpdateFeesParams, 'organizationId'>; result: void }
|
|
3081
|
-
transitionItem: { params: Omit<TransitionItemParams, 'organizationId'>; result: void }
|
|
3082
|
-
setContactNurture: { params: Omit<SetContactNurtureParams, 'organizationId'>; result: void }
|
|
3083
|
-
cancelSchedulesAndHitlByEmail: {
|
|
3084
|
-
params: Omit<CancelSchedulesAndHitlByEmailParams, 'organizationId'>
|
|
3085
|
-
result: { schedulesCancelled: number; hitlDeleted: number }
|
|
3086
|
-
}
|
|
3087
|
-
cancelHitlByDealId: { params: Omit<CancelHitlByDealIdParams, 'organizationId'>; result: { hitlDeleted: number } }
|
|
3088
|
-
clearDealFields: { params: Omit<ClearDealFieldsParams, 'organizationId'>; result: void }
|
|
3089
|
-
deleteDeal: { params: Omit<DeleteDealParams, 'organizationId'>; result: void }
|
|
3090
|
-
recordDealActivity: {
|
|
3091
|
-
params: Omit<RecordDealActivityParams, 'organizationId'>
|
|
3092
|
-
result: void
|
|
3093
|
-
}
|
|
3094
|
-
// Deal note operations
|
|
3095
|
-
createDealNote: {
|
|
3096
|
-
params: Omit<CreateDealNoteParams, 'organizationId'>
|
|
3097
|
-
result: AcqDealNote
|
|
3098
|
-
}
|
|
3099
|
-
listDealNotes: {
|
|
3100
|
-
params: Omit<ListDealNotesParams, 'organizationId'>
|
|
3101
|
-
result: AcqDealNote[]
|
|
3102
|
-
}
|
|
3103
|
-
// Deal task operations
|
|
3104
|
-
createDealTask: {
|
|
3105
|
-
params: Omit<CreateDealTaskParams, 'organizationId'>
|
|
3106
|
-
result: AcqDealTask
|
|
3107
|
-
}
|
|
3108
|
-
listDealTasks: {
|
|
3109
|
-
params: Omit<ListDealTasksParams, 'organizationId'>
|
|
3110
|
-
result: AcqDealTask[]
|
|
3111
|
-
}
|
|
3112
|
-
listDealTasksDue: {
|
|
3113
|
-
params: Omit<ListDealTasksDueParams, 'organizationId'>
|
|
3114
|
-
result: AcqDealTask[]
|
|
3115
|
-
}
|
|
3116
|
-
completeDealTask: {
|
|
3117
|
-
params: Omit<CompleteDealTaskParams, 'organizationId'>
|
|
3118
|
-
result: AcqDealTask
|
|
3119
|
-
}
|
|
3120
|
-
// Deal query & analytics operations
|
|
3121
|
-
listDeals: { params: DealFilters; result: AcqDeal[] }
|
|
3122
|
-
getDealPipelineAnalytics: { params: { recentLimit?: number }; result: DealPipelineAnalytics }
|
|
3123
|
-
// Enrichment data operations
|
|
3124
|
-
mergeEnrichmentData: {
|
|
3125
|
-
params: { id: string; table: 'acq_companies' | 'acq_contacts'; data: Record<string, unknown> }
|
|
3126
|
-
result: void
|
|
3127
|
-
}
|
|
3128
|
-
// Social monitoring operations
|
|
3129
|
-
upsertSocialPosts: {
|
|
3130
|
-
params: { posts: Omit<UpsertSocialPostParams, 'organizationId'>[] }
|
|
3131
|
-
result: UpsertSocialPostsResult
|
|
3132
|
-
}
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
}
|
|
3147
|
-
result: {
|
|
3148
|
-
}
|
|
3149
|
-
|
|
3150
|
-
params: {
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
}
|
|
3154
|
-
result: { ok: true }
|
|
3155
|
-
}
|
|
3156
|
-
// CRM workflow helpers
|
|
3157
|
-
transitionDeal: {
|
|
3158
|
-
params: {
|
|
3159
|
-
dealId: string
|
|
3160
|
-
toStage: string
|
|
3161
|
-
toState?: string
|
|
3162
|
-
}
|
|
3163
|
-
result: { deal: AcqDeal }
|
|
3164
|
-
}
|
|
3165
|
-
loadDeal: {
|
|
3166
|
-
params: { dealId: string }
|
|
3167
|
-
result: DealDetail | null
|
|
3168
|
-
}
|
|
3169
|
-
listDealTouchpoints: {
|
|
3170
|
-
params: {
|
|
3171
|
-
dealId: string
|
|
3172
|
-
kind?: string
|
|
3173
|
-
limit?: number
|
|
3174
|
-
}
|
|
3175
|
-
result: Array<{
|
|
3176
|
-
id: string
|
|
3177
|
-
organization_id: string
|
|
3178
|
-
contact_id: string | null
|
|
3179
|
-
list_id: string | null
|
|
3180
|
-
list_member_id: string | null
|
|
3181
|
-
direction: string
|
|
3182
|
-
channel: string
|
|
3183
|
-
kind: string
|
|
3184
|
-
payload: Record<string, unknown> | null
|
|
3185
|
-
artifact_id: string | null
|
|
3186
|
-
source_execution_id: string | null
|
|
3187
|
-
occurred_at: string
|
|
3188
|
-
created_at: string
|
|
3189
|
-
}>
|
|
3190
|
-
}
|
|
2979
|
+
export type LeadToolMap = {
|
|
2980
|
+
// List operations
|
|
2981
|
+
listLists: { params: Record<string, never>; result: AcqList[] }
|
|
2982
|
+
createList: { params: Omit<CreateListParams, 'organizationId'>; result: AcqList }
|
|
2983
|
+
updateList: { params: { id: string } & UpdateListParams; result: AcqList }
|
|
2984
|
+
deleteList: { params: { id: string }; result: void }
|
|
2985
|
+
addContactsToList: { params: Omit<AddContactsToListParams, 'organizationId'>; result: AddContactsToListResult }
|
|
2986
|
+
updateCompanyStage: {
|
|
2987
|
+
params: Omit<UpdateCompanyStageParams, 'organizationId'>
|
|
2988
|
+
result: void
|
|
2989
|
+
}
|
|
2990
|
+
updateContactStage: {
|
|
2991
|
+
params: Omit<UpdateContactStageParams, 'organizationId'>
|
|
2992
|
+
result: void
|
|
2993
|
+
}
|
|
2994
|
+
// Company operations
|
|
2995
|
+
createCompany: { params: Omit<CreateCompanyParams, 'organizationId'>; result: AcqCompany }
|
|
2996
|
+
upsertCompany: { params: Omit<UpsertCompanyParams, 'organizationId'>; result: AcqCompany }
|
|
2997
|
+
updateCompany: { params: { id: string } & UpdateCompanyParams; result: AcqCompany }
|
|
2998
|
+
getCompany: { params: { id: string }; result: AcqCompany | null }
|
|
2999
|
+
listCompanies: { params: CompanyFilters; result: AcqCompany[] }
|
|
3000
|
+
deleteCompany: { params: { id: string }; result: void }
|
|
3001
|
+
// Contact operations
|
|
3002
|
+
createContact: { params: Omit<CreateContactParams, 'organizationId'>; result: AcqContact }
|
|
3003
|
+
upsertContact: { params: Omit<UpsertContactParams, 'organizationId'>; result: AcqContact }
|
|
3004
|
+
updateContact: { params: { id: string } & UpdateContactParams; result: AcqContact }
|
|
3005
|
+
getContact: { params: { id: string }; result: AcqContact | null }
|
|
3006
|
+
getContactByEmail: { params: { email: string }; result: AcqContact | null }
|
|
3007
|
+
listContacts: {
|
|
3008
|
+
params: ContactFilters & { limit?: number; offset?: number }
|
|
3009
|
+
result: PaginatedResult<AcqContact>
|
|
3010
|
+
}
|
|
3011
|
+
deleteContact: { params: { id: string }; result: void }
|
|
3012
|
+
bulkImportContacts: { params: Omit<BulkImportParams, 'organizationId'>; result: BulkImportResult }
|
|
3013
|
+
bulkImportCompanies: {
|
|
3014
|
+
params: Omit<BulkImportCompaniesParams, 'organizationId'>
|
|
3015
|
+
result: BulkImportCompaniesResult
|
|
3016
|
+
}
|
|
3017
|
+
deactivateContactsByCompany: {
|
|
3018
|
+
params: { companyId: string }
|
|
3019
|
+
result: { deactivated: number }
|
|
3020
|
+
}
|
|
3021
|
+
// Deal operations
|
|
3022
|
+
upsertDeal: { params: Omit<UpsertDealParams, 'organizationId'>; result: AcqDeal }
|
|
3023
|
+
getDealByEmail: { params: { email: string }; result: AcqDeal | null }
|
|
3024
|
+
getDealByEnvelopeId: { params: { envelopeId: string }; result: AcqDeal | null }
|
|
3025
|
+
updateDealEnvelopeId: { params: { dealId: string; envelopeId: string }; result: AcqDeal | null }
|
|
3026
|
+
getDealById: { params: Omit<GetDealByIdParams, 'organizationId'>; result: AcqDeal | null }
|
|
3027
|
+
getContactById: { params: Omit<GetContactByIdParams, 'organizationId'>; result: AcqContact | null }
|
|
3028
|
+
getCompanyById: { params: Omit<GetCompanyByIdParams, 'organizationId'>; result: AcqCompany | null }
|
|
3029
|
+
// Deal-sync operations
|
|
3030
|
+
updateDiscoveryData: { params: Omit<UpdateDiscoveryDataParams, 'organizationId'>; result: void }
|
|
3031
|
+
updateProposalData: { params: Omit<UpdateProposalDataParams, 'organizationId'>; result: void }
|
|
3032
|
+
markProposalSent: { params: Omit<MarkProposalSentParams, 'organizationId'>; result: void }
|
|
3033
|
+
markProposalReviewed: { params: Omit<MarkProposalReviewedParams, 'organizationId'>; result: void }
|
|
3034
|
+
updateCloseLostReason: { params: Omit<UpdateCloseLostReasonParams, 'organizationId'>; result: void }
|
|
3035
|
+
updateFees: { params: Omit<UpdateFeesParams, 'organizationId'>; result: void }
|
|
3036
|
+
transitionItem: { params: Omit<TransitionItemParams, 'organizationId'>; result: void }
|
|
3037
|
+
setContactNurture: { params: Omit<SetContactNurtureParams, 'organizationId'>; result: void }
|
|
3038
|
+
cancelSchedulesAndHitlByEmail: {
|
|
3039
|
+
params: Omit<CancelSchedulesAndHitlByEmailParams, 'organizationId'>
|
|
3040
|
+
result: { schedulesCancelled: number; hitlDeleted: number }
|
|
3041
|
+
}
|
|
3042
|
+
cancelHitlByDealId: { params: Omit<CancelHitlByDealIdParams, 'organizationId'>; result: { hitlDeleted: number } }
|
|
3043
|
+
clearDealFields: { params: Omit<ClearDealFieldsParams, 'organizationId'>; result: void }
|
|
3044
|
+
deleteDeal: { params: Omit<DeleteDealParams, 'organizationId'>; result: void }
|
|
3045
|
+
recordDealActivity: {
|
|
3046
|
+
params: Omit<RecordDealActivityParams, 'organizationId'>
|
|
3047
|
+
result: void
|
|
3048
|
+
}
|
|
3049
|
+
// Deal note operations
|
|
3050
|
+
createDealNote: {
|
|
3051
|
+
params: Omit<CreateDealNoteParams, 'organizationId'>
|
|
3052
|
+
result: AcqDealNote
|
|
3053
|
+
}
|
|
3054
|
+
listDealNotes: {
|
|
3055
|
+
params: Omit<ListDealNotesParams, 'organizationId'>
|
|
3056
|
+
result: AcqDealNote[]
|
|
3057
|
+
}
|
|
3058
|
+
// Deal task operations
|
|
3059
|
+
createDealTask: {
|
|
3060
|
+
params: Omit<CreateDealTaskParams, 'organizationId'>
|
|
3061
|
+
result: AcqDealTask
|
|
3062
|
+
}
|
|
3063
|
+
listDealTasks: {
|
|
3064
|
+
params: Omit<ListDealTasksParams, 'organizationId'>
|
|
3065
|
+
result: AcqDealTask[]
|
|
3066
|
+
}
|
|
3067
|
+
listDealTasksDue: {
|
|
3068
|
+
params: Omit<ListDealTasksDueParams, 'organizationId'>
|
|
3069
|
+
result: AcqDealTask[]
|
|
3070
|
+
}
|
|
3071
|
+
completeDealTask: {
|
|
3072
|
+
params: Omit<CompleteDealTaskParams, 'organizationId'>
|
|
3073
|
+
result: AcqDealTask
|
|
3074
|
+
}
|
|
3075
|
+
// Deal query & analytics operations
|
|
3076
|
+
listDeals: { params: DealFilters; result: AcqDeal[] }
|
|
3077
|
+
getDealPipelineAnalytics: { params: { recentLimit?: number }; result: DealPipelineAnalytics }
|
|
3078
|
+
// Enrichment data operations
|
|
3079
|
+
mergeEnrichmentData: {
|
|
3080
|
+
params: { id: string; table: 'acq_companies' | 'acq_contacts'; data: Record<string, unknown> }
|
|
3081
|
+
result: void
|
|
3082
|
+
}
|
|
3083
|
+
// Social monitoring operations
|
|
3084
|
+
upsertSocialPosts: {
|
|
3085
|
+
params: { posts: Omit<UpsertSocialPostParams, 'organizationId'>[] }
|
|
3086
|
+
result: UpsertSocialPostsResult
|
|
3087
|
+
}
|
|
3088
|
+
setDealStateKey: {
|
|
3089
|
+
params: {
|
|
3090
|
+
dealId: string
|
|
3091
|
+
stateKey: string
|
|
3092
|
+
}
|
|
3093
|
+
result: { ok: true }
|
|
3094
|
+
}
|
|
3095
|
+
// CRM workflow helpers
|
|
3096
|
+
transitionDeal: {
|
|
3097
|
+
params: {
|
|
3098
|
+
dealId: string
|
|
3099
|
+
toStage: string
|
|
3100
|
+
toState?: string
|
|
3101
|
+
}
|
|
3102
|
+
result: { deal: AcqDeal }
|
|
3103
|
+
}
|
|
3104
|
+
loadDeal: {
|
|
3105
|
+
params: { dealId: string }
|
|
3106
|
+
result: DealDetail | null
|
|
3107
|
+
}
|
|
3191
3108
|
}
|
|
3192
3109
|
```
|
|
3193
3110
|
|
|
3194
3111
|
### `ListToolMap`
|
|
3195
3112
|
|
|
3196
3113
|
```typescript
|
|
3197
|
-
export type ListToolMap = {
|
|
3198
|
-
getConfig: {
|
|
3199
|
-
params: { listId: string }
|
|
3200
|
-
result: { scrapingConfig: ScrapingConfig; icp: IcpRubric; pipelineConfig: PipelineConfig }
|
|
3201
|
-
}
|
|
3202
|
-
recordExecution: {
|
|
3203
|
-
params: Omit<RecordListExecutionParams, 'organizationId'>
|
|
3204
|
-
result: void
|
|
3205
|
-
}
|
|
3206
|
-
updateCompanyStage: {
|
|
3207
|
-
params: Omit<UpdateCompanyStageParams, 'organizationId'>
|
|
3208
|
-
result: void
|
|
3209
|
-
}
|
|
3210
|
-
updateContactStage: {
|
|
3211
|
-
params: Omit<UpdateContactStageParams, 'organizationId'>
|
|
3212
|
-
result: void
|
|
3213
|
-
}
|
|
3114
|
+
export type ListToolMap = {
|
|
3115
|
+
getConfig: {
|
|
3116
|
+
params: { listId: string }
|
|
3117
|
+
result: { scrapingConfig: ScrapingConfig; icp: IcpRubric; pipelineConfig: PipelineConfig }
|
|
3118
|
+
}
|
|
3119
|
+
recordExecution: {
|
|
3120
|
+
params: Omit<RecordListExecutionParams, 'organizationId'>
|
|
3121
|
+
result: void
|
|
3122
|
+
}
|
|
3123
|
+
updateCompanyStage: {
|
|
3124
|
+
params: Omit<UpdateCompanyStageParams, 'organizationId'>
|
|
3125
|
+
result: void
|
|
3126
|
+
}
|
|
3127
|
+
updateContactStage: {
|
|
3128
|
+
params: Omit<UpdateContactStageParams, 'organizationId'>
|
|
3129
|
+
result: void
|
|
3130
|
+
}
|
|
3214
3131
|
}
|
|
3215
3132
|
```
|