@elevasis/core 0.15.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/index.d.ts +1662 -23
  2. package/dist/index.js +171 -24
  3. package/dist/knowledge/index.d.ts +1340 -0
  4. package/dist/knowledge/index.js +138 -0
  5. package/dist/organization-model/index.d.ts +1662 -23
  6. package/dist/organization-model/index.js +171 -24
  7. package/dist/test-utils/index.d.ts +711 -10
  8. package/dist/test-utils/index.js +159 -16
  9. package/package.json +7 -3
  10. package/src/__tests__/publish.test.ts +14 -13
  11. package/src/__tests__/template-core-compatibility.test.ts +4 -4
  12. package/src/_gen/__tests__/__snapshots__/contracts.md.snap +1265 -1154
  13. package/src/auth/multi-tenancy/index.ts +3 -0
  14. package/src/auth/multi-tenancy/theme-presets.ts +45 -0
  15. package/src/auth/multi-tenancy/types.ts +57 -83
  16. package/src/auth/multi-tenancy/users/api-schemas.ts +165 -194
  17. package/src/business/acquisition/activity-events.ts +1 -1
  18. package/src/business/acquisition/api-schemas.ts +1196 -1177
  19. package/src/business/acquisition/crm-state-actions.test.ts +139 -139
  20. package/src/business/acquisition/types.ts +381 -390
  21. package/src/business/crm/api-schemas.ts +40 -0
  22. package/src/business/crm/index.ts +1 -0
  23. package/src/business/deals/api-schemas.ts +79 -0
  24. package/src/business/deals/index.ts +1 -0
  25. package/src/business/projects/types.ts +124 -88
  26. package/src/execution/core/runner-types.ts +61 -80
  27. package/src/execution/engine/tools/integration/server/adapters/gmail/gmail-tools.ts +105 -104
  28. package/src/execution/engine/tools/integration/server/adapters/instantly/instantly-tools.ts +1474 -1473
  29. package/src/execution/engine/tools/integration/server/adapters/millionverifier/millionverifier-tools.ts +103 -102
  30. package/src/execution/engine/tools/integration/server/adapters/signature-api/signature-api-tools.ts +182 -179
  31. package/src/execution/engine/tools/integration/server/adapters/stripe/stripe-tools.ts +310 -309
  32. package/src/execution/engine/tools/integration/tool.ts +255 -253
  33. package/src/execution/engine/tools/lead-service-types.ts +895 -894
  34. package/src/execution/engine/tools/messages.ts +43 -0
  35. package/src/execution/engine/tools/platform/acquisition/types.ts +2 -1
  36. package/src/execution/engine/tools/platform/email/types.ts +97 -96
  37. package/src/execution/engine/tools/types.ts +234 -233
  38. package/src/execution/engine/workflow/types.ts +195 -193
  39. package/src/execution/external/api-schemas.ts +40 -0
  40. package/src/execution/external/index.ts +1 -0
  41. package/src/knowledge/README.md +32 -0
  42. package/src/knowledge/__tests__/queries.test.ts +504 -0
  43. package/src/knowledge/format.ts +99 -0
  44. package/src/knowledge/index.ts +5 -0
  45. package/src/knowledge/published.ts +5 -0
  46. package/src/knowledge/queries.ts +256 -0
  47. package/src/organization-model/__tests__/defaults.test.ts +172 -172
  48. package/src/organization-model/__tests__/foundation.test.ts +7 -7
  49. package/src/organization-model/__tests__/icons.test.ts +27 -0
  50. package/src/organization-model/__tests__/knowledge.test.ts +214 -0
  51. package/src/organization-model/contracts.ts +17 -15
  52. package/src/organization-model/defaults.ts +74 -19
  53. package/src/organization-model/domains/knowledge.ts +53 -0
  54. package/src/organization-model/domains/navigation.ts +416 -399
  55. package/src/organization-model/domains/shared.ts +6 -5
  56. package/src/organization-model/foundation.ts +10 -6
  57. package/src/organization-model/graph/build.ts +209 -182
  58. package/src/organization-model/graph/schema.ts +37 -34
  59. package/src/organization-model/graph/types.ts +47 -31
  60. package/src/organization-model/icons.ts +81 -0
  61. package/src/organization-model/index.ts +8 -3
  62. package/src/organization-model/organization-model.mdx +1 -1
  63. package/src/organization-model/published.ts +103 -86
  64. package/src/organization-model/schema.ts +90 -85
  65. package/src/organization-model/types.ts +40 -33
  66. package/src/platform/index.ts +23 -27
  67. package/src/platform/registry/index.ts +0 -4
  68. package/src/platform/registry/resource-registry.ts +0 -77
  69. package/src/platform/registry/serialized-types.ts +148 -219
  70. package/src/platform/registry/stats-types.ts +60 -60
  71. package/src/reference/_generated/contracts.md +1265 -1154
  72. package/src/platform/registry/__tests__/resource-registry.list-executable.test.ts +0 -393
@@ -177,15 +177,53 @@ export type OrganizationModelObjective = z.infer<typeof ObjectiveSchema>
177
177
  export type OrganizationModelKeyResult = z.infer<typeof KeyResultSchema>
178
178
  ```
179
179
 
180
+ ### `OrganizationModelKnowledge`
181
+
182
+ ```typescript
183
+ export type OrganizationModelKnowledge = z.infer<typeof KnowledgeDomainSchema>
184
+ ```
185
+
186
+ ### `OrgKnowledgeNode`
187
+
188
+ ```typescript
189
+ export type OrgKnowledgeNode = z.infer<typeof OrgKnowledgeNodeSchema>
190
+ ```
191
+
192
+ ### `OrgKnowledgeKind`
193
+
194
+ ```typescript
195
+ export type OrgKnowledgeKind = z.infer<typeof OrgKnowledgeKindSchema>
196
+ ```
197
+
198
+ ### `OrganizationModelIconToken`
199
+
200
+ ```typescript
201
+ export type OrganizationModelIconToken = z.infer<typeof OrganizationModelIconTokenSchema>
202
+ ```
203
+
204
+ ### `OrganizationModelBuiltinIconToken`
205
+
206
+ ```typescript
207
+ export type OrganizationModelBuiltinIconToken = z.infer<typeof OrganizationModelBuiltinIconTokenSchema>
208
+ ```
209
+
180
210
  ### `DeepPartial`
181
211
 
182
212
  ```typescript
183
- export type DeepPartial<T> =
213
+ export type DeepPartial<T> =
184
214
  T extends Array<infer U> ? Array<DeepPartial<U>> : T extends object ? { [K in keyof T]?: DeepPartial<T[K]> } : T
185
215
  ```
186
216
 
187
217
  ## Feature System
188
218
 
219
+ ### `ElevasisOrganizationModel`
220
+
221
+ ```typescript
222
+ export type ElevasisOrganizationModel = Omit<OrganizationModel, 'knowledge'> & {
223
+ knowledge?: OrganizationModel['knowledge']
224
+ }
225
+ ```
226
+
189
227
  ### `FeatureSidebarComponent`
190
228
 
191
229
  ```typescript
