@elevasis/sdk 1.15.0 → 1.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -888,6 +888,26 @@ export interface AcqContact {
888
888
  export type DealStage = 'interested' | 'proposal' | 'closing' | 'closed_won' | 'closed_lost' | 'nurturing'
889
889
  ```
890
890
 
891
+ ### `DealPriorityBucketKey`
892
+
893
+ ```typescript
894
+ export type DealPriorityBucketKey = 'needs_response' | 'follow_up_due' | 'waiting' | 'stale' | 'closed_low'
895
+ ```
896
+
897
+ ### `DealPriority`
898
+
899
+ ```typescript
900
+ export interface DealPriority {
901
+ bucketKey: DealPriorityBucketKey
902
+ rank: number
903
+ label: string
904
+ color: string
905
+ reason: string
906
+ latestActivityAt: string | null
907
+ nextActionAt: string | null
908
+ }
909
+ ```
910
+
891
911
  ### `KanbanStageConfig`
892
912
 
893
913
  ```typescript
@@ -944,8 +964,11 @@ export interface DealFilters {
944
964
 
945
965
  ```typescript
946
966
  /** Deal list item with joined contact and company data */
947
- export interface DealListItem extends AcqDealRow {
948
- contact: DealContact | null
967
+ export interface DealListItem extends AcqDealRow {
968
+ priority: DealPriority
969
+ ownership: 'us' | 'them' | null
970
+ nextAction: string | null
971
+ contact: DealContact | null
949
972
  }
950
973
  ```
951
974
 
@@ -986,6 +1009,66 @@ export interface AcqDealTask {
986
1009
  }
987
1010
  ```
988
1011
 
1012
+ ### `CrmPriorityBucketKey`
1013
+
1014
+ ```typescript
1015
+ export type CrmPriorityBucketKey = 'needs_response' | 'follow_up_due' | 'waiting' | 'stale' | 'closed_low'
1016
+ ```
1017
+
1018
+ ### `CrmPriorityBucketDefinition`
1019
+
1020
+ ```typescript
1021
+ export interface CrmPriorityBucketDefinition {
1022
+ bucketKey: CrmPriorityBucketKey
1023
+ label: string
1024
+ /** Lower ranks sort first in deal lists and pipeline columns. */
1025
+ rank: number
1026
+ /** UI color token. Consumers may map this to their design system. */
1027
+ color: string
1028
+ }
1029
+ ```
1030
+
1031
+ ### `CrmPriorityRuleConfig`
1032
+
1033
+ ```typescript
1034
+ export interface CrmPriorityRuleConfig {
1035
+ buckets: CrmPriorityBucketDefinition[]
1036
+ closedStageKeys: string[]
1037
+ followUpAfterDaysByStateKey: Record<string, number>
1038
+ staleAfterDays: number
1039
+ }
1040
+ ```
1041
+
1042
+ ### `CRM_PRIORITY_BUCKETS`
1043
+
1044
+ ```typescript
1045
+ export const CRM_PRIORITY_BUCKETS: CrmPriorityBucketDefinition[] = [
1046
+ { bucketKey: 'needs_response', label: 'Needs Response', rank: 10, color: 'red' },
1047
+ { bucketKey: 'follow_up_due', label: 'Follow-up Due', rank: 20, color: 'orange' },
1048
+ { bucketKey: 'waiting', label: 'Waiting', rank: 30, color: 'blue' },
1049
+ { bucketKey: 'stale', label: 'Stale', rank: 40, color: 'gray' },
1050
+ { bucketKey: 'closed_low', label: 'Closed', rank: 50, color: 'dark' }
1051
+ ]
1052
+ ```
1053
+
1054
+ ### `DEFAULT_CRM_PRIORITY_RULE_CONFIG`
1055
+
1056
+ ```typescript
1057
+ export const DEFAULT_CRM_PRIORITY_RULE_CONFIG: CrmPriorityRuleConfig = {
1058
+ buckets: CRM_PRIORITY_BUCKETS,
1059
+ closedStageKeys: ['closed_won', 'closed_lost'],
1060
+ followUpAfterDaysByStateKey: {
1061
+ discovery_link_sent: 3,
1062
+ discovery_nudging: 2,
1063
+ reply_sent: 3,
1064
+ followup_1_sent: 3,
1065
+ followup_2_sent: 5,
1066
+ followup_3_sent: 7
1067
+ },
1068
+ staleAfterDays: 14
1069
+ }
1070
+ ```
1071
+
989
1072
  ### `DealStageSchema`
990
1073
 
991
1074
  ```typescript
@@ -1001,178 +1084,195 @@ export const AcqDealTaskKindSchema = z.enum(['call', 'email', 'meeting', 'other'
1001
1084
  ### `DealIdParamsSchema`
1002
1085
 
1003
1086
  ```typescript
1004
- export const DealIdParamsSchema = z.object({
1005
- dealId: UuidSchema
1087
+ export const DealIdParamsSchema = z.object({
1088
+ dealId: UuidSchema
1006
1089
  })
1007
1090
  ```
1008
1091
 
1009
1092
  ### `DealTaskIdParamsSchema`
1010
1093
 
1011
1094
  ```typescript
1012
- export const DealTaskIdParamsSchema = z.object({
1013
- dealId: UuidSchema,
1014
- taskId: UuidSchema
1095
+ export const DealTaskIdParamsSchema = z.object({
1096
+ dealId: UuidSchema,
1097
+ taskId: UuidSchema
1015
1098
  })
1016
1099
  ```
1017
1100
 
1018
1101
  ### `ListDealsQuerySchema`
1019
1102
 
1020
1103
  ```typescript
1021
- export const ListDealsQuerySchema = z
1022
- .object({
1023
- stage: DealStageSchema.optional(),
1024
- search: z.string().optional(),
1025
- limit: z.coerce.number().int().positive().default(50),
1026
- offset: z.coerce.number().int().min(0).default(0)
1027
- })
1104
+ export const ListDealsQuerySchema = z
1105
+ .object({
1106
+ stage: DealStageSchema.optional(),
1107
+ search: z.string().optional(),
1108
+ limit: z.coerce.number().int().positive().default(50),
1109
+ offset: z.coerce.number().int().min(0).default(0)
1110
+ })
1028
1111
  .strict()
1029
1112
  ```
1030
1113
 
1031
1114
  ### `DealLookupQuerySchema`
1032
1115
 
1033
1116
  ```typescript
1034
- export const DealLookupQuerySchema = z
1035
- .object({
1036
- search: z.string().trim().min(1).max(200).optional(),
1037
- limit: z.coerce.number().int().min(1).max(25).default(10)
1038
- })
1117
+ export const DealLookupQuerySchema = z
1118
+ .object({
1119
+ search: z.string().trim().min(1).max(200).optional(),
1120
+ limit: z.coerce.number().int().min(1).max(25).default(10)
1121
+ })
1039
1122
  .strict()
1040
1123
  ```
1041
1124
 
1042
1125
  ### `ListDealTasksDueQuerySchema`
1043
1126
 
1044
1127
  ```typescript
1045
- export const ListDealTasksDueQuerySchema = z
1046
- .object({
1047
- window: z.enum(['overdue', 'today', 'today_and_overdue', 'upcoming']).optional(),
1048
- assigneeUserId: UuidSchema.optional()
1049
- })
1128
+ export const ListDealTasksDueQuerySchema = z
1129
+ .object({
1130
+ window: z.enum(['overdue', 'today', 'today_and_overdue', 'upcoming']).optional(),
1131
+ assigneeUserId: UuidSchema.optional()
1132
+ })
1050
1133
  .strict()
1051
1134
  ```
1052
1135
 
1053
1136
  ### `CreateDealNoteRequestSchema`
1054
1137
 
1055
1138
  ```typescript
1056
- export const CreateDealNoteRequestSchema = z
1057
- .object({
1058
- body: z.string().trim().min(1).max(10000)
1059
- })
1139
+ export const CreateDealNoteRequestSchema = z
1140
+ .object({
1141
+ body: z.string().trim().min(1).max(10000)
1142
+ })
1060
1143
  .strict()
1061
1144
  ```
1062
1145
 
1063
1146
  ### `CreateDealTaskRequestSchema`
1064
1147
 
1065
1148
  ```typescript
1066
- export const CreateDealTaskRequestSchema = z
1067
- .object({
1068
- title: z.string().trim().min(1).max(255),
1069
- description: z.string().nullable().optional(),
1070
- kind: AcqDealTaskKindSchema.optional(),
1071
- dueAt: z.string().datetime().nullable().optional(),
1072
- assigneeUserId: UuidSchema.nullable().optional()
1073
- })
1149
+ export const CreateDealTaskRequestSchema = z
1150
+ .object({
1151
+ title: z.string().trim().min(1).max(255),
1152
+ description: z.string().nullable().optional(),
1153
+ kind: AcqDealTaskKindSchema.optional(),
1154
+ dueAt: z.string().datetime().nullable().optional(),
1155
+ assigneeUserId: UuidSchema.nullable().optional()
1156
+ })
1074
1157
  .strict()
1075
1158
  ```
1076
1159
 
1077
1160
  ### `TransitionItemRequestSchema`
1078
1161
 
1079
1162
  ```typescript
1080
- export const TransitionItemRequestSchema = z
1081
- .object({
1082
- pipelineKey: z.string().min(1),
1083
- stageKey: z.string().min(1),
1084
- stateKey: z.string().nullable().optional(),
1085
- reason: z.string().optional(),
1086
- expectedUpdatedAt: z.string().datetime().optional()
1087
- })
1163
+ export const TransitionItemRequestSchema = z
1164
+ .object({
1165
+ pipelineKey: z.string().min(1),
1166
+ stageKey: z.string().min(1),
1167
+ stateKey: z.string().nullable().optional(),
1168
+ reason: z.string().optional(),
1169
+ expectedUpdatedAt: z.string().datetime().optional()
1170
+ })
1088
1171
  .strict()
1089
1172
  ```
1090
1173
 
1091
1174
  ### `ExecuteActionParamsSchema`
1092
1175
 
1093
1176
  ```typescript
1094
- export const ExecuteActionParamsSchema = z
1095
- .object({
1096
- dealId: UuidSchema,
1097
- actionKey: NonEmptyStringSchema
1098
- })
1177
+ export const ExecuteActionParamsSchema = z
1178
+ .object({
1179
+ dealId: UuidSchema,
1180
+ actionKey: NonEmptyStringSchema
1181
+ })
1099
1182
  .strict()
1100
1183
  ```
1101
1184
 
1102
1185
  ### `ExecuteActionRequestSchema`
1103
1186
 
1104
1187
  ```typescript
1105
- export const ExecuteActionRequestSchema = z
1106
- .object({
1107
- payload: z.record(z.string(), z.unknown()).optional()
1108
- })
1188
+ export const ExecuteActionRequestSchema = z
1189
+ .object({
1190
+ payload: z.record(z.string(), z.unknown()).optional()
1191
+ })
1109
1192
  .strict()
1110
1193
  ```
1111
1194
 
1112
1195
  ### `DealContactSummarySchema`
1113
1196
 
1114
1197
  ```typescript
1115
- /**
1116
- * Contact summary nested inside DealListItem / DealDetailResponse.
1117
- * Matches the joined shape returned by useDeals / useDealDetail Supabase queries.
1118
- */
1119
- export const DealContactSummarySchema = z.object({
1120
- id: z.string(),
1121
- first_name: z.string().nullable(),
1122
- last_name: z.string().nullable(),
1123
- email: z.string(),
1124
- title: z.string().nullable(),
1125
- headline: z.string().nullable(),
1126
- linkedin_url: z.string().nullable(),
1127
- pipeline_status: z.record(z.string(), z.unknown()).nullable(),
1128
- enrichment_data: z.record(z.string(), z.unknown()).nullable(),
1129
- company: z
1130
- .object({
1131
- id: z.string(),
1132
- name: z.string(),
1133
- domain: z.string().nullable(),
1134
- website: z.string().nullable(),
1135
- linkedin_url: z.string().nullable(),
1136
- segment: z.string().nullable(),
1137
- category: z.string().nullable(),
1138
- num_employees: z.number().nullable()
1139
- })
1140
- .nullable()
1198
+ /**
1199
+ * Contact summary nested inside DealListItem / DealDetailResponse.
1200
+ * Matches the joined shape returned by useDeals / useDealDetail Supabase queries.
1201
+ */
1202
+ export const DealContactSummarySchema = z.object({
1203
+ id: z.string(),
1204
+ first_name: z.string().nullable(),
1205
+ last_name: z.string().nullable(),
1206
+ email: z.string(),
1207
+ title: z.string().nullable(),
1208
+ headline: z.string().nullable(),
1209
+ linkedin_url: z.string().nullable(),
1210
+ pipeline_status: z.record(z.string(), z.unknown()).nullable(),
1211
+ enrichment_data: z.record(z.string(), z.unknown()).nullable(),
1212
+ company: z
1213
+ .object({
1214
+ id: z.string(),
1215
+ name: z.string(),
1216
+ domain: z.string().nullable(),
1217
+ website: z.string().nullable(),
1218
+ linkedin_url: z.string().nullable(),
1219
+ segment: z.string().nullable(),
1220
+ category: z.string().nullable(),
1221
+ num_employees: z.number().nullable()
1222
+ })
1223
+ .nullable()
1224
+ })
1225
+ ```
1226
+
1227
+ ### `DealPrioritySchema`
1228
+
1229
+ ```typescript
1230
+ export const DealPrioritySchema = z.object({
1231
+ bucketKey: z.enum(['needs_response', 'follow_up_due', 'waiting', 'stale', 'closed_low']),
1232
+ rank: z.number().int(),
1233
+ label: z.string(),
1234
+ color: z.string(),
1235
+ reason: z.string(),
1236
+ latestActivityAt: z.string().nullable(),
1237
+ nextActionAt: z.string().nullable()
1141
1238
  })
1142
1239
  ```
1143
1240
 
1144
1241
  ### `DealListItemSchema`
1145
1242
 
1146
1243
  ```typescript
1147
- /**
1148
- * Deal list item with joined contact (and company via contact).
1149
- * Matches DealListItem from @repo/core types.
1150
- */
1151
- export const DealListItemSchema = z.object({
1152
- // acq_deals columns
1153
- id: z.string(),
1154
- organization_id: z.string(),
1155
- contact_id: z.string().nullable(),
1156
- contact_email: z.string(),
1157
- pipeline_key: z.string(),
1158
- stage_key: z.string().nullable(),
1159
- state_key: z.string().nullable(),
1160
- activity_log: z.unknown(),
1161
- discovery_data: z.unknown().nullable(),
1162
- discovery_submitted_at: z.string().nullable(),
1163
- discovery_submitted_by: z.string().nullable(),
1164
- proposal_data: z.unknown().nullable(),
1165
- proposal_sent_at: z.string().nullable(),
1166
- proposal_pdf_url: z.string().nullable(),
1167
- signature_envelope_id: z.string().nullable(),
1168
- source_list_id: z.string().nullable(),
1169
- source_type: z.string().nullable(),
1170
- initial_fee: z.number().nullable(),
1171
- monthly_fee: z.number().nullable(),
1172
- closed_lost_at: z.string().nullable(),
1173
- closed_lost_reason: z.string().nullable(),
1244
+ /**
1245
+ * Deal list item with joined contact (and company via contact).
1246
+ * Matches DealListItem from @repo/core types.
1247
+ */
1248
+ export const DealListItemSchema = z.object({
1249
+ // acq_deals columns
1250
+ id: z.string(),
1251
+ organization_id: z.string(),
1252
+ contact_id: z.string().nullable(),
1253
+ contact_email: z.string(),
1254
+ pipeline_key: z.string(),
1255
+ stage_key: z.string().nullable(),
1256
+ state_key: z.string().nullable(),
1257
+ activity_log: z.unknown(),
1258
+ discovery_data: z.unknown().nullable(),
1259
+ discovery_submitted_at: z.string().nullable(),
1260
+ discovery_submitted_by: z.string().nullable(),
1261
+ proposal_data: z.unknown().nullable(),
1262
+ proposal_sent_at: z.string().nullable(),
1263
+ proposal_pdf_url: z.string().nullable(),
1264
+ signature_envelope_id: z.string().nullable(),
1265
+ source_list_id: z.string().nullable(),
1266
+ source_type: z.string().nullable(),
1267
+ initial_fee: z.number().nullable(),
1268
+ monthly_fee: z.number().nullable(),
1269
+ closed_lost_at: z.string().nullable(),
1270
+ closed_lost_reason: z.string().nullable(),
1174
1271
  created_at: z.string(),
1175
1272
  updated_at: z.string(),
1273
+ priority: DealPrioritySchema,
1274
+ ownership: z.enum(['us', 'them']).nullable(),
1275
+ nextAction: z.string().nullable(),
1176
1276
  // joined relation
1177
1277
  contact: DealContactSummarySchema.nullable()
1178
1278
  })
@@ -1181,38 +1281,40 @@ export const DealListItemSchema = z.object({
1181
1281
  ### `DealListResponseSchema`
1182
1282
 
1183
1283
  ```typescript
1184
- export const DealListResponseSchema = z.object({
1185
- data: z.array(DealListItemSchema),
1186
- total: z.number().int(),
1187
- limit: z.number().int(),
1188
- offset: z.number().int()
1284
+ export const DealListResponseSchema = z.object({
1285
+ data: z.array(DealListItemSchema),
1286
+ total: z.number().int(),
1287
+ limit: z.number().int(),
1288
+ offset: z.number().int()
1189
1289
  })
1190
1290
  ```
1191
1291
 
1192
1292
  ### `DealDetailResponseSchema`
1193
1293
 
1194
1294
  ```typescript
1195
- /**
1196
- * Deal detail shape — currently the same as a list item (full joined record).
1197
- * useDealDetail returns DealDetail which is typed as DealListItem.
1198
- */
1199
- export const DealDetailResponseSchema = DealListItemSchema
1295
+ /**
1296
+ * Deal detail shape — currently the same as a list item (full joined record).
1297
+ * Additive fields keep existing DealListItem callers compatible.
1298
+ */
1299
+ export const DealDetailResponseSchema = DealListItemSchema.extend({
1300
+ conversation: DealConversationSchema
1301
+ })
1200
1302
  ```
1201
1303
 
1202
1304
  ### `DealNoteResponseSchema`
1203
1305
 
1204
1306
  ```typescript
1205
- /**
1206
- * Single acq_deal_notes row (camelCase API representation).
1207
- */
1208
- export const DealNoteResponseSchema = z.object({
1209
- id: z.string(),
1210
- dealId: z.string(),
1211
- organizationId: z.string(),
1212
- authorUserId: z.string().nullable(),
1213
- body: z.string(),
1214
- createdAt: z.string(),
1215
- updatedAt: z.string()
1307
+ /**
1308
+ * Single acq_deal_notes row (camelCase API representation).
1309
+ */
1310
+ export const DealNoteResponseSchema = z.object({
1311
+ id: z.string(),
1312
+ dealId: z.string(),
1313
+ organizationId: z.string(),
1314
+ authorUserId: z.string().nullable(),
1315
+ body: z.string(),
1316
+ createdAt: z.string(),
1317
+ updatedAt: z.string()
1216
1318
  })
1217
1319
  ```
1218
1320
 
@@ -1225,24 +1327,24 @@ export const DealNoteListResponseSchema = z.array(DealNoteResponseSchema)
1225
1327
  ### `DealTaskResponseSchema`
1226
1328
 
1227
1329
  ```typescript
1228
- /**
1229
- * Single acq_deal_tasks row (camelCase API representation).
1230
- * Matches AcqDealTask domain type from types.ts.
1231
- */
1232
- export const DealTaskResponseSchema = z.object({
1233
- id: z.string(),
1234
- organizationId: z.string(),
1235
- dealId: z.string(),
1236
- title: z.string(),
1237
- description: z.string().nullable(),
1238
- kind: AcqDealTaskKindSchema,
1239
- dueAt: z.string().nullable(),
1240
- assigneeUserId: z.string().nullable(),
1241
- completedAt: z.string().nullable(),
1242
- completedByUserId: z.string().nullable(),
1243
- createdAt: z.string(),
1244
- updatedAt: z.string(),
1245
- createdByUserId: z.string().nullable()
1330
+ /**
1331
+ * Single acq_deal_tasks row (camelCase API representation).
1332
+ * Matches AcqDealTask domain type from types.ts.
1333
+ */
1334
+ export const DealTaskResponseSchema = z.object({
1335
+ id: z.string(),
1336
+ organizationId: z.string(),
1337
+ dealId: z.string(),
1338
+ title: z.string(),
1339
+ description: z.string().nullable(),
1340
+ kind: AcqDealTaskKindSchema,
1341
+ dueAt: z.string().nullable(),
1342
+ assigneeUserId: z.string().nullable(),
1343
+ completedAt: z.string().nullable(),
1344
+ completedByUserId: z.string().nullable(),
1345
+ createdAt: z.string(),
1346
+ updatedAt: z.string(),
1347
+ createdByUserId: z.string().nullable()
1246
1348
  })
1247
1349
  ```
1248
1350
 
@@ -1255,43 +1357,45 @@ export const DealTaskListResponseSchema = z.array(DealTaskResponseSchema)
1255
1357
  ### `DealSchemas`
1256
1358
 
1257
1359
  ```typescript
1258
- export const DealSchemas = {
1259
- // Params
1260
- DealIdParams: DealIdParamsSchema,
1261
- DealTaskIdParams: DealTaskIdParamsSchema,
1262
-
1263
- // Queries
1264
- ListDealsQuery: ListDealsQuerySchema,
1265
- DealLookupQuery: DealLookupQuerySchema,
1266
- ListDealTasksDueQuery: ListDealTasksDueQuerySchema,
1267
-
1268
- // Request bodies
1269
- CreateDealNoteRequest: CreateDealNoteRequestSchema,
1270
- CreateDealTaskRequest: CreateDealTaskRequestSchema,
1271
- TransitionItemRequest: TransitionItemRequestSchema,
1272
- TransitionDealStateRequest: TransitionDealStateRequestSchema,
1273
- ExecuteActionParams: ExecuteActionParamsSchema,
1274
- ExecuteActionRequest: ExecuteActionRequestSchema,
1275
-
1276
- // Responses
1277
- DealListResponse: DealListResponseSchema,
1278
- DealSummaryResponse: DealSummaryResponseSchema,
1279
- DealLookupResponse: DealLookupResponseSchema,
1280
- DealDetailResponse: DealDetailResponseSchema,
1281
- DealNoteResponse: DealNoteResponseSchema,
1282
- DealNoteListResponse: DealNoteListResponseSchema,
1283
- DealTaskResponse: DealTaskResponseSchema,
1284
- DealTaskListResponse: DealTaskListResponseSchema
1360
+ export const DealSchemas = {
1361
+ // Params
1362
+ DealIdParams: DealIdParamsSchema,
1363
+ DealTaskIdParams: DealTaskIdParamsSchema,
1364
+
1365
+ // Queries
1366
+ ListDealsQuery: ListDealsQuerySchema,
1367
+ DealLookupQuery: DealLookupQuerySchema,
1368
+ ListDealTasksDueQuery: ListDealTasksDueQuerySchema,
1369
+
1370
+ // Request bodies
1371
+ CreateDealNoteRequest: CreateDealNoteRequestSchema,
1372
+ CreateDealTaskRequest: CreateDealTaskRequestSchema,
1373
+ TransitionItemRequest: TransitionItemRequestSchema,
1374
+ TransitionDealStateRequest: TransitionDealStateRequestSchema,
1375
+ ExecuteActionParams: ExecuteActionParamsSchema,
1376
+ ExecuteActionRequest: ExecuteActionRequestSchema,
1377
+
1378
+ // Responses
1379
+ DealPriority: DealPrioritySchema,
1380
+ DealListResponse: DealListResponseSchema,
1381
+ DealSummaryResponse: DealSummaryResponseSchema,
1382
+ DealLookupResponse: DealLookupResponseSchema,
1383
+ ConversationMessage: ConversationMessageSchema,
1384
+ DealDetailResponse: DealDetailResponseSchema,
1385
+ DealNoteResponse: DealNoteResponseSchema,
1386
+ DealNoteListResponse: DealNoteListResponseSchema,
1387
+ DealTaskResponse: DealTaskResponseSchema,
1388
+ DealTaskListResponse: DealTaskListResponseSchema
1285
1389
  }
1286
1390
  ```
1287
1391
 
1288
1392
  ### `Action`
1289
1393
 
1290
1394
  ```typescript
1291
- export interface Action {
1292
- key: string
1293
- label: string
1294
- payloadSchema?: z.ZodTypeAny
1395
+ export interface Action {
1396
+ key: string
1397
+ label: string
1398
+ payloadSchema?: z.ZodTypeAny
1295
1399
  }
1296
1400
  ```
1297
1401
 
@@ -1310,83 +1414,84 @@ export interface ActionDef {
1310
1414
  ### `DEFAULT_CRM_ACTIONS`
1311
1415
 
1312
1416
  ```typescript
1313
- export const DEFAULT_CRM_ACTIONS: ActionDef[] = [
1314
- {
1315
- key: 'move_to_proposal',
1316
- label: 'Move to Proposal',
1317
- isAvailableFor: (deal) => deal.stage_key === 'interested',
1318
- workflowId: 'move_to_proposal-workflow'
1319
- },
1320
- {
1321
- key: 'move_to_closing',
1322
- label: 'Move to Closing',
1323
- isAvailableFor: (deal) => deal.stage_key === 'proposal',
1324
- workflowId: 'move_to_closing-workflow'
1325
- },
1326
- {
1327
- key: 'move_to_closed_won',
1328
- label: 'Close Won',
1329
- isAvailableFor: (deal) => deal.stage_key === 'closing',
1330
- workflowId: 'move_to_closed_won-workflow'
1331
- },
1332
- {
1333
- key: 'move_to_closed_lost',
1334
- label: 'Close Lost',
1335
- isAvailableFor: (deal) =>
1336
- deal.stage_key === 'interested' || deal.stage_key === 'proposal' || deal.stage_key === 'closing',
1337
- workflowId: 'move_to_closed_lost-workflow'
1338
- },
1339
- {
1340
- key: 'move_to_nurturing',
1341
- label: 'Move to Nurturing',
1342
- isAvailableFor: (deal) =>
1343
- deal.stage_key === 'interested' || deal.stage_key === 'proposal' || deal.stage_key === 'closing',
1344
- workflowId: 'move_to_nurturing-workflow'
1345
- },
1346
- {
1417
+ export const DEFAULT_CRM_ACTIONS: ActionDef[] = [
1418
+ {
1419
+ key: 'move_to_proposal',
1420
+ label: 'Move to Proposal',
1421
+ isAvailableFor: (deal) => deal.stage_key === 'interested',
1422
+ workflowId: 'move_to_proposal-workflow'
1423
+ },
1424
+ {
1425
+ key: 'move_to_closing',
1426
+ label: 'Move to Closing',
1427
+ isAvailableFor: (deal) => deal.stage_key === 'proposal',
1428
+ workflowId: 'move_to_closing-workflow'
1429
+ },
1430
+ {
1431
+ key: 'move_to_closed_won',
1432
+ label: 'Close Won',
1433
+ isAvailableFor: (deal) => deal.stage_key === 'closing',
1434
+ workflowId: 'move_to_closed_won-workflow'
1435
+ },
1436
+ {
1437
+ key: 'move_to_closed_lost',
1438
+ label: 'Close Lost',
1439
+ isAvailableFor: (deal) =>
1440
+ deal.stage_key === 'interested' || deal.stage_key === 'proposal' || deal.stage_key === 'closing',
1441
+ workflowId: 'move_to_closed_lost-workflow'
1442
+ },
1443
+ {
1444
+ key: 'move_to_nurturing',
1445
+ label: 'Move to Nurturing',
1446
+ isAvailableFor: (deal) =>
1447
+ deal.stage_key === 'interested' || deal.stage_key === 'proposal' || deal.stage_key === 'closing',
1448
+ workflowId: 'move_to_nurturing-workflow'
1449
+ },
1450
+ {
1347
1451
  key: 'send_reply',
1348
1452
  label: 'Send Reply',
1349
1453
  isAvailableFor: (deal) =>
1350
1454
  deal.stage_key === 'interested' &&
1455
+ isOurReplyAction(deal) &&
1351
1456
  (deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey ||
1352
1457
  deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey ||
1353
1458
  deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey),
1354
- workflowId: 'crm-send-reply-workflow',
1355
- payloadSchema: SendReplyActionPayloadSchema
1356
- },
1357
- {
1358
- key: 'send_link',
1359
- label: 'Send Booking Link',
1360
- isAvailableFor: (deal) =>
1361
- deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey,
1362
- workflowId: 'crm-send-booking-link-workflow'
1363
- },
1364
- {
1365
- key: 'send_nudge',
1366
- label: 'Send Nudge',
1367
- isAvailableFor: (deal) =>
1368
- deal.stage_key === 'interested' &&
1369
- (deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey ||
1370
- deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey),
1371
- workflowId: 'crm-send-nudge-workflow'
1372
- },
1373
- {
1374
- key: 'mark_no_show',
1375
- label: 'Mark No-Show',
1376
- isAvailableFor: (deal) =>
1377
- deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey,
1378
- // Mirrors the auto-timeout precedent in operations/sales/crm/pipeline/timeout-actions.ts:
1379
- // both manual-click and timeout move the deal to closed_lost. The action_taken activity
1380
- // event captures operator intent and distinguishes the manual variant from the timed one.
1381
- workflowId: 'mark_no_show-workflow'
1382
- },
1383
- {
1384
- key: 'rebook',
1385
- label: 'Rebook',
1386
- isAvailableFor: (deal) =>
1387
- deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_BOOKING_CANCELLED_STATE.stateKey,
1388
- workflowId: 'crm-rebook-workflow'
1389
- }
1459
+ workflowId: 'crm-send-reply-workflow',
1460
+ payloadSchema: SendReplyActionPayloadSchema
1461
+ },
1462
+ {
1463
+ key: 'send_link',
1464
+ label: 'Send Booking Link',
1465
+ isAvailableFor: (deal) =>
1466
+ deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey,
1467
+ workflowId: 'crm-send-booking-link-workflow'
1468
+ },
1469
+ {
1470
+ key: 'send_nudge',
1471
+ label: 'Send Nudge',
1472
+ isAvailableFor: (deal) =>
1473
+ deal.stage_key === 'interested' &&
1474
+ (deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey ||
1475
+ deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey),
1476
+ workflowId: 'crm-send-nudge-workflow'
1477
+ },
1478
+ {
1479
+ key: 'mark_no_show',
1480
+ label: 'Mark No-Show',
1481
+ isAvailableFor: (deal) =>
1482
+ deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey,
1483
+ // Mirrors the auto-timeout precedent in operations/sales/crm/pipeline/timeout-actions.ts:
1484
+ // both manual-click and timeout move the deal to closed_lost. The action_taken activity
1485
+ // event captures operator intent and distinguishes the manual variant from the timed one.
1486
+ workflowId: 'mark_no_show-workflow'
1487
+ },
1488
+ {
1489
+ key: 'rebook',
1490
+ label: 'Rebook',
1491
+ isAvailableFor: (deal) =>
1492
+ deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_BOOKING_CANCELLED_STATE.stateKey,
1493
+ workflowId: 'crm-rebook-workflow'
1494
+ }
1390
1495
  ]
1391
1496
  ```
1392
1497
 
@@ -1561,7 +1666,7 @@ export interface AcqList {
1561
1666
  scrapingConfig: ScrapingConfig
1562
1667
  icp: IcpRubric
1563
1668
  pipelineConfig: PipelineConfig
1564
- metadata: Record<string, unknown>
1669
+ metadata: AcqListMetadata
1565
1670
  launchedAt: Date | null
1566
1671
  completedAt: Date | null
1567
1672
  createdAt: Date
@@ -1645,10 +1750,10 @@ export interface AcqContact {
1645
1750
 
1646
1751
  ```typescript
1647
1752
  /**
1648
- * Live-scan aggregate telemetry for a single list, computed on demand from
1649
- * the list junction tables and current contact deliverability state.
1650
- * `stageCounts` are attempted counts from list-row processing_state.
1651
- */
1753
+ * Live-scan aggregate telemetry for a single list, computed on demand from
1754
+ * the list junction tables and current contact deliverability state.
1755
+ * `stageCounts` are attempted counts from list-row processing_state.
1756
+ */
1652
1757
  export interface ListTelemetry {
1653
1758
  listId: string
1654
1759
  totalCompanies: number
@@ -1677,167 +1782,180 @@ export interface ListTelemetry {
1677
1782
  ### `ListStageCountsSchema`
1678
1783
 
1679
1784
  ```typescript
1680
- export const ListStageCountsSchema = z.object({
1681
- // Attempted counts by canonical lead-gen stage. The detailed status
1682
- // distribution lives on ListProgress; telemetry keeps the overview payload small.
1683
- stageCounts: z.object({
1684
- populated: z.number().int(),
1685
- extracted: z.number().int(),
1686
- qualified: z.number().int(),
1687
- discovered: z.number().int(),
1688
- verified: z.number().int(),
1689
- personalized: z.number().int(),
1690
- uploaded: z.number().int()
1691
- }),
1692
- deliverability: z.object({
1693
- valid: z.number().int(),
1694
- risky: z.number().int(),
1695
- invalid: z.number().int(),
1696
- unknown: z.number().int(),
1697
- bounced: z.number().int()
1698
- })
1785
+ export const ListStageCountsSchema = z.object({
1786
+ // Attempted counts by canonical lead-gen stage. The detailed status
1787
+ // distribution lives on ListProgress; telemetry keeps the overview payload small.
1788
+ stageCounts: z.object({
1789
+ populated: z.number().int(),
1790
+ extracted: z.number().int(),
1791
+ qualified: z.number().int(),
1792
+ discovered: z.number().int(),
1793
+ verified: z.number().int(),
1794
+ personalized: z.number().int(),
1795
+ uploaded: z.number().int()
1796
+ }),
1797
+ deliverability: z.object({
1798
+ valid: z.number().int(),
1799
+ risky: z.number().int(),
1800
+ invalid: z.number().int(),
1801
+ unknown: z.number().int(),
1802
+ bounced: z.number().int()
1803
+ })
1699
1804
  })
1700
1805
  ```
1701
1806
 
1702
1807
  ### `ListTelemetrySchema`
1703
1808
 
1704
1809
  ```typescript
1705
- export const ListTelemetrySchema = z.object({
1706
- listId: UuidSchema,
1707
- totalCompanies: z.number().int(),
1708
- totalContacts: z.number().int(),
1709
- stageCounts: ListStageCountsSchema.shape.stageCounts,
1710
- deliverability: ListStageCountsSchema.shape.deliverability,
1711
- activeWorkflows: z.array(z.string()).optional()
1810
+ export const ListTelemetrySchema = z.object({
1811
+ listId: UuidSchema,
1812
+ totalCompanies: z.number().int(),
1813
+ totalContacts: z.number().int(),
1814
+ stageCounts: ListStageCountsSchema.shape.stageCounts,
1815
+ deliverability: ListStageCountsSchema.shape.deliverability,
1816
+ activeWorkflows: z.array(z.string()).optional()
1712
1817
  })
1713
1818
  ```
1714
1819
 
1715
1820
  ### `ListIdParamsSchema`
1716
1821
 
1717
1822
  ```typescript
1718
- export const ListIdParamsSchema = z.object({
1719
- listId: UuidSchema
1823
+ export const ListIdParamsSchema = z.object({
1824
+ listId: UuidSchema
1720
1825
  })
1721
1826
  ```
1722
1827
 
1723
1828
  ### `CreateListRequestSchema`
1724
1829
 
1725
1830
  ```typescript
1726
- export const CreateListRequestSchema = z
1727
- .object({
1728
- name: z.string().trim().min(1).max(255),
1729
- description: z.string().trim().nullable().optional(),
1730
- status: ListStatusSchema.optional(),
1731
- scrapingConfig: ScrapingConfigSchema.optional(),
1732
- icp: IcpRubricSchema.optional(),
1733
- pipelineConfig: PipelineConfigSchema.optional()
1734
- })
1831
+ export const CreateListRequestSchema = z
1832
+ .object({
1833
+ name: z.string().trim().min(1).max(255),
1834
+ description: z.string().trim().nullable().optional(),
1835
+ status: ListStatusSchema.optional(),
1836
+ buildTemplateId: ProspectingBuildTemplateIdSchema.optional(),
1837
+ scrapingConfig: ScrapingConfigSchema.optional(),
1838
+ icp: IcpRubricSchema.optional(),
1839
+ pipelineConfig: PipelineConfigSchema.optional()
1840
+ })
1735
1841
  .strict()
1736
1842
  ```
1737
1843
 
1738
1844
  ### `UpdateListRequestSchema`
1739
1845
 
1740
1846
  ```typescript
1741
- export const UpdateListRequestSchema = z
1742
- .object({
1743
- name: z.string().trim().min(1).max(255).optional(),
1744
- description: z.string().trim().nullable().optional(),
1745
- batchIds: z.array(z.string()).optional()
1746
- })
1747
- .strict()
1748
- .refine((data) => data.name !== undefined || data.description !== undefined || data.batchIds !== undefined, {
1749
- message: 'At least one field (name, description, or batchIds) must be provided'
1847
+ export const UpdateListRequestSchema = z
1848
+ .object({
1849
+ name: z.string().trim().min(1).max(255).optional(),
1850
+ description: z.string().trim().nullable().optional(),
1851
+ batchIds: z.array(z.string()).optional(),
1852
+ buildTemplateId: ProspectingBuildTemplateIdSchema.optional(),
1853
+ confirmBuildTemplateChange: z.literal(true).optional()
1854
+ })
1855
+ .strict()
1856
+ .refine(
1857
+ (data) =>
1858
+ data.name !== undefined ||
1859
+ data.description !== undefined ||
1860
+ data.batchIds !== undefined ||
1861
+ data.buildTemplateId !== undefined,
1862
+ {
1863
+ message: 'At least one field (name, description, batchIds, or buildTemplateId) must be provided'
1864
+ }
1865
+ )
1866
+ .refine((data) => data.buildTemplateId === undefined || data.confirmBuildTemplateChange === true, {
1867
+ message: 'confirmBuildTemplateChange must be true when changing buildTemplateId',
1868
+ path: ['confirmBuildTemplateChange']
1750
1869
  })
1751
1870
  ```
1752
1871
 
1753
1872
  ### `UpdateListConfigRequestSchema`
1754
1873
 
1755
1874
  ```typescript
1756
- /**
1757
- * Partial patch for the three jsonb config columns. UI sends only the edited
1758
- * subtree; server writes the field as-is (no deep merge — each column is
1759
- * replaced atomically when present in the patch).
1760
- */
1761
- export const UpdateListConfigRequestSchema = z
1762
- .object({
1763
- scrapingConfig: ScrapingConfigSchema.partial().optional(),
1764
- icp: IcpRubricSchema.partial().optional(),
1765
- pipelineConfig: PipelineConfigSchema.partial().optional()
1766
- })
1767
- .strict()
1768
- .refine((data) => data.scrapingConfig !== undefined || data.icp !== undefined || data.pipelineConfig !== undefined, {
1769
- message: 'At least one of scrapingConfig, icp, or pipelineConfig must be provided'
1875
+ /**
1876
+ * Partial patch for the three jsonb config columns. UI sends only the edited
1877
+ * subtree; server writes the field as-is (no deep merge — each column is
1878
+ * replaced atomically when present in the patch).
1879
+ */
1880
+ export const UpdateListConfigRequestSchema = z
1881
+ .object({
1882
+ scrapingConfig: ScrapingConfigSchema.partial().optional(),
1883
+ icp: IcpRubricSchema.partial().optional(),
1884
+ pipelineConfig: PipelineConfigSchema.partial().optional()
1885
+ })
1886
+ .strict()
1887
+ .refine((data) => data.scrapingConfig !== undefined || data.icp !== undefined || data.pipelineConfig !== undefined, {
1888
+ message: 'At least one of scrapingConfig, icp, or pipelineConfig must be provided'
1770
1889
  })
1771
1890
  ```
1772
1891
 
1773
1892
  ### `AddCompaniesToListRequestSchema`
1774
1893
 
1775
1894
  ```typescript
1776
- export const AddCompaniesToListRequestSchema = z
1777
- .object({
1778
- companyIds: z.array(UuidSchema).min(1).max(1000)
1779
- })
1895
+ export const AddCompaniesToListRequestSchema = z
1896
+ .object({
1897
+ companyIds: z.array(UuidSchema).min(1).max(1000)
1898
+ })
1780
1899
  .strict()
1781
1900
  ```
1782
1901
 
1783
1902
  ### `RemoveCompaniesFromListRequestSchema`
1784
1903
 
1785
1904
  ```typescript
1786
- export const RemoveCompaniesFromListRequestSchema = z
1787
- .object({
1788
- companyIds: z.array(UuidSchema).min(1).max(1000)
1789
- })
1905
+ export const RemoveCompaniesFromListRequestSchema = z
1906
+ .object({
1907
+ companyIds: z.array(UuidSchema).min(1).max(1000)
1908
+ })
1790
1909
  .strict()
1791
1910
  ```
1792
1911
 
1793
1912
  ### `AddContactsToListRequestSchema`
1794
1913
 
1795
1914
  ```typescript
1796
- export const AddContactsToListRequestSchema = z
1797
- .object({
1798
- contactIds: z.array(UuidSchema).min(1).max(1000)
1799
- })
1915
+ export const AddContactsToListRequestSchema = z
1916
+ .object({
1917
+ contactIds: z.array(UuidSchema).min(1).max(1000)
1918
+ })
1800
1919
  .strict()
1801
1920
  ```
1802
1921
 
1803
1922
  ### `RecordListExecutionRequestSchema`
1804
1923
 
1805
1924
  ```typescript
1806
- export const RecordListExecutionRequestSchema = z
1807
- .object({
1808
- executionId: UuidSchema,
1809
- configSnapshot: z.record(z.string(), z.unknown()).optional()
1810
- })
1925
+ export const RecordListExecutionRequestSchema = z
1926
+ .object({
1927
+ executionId: UuidSchema,
1928
+ configSnapshot: z.record(z.string(), z.unknown()).optional()
1929
+ })
1811
1930
  .strict()
1812
1931
  ```
1813
1932
 
1814
1933
  ### `AcqListResponseSchema`
1815
1934
 
1816
1935
  ```typescript
1817
- /**
1818
- * Single list as returned by /api/acquisition/lists/:id etc.
1819
- * Camel-cased domain shape matching AcqList in types.ts.
1820
- */
1821
- export const AcqListResponseSchema = z.object({
1822
- id: z.string(),
1823
- organizationId: z.string(),
1824
- name: z.string(),
1825
- description: z.string().nullable(),
1826
- type: z.string(),
1827
- batchIds: z.array(z.string()),
1828
- instantlyCampaignId: z.string().nullable(),
1829
- /** Lifecycle status (draft | enriching | launched | closing | archived). */
1830
- status: ListStatusSchema,
1831
- metadata: z.record(z.string(), z.unknown()),
1832
- launchedAt: z.string().nullable(),
1833
- completedAt: z.string().nullable(),
1834
- createdAt: z.string(),
1835
- /** Scraping criteria stored as jsonb on the row. */
1836
- scrapingConfig: ScrapingConfigSchema,
1837
- /** ICP / qualification rubric stored as jsonb on the row. */
1838
- icp: IcpRubricSchema,
1839
- /** Pipeline presentation contract stored as jsonb on the row. */
1840
- pipelineConfig: PipelineConfigSchema
1936
+ /**
1937
+ * Single list as returned by /api/acquisition/lists/:id etc.
1938
+ * Camel-cased domain shape matching AcqList in types.ts.
1939
+ */
1940
+ export const AcqListResponseSchema = z.object({
1941
+ id: z.string(),
1942
+ organizationId: z.string(),
1943
+ name: z.string(),
1944
+ description: z.string().nullable(),
1945
+ batchIds: z.array(z.string()),
1946
+ instantlyCampaignId: z.string().nullable(),
1947
+ /** Lifecycle status (draft | enriching | launched | closing | archived). */
1948
+ status: ListStatusSchema,
1949
+ metadata: AcqListMetadataSchema,
1950
+ launchedAt: z.string().nullable(),
1951
+ completedAt: z.string().nullable(),
1952
+ createdAt: z.string(),
1953
+ /** Scraping criteria stored as jsonb on the row. */
1954
+ scrapingConfig: ScrapingConfigSchema,
1955
+ /** ICP / qualification rubric stored as jsonb on the row. */
1956
+ icp: IcpRubricSchema,
1957
+ /** Pipeline presentation contract stored as jsonb on the row. */
1958
+ pipelineConfig: PipelineConfigSchema
1841
1959
  })
1842
1960
  ```
1843
1961
 
@@ -1862,17 +1980,17 @@ export const ListTelemetryListResponseSchema = z.array(ListTelemetrySchema)
1862
1980
  ### `ListExecutionSummarySchema`
1863
1981
 
1864
1982
  ```typescript
1865
- /**
1866
- * Row from acq_list_executions joined with the execution summary,
1867
- * shaped for the /lists/:id/executions response.
1868
- */
1869
- export const ListExecutionSummarySchema = z.object({
1870
- executionId: z.string(),
1871
- resourceId: z.string(),
1872
- status: z.string(),
1873
- createdAt: z.string(),
1874
- completedAt: z.string().nullable(),
1875
- durationMs: z.number().int().nullable()
1983
+ /**
1984
+ * Row from acq_list_executions joined with the execution summary,
1985
+ * shaped for the /lists/:id/executions response.
1986
+ */
1987
+ export const ListExecutionSummarySchema = z.object({
1988
+ executionId: z.string(),
1989
+ resourceId: z.string(),
1990
+ status: z.string(),
1991
+ createdAt: z.string(),
1992
+ completedAt: z.string().nullable(),
1993
+ durationMs: z.number().int().nullable()
1876
1994
  })
1877
1995
  ```
1878
1996
 
@@ -1903,282 +2021,282 @@ export const AcqEmailValidSchema = z.enum(['VALID', 'INVALID', 'RISKY', 'UNKNOWN
1903
2021
  ### `CompanyIdParamsSchema`
1904
2022
 
1905
2023
  ```typescript
1906
- export const CompanyIdParamsSchema = z.object({
1907
- companyId: UuidSchema
2024
+ export const CompanyIdParamsSchema = z.object({
2025
+ companyId: UuidSchema
1908
2026
  })
1909
2027
  ```
1910
2028
 
1911
2029
  ### `ContactIdParamsSchema`
1912
2030
 
1913
2031
  ```typescript
1914
- export const ContactIdParamsSchema = z.object({
1915
- contactId: UuidSchema
2032
+ export const ContactIdParamsSchema = z.object({
2033
+ contactId: UuidSchema
1916
2034
  })
1917
2035
  ```
1918
2036
 
1919
2037
  ### `ListCompaniesQuerySchema`
1920
2038
 
1921
2039
  ```typescript
1922
- export const ListCompaniesQuerySchema = z
1923
- .object({
1924
- search: z.string().trim().min(1).max(200).optional(),
1925
- listId: UuidSchema.optional(),
1926
- domain: z.string().trim().min(1).max(255).optional(),
1927
- website: z.string().trim().min(1).max(2048).optional(),
1928
- segment: z.string().trim().min(1).max(255).optional(),
1929
- category: z.string().trim().min(1).max(255).optional(),
1930
- batchId: z.string().trim().min(1).max(255).optional(),
1931
- status: AcqCompanyStatusSchema.optional(),
1932
- includeAll: QueryBooleanSchema.optional(),
1933
- limit: z.coerce.number().int().min(1).max(5000).default(50),
1934
- offset: z.coerce.number().int().min(0).default(0)
1935
- })
2040
+ export const ListCompaniesQuerySchema = z
2041
+ .object({
2042
+ search: z.string().trim().min(1).max(200).optional(),
2043
+ listId: UuidSchema.optional(),
2044
+ domain: z.string().trim().min(1).max(255).optional(),
2045
+ website: z.string().trim().min(1).max(2048).optional(),
2046
+ segment: z.string().trim().min(1).max(255).optional(),
2047
+ category: z.string().trim().min(1).max(255).optional(),
2048
+ batchId: z.string().trim().min(1).max(255).optional(),
2049
+ status: AcqCompanyStatusSchema.optional(),
2050
+ includeAll: QueryBooleanSchema.optional(),
2051
+ limit: z.coerce.number().int().min(1).max(5000).default(50),
2052
+ offset: z.coerce.number().int().min(0).default(0)
2053
+ })
1936
2054
  .strict()
1937
2055
  ```
1938
2056
 
1939
2057
  ### `ListContactsQuerySchema`
1940
2058
 
1941
2059
  ```typescript
1942
- export const ListContactsQuerySchema = z
1943
- .object({
1944
- search: z.string().trim().min(1).max(200).optional(),
1945
- listId: UuidSchema.optional(),
1946
- openingLineIsNull: QueryBooleanSchema.optional(),
1947
- batchId: z.string().trim().min(1).max(255).optional(),
1948
- contactStatus: AcqContactStatusSchema.optional(),
1949
- limit: z.coerce.number().int().min(1).max(5000).default(5000),
1950
- offset: z.coerce.number().int().min(0).default(0)
1951
- })
2060
+ export const ListContactsQuerySchema = z
2061
+ .object({
2062
+ search: z.string().trim().min(1).max(200).optional(),
2063
+ listId: UuidSchema.optional(),
2064
+ openingLineIsNull: QueryBooleanSchema.optional(),
2065
+ batchId: z.string().trim().min(1).max(255).optional(),
2066
+ contactStatus: AcqContactStatusSchema.optional(),
2067
+ limit: z.coerce.number().int().min(1).max(5000).default(5000),
2068
+ offset: z.coerce.number().int().min(0).default(0)
2069
+ })
1952
2070
  .strict()
1953
2071
  ```
1954
2072
 
1955
2073
  ### `CreateCompanyRequestSchema`
1956
2074
 
1957
2075
  ```typescript
1958
- export const CreateCompanyRequestSchema = z
1959
- .object({
1960
- name: z.string().trim().min(1).max(255),
1961
- domain: z.string().trim().min(1).max(255).optional(),
1962
- linkedinUrl: z.string().trim().url().optional(),
1963
- website: z.string().trim().url().optional(),
1964
- numEmployees: z.number().int().min(0).optional(),
1965
- foundedYear: z.number().int().optional(),
1966
- locationCity: z.string().trim().min(1).max(255).optional(),
1967
- locationState: z.string().trim().min(1).max(255).optional(),
1968
- category: z.string().trim().min(1).max(255).optional(),
1969
- source: z.string().trim().min(1).max(255).optional(),
1970
- batchId: z.string().trim().min(1).max(255).optional(),
1971
- verticalResearch: z.string().trim().min(1).max(5000).optional()
1972
- })
2076
+ export const CreateCompanyRequestSchema = z
2077
+ .object({
2078
+ name: z.string().trim().min(1).max(255),
2079
+ domain: z.string().trim().min(1).max(255).optional(),
2080
+ linkedinUrl: z.string().trim().url().optional(),
2081
+ website: z.string().trim().url().optional(),
2082
+ numEmployees: z.number().int().min(0).optional(),
2083
+ foundedYear: z.number().int().optional(),
2084
+ locationCity: z.string().trim().min(1).max(255).optional(),
2085
+ locationState: z.string().trim().min(1).max(255).optional(),
2086
+ category: z.string().trim().min(1).max(255).optional(),
2087
+ source: z.string().trim().min(1).max(255).optional(),
2088
+ batchId: z.string().trim().min(1).max(255).optional(),
2089
+ verticalResearch: z.string().trim().min(1).max(5000).optional()
2090
+ })
1973
2091
  .strict()
1974
2092
  ```
1975
2093
 
1976
2094
  ### `UpdateCompanyRequestSchema`
1977
2095
 
1978
2096
  ```typescript
1979
- export const UpdateCompanyRequestSchema = z
1980
- .object({
1981
- name: z.string().trim().min(1).max(255).optional(),
1982
- domain: z.string().trim().min(1).max(255).optional(),
1983
- linkedinUrl: z.string().trim().url().optional(),
1984
- website: z.string().trim().url().optional(),
1985
- numEmployees: z.number().int().min(0).optional(),
1986
- foundedYear: z.number().int().optional(),
1987
- locationCity: z.string().trim().min(1).max(255).optional(),
1988
- locationState: z.string().trim().min(1).max(255).optional(),
1989
- category: z.string().trim().min(1).max(255).optional(),
1990
- segment: z.string().trim().min(1).max(255).optional(),
1991
- pipelineStatus: z.record(z.string(), z.unknown()).optional(),
1992
- enrichmentData: z.record(z.string(), z.unknown()).optional(),
1993
- source: z.string().trim().min(1).max(255).optional(),
1994
- batchId: z.string().trim().min(1).max(255).optional(),
1995
- status: AcqCompanyStatusSchema.optional(),
1996
- verticalResearch: z.string().trim().min(1).max(5000).nullable().optional()
1997
- })
1998
- .strict()
1999
- .refine(
2000
- (data) =>
2001
- data.name !== undefined ||
2002
- data.domain !== undefined ||
2003
- data.linkedinUrl !== undefined ||
2004
- data.website !== undefined ||
2005
- data.numEmployees !== undefined ||
2006
- data.foundedYear !== undefined ||
2007
- data.locationCity !== undefined ||
2008
- data.locationState !== undefined ||
2009
- data.category !== undefined ||
2010
- data.segment !== undefined ||
2011
- data.pipelineStatus !== undefined ||
2012
- data.enrichmentData !== undefined ||
2013
- data.source !== undefined ||
2014
- data.batchId !== undefined ||
2015
- data.status !== undefined ||
2016
- data.verticalResearch !== undefined,
2017
- {
2018
- message: 'At least one field must be provided'
2019
- }
2097
+ export const UpdateCompanyRequestSchema = z
2098
+ .object({
2099
+ name: z.string().trim().min(1).max(255).optional(),
2100
+ domain: z.string().trim().min(1).max(255).optional(),
2101
+ linkedinUrl: z.string().trim().url().optional(),
2102
+ website: z.string().trim().url().optional(),
2103
+ numEmployees: z.number().int().min(0).optional(),
2104
+ foundedYear: z.number().int().optional(),
2105
+ locationCity: z.string().trim().min(1).max(255).optional(),
2106
+ locationState: z.string().trim().min(1).max(255).optional(),
2107
+ category: z.string().trim().min(1).max(255).optional(),
2108
+ segment: z.string().trim().min(1).max(255).optional(),
2109
+ pipelineStatus: z.record(z.string(), z.unknown()).optional(),
2110
+ enrichmentData: z.record(z.string(), z.unknown()).optional(),
2111
+ source: z.string().trim().min(1).max(255).optional(),
2112
+ batchId: z.string().trim().min(1).max(255).optional(),
2113
+ status: AcqCompanyStatusSchema.optional(),
2114
+ verticalResearch: z.string().trim().min(1).max(5000).nullable().optional()
2115
+ })
2116
+ .strict()
2117
+ .refine(
2118
+ (data) =>
2119
+ data.name !== undefined ||
2120
+ data.domain !== undefined ||
2121
+ data.linkedinUrl !== undefined ||
2122
+ data.website !== undefined ||
2123
+ data.numEmployees !== undefined ||
2124
+ data.foundedYear !== undefined ||
2125
+ data.locationCity !== undefined ||
2126
+ data.locationState !== undefined ||
2127
+ data.category !== undefined ||
2128
+ data.segment !== undefined ||
2129
+ data.pipelineStatus !== undefined ||
2130
+ data.enrichmentData !== undefined ||
2131
+ data.source !== undefined ||
2132
+ data.batchId !== undefined ||
2133
+ data.status !== undefined ||
2134
+ data.verticalResearch !== undefined,
2135
+ {
2136
+ message: 'At least one field must be provided'
2137
+ }
2020
2138
  )
2021
2139
  ```
2022
2140
 
2023
2141
  ### `CreateContactRequestSchema`
2024
2142
 
2025
2143
  ```typescript
2026
- export const CreateContactRequestSchema = z
2027
- .object({
2028
- email: z.string().trim().email(),
2029
- companyId: UuidSchema.optional(),
2030
- firstName: z.string().trim().min(1).max(255).optional(),
2031
- lastName: z.string().trim().min(1).max(255).optional(),
2032
- linkedinUrl: z.string().trim().url().optional(),
2033
- title: z.string().trim().min(1).max(255).optional(),
2034
- source: z.string().trim().min(1).max(255).optional(),
2035
- sourceId: z.string().trim().min(1).max(255).optional(),
2036
- batchId: z.string().trim().min(1).max(255).optional()
2037
- })
2144
+ export const CreateContactRequestSchema = z
2145
+ .object({
2146
+ email: z.string().trim().email(),
2147
+ companyId: UuidSchema.optional(),
2148
+ firstName: z.string().trim().min(1).max(255).optional(),
2149
+ lastName: z.string().trim().min(1).max(255).optional(),
2150
+ linkedinUrl: z.string().trim().url().optional(),
2151
+ title: z.string().trim().min(1).max(255).optional(),
2152
+ source: z.string().trim().min(1).max(255).optional(),
2153
+ sourceId: z.string().trim().min(1).max(255).optional(),
2154
+ batchId: z.string().trim().min(1).max(255).optional()
2155
+ })
2038
2156
  .strict()
2039
2157
  ```
2040
2158
 
2041
2159
  ### `UpdateContactRequestSchema`
2042
2160
 
2043
2161
  ```typescript
2044
- export const UpdateContactRequestSchema = z
2045
- .object({
2046
- companyId: UuidSchema.optional(),
2047
- emailValid: AcqEmailValidSchema.optional(),
2048
- firstName: z.string().trim().min(1).max(255).optional(),
2049
- lastName: z.string().trim().min(1).max(255).optional(),
2050
- linkedinUrl: z.string().trim().url().optional(),
2051
- title: z.string().trim().min(1).max(255).optional(),
2052
- headline: z.string().trim().min(1).max(5000).optional(),
2053
- filterReason: z.string().trim().min(1).max(5000).optional(),
2054
- openingLine: z.string().trim().min(1).max(5000).optional(),
2055
- pipelineStatus: z.record(z.string(), z.unknown()).optional(),
2056
- enrichmentData: z.record(z.string(), z.unknown()).optional(),
2057
- status: AcqContactStatusSchema.optional()
2058
- })
2059
- .strict()
2060
- .refine(
2061
- (data) =>
2062
- data.companyId !== undefined ||
2063
- data.emailValid !== undefined ||
2064
- data.firstName !== undefined ||
2065
- data.lastName !== undefined ||
2066
- data.linkedinUrl !== undefined ||
2067
- data.title !== undefined ||
2068
- data.headline !== undefined ||
2069
- data.filterReason !== undefined ||
2070
- data.openingLine !== undefined ||
2071
- data.pipelineStatus !== undefined ||
2072
- data.enrichmentData !== undefined ||
2073
- data.status !== undefined,
2074
- {
2075
- message: 'At least one field must be provided'
2076
- }
2162
+ export const UpdateContactRequestSchema = z
2163
+ .object({
2164
+ companyId: UuidSchema.optional(),
2165
+ emailValid: AcqEmailValidSchema.optional(),
2166
+ firstName: z.string().trim().min(1).max(255).optional(),
2167
+ lastName: z.string().trim().min(1).max(255).optional(),
2168
+ linkedinUrl: z.string().trim().url().optional(),
2169
+ title: z.string().trim().min(1).max(255).optional(),
2170
+ headline: z.string().trim().min(1).max(5000).optional(),
2171
+ filterReason: z.string().trim().min(1).max(5000).optional(),
2172
+ openingLine: z.string().trim().min(1).max(5000).optional(),
2173
+ pipelineStatus: z.record(z.string(), z.unknown()).optional(),
2174
+ enrichmentData: z.record(z.string(), z.unknown()).optional(),
2175
+ status: AcqContactStatusSchema.optional()
2176
+ })
2177
+ .strict()
2178
+ .refine(
2179
+ (data) =>
2180
+ data.companyId !== undefined ||
2181
+ data.emailValid !== undefined ||
2182
+ data.firstName !== undefined ||
2183
+ data.lastName !== undefined ||
2184
+ data.linkedinUrl !== undefined ||
2185
+ data.title !== undefined ||
2186
+ data.headline !== undefined ||
2187
+ data.filterReason !== undefined ||
2188
+ data.openingLine !== undefined ||
2189
+ data.pipelineStatus !== undefined ||
2190
+ data.enrichmentData !== undefined ||
2191
+ data.status !== undefined,
2192
+ {
2193
+ message: 'At least one field must be provided'
2194
+ }
2077
2195
  )
2078
2196
  ```
2079
2197
 
2080
2198
  ### `AcqCompanyResponseSchema`
2081
2199
 
2082
2200
  ```typescript
2083
- export const AcqCompanyResponseSchema = z.object({
2084
- id: z.string(),
2085
- organizationId: z.string(),
2086
- name: z.string(),
2087
- domain: z.string().nullable(),
2088
- linkedinUrl: z.string().nullable(),
2089
- website: z.string().nullable(),
2090
- numEmployees: z.number().nullable(),
2091
- foundedYear: z.number().nullable(),
2092
- locationCity: z.string().nullable(),
2093
- locationState: z.string().nullable(),
2094
- category: z.string().nullable(),
2095
- categoryPain: z.string().nullable(),
2096
- segment: z.string().nullable(),
2097
- pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
2098
- enrichmentData: z.record(z.string(), z.unknown()).nullable(),
2099
- source: z.string().nullable(),
2100
- batchId: z.string().nullable(),
2101
- status: AcqCompanyStatusSchema,
2102
- contactCount: z.number().int().min(0),
2103
- verticalResearch: z.string().nullable(),
2104
- createdAt: z.string(),
2105
- updatedAt: z.string()
2201
+ export const AcqCompanyResponseSchema = z.object({
2202
+ id: z.string(),
2203
+ organizationId: z.string(),
2204
+ name: z.string(),
2205
+ domain: z.string().nullable(),
2206
+ linkedinUrl: z.string().nullable(),
2207
+ website: z.string().nullable(),
2208
+ numEmployees: z.number().nullable(),
2209
+ foundedYear: z.number().nullable(),
2210
+ locationCity: z.string().nullable(),
2211
+ locationState: z.string().nullable(),
2212
+ category: z.string().nullable(),
2213
+ categoryPain: z.string().nullable(),
2214
+ segment: z.string().nullable(),
2215
+ pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
2216
+ enrichmentData: z.record(z.string(), z.unknown()).nullable(),
2217
+ source: z.string().nullable(),
2218
+ batchId: z.string().nullable(),
2219
+ status: AcqCompanyStatusSchema,
2220
+ contactCount: z.number().int().min(0),
2221
+ verticalResearch: z.string().nullable(),
2222
+ createdAt: z.string(),
2223
+ updatedAt: z.string()
2106
2224
  })
2107
2225
  ```
2108
2226
 
2109
2227
  ### `AcqCompanyListResponseSchema`
2110
2228
 
2111
2229
  ```typescript
2112
- export const AcqCompanyListResponseSchema = z.object({
2113
- data: z.array(AcqCompanyResponseSchema),
2114
- total: z.number().int(),
2115
- limit: z.number().int(),
2116
- offset: z.number().int()
2230
+ export const AcqCompanyListResponseSchema = z.object({
2231
+ data: z.array(AcqCompanyResponseSchema),
2232
+ total: z.number().int(),
2233
+ limit: z.number().int(),
2234
+ offset: z.number().int()
2117
2235
  })
2118
2236
  ```
2119
2237
 
2120
2238
  ### `AcqCompanyFacetsResponseSchema`
2121
2239
 
2122
2240
  ```typescript
2123
- export const AcqCompanyFacetsResponseSchema = z.object({
2124
- segments: z.array(z.string()),
2125
- categories: z.array(z.string()),
2126
- statuses: z.array(AcqCompanyStatusSchema)
2241
+ export const AcqCompanyFacetsResponseSchema = z.object({
2242
+ segments: z.array(z.string()),
2243
+ categories: z.array(z.string()),
2244
+ statuses: z.array(AcqCompanyStatusSchema)
2127
2245
  })
2128
2246
  ```
2129
2247
 
2130
2248
  ### `AcqContactCompanySummarySchema`
2131
2249
 
2132
2250
  ```typescript
2133
- export const AcqContactCompanySummarySchema = z.object({
2134
- id: z.string(),
2135
- name: z.string(),
2136
- domain: z.string().nullable(),
2137
- website: z.string().nullable(),
2138
- linkedinUrl: z.string().nullable(),
2139
- segment: z.string().nullable(),
2140
- category: z.string().nullable(),
2141
- status: AcqCompanyStatusSchema
2251
+ export const AcqContactCompanySummarySchema = z.object({
2252
+ id: z.string(),
2253
+ name: z.string(),
2254
+ domain: z.string().nullable(),
2255
+ website: z.string().nullable(),
2256
+ linkedinUrl: z.string().nullable(),
2257
+ segment: z.string().nullable(),
2258
+ category: z.string().nullable(),
2259
+ status: AcqCompanyStatusSchema
2142
2260
  })
2143
2261
  ```
2144
2262
 
2145
2263
  ### `AcqContactResponseSchema`
2146
2264
 
2147
2265
  ```typescript
2148
- export const AcqContactResponseSchema = z.object({
2149
- id: z.string(),
2150
- organizationId: z.string(),
2151
- companyId: z.string().nullable(),
2152
- email: z.string(),
2153
- emailValid: AcqEmailValidSchema.nullable(),
2154
- firstName: z.string().nullable(),
2155
- lastName: z.string().nullable(),
2156
- linkedinUrl: z.string().nullable(),
2157
- title: z.string().nullable(),
2158
- headline: z.string().nullable(),
2159
- filterReason: z.string().nullable(),
2160
- openingLine: z.string().nullable(),
2161
- source: z.string().nullable(),
2162
- sourceId: z.string().nullable(),
2163
- pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
2164
- enrichmentData: z.record(z.string(), z.unknown()).nullable(),
2165
- attioPersonId: z.string().nullable(),
2166
- batchId: z.string().nullable(),
2167
- status: AcqContactStatusSchema,
2168
- company: AcqContactCompanySummarySchema.nullable().optional(),
2169
- createdAt: z.string(),
2170
- updatedAt: z.string()
2266
+ export const AcqContactResponseSchema = z.object({
2267
+ id: z.string(),
2268
+ organizationId: z.string(),
2269
+ companyId: z.string().nullable(),
2270
+ email: z.string(),
2271
+ emailValid: AcqEmailValidSchema.nullable(),
2272
+ firstName: z.string().nullable(),
2273
+ lastName: z.string().nullable(),
2274
+ linkedinUrl: z.string().nullable(),
2275
+ title: z.string().nullable(),
2276
+ headline: z.string().nullable(),
2277
+ filterReason: z.string().nullable(),
2278
+ openingLine: z.string().nullable(),
2279
+ source: z.string().nullable(),
2280
+ sourceId: z.string().nullable(),
2281
+ pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
2282
+ enrichmentData: z.record(z.string(), z.unknown()).nullable(),
2283
+ attioPersonId: z.string().nullable(),
2284
+ batchId: z.string().nullable(),
2285
+ status: AcqContactStatusSchema,
2286
+ company: AcqContactCompanySummarySchema.nullable().optional(),
2287
+ createdAt: z.string(),
2288
+ updatedAt: z.string()
2171
2289
  })
2172
2290
  ```
2173
2291
 
2174
2292
  ### `AcqContactListResponseSchema`
2175
2293
 
2176
2294
  ```typescript
2177
- export const AcqContactListResponseSchema = z.object({
2178
- data: z.array(AcqContactResponseSchema),
2179
- total: z.number().int(),
2180
- limit: z.number().int(),
2181
- offset: z.number().int()
2295
+ export const AcqContactListResponseSchema = z.object({
2296
+ data: z.array(AcqContactResponseSchema),
2297
+ total: z.number().int(),
2298
+ limit: z.number().int(),
2299
+ offset: z.number().int()
2182
2300
  })
2183
2301
  ```
2184
2302
 
@@ -2191,223 +2309,226 @@ export const AcqArtifactOwnerKindSchema = z.enum(['company', 'contact', 'deal',
2191
2309
  ### `ListArtifactsQuerySchema`
2192
2310
 
2193
2311
  ```typescript
2194
- export const ListArtifactsQuerySchema = z
2195
- .object({
2196
- ownerKind: AcqArtifactOwnerKindSchema,
2197
- ownerId: UuidSchema
2198
- })
2312
+ export const ListArtifactsQuerySchema = z
2313
+ .object({
2314
+ ownerKind: AcqArtifactOwnerKindSchema,
2315
+ ownerId: UuidSchema
2316
+ })
2199
2317
  .strict()
2200
2318
  ```
2201
2319
 
2202
2320
  ### `CreateArtifactRequestSchema`
2203
2321
 
2204
2322
  ```typescript
2205
- export const CreateArtifactRequestSchema = z
2206
- .object({
2207
- ownerKind: AcqArtifactOwnerKindSchema,
2208
- ownerId: UuidSchema,
2209
- kind: z.string().trim().min(1).max(255),
2210
- content: z.record(z.string(), z.unknown()),
2211
- sourceExecutionId: UuidSchema.optional()
2212
- })
2323
+ export const CreateArtifactRequestSchema = z
2324
+ .object({
2325
+ ownerKind: AcqArtifactOwnerKindSchema,
2326
+ ownerId: UuidSchema,
2327
+ kind: z.string().trim().min(1).max(255),
2328
+ content: z.record(z.string(), z.unknown()),
2329
+ sourceExecutionId: UuidSchema.optional()
2330
+ })
2213
2331
  .strict()
2214
2332
  ```
2215
2333
 
2216
2334
  ### `AcqArtifactResponseSchema`
2217
2335
 
2218
2336
  ```typescript
2219
- export const AcqArtifactResponseSchema = z.object({
2220
- id: z.string(),
2221
- organizationId: z.string(),
2222
- ownerKind: z.string(),
2223
- ownerId: z.string(),
2224
- kind: z.string(),
2225
- content: z.record(z.string(), z.unknown()),
2226
- sourceExecutionId: z.string().nullable(),
2227
- createdBy: z.string().nullable(),
2228
- createdAt: z.string(),
2229
- version: z.number().int()
2337
+ export const AcqArtifactResponseSchema = z.object({
2338
+ id: z.string(),
2339
+ organizationId: z.string(),
2340
+ ownerKind: z.string(),
2341
+ ownerId: z.string(),
2342
+ kind: z.string(),
2343
+ content: z.record(z.string(), z.unknown()),
2344
+ sourceExecutionId: z.string().nullable(),
2345
+ createdBy: z.string().nullable(),
2346
+ createdAt: z.string(),
2347
+ version: z.number().int()
2230
2348
  })
2231
2349
  ```
2232
2350
 
2233
2351
  ### `AcqArtifactListResponseSchema`
2234
2352
 
2235
2353
  ```typescript
2236
- export const AcqArtifactListResponseSchema = z.object({
2237
- artifacts: z.array(AcqArtifactResponseSchema)
2354
+ export const AcqArtifactListResponseSchema = z.object({
2355
+ artifacts: z.array(AcqArtifactResponseSchema)
2238
2356
  })
2239
2357
  ```
2240
2358
 
2241
2359
  ### `ListMembersQuerySchema`
2242
2360
 
2243
2361
  ```typescript
2244
- export const ListMembersQuerySchema = z
2245
- .object({
2246
- limit: z.coerce.number().int().min(1).max(500).default(50),
2247
- offset: z.coerce.number().int().min(0).default(0)
2248
- })
2362
+ export const ListMembersQuerySchema = z
2363
+ .object({
2364
+ limit: z.coerce.number().int().min(1).max(500).default(50),
2365
+ offset: z.coerce.number().int().min(0).default(0)
2366
+ })
2249
2367
  .strict()
2250
2368
  ```
2251
2369
 
2252
2370
  ### `MemberIdParamsSchema`
2253
2371
 
2254
2372
  ```typescript
2255
- export const MemberIdParamsSchema = z.object({
2256
- memberId: UuidSchema
2373
+ export const MemberIdParamsSchema = z.object({
2374
+ memberId: UuidSchema
2257
2375
  })
2258
2376
  ```
2259
2377
 
2260
2378
  ### `AcqListMemberContactSummarySchema`
2261
2379
 
2262
2380
  ```typescript
2263
- export const AcqListMemberContactSummarySchema = z.object({
2264
- id: z.string(),
2265
- email: z.string(),
2266
- firstName: z.string().nullable(),
2267
- lastName: z.string().nullable(),
2268
- title: z.string().nullable(),
2269
- linkedinUrl: z.string().nullable(),
2270
- companyId: z.string().nullable()
2381
+ export const AcqListMemberContactSummarySchema = z.object({
2382
+ id: z.string(),
2383
+ email: z.string(),
2384
+ firstName: z.string().nullable(),
2385
+ lastName: z.string().nullable(),
2386
+ title: z.string().nullable(),
2387
+ linkedinUrl: z.string().nullable(),
2388
+ companyId: z.string().nullable()
2271
2389
  })
2272
2390
  ```
2273
2391
 
2274
2392
  ### `AcqListMemberResponseSchema`
2275
2393
 
2276
2394
  ```typescript
2277
- export const AcqListMemberResponseSchema = z.object({
2278
- id: z.string(),
2279
- listId: z.string(),
2280
- contactId: z.string(),
2281
- pipelineKey: z.string(),
2282
- stageKey: z.string(),
2283
- stateKey: z.string(),
2284
- activityLog: z.unknown(),
2285
- addedAt: z.string(),
2286
- addedBy: z.string().nullable(),
2287
- sourceExecutionId: z.string().nullable(),
2288
- contact: AcqListMemberContactSummarySchema.nullable()
2395
+ export const AcqListMemberResponseSchema = z.object({
2396
+ id: z.string(),
2397
+ listId: z.string(),
2398
+ contactId: z.string(),
2399
+ pipelineKey: z.string(),
2400
+ stageKey: z.string(),
2401
+ stateKey: z.string(),
2402
+ activityLog: z.unknown(),
2403
+ addedAt: z.string(),
2404
+ addedBy: z.string().nullable(),
2405
+ sourceExecutionId: z.string().nullable(),
2406
+ contact: AcqListMemberContactSummarySchema.nullable()
2289
2407
  })
2290
2408
  ```
2291
2409
 
2292
2410
  ### `AcqListMembersResponseSchema`
2293
2411
 
2294
2412
  ```typescript
2295
- export const AcqListMembersResponseSchema = z.object({
2296
- members: z.array(AcqListMemberResponseSchema)
2413
+ export const AcqListMembersResponseSchema = z.object({
2414
+ members: z.array(AcqListMemberResponseSchema)
2297
2415
  })
2298
2416
  ```
2299
2417
 
2300
2418
  ### `ListCompanyIdParamsSchema`
2301
2419
 
2302
2420
  ```typescript
2303
- export const ListCompanyIdParamsSchema = z.object({
2304
- listCompanyId: UuidSchema
2421
+ export const ListCompanyIdParamsSchema = z.object({
2422
+ listCompanyId: UuidSchema
2305
2423
  })
2306
2424
  ```
2307
2425
 
2308
2426
  ### `AcqListCompanyResponseSchema`
2309
2427
 
2310
2428
  ```typescript
2311
- export const AcqListCompanyResponseSchema = z.object({
2312
- id: z.string(),
2313
- listId: z.string(),
2314
- companyId: z.string(),
2315
- pipelineKey: z.string(),
2316
- stageKey: z.string(),
2317
- stateKey: z.string(),
2318
- activityLog: z.unknown(),
2319
- addedAt: z.string(),
2320
- addedBy: z.string().nullable(),
2321
- sourceExecutionId: z.string().nullable()
2429
+ export const AcqListCompanyResponseSchema = z.object({
2430
+ id: z.string(),
2431
+ listId: z.string(),
2432
+ companyId: z.string(),
2433
+ pipelineKey: z.string(),
2434
+ stageKey: z.string(),
2435
+ stateKey: z.string(),
2436
+ activityLog: z.unknown(),
2437
+ addedAt: z.string(),
2438
+ addedBy: z.string().nullable(),
2439
+ sourceExecutionId: z.string().nullable()
2322
2440
  })
2323
2441
  ```
2324
2442
 
2325
2443
  ### `AcqCompanySchemas`
2326
2444
 
2327
2445
  ```typescript
2328
- export const AcqCompanySchemas = {
2329
- CompanyIdParams: CompanyIdParamsSchema,
2330
- ListCompaniesQuery: ListCompaniesQuerySchema,
2331
- CreateCompanyRequest: CreateCompanyRequestSchema,
2332
- UpdateCompanyRequest: UpdateCompanyRequestSchema,
2333
- AcqCompanyResponse: AcqCompanyResponseSchema,
2334
- AcqCompanyListResponse: AcqCompanyListResponseSchema,
2335
- AcqCompanyFacetsResponse: AcqCompanyFacetsResponseSchema
2446
+ export const AcqCompanySchemas = {
2447
+ CompanyIdParams: CompanyIdParamsSchema,
2448
+ ListCompaniesQuery: ListCompaniesQuerySchema,
2449
+ CreateCompanyRequest: CreateCompanyRequestSchema,
2450
+ UpdateCompanyRequest: UpdateCompanyRequestSchema,
2451
+ AcqCompanyResponse: AcqCompanyResponseSchema,
2452
+ AcqCompanyListResponse: AcqCompanyListResponseSchema,
2453
+ AcqCompanyFacetsResponse: AcqCompanyFacetsResponseSchema
2336
2454
  }
2337
2455
  ```
2338
2456
 
2339
2457
  ### `AcqContactSchemas`
2340
2458
 
2341
2459
  ```typescript
2342
- export const AcqContactSchemas = {
2343
- ContactIdParams: ContactIdParamsSchema,
2344
- ListContactsQuery: ListContactsQuerySchema,
2345
- CreateContactRequest: CreateContactRequestSchema,
2346
- UpdateContactRequest: UpdateContactRequestSchema,
2347
- AcqContactResponse: AcqContactResponseSchema,
2348
- AcqContactListResponse: AcqContactListResponseSchema
2460
+ export const AcqContactSchemas = {
2461
+ ContactIdParams: ContactIdParamsSchema,
2462
+ ListContactsQuery: ListContactsQuerySchema,
2463
+ CreateContactRequest: CreateContactRequestSchema,
2464
+ UpdateContactRequest: UpdateContactRequestSchema,
2465
+ AcqContactResponse: AcqContactResponseSchema,
2466
+ AcqContactListResponse: AcqContactListResponseSchema
2349
2467
  }
2350
2468
  ```
2351
2469
 
2352
2470
  ### `AcqListSchemas`
2353
2471
 
2354
2472
  ```typescript
2355
- export const AcqListSchemas = {
2356
- // Params
2357
- ListIdParams: ListIdParamsSchema,
2358
-
2359
- // Primitives (for UI / tests)
2360
- ListStatus: ListStatusSchema,
2361
- ScrapingConfig: ScrapingConfigSchema,
2362
- IcpRubric: IcpRubricSchema,
2363
- PipelineConfig: PipelineConfigSchema,
2364
- PipelineStage: PipelineStageSchema,
2365
- ProcessingStageStatus: ProcessingStageStatusSchema,
2366
- ListStageCounts: ListStageCountsSchema,
2367
- ListTelemetry: ListTelemetrySchema,
2368
-
2369
- // Requests
2370
- CreateListRequest: CreateListRequestSchema,
2371
- UpdateListRequest: UpdateListRequestSchema,
2372
- UpdateListStatusRequest: UpdateListStatusRequestSchema,
2373
- UpdateListConfigRequest: UpdateListConfigRequestSchema,
2374
- AddCompaniesToListRequest: AddCompaniesToListRequestSchema,
2375
- RemoveCompaniesFromListRequest: RemoveCompaniesFromListRequestSchema,
2376
- AddContactsToListRequest: AddContactsToListRequestSchema,
2377
- RecordListExecutionRequest: RecordListExecutionRequestSchema,
2378
-
2379
- // Responses
2380
- AcqListResponse: AcqListResponseSchema,
2381
- AcqListListResponse: AcqListListResponseSchema,
2382
- ListTelemetryResponse: ListTelemetryResponseSchema,
2383
- ListTelemetryListResponse: ListTelemetryListResponseSchema,
2384
- ListExecutionsResponse: ListExecutionsResponseSchema,
2385
- ListProgressResponse: ListProgressResponseSchema
2473
+ export const AcqListSchemas = {
2474
+ // Params
2475
+ ListIdParams: ListIdParamsSchema,
2476
+
2477
+ // Primitives (for UI / tests)
2478
+ ListStatus: ListStatusSchema,
2479
+ ScrapingConfig: ScrapingConfigSchema,
2480
+ IcpRubric: IcpRubricSchema,
2481
+ PipelineConfig: PipelineConfigSchema,
2482
+ PipelineStage: PipelineStageSchema,
2483
+ BuildPlanSnapshot: BuildPlanSnapshotSchema,
2484
+ BuildPlanSnapshotStep: BuildPlanSnapshotStepSchema,
2485
+ AcqListMetadata: AcqListMetadataSchema,
2486
+ ProcessingStageStatus: ProcessingStageStatusSchema,
2487
+ ListStageCounts: ListStageCountsSchema,
2488
+ ListTelemetry: ListTelemetrySchema,
2489
+
2490
+ // Requests
2491
+ CreateListRequest: CreateListRequestSchema,
2492
+ UpdateListRequest: UpdateListRequestSchema,
2493
+ UpdateListStatusRequest: UpdateListStatusRequestSchema,
2494
+ UpdateListConfigRequest: UpdateListConfigRequestSchema,
2495
+ AddCompaniesToListRequest: AddCompaniesToListRequestSchema,
2496
+ RemoveCompaniesFromListRequest: RemoveCompaniesFromListRequestSchema,
2497
+ AddContactsToListRequest: AddContactsToListRequestSchema,
2498
+ RecordListExecutionRequest: RecordListExecutionRequestSchema,
2499
+
2500
+ // Responses
2501
+ AcqListResponse: AcqListResponseSchema,
2502
+ AcqListListResponse: AcqListListResponseSchema,
2503
+ ListTelemetryResponse: ListTelemetryResponseSchema,
2504
+ ListTelemetryListResponse: ListTelemetryListResponseSchema,
2505
+ ListExecutionsResponse: ListExecutionsResponseSchema,
2506
+ ListProgressResponse: ListProgressResponseSchema
2386
2507
  }
2387
2508
  ```
2388
2509
 
2389
2510
  ### `AcqSubstrateSchemas`
2390
2511
 
2391
2512
  ```typescript
2392
- export const AcqSubstrateSchemas = {
2393
- // Artifacts
2394
- ListArtifactsQuery: ListArtifactsQuerySchema,
2395
- CreateArtifactRequest: CreateArtifactRequestSchema,
2396
- AcqArtifactResponse: AcqArtifactResponseSchema,
2397
- AcqArtifactListResponse: AcqArtifactListResponseSchema,
2398
-
2399
- // List members
2400
- ListMembersQuery: ListMembersQuerySchema,
2401
- MemberIdParams: MemberIdParamsSchema,
2402
- AcqListMemberResponse: AcqListMemberResponseSchema,
2403
- AcqListMembersResponse: AcqListMembersResponseSchema,
2404
-
2405
- // List companies
2406
- ListCompanyIdParams: ListCompanyIdParamsSchema,
2407
- AcqListCompanyResponse: AcqListCompanyResponseSchema,
2408
-
2409
- // Transition (shared with deals — TransitionItemRequestSchema)
2410
- TransitionItemRequest: TransitionItemRequestSchema
2513
+ export const AcqSubstrateSchemas = {
2514
+ // Artifacts
2515
+ ListArtifactsQuery: ListArtifactsQuerySchema,
2516
+ CreateArtifactRequest: CreateArtifactRequestSchema,
2517
+ AcqArtifactResponse: AcqArtifactResponseSchema,
2518
+ AcqArtifactListResponse: AcqArtifactListResponseSchema,
2519
+
2520
+ // List members
2521
+ ListMembersQuery: ListMembersQuerySchema,
2522
+ MemberIdParams: MemberIdParamsSchema,
2523
+ AcqListMemberResponse: AcqListMemberResponseSchema,
2524
+ AcqListMembersResponse: AcqListMembersResponseSchema,
2525
+
2526
+ // List companies
2527
+ ListCompanyIdParams: ListCompanyIdParamsSchema,
2528
+ AcqListCompanyResponse: AcqListCompanyResponseSchema,
2529
+
2530
+ // Transition (shared with deals — TransitionItemRequestSchema)
2531
+ TransitionItemRequest: TransitionItemRequestSchema
2411
2532
  }
2412
2533
  ```
2413
2534
 
@@ -2618,11 +2739,12 @@ export interface CreateListParams {
2618
2739
  description?: string
2619
2740
  type?: string
2620
2741
  batchIds?: string[]
2621
- instantlyCampaignId?: string
2622
- status?: ListStatus
2623
- metadata?: Record<string, unknown>
2624
- scrapingConfig?: ScrapingConfig
2625
- icp?: IcpRubric
2742
+ instantlyCampaignId?: string
2743
+ status?: ListStatus
2744
+ buildTemplateId?: string
2745
+ metadata?: Record<string, unknown>
2746
+ scrapingConfig?: ScrapingConfig
2747
+ icp?: IcpRubric
2626
2748
  pipelineConfig?: PipelineConfig
2627
2749
  }
2628
2750
  ```
@@ -2630,10 +2752,10 @@ export interface CreateListParams {
2630
2752
  ### `UpdateListParams`
2631
2753
 
2632
2754
  ```typescript
2633
- export interface UpdateListParams {
2634
- name?: string
2635
- description?: string
2636
- batchIds?: string[]
2755
+ export interface UpdateListParams {
2756
+ name?: string
2757
+ description?: string
2758
+ batchIds?: string[]
2637
2759
  }
2638
2760
  ```
2639
2761
 
@@ -3045,6 +3167,7 @@ export type LeadToolMap = {
3045
3167
  markProposalReviewed: { params: Omit<MarkProposalReviewedParams, 'organizationId'>; result: void }
3046
3168
  updateCloseLostReason: { params: Omit<UpdateCloseLostReasonParams, 'organizationId'>; result: void }
3047
3169
  updateFees: { params: Omit<UpdateFeesParams, 'organizationId'>; result: void }
3170
+ cacheInstantlyThreadIds: { params: Omit<CacheInstantlyThreadIdsParams, 'organizationId'>; result: void }
3048
3171
  transitionItem: { params: Omit<TransitionItemParams, 'organizationId'>; result: void }
3049
3172
  setContactNurture: { params: Omit<SetContactNurtureParams, 'organizationId'>; result: void }
3050
3173
  cancelSchedulesAndHitlByEmail: {