@elevasis/core 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/test-utils/index.d.ts +17 -12
- package/dist/test-utils/index.js +19 -0
- package/package.json +1 -1
- package/src/auth/multi-tenancy/credentials/__tests__/encryption.test.ts +217 -216
- package/src/auth/multi-tenancy/credentials/server/encryption.ts +5 -19
- package/src/auth/multi-tenancy/credentials/server/kek-loader.ts +3 -13
- package/src/auth/multi-tenancy/permissions.ts +12 -5
- package/src/business/acquisition/activity-events.ts +142 -0
- package/src/business/acquisition/api-schemas.ts +694 -689
- package/src/business/acquisition/derive-actions.ts +90 -0
- package/src/business/acquisition/index.ts +111 -109
- package/src/execution/engine/index.ts +434 -434
- package/src/execution/engine/tools/integration/server/adapters/apify/__tests__/apify-run-actor.integration.test.ts +1 -2
- package/src/execution/engine/tools/integration/server/adapters/attio/__tests__/attio-crud.integration.test.ts +0 -1
- package/src/execution/engine/tools/lead-service-types.ts +882 -879
- package/src/execution/engine/tools/registry.ts +699 -700
- package/src/execution/engine/tools/tool-maps.ts +777 -780
- package/src/organization-model/organization-graph.mdx +2 -2
- package/src/platform/constants/versions.ts +1 -1
- package/src/scaffold-registry/index.ts +10 -9
- package/src/scaffold-registry/schema.ts +68 -62
- package/src/supabase/database.types.ts +9 -7
- package/src/test-utils/rls/RLSTestContext.ts +585 -553
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
import { UuidSchema } from '../../platform/utils/validation'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Deal Management API Schemas
|
|
6
|
-
*
|
|
7
|
-
* Request/response validation for /api/deals surface.
|
|
8
|
-
* Used by both the API route handlers and the frontend hooks.
|
|
9
|
-
*
|
|
10
|
-
* Table mapping:
|
|
11
|
-
* acq_deals -> DealSchemas (list/detail)
|
|
12
|
-
* acq_deal_notes -> DealSchemas (note shapes)
|
|
13
|
-
* acq_deal_tasks -> DealSchemas (task shapes)
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
// ---------------------------------------------------------------------------
|
|
17
|
-
// Enum literals (must match DB CHECK constraints exactly)
|
|
18
|
-
// ---------------------------------------------------------------------------
|
|
19
|
-
|
|
20
|
-
export const DealStageSchema = z.enum(['interested', 'proposal', 'closing', 'closed_won', 'closed_lost', 'nurturing'])
|
|
21
|
-
|
|
22
|
-
export const AcqDealTaskKindSchema = z.enum(['call', 'email', 'meeting', 'other'])
|
|
23
|
-
|
|
24
|
-
// ---------------------------------------------------------------------------
|
|
25
|
-
// Params
|
|
26
|
-
// ---------------------------------------------------------------------------
|
|
27
|
-
|
|
28
|
-
export const DealIdParamsSchema = z.object({
|
|
29
|
-
dealId: UuidSchema
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
export const DealTaskIdParamsSchema = z.object({
|
|
33
|
-
dealId: UuidSchema,
|
|
34
|
-
taskId: UuidSchema
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
// ---------------------------------------------------------------------------
|
|
38
|
-
// Query schemas (coerce strings from query params)
|
|
39
|
-
// ---------------------------------------------------------------------------
|
|
40
|
-
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { UuidSchema } from '../../platform/utils/validation'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Deal Management API Schemas
|
|
6
|
+
*
|
|
7
|
+
* Request/response validation for /api/deals surface.
|
|
8
|
+
* Used by both the API route handlers and the frontend hooks.
|
|
9
|
+
*
|
|
10
|
+
* Table mapping:
|
|
11
|
+
* acq_deals -> DealSchemas (list/detail)
|
|
12
|
+
* acq_deal_notes -> DealSchemas (note shapes)
|
|
13
|
+
* acq_deal_tasks -> DealSchemas (task shapes)
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
// Enum literals (must match DB CHECK constraints exactly)
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
export const DealStageSchema = z.enum(['interested', 'proposal', 'closing', 'closed_won', 'closed_lost', 'nurturing'])
|
|
21
|
+
|
|
22
|
+
export const AcqDealTaskKindSchema = z.enum(['call', 'email', 'meeting', 'other'])
|
|
23
|
+
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
// Params
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
export const DealIdParamsSchema = z.object({
|
|
29
|
+
dealId: UuidSchema
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
export const DealTaskIdParamsSchema = z.object({
|
|
33
|
+
dealId: UuidSchema,
|
|
34
|
+
taskId: UuidSchema
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
// Query schemas (coerce strings from query params)
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
|
|
41
41
|
export const ListDealsQuerySchema = z
|
|
42
42
|
.object({
|
|
43
43
|
stage: DealStageSchema.optional(),
|
|
@@ -53,101 +53,106 @@ export const DealLookupQuerySchema = z
|
|
|
53
53
|
limit: z.coerce.number().int().min(1).max(25).default(10)
|
|
54
54
|
})
|
|
55
55
|
.strict()
|
|
56
|
-
|
|
57
|
-
export const ListDealTasksDueQuerySchema = z
|
|
58
|
-
.object({
|
|
59
|
-
window: z.enum(['overdue', 'today', 'today_and_overdue', 'upcoming']).optional(),
|
|
60
|
-
assigneeUserId: UuidSchema.optional()
|
|
61
|
-
})
|
|
62
|
-
.strict()
|
|
63
|
-
|
|
64
|
-
// ---------------------------------------------------------------------------
|
|
65
|
-
// Request body schemas (all use .strict() — rejects unknown fields)
|
|
66
|
-
// ---------------------------------------------------------------------------
|
|
67
|
-
|
|
68
|
-
export const CreateDealNoteRequestSchema = z
|
|
69
|
-
.object({
|
|
70
|
-
body: z.string().trim().min(1).max(10000)
|
|
71
|
-
})
|
|
72
|
-
.strict()
|
|
73
|
-
|
|
74
|
-
export const CreateDealTaskRequestSchema = z
|
|
75
|
-
.object({
|
|
76
|
-
title: z.string().trim().min(1).max(255),
|
|
77
|
-
description: z.string().nullable().optional(),
|
|
78
|
-
kind: AcqDealTaskKindSchema.optional(),
|
|
79
|
-
dueAt: z.string().datetime().nullable().optional(),
|
|
80
|
-
assigneeUserId: UuidSchema.nullable().optional()
|
|
81
|
-
})
|
|
82
|
-
.strict()
|
|
83
|
-
|
|
84
|
-
export const
|
|
85
|
-
.object({
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
56
|
+
|
|
57
|
+
export const ListDealTasksDueQuerySchema = z
|
|
58
|
+
.object({
|
|
59
|
+
window: z.enum(['overdue', 'today', 'today_and_overdue', 'upcoming']).optional(),
|
|
60
|
+
assigneeUserId: UuidSchema.optional()
|
|
61
|
+
})
|
|
62
|
+
.strict()
|
|
63
|
+
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
// Request body schemas (all use .strict() — rejects unknown fields)
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
|
|
68
|
+
export const CreateDealNoteRequestSchema = z
|
|
69
|
+
.object({
|
|
70
|
+
body: z.string().trim().min(1).max(10000)
|
|
71
|
+
})
|
|
72
|
+
.strict()
|
|
73
|
+
|
|
74
|
+
export const CreateDealTaskRequestSchema = z
|
|
75
|
+
.object({
|
|
76
|
+
title: z.string().trim().min(1).max(255),
|
|
77
|
+
description: z.string().nullable().optional(),
|
|
78
|
+
kind: AcqDealTaskKindSchema.optional(),
|
|
79
|
+
dueAt: z.string().datetime().nullable().optional(),
|
|
80
|
+
assigneeUserId: UuidSchema.nullable().optional()
|
|
81
|
+
})
|
|
82
|
+
.strict()
|
|
83
|
+
|
|
84
|
+
export const TransitionItemRequestSchema = z
|
|
85
|
+
.object({
|
|
86
|
+
pipelineKey: z.string().min(1),
|
|
87
|
+
stageKey: z.string().min(1),
|
|
88
|
+
stateKey: z.string().nullable().optional(),
|
|
89
|
+
reason: z.string().optional(),
|
|
90
|
+
expectedUpdatedAt: z.string().datetime().optional()
|
|
91
|
+
})
|
|
92
|
+
.strict()
|
|
93
|
+
|
|
94
|
+
// ---------------------------------------------------------------------------
|
|
95
|
+
// Response schemas (no .strict() — allows forward-compatible additions)
|
|
96
|
+
// ---------------------------------------------------------------------------
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Contact summary nested inside DealListItem / DealDetailResponse.
|
|
100
|
+
* Matches the joined shape returned by useDeals / useDealDetail Supabase queries.
|
|
101
|
+
*/
|
|
102
|
+
export const DealContactSummarySchema = z.object({
|
|
103
|
+
id: z.string(),
|
|
104
|
+
first_name: z.string().nullable(),
|
|
105
|
+
last_name: z.string().nullable(),
|
|
106
|
+
email: z.string(),
|
|
107
|
+
title: z.string().nullable(),
|
|
108
|
+
headline: z.string().nullable(),
|
|
109
|
+
linkedin_url: z.string().nullable(),
|
|
110
|
+
pipeline_status: z.record(z.string(), z.unknown()).nullable(),
|
|
111
|
+
enrichment_data: z.record(z.string(), z.unknown()).nullable(),
|
|
112
|
+
company: z
|
|
113
|
+
.object({
|
|
114
|
+
id: z.string(),
|
|
115
|
+
name: z.string(),
|
|
116
|
+
domain: z.string().nullable(),
|
|
117
|
+
website: z.string().nullable(),
|
|
118
|
+
linkedin_url: z.string().nullable(),
|
|
119
|
+
segment: z.string().nullable(),
|
|
120
|
+
category: z.string().nullable(),
|
|
121
|
+
num_employees: z.number().nullable()
|
|
122
|
+
})
|
|
123
|
+
.nullable()
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Deal list item with joined contact (and company via contact).
|
|
128
|
+
* Matches DealListItem from @repo/core types.
|
|
129
|
+
*/
|
|
126
130
|
export const DealListItemSchema = z.object({
|
|
127
|
-
// acq_deals columns
|
|
128
|
-
id: z.string(),
|
|
129
|
-
organization_id: z.string(),
|
|
130
|
-
contact_id: z.string().nullable(),
|
|
131
|
-
contact_email: z.string(),
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
131
|
+
// acq_deals columns
|
|
132
|
+
id: z.string(),
|
|
133
|
+
organization_id: z.string(),
|
|
134
|
+
contact_id: z.string().nullable(),
|
|
135
|
+
contact_email: z.string(),
|
|
136
|
+
pipeline_key: z.string(),
|
|
137
|
+
stage_key: z.string().nullable(),
|
|
138
|
+
state_key: z.string().nullable(),
|
|
139
|
+
activity_log: z.unknown(),
|
|
140
|
+
discovery_data: z.unknown().nullable(),
|
|
141
|
+
discovery_submitted_at: z.string().nullable(),
|
|
142
|
+
discovery_submitted_by: z.string().nullable(),
|
|
143
|
+
proposal_data: z.unknown().nullable(),
|
|
144
|
+
proposal_sent_at: z.string().nullable(),
|
|
145
|
+
proposal_pdf_url: z.string().nullable(),
|
|
146
|
+
signature_envelope_id: z.string().nullable(),
|
|
147
|
+
source_list_id: z.string().nullable(),
|
|
148
|
+
source_type: z.string().nullable(),
|
|
149
|
+
initial_fee: z.number().nullable(),
|
|
150
|
+
monthly_fee: z.number().nullable(),
|
|
151
|
+
closed_lost_at: z.string().nullable(),
|
|
152
|
+
closed_lost_reason: z.string().nullable(),
|
|
153
|
+
created_at: z.string(),
|
|
154
|
+
updated_at: z.string(),
|
|
155
|
+
// joined relation
|
|
151
156
|
contact: DealContactSummarySchema.nullable()
|
|
152
157
|
})
|
|
153
158
|
|
|
@@ -168,7 +173,7 @@ export const DealStageSummarySchema = z.object({
|
|
|
168
173
|
export const StaleDealSummarySchema = z.object({
|
|
169
174
|
id: z.string(),
|
|
170
175
|
contactEmail: z.string(),
|
|
171
|
-
|
|
176
|
+
stageKey: z.string(),
|
|
172
177
|
updatedAt: z.string(),
|
|
173
178
|
daysStale: z.number().int()
|
|
174
179
|
})
|
|
@@ -188,7 +193,7 @@ export const DealSummaryResponseSchema = z.object({
|
|
|
188
193
|
export const DealLookupItemSchema = z.object({
|
|
189
194
|
id: z.string(),
|
|
190
195
|
contactEmail: z.string(),
|
|
191
|
-
|
|
196
|
+
stageKey: z.string().nullable(),
|
|
192
197
|
updatedAt: z.string(),
|
|
193
198
|
contactName: z.string().nullable(),
|
|
194
199
|
companyName: z.string().nullable(),
|
|
@@ -196,228 +201,228 @@ export const DealLookupItemSchema = z.object({
|
|
|
196
201
|
})
|
|
197
202
|
|
|
198
203
|
export const DealLookupResponseSchema = z.array(DealLookupItemSchema)
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Deal detail shape — currently the same as a list item (full joined record).
|
|
202
|
-
* useDealDetail returns DealDetail which is typed as DealListItem.
|
|
203
|
-
*/
|
|
204
|
-
export const DealDetailResponseSchema = DealListItemSchema
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Single acq_deal_notes row (camelCase API representation).
|
|
208
|
-
*/
|
|
209
|
-
export const DealNoteResponseSchema = z.object({
|
|
210
|
-
id: z.string(),
|
|
211
|
-
dealId: z.string(),
|
|
212
|
-
organizationId: z.string(),
|
|
213
|
-
authorUserId: z.string().nullable(),
|
|
214
|
-
body: z.string(),
|
|
215
|
-
createdAt: z.string(),
|
|
216
|
-
updatedAt: z.string()
|
|
217
|
-
})
|
|
218
|
-
|
|
219
|
-
export const DealNoteListResponseSchema = z.array(DealNoteResponseSchema)
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Single acq_deal_tasks row (camelCase API representation).
|
|
223
|
-
* Matches AcqDealTask domain type from types.ts.
|
|
224
|
-
*/
|
|
225
|
-
export const DealTaskResponseSchema = z.object({
|
|
226
|
-
id: z.string(),
|
|
227
|
-
organizationId: z.string(),
|
|
228
|
-
dealId: z.string(),
|
|
229
|
-
title: z.string(),
|
|
230
|
-
description: z.string().nullable(),
|
|
231
|
-
kind: AcqDealTaskKindSchema,
|
|
232
|
-
dueAt: z.string().nullable(),
|
|
233
|
-
assigneeUserId: z.string().nullable(),
|
|
234
|
-
completedAt: z.string().nullable(),
|
|
235
|
-
completedByUserId: z.string().nullable(),
|
|
236
|
-
createdAt: z.string(),
|
|
237
|
-
updatedAt: z.string(),
|
|
238
|
-
createdByUserId: z.string().nullable()
|
|
239
|
-
})
|
|
240
|
-
|
|
241
|
-
export const DealTaskListResponseSchema = z.array(DealTaskResponseSchema)
|
|
242
|
-
|
|
243
|
-
// ---------------------------------------------------------------------------
|
|
244
|
-
// Bundled export
|
|
245
|
-
// ---------------------------------------------------------------------------
|
|
246
|
-
|
|
247
|
-
export const DealSchemas = {
|
|
248
|
-
// Params
|
|
249
|
-
DealIdParams: DealIdParamsSchema,
|
|
250
|
-
DealTaskIdParams: DealTaskIdParamsSchema,
|
|
251
|
-
|
|
252
|
-
// Queries
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Deal detail shape — currently the same as a list item (full joined record).
|
|
207
|
+
* useDealDetail returns DealDetail which is typed as DealListItem.
|
|
208
|
+
*/
|
|
209
|
+
export const DealDetailResponseSchema = DealListItemSchema
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Single acq_deal_notes row (camelCase API representation).
|
|
213
|
+
*/
|
|
214
|
+
export const DealNoteResponseSchema = z.object({
|
|
215
|
+
id: z.string(),
|
|
216
|
+
dealId: z.string(),
|
|
217
|
+
organizationId: z.string(),
|
|
218
|
+
authorUserId: z.string().nullable(),
|
|
219
|
+
body: z.string(),
|
|
220
|
+
createdAt: z.string(),
|
|
221
|
+
updatedAt: z.string()
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
export const DealNoteListResponseSchema = z.array(DealNoteResponseSchema)
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Single acq_deal_tasks row (camelCase API representation).
|
|
228
|
+
* Matches AcqDealTask domain type from types.ts.
|
|
229
|
+
*/
|
|
230
|
+
export const DealTaskResponseSchema = z.object({
|
|
231
|
+
id: z.string(),
|
|
232
|
+
organizationId: z.string(),
|
|
233
|
+
dealId: z.string(),
|
|
234
|
+
title: z.string(),
|
|
235
|
+
description: z.string().nullable(),
|
|
236
|
+
kind: AcqDealTaskKindSchema,
|
|
237
|
+
dueAt: z.string().nullable(),
|
|
238
|
+
assigneeUserId: z.string().nullable(),
|
|
239
|
+
completedAt: z.string().nullable(),
|
|
240
|
+
completedByUserId: z.string().nullable(),
|
|
241
|
+
createdAt: z.string(),
|
|
242
|
+
updatedAt: z.string(),
|
|
243
|
+
createdByUserId: z.string().nullable()
|
|
244
|
+
})
|
|
245
|
+
|
|
246
|
+
export const DealTaskListResponseSchema = z.array(DealTaskResponseSchema)
|
|
247
|
+
|
|
248
|
+
// ---------------------------------------------------------------------------
|
|
249
|
+
// Bundled export
|
|
250
|
+
// ---------------------------------------------------------------------------
|
|
251
|
+
|
|
252
|
+
export const DealSchemas = {
|
|
253
|
+
// Params
|
|
254
|
+
DealIdParams: DealIdParamsSchema,
|
|
255
|
+
DealTaskIdParams: DealTaskIdParamsSchema,
|
|
256
|
+
|
|
257
|
+
// Queries
|
|
253
258
|
ListDealsQuery: ListDealsQuerySchema,
|
|
254
259
|
DealLookupQuery: DealLookupQuerySchema,
|
|
255
260
|
ListDealTasksDueQuery: ListDealTasksDueQuerySchema,
|
|
256
|
-
|
|
257
|
-
// Request bodies
|
|
258
|
-
CreateDealNoteRequest: CreateDealNoteRequestSchema,
|
|
259
|
-
CreateDealTaskRequest: CreateDealTaskRequestSchema,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
// Responses
|
|
261
|
+
|
|
262
|
+
// Request bodies
|
|
263
|
+
CreateDealNoteRequest: CreateDealNoteRequestSchema,
|
|
264
|
+
CreateDealTaskRequest: CreateDealTaskRequestSchema,
|
|
265
|
+
TransitionItemRequest: TransitionItemRequestSchema,
|
|
266
|
+
|
|
267
|
+
// Responses
|
|
263
268
|
DealListResponse: DealListResponseSchema,
|
|
264
269
|
DealSummaryResponse: DealSummaryResponseSchema,
|
|
265
270
|
DealLookupResponse: DealLookupResponseSchema,
|
|
266
271
|
DealDetailResponse: DealDetailResponseSchema,
|
|
267
|
-
DealNoteResponse: DealNoteResponseSchema,
|
|
268
|
-
DealNoteListResponse: DealNoteListResponseSchema,
|
|
269
|
-
DealTaskResponse: DealTaskResponseSchema,
|
|
270
|
-
DealTaskListResponse: DealTaskListResponseSchema
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
// ---------------------------------------------------------------------------
|
|
274
|
-
// Inferred types
|
|
275
|
-
// ---------------------------------------------------------------------------
|
|
276
|
-
|
|
277
|
-
export type DealStage = z.infer<typeof DealStageSchema>
|
|
278
|
-
export type AcqDealTaskKind = z.infer<typeof AcqDealTaskKindSchema>
|
|
279
|
-
export type DealIdParams = z.infer<typeof DealIdParamsSchema>
|
|
280
|
-
export type DealTaskIdParams = z.infer<typeof DealTaskIdParamsSchema>
|
|
272
|
+
DealNoteResponse: DealNoteResponseSchema,
|
|
273
|
+
DealNoteListResponse: DealNoteListResponseSchema,
|
|
274
|
+
DealTaskResponse: DealTaskResponseSchema,
|
|
275
|
+
DealTaskListResponse: DealTaskListResponseSchema
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// ---------------------------------------------------------------------------
|
|
279
|
+
// Inferred types
|
|
280
|
+
// ---------------------------------------------------------------------------
|
|
281
|
+
|
|
282
|
+
export type DealStage = z.infer<typeof DealStageSchema>
|
|
283
|
+
export type AcqDealTaskKind = z.infer<typeof AcqDealTaskKindSchema>
|
|
284
|
+
export type DealIdParams = z.infer<typeof DealIdParamsSchema>
|
|
285
|
+
export type DealTaskIdParams = z.infer<typeof DealTaskIdParamsSchema>
|
|
281
286
|
export type ListDealsQuery = z.infer<typeof ListDealsQuerySchema>
|
|
282
287
|
export type DealLookupQuery = z.infer<typeof DealLookupQuerySchema>
|
|
283
288
|
export type ListDealTasksDueQuery = z.infer<typeof ListDealTasksDueQuerySchema>
|
|
284
|
-
export type CreateDealNoteRequest = z.infer<typeof CreateDealNoteRequestSchema>
|
|
285
|
-
export type CreateDealTaskRequest = z.infer<typeof CreateDealTaskRequestSchema>
|
|
286
|
-
export type
|
|
289
|
+
export type CreateDealNoteRequest = z.infer<typeof CreateDealNoteRequestSchema>
|
|
290
|
+
export type CreateDealTaskRequest = z.infer<typeof CreateDealTaskRequestSchema>
|
|
291
|
+
export type TransitionItemRequest = z.infer<typeof TransitionItemRequestSchema>
|
|
287
292
|
export type DealListResponse = z.infer<typeof DealListResponseSchema>
|
|
288
293
|
export type DealSummaryResponse = z.infer<typeof DealSummaryResponseSchema>
|
|
289
294
|
export type DealLookupItem = z.infer<typeof DealLookupItemSchema>
|
|
290
295
|
export type DealLookupResponse = z.infer<typeof DealLookupResponseSchema>
|
|
291
296
|
export type DealDetailResponse = z.infer<typeof DealDetailResponseSchema>
|
|
292
|
-
export type DealNoteResponse = z.infer<typeof DealNoteResponseSchema>
|
|
293
|
-
export type DealNoteListResponse = z.infer<typeof DealNoteListResponseSchema>
|
|
294
|
-
export type DealTaskResponse = z.infer<typeof DealTaskResponseSchema>
|
|
295
|
-
export type DealTaskListResponse = z.infer<typeof DealTaskListResponseSchema>
|
|
296
|
-
|
|
297
|
-
// ---------------------------------------------------------------------------
|
|
298
|
-
// List Management API Schemas
|
|
299
|
-
//
|
|
300
|
-
// Request/response validation for /api/acquisition/lists surface.
|
|
301
|
-
// Used by both the API route handlers and the frontend hooks.
|
|
302
|
-
//
|
|
303
|
-
// Table mapping:
|
|
304
|
-
// acq_lists -> AcqListSchemas (list/detail/progress)
|
|
305
|
-
// acq_list_companies -> AcqListSchemas (add/remove company membership)
|
|
306
|
-
// acq_list_contacts -> AcqListSchemas (add/remove contact membership)
|
|
307
|
-
// acq_list_executions -> AcqListSchemas (execution history)
|
|
308
|
-
// ---------------------------------------------------------------------------
|
|
309
|
-
|
|
310
|
-
// ---------------------------------------------------------------------------
|
|
311
|
-
// Primitives — list config subtrees
|
|
312
|
-
// ---------------------------------------------------------------------------
|
|
313
|
-
|
|
314
|
-
export const ListQualificationSchema = z.object({
|
|
315
|
-
targetDescription: z.string(),
|
|
316
|
-
minReviewCount: z.number().int().min(0),
|
|
317
|
-
minRating: z.number().min(0).max(5),
|
|
318
|
-
excludeFranchises: z.boolean(),
|
|
319
|
-
customRules: z.string()
|
|
320
|
-
})
|
|
321
|
-
|
|
322
|
-
export const ListEnrichmentSchema = z.object({
|
|
323
|
-
emailDiscovery: z
|
|
324
|
-
.object({
|
|
325
|
-
primary: z.enum(['tomba', 'anymailfinder']),
|
|
326
|
-
credentialName: z.string().optional()
|
|
327
|
-
})
|
|
328
|
-
.optional(),
|
|
329
|
-
emailVerification: z
|
|
330
|
-
.object({
|
|
331
|
-
provider: z.literal('millionverifier'),
|
|
332
|
-
threshold: z.enum(['ok', 'ok+catch_all']).optional()
|
|
333
|
-
})
|
|
334
|
-
.optional()
|
|
335
|
-
})
|
|
336
|
-
|
|
337
|
-
export const ListPersonalizationSchema = z.object({
|
|
338
|
-
industryContext: z.string().optional(),
|
|
339
|
-
emailBody: z.string().optional(),
|
|
340
|
-
creativeDirection: z.string().optional(),
|
|
341
|
-
exclusionRules: z.array(z.string()).optional()
|
|
342
|
-
})
|
|
343
|
-
|
|
344
|
-
export const PipelineStepSchema = z.object({
|
|
345
|
-
key: z.string(),
|
|
346
|
-
label: z.string(),
|
|
347
|
-
resourceId: z.string(),
|
|
348
|
-
inputTemplate: z.record(z.string(), z.unknown()),
|
|
349
|
-
enabled: z.boolean(),
|
|
350
|
-
order: z.number().int()
|
|
351
|
-
})
|
|
352
|
-
|
|
353
|
-
export const ListPipelineSchema = z.object({
|
|
354
|
-
steps: z.array(PipelineStepSchema)
|
|
355
|
-
})
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
* Full ListConfig shape. `qualification` is required; everything else optional.
|
|
359
|
-
* Matches `acq_lists.config` jsonb and ListConfig type in types.ts.
|
|
360
|
-
*/
|
|
361
|
-
export const ListConfigSchema = z.object({
|
|
362
|
-
qualification: ListQualificationSchema,
|
|
363
|
-
enrichment: ListEnrichmentSchema.optional(),
|
|
364
|
-
personalization: ListPersonalizationSchema.optional(),
|
|
365
|
-
pipeline: ListPipelineSchema.optional()
|
|
366
|
-
})
|
|
367
|
-
|
|
368
|
-
// ---------------------------------------------------------------------------
|
|
369
|
-
// List telemetry / progress schemas
|
|
370
|
-
// ---------------------------------------------------------------------------
|
|
371
|
-
|
|
372
|
-
export const ListStageCountsSchema = z.object({
|
|
373
|
-
stageCounts: z.object({
|
|
374
|
-
populated: z.number().int(),
|
|
375
|
-
extracted: z.number().int(),
|
|
376
|
-
qualified: z.number().int(),
|
|
377
|
-
discovered: z.number().int(),
|
|
378
|
-
verified: z.number().int(),
|
|
379
|
-
personalized: z.number().int(),
|
|
380
|
-
uploaded: z.number().int()
|
|
381
|
-
}),
|
|
382
|
-
deliverability: z.object({
|
|
383
|
-
valid: z.number().int(),
|
|
384
|
-
risky: z.number().int(),
|
|
385
|
-
invalid: z.number().int(),
|
|
386
|
-
unknown: z.number().int(),
|
|
387
|
-
bounced: z.number().int()
|
|
388
|
-
})
|
|
389
|
-
})
|
|
390
|
-
|
|
391
|
-
export const ListTelemetrySchema = z.object({
|
|
392
|
-
listId: UuidSchema,
|
|
393
|
-
totalCompanies: z.number().int(),
|
|
394
|
-
totalContacts: z.number().int(),
|
|
395
|
-
stageCounts: ListStageCountsSchema.shape.stageCounts,
|
|
396
|
-
deliverability: ListStageCountsSchema.shape.deliverability,
|
|
397
|
-
activeWorkflows: z.array(z.string()).optional()
|
|
398
|
-
})
|
|
399
|
-
|
|
400
|
-
// ---------------------------------------------------------------------------
|
|
401
|
-
// Params
|
|
402
|
-
// ---------------------------------------------------------------------------
|
|
403
|
-
|
|
404
|
-
export const ListIdParamsSchema = z.object({
|
|
405
|
-
listId: UuidSchema
|
|
406
|
-
})
|
|
407
|
-
|
|
408
|
-
// ---------------------------------------------------------------------------
|
|
409
|
-
// Request body schemas (all use .strict() — rejects unknown fields)
|
|
410
|
-
// ---------------------------------------------------------------------------
|
|
411
|
-
|
|
412
|
-
export const CreateListRequestSchema = z
|
|
413
|
-
.object({
|
|
414
|
-
name: z.string().trim().min(1).max(255),
|
|
415
|
-
description: z.string().trim().nullable().optional(),
|
|
416
|
-
type: z.string().default('manual'),
|
|
417
|
-
config: ListConfigSchema.optional()
|
|
418
|
-
})
|
|
419
|
-
.strict()
|
|
420
|
-
|
|
297
|
+
export type DealNoteResponse = z.infer<typeof DealNoteResponseSchema>
|
|
298
|
+
export type DealNoteListResponse = z.infer<typeof DealNoteListResponseSchema>
|
|
299
|
+
export type DealTaskResponse = z.infer<typeof DealTaskResponseSchema>
|
|
300
|
+
export type DealTaskListResponse = z.infer<typeof DealTaskListResponseSchema>
|
|
301
|
+
|
|
302
|
+
// ---------------------------------------------------------------------------
|
|
303
|
+
// List Management API Schemas
|
|
304
|
+
//
|
|
305
|
+
// Request/response validation for /api/acquisition/lists surface.
|
|
306
|
+
// Used by both the API route handlers and the frontend hooks.
|
|
307
|
+
//
|
|
308
|
+
// Table mapping:
|
|
309
|
+
// acq_lists -> AcqListSchemas (list/detail/progress)
|
|
310
|
+
// acq_list_companies -> AcqListSchemas (add/remove company membership)
|
|
311
|
+
// acq_list_contacts -> AcqListSchemas (add/remove contact membership)
|
|
312
|
+
// acq_list_executions -> AcqListSchemas (execution history)
|
|
313
|
+
// ---------------------------------------------------------------------------
|
|
314
|
+
|
|
315
|
+
// ---------------------------------------------------------------------------
|
|
316
|
+
// Primitives — list config subtrees
|
|
317
|
+
// ---------------------------------------------------------------------------
|
|
318
|
+
|
|
319
|
+
export const ListQualificationSchema = z.object({
|
|
320
|
+
targetDescription: z.string(),
|
|
321
|
+
minReviewCount: z.number().int().min(0),
|
|
322
|
+
minRating: z.number().min(0).max(5),
|
|
323
|
+
excludeFranchises: z.boolean(),
|
|
324
|
+
customRules: z.string()
|
|
325
|
+
})
|
|
326
|
+
|
|
327
|
+
export const ListEnrichmentSchema = z.object({
|
|
328
|
+
emailDiscovery: z
|
|
329
|
+
.object({
|
|
330
|
+
primary: z.enum(['tomba', 'anymailfinder']),
|
|
331
|
+
credentialName: z.string().optional()
|
|
332
|
+
})
|
|
333
|
+
.optional(),
|
|
334
|
+
emailVerification: z
|
|
335
|
+
.object({
|
|
336
|
+
provider: z.literal('millionverifier'),
|
|
337
|
+
threshold: z.enum(['ok', 'ok+catch_all']).optional()
|
|
338
|
+
})
|
|
339
|
+
.optional()
|
|
340
|
+
})
|
|
341
|
+
|
|
342
|
+
export const ListPersonalizationSchema = z.object({
|
|
343
|
+
industryContext: z.string().optional(),
|
|
344
|
+
emailBody: z.string().optional(),
|
|
345
|
+
creativeDirection: z.string().optional(),
|
|
346
|
+
exclusionRules: z.array(z.string()).optional()
|
|
347
|
+
})
|
|
348
|
+
|
|
349
|
+
export const PipelineStepSchema = z.object({
|
|
350
|
+
key: z.string(),
|
|
351
|
+
label: z.string(),
|
|
352
|
+
resourceId: z.string(),
|
|
353
|
+
inputTemplate: z.record(z.string(), z.unknown()),
|
|
354
|
+
enabled: z.boolean(),
|
|
355
|
+
order: z.number().int()
|
|
356
|
+
})
|
|
357
|
+
|
|
358
|
+
export const ListPipelineSchema = z.object({
|
|
359
|
+
steps: z.array(PipelineStepSchema)
|
|
360
|
+
})
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Full ListConfig shape. `qualification` is required; everything else optional.
|
|
364
|
+
* Matches `acq_lists.config` jsonb and ListConfig type in types.ts.
|
|
365
|
+
*/
|
|
366
|
+
export const ListConfigSchema = z.object({
|
|
367
|
+
qualification: ListQualificationSchema,
|
|
368
|
+
enrichment: ListEnrichmentSchema.optional(),
|
|
369
|
+
personalization: ListPersonalizationSchema.optional(),
|
|
370
|
+
pipeline: ListPipelineSchema.optional()
|
|
371
|
+
})
|
|
372
|
+
|
|
373
|
+
// ---------------------------------------------------------------------------
|
|
374
|
+
// List telemetry / progress schemas
|
|
375
|
+
// ---------------------------------------------------------------------------
|
|
376
|
+
|
|
377
|
+
export const ListStageCountsSchema = z.object({
|
|
378
|
+
stageCounts: z.object({
|
|
379
|
+
populated: z.number().int(),
|
|
380
|
+
extracted: z.number().int(),
|
|
381
|
+
qualified: z.number().int(),
|
|
382
|
+
discovered: z.number().int(),
|
|
383
|
+
verified: z.number().int(),
|
|
384
|
+
personalized: z.number().int(),
|
|
385
|
+
uploaded: z.number().int()
|
|
386
|
+
}),
|
|
387
|
+
deliverability: z.object({
|
|
388
|
+
valid: z.number().int(),
|
|
389
|
+
risky: z.number().int(),
|
|
390
|
+
invalid: z.number().int(),
|
|
391
|
+
unknown: z.number().int(),
|
|
392
|
+
bounced: z.number().int()
|
|
393
|
+
})
|
|
394
|
+
})
|
|
395
|
+
|
|
396
|
+
export const ListTelemetrySchema = z.object({
|
|
397
|
+
listId: UuidSchema,
|
|
398
|
+
totalCompanies: z.number().int(),
|
|
399
|
+
totalContacts: z.number().int(),
|
|
400
|
+
stageCounts: ListStageCountsSchema.shape.stageCounts,
|
|
401
|
+
deliverability: ListStageCountsSchema.shape.deliverability,
|
|
402
|
+
activeWorkflows: z.array(z.string()).optional()
|
|
403
|
+
})
|
|
404
|
+
|
|
405
|
+
// ---------------------------------------------------------------------------
|
|
406
|
+
// Params
|
|
407
|
+
// ---------------------------------------------------------------------------
|
|
408
|
+
|
|
409
|
+
export const ListIdParamsSchema = z.object({
|
|
410
|
+
listId: UuidSchema
|
|
411
|
+
})
|
|
412
|
+
|
|
413
|
+
// ---------------------------------------------------------------------------
|
|
414
|
+
// Request body schemas (all use .strict() — rejects unknown fields)
|
|
415
|
+
// ---------------------------------------------------------------------------
|
|
416
|
+
|
|
417
|
+
export const CreateListRequestSchema = z
|
|
418
|
+
.object({
|
|
419
|
+
name: z.string().trim().min(1).max(255),
|
|
420
|
+
description: z.string().trim().nullable().optional(),
|
|
421
|
+
type: z.string().default('manual'),
|
|
422
|
+
config: ListConfigSchema.optional()
|
|
423
|
+
})
|
|
424
|
+
.strict()
|
|
425
|
+
|
|
421
426
|
export const UpdateListRequestSchema = z
|
|
422
427
|
.object({
|
|
423
428
|
name: z.string().trim().min(1).max(255).optional(),
|
|
@@ -436,121 +441,121 @@ export const UpdateListRequestSchema = z
|
|
|
436
441
|
message: 'At least one field (name, description, status, or batchIds) must be provided'
|
|
437
442
|
}
|
|
438
443
|
)
|
|
439
|
-
|
|
440
|
-
/**
|
|
441
|
-
* Partial patch for list.config — UI sends only the edited tab's subtree.
|
|
442
|
-
* Zod v4: use .partial() on each subtree and remake the root schema.
|
|
443
|
-
* Since the root ListConfigSchema marks `qualification` as required, we must
|
|
444
|
-
* produce a manually-built deep-partial that makes qualification optional too.
|
|
445
|
-
*/
|
|
446
|
-
export const UpdateListConfigRequestSchema = z
|
|
447
|
-
.object({
|
|
448
|
-
qualification: ListQualificationSchema.partial().optional(),
|
|
449
|
-
enrichment: ListEnrichmentSchema.partial().optional(),
|
|
450
|
-
personalization: ListPersonalizationSchema.partial().optional(),
|
|
451
|
-
pipeline: ListPipelineSchema.partial().optional()
|
|
452
|
-
})
|
|
453
|
-
.strict()
|
|
454
|
-
|
|
455
|
-
export const AddCompaniesToListRequestSchema = z
|
|
456
|
-
.object({
|
|
457
|
-
companyIds: z.array(UuidSchema).min(1).max(1000)
|
|
458
|
-
})
|
|
459
|
-
.strict()
|
|
460
|
-
|
|
461
|
-
export const RemoveCompaniesFromListRequestSchema = z
|
|
462
|
-
.object({
|
|
463
|
-
companyIds: z.array(UuidSchema).min(1).max(1000)
|
|
464
|
-
})
|
|
465
|
-
.strict()
|
|
466
|
-
|
|
467
|
-
export const AddContactsToListRequestSchema = z
|
|
468
|
-
.object({
|
|
469
|
-
contactIds: z.array(UuidSchema).min(1).max(1000)
|
|
470
|
-
})
|
|
471
|
-
.strict()
|
|
472
|
-
|
|
473
|
-
export const RecordListExecutionRequestSchema = z
|
|
474
|
-
.object({
|
|
475
|
-
executionId: UuidSchema,
|
|
476
|
-
configSnapshot: z.record(z.string(), z.unknown()).optional()
|
|
477
|
-
})
|
|
478
|
-
.strict()
|
|
479
|
-
|
|
480
|
-
// ---------------------------------------------------------------------------
|
|
481
|
-
// Response schemas (no .strict() — allows forward-compatible additions)
|
|
482
|
-
// ---------------------------------------------------------------------------
|
|
483
|
-
|
|
484
|
-
/**
|
|
485
|
-
* Single list as returned by /api/acquisition/lists/:id etc.
|
|
486
|
-
* Camel-cased domain shape matching AcqList in types.ts.
|
|
487
|
-
*/
|
|
488
|
-
export const AcqListResponseSchema = z.object({
|
|
489
|
-
id: z.string(),
|
|
490
|
-
organizationId: z.string(),
|
|
491
|
-
name: z.string(),
|
|
492
|
-
description: z.string().nullable(),
|
|
493
|
-
type: z.string(),
|
|
494
|
-
batchIds: z.array(z.string()),
|
|
495
|
-
instantlyCampaignId: z.string().nullable(),
|
|
496
|
-
status: z.string(),
|
|
497
|
-
metadata: z.record(z.string(), z.unknown()),
|
|
498
|
-
launchedAt: z.string().nullable(),
|
|
499
|
-
completedAt: z.string().nullable(),
|
|
500
|
-
createdAt: z.string(),
|
|
501
|
-
config: ListConfigSchema
|
|
502
|
-
})
|
|
503
|
-
|
|
504
|
-
export const AcqListListResponseSchema = z.array(AcqListResponseSchema)
|
|
505
|
-
|
|
506
|
-
export const ListTelemetryResponseSchema = ListTelemetrySchema
|
|
507
|
-
|
|
508
|
-
export const ListTelemetryListResponseSchema = z.array(ListTelemetrySchema)
|
|
509
|
-
|
|
510
|
-
/**
|
|
511
|
-
* Row from acq_list_executions joined with the execution summary,
|
|
512
|
-
* shaped for the /lists/:id/executions response.
|
|
513
|
-
*/
|
|
514
|
-
export const ListExecutionSummarySchema = z.object({
|
|
515
|
-
executionId: z.string(),
|
|
516
|
-
resourceId: z.string(),
|
|
517
|
-
status: z.string(),
|
|
518
|
-
createdAt: z.string(),
|
|
519
|
-
completedAt: z.string().nullable(),
|
|
520
|
-
durationMs: z.number().int().nullable()
|
|
521
|
-
})
|
|
522
|
-
|
|
523
|
-
export const ListExecutionsResponseSchema = z.array(ListExecutionSummarySchema)
|
|
524
|
-
|
|
525
|
-
// ---------------------------------------------------------------------------
|
|
526
|
-
// Company / Contact API Schemas
|
|
527
|
-
// ---------------------------------------------------------------------------
|
|
528
|
-
|
|
529
|
-
const QueryBooleanSchema = z.preprocess((value) => {
|
|
530
|
-
if (value === 'true' || value === '1' || value === true) return true
|
|
531
|
-
if (value === 'false' || value === '0' || value === false) return false
|
|
532
|
-
return value
|
|
533
|
-
}, z.boolean())
|
|
534
|
-
|
|
535
|
-
export const AcqCompanyStatusSchema = z.enum(['active', 'invalid'])
|
|
536
|
-
export const AcqContactStatusSchema = z.enum(['active', 'invalid'])
|
|
537
|
-
export const AcqEmailValidSchema = z.enum(['VALID', 'INVALID', 'RISKY', 'UNKNOWN'])
|
|
538
|
-
|
|
539
|
-
export const CompanyIdParamsSchema = z.object({
|
|
540
|
-
companyId: UuidSchema
|
|
541
|
-
})
|
|
542
|
-
|
|
543
|
-
export const ContactIdParamsSchema = z.object({
|
|
544
|
-
contactId: UuidSchema
|
|
545
|
-
})
|
|
546
|
-
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* Partial patch for list.config — UI sends only the edited tab's subtree.
|
|
447
|
+
* Zod v4: use .partial() on each subtree and remake the root schema.
|
|
448
|
+
* Since the root ListConfigSchema marks `qualification` as required, we must
|
|
449
|
+
* produce a manually-built deep-partial that makes qualification optional too.
|
|
450
|
+
*/
|
|
451
|
+
export const UpdateListConfigRequestSchema = z
|
|
452
|
+
.object({
|
|
453
|
+
qualification: ListQualificationSchema.partial().optional(),
|
|
454
|
+
enrichment: ListEnrichmentSchema.partial().optional(),
|
|
455
|
+
personalization: ListPersonalizationSchema.partial().optional(),
|
|
456
|
+
pipeline: ListPipelineSchema.partial().optional()
|
|
457
|
+
})
|
|
458
|
+
.strict()
|
|
459
|
+
|
|
460
|
+
export const AddCompaniesToListRequestSchema = z
|
|
461
|
+
.object({
|
|
462
|
+
companyIds: z.array(UuidSchema).min(1).max(1000)
|
|
463
|
+
})
|
|
464
|
+
.strict()
|
|
465
|
+
|
|
466
|
+
export const RemoveCompaniesFromListRequestSchema = z
|
|
467
|
+
.object({
|
|
468
|
+
companyIds: z.array(UuidSchema).min(1).max(1000)
|
|
469
|
+
})
|
|
470
|
+
.strict()
|
|
471
|
+
|
|
472
|
+
export const AddContactsToListRequestSchema = z
|
|
473
|
+
.object({
|
|
474
|
+
contactIds: z.array(UuidSchema).min(1).max(1000)
|
|
475
|
+
})
|
|
476
|
+
.strict()
|
|
477
|
+
|
|
478
|
+
export const RecordListExecutionRequestSchema = z
|
|
479
|
+
.object({
|
|
480
|
+
executionId: UuidSchema,
|
|
481
|
+
configSnapshot: z.record(z.string(), z.unknown()).optional()
|
|
482
|
+
})
|
|
483
|
+
.strict()
|
|
484
|
+
|
|
485
|
+
// ---------------------------------------------------------------------------
|
|
486
|
+
// Response schemas (no .strict() — allows forward-compatible additions)
|
|
487
|
+
// ---------------------------------------------------------------------------
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Single list as returned by /api/acquisition/lists/:id etc.
|
|
491
|
+
* Camel-cased domain shape matching AcqList in types.ts.
|
|
492
|
+
*/
|
|
493
|
+
export const AcqListResponseSchema = z.object({
|
|
494
|
+
id: z.string(),
|
|
495
|
+
organizationId: z.string(),
|
|
496
|
+
name: z.string(),
|
|
497
|
+
description: z.string().nullable(),
|
|
498
|
+
type: z.string(),
|
|
499
|
+
batchIds: z.array(z.string()),
|
|
500
|
+
instantlyCampaignId: z.string().nullable(),
|
|
501
|
+
status: z.string(),
|
|
502
|
+
metadata: z.record(z.string(), z.unknown()),
|
|
503
|
+
launchedAt: z.string().nullable(),
|
|
504
|
+
completedAt: z.string().nullable(),
|
|
505
|
+
createdAt: z.string(),
|
|
506
|
+
config: ListConfigSchema
|
|
507
|
+
})
|
|
508
|
+
|
|
509
|
+
export const AcqListListResponseSchema = z.array(AcqListResponseSchema)
|
|
510
|
+
|
|
511
|
+
export const ListTelemetryResponseSchema = ListTelemetrySchema
|
|
512
|
+
|
|
513
|
+
export const ListTelemetryListResponseSchema = z.array(ListTelemetrySchema)
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Row from acq_list_executions joined with the execution summary,
|
|
517
|
+
* shaped for the /lists/:id/executions response.
|
|
518
|
+
*/
|
|
519
|
+
export const ListExecutionSummarySchema = z.object({
|
|
520
|
+
executionId: z.string(),
|
|
521
|
+
resourceId: z.string(),
|
|
522
|
+
status: z.string(),
|
|
523
|
+
createdAt: z.string(),
|
|
524
|
+
completedAt: z.string().nullable(),
|
|
525
|
+
durationMs: z.number().int().nullable()
|
|
526
|
+
})
|
|
527
|
+
|
|
528
|
+
export const ListExecutionsResponseSchema = z.array(ListExecutionSummarySchema)
|
|
529
|
+
|
|
530
|
+
// ---------------------------------------------------------------------------
|
|
531
|
+
// Company / Contact API Schemas
|
|
532
|
+
// ---------------------------------------------------------------------------
|
|
533
|
+
|
|
534
|
+
const QueryBooleanSchema = z.preprocess((value) => {
|
|
535
|
+
if (value === 'true' || value === '1' || value === true) return true
|
|
536
|
+
if (value === 'false' || value === '0' || value === false) return false
|
|
537
|
+
return value
|
|
538
|
+
}, z.boolean())
|
|
539
|
+
|
|
540
|
+
export const AcqCompanyStatusSchema = z.enum(['active', 'invalid'])
|
|
541
|
+
export const AcqContactStatusSchema = z.enum(['active', 'invalid'])
|
|
542
|
+
export const AcqEmailValidSchema = z.enum(['VALID', 'INVALID', 'RISKY', 'UNKNOWN'])
|
|
543
|
+
|
|
544
|
+
export const CompanyIdParamsSchema = z.object({
|
|
545
|
+
companyId: UuidSchema
|
|
546
|
+
})
|
|
547
|
+
|
|
548
|
+
export const ContactIdParamsSchema = z.object({
|
|
549
|
+
contactId: UuidSchema
|
|
550
|
+
})
|
|
551
|
+
|
|
547
552
|
export const ListCompaniesQuerySchema = z
|
|
548
553
|
.object({
|
|
549
554
|
search: z.string().trim().min(1).max(200).optional(),
|
|
550
555
|
listId: UuidSchema.optional(),
|
|
551
556
|
domain: z.string().trim().min(1).max(255).optional(),
|
|
552
|
-
website: z.string().trim().min(1).max(2048).optional(),
|
|
553
|
-
segment: z.string().trim().min(1).max(255).optional(),
|
|
557
|
+
website: z.string().trim().min(1).max(2048).optional(),
|
|
558
|
+
segment: z.string().trim().min(1).max(255).optional(),
|
|
554
559
|
category: z.string().trim().min(1).max(255).optional(),
|
|
555
560
|
batchId: z.string().trim().min(1).max(255).optional(),
|
|
556
561
|
status: AcqCompanyStatusSchema.optional(),
|
|
@@ -559,145 +564,145 @@ export const ListCompaniesQuerySchema = z
|
|
|
559
564
|
offset: z.coerce.number().int().min(0).default(0)
|
|
560
565
|
})
|
|
561
566
|
.strict()
|
|
562
|
-
|
|
563
|
-
export const ListContactsQuerySchema = z
|
|
564
|
-
.object({
|
|
565
|
-
search: z.string().trim().min(1).max(200).optional(),
|
|
566
|
-
listId: UuidSchema.optional(),
|
|
567
|
-
openingLineIsNull: QueryBooleanSchema.optional(),
|
|
568
|
-
batchId: z.string().trim().min(1).max(255).optional(),
|
|
569
|
-
contactStatus: AcqContactStatusSchema.optional(),
|
|
570
|
-
limit: z.coerce.number().int().min(1).max(5000).default(5000),
|
|
571
|
-
offset: z.coerce.number().int().min(0).default(0)
|
|
572
|
-
})
|
|
573
|
-
.strict()
|
|
574
|
-
|
|
575
|
-
export const CreateCompanyRequestSchema = z
|
|
576
|
-
.object({
|
|
577
|
-
name: z.string().trim().min(1).max(255),
|
|
578
|
-
domain: z.string().trim().min(1).max(255).optional(),
|
|
579
|
-
linkedinUrl: z.string().trim().url().optional(),
|
|
580
|
-
website: z.string().trim().url().optional(),
|
|
581
|
-
numEmployees: z.number().int().min(0).optional(),
|
|
582
|
-
foundedYear: z.number().int().optional(),
|
|
583
|
-
locationCity: z.string().trim().min(1).max(255).optional(),
|
|
584
|
-
locationState: z.string().trim().min(1).max(255).optional(),
|
|
585
|
-
category: z.string().trim().min(1).max(255).optional(),
|
|
586
|
-
source: z.string().trim().min(1).max(255).optional(),
|
|
587
|
-
batchId: z.string().trim().min(1).max(255).optional(),
|
|
588
|
-
verticalResearch: z.string().trim().min(1).max(5000).optional()
|
|
589
|
-
})
|
|
590
|
-
.strict()
|
|
591
|
-
|
|
592
|
-
export const UpdateCompanyRequestSchema = z
|
|
593
|
-
.object({
|
|
594
|
-
name: z.string().trim().min(1).max(255).optional(),
|
|
595
|
-
domain: z.string().trim().min(1).max(255).optional(),
|
|
596
|
-
linkedinUrl: z.string().trim().url().optional(),
|
|
597
|
-
website: z.string().trim().url().optional(),
|
|
598
|
-
numEmployees: z.number().int().min(0).optional(),
|
|
599
|
-
foundedYear: z.number().int().optional(),
|
|
600
|
-
locationCity: z.string().trim().min(1).max(255).optional(),
|
|
601
|
-
locationState: z.string().trim().min(1).max(255).optional(),
|
|
602
|
-
category: z.string().trim().min(1).max(255).optional(),
|
|
603
|
-
segment: z.string().trim().min(1).max(255).optional(),
|
|
604
|
-
pipelineStatus: z.record(z.string(), z.unknown()).optional(),
|
|
605
|
-
enrichmentData: z.record(z.string(), z.unknown()).optional(),
|
|
606
|
-
source: z.string().trim().min(1).max(255).optional(),
|
|
607
|
-
batchId: z.string().trim().min(1).max(255).optional(),
|
|
608
|
-
status: AcqCompanyStatusSchema.optional(),
|
|
609
|
-
verticalResearch: z.string().trim().min(1).max(5000).nullable().optional()
|
|
610
|
-
})
|
|
611
|
-
.strict()
|
|
612
|
-
.refine(
|
|
613
|
-
(data) =>
|
|
614
|
-
data.name !== undefined ||
|
|
615
|
-
data.domain !== undefined ||
|
|
616
|
-
data.linkedinUrl !== undefined ||
|
|
617
|
-
data.website !== undefined ||
|
|
618
|
-
data.numEmployees !== undefined ||
|
|
619
|
-
data.foundedYear !== undefined ||
|
|
620
|
-
data.locationCity !== undefined ||
|
|
621
|
-
data.locationState !== undefined ||
|
|
622
|
-
data.category !== undefined ||
|
|
623
|
-
data.segment !== undefined ||
|
|
624
|
-
data.pipelineStatus !== undefined ||
|
|
625
|
-
data.enrichmentData !== undefined ||
|
|
626
|
-
data.source !== undefined ||
|
|
627
|
-
data.batchId !== undefined ||
|
|
628
|
-
data.status !== undefined ||
|
|
629
|
-
data.verticalResearch !== undefined,
|
|
630
|
-
{
|
|
631
|
-
message: 'At least one field must be provided'
|
|
632
|
-
}
|
|
633
|
-
)
|
|
634
|
-
|
|
635
|
-
export const CreateContactRequestSchema = z
|
|
636
|
-
.object({
|
|
637
|
-
email: z.string().trim().email(),
|
|
638
|
-
companyId: UuidSchema.optional(),
|
|
639
|
-
firstName: z.string().trim().min(1).max(255).optional(),
|
|
640
|
-
lastName: z.string().trim().min(1).max(255).optional(),
|
|
641
|
-
linkedinUrl: z.string().trim().url().optional(),
|
|
642
|
-
title: z.string().trim().min(1).max(255).optional(),
|
|
643
|
-
source: z.string().trim().min(1).max(255).optional(),
|
|
644
|
-
sourceId: z.string().trim().min(1).max(255).optional(),
|
|
645
|
-
batchId: z.string().trim().min(1).max(255).optional()
|
|
646
|
-
})
|
|
647
|
-
.strict()
|
|
648
|
-
|
|
649
|
-
export const UpdateContactRequestSchema = z
|
|
650
|
-
.object({
|
|
651
|
-
companyId: UuidSchema.optional(),
|
|
652
|
-
emailValid: AcqEmailValidSchema.optional(),
|
|
653
|
-
firstName: z.string().trim().min(1).max(255).optional(),
|
|
654
|
-
lastName: z.string().trim().min(1).max(255).optional(),
|
|
655
|
-
linkedinUrl: z.string().trim().url().optional(),
|
|
656
|
-
title: z.string().trim().min(1).max(255).optional(),
|
|
657
|
-
headline: z.string().trim().min(1).max(5000).optional(),
|
|
658
|
-
filterReason: z.string().trim().min(1).max(5000).optional(),
|
|
659
|
-
openingLine: z.string().trim().min(1).max(5000).optional(),
|
|
660
|
-
pipelineStatus: z.record(z.string(), z.unknown()).optional(),
|
|
661
|
-
enrichmentData: z.record(z.string(), z.unknown()).optional(),
|
|
662
|
-
status: AcqContactStatusSchema.optional()
|
|
663
|
-
})
|
|
664
|
-
.strict()
|
|
665
|
-
.refine(
|
|
666
|
-
(data) =>
|
|
667
|
-
data.companyId !== undefined ||
|
|
668
|
-
data.emailValid !== undefined ||
|
|
669
|
-
data.firstName !== undefined ||
|
|
670
|
-
data.lastName !== undefined ||
|
|
671
|
-
data.linkedinUrl !== undefined ||
|
|
672
|
-
data.title !== undefined ||
|
|
673
|
-
data.headline !== undefined ||
|
|
674
|
-
data.filterReason !== undefined ||
|
|
675
|
-
data.openingLine !== undefined ||
|
|
676
|
-
data.pipelineStatus !== undefined ||
|
|
677
|
-
data.enrichmentData !== undefined ||
|
|
678
|
-
data.status !== undefined,
|
|
679
|
-
{
|
|
680
|
-
message: 'At least one field must be provided'
|
|
681
|
-
}
|
|
682
|
-
)
|
|
683
|
-
|
|
567
|
+
|
|
568
|
+
export const ListContactsQuerySchema = z
|
|
569
|
+
.object({
|
|
570
|
+
search: z.string().trim().min(1).max(200).optional(),
|
|
571
|
+
listId: UuidSchema.optional(),
|
|
572
|
+
openingLineIsNull: QueryBooleanSchema.optional(),
|
|
573
|
+
batchId: z.string().trim().min(1).max(255).optional(),
|
|
574
|
+
contactStatus: AcqContactStatusSchema.optional(),
|
|
575
|
+
limit: z.coerce.number().int().min(1).max(5000).default(5000),
|
|
576
|
+
offset: z.coerce.number().int().min(0).default(0)
|
|
577
|
+
})
|
|
578
|
+
.strict()
|
|
579
|
+
|
|
580
|
+
export const CreateCompanyRequestSchema = z
|
|
581
|
+
.object({
|
|
582
|
+
name: z.string().trim().min(1).max(255),
|
|
583
|
+
domain: z.string().trim().min(1).max(255).optional(),
|
|
584
|
+
linkedinUrl: z.string().trim().url().optional(),
|
|
585
|
+
website: z.string().trim().url().optional(),
|
|
586
|
+
numEmployees: z.number().int().min(0).optional(),
|
|
587
|
+
foundedYear: z.number().int().optional(),
|
|
588
|
+
locationCity: z.string().trim().min(1).max(255).optional(),
|
|
589
|
+
locationState: z.string().trim().min(1).max(255).optional(),
|
|
590
|
+
category: z.string().trim().min(1).max(255).optional(),
|
|
591
|
+
source: z.string().trim().min(1).max(255).optional(),
|
|
592
|
+
batchId: z.string().trim().min(1).max(255).optional(),
|
|
593
|
+
verticalResearch: z.string().trim().min(1).max(5000).optional()
|
|
594
|
+
})
|
|
595
|
+
.strict()
|
|
596
|
+
|
|
597
|
+
export const UpdateCompanyRequestSchema = z
|
|
598
|
+
.object({
|
|
599
|
+
name: z.string().trim().min(1).max(255).optional(),
|
|
600
|
+
domain: z.string().trim().min(1).max(255).optional(),
|
|
601
|
+
linkedinUrl: z.string().trim().url().optional(),
|
|
602
|
+
website: z.string().trim().url().optional(),
|
|
603
|
+
numEmployees: z.number().int().min(0).optional(),
|
|
604
|
+
foundedYear: z.number().int().optional(),
|
|
605
|
+
locationCity: z.string().trim().min(1).max(255).optional(),
|
|
606
|
+
locationState: z.string().trim().min(1).max(255).optional(),
|
|
607
|
+
category: z.string().trim().min(1).max(255).optional(),
|
|
608
|
+
segment: z.string().trim().min(1).max(255).optional(),
|
|
609
|
+
pipelineStatus: z.record(z.string(), z.unknown()).optional(),
|
|
610
|
+
enrichmentData: z.record(z.string(), z.unknown()).optional(),
|
|
611
|
+
source: z.string().trim().min(1).max(255).optional(),
|
|
612
|
+
batchId: z.string().trim().min(1).max(255).optional(),
|
|
613
|
+
status: AcqCompanyStatusSchema.optional(),
|
|
614
|
+
verticalResearch: z.string().trim().min(1).max(5000).nullable().optional()
|
|
615
|
+
})
|
|
616
|
+
.strict()
|
|
617
|
+
.refine(
|
|
618
|
+
(data) =>
|
|
619
|
+
data.name !== undefined ||
|
|
620
|
+
data.domain !== undefined ||
|
|
621
|
+
data.linkedinUrl !== undefined ||
|
|
622
|
+
data.website !== undefined ||
|
|
623
|
+
data.numEmployees !== undefined ||
|
|
624
|
+
data.foundedYear !== undefined ||
|
|
625
|
+
data.locationCity !== undefined ||
|
|
626
|
+
data.locationState !== undefined ||
|
|
627
|
+
data.category !== undefined ||
|
|
628
|
+
data.segment !== undefined ||
|
|
629
|
+
data.pipelineStatus !== undefined ||
|
|
630
|
+
data.enrichmentData !== undefined ||
|
|
631
|
+
data.source !== undefined ||
|
|
632
|
+
data.batchId !== undefined ||
|
|
633
|
+
data.status !== undefined ||
|
|
634
|
+
data.verticalResearch !== undefined,
|
|
635
|
+
{
|
|
636
|
+
message: 'At least one field must be provided'
|
|
637
|
+
}
|
|
638
|
+
)
|
|
639
|
+
|
|
640
|
+
export const CreateContactRequestSchema = z
|
|
641
|
+
.object({
|
|
642
|
+
email: z.string().trim().email(),
|
|
643
|
+
companyId: UuidSchema.optional(),
|
|
644
|
+
firstName: z.string().trim().min(1).max(255).optional(),
|
|
645
|
+
lastName: z.string().trim().min(1).max(255).optional(),
|
|
646
|
+
linkedinUrl: z.string().trim().url().optional(),
|
|
647
|
+
title: z.string().trim().min(1).max(255).optional(),
|
|
648
|
+
source: z.string().trim().min(1).max(255).optional(),
|
|
649
|
+
sourceId: z.string().trim().min(1).max(255).optional(),
|
|
650
|
+
batchId: z.string().trim().min(1).max(255).optional()
|
|
651
|
+
})
|
|
652
|
+
.strict()
|
|
653
|
+
|
|
654
|
+
export const UpdateContactRequestSchema = z
|
|
655
|
+
.object({
|
|
656
|
+
companyId: UuidSchema.optional(),
|
|
657
|
+
emailValid: AcqEmailValidSchema.optional(),
|
|
658
|
+
firstName: z.string().trim().min(1).max(255).optional(),
|
|
659
|
+
lastName: z.string().trim().min(1).max(255).optional(),
|
|
660
|
+
linkedinUrl: z.string().trim().url().optional(),
|
|
661
|
+
title: z.string().trim().min(1).max(255).optional(),
|
|
662
|
+
headline: z.string().trim().min(1).max(5000).optional(),
|
|
663
|
+
filterReason: z.string().trim().min(1).max(5000).optional(),
|
|
664
|
+
openingLine: z.string().trim().min(1).max(5000).optional(),
|
|
665
|
+
pipelineStatus: z.record(z.string(), z.unknown()).optional(),
|
|
666
|
+
enrichmentData: z.record(z.string(), z.unknown()).optional(),
|
|
667
|
+
status: AcqContactStatusSchema.optional()
|
|
668
|
+
})
|
|
669
|
+
.strict()
|
|
670
|
+
.refine(
|
|
671
|
+
(data) =>
|
|
672
|
+
data.companyId !== undefined ||
|
|
673
|
+
data.emailValid !== undefined ||
|
|
674
|
+
data.firstName !== undefined ||
|
|
675
|
+
data.lastName !== undefined ||
|
|
676
|
+
data.linkedinUrl !== undefined ||
|
|
677
|
+
data.title !== undefined ||
|
|
678
|
+
data.headline !== undefined ||
|
|
679
|
+
data.filterReason !== undefined ||
|
|
680
|
+
data.openingLine !== undefined ||
|
|
681
|
+
data.pipelineStatus !== undefined ||
|
|
682
|
+
data.enrichmentData !== undefined ||
|
|
683
|
+
data.status !== undefined,
|
|
684
|
+
{
|
|
685
|
+
message: 'At least one field must be provided'
|
|
686
|
+
}
|
|
687
|
+
)
|
|
688
|
+
|
|
684
689
|
export const AcqCompanyResponseSchema = z.object({
|
|
685
690
|
id: z.string(),
|
|
686
691
|
organizationId: z.string(),
|
|
687
692
|
name: z.string(),
|
|
688
|
-
domain: z.string().nullable(),
|
|
689
|
-
linkedinUrl: z.string().nullable(),
|
|
690
|
-
website: z.string().nullable(),
|
|
691
|
-
numEmployees: z.number().nullable(),
|
|
692
|
-
foundedYear: z.number().nullable(),
|
|
693
|
-
locationCity: z.string().nullable(),
|
|
694
|
-
locationState: z.string().nullable(),
|
|
695
|
-
category: z.string().nullable(),
|
|
696
|
-
categoryPain: z.string().nullable(),
|
|
697
|
-
segment: z.string().nullable(),
|
|
698
|
-
pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
|
|
699
|
-
enrichmentData: z.record(z.string(), z.unknown()).nullable(),
|
|
700
|
-
source: z.string().nullable(),
|
|
693
|
+
domain: z.string().nullable(),
|
|
694
|
+
linkedinUrl: z.string().nullable(),
|
|
695
|
+
website: z.string().nullable(),
|
|
696
|
+
numEmployees: z.number().nullable(),
|
|
697
|
+
foundedYear: z.number().nullable(),
|
|
698
|
+
locationCity: z.string().nullable(),
|
|
699
|
+
locationState: z.string().nullable(),
|
|
700
|
+
category: z.string().nullable(),
|
|
701
|
+
categoryPain: z.string().nullable(),
|
|
702
|
+
segment: z.string().nullable(),
|
|
703
|
+
pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
|
|
704
|
+
enrichmentData: z.record(z.string(), z.unknown()).nullable(),
|
|
705
|
+
source: z.string().nullable(),
|
|
701
706
|
batchId: z.string().nullable(),
|
|
702
707
|
status: AcqCompanyStatusSchema,
|
|
703
708
|
contactCount: z.number().int().min(0),
|
|
@@ -733,20 +738,20 @@ export const AcqContactCompanySummarySchema = z.object({
|
|
|
733
738
|
export const AcqContactResponseSchema = z.object({
|
|
734
739
|
id: z.string(),
|
|
735
740
|
organizationId: z.string(),
|
|
736
|
-
companyId: z.string().nullable(),
|
|
737
|
-
email: z.string(),
|
|
738
|
-
emailValid: AcqEmailValidSchema.nullable(),
|
|
739
|
-
firstName: z.string().nullable(),
|
|
740
|
-
lastName: z.string().nullable(),
|
|
741
|
-
linkedinUrl: z.string().nullable(),
|
|
742
|
-
title: z.string().nullable(),
|
|
743
|
-
headline: z.string().nullable(),
|
|
744
|
-
filterReason: z.string().nullable(),
|
|
745
|
-
openingLine: z.string().nullable(),
|
|
746
|
-
source: z.string().nullable(),
|
|
747
|
-
sourceId: z.string().nullable(),
|
|
748
|
-
pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
|
|
749
|
-
enrichmentData: z.record(z.string(), z.unknown()).nullable(),
|
|
741
|
+
companyId: z.string().nullable(),
|
|
742
|
+
email: z.string(),
|
|
743
|
+
emailValid: AcqEmailValidSchema.nullable(),
|
|
744
|
+
firstName: z.string().nullable(),
|
|
745
|
+
lastName: z.string().nullable(),
|
|
746
|
+
linkedinUrl: z.string().nullable(),
|
|
747
|
+
title: z.string().nullable(),
|
|
748
|
+
headline: z.string().nullable(),
|
|
749
|
+
filterReason: z.string().nullable(),
|
|
750
|
+
openingLine: z.string().nullable(),
|
|
751
|
+
source: z.string().nullable(),
|
|
752
|
+
sourceId: z.string().nullable(),
|
|
753
|
+
pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
|
|
754
|
+
enrichmentData: z.record(z.string(), z.unknown()).nullable(),
|
|
750
755
|
attioPersonId: z.string().nullable(),
|
|
751
756
|
batchId: z.string().nullable(),
|
|
752
757
|
status: AcqContactStatusSchema,
|
|
@@ -754,101 +759,101 @@ export const AcqContactResponseSchema = z.object({
|
|
|
754
759
|
createdAt: z.string(),
|
|
755
760
|
updatedAt: z.string()
|
|
756
761
|
})
|
|
757
|
-
|
|
758
|
-
export const AcqContactListResponseSchema = z.object({
|
|
759
|
-
data: z.array(AcqContactResponseSchema),
|
|
760
|
-
total: z.number().int(),
|
|
761
|
-
limit: z.number().int(),
|
|
762
|
-
offset: z.number().int()
|
|
763
|
-
})
|
|
764
|
-
|
|
765
|
-
export const AcqCompanySchemas = {
|
|
766
|
-
CompanyIdParams: CompanyIdParamsSchema,
|
|
767
|
-
ListCompaniesQuery: ListCompaniesQuerySchema,
|
|
768
|
-
CreateCompanyRequest: CreateCompanyRequestSchema,
|
|
762
|
+
|
|
763
|
+
export const AcqContactListResponseSchema = z.object({
|
|
764
|
+
data: z.array(AcqContactResponseSchema),
|
|
765
|
+
total: z.number().int(),
|
|
766
|
+
limit: z.number().int(),
|
|
767
|
+
offset: z.number().int()
|
|
768
|
+
})
|
|
769
|
+
|
|
770
|
+
export const AcqCompanySchemas = {
|
|
771
|
+
CompanyIdParams: CompanyIdParamsSchema,
|
|
772
|
+
ListCompaniesQuery: ListCompaniesQuerySchema,
|
|
773
|
+
CreateCompanyRequest: CreateCompanyRequestSchema,
|
|
769
774
|
UpdateCompanyRequest: UpdateCompanyRequestSchema,
|
|
770
775
|
AcqCompanyResponse: AcqCompanyResponseSchema,
|
|
771
776
|
AcqCompanyListResponse: AcqCompanyListResponseSchema,
|
|
772
777
|
AcqCompanyFacetsResponse: AcqCompanyFacetsResponseSchema
|
|
773
778
|
}
|
|
774
|
-
|
|
775
|
-
export const AcqContactSchemas = {
|
|
776
|
-
ContactIdParams: ContactIdParamsSchema,
|
|
777
|
-
ListContactsQuery: ListContactsQuerySchema,
|
|
778
|
-
CreateContactRequest: CreateContactRequestSchema,
|
|
779
|
-
UpdateContactRequest: UpdateContactRequestSchema,
|
|
780
|
-
AcqContactResponse: AcqContactResponseSchema,
|
|
781
|
-
AcqContactListResponse: AcqContactListResponseSchema
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
export type AcqCompanyStatus = z.infer<typeof AcqCompanyStatusSchema>
|
|
785
|
-
export type AcqContactStatus = z.infer<typeof AcqContactStatusSchema>
|
|
786
|
-
export type AcqEmailValid = z.infer<typeof AcqEmailValidSchema>
|
|
787
|
-
export type CompanyIdParams = z.infer<typeof CompanyIdParamsSchema>
|
|
788
|
-
export type ContactIdParams = z.infer<typeof ContactIdParamsSchema>
|
|
789
|
-
export type ListCompaniesQuery = z.infer<typeof ListCompaniesQuerySchema>
|
|
790
|
-
export type ListContactsQuery = z.infer<typeof ListContactsQuerySchema>
|
|
791
|
-
export type CreateCompanyRequest = z.infer<typeof CreateCompanyRequestSchema>
|
|
792
|
-
export type UpdateCompanyRequest = z.infer<typeof UpdateCompanyRequestSchema>
|
|
793
|
-
export type CreateContactRequest = z.infer<typeof CreateContactRequestSchema>
|
|
794
|
-
export type UpdateContactRequest = z.infer<typeof UpdateContactRequestSchema>
|
|
779
|
+
|
|
780
|
+
export const AcqContactSchemas = {
|
|
781
|
+
ContactIdParams: ContactIdParamsSchema,
|
|
782
|
+
ListContactsQuery: ListContactsQuerySchema,
|
|
783
|
+
CreateContactRequest: CreateContactRequestSchema,
|
|
784
|
+
UpdateContactRequest: UpdateContactRequestSchema,
|
|
785
|
+
AcqContactResponse: AcqContactResponseSchema,
|
|
786
|
+
AcqContactListResponse: AcqContactListResponseSchema
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
export type AcqCompanyStatus = z.infer<typeof AcqCompanyStatusSchema>
|
|
790
|
+
export type AcqContactStatus = z.infer<typeof AcqContactStatusSchema>
|
|
791
|
+
export type AcqEmailValid = z.infer<typeof AcqEmailValidSchema>
|
|
792
|
+
export type CompanyIdParams = z.infer<typeof CompanyIdParamsSchema>
|
|
793
|
+
export type ContactIdParams = z.infer<typeof ContactIdParamsSchema>
|
|
794
|
+
export type ListCompaniesQuery = z.infer<typeof ListCompaniesQuerySchema>
|
|
795
|
+
export type ListContactsQuery = z.infer<typeof ListContactsQuerySchema>
|
|
796
|
+
export type CreateCompanyRequest = z.infer<typeof CreateCompanyRequestSchema>
|
|
797
|
+
export type UpdateCompanyRequest = z.infer<typeof UpdateCompanyRequestSchema>
|
|
798
|
+
export type CreateContactRequest = z.infer<typeof CreateContactRequestSchema>
|
|
799
|
+
export type UpdateContactRequest = z.infer<typeof UpdateContactRequestSchema>
|
|
795
800
|
export type AcqCompanyResponse = z.infer<typeof AcqCompanyResponseSchema>
|
|
796
801
|
export type AcqCompanyListResponse = z.infer<typeof AcqCompanyListResponseSchema>
|
|
797
802
|
export type AcqCompanyFacetsResponse = z.infer<typeof AcqCompanyFacetsResponseSchema>
|
|
798
803
|
export type AcqContactCompanySummary = z.infer<typeof AcqContactCompanySummarySchema>
|
|
799
804
|
export type AcqContactResponse = z.infer<typeof AcqContactResponseSchema>
|
|
800
805
|
export type AcqContactListResponse = z.infer<typeof AcqContactListResponseSchema>
|
|
801
|
-
|
|
802
|
-
// ---------------------------------------------------------------------------
|
|
803
|
-
// Bundled export
|
|
804
|
-
// ---------------------------------------------------------------------------
|
|
805
|
-
|
|
806
|
-
export const AcqListSchemas = {
|
|
807
|
-
// Params
|
|
808
|
-
ListIdParams: ListIdParamsSchema,
|
|
809
|
-
|
|
810
|
-
// Primitives (for UI / tests)
|
|
811
|
-
ListConfig: ListConfigSchema,
|
|
812
|
-
ListStageCounts: ListStageCountsSchema,
|
|
813
|
-
ListTelemetry: ListTelemetrySchema,
|
|
814
|
-
PipelineStep: PipelineStepSchema,
|
|
815
|
-
|
|
816
|
-
// Requests
|
|
817
|
-
CreateListRequest: CreateListRequestSchema,
|
|
818
|
-
UpdateListRequest: UpdateListRequestSchema,
|
|
819
|
-
UpdateListConfigRequest: UpdateListConfigRequestSchema,
|
|
820
|
-
AddCompaniesToListRequest: AddCompaniesToListRequestSchema,
|
|
821
|
-
RemoveCompaniesFromListRequest: RemoveCompaniesFromListRequestSchema,
|
|
822
|
-
AddContactsToListRequest: AddContactsToListRequestSchema,
|
|
823
|
-
RecordListExecutionRequest: RecordListExecutionRequestSchema,
|
|
824
|
-
|
|
825
|
-
// Responses
|
|
826
|
-
AcqListResponse: AcqListResponseSchema,
|
|
827
|
-
AcqListListResponse: AcqListListResponseSchema,
|
|
828
|
-
ListTelemetryResponse: ListTelemetryResponseSchema,
|
|
829
|
-
ListTelemetryListResponse: ListTelemetryListResponseSchema,
|
|
830
|
-
ListExecutionsResponse: ListExecutionsResponseSchema
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
// ---------------------------------------------------------------------------
|
|
834
|
-
// Inferred types
|
|
835
|
-
// ---------------------------------------------------------------------------
|
|
836
|
-
|
|
837
|
-
export type ListConfigInput = z.infer<typeof ListConfigSchema>
|
|
838
|
-
export type ListStageCountsInput = z.infer<typeof ListStageCountsSchema>['stageCounts']
|
|
839
|
-
export type ListTelemetryInput = z.infer<typeof ListTelemetrySchema>
|
|
840
|
-
export type PipelineStepInput = z.infer<typeof PipelineStepSchema>
|
|
841
|
-
export type ListIdParams = z.infer<typeof ListIdParamsSchema>
|
|
842
|
-
export type CreateListRequest = z.infer<typeof CreateListRequestSchema>
|
|
843
|
-
export type UpdateListRequest = z.infer<typeof UpdateListRequestSchema>
|
|
844
|
-
export type UpdateListConfigRequest = z.infer<typeof UpdateListConfigRequestSchema>
|
|
845
|
-
export type AddCompaniesToListRequest = z.infer<typeof AddCompaniesToListRequestSchema>
|
|
846
|
-
export type RemoveCompaniesFromListRequest = z.infer<typeof RemoveCompaniesFromListRequestSchema>
|
|
847
|
-
export type AddContactsToListRequest = z.infer<typeof AddContactsToListRequestSchema>
|
|
848
|
-
export type RecordListExecutionRequest = z.infer<typeof RecordListExecutionRequestSchema>
|
|
849
|
-
export type AcqListResponse = z.infer<typeof AcqListResponseSchema>
|
|
850
|
-
export type AcqListListResponse = z.infer<typeof AcqListListResponseSchema>
|
|
851
|
-
export type ListTelemetryResponse = z.infer<typeof ListTelemetryResponseSchema>
|
|
852
|
-
export type ListTelemetryListResponse = z.infer<typeof ListTelemetryListResponseSchema>
|
|
853
|
-
export type ListExecutionSummaryInput = z.infer<typeof ListExecutionSummarySchema>
|
|
854
|
-
export type ListExecutionsResponse = z.infer<typeof ListExecutionsResponseSchema>
|
|
806
|
+
|
|
807
|
+
// ---------------------------------------------------------------------------
|
|
808
|
+
// Bundled export
|
|
809
|
+
// ---------------------------------------------------------------------------
|
|
810
|
+
|
|
811
|
+
export const AcqListSchemas = {
|
|
812
|
+
// Params
|
|
813
|
+
ListIdParams: ListIdParamsSchema,
|
|
814
|
+
|
|
815
|
+
// Primitives (for UI / tests)
|
|
816
|
+
ListConfig: ListConfigSchema,
|
|
817
|
+
ListStageCounts: ListStageCountsSchema,
|
|
818
|
+
ListTelemetry: ListTelemetrySchema,
|
|
819
|
+
PipelineStep: PipelineStepSchema,
|
|
820
|
+
|
|
821
|
+
// Requests
|
|
822
|
+
CreateListRequest: CreateListRequestSchema,
|
|
823
|
+
UpdateListRequest: UpdateListRequestSchema,
|
|
824
|
+
UpdateListConfigRequest: UpdateListConfigRequestSchema,
|
|
825
|
+
AddCompaniesToListRequest: AddCompaniesToListRequestSchema,
|
|
826
|
+
RemoveCompaniesFromListRequest: RemoveCompaniesFromListRequestSchema,
|
|
827
|
+
AddContactsToListRequest: AddContactsToListRequestSchema,
|
|
828
|
+
RecordListExecutionRequest: RecordListExecutionRequestSchema,
|
|
829
|
+
|
|
830
|
+
// Responses
|
|
831
|
+
AcqListResponse: AcqListResponseSchema,
|
|
832
|
+
AcqListListResponse: AcqListListResponseSchema,
|
|
833
|
+
ListTelemetryResponse: ListTelemetryResponseSchema,
|
|
834
|
+
ListTelemetryListResponse: ListTelemetryListResponseSchema,
|
|
835
|
+
ListExecutionsResponse: ListExecutionsResponseSchema
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
// ---------------------------------------------------------------------------
|
|
839
|
+
// Inferred types
|
|
840
|
+
// ---------------------------------------------------------------------------
|
|
841
|
+
|
|
842
|
+
export type ListConfigInput = z.infer<typeof ListConfigSchema>
|
|
843
|
+
export type ListStageCountsInput = z.infer<typeof ListStageCountsSchema>['stageCounts']
|
|
844
|
+
export type ListTelemetryInput = z.infer<typeof ListTelemetrySchema>
|
|
845
|
+
export type PipelineStepInput = z.infer<typeof PipelineStepSchema>
|
|
846
|
+
export type ListIdParams = z.infer<typeof ListIdParamsSchema>
|
|
847
|
+
export type CreateListRequest = z.infer<typeof CreateListRequestSchema>
|
|
848
|
+
export type UpdateListRequest = z.infer<typeof UpdateListRequestSchema>
|
|
849
|
+
export type UpdateListConfigRequest = z.infer<typeof UpdateListConfigRequestSchema>
|
|
850
|
+
export type AddCompaniesToListRequest = z.infer<typeof AddCompaniesToListRequestSchema>
|
|
851
|
+
export type RemoveCompaniesFromListRequest = z.infer<typeof RemoveCompaniesFromListRequestSchema>
|
|
852
|
+
export type AddContactsToListRequest = z.infer<typeof AddContactsToListRequestSchema>
|
|
853
|
+
export type RecordListExecutionRequest = z.infer<typeof RecordListExecutionRequestSchema>
|
|
854
|
+
export type AcqListResponse = z.infer<typeof AcqListResponseSchema>
|
|
855
|
+
export type AcqListListResponse = z.infer<typeof AcqListListResponseSchema>
|
|
856
|
+
export type ListTelemetryResponse = z.infer<typeof ListTelemetryResponseSchema>
|
|
857
|
+
export type ListTelemetryListResponse = z.infer<typeof ListTelemetryListResponseSchema>
|
|
858
|
+
export type ListExecutionSummaryInput = z.infer<typeof ListExecutionSummarySchema>
|
|
859
|
+
export type ListExecutionsResponse = z.infer<typeof ListExecutionsResponseSchema>
|