@@ -324,7 +362,7 @@ export interface OrganizationGraphContextValue {
324
362
  ```typescript
325
363
  export interface ElevasisFeaturesProviderProps {
326
364
  features: FeatureModule[]
327
- organizationModel?: OrganizationModel
365
+ organizationModel?: ElevasisOrganizationModel
328
366
  timeRange?: TimeRange
329
367
  operationsApiUrl?: string
330
368
  operationsSSEManager?: SSEConnectionManagerLike
@@ -809,73 +847,73 @@ export interface DeploymentSpec {
809
847
  ### `AcqCompany`
810
848
 
811
849
  ```typescript
812
- /**
813
- * Company record in the acquisition database.
814
- * Contains enriched company data from various sources.
815
- * Transformed from AcqCompanyRow with camelCase properties.
816
- */
817
- export interface AcqCompany {
818
- id: string
819
- organizationId: string
820
- name: string
821
- domain: string | null
822
- linkedinUrl: string | null
823
- website: string | null
824
- numEmployees: number | null
825
- foundedYear: number | null
826
- locationCity: string | null
827
- locationState: string | null
828
- category: string | null
829
- categoryPain: string | null
830
- segment: string | null
831
- pipelineStatus: CompanyPipelineStatus | null
832
- enrichmentData: CompanyEnrichmentData | null
833
- source: string | null
834
- batchId: string | null
835
- status: 'active' | 'invalid'
836
- verticalResearch: string | null
837
- /** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
838
- qualificationScore: number | null
839
- /** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
840
- qualificationSignals: Record<string, unknown> | null
841
- /** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
842
- qualificationRubricKey: string | null
843
- createdAt: Date
844
- updatedAt: Date
850
+ /**
851
+ * Company record in the acquisition database.
852
+ * Contains enriched company data from various sources.
853
+ * Transformed from AcqCompanyRow with camelCase properties.
854
+ */
855
+ export interface AcqCompany {
856
+ id: string
857
+ organizationId: string
858
+ name: string
859
+ domain: string | null
860
+ linkedinUrl: string | null
861
+ website: string | null
862
+ numEmployees: number | null
863
+ foundedYear: number | null
864
+ locationCity: string | null
865
+ locationState: string | null
866
+ category: string | null
867
+ categoryPain: string | null
868
+ segment: string | null
869
+ pipelineStatus: CompanyPipelineStatus | null
870
+ enrichmentData: CompanyEnrichmentData | null
871
+ source: string | null
872
+ batchId: string | null
873
+ status: 'active' | 'invalid'
874
+ verticalResearch: string | null
875
+ /** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
876
+ qualificationScore: number | null
877
+ /** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
878
+ qualificationSignals: Record<string, unknown> | null
879
+ /** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
880
+ qualificationRubricKey: string | null
881
+ createdAt: Date
882
+ updatedAt: Date
845
883
  }
846
884
  ```
847
885
 
848
886
  ### `AcqContact`
849
887
 
850
888
  ```typescript
851
- /**
852
- * Contact record in the acquisition database.
853
- * Contains enriched contact data and personalization content.
854
- * Transformed from AcqContactRow with camelCase properties.
855
- */
856
- export interface AcqContact {
857
- id: string
858
- organizationId: string
859
- companyId: string | null
860
- email: string
861
- emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null
862
- firstName: string | null
863
- lastName: string | null
864
- linkedinUrl: string | null
865
- title: string | null
866
- headline: string | null
867
- filterReason: string | null
868
- openingLine: string | null
869
- source: string | null
870
- sourceId: string | null
871
- pipelineStatus: ContactPipelineStatus | null
872
- enrichmentData: ContactEnrichmentData | null
873
- /** Attio Person record ID - set when contact responds and is added to CRM */
874
- attioPersonId: string | null
875
- batchId: string | null
876
- status: 'active' | 'invalid'
877
- createdAt: Date
878
- updatedAt: Date
889
+ /**
890
+ * Contact record in the acquisition database.
891
+ * Contains enriched contact data and personalization content.
892
+ * Transformed from AcqContactRow with camelCase properties.
893
+ */
894
+ export interface AcqContact {
895
+ id: string
896
+ organizationId: string
897
+ companyId: string | null
898
+ email: string
899
+ emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null
900
+ firstName: string | null
901
+ lastName: string | null
902
+ linkedinUrl: string | null
903
+ title: string | null
904
+ headline: string | null
905
+ filterReason: string | null
906
+ openingLine: string | null
907
+ source: string | null
908
+ sourceId: string | null
909
+ pipelineStatus: ContactPipelineStatus | null
910
+ enrichmentData: ContactEnrichmentData | null
911
+ /** Attio Person record ID - set when contact responds and is added to CRM */
912
+ attioPersonId: string | null
913
+ batchId: string | null
914
+ status: 'active' | 'invalid'
915
+ createdAt: Date
916
+ updatedAt: Date
879
917
  }
880
918
  ```
881
919
 
@@ -894,23 +932,23 @@ export type DealPriorityBucketKey = 'needs_response' | 'follow_up_due' | 'waitin
894
932
  ### `DealPriority`
895
933
 
896
934
  ```typescript
897
- export interface DealPriority {
898
- bucketKey: DealPriorityBucketKey
899
- rank: number
900
- label: string
901
- color: string
902
- reason: string
903
- latestActivityAt: string | null
904
- nextActionAt: string | null
935
+ export interface DealPriority {
936
+ bucketKey: DealPriorityBucketKey
937
+ rank: number
938
+ label: string
939
+ color: string
940
+ reason: string
941
+ latestActivityAt: string | null
942
+ nextActionAt: string | null
905
943
  }
906
944
  ```
907
945
 
908
946
  ### `KanbanStageConfig`
909
947
 
910
948
  ```typescript
911
- export interface KanbanStageConfig {
912
- color: string // Mantine color token (e.g. 'blue', 'teal')
913
- label?: string // Optional display label override
949
+ export interface KanbanStageConfig {
950
+ color: string // Mantine color token (e.g. 'blue', 'teal')
951
+ label?: string // Optional display label override
914
952
  }
915
953
  ```
916
954
 
@@ -923,44 +961,44 @@ export type KanbanBoardConfig = Partial<Record<DealStage, KanbanStageConfig>>
923
961
  ### `DealContact`
924
962
 
925
963
  ```typescript
926
- export interface DealContact {
927
- id: string
928
- first_name: string | null
929
- last_name: string | null
930
- email: string
931
- title: string | null
932
- headline: string | null
933
- linkedin_url: string | null
934
- pipeline_status: Record<string, unknown> | null
935
- enrichment_data: Record<string, unknown> | null
936
- company: {
937
- id: string
938
- name: string
939
- domain: string | null
940
- website: string | null
941
- linkedin_url: string | null
942
- segment: string | null
943
- category: string | null
944
- num_employees: number | null
945
- } | null
964
+ export interface DealContact {
965
+ id: string
966
+ first_name: string | null
967
+ last_name: string | null
968
+ email: string
969
+ title: string | null
970
+ headline: string | null
971
+ linkedin_url: string | null
972
+ pipeline_status: Record<string, unknown> | null
973
+ enrichment_data: Record<string, unknown> | null
974
+ company: {
975
+ id: string
976
+ name: string
977
+ domain: string | null
978
+ website: string | null
979
+ linkedin_url: string | null
980
+ segment: string | null
981
+ category: string | null
982
+ num_employees: number | null
983
+ } | null
946
984
  }
947
985
  ```
948
986
 
949
987
  ### `DealFilters`
950
988
 
951
989
  ```typescript
952
- export interface DealFilters {
953
- stage?: DealStage
954
- search?: string
955
- limit?: number
956
- offset?: number
990
+ export interface DealFilters {
991
+ stage?: DealStage
992
+ search?: string
993
+ limit?: number
994
+ offset?: number
957
995
  }
958
996
  ```
959
997
 
960
998
  ### `DealListItem`
961
999
 
962
1000
  ```typescript
963
- /** Deal list item with joined contact and company data */
1001
+ /** Deal list item with joined contact and company data */
964
1002
  export interface DealListItem extends AcqDealRow {
965
1003
  priority: DealPriority
966
1004
  ownership: 'us' | 'them' | null
@@ -978,31 +1016,31 @@ export type DealDetail = DealListItem
978
1016
  ### `AcqDealTaskKind`
979
1017
 
980
1018
  ```typescript
981
- /** Task kind options for a deal task (human follow-up action type) */
1019
+ /** Task kind options for a deal task (human follow-up action type) */
982
1020
  export type AcqDealTaskKind = 'call' | 'email' | 'meeting' | 'other'
983
1021
  ```
984
1022
 
985
1023
  ### `AcqDealTask`
986
1024
 
987
1025
  ```typescript
988
- /**
989
- * A CRM to-do item attached to a deal representing a human follow-up action.
990
- * Transformed from AcqDealTaskRow with camelCase properties.
991
- */
992
- export interface AcqDealTask {
993
- id: string
994
- organizationId: string
995
- dealId: string
996
- title: string
997
- description: string | null
998
- kind: AcqDealTaskKind
999
- dueAt: string | null
1000
- assigneeUserId: string | null
1001
- completedAt: string | null
1002
- completedByUserId: string | null
1003
- createdAt: string
1004
- updatedAt: string
1005
- createdByUserId: string | null
1026
+ /**
1027
+ * A CRM to-do item attached to a deal representing a human follow-up action.
1028
+ * Transformed from AcqDealTaskRow with camelCase properties.
1029
+ */
1030
+ export interface AcqDealTask {
1031
+ id: string
1032
+ organizationId: string
1033
+ dealId: string
1034
+ title: string
1035
+ description: string | null
1036
+ kind: AcqDealTaskKind
1037
+ dueAt: string | null
1038
+ assigneeUserId: string | null
1039
+ completedAt: string | null
1040
+ completedByUserId: string | null
1041
+ createdAt: string
1042
+ updatedAt: string
1043
+ createdByUserId: string | null
1006
1044
  }
1007
1045
  ```
1008
1046
 
@@ -1081,190 +1119,190 @@ export const AcqDealTaskKindSchema = z.enum(['call', 'email', 'meeting', 'other'
1081
1119
  ### `DealIdParamsSchema`
1082
1120
 
1083
1121
  ```typescript
1084
- export const DealIdParamsSchema = z.object({
1085
- dealId: UuidSchema
1122
+ export const DealIdParamsSchema = z.object({
1123
+ dealId: UuidSchema
1086
1124
  })
1087
1125
  ```
1088
1126
 
1089
1127
  ### `DealTaskIdParamsSchema`
1090
1128
 
1091
1129
  ```typescript
1092
- export const DealTaskIdParamsSchema = z.object({
1093
- dealId: UuidSchema,
1094
- taskId: UuidSchema
1130
+ export const DealTaskIdParamsSchema = z.object({
1131
+ dealId: UuidSchema,
1132
+ taskId: UuidSchema
1095
1133
  })
1096
1134
  ```
1097
1135
 
1098
1136
  ### `ListDealsQuerySchema`
1099
1137
 
1100
1138
  ```typescript
1101
- export const ListDealsQuerySchema = z
1102
- .object({
1103
- stage: DealStageSchema.optional(),
1104
- search: z.string().optional(),
1105
- limit: z.coerce.number().int().positive().default(50),
1106
- offset: z.coerce.number().int().min(0).default(0)
1107
- })
1139
+ export const ListDealsQuerySchema = z
1140
+ .object({
1141
+ stage: DealStageSchema.optional(),
1142
+ search: z.string().optional(),
1143
+ limit: z.coerce.number().int().positive().default(50),
1144
+ offset: z.coerce.number().int().min(0).default(0)
1145
+ })
1108
1146
  .strict()
1109
1147
  ```
1110
1148
 
1111
1149
  ### `DealLookupQuerySchema`
1112
1150
 
1113
1151
  ```typescript
1114
- export const DealLookupQuerySchema = z
1115
- .object({
1116
- search: z.string().trim().min(1).max(200).optional(),
1117
- limit: z.coerce.number().int().min(1).max(25).default(10)
1118
- })
1152
+ export const DealLookupQuerySchema = z
1153
+ .object({
1154
+ search: z.string().trim().min(1).max(200).optional(),
1155
+ limit: z.coerce.number().int().min(1).max(25).default(10)
1156
+ })
1119
1157
  .strict()
1120
1158
  ```
1121
1159
 
1122
1160
  ### `ListDealTasksDueQuerySchema`
1123
1161
 
1124
1162
  ```typescript
1125
- export const ListDealTasksDueQuerySchema = z
1126
- .object({
1127
- window: z.enum(['overdue', 'today', 'today_and_overdue', 'upcoming']).optional(),
1128
- assigneeUserId: UuidSchema.optional()
1129
- })
1163
+ export const ListDealTasksDueQuerySchema = z
1164
+ .object({
1165
+ window: z.enum(['overdue', 'today', 'today_and_overdue', 'upcoming']).optional(),
1166
+ assigneeUserId: UuidSchema.optional()
1167
+ })
1130
1168
  .strict()
1131
1169
  ```
1132
1170
 
1133
1171
  ### `CreateDealNoteRequestSchema`
1134
1172
 
1135
1173
  ```typescript
1136
- export const CreateDealNoteRequestSchema = z
1137
- .object({
1138
- body: z.string().trim().min(1).max(10000)
1139
- })
1174
+ export const CreateDealNoteRequestSchema = z
1175
+ .object({
1176
+ body: z.string().trim().min(1).max(10000)
1177
+ })
1140
1178
  .strict()
1141
1179
  ```
1142
1180
 
1143
1181
  ### `CreateDealTaskRequestSchema`
1144
1182
 
1145
1183
  ```typescript
1146
- export const CreateDealTaskRequestSchema = z
1147
- .object({
1148
- title: z.string().trim().min(1).max(255),
1149
- description: z.string().nullable().optional(),
1150
- kind: AcqDealTaskKindSchema.optional(),
1151
- dueAt: z.string().datetime().nullable().optional(),
1152
- assigneeUserId: UuidSchema.nullable().optional()
1153
- })
1184
+ export const CreateDealTaskRequestSchema = z
1185
+ .object({
1186
+ title: z.string().trim().min(1).max(255),
1187
+ description: z.string().nullable().optional(),
1188
+ kind: AcqDealTaskKindSchema.optional(),
1189
+ dueAt: z.string().datetime().nullable().optional(),
1190
+ assigneeUserId: UuidSchema.nullable().optional()
1191
+ })
1154
1192
  .strict()
1155
1193
  ```
1156
1194
 
1157
1195
  ### `TransitionItemRequestSchema`
1158
1196
 
1159
1197
  ```typescript
1160
- export const TransitionItemRequestSchema = z
1161
- .object({
1162
- pipelineKey: z.string().min(1),
1163
- stageKey: z.string().min(1),
1164
- stateKey: z.string().nullable().optional(),
1165
- reason: z.string().optional(),
1166
- expectedUpdatedAt: z.string().datetime().optional()
1167
- })
1198
+ export const TransitionItemRequestSchema = z
1199
+ .object({
1200
+ pipelineKey: z.string().min(1),
1201
+ stageKey: z.string().min(1),
1202
+ stateKey: z.string().nullable().optional(),
1203
+ reason: z.string().optional(),
1204
+ expectedUpdatedAt: z.string().datetime().optional()
1205
+ })
1168
1206
  .strict()
1169
1207
  ```
1170
1208
 
1171
1209
  ### `ExecuteActionParamsSchema`
1172
1210
 
1173
1211
  ```typescript
1174
- export const ExecuteActionParamsSchema = z
1175
- .object({
1176
- dealId: UuidSchema,
1177
- actionKey: NonEmptyStringSchema
1178
- })
1212
+ export const ExecuteActionParamsSchema = z
1213
+ .object({
1214
+ dealId: UuidSchema,
1215
+ actionKey: NonEmptyStringSchema
1216
+ })
1179
1217
  .strict()
1180
1218
  ```
1181
1219
 
1182
1220
  ### `ExecuteActionRequestSchema`
1183
1221
 
1184
1222
  ```typescript
1185
- export const ExecuteActionRequestSchema = z
1186
- .object({
1187
- payload: z.record(z.string(), z.unknown()).optional()
1188
- })
1223
+ export const ExecuteActionRequestSchema = z
1224
+ .object({
1225
+ payload: z.record(z.string(), z.unknown()).optional()
1226
+ })
1189
1227
  .strict()
1190
1228
  ```
1191
1229
 
1192
1230
  ### `DealContactSummarySchema`
1193
1231
 
1194
1232
  ```typescript
1195
- /**
1196
- * Contact summary nested inside DealListItem / DealDetailResponse.
1197
- * Matches the joined shape returned by useDeals / useDealDetail Supabase queries.
1198
- */
1199
- export const DealContactSummarySchema = z.object({
1200
- id: z.string(),
1201
- first_name: z.string().nullable(),
1202
- last_name: z.string().nullable(),
1203
- email: z.string(),
1204
- title: z.string().nullable(),
1205
- headline: z.string().nullable(),
1206
- linkedin_url: z.string().nullable(),
1207
- pipeline_status: z.record(z.string(), z.unknown()).nullable(),
1208
- enrichment_data: z.record(z.string(), z.unknown()).nullable(),
1209
- company: z
1210
- .object({
1211
- id: z.string(),
1212
- name: z.string(),
1213
- domain: z.string().nullable(),
1214
- website: z.string().nullable(),
1215
- linkedin_url: z.string().nullable(),
1216
- segment: z.string().nullable(),
1217
- category: z.string().nullable(),
1218
- num_employees: z.number().nullable()
1219
- })
1220
- .nullable()
1233
+ /**
1234
+ * Contact summary nested inside DealListItem / DealDetailResponse.
1235
+ * Matches the joined shape returned by useDeals / useDealDetail Supabase queries.
1236
+ */
1237
+ export const DealContactSummarySchema = z.object({
1238
+ id: z.string(),
1239
+ first_name: z.string().nullable(),
1240
+ last_name: z.string().nullable(),
1241
+ email: z.string(),
1242
+ title: z.string().nullable(),
1243
+ headline: z.string().nullable(),
1244
+ linkedin_url: z.string().nullable(),
1245
+ pipeline_status: z.record(z.string(), z.unknown()).nullable(),
1246
+ enrichment_data: z.record(z.string(), z.unknown()).nullable(),
1247
+ company: z
1248
+ .object({
1249
+ id: z.string(),
1250
+ name: z.string(),
1251
+ domain: z.string().nullable(),
1252
+ website: z.string().nullable(),
1253
+ linkedin_url: z.string().nullable(),
1254
+ segment: z.string().nullable(),
1255
+ category: z.string().nullable(),
1256
+ num_employees: z.number().nullable()
1257
+ })
1258
+ .nullable()
1221
1259
  })
1222
1260
  ```
1223
1261
 
1224
1262
  ### `DealPrioritySchema`
1225
1263
 
1226
1264
  ```typescript
1227
- export const DealPrioritySchema = z.object({
1228
- bucketKey: z.enum(['needs_response', 'follow_up_due', 'waiting', 'stale', 'closed_low']),
1229
- rank: z.number().int(),
1230
- label: z.string(),
1231
- color: z.string(),
1232
- reason: z.string(),
1233
- latestActivityAt: z.string().nullable(),
1234
- nextActionAt: z.string().nullable()
1265
+ export const DealPrioritySchema = z.object({
1266
+ bucketKey: z.enum(['needs_response', 'follow_up_due', 'waiting', 'stale', 'closed_low']),
1267
+ rank: z.number().int(),
1268
+ label: z.string(),
1269
+ color: z.string(),
1270
+ reason: z.string(),
1271
+ latestActivityAt: z.string().nullable(),
1272
+ nextActionAt: z.string().nullable()
1235
1273
  })
1236
1274
  ```
1237
1275
 
1238
1276
  ### `DealListItemSchema`
1239
1277
 
1240
1278
  ```typescript
1241
- /**
1242
- * Deal list item with joined contact (and company via contact).
1243
- * Matches DealListItem from @repo/core types.
1244
- */
1245
- export const DealListItemSchema = z.object({
1246
- // acq_deals columns
1247
- id: z.string(),
1248
- organization_id: z.string(),
1249
- contact_id: z.string().nullable(),
1250
- contact_email: z.string(),
1251
- pipeline_key: z.string(),
1252
- stage_key: z.string().nullable(),
1253
- state_key: z.string().nullable(),
1254
- activity_log: z.unknown(),
1255
- discovery_data: z.unknown().nullable(),
1256
- discovery_submitted_at: z.string().nullable(),
1257
- discovery_submitted_by: z.string().nullable(),
1258
- proposal_data: z.unknown().nullable(),
1259
- proposal_sent_at: z.string().nullable(),
1260
- proposal_pdf_url: z.string().nullable(),
1261
- signature_envelope_id: z.string().nullable(),
1262
- source_list_id: z.string().nullable(),
1263
- source_type: z.string().nullable(),
1264
- initial_fee: z.number().nullable(),
1265
- monthly_fee: z.number().nullable(),
1266
- closed_lost_at: z.string().nullable(),
1267
- closed_lost_reason: z.string().nullable(),
1279
+ /**
1280
+ * Deal list item with joined contact (and company via contact).
1281
+ * Matches DealListItem from @repo/core types.
1282
+ */
1283
+ export const DealListItemSchema = z.object({
1284
+ // acq_deals columns
1285
+ id: z.string(),
1286
+ organization_id: z.string(),
1287
+ contact_id: z.string().nullable(),
1288
+ contact_email: z.string(),
1289
+ pipeline_key: z.string(),
1290
+ stage_key: z.string().nullable(),
1291
+ state_key: z.string().nullable(),
1292
+ activity_log: z.unknown(),
1293
+ discovery_data: z.unknown().nullable(),
1294
+ discovery_submitted_at: z.string().nullable(),
1295
+ discovery_submitted_by: z.string().nullable(),
1296
+ proposal_data: z.unknown().nullable(),
1297
+ proposal_sent_at: z.string().nullable(),
1298
+ proposal_pdf_url: z.string().nullable(),
1299
+ signature_envelope_id: z.string().nullable(),
1300
+ source_list_id: z.string().nullable(),
1301
+ source_type: z.string().nullable(),
1302
+ initial_fee: z.number().nullable(),
1303
+ monthly_fee: z.number().nullable(),
1304
+ closed_lost_at: z.string().nullable(),
1305
+ closed_lost_reason: z.string().nullable(),
1268
1306
  created_at: z.string(),
1269
1307
  updated_at: z.string(),
1270
1308
  priority: DealPrioritySchema,
@@ -1278,40 +1316,40 @@ export const DealListItemSchema = z.object({
1278
1316
  ### `DealListResponseSchema`
1279
1317
 
1280
1318
  ```typescript
1281
- export const DealListResponseSchema = z.object({
1282
- data: z.array(DealListItemSchema),
1283
- total: z.number().int(),
1284
- limit: z.number().int(),
1285
- offset: z.number().int()
1319
+ export const DealListResponseSchema = z.object({
1320
+ data: z.array(DealListItemSchema),
1321
+ total: z.number().int(),
1322
+ limit: z.number().int(),
1323
+ offset: z.number().int()
1286
1324
  })
1287
1325
  ```
1288
1326
 
1289
1327
  ### `DealDetailResponseSchema`
1290
1328
 
1291
1329
  ```typescript
1292
- /**
1293
- * Deal detail shape — currently the same as a list item (full joined record).
1294
- * Additive fields keep existing DealListItem callers compatible.
1295
- */
1296
- export const DealDetailResponseSchema = DealListItemSchema.extend({
1297
- conversation: DealConversationSchema
1330
+ /**
1331
+ * Deal detail shape — currently the same as a list item (full joined record).
1332
+ * Additive fields keep existing DealListItem callers compatible.
1333
+ */
1334
+ export const DealDetailResponseSchema = DealListItemSchema.extend({
1335
+ conversation: DealConversationSchema
1298
1336
  })
1299
1337
  ```
1300
1338
 
1301
1339
  ### `DealNoteResponseSchema`
1302
1340
 
1303
1341
  ```typescript
1304
- /**
1305
- * Single acq_deal_notes row (camelCase API representation).
1306
- */
1307
- export const DealNoteResponseSchema = z.object({
1308
- id: z.string(),
1309
- dealId: z.string(),
1310
- organizationId: z.string(),
1311
- authorUserId: z.string().nullable(),
1312
- body: z.string(),
1313
- createdAt: z.string(),
1314
- updatedAt: z.string()
1342
+ /**
1343
+ * Single acq_deal_notes row (camelCase API representation).
1344
+ */
1345
+ export const DealNoteResponseSchema = z.object({
1346
+ id: z.string(),
1347
+ dealId: z.string(),
1348
+ organizationId: z.string(),
1349
+ authorUserId: z.string().nullable(),
1350
+ body: z.string(),
1351
+ createdAt: z.string(),
1352
+ updatedAt: z.string()
1315
1353
  })
1316
1354
  ```
1317
1355
 
@@ -1324,24 +1362,24 @@ export const DealNoteListResponseSchema = z.array(DealNoteResponseSchema)
1324
1362
  ### `DealTaskResponseSchema`
1325
1363
 
1326
1364
  ```typescript
1327
- /**
1328
- * Single acq_deal_tasks row (camelCase API representation).
1329
- * Matches AcqDealTask domain type from types.ts.
1330
- */
1331
- export const DealTaskResponseSchema = z.object({
1332
- id: z.string(),
1333
- organizationId: z.string(),
1334
- dealId: z.string(),
1335
- title: z.string(),
1336
- description: z.string().nullable(),
1337
- kind: AcqDealTaskKindSchema,
1338
- dueAt: z.string().nullable(),
1339
- assigneeUserId: z.string().nullable(),
1340
- completedAt: z.string().nullable(),
1341
- completedByUserId: z.string().nullable(),
1342
- createdAt: z.string(),
1343
- updatedAt: z.string(),
1344
- createdByUserId: z.string().nullable()
1365
+ /**
1366
+ * Single acq_deal_tasks row (camelCase API representation).
1367
+ * Matches AcqDealTask domain type from types.ts.
1368
+ */
1369
+ export const DealTaskResponseSchema = z.object({
1370
+ id: z.string(),
1371
+ organizationId: z.string(),
1372
+ dealId: z.string(),
1373
+ title: z.string(),
1374
+ description: z.string().nullable(),
1375
+ kind: AcqDealTaskKindSchema,
1376
+ dueAt: z.string().nullable(),
1377
+ assigneeUserId: z.string().nullable(),
1378
+ completedAt: z.string().nullable(),
1379
+ completedByUserId: z.string().nullable(),
1380
+ createdAt: z.string(),
1381
+ updatedAt: z.string(),
1382
+ createdByUserId: z.string().nullable()
1345
1383
  })
1346
1384
  ```
1347
1385
 
@@ -1354,35 +1392,35 @@ export const DealTaskListResponseSchema = z.array(DealTaskResponseSchema)
1354
1392
  ### `DealSchemas`
1355
1393
 
1356
1394
  ```typescript
1357
- export const DealSchemas = {
1358
- // Params
1359
- DealIdParams: DealIdParamsSchema,
1360
- DealTaskIdParams: DealTaskIdParamsSchema,
1361
-
1362
- // Queries
1363
- ListDealsQuery: ListDealsQuerySchema,
1364
- DealLookupQuery: DealLookupQuerySchema,
1365
- ListDealTasksDueQuery: ListDealTasksDueQuerySchema,
1366
-
1367
- // Request bodies
1368
- CreateDealNoteRequest: CreateDealNoteRequestSchema,
1369
- CreateDealTaskRequest: CreateDealTaskRequestSchema,
1370
- TransitionItemRequest: TransitionItemRequestSchema,
1371
- TransitionDealStateRequest: TransitionDealStateRequestSchema,
1372
- ExecuteActionParams: ExecuteActionParamsSchema,
1373
- ExecuteActionRequest: ExecuteActionRequestSchema,
1374
-
1375
- // Responses
1376
- DealPriority: DealPrioritySchema,
1377
- DealListResponse: DealListResponseSchema,
1378
- DealSummaryResponse: DealSummaryResponseSchema,
1379
- DealLookupResponse: DealLookupResponseSchema,
1380
- ConversationMessage: ConversationMessageSchema,
1381
- DealDetailResponse: DealDetailResponseSchema,
1382
- DealNoteResponse: DealNoteResponseSchema,
1383
- DealNoteListResponse: DealNoteListResponseSchema,
1384
- DealTaskResponse: DealTaskResponseSchema,
1385
- DealTaskListResponse: DealTaskListResponseSchema
1395
+ export const DealSchemas = {
1396
+ // Params
1397
+ DealIdParams: DealIdParamsSchema,
1398
+ DealTaskIdParams: DealTaskIdParamsSchema,
1399
+
1400
+ // Queries
1401
+ ListDealsQuery: ListDealsQuerySchema,
1402
+ DealLookupQuery: DealLookupQuerySchema,
1403
+ ListDealTasksDueQuery: ListDealTasksDueQuerySchema,
1404
+
1405
+ // Request bodies
1406
+ CreateDealNoteRequest: CreateDealNoteRequestSchema,
1407
+ CreateDealTaskRequest: CreateDealTaskRequestSchema,
1408
+ TransitionItemRequest: TransitionItemRequestSchema,
1409
+ TransitionDealStateRequest: TransitionDealStateRequestSchema,
1410
+ ExecuteActionParams: ExecuteActionParamsSchema,
1411
+ ExecuteActionRequest: ExecuteActionRequestSchema,
1412
+
1413
+ // Responses
1414
+ DealPriority: DealPrioritySchema,
1415
+ DealListResponse: DealListResponseSchema,
1416
+ DealSummaryResponse: DealSummaryResponseSchema,
1417
+ DealLookupResponse: DealLookupResponseSchema,
1418
+ ConversationMessage: ConversationMessageSchema,
1419
+ DealDetailResponse: DealDetailResponseSchema,
1420
+ DealNoteResponse: DealNoteResponseSchema,
1421
+ DealNoteListResponse: DealNoteListResponseSchema,
1422
+ DealTaskResponse: DealTaskResponseSchema,
1423
+ DealTaskListResponse: DealTaskListResponseSchema
1386
1424
  }
1387
1425
  ```
1388
1426
 
@@ -1516,443 +1554,443 @@ export type CrmToolMap = {
1516
1554
  ### `WebPost`
1517
1555
 
1518
1556
  ```typescript
1519
- /**
1520
- * Represents a web post from company website scraping.
1521
- * Used for recent blog posts, news, or announcements.
1522
- */
1523
- export interface WebPost {
1524
- /** ISO date string of when the post was published */
1525
- date: string
1526
- /** Title of the web post */
1527
- title: string
1528
- /** Brief summary of the post content */
1529
- summary: string
1530
- /** AI-generated insight about the post's relevance */
1531
- aiInsight?: string
1557
+ /**
1558
+ * Represents a web post from company website scraping.
1559
+ * Used for recent blog posts, news, or announcements.
1560
+ */
1561
+ export interface WebPost {
1562
+ /** ISO date string of when the post was published */
1563
+ date: string
1564
+ /** Title of the web post */
1565
+ title: string
1566
+ /** Brief summary of the post content */
1567
+ summary: string
1568
+ /** AI-generated insight about the post's relevance */
1569
+ aiInsight?: string
1532
1570
  }
1533
1571
  ```
1534
1572
 
1535
1573
  ### `CompanyPipelineStatus`
1536
1574
 
1537
1575
  ```typescript
1538
- /**
1539
- * Tracks pipeline status for a company across all processing stages.
1540
- */
1541
- export interface CompanyPipelineStatus {
1542
- acquired: boolean
1543
- enrichment: {
1544
- [source: string]: {
1545
- status: 'pending' | 'complete' | 'failed' | 'skipped'
1546
- completedAt?: string
1547
- error?: string
1548
- }
1549
- }
1576
+ /**
1577
+ * Tracks pipeline status for a company across all processing stages.
1578
+ */
1579
+ export interface CompanyPipelineStatus {
1580
+ acquired: boolean
1581
+ enrichment: {
1582
+ [source: string]: {
1583
+ status: 'pending' | 'complete' | 'failed' | 'skipped'
1584
+ completedAt?: string
1585
+ error?: string
1586
+ }
1587
+ }
1550
1588
  }
1551
1589
  ```
1552
1590
 
1553
1591
  ### `ContactPipelineStatus`
1554
1592
 
1555
1593
  ```typescript
1556
- /**
1557
- * Tracks pipeline status for a contact across all processing stages.
1558
- */
1559
- export interface ContactPipelineStatus {
1560
- enrichment: {
1561
- [source: string]: {
1562
- status: 'pending' | 'complete' | 'failed' | 'skipped'
1563
- completedAt?: string
1564
- error?: string
1565
- }
1566
- }
1567
- personalization: {
1568
- status: 'pending' | 'complete' | 'failed' | 'skipped'
1569
- completedAt?: string
1570
- }
1571
- outreach: {
1572
- status: 'pending' | 'sent' | 'replied' | 'bounced' | 'opted-out'
1573
- sentAt?: string
1574
- channel?: string
1575
- campaignId?: string
1576
- }
1594
+ /**
1595
+ * Tracks pipeline status for a contact across all processing stages.
1596
+ */
1597
+ export interface ContactPipelineStatus {
1598
+ enrichment: {
1599
+ [source: string]: {
1600
+ status: 'pending' | 'complete' | 'failed' | 'skipped'
1601
+ completedAt?: string
1602
+ error?: string
1603
+ }
1604
+ }
1605
+ personalization: {
1606
+ status: 'pending' | 'complete' | 'failed' | 'skipped'
1607
+ completedAt?: string
1608
+ }
1609
+ outreach: {
1610
+ status: 'pending' | 'sent' | 'replied' | 'bounced' | 'opted-out'
1611
+ sentAt?: string
1612
+ channel?: string
1613
+ campaignId?: string
1614
+ }
1577
1615
  }
1578
1616
  ```
1579
1617
 
1580
1618
  ### `CompanyEnrichmentData`
1581
1619
 
1582
1620
  ```typescript
1583
- /**
1584
- * Enrichment data collected for a company from various sources.
1585
- */
1586
- export interface CompanyEnrichmentData {
1587
- googleMaps?: {
1588
- placeId?: string
1589
- totalScore?: number
1590
- reviewsCount?: number
1591
- address?: string
1592
- phone?: string
1593
- categoryName?: string
1594
- googleMapsUrl?: string
1595
- scrapedAt?: string
1596
- }
1597
- websiteCrawl?: {
1598
- companyDescription?: string
1599
- services?: string[]
1600
- specialties?: string[]
1601
- staff?: Array<{ name: string; title?: string; email?: string }>
1602
- automationGaps?: string[]
1603
- targetAudience?: string
1604
- category?: string
1605
- segment?: string
1606
- recentWin?: string
1607
- emailCount?: number
1608
- pageCount?: number
1609
- totalChars?: number
1610
- crawledAt?: string
1611
- extractedAt?: string
1612
- }
1613
- website?: {
1614
- missionVision?: string
1615
- uniqueAttributes?: string
1616
- coreOfferings?: string
1617
- targetAudience?: string
1618
- companyValues?: string
1619
- businessDescription?: string
1620
- recentPosts?: Array<{ date?: string; title?: string; summary?: string; aiInsight?: string }>
1621
- }
1622
- tomba?: {
1623
- waterfallEmail?: {
1624
- email: string
1625
- name?: string
1626
- title?: string
1627
- department?: string
1628
- } | null
1629
- genericEmail?: string | null
1630
- totalFound?: number
1631
- searchedAt?: string
1632
- }
1621
+ /**
1622
+ * Enrichment data collected for a company from various sources.
1623
+ */
1624
+ export interface CompanyEnrichmentData {
1625
+ googleMaps?: {
1626
+ placeId?: string
1627
+ totalScore?: number
1628
+ reviewsCount?: number
1629
+ address?: string
1630
+ phone?: string
1631
+ categoryName?: string
1632
+ googleMapsUrl?: string
1633
+ scrapedAt?: string
1634
+ }
1635
+ websiteCrawl?: {
1636
+ companyDescription?: string
1637
+ services?: string[]
1638
+ specialties?: string[]
1639
+ staff?: Array<{ name: string; title?: string; email?: string }>
1640
+ automationGaps?: string[]
1641
+ targetAudience?: string
1642
+ category?: string
1643
+ segment?: string
1644
+ recentWin?: string
1645
+ emailCount?: number
1646
+ pageCount?: number
1647
+ totalChars?: number
1648
+ crawledAt?: string
1649
+ extractedAt?: string
1650
+ }
1651
+ website?: {
1652
+ missionVision?: string
1653
+ uniqueAttributes?: string
1654
+ coreOfferings?: string
1655
+ targetAudience?: string
1656
+ companyValues?: string
1657
+ businessDescription?: string
1658
+ recentPosts?: Array<{ date?: string; title?: string; summary?: string; aiInsight?: string }>
1659
+ }
1660
+ tomba?: {
1661
+ waterfallEmail?: {
1662
+ email: string
1663
+ name?: string
1664
+ title?: string
1665
+ department?: string
1666
+ } | null
1667
+ genericEmail?: string | null
1668
+ totalFound?: number
1669
+ searchedAt?: string
1670
+ }
1633
1671
  }
1634
1672
  ```
1635
1673
 
1636
1674
  ### `ContactEnrichmentData`
1637
1675
 
1638
1676
  ```typescript
1639
- /**
1640
- * Enrichment data collected for a contact from various sources.
1641
- */
1642
- export interface ContactEnrichmentData {
1643
- linkedin?: {
1644
- summary?: string
1645
- pastExperience?: string
1646
- education?: string
1647
- activity?: Array<{ date?: string; content?: string }>
1648
- }
1677
+ /**
1678
+ * Enrichment data collected for a contact from various sources.
1679
+ */
1680
+ export interface ContactEnrichmentData {
1681
+ linkedin?: {
1682
+ summary?: string
1683
+ pastExperience?: string
1684
+ education?: string
1685
+ activity?: Array<{ date?: string; content?: string }>
1686
+ }
1649
1687
  }
1650
1688
  ```
1651
1689
 
1652
1690
  ### `AcqList`
1653
1691
 
1654
1692
  ```typescript
1655
- export interface AcqList {
1656
- id: string
1657
- organizationId: string
1658
- name: string
1659
- description: string | null
1660
- batchIds: string[]
1661
- instantlyCampaignId: string | null
1662
- status: ListStatus
1663
- scrapingConfig: ScrapingConfig
1664
- icp: IcpRubric
1665
- pipelineConfig: PipelineConfig
1666
- metadata: AcqListMetadata
1667
- launchedAt: Date | null
1668
- completedAt: Date | null
1669
- createdAt: Date
1693
+ export interface AcqList {
1694
+ id: string
1695
+ organizationId: string
1696
+ name: string
1697
+ description: string | null
1698
+ batchIds: string[]
1699
+ instantlyCampaignId: string | null
1700
+ status: ListStatus
1701
+ scrapingConfig: ScrapingConfig
1702
+ icp: IcpRubric
1703
+ pipelineConfig: PipelineConfig
1704
+ metadata: AcqListMetadata
1705
+ launchedAt: Date | null
1706
+ completedAt: Date | null
1707
+ createdAt: Date
1670
1708
  }
1671
1709
  ```
1672
1710
 
1673
1711
  ### `AcqCompany`
1674
1712
 
1675
1713
  ```typescript
1676
- /**
1677
- * Company record in the acquisition database.
1678
- * Contains enriched company data from various sources.
1679
- * Transformed from AcqCompanyRow with camelCase properties.
1680
- */
1681
- export interface AcqCompany {
1682
- id: string
1683
- organizationId: string
1684
- name: string
1685
- domain: string | null
1686
- linkedinUrl: string | null
1687
- website: string | null
1688
- numEmployees: number | null
1689
- foundedYear: number | null
1690
- locationCity: string | null
1691
- locationState: string | null
1692
- category: string | null
1693
- categoryPain: string | null
1694
- segment: string | null
1695
- pipelineStatus: CompanyPipelineStatus | null
1696
- enrichmentData: CompanyEnrichmentData | null
1697
- source: string | null
1698
- batchId: string | null
1699
- status: 'active' | 'invalid'
1700
- verticalResearch: string | null
1701
- /** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
1702
- qualificationScore: number | null
1703
- /** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
1704
- qualificationSignals: Record<string, unknown> | null
1705
- /** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
1706
- qualificationRubricKey: string | null
1707
- createdAt: Date
1708
- updatedAt: Date
1714
+ /**
1715
+ * Company record in the acquisition database.
1716
+ * Contains enriched company data from various sources.
1717
+ * Transformed from AcqCompanyRow with camelCase properties.
1718
+ */
1719
+ export interface AcqCompany {
1720
+ id: string
1721
+ organizationId: string
1722
+ name: string
1723
+ domain: string | null
1724
+ linkedinUrl: string | null
1725
+ website: string | null
1726
+ numEmployees: number | null
1727
+ foundedYear: number | null
1728
+ locationCity: string | null
1729
+ locationState: string | null
1730
+ category: string | null
1731
+ categoryPain: string | null
1732
+ segment: string | null
1733
+ pipelineStatus: CompanyPipelineStatus | null
1734
+ enrichmentData: CompanyEnrichmentData | null
1735
+ source: string | null
1736
+ batchId: string | null
1737
+ status: 'active' | 'invalid'
1738
+ verticalResearch: string | null
1739
+ /** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
1740
+ qualificationScore: number | null
1741
+ /** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
1742
+ qualificationSignals: Record<string, unknown> | null
1743
+ /** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
1744
+ qualificationRubricKey: string | null
1745
+ createdAt: Date
1746
+ updatedAt: Date
1709
1747
  }
1710
1748
  ```
1711
1749
 
1712
1750
  ### `AcqContact`
1713
1751
 
1714
1752
  ```typescript
1715
- /**
1716
- * Contact record in the acquisition database.
1717
- * Contains enriched contact data and personalization content.
1718
- * Transformed from AcqContactRow with camelCase properties.
1719
- */
1720
- export interface AcqContact {
1721
- id: string
1722
- organizationId: string
1723
- companyId: string | null
1724
- email: string
1725
- emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null
1726
- firstName: string | null
1727
- lastName: string | null
1728
- linkedinUrl: string | null
1729
- title: string | null
1730
- headline: string | null
1731
- filterReason: string | null
1732
- openingLine: string | null
1733
- source: string | null
1734
- sourceId: string | null
1735
- pipelineStatus: ContactPipelineStatus | null
1736
- enrichmentData: ContactEnrichmentData | null
1737
- /** Attio Person record ID - set when contact responds and is added to CRM */
1738
- attioPersonId: string | null
1739
- batchId: string | null
1740
- status: 'active' | 'invalid'
1741
- createdAt: Date
1742
- updatedAt: Date
1753
+ /**
1754
+ * Contact record in the acquisition database.
1755
+ * Contains enriched contact data and personalization content.
1756
+ * Transformed from AcqContactRow with camelCase properties.
1757
+ */
1758
+ export interface AcqContact {
1759
+ id: string
1760
+ organizationId: string
1761
+ companyId: string | null
1762
+ email: string
1763
+ emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null
1764
+ firstName: string | null
1765
+ lastName: string | null
1766
+ linkedinUrl: string | null
1767
+ title: string | null
1768
+ headline: string | null
1769
+ filterReason: string | null
1770
+ openingLine: string | null
1771
+ source: string | null
1772
+ sourceId: string | null
1773
+ pipelineStatus: ContactPipelineStatus | null
1774
+ enrichmentData: ContactEnrichmentData | null
1775
+ /** Attio Person record ID - set when contact responds and is added to CRM */
1776
+ attioPersonId: string | null
1777
+ batchId: string | null
1778
+ status: 'active' | 'invalid'
1779
+ createdAt: Date
1780
+ updatedAt: Date
1743
1781
  }
1744
1782
  ```
1745
1783
 
1746
1784
  ### `ListTelemetry`
1747
1785
 
1748
1786
  ```typescript
1749
- /**
1750
- * Live-scan aggregate telemetry for a single list, computed on demand from
1751
- * the list junction tables and current contact deliverability state.
1752
- * `stageCounts` are attempted counts from list-row processing_state.
1753
- */
1754
- export interface ListTelemetry {
1755
- listId: string
1756
- totalCompanies: number
1757
- totalContacts: number
1758
- stageCounts: {
1759
- populated: number
1760
- extracted: number
1761
- qualified: number
1762
- discovered: number
1763
- verified: number
1764
- personalized: number
1765
- uploaded: number
1766
- }
1767
- deliverability: {
1768
- valid: number
1769
- risky: number
1770
- invalid: number
1771
- unknown: number
1772
- bounced: number
1773
- }
1774
- /** Reserved -- active workflow IDs associated with this list. */
1775
- activeWorkflows?: string[]
1787
+ /**
1788
+ * Live-scan aggregate telemetry for a single list, computed on demand from
1789
+ * the list junction tables and current contact deliverability state.
1790
+ * `stageCounts` are attempted counts from list-row processing_state.
1791
+ */
1792
+ export interface ListTelemetry {
1793
+ listId: string
1794
+ totalCompanies: number
1795
+ totalContacts: number
1796
+ stageCounts: {
1797
+ populated: number
1798
+ extracted: number
1799
+ qualified: number
1800
+ discovered: number
1801
+ verified: number
1802
+ personalized: number
1803
+ uploaded: number
1804
+ }
1805
+ deliverability: {
1806
+ valid: number
1807
+ risky: number
1808
+ invalid: number
1809
+ unknown: number
1810
+ bounced: number
1811
+ }
1812
+ /** Reserved -- active workflow IDs associated with this list. */
1813
+ activeWorkflows?: string[]
1776
1814
  }
1777
1815
  ```
1778
1816
 
1779
1817
  ### `ListStageCountsSchema`
1780
1818
 
1781
1819
  ```typescript
1782
- export const ListStageCountsSchema = z.object({
1783
- // Attempted counts by canonical lead-gen stage. The detailed status
1784
- // distribution lives on ListProgress; telemetry keeps the overview payload small.
1785
- stageCounts: z.object({
1786
- populated: z.number().int(),
1787
- extracted: z.number().int(),
1788
- qualified: z.number().int(),
1789
- discovered: z.number().int(),
1790
- verified: z.number().int(),
1791
- personalized: z.number().int(),
1792
- uploaded: z.number().int()
1793
- }),
1794
- deliverability: z.object({
1795
- valid: z.number().int(),
1796
- risky: z.number().int(),
1797
- invalid: z.number().int(),
1798
- unknown: z.number().int(),
1799
- bounced: z.number().int()
1800
- })
1820
+ export const ListStageCountsSchema = z.object({
1821
+ // Attempted counts by canonical lead-gen stage. The detailed status
1822
+ // distribution lives on ListProgress; telemetry keeps the overview payload small.
1823
+ stageCounts: z.object({
1824
+ populated: z.number().int(),
1825
+ extracted: z.number().int(),
1826
+ qualified: z.number().int(),
1827
+ discovered: z.number().int(),
1828
+ verified: z.number().int(),
1829
+ personalized: z.number().int(),
1830
+ uploaded: z.number().int()
1831
+ }),
1832
+ deliverability: z.object({
1833
+ valid: z.number().int(),
1834
+ risky: z.number().int(),
1835
+ invalid: z.number().int(),
1836
+ unknown: z.number().int(),
1837
+ bounced: z.number().int()
1838
+ })
1801
1839
  })
1802
1840
  ```
1803
1841
 
1804
1842
  ### `ListTelemetrySchema`
1805
1843
 
1806
1844
  ```typescript
1807
- export const ListTelemetrySchema = z.object({
1808
- listId: UuidSchema,
1809
- totalCompanies: z.number().int(),
1810
- totalContacts: z.number().int(),
1811
- stageCounts: ListStageCountsSchema.shape.stageCounts,
1812
- deliverability: ListStageCountsSchema.shape.deliverability,
1813
- activeWorkflows: z.array(z.string()).optional()
1845
+ export const ListTelemetrySchema = z.object({
1846
+ listId: UuidSchema,
1847
+ totalCompanies: z.number().int(),
1848
+ totalContacts: z.number().int(),
1849
+ stageCounts: ListStageCountsSchema.shape.stageCounts,
1850
+ deliverability: ListStageCountsSchema.shape.deliverability,
1851
+ activeWorkflows: z.array(z.string()).optional()
1814
1852
  })
1815
1853
  ```
1816
1854
 
1817
1855
  ### `ListIdParamsSchema`
1818
1856
 
1819
1857
  ```typescript
1820
- export const ListIdParamsSchema = z.object({
1821
- listId: UuidSchema
1858
+ export const ListIdParamsSchema = z.object({
1859
+ listId: UuidSchema
1822
1860
  })
1823
1861
  ```
1824
1862
 
1825
1863
  ### `CreateListRequestSchema`
1826
1864
 
1827
1865
  ```typescript
1828
- export const CreateListRequestSchema = z
1829
- .object({
1830
- name: z.string().trim().min(1).max(255),
1831
- description: z.string().trim().nullable().optional(),
1832
- status: ListStatusSchema.optional(),
1833
- buildTemplateId: ProspectingBuildTemplateIdSchema.optional(),
1834
- scrapingConfig: ScrapingConfigSchema.optional(),
1835
- icp: IcpRubricSchema.optional(),
1836
- pipelineConfig: PipelineConfigSchema.optional()
1837
- })
1866
+ export const CreateListRequestSchema = z
1867
+ .object({
1868
+ name: z.string().trim().min(1).max(255),
1869
+ description: z.string().trim().nullable().optional(),
1870
+ status: ListStatusSchema.optional(),
1871
+ buildTemplateId: ProspectingBuildTemplateIdSchema.optional(),
1872
+ scrapingConfig: ScrapingConfigSchema.optional(),
1873
+ icp: IcpRubricSchema.optional(),
1874
+ pipelineConfig: PipelineConfigSchema.optional()
1875
+ })
1838
1876
  .strict()
1839
1877
  ```
1840
1878
 
1841
1879
  ### `UpdateListRequestSchema`
1842
1880
 
1843
1881
  ```typescript
1844
- export const UpdateListRequestSchema = z
1845
- .object({
1846
- name: z.string().trim().min(1).max(255).optional(),
1847
- description: z.string().trim().nullable().optional(),
1848
- batchIds: z.array(z.string()).optional(),
1849
- buildTemplateId: ProspectingBuildTemplateIdSchema.optional(),
1850
- confirmBuildTemplateChange: z.literal(true).optional()
1851
- })
1852
- .strict()
1853
- .refine(
1854
- (data) =>
1855
- data.name !== undefined ||
1856
- data.description !== undefined ||
1857
- data.batchIds !== undefined ||
1858
- data.buildTemplateId !== undefined,
1859
- {
1860
- message: 'At least one field (name, description, batchIds, or buildTemplateId) must be provided'
1861
- }
1862
- )
1863
- .refine((data) => data.buildTemplateId === undefined || data.confirmBuildTemplateChange === true, {
1864
- message: 'confirmBuildTemplateChange must be true when changing buildTemplateId',
1865
- path: ['confirmBuildTemplateChange']
1882
+ export const UpdateListRequestSchema = z
1883
+ .object({
1884
+ name: z.string().trim().min(1).max(255).optional(),
1885
+ description: z.string().trim().nullable().optional(),
1886
+ batchIds: z.array(z.string()).optional(),
1887
+ buildTemplateId: ProspectingBuildTemplateIdSchema.optional(),
1888
+ confirmBuildTemplateChange: z.literal(true).optional()
1889
+ })
1890
+ .strict()
1891
+ .refine(
1892
+ (data) =>
1893
+ data.name !== undefined ||
1894
+ data.description !== undefined ||
1895
+ data.batchIds !== undefined ||
1896
+ data.buildTemplateId !== undefined,
1897
+ {
1898
+ message: 'At least one field (name, description, batchIds, or buildTemplateId) must be provided'
1899
+ }
1900
+ )
1901
+ .refine((data) => data.buildTemplateId === undefined || data.confirmBuildTemplateChange === true, {
1902
+ message: 'confirmBuildTemplateChange must be true when changing buildTemplateId',
1903
+ path: ['confirmBuildTemplateChange']
1866
1904
  })
1867
1905
  ```
1868
1906
 
1869
1907
  ### `UpdateListConfigRequestSchema`
1870
1908
 
1871
1909
  ```typescript
1872
- /**
1873
- * Partial patch for the three jsonb config columns. UI sends only the edited
1874
- * subtree; server writes the field as-is (no deep merge — each column is
1875
- * replaced atomically when present in the patch).
1876
- */
1877
- export const UpdateListConfigRequestSchema = z
1878
- .object({
1879
- scrapingConfig: ScrapingConfigSchema.partial().optional(),
1880
- icp: IcpRubricSchema.partial().optional(),
1881
- pipelineConfig: PipelineConfigSchema.partial().optional()
1882
- })
1883
- .strict()
1884
- .refine((data) => data.scrapingConfig !== undefined || data.icp !== undefined || data.pipelineConfig !== undefined, {
1885
- message: 'At least one of scrapingConfig, icp, or pipelineConfig must be provided'
1910
+ /**
1911
+ * Partial patch for the three jsonb config columns. UI sends only the edited
1912
+ * subtree; server writes the field as-is (no deep merge — each column is
1913
+ * replaced atomically when present in the patch).
1914
+ */
1915
+ export const UpdateListConfigRequestSchema = z
1916
+ .object({
1917
+ scrapingConfig: ScrapingConfigSchema.partial().optional(),
1918
+ icp: IcpRubricSchema.partial().optional(),
1919
+ pipelineConfig: PipelineConfigSchema.partial().optional()
1920
+ })
1921
+ .strict()
1922
+ .refine((data) => data.scrapingConfig !== undefined || data.icp !== undefined || data.pipelineConfig !== undefined, {
1923
+ message: 'At least one of scrapingConfig, icp, or pipelineConfig must be provided'
1886
1924
  })
1887
1925
  ```
1888
1926
 
1889
1927
  ### `AddCompaniesToListRequestSchema`
1890
1928
 
1891
1929
  ```typescript
1892
- export const AddCompaniesToListRequestSchema = z
1893
- .object({
1894
- companyIds: z.array(UuidSchema).min(1).max(1000)
1895
- })
1930
+ export const AddCompaniesToListRequestSchema = z
1931
+ .object({
1932
+ companyIds: z.array(UuidSchema).min(1).max(1000)
1933
+ })
1896
1934
  .strict()
1897
1935
  ```
1898
1936
 
1899
1937
  ### `RemoveCompaniesFromListRequestSchema`
1900
1938
 
1901
1939
  ```typescript
1902
- export const RemoveCompaniesFromListRequestSchema = z
1903
- .object({
1904
- companyIds: z.array(UuidSchema).min(1).max(1000)
1905
- })
1940
+ export const RemoveCompaniesFromListRequestSchema = z
1941
+ .object({
1942
+ companyIds: z.array(UuidSchema).min(1).max(1000)
1943
+ })
1906
1944
  .strict()
1907
1945
  ```
1908
1946
 
1909
1947
  ### `AddContactsToListRequestSchema`
1910
1948
 
1911
1949
  ```typescript
1912
- export const AddContactsToListRequestSchema = z
1913
- .object({
1914
- contactIds: z.array(UuidSchema).min(1).max(1000)
1915
- })
1950
+ export const AddContactsToListRequestSchema = z
1951
+ .object({
1952
+ contactIds: z.array(UuidSchema).min(1).max(1000)
1953
+ })
1916
1954
  .strict()
1917
1955
  ```
1918
1956
 
1919
1957
  ### `RecordListExecutionRequestSchema`
1920
1958
 
1921
1959
  ```typescript
1922
- export const RecordListExecutionRequestSchema = z
1923
- .object({
1924
- executionId: UuidSchema,
1925
- configSnapshot: z.record(z.string(), z.unknown()).optional()
1926
- })
1960
+ export const RecordListExecutionRequestSchema = z
1961
+ .object({
1962
+ executionId: UuidSchema,
1963
+ configSnapshot: z.record(z.string(), z.unknown()).optional()
1964
+ })
1927
1965
  .strict()
1928
1966
  ```
1929
1967
 
1930
1968
  ### `AcqListResponseSchema`
1931
1969
 
1932
1970
  ```typescript
1933
- /**
1934
- * Single list as returned by /api/acquisition/lists/:id etc.
1935
- * Camel-cased domain shape matching AcqList in types.ts.
1936
- */
1937
- export const AcqListResponseSchema = z.object({
1938
- id: z.string(),
1939
- organizationId: z.string(),
1940
- name: z.string(),
1941
- description: z.string().nullable(),
1942
- batchIds: z.array(z.string()),
1943
- instantlyCampaignId: z.string().nullable(),
1944
- /** Lifecycle status (draft | enriching | launched | closing | archived). */
1945
- status: ListStatusSchema,
1946
- metadata: AcqListMetadataSchema,
1947
- launchedAt: z.string().nullable(),
1948
- completedAt: z.string().nullable(),
1949
- createdAt: z.string(),
1950
- /** Scraping criteria stored as jsonb on the row. */
1951
- scrapingConfig: ScrapingConfigSchema,
1952
- /** ICP / qualification rubric stored as jsonb on the row. */
1953
- icp: IcpRubricSchema,
1954
- /** Pipeline presentation contract stored as jsonb on the row. */
1955
- pipelineConfig: PipelineConfigSchema
1971
+ /**
1972
+ * Single list as returned by /api/acquisition/lists/:id etc.
1973
+ * Camel-cased domain shape matching AcqList in types.ts.
1974
+ */
1975
+ export const AcqListResponseSchema = z.object({
1976
+ id: z.string(),
1977
+ organizationId: z.string(),
1978
+ name: z.string(),
1979
+ description: z.string().nullable(),
1980
+ batchIds: z.array(z.string()),
1981
+ instantlyCampaignId: z.string().nullable(),
1982
+ /** Lifecycle status (draft | enriching | launched | closing | archived). */
1983
+ status: ListStatusSchema,
1984
+ metadata: AcqListMetadataSchema,
1985
+ launchedAt: z.string().nullable(),
1986
+ completedAt: z.string().nullable(),
1987
+ createdAt: z.string(),
1988
+ /** Scraping criteria stored as jsonb on the row. */
1989
+ scrapingConfig: ScrapingConfigSchema,
1990
+ /** ICP / qualification rubric stored as jsonb on the row. */
1991
+ icp: IcpRubricSchema,
1992
+ /** Pipeline presentation contract stored as jsonb on the row. */
1993
+ pipelineConfig: PipelineConfigSchema
1956
1994
  })
1957
1995
  ```
1958
1996
 
@@ -1977,17 +2015,18 @@ export const ListTelemetryListResponseSchema = z.array(ListTelemetrySchema)
1977
2015
  ### `ListExecutionSummarySchema`
1978
2016
 
1979
2017
  ```typescript
1980
- /**
1981
- * Row from acq_list_executions joined with the execution summary,
1982
- * shaped for the /lists/:id/executions response.
1983
- */
1984
- export const ListExecutionSummarySchema = z.object({
1985
- executionId: z.string(),
1986
- resourceId: z.string(),
1987
- status: z.string(),
1988
- createdAt: z.string(),
1989
- completedAt: z.string().nullable(),
1990
- durationMs: z.number().int().nullable()
2018
+ /**
2019
+ * Row from acq_list_executions joined with the execution summary,
2020
+ * shaped for the /lists/:id/executions response.
2021
+ */
2022
+ export const ListExecutionSummarySchema = z.object({
2023
+ executionId: z.string(),
2024
+ resourceId: z.string(),
2025
+ status: z.string(),
2026
+ createdAt: z.string(),
2027
+ completedAt: z.string().nullable(),
2028
+ durationMs: z.number().int().nullable(),
2029
+ input: z.unknown().nullable().optional()
1991
2030
  })
1992
2031
  ```
1993
2032
 
@@ -2018,282 +2057,282 @@ export const AcqEmailValidSchema = z.enum(['VALID', 'INVALID', 'RISKY', 'UNKNOWN
2018
2057
  ### `CompanyIdParamsSchema`
2019
2058
 
2020
2059
  ```typescript
2021
- export const CompanyIdParamsSchema = z.object({
2022
- companyId: UuidSchema
2060
+ export const CompanyIdParamsSchema = z.object({
2061
+ companyId: UuidSchema
2023
2062
  })
2024
2063
  ```
2025
2064
 
2026
2065
  ### `ContactIdParamsSchema`
2027
2066
 
2028
2067
  ```typescript
2029
- export const ContactIdParamsSchema = z.object({
2030
- contactId: UuidSchema
2068
+ export const ContactIdParamsSchema = z.object({
2069
+ contactId: UuidSchema
2031
2070
  })
2032
2071
  ```
2033
2072
 
2034
2073
  ### `ListCompaniesQuerySchema`
2035
2074
 
2036
2075
  ```typescript
2037
- export const ListCompaniesQuerySchema = z
2038
- .object({
2039
- search: z.string().trim().min(1).max(200).optional(),
2040
- listId: UuidSchema.optional(),
2041
- domain: z.string().trim().min(1).max(255).optional(),
2042
- website: z.string().trim().min(1).max(2048).optional(),
2043
- segment: z.string().trim().min(1).max(255).optional(),
2044
- category: z.string().trim().min(1).max(255).optional(),
2045
- batchId: z.string().trim().min(1).max(255).optional(),
2046
- status: AcqCompanyStatusSchema.optional(),
2047
- includeAll: QueryBooleanSchema.optional(),
2048
- limit: z.coerce.number().int().min(1).max(5000).default(50),
2049
- offset: z.coerce.number().int().min(0).default(0)
2050
- })
2076
+ export const ListCompaniesQuerySchema = z
2077
+ .object({
2078
+ search: z.string().trim().min(1).max(200).optional(),
2079
+ listId: UuidSchema.optional(),
2080
+ domain: z.string().trim().min(1).max(255).optional(),
2081
+ website: z.string().trim().min(1).max(2048).optional(),
2082
+ segment: z.string().trim().min(1).max(255).optional(),
2083
+ category: z.string().trim().min(1).max(255).optional(),
2084
+ batchId: z.string().trim().min(1).max(255).optional(),
2085
+ status: AcqCompanyStatusSchema.optional(),
2086
+ includeAll: QueryBooleanSchema.optional(),
2087
+ limit: z.coerce.number().int().min(1).max(5000).default(50),
2088
+ offset: z.coerce.number().int().min(0).default(0)
2089
+ })
2051
2090
  .strict()
2052
2091
  ```
2053
2092
 
2054
2093
  ### `ListContactsQuerySchema`
2055
2094
 
2056
2095
  ```typescript
2057
- export const ListContactsQuerySchema = z
2058
- .object({
2059
- search: z.string().trim().min(1).max(200).optional(),
2060
- listId: UuidSchema.optional(),
2061
- openingLineIsNull: QueryBooleanSchema.optional(),
2062
- batchId: z.string().trim().min(1).max(255).optional(),
2063
- contactStatus: AcqContactStatusSchema.optional(),
2064
- limit: z.coerce.number().int().min(1).max(5000).default(5000),
2065
- offset: z.coerce.number().int().min(0).default(0)
2066
- })
2096
+ export const ListContactsQuerySchema = z
2097
+ .object({
2098
+ search: z.string().trim().min(1).max(200).optional(),
2099
+ listId: UuidSchema.optional(),
2100
+ openingLineIsNull: QueryBooleanSchema.optional(),
2101
+ batchId: z.string().trim().min(1).max(255).optional(),
2102
+ contactStatus: AcqContactStatusSchema.optional(),
2103
+ limit: z.coerce.number().int().min(1).max(5000).default(5000),
2104
+ offset: z.coerce.number().int().min(0).default(0)
2105
+ })
2067
2106
  .strict()
2068
2107
  ```
2069
2108
 
2070
2109
  ### `CreateCompanyRequestSchema`
2071
2110
 
2072
2111
  ```typescript
2073
- export const CreateCompanyRequestSchema = z
2074
- .object({
2075
- name: z.string().trim().min(1).max(255),
2076
- domain: z.string().trim().min(1).max(255).optional(),
2077
- linkedinUrl: z.string().trim().url().optional(),
2078
- website: z.string().trim().url().optional(),
2079
- numEmployees: z.number().int().min(0).optional(),
2080
- foundedYear: z.number().int().optional(),
2081
- locationCity: z.string().trim().min(1).max(255).optional(),
2082
- locationState: z.string().trim().min(1).max(255).optional(),
2083
- category: z.string().trim().min(1).max(255).optional(),
2084
- source: z.string().trim().min(1).max(255).optional(),
2085
- batchId: z.string().trim().min(1).max(255).optional(),
2086
- verticalResearch: z.string().trim().min(1).max(5000).optional()
2087
- })
2112
+ export const CreateCompanyRequestSchema = z
2113
+ .object({
2114
+ name: z.string().trim().min(1).max(255),
2115
+ domain: z.string().trim().min(1).max(255).optional(),
2116
+ linkedinUrl: z.string().trim().url().optional(),
2117
+ website: z.string().trim().url().optional(),
2118
+ numEmployees: z.number().int().min(0).optional(),
2119
+ foundedYear: z.number().int().optional(),
2120
+ locationCity: z.string().trim().min(1).max(255).optional(),
2121
+ locationState: z.string().trim().min(1).max(255).optional(),
2122
+ category: z.string().trim().min(1).max(255).optional(),
2123
+ source: z.string().trim().min(1).max(255).optional(),
2124
+ batchId: z.string().trim().min(1).max(255).optional(),
2125
+ verticalResearch: z.string().trim().min(1).max(5000).optional()
2126
+ })
2088
2127
  .strict()
2089
2128
  ```
2090
2129
 
2091
2130
  ### `UpdateCompanyRequestSchema`
2092
2131
 
2093
2132
  ```typescript
2094
- export const UpdateCompanyRequestSchema = z
2095
- .object({
2096
- name: z.string().trim().min(1).max(255).optional(),
2097
- domain: z.string().trim().min(1).max(255).optional(),
2098
- linkedinUrl: z.string().trim().url().optional(),
2099
- website: z.string().trim().url().optional(),
2100
- numEmployees: z.number().int().min(0).optional(),
2101
- foundedYear: z.number().int().optional(),
2102
- locationCity: z.string().trim().min(1).max(255).optional(),
2103
- locationState: z.string().trim().min(1).max(255).optional(),
2104
- category: z.string().trim().min(1).max(255).optional(),
2105
- segment: z.string().trim().min(1).max(255).optional(),
2106
- pipelineStatus: z.record(z.string(), z.unknown()).optional(),
2107
- enrichmentData: z.record(z.string(), z.unknown()).optional(),
2108
- source: z.string().trim().min(1).max(255).optional(),
2109
- batchId: z.string().trim().min(1).max(255).optional(),
2110
- status: AcqCompanyStatusSchema.optional(),
2111
- verticalResearch: z.string().trim().min(1).max(5000).nullable().optional()
2112
- })
2113
- .strict()
2114
- .refine(
2115
- (data) =>
2116
- data.name !== undefined ||
2117
- data.domain !== undefined ||
2118
- data.linkedinUrl !== undefined ||
2119
- data.website !== undefined ||
2120
- data.numEmployees !== undefined ||
2121
- data.foundedYear !== undefined ||
2122
- data.locationCity !== undefined ||
2123
- data.locationState !== undefined ||
2124
- data.category !== undefined ||
2125
- data.segment !== undefined ||
2126
- data.pipelineStatus !== undefined ||
2127
- data.enrichmentData !== undefined ||
2128
- data.source !== undefined ||
2129
- data.batchId !== undefined ||
2130
- data.status !== undefined ||
2131
- data.verticalResearch !== undefined,
2132
- {
2133
- message: 'At least one field must be provided'
2134
- }
2133
+ export const UpdateCompanyRequestSchema = z
2134
+ .object({
2135
+ name: z.string().trim().min(1).max(255).optional(),
2136
+ domain: z.string().trim().min(1).max(255).optional(),
2137
+ linkedinUrl: z.string().trim().url().optional(),
2138
+ website: z.string().trim().url().optional(),
2139
+ numEmployees: z.number().int().min(0).optional(),
2140
+ foundedYear: z.number().int().optional(),
2141
+ locationCity: z.string().trim().min(1).max(255).optional(),
2142
+ locationState: z.string().trim().min(1).max(255).optional(),
2143
+ category: z.string().trim().min(1).max(255).optional(),
2144
+ segment: z.string().trim().min(1).max(255).optional(),
2145
+ pipelineStatus: z.record(z.string(), z.unknown()).optional(),
2146
+ enrichmentData: z.record(z.string(), z.unknown()).optional(),
2147
+ source: z.string().trim().min(1).max(255).optional(),
2148
+ batchId: z.string().trim().min(1).max(255).optional(),
2149
+ status: AcqCompanyStatusSchema.optional(),
2150
+ verticalResearch: z.string().trim().min(1).max(5000).nullable().optional()
2151
+ })
2152
+ .strict()
2153
+ .refine(
2154
+ (data) =>
2155
+ data.name !== undefined ||
2156
+ data.domain !== undefined ||
2157
+ data.linkedinUrl !== undefined ||
2158
+ data.website !== undefined ||
2159
+ data.numEmployees !== undefined ||
2160
+ data.foundedYear !== undefined ||
2161
+ data.locationCity !== undefined ||
2162
+ data.locationState !== undefined ||
2163
+ data.category !== undefined ||
2164
+ data.segment !== undefined ||
2165
+ data.pipelineStatus !== undefined ||
2166
+ data.enrichmentData !== undefined ||
2167
+ data.source !== undefined ||
2168
+ data.batchId !== undefined ||
2169
+ data.status !== undefined ||
2170
+ data.verticalResearch !== undefined,
2171
+ {
2172
+ message: 'At least one field must be provided'
2173
+ }
2135
2174
  )
2136
2175
  ```
2137
2176
 
2138
2177
  ### `CreateContactRequestSchema`
2139
2178
 
2140
2179
  ```typescript
2141
- export const CreateContactRequestSchema = z
2142
- .object({
2143
- email: z.string().trim().email(),
2144
- companyId: UuidSchema.optional(),
2145
- firstName: z.string().trim().min(1).max(255).optional(),
2146
- lastName: z.string().trim().min(1).max(255).optional(),
2147
- linkedinUrl: z.string().trim().url().optional(),
2148
- title: z.string().trim().min(1).max(255).optional(),
2149
- source: z.string().trim().min(1).max(255).optional(),
2150
- sourceId: z.string().trim().min(1).max(255).optional(),
2151
- batchId: z.string().trim().min(1).max(255).optional()
2152
- })
2180
+ export const CreateContactRequestSchema = z
2181
+ .object({
2182
+ email: z.string().trim().email(),
2183
+ companyId: UuidSchema.optional(),
2184
+ firstName: z.string().trim().min(1).max(255).optional(),
2185
+ lastName: z.string().trim().min(1).max(255).optional(),
2186
+ linkedinUrl: z.string().trim().url().optional(),
2187
+ title: z.string().trim().min(1).max(255).optional(),
2188
+ source: z.string().trim().min(1).max(255).optional(),
2189
+ sourceId: z.string().trim().min(1).max(255).optional(),
2190
+ batchId: z.string().trim().min(1).max(255).optional()
2191
+ })
2153
2192
  .strict()
2154
2193
  ```
2155
2194
 
2156
2195
  ### `UpdateContactRequestSchema`
2157
2196
 
2158
2197
  ```typescript
2159
- export const UpdateContactRequestSchema = z
2160
- .object({
2161
- companyId: UuidSchema.optional(),
2162
- emailValid: AcqEmailValidSchema.optional(),
2163
- firstName: z.string().trim().min(1).max(255).optional(),
2164
- lastName: z.string().trim().min(1).max(255).optional(),
2165
- linkedinUrl: z.string().trim().url().optional(),
2166
- title: z.string().trim().min(1).max(255).optional(),
2167
- headline: z.string().trim().min(1).max(5000).optional(),
2168
- filterReason: z.string().trim().min(1).max(5000).optional(),
2169
- openingLine: z.string().trim().min(1).max(5000).optional(),
2170
- pipelineStatus: z.record(z.string(), z.unknown()).optional(),
2171
- enrichmentData: z.record(z.string(), z.unknown()).optional(),
2172
- status: AcqContactStatusSchema.optional()
2173
- })
2174
- .strict()
2175
- .refine(
2176
- (data) =>
2177
- data.companyId !== undefined ||
2178
- data.emailValid !== undefined ||
2179
- data.firstName !== undefined ||
2180
- data.lastName !== undefined ||
2181
- data.linkedinUrl !== undefined ||
2182
- data.title !== undefined ||
2183
- data.headline !== undefined ||
2184
- data.filterReason !== undefined ||
2185
- data.openingLine !== undefined ||
2186
- data.pipelineStatus !== undefined ||
2187
- data.enrichmentData !== undefined ||
2188
- data.status !== undefined,
2189
- {
2190
- message: 'At least one field must be provided'
2191
- }
2198
+ export const UpdateContactRequestSchema = z
2199
+ .object({
2200
+ companyId: UuidSchema.optional(),
2201
+ emailValid: AcqEmailValidSchema.optional(),
2202
+ firstName: z.string().trim().min(1).max(255).optional(),
2203
+ lastName: z.string().trim().min(1).max(255).optional(),
2204
+ linkedinUrl: z.string().trim().url().optional(),
2205
+ title: z.string().trim().min(1).max(255).optional(),
2206
+ headline: z.string().trim().min(1).max(5000).optional(),
2207
+ filterReason: z.string().trim().min(1).max(5000).optional(),
2208
+ openingLine: z.string().trim().min(1).max(5000).optional(),
2209
+ pipelineStatus: z.record(z.string(), z.unknown()).optional(),
2210
+ enrichmentData: z.record(z.string(), z.unknown()).optional(),
2211
+ status: AcqContactStatusSchema.optional()
2212
+ })
2213
+ .strict()
2214
+ .refine(
2215
+ (data) =>
2216
+ data.companyId !== undefined ||
2217
+ data.emailValid !== undefined ||
2218
+ data.firstName !== undefined ||
2219
+ data.lastName !== undefined ||
2220
+ data.linkedinUrl !== undefined ||
2221
+ data.title !== undefined ||
2222
+ data.headline !== undefined ||
2223
+ data.filterReason !== undefined ||
2224
+ data.openingLine !== undefined ||
2225
+ data.pipelineStatus !== undefined ||
2226
+ data.enrichmentData !== undefined ||
2227
+ data.status !== undefined,
2228
+ {
2229
+ message: 'At least one field must be provided'
2230
+ }
2192
2231
  )
2193
2232
  ```
2194
2233
 
2195
2234
  ### `AcqCompanyResponseSchema`
2196
2235
 
2197
2236
  ```typescript
2198
- export const AcqCompanyResponseSchema = z.object({
2199
- id: z.string(),
2200
- organizationId: z.string(),
2201
- name: z.string(),
2202
- domain: z.string().nullable(),
2203
- linkedinUrl: z.string().nullable(),
2204
- website: z.string().nullable(),
2205
- numEmployees: z.number().nullable(),
2206
- foundedYear: z.number().nullable(),
2207
- locationCity: z.string().nullable(),
2208
- locationState: z.string().nullable(),
2209
- category: z.string().nullable(),
2210
- categoryPain: z.string().nullable(),
2211
- segment: z.string().nullable(),
2212
- pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
2213
- enrichmentData: z.record(z.string(), z.unknown()).nullable(),
2214
- source: z.string().nullable(),
2215
- batchId: z.string().nullable(),
2216
- status: AcqCompanyStatusSchema,
2217
- contactCount: z.number().int().min(0),
2218
- verticalResearch: z.string().nullable(),
2219
- createdAt: z.string(),
2220
- updatedAt: z.string()
2237
+ export const AcqCompanyResponseSchema = z.object({
2238
+ id: z.string(),
2239
+ organizationId: z.string(),
2240
+ name: z.string(),
2241
+ domain: z.string().nullable(),
2242
+ linkedinUrl: z.string().nullable(),
2243
+ website: z.string().nullable(),
2244
+ numEmployees: z.number().nullable(),
2245
+ foundedYear: z.number().nullable(),
2246
+ locationCity: z.string().nullable(),
2247
+ locationState: z.string().nullable(),
2248
+ category: z.string().nullable(),
2249
+ categoryPain: z.string().nullable(),
2250
+ segment: z.string().nullable(),
2251
+ pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
2252
+ enrichmentData: z.record(z.string(), z.unknown()).nullable(),
2253
+ source: z.string().nullable(),
2254
+ batchId: z.string().nullable(),
2255
+ status: AcqCompanyStatusSchema,
2256
+ contactCount: z.number().int().min(0),
2257
+ verticalResearch: z.string().nullable(),
2258
+ createdAt: z.string(),
2259
+ updatedAt: z.string()
2221
2260
  })
2222
2261
  ```
2223
2262
 
2224
2263
  ### `AcqCompanyListResponseSchema`
2225
2264
 
2226
2265
  ```typescript
2227
- export const AcqCompanyListResponseSchema = z.object({
2228
- data: z.array(AcqCompanyResponseSchema),
2229
- total: z.number().int(),
2230
- limit: z.number().int(),
2231
- offset: z.number().int()
2266
+ export const AcqCompanyListResponseSchema = z.object({
2267
+ data: z.array(AcqCompanyResponseSchema),
2268
+ total: z.number().int(),
2269
+ limit: z.number().int(),
2270
+ offset: z.number().int()
2232
2271
  })
2233
2272
  ```
2234
2273
 
2235
2274
  ### `AcqCompanyFacetsResponseSchema`
2236
2275
 
2237
2276
  ```typescript
2238
- export const AcqCompanyFacetsResponseSchema = z.object({
2239
- segments: z.array(z.string()),
2240
- categories: z.array(z.string()),
2241
- statuses: z.array(AcqCompanyStatusSchema)
2277
+ export const AcqCompanyFacetsResponseSchema = z.object({
2278
+ segments: z.array(z.string()),
2279
+ categories: z.array(z.string()),
2280
+ statuses: z.array(AcqCompanyStatusSchema)
2242
2281
  })
2243
2282
  ```
2244
2283
 
2245
2284
  ### `AcqContactCompanySummarySchema`
2246
2285
 
2247
2286
  ```typescript
2248
- export const AcqContactCompanySummarySchema = z.object({
2249
- id: z.string(),
2250
- name: z.string(),
2251
- domain: z.string().nullable(),
2252
- website: z.string().nullable(),
2253
- linkedinUrl: z.string().nullable(),
2254
- segment: z.string().nullable(),
2255
- category: z.string().nullable(),
2256
- status: AcqCompanyStatusSchema
2287
+ export const AcqContactCompanySummarySchema = z.object({
2288
+ id: z.string(),
2289
+ name: z.string(),
2290
+ domain: z.string().nullable(),
2291
+ website: z.string().nullable(),
2292
+ linkedinUrl: z.string().nullable(),
2293
+ segment: z.string().nullable(),
2294
+ category: z.string().nullable(),
2295
+ status: AcqCompanyStatusSchema
2257
2296
  })
2258
2297
  ```
2259
2298
 
2260
2299
  ### `AcqContactResponseSchema`
2261
2300
 
2262
2301
  ```typescript
2263
- export const AcqContactResponseSchema = z.object({
2264
- id: z.string(),
2265
- organizationId: z.string(),
2266
- companyId: z.string().nullable(),
2267
- email: z.string(),
2268
- emailValid: AcqEmailValidSchema.nullable(),
2269
- firstName: z.string().nullable(),
2270
- lastName: z.string().nullable(),
2271
- linkedinUrl: z.string().nullable(),
2272
- title: z.string().nullable(),
2273
- headline: z.string().nullable(),
2274
- filterReason: z.string().nullable(),
2275
- openingLine: z.string().nullable(),
2276
- source: z.string().nullable(),
2277
- sourceId: z.string().nullable(),
2278
- pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
2279
- enrichmentData: z.record(z.string(), z.unknown()).nullable(),
2280
- attioPersonId: z.string().nullable(),
2281
- batchId: z.string().nullable(),
2282
- status: AcqContactStatusSchema,
2283
- company: AcqContactCompanySummarySchema.nullable().optional(),
2284
- createdAt: z.string(),
2285
- updatedAt: z.string()
2302
+ export const AcqContactResponseSchema = z.object({
2303
+ id: z.string(),
2304
+ organizationId: z.string(),
2305
+ companyId: z.string().nullable(),
2306
+ email: z.string(),
2307
+ emailValid: AcqEmailValidSchema.nullable(),
2308
+ firstName: z.string().nullable(),
2309
+ lastName: z.string().nullable(),
2310
+ linkedinUrl: z.string().nullable(),
2311
+ title: z.string().nullable(),
2312
+ headline: z.string().nullable(),
2313
+ filterReason: z.string().nullable(),
2314
+ openingLine: z.string().nullable(),
2315
+ source: z.string().nullable(),
2316
+ sourceId: z.string().nullable(),
2317
+ pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
2318
+ enrichmentData: z.record(z.string(), z.unknown()).nullable(),
2319
+ attioPersonId: z.string().nullable(),
2320
+ batchId: z.string().nullable(),
2321
+ status: AcqContactStatusSchema,
2322
+ company: AcqContactCompanySummarySchema.nullable().optional(),
2323
+ createdAt: z.string(),
2324
+ updatedAt: z.string()
2286
2325
  })
2287
2326
  ```
2288
2327
 
2289
2328
  ### `AcqContactListResponseSchema`
2290
2329
 
2291
2330
  ```typescript
2292
- export const AcqContactListResponseSchema = z.object({
2293
- data: z.array(AcqContactResponseSchema),
2294
- total: z.number().int(),
2295
- limit: z.number().int(),
2296
- offset: z.number().int()
2331
+ export const AcqContactListResponseSchema = z.object({
2332
+ data: z.array(AcqContactResponseSchema),
2333
+ total: z.number().int(),
2334
+ limit: z.number().int(),
2335
+ offset: z.number().int()
2297
2336
  })
2298
2337
  ```
2299
2338
 
@@ -2306,226 +2345,226 @@ export const AcqArtifactOwnerKindSchema = z.enum(['company', 'contact', 'deal',
2306
2345
  ### `ListArtifactsQuerySchema`
2307
2346
 
2308
2347
  ```typescript
2309
- export const ListArtifactsQuerySchema = z
2310
- .object({
2311
- ownerKind: AcqArtifactOwnerKindSchema,
2312
- ownerId: UuidSchema
2313
- })
2348
+ export const ListArtifactsQuerySchema = z
2349
+ .object({
2350
+ ownerKind: AcqArtifactOwnerKindSchema,
2351
+ ownerId: UuidSchema
2352
+ })
2314
2353
  .strict()
2315
2354
  ```
2316
2355
 
2317
2356
  ### `CreateArtifactRequestSchema`
2318
2357
 
2319
2358
  ```typescript
2320
- export const CreateArtifactRequestSchema = z
2321
- .object({
2322
- ownerKind: AcqArtifactOwnerKindSchema,
2323
- ownerId: UuidSchema,
2324
- kind: z.string().trim().min(1).max(255),
2325
- content: z.record(z.string(), z.unknown()),
2326
- sourceExecutionId: UuidSchema.optional()
2327
- })
2359
+ export const CreateArtifactRequestSchema = z
2360
+ .object({
2361
+ ownerKind: AcqArtifactOwnerKindSchema,
2362
+ ownerId: UuidSchema,
2363
+ kind: z.string().trim().min(1).max(255),
2364
+ content: z.record(z.string(), z.unknown()),
2365
+ sourceExecutionId: UuidSchema.optional()
2366
+ })
2328
2367
  .strict()
2329
2368
  ```
2330
2369
 
2331
2370
  ### `AcqArtifactResponseSchema`
2332
2371
 
2333
2372
  ```typescript
2334
- export const AcqArtifactResponseSchema = z.object({
2335
- id: z.string(),
2336
- organizationId: z.string(),
2337
- ownerKind: z.string(),
2338
- ownerId: z.string(),
2339
- kind: z.string(),
2340
- content: z.record(z.string(), z.unknown()),
2341
- sourceExecutionId: z.string().nullable(),
2342
- createdBy: z.string().nullable(),
2343
- createdAt: z.string(),
2344
- version: z.number().int()
2373
+ export const AcqArtifactResponseSchema = z.object({
2374
+ id: z.string(),
2375
+ organizationId: z.string(),
2376
+ ownerKind: z.string(),
2377
+ ownerId: z.string(),
2378
+ kind: z.string(),
2379
+ content: z.record(z.string(), z.unknown()),
2380
+ sourceExecutionId: z.string().nullable(),
2381
+ createdBy: z.string().nullable(),
2382
+ createdAt: z.string(),
2383
+ version: z.number().int()
2345
2384
  })
2346
2385
  ```
2347
2386
 
2348
2387
  ### `AcqArtifactListResponseSchema`
2349
2388
 
2350
2389
  ```typescript
2351
- export const AcqArtifactListResponseSchema = z.object({
2352
- artifacts: z.array(AcqArtifactResponseSchema)
2390
+ export const AcqArtifactListResponseSchema = z.object({
2391
+ artifacts: z.array(AcqArtifactResponseSchema)
2353
2392
  })
2354
2393
  ```
2355
2394
 
2356
2395
  ### `ListMembersQuerySchema`
2357
2396
 
2358
2397
  ```typescript
2359
- export const ListMembersQuerySchema = z
2360
- .object({
2361
- limit: z.coerce.number().int().min(1).max(500).default(50),
2362
- offset: z.coerce.number().int().min(0).default(0)
2363
- })
2398
+ export const ListMembersQuerySchema = z
2399
+ .object({
2400
+ limit: z.coerce.number().int().min(1).max(500).default(50),
2401
+ offset: z.coerce.number().int().min(0).default(0)
2402
+ })
2364
2403
  .strict()
2365
2404
  ```
2366
2405
 
2367
2406
  ### `MemberIdParamsSchema`
2368
2407
 
2369
2408
  ```typescript
2370
- export const MemberIdParamsSchema = z.object({
2371
- memberId: UuidSchema
2409
+ export const MemberIdParamsSchema = z.object({
2410
+ memberId: UuidSchema
2372
2411
  })
2373
2412
  ```
2374
2413
 
2375
2414
  ### `AcqListMemberContactSummarySchema`
2376
2415
 
2377
2416
  ```typescript
2378
- export const AcqListMemberContactSummarySchema = z.object({
2379
- id: z.string(),
2380
- email: z.string(),
2381
- firstName: z.string().nullable(),
2382
- lastName: z.string().nullable(),
2383
- title: z.string().nullable(),
2384
- linkedinUrl: z.string().nullable(),
2385
- companyId: z.string().nullable()
2417
+ export const AcqListMemberContactSummarySchema = z.object({
2418
+ id: z.string(),
2419
+ email: z.string(),
2420
+ firstName: z.string().nullable(),
2421
+ lastName: z.string().nullable(),
2422
+ title: z.string().nullable(),
2423
+ linkedinUrl: z.string().nullable(),
2424
+ companyId: z.string().nullable()
2386
2425
  })
2387
2426
  ```
2388
2427
 
2389
2428
  ### `AcqListMemberResponseSchema`
2390
2429
 
2391
2430
  ```typescript
2392
- export const AcqListMemberResponseSchema = z.object({
2393
- id: z.string(),
2394
- listId: z.string(),
2395
- contactId: z.string(),
2396
- pipelineKey: z.string(),
2397
- stageKey: z.string(),
2398
- stateKey: z.string(),
2399
- activityLog: z.unknown(),
2400
- addedAt: z.string(),
2401
- addedBy: z.string().nullable(),
2402
- sourceExecutionId: z.string().nullable(),
2403
- contact: AcqListMemberContactSummarySchema.nullable()
2431
+ export const AcqListMemberResponseSchema = z.object({
2432
+ id: z.string(),
2433
+ listId: z.string(),
2434
+ contactId: z.string(),
2435
+ pipelineKey: z.string(),
2436
+ stageKey: z.string(),
2437
+ stateKey: z.string(),
2438
+ activityLog: z.unknown(),
2439
+ addedAt: z.string(),
2440
+ addedBy: z.string().nullable(),
2441
+ sourceExecutionId: z.string().nullable(),
2442
+ contact: AcqListMemberContactSummarySchema.nullable()
2404
2443
  })
2405
2444
  ```
2406
2445
 
2407
2446
  ### `AcqListMembersResponseSchema`
2408
2447
 
2409
2448
  ```typescript
2410
- export const AcqListMembersResponseSchema = z.object({
2411
- members: z.array(AcqListMemberResponseSchema)
2449
+ export const AcqListMembersResponseSchema = z.object({
2450
+ members: z.array(AcqListMemberResponseSchema)
2412
2451
  })
2413
2452
  ```
2414
2453
 
2415
2454
  ### `ListCompanyIdParamsSchema`
2416
2455
 
2417
2456
  ```typescript
2418
- export const ListCompanyIdParamsSchema = z.object({
2419
- listCompanyId: UuidSchema
2457
+ export const ListCompanyIdParamsSchema = z.object({
2458
+ listCompanyId: UuidSchema
2420
2459
  })
2421
2460
  ```
2422
2461
 
2423
2462
  ### `AcqListCompanyResponseSchema`
2424
2463
 
2425
2464
  ```typescript
2426
- export const AcqListCompanyResponseSchema = z.object({
2427
- id: z.string(),
2428
- listId: z.string(),
2429
- companyId: z.string(),
2430
- pipelineKey: z.string(),
2431
- stageKey: z.string(),
2432
- stateKey: z.string(),
2433
- activityLog: z.unknown(),
2434
- addedAt: z.string(),
2435
- addedBy: z.string().nullable(),
2436
- sourceExecutionId: z.string().nullable()
2465
+ export const AcqListCompanyResponseSchema = z.object({
2466
+ id: z.string(),
2467
+ listId: z.string(),
2468
+ companyId: z.string(),
2469
+ pipelineKey: z.string(),
2470
+ stageKey: z.string(),
2471
+ stateKey: z.string(),
2472
+ activityLog: z.unknown(),
2473
+ addedAt: z.string(),
2474
+ addedBy: z.string().nullable(),
2475
+ sourceExecutionId: z.string().nullable()
2437
2476
  })
2438
2477
  ```
2439
2478
 
2440
2479
  ### `AcqCompanySchemas`
2441
2480
 
2442
2481
  ```typescript
2443
- export const AcqCompanySchemas = {
2444
- CompanyIdParams: CompanyIdParamsSchema,
2445
- ListCompaniesQuery: ListCompaniesQuerySchema,
2446
- CreateCompanyRequest: CreateCompanyRequestSchema,
2447
- UpdateCompanyRequest: UpdateCompanyRequestSchema,
2448
- AcqCompanyResponse: AcqCompanyResponseSchema,
2449
- AcqCompanyListResponse: AcqCompanyListResponseSchema,
2450
- AcqCompanyFacetsResponse: AcqCompanyFacetsResponseSchema
2482
+ export const AcqCompanySchemas = {
2483
+ CompanyIdParams: CompanyIdParamsSchema,
2484
+ ListCompaniesQuery: ListCompaniesQuerySchema,
2485
+ CreateCompanyRequest: CreateCompanyRequestSchema,
2486
+ UpdateCompanyRequest: UpdateCompanyRequestSchema,
2487
+ AcqCompanyResponse: AcqCompanyResponseSchema,
2488
+ AcqCompanyListResponse: AcqCompanyListResponseSchema,
2489
+ AcqCompanyFacetsResponse: AcqCompanyFacetsResponseSchema
2451
2490
  }
2452
2491
  ```
2453
2492
 
2454
2493
  ### `AcqContactSchemas`
2455
2494
 
2456
2495
  ```typescript
2457
- export const AcqContactSchemas = {
2458
- ContactIdParams: ContactIdParamsSchema,
2459
- ListContactsQuery: ListContactsQuerySchema,
2460
- CreateContactRequest: CreateContactRequestSchema,
2461
- UpdateContactRequest: UpdateContactRequestSchema,
2462
- AcqContactResponse: AcqContactResponseSchema,
2463
- AcqContactListResponse: AcqContactListResponseSchema
2496
+ export const AcqContactSchemas = {
2497
+ ContactIdParams: ContactIdParamsSchema,
2498
+ ListContactsQuery: ListContactsQuerySchema,
2499
+ CreateContactRequest: CreateContactRequestSchema,
2500
+ UpdateContactRequest: UpdateContactRequestSchema,
2501
+ AcqContactResponse: AcqContactResponseSchema,
2502
+ AcqContactListResponse: AcqContactListResponseSchema
2464
2503
  }
2465
2504
  ```
2466
2505
 
2467
2506
  ### `AcqListSchemas`
2468
2507
 
2469
2508
  ```typescript
2470
- export const AcqListSchemas = {
2471
- // Params
2472
- ListIdParams: ListIdParamsSchema,
2473
-
2474
- // Primitives (for UI / tests)
2475
- ListStatus: ListStatusSchema,
2476
- ScrapingConfig: ScrapingConfigSchema,
2477
- IcpRubric: IcpRubricSchema,
2478
- PipelineConfig: PipelineConfigSchema,
2479
- PipelineStage: PipelineStageSchema,
2480
- BuildPlanSnapshot: BuildPlanSnapshotSchema,
2481
- BuildPlanSnapshotStep: BuildPlanSnapshotStepSchema,
2482
- AcqListMetadata: AcqListMetadataSchema,
2483
- ProcessingStageStatus: ProcessingStageStatusSchema,
2484
- ListStageCounts: ListStageCountsSchema,
2485
- ListTelemetry: ListTelemetrySchema,
2486
-
2487
- // Requests
2488
- CreateListRequest: CreateListRequestSchema,
2489
- UpdateListRequest: UpdateListRequestSchema,
2490
- UpdateListStatusRequest: UpdateListStatusRequestSchema,
2491
- UpdateListConfigRequest: UpdateListConfigRequestSchema,
2492
- AddCompaniesToListRequest: AddCompaniesToListRequestSchema,
2493
- RemoveCompaniesFromListRequest: RemoveCompaniesFromListRequestSchema,
2494
- AddContactsToListRequest: AddContactsToListRequestSchema,
2495
- RecordListExecutionRequest: RecordListExecutionRequestSchema,
2496
-
2497
- // Responses
2498
- AcqListResponse: AcqListResponseSchema,
2499
- AcqListListResponse: AcqListListResponseSchema,
2500
- ListTelemetryResponse: ListTelemetryResponseSchema,
2501
- ListTelemetryListResponse: ListTelemetryListResponseSchema,
2502
- ListExecutionsResponse: ListExecutionsResponseSchema,
2503
- ListProgressResponse: ListProgressResponseSchema
2509
+ export const AcqListSchemas = {
2510
+ // Params
2511
+ ListIdParams: ListIdParamsSchema,
2512
+
2513
+ // Primitives (for UI / tests)
2514
+ ListStatus: ListStatusSchema,
2515
+ ScrapingConfig: ScrapingConfigSchema,
2516
+ IcpRubric: IcpRubricSchema,
2517
+ PipelineConfig: PipelineConfigSchema,
2518
+ PipelineStage: PipelineStageSchema,
2519
+ BuildPlanSnapshot: BuildPlanSnapshotSchema,
2520
+ BuildPlanSnapshotStep: BuildPlanSnapshotStepSchema,
2521
+ AcqListMetadata: AcqListMetadataSchema,
2522
+ ProcessingStageStatus: ProcessingStageStatusSchema,
2523
+ ListStageCounts: ListStageCountsSchema,
2524
+ ListTelemetry: ListTelemetrySchema,
2525
+
2526
+ // Requests
2527
+ CreateListRequest: CreateListRequestSchema,
2528
+ UpdateListRequest: UpdateListRequestSchema,
2529
+ UpdateListStatusRequest: UpdateListStatusRequestSchema,
2530
+ UpdateListConfigRequest: UpdateListConfigRequestSchema,
2531
+ AddCompaniesToListRequest: AddCompaniesToListRequestSchema,
2532
+ RemoveCompaniesFromListRequest: RemoveCompaniesFromListRequestSchema,
2533
+ AddContactsToListRequest: AddContactsToListRequestSchema,
2534
+ RecordListExecutionRequest: RecordListExecutionRequestSchema,
2535
+
2536
+ // Responses
2537
+ AcqListResponse: AcqListResponseSchema,
2538
+ AcqListListResponse: AcqListListResponseSchema,
2539
+ ListTelemetryResponse: ListTelemetryResponseSchema,
2540
+ ListTelemetryListResponse: ListTelemetryListResponseSchema,
2541
+ ListExecutionsResponse: ListExecutionsResponseSchema,
2542
+ ListProgressResponse: ListProgressResponseSchema
2504
2543
  }
2505
2544
  ```
2506
2545
 
2507
2546
  ### `AcqSubstrateSchemas`
2508
2547
 
2509
2548
  ```typescript
2510
- export const AcqSubstrateSchemas = {
2511
- // Artifacts
2512
- ListArtifactsQuery: ListArtifactsQuerySchema,
2513
- CreateArtifactRequest: CreateArtifactRequestSchema,
2514
- AcqArtifactResponse: AcqArtifactResponseSchema,
2515
- AcqArtifactListResponse: AcqArtifactListResponseSchema,
2516
-
2517
- // List members
2518
- ListMembersQuery: ListMembersQuerySchema,
2519
- MemberIdParams: MemberIdParamsSchema,
2520
- AcqListMemberResponse: AcqListMemberResponseSchema,
2521
- AcqListMembersResponse: AcqListMembersResponseSchema,
2522
-
2523
- // List companies
2524
- ListCompanyIdParams: ListCompanyIdParamsSchema,
2525
- AcqListCompanyResponse: AcqListCompanyResponseSchema,
2526
-
2527
- // Transition (shared with deals — TransitionItemRequestSchema)
2528
- TransitionItemRequest: TransitionItemRequestSchema
2549
+ export const AcqSubstrateSchemas = {
2550
+ // Artifacts
2551
+ ListArtifactsQuery: ListArtifactsQuerySchema,
2552
+ CreateArtifactRequest: CreateArtifactRequestSchema,
2553
+ AcqArtifactResponse: AcqArtifactResponseSchema,
2554
+ AcqArtifactListResponse: AcqArtifactListResponseSchema,
2555
+
2556
+ // List members
2557
+ ListMembersQuery: ListMembersQuerySchema,
2558
+ MemberIdParams: MemberIdParamsSchema,
2559
+ AcqListMemberResponse: AcqListMemberResponseSchema,
2560
+ AcqListMembersResponse: AcqListMembersResponseSchema,
2561
+
2562
+ // List companies
2563
+ ListCompanyIdParams: ListCompanyIdParamsSchema,
2564
+ AcqListCompanyResponse: AcqListCompanyResponseSchema,
2565
+
2566
+ // Transition (shared with deals — TransitionItemRequestSchema)
2567
+ TransitionItemRequest: TransitionItemRequestSchema
2529
2568
  }
2530
2569
  ```
2531
2570
 
@@ -2710,39 +2749,39 @@ export const LEAD_GEN_PIPELINE_DEFINITIONS: Record<string, StatefulPipelineDefin
2710
2749
  ### `PaginationParams`
2711
2750
 
2712
2751
  ```typescript
2713
- export interface PaginationParams {
2714
- limit: number
2715
- offset: number
2752
+ export interface PaginationParams {
2753
+ limit: number
2754
+ offset: number
2716
2755
  }
2717
2756
  ```
2718
2757
 
2719
2758
  ### `PaginatedResult`
2720
2759
 
2721
2760
  ```typescript
2722
- export interface PaginatedResult<T> {
2723
- data: T[]
2724
- total: number
2725
- limit: number
2726
- offset: number
2761
+ export interface PaginatedResult<T> {
2762
+ data: T[]
2763
+ total: number
2764
+ limit: number
2765
+ offset: number
2727
2766
  }
2728
2767
  ```
2729
2768
 
2730
2769
  ### `CreateListParams`
2731
2770
 
2732
2771
  ```typescript
2733
- export interface CreateListParams {
2734
- organizationId: string
2735
- name: string
2736
- description?: string
2737
- type?: string
2738
- batchIds?: string[]
2772
+ export interface CreateListParams {
2773
+ organizationId: string
2774
+ name: string
2775
+ description?: string
2776
+ type?: string
2777
+ batchIds?: string[]
2739
2778
  instantlyCampaignId?: string
2740
2779
  status?: ListStatus
2741
2780
  buildTemplateId?: string
2742
2781
  metadata?: Record<string, unknown>
2743
2782
  scrapingConfig?: ScrapingConfig
2744
2783
  icp?: IcpRubric
2745
- pipelineConfig?: PipelineConfig
2784
+ pipelineConfig?: PipelineConfig
2746
2785
  }
2747
2786
  ```
2748
2787
 
@@ -2759,49 +2798,49 @@ export interface UpdateListParams {
2759
2798
  ### `CreateCompanyParams`
2760
2799
 
2761
2800
  ```typescript
2762
- export interface CreateCompanyParams {
2763
- organizationId: string
2764
- name: string
2765
- domain?: string
2766
- linkedinUrl?: string
2767
- website?: string
2768
- numEmployees?: number
2769
- foundedYear?: number
2770
- locationCity?: string
2771
- locationState?: string
2772
- category?: string
2773
- source?: string
2774
- batchId?: string
2775
- verticalResearch?: string
2801
+ export interface CreateCompanyParams {
2802
+ organizationId: string
2803
+ name: string
2804
+ domain?: string
2805
+ linkedinUrl?: string
2806
+ website?: string
2807
+ numEmployees?: number
2808
+ foundedYear?: number
2809
+ locationCity?: string
2810
+ locationState?: string
2811
+ category?: string
2812
+ source?: string
2813
+ batchId?: string
2814
+ verticalResearch?: string
2776
2815
  }
2777
2816
  ```
2778
2817
 
2779
2818
  ### `UpdateCompanyParams`
2780
2819
 
2781
2820
  ```typescript
2782
- export interface UpdateCompanyParams {
2783
- name?: string
2784
- domain?: string
2785
- linkedinUrl?: string
2786
- website?: string
2787
- numEmployees?: number
2788
- foundedYear?: number
2789
- locationCity?: string
2790
- locationState?: string
2791
- category?: string
2792
- segment?: string
2793
- pipelineStatus?: Record<string, unknown>
2794
- enrichmentData?: Record<string, unknown>
2795
- source?: string
2796
- batchId?: string
2797
- status?: 'active' | 'invalid'
2798
- verticalResearch?: string | null
2799
- /** Track A: flat qualification score column (null until a scoring rubric is defined) */
2800
- qualificationScore?: number | null
2801
- /** Track A: flat qualification signals jsonb — mirrors the former pipeline_status.qualification shape */
2802
- qualificationSignals?: Record<string, unknown> | null
2803
- /** Track A: key identifying the rubric used for qualification */
2804
- qualificationRubricKey?: string | null
2821
+ export interface UpdateCompanyParams {
2822
+ name?: string
2823
+ domain?: string
2824
+ linkedinUrl?: string
2825
+ website?: string
2826
+ numEmployees?: number
2827
+ foundedYear?: number
2828
+ locationCity?: string
2829
+ locationState?: string
2830
+ category?: string
2831
+ segment?: string
2832
+ pipelineStatus?: Record<string, unknown>
2833
+ enrichmentData?: Record<string, unknown>
2834
+ source?: string
2835
+ batchId?: string
2836
+ status?: 'active' | 'invalid'
2837
+ verticalResearch?: string | null
2838
+ /** Track A: flat qualification score column (null until a scoring rubric is defined) */
2839
+ qualificationScore?: number | null
2840
+ /** Track A: flat qualification signals jsonb — mirrors the former pipeline_status.qualification shape */
2841
+ qualificationSignals?: Record<string, unknown> | null
2842
+ /** Track A: key identifying the rubric used for qualification */
2843
+ qualificationRubricKey?: string | null
2805
2844
  }
2806
2845
  ```
2807
2846
 
@@ -2814,56 +2853,57 @@ export type UpsertCompanyParams = CreateCompanyParams
2814
2853
  ### `CompanyFilters`
2815
2854
 
2816
2855
  ```typescript
2817
- export interface CompanyFilters {
2818
- listId?: string // Filter to companies in a specific list (via acq_list_companies)
2819
- search?: string
2820
- domain?: string
2821
- website?: string
2822
- segment?: string
2823
- category?: string
2824
- pipelineStatus?: Record<string, unknown>
2825
- /** Exclude companies whose pipeline_status contains this value (PostgREST NOT contains) */
2826
- pipelineStatusNot?: Record<string, unknown>
2827
- batchId?: string
2828
- status?: 'active' | 'invalid'
2829
- includeAll?: boolean
2830
- excludeColumns?: Array<'enrichmentData' | 'pipelineStatus'>
2856
+ export interface CompanyFilters {
2857
+ listId?: string // Filter to companies in a specific list (via acq_list_companies)
2858
+ search?: string
2859
+ domain?: string
2860
+ website?: string
2861
+ segment?: string
2862
+ category?: string
2863
+ pipelineStatus?: Record<string, unknown>
2864
+ /** Exclude companies whose pipeline_status contains this value (PostgREST NOT contains) */
2865
+ pipelineStatusNot?: Record<string, unknown>
2866
+ batchId?: string
2867
+ status?: 'active' | 'invalid'
2868
+ includeAll?: boolean
2869
+ excludeColumns?: Array<'enrichmentData' | 'pipelineStatus'>
2870
+ limit?: number
2831
2871
  }
2832
2872
  ```
2833
2873
 
2834
2874
  ### `CreateContactParams`
2835
2875
 
2836
2876
  ```typescript
2837
- export interface CreateContactParams {
2838
- organizationId: string
2839
- email: string
2840
- companyId?: string
2841
- firstName?: string
2842
- lastName?: string
2843
- linkedinUrl?: string
2844
- title?: string
2845
- source?: string
2846
- sourceId?: string
2847
- batchId?: string
2877
+ export interface CreateContactParams {
2878
+ organizationId: string
2879
+ email: string
2880
+ companyId?: string
2881
+ firstName?: string
2882
+ lastName?: string
2883
+ linkedinUrl?: string
2884
+ title?: string
2885
+ source?: string
2886
+ sourceId?: string
2887
+ batchId?: string
2848
2888
  }
2849
2889
  ```
2850
2890
 
2851
2891
  ### `UpdateContactParams`
2852
2892
 
2853
2893
  ```typescript
2854
- export interface UpdateContactParams {
2855
- companyId?: string
2856
- emailValid?: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN'
2857
- firstName?: string
2858
- lastName?: string
2859
- linkedinUrl?: string
2860
- title?: string
2861
- headline?: string
2862
- filterReason?: string
2863
- openingLine?: string
2864
- pipelineStatus?: Record<string, unknown>
2865
- enrichmentData?: Record<string, unknown>
2866
- status?: 'active' | 'invalid'
2894
+ export interface UpdateContactParams {
2895
+ companyId?: string
2896
+ emailValid?: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN'
2897
+ firstName?: string
2898
+ lastName?: string
2899
+ linkedinUrl?: string
2900
+ title?: string
2901
+ headline?: string
2902
+ filterReason?: string
2903
+ openingLine?: string
2904
+ pipelineStatus?: Record<string, unknown>
2905
+ enrichmentData?: Record<string, unknown>
2906
+ status?: 'active' | 'invalid'
2867
2907
  }
2868
2908
  ```
2869
2909
 
@@ -2876,87 +2916,87 @@ export type UpsertContactParams = CreateContactParams
2876
2916
  ### `ContactFilters`
2877
2917
 
2878
2918
  ```typescript
2879
- export interface ContactFilters {
2880
- listId?: string // Filter to contacts in a specific list (via acq_list_members)
2881
- search?: string
2882
- openingLineIsNull?: boolean // Filter to contacts without personalization
2883
- pipelineStatus?: Record<string, unknown>
2884
- batchId?: string
2885
- contactStatus?: 'active' | 'invalid' // Filter by contact status (soft-delete flag)
2919
+ export interface ContactFilters {
2920
+ listId?: string // Filter to contacts in a specific list (via acq_list_members)
2921
+ search?: string
2922
+ openingLineIsNull?: boolean // Filter to contacts without personalization
2923
+ pipelineStatus?: Record<string, unknown>
2924
+ batchId?: string
2925
+ contactStatus?: 'active' | 'invalid' // Filter by contact status (soft-delete flag)
2886
2926
  }
2887
2927
  ```
2888
2928
 
2889
2929
  ### `UpsertSocialPostParams`
2890
2930
 
2891
2931
  ```typescript
2892
- export interface UpsertSocialPostParams {
2893
- organizationId: string
2894
- platform: string
2895
- platformPostId: string
2896
- authorName: string
2897
- authorUrl?: string | null
2898
- postTitle: string
2899
- postText: string
2900
- postUrl: string
2901
- engagementCount?: number
2902
- commentsCount?: number
2903
- postedAt: string
2904
- metadata?: Record<string, unknown>
2905
- relevanceScore?: number
2906
- matchedKeywords?: string[]
2907
- matchedQuery?: string | null
2908
- initialDraft?: string | null
2909
- finalResponse?: string | null
2910
- sourceCategory?: string | null
2932
+ export interface UpsertSocialPostParams {
2933
+ organizationId: string
2934
+ platform: string
2935
+ platformPostId: string
2936
+ authorName: string
2937
+ authorUrl?: string | null
2938
+ postTitle: string
2939
+ postText: string
2940
+ postUrl: string
2941
+ engagementCount?: number
2942
+ commentsCount?: number
2943
+ postedAt: string
2944
+ metadata?: Record<string, unknown>
2945
+ relevanceScore?: number
2946
+ matchedKeywords?: string[]
2947
+ matchedQuery?: string | null
2948
+ initialDraft?: string | null
2949
+ finalResponse?: string | null
2950
+ sourceCategory?: string | null
2911
2951
  }
2912
2952
  ```
2913
2953
 
2914
2954
  ### `UpsertSocialPostsParams`
2915
2955
 
2916
2956
  ```typescript
2917
- export interface UpsertSocialPostsParams {
2918
- organizationId: string
2919
- posts: Omit<UpsertSocialPostParams, 'organizationId'>[]
2957
+ export interface UpsertSocialPostsParams {
2958
+ organizationId: string
2959
+ posts: Omit<UpsertSocialPostParams, 'organizationId'>[]
2920
2960
  }
2921
2961
  ```
2922
2962
 
2923
2963
  ### `UpsertSocialPostsResult`
2924
2964
 
2925
2965
  ```typescript
2926
- export interface UpsertSocialPostsResult {
2927
- inserted: number
2928
- duplicatesSkipped: number
2966
+ export interface UpsertSocialPostsResult {
2967
+ inserted: number
2968
+ duplicatesSkipped: number
2929
2969
  }
2930
2970
  ```
2931
2971
 
2932
2972
  ### `AddContactsToListParams`
2933
2973
 
2934
2974
  ```typescript
2935
- export interface AddContactsToListParams {
2936
- organizationId: string
2937
- listId: string
2938
- contactIds: string[]
2975
+ export interface AddContactsToListParams {
2976
+ organizationId: string
2977
+ listId: string
2978
+ contactIds: string[]
2939
2979
  }
2940
2980
  ```
2941
2981
 
2942
2982
  ### `AddContactsToListResult`
2943
2983
 
2944
2984
  ```typescript
2945
- export interface AddContactsToListResult {
2946
- added: number
2947
- alreadyExisted: number
2985
+ export interface AddContactsToListResult {
2986
+ added: number
2987
+ alreadyExisted: number
2948
2988
  }
2949
2989
  ```
2950
2990
 
2951
2991
  ### `UpdateListConfigParams`
2952
2992
 
2953
2993
  ```typescript
2954
- export interface UpdateListConfigParams {
2955
- organizationId: string
2956
- listId: string
2957
- scrapingConfig?: ScrapingConfig
2958
- icp?: IcpRubric
2959
- pipelineConfig?: PipelineConfig
2994
+ export interface UpdateListConfigParams {
2995
+ organizationId: string
2996
+ listId: string
2997
+ scrapingConfig?: ScrapingConfig
2998
+ icp?: IcpRubric
2999
+ pipelineConfig?: PipelineConfig
2960
3000
  }
2961
3001
  ```
2962
3002
 
@@ -2989,117 +3029,117 @@ export interface UpdateContactStageParams {
2989
3029
  ### `AddCompaniesToListParams`
2990
3030
 
2991
3031
  ```typescript
2992
- export interface AddCompaniesToListParams {
2993
- organizationId: string
2994
- listId: string
2995
- companyIds: string[]
3032
+ export interface AddCompaniesToListParams {
3033
+ organizationId: string
3034
+ listId: string
3035
+ companyIds: string[]
2996
3036
  }
2997
3037
  ```
2998
3038
 
2999
3039
  ### `AddCompaniesToListResult`
3000
3040
 
3001
3041
  ```typescript
3002
- export interface AddCompaniesToListResult {
3003
- added: number
3004
- alreadyExisted: number
3042
+ export interface AddCompaniesToListResult {
3043
+ added: number
3044
+ alreadyExisted: number
3005
3045
  }
3006
3046
  ```
3007
3047
 
3008
3048
  ### `RemoveCompaniesFromListParams`
3009
3049
 
3010
3050
  ```typescript
3011
- export interface RemoveCompaniesFromListParams {
3012
- organizationId: string
3013
- listId: string
3014
- companyIds: string[]
3051
+ export interface RemoveCompaniesFromListParams {
3052
+ organizationId: string
3053
+ listId: string
3054
+ companyIds: string[]
3015
3055
  }
3016
3056
  ```
3017
3057
 
3018
3058
  ### `RemoveCompaniesFromListResult`
3019
3059
 
3020
3060
  ```typescript
3021
- export interface RemoveCompaniesFromListResult {
3022
- removed: number
3061
+ export interface RemoveCompaniesFromListResult {
3062
+ removed: number
3023
3063
  }
3024
3064
  ```
3025
3065
 
3026
3066
  ### `RecordListExecutionParams`
3027
3067
 
3028
3068
  ```typescript
3029
- export interface RecordListExecutionParams {
3030
- organizationId: string
3031
- listId: string
3032
- executionId: string
3033
- configSnapshot?: Record<string, unknown>
3069
+ export interface RecordListExecutionParams {
3070
+ organizationId: string
3071
+ listId: string
3072
+ executionId: string
3073
+ configSnapshot?: Record<string, unknown>
3034
3074
  }
3035
3075
  ```
3036
3076
 
3037
3077
  ### `ListExecutionSummary`
3038
3078
 
3039
3079
  ```typescript
3040
- export interface ListExecutionSummary {
3041
- executionId: string
3042
- resourceId: string
3043
- status: string
3044
- createdAt: string
3045
- completedAt: string | null
3046
- durationMs: number | null
3080
+ export interface ListExecutionSummary {
3081
+ executionId: string
3082
+ resourceId: string
3083
+ status: string
3084
+ createdAt: string
3085
+ completedAt: string | null
3086
+ durationMs: number | null
3047
3087
  }
3048
3088
  ```
3049
3089
 
3050
3090
  ### `BulkImportParams`
3051
3091
 
3052
3092
  ```typescript
3053
- export interface BulkImportParams {
3054
- organizationId: string
3055
- contacts: CreateContactParams[]
3056
- listId?: string
3093
+ export interface BulkImportParams {
3094
+ organizationId: string
3095
+ contacts: CreateContactParams[]
3096
+ listId?: string
3057
3097
  }
3058
3098
  ```
3059
3099
 
3060
3100
  ### `BulkImportResult`
3061
3101
 
3062
3102
  ```typescript
3063
- export interface BulkImportResult {
3064
- created: number
3065
- updated: number
3066
- errors: Array<{ email: string; error: string }>
3103
+ export interface BulkImportResult {
3104
+ created: number
3105
+ updated: number
3106
+ errors: Array<{ email: string; error: string }>
3067
3107
  }
3068
3108
  ```
3069
3109
 
3070
3110
  ### `BulkImportCompanyEntry`
3071
3111
 
3072
3112
  ```typescript
3073
- export interface BulkImportCompanyEntry {
3074
- name: string
3075
- domain: string
3076
- website?: string
3077
- locationCity?: string
3078
- locationState?: string
3079
- category?: string
3080
- source?: string
3081
- enrichmentData?: Record<string, unknown>
3082
- pipelineStatus?: Record<string, unknown>
3113
+ export interface BulkImportCompanyEntry {
3114
+ name: string
3115
+ domain: string
3116
+ website?: string
3117
+ locationCity?: string
3118
+ locationState?: string
3119
+ category?: string
3120
+ source?: string
3121
+ enrichmentData?: Record<string, unknown>
3122
+ pipelineStatus?: Record<string, unknown>
3083
3123
  }
3084
3124
  ```
3085
3125
 
3086
3126
  ### `BulkImportCompaniesParams`
3087
3127
 
3088
3128
  ```typescript
3089
- export interface BulkImportCompaniesParams {
3090
- organizationId: string
3091
- batchId: string
3092
- companies: BulkImportCompanyEntry[]
3129
+ export interface BulkImportCompaniesParams {
3130
+ organizationId: string
3131
+ batchId: string
3132
+ companies: BulkImportCompanyEntry[]
3093
3133
  }
3094
3134
  ```
3095
3135
 
3096
3136
  ### `BulkImportCompaniesResult`
3097
3137
 
3098
3138
  ```typescript
3099
- export interface BulkImportCompaniesResult {
3100
- created: number
3101
- skipped: number
3102
- errors: Array<{ companyName: string; error: string }>
3139
+ export interface BulkImportCompaniesResult {
3140
+ created: number
3141
+ skipped: number
3142
+ errors: Array<{ companyName: string; error: string }>
3103
3143
  }
3104
3144
  ```
3105
3145
 
@@ -3262,3 +3302,74 @@ export type ListToolMap = {
3262
3302
  }
3263
3303
  }
3264
3304
  ```
3305
+
3306
+ ## Knowledge Platform Primitives
3307
+
3308
+ ### `KnowledgeLinkSchema`
3309
+
3310
+ ```typescript
3311
+ export const KnowledgeLinkSchema = z.object({
3312
+ nodeId: NodeIdStringSchema
3313
+ })
3314
+ ```
3315
+
3316
+ ### `OrgKnowledgeKindSchema`
3317
+
3318
+ ```typescript
3319
+ export const OrgKnowledgeKindSchema = z.enum(['playbook', 'strategy', 'reference'])
3320
+ ```
3321
+
3322
+ ### `OrgKnowledgeNodeSchema`
3323
+
3324
+ ```typescript
3325
+ export const OrgKnowledgeNodeSchema = z.object({
3326
+ id: ModelIdSchema,
3327
+ kind: OrgKnowledgeKindSchema,
3328
+ title: z.string().trim().min(1).max(200),
3329
+ summary: z.string().trim().min(1).max(1000),
3330
+ icon: IconNameSchema.optional(),
3331
+ /** Raw MDX string. Phase 2 will introduce a structured block format. */
3332
+ body: z.string().trim().min(1),
3333
+ /**
3334
+ * Graph links to other OM nodes this knowledge node governs.
3335
+ * Each link emits a `governs` edge: knowledge-node -> target node.
3336
+ */
3337
+ links: z.array(KnowledgeLinkSchema).default([]),
3338
+ /** Identifiers of the roles or members who own this knowledge node. */
3339
+ ownerIds: z.array(ModelIdSchema).default([]),
3340
+ /** ISO date string (YYYY-MM-DD or full ISO 8601) of last meaningful update. */
3341
+ updatedAt: z.string().trim().min(1).max(50)
3342
+ })
3343
+ ```
3344
+
3345
+ ### `KnowledgeDomainSchema`
3346
+
3347
+ ```typescript
3348
+ export const KnowledgeDomainSchema = z.object({
3349
+ nodes: z.array(OrgKnowledgeNodeSchema).default([])
3350
+ })
3351
+ ```
3352
+
3353
+ ### `OrgKnowledgeNode`
3354
+
3355
+ ```typescript
3356
+ export type OrgKnowledgeNode = z.infer<typeof OrgKnowledgeNodeSchema>
3357
+ ```
3358
+
3359
+ ### `OrgKnowledgeKind`
3360
+
3361
+ ```typescript
3362
+ export type OrgKnowledgeKind = z.infer<typeof OrgKnowledgeKindSchema>
3363
+ ```
3364
+
3365
+ ### `KnowledgeLink`
3366
+
3367
+ ```typescript
3368
+ export type KnowledgeLink = z.infer<typeof KnowledgeLinkSchema>
3369
+ ```
3370
+
3371
+ ### `KnowledgeDomain`
3372
+
3373
+ ```typescript
3374
+ export type KnowledgeDomain = z.infer<typeof KnowledgeDomainSchema>
3375
+ ```