@elevasis/core 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -2
- package/dist/organization-model/index.d.ts +1 -1
- package/dist/organization-model/index.js +9 -2
- package/dist/test-utils/index.d.ts +480 -389
- package/dist/test-utils/index.js +28 -2
- package/package.json +1 -1
- package/src/_gen/__tests__/__snapshots__/contracts.md.snap +2324 -0
- 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.test.ts +250 -0
- package/src/business/acquisition/activity-events.ts +84 -0
- package/src/business/acquisition/api-schemas.test.ts +1180 -0
- package/src/business/acquisition/api-schemas.ts +456 -235
- package/src/business/acquisition/crm-state-actions.test.ts +160 -0
- package/src/business/acquisition/derive-actions.test.ts +518 -0
- package/src/business/acquisition/derive-actions.ts +103 -0
- package/src/business/acquisition/index.ts +51 -11
- package/src/business/acquisition/stateful.ts +30 -0
- package/src/business/acquisition/types.ts +44 -77
- package/src/execution/engine/index.ts +4 -1
- 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 +363 -361
- package/src/execution/engine/tools/integration/server/adapters/attio/fetch/get-record/index.test.ts +162 -186
- package/src/execution/engine/tools/integration/server/adapters/attio/fetch/list-records/index.test.ts +316 -338
- package/src/execution/engine/tools/integration/server/adapters/gmail/gmail-adapter.ts +204 -210
- package/src/execution/engine/tools/integration/server/adapters/resend/fetch/send-email/index.test.ts +88 -0
- package/src/execution/engine/tools/integration/server/adapters/resend/fetch/send-email/index.ts +141 -134
- package/src/execution/engine/tools/integration/server/adapters/resend/fetch/utils/types.ts +76 -75
- package/src/execution/engine/tools/integration/service.test.ts +34 -9
- package/src/execution/engine/tools/integration/service.ts +6 -3
- package/src/execution/engine/tools/lead-service-types.ts +90 -30
- package/src/execution/engine/tools/platform/acquisition/types.ts +266 -260
- package/src/execution/engine/tools/registry.ts +5 -4
- package/src/execution/engine/tools/tool-maps.ts +43 -21
- package/src/execution/engine/workflow/types.ts +11 -0
- package/src/organization-model/contracts.ts +4 -4
- package/src/organization-model/domains/navigation.ts +62 -62
- package/src/organization-model/domains/sales.ts +272 -0
- package/src/organization-model/organization-graph.mdx +2 -2
- package/src/organization-model/published.ts +21 -21
- package/src/organization-model/resolve.ts +21 -8
- package/src/platform/constants/versions.ts +1 -1
- package/src/reference/_generated/contracts.md +2324 -0
- package/src/scaffold-registry/index.ts +10 -9
- package/src/scaffold-registry/schema.ts +68 -62
- package/src/supabase/database.types.ts +2958 -2884
- package/src/test-utils/rls/RLSTestContext.ts +585 -553
|
@@ -1,260 +1,266 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
|
|
3
|
-
// ============================================
|
|
4
|
-
// LIST SCHEMAS
|
|
5
|
-
// ============================================
|
|
6
|
-
|
|
7
|
-
export const CreateListInputSchema = z.object({
|
|
8
|
-
name: z.string().min(1),
|
|
9
|
-
description: z.string().optional()
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
export const UpdateListInputSchema = z.object({
|
|
13
|
-
id: z.string().uuid(),
|
|
14
|
-
name: z.string().min(1).optional(),
|
|
15
|
-
description: z.string().optional()
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
export const DeleteListInputSchema = z.object({
|
|
19
|
-
id: z.string().uuid()
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
export const ListOutputSchema = z.object({
|
|
23
|
-
id: z.string().uuid(),
|
|
24
|
-
organizationId: z.string().uuid(),
|
|
25
|
-
name: z.string(),
|
|
26
|
-
description: z.string().nullable(),
|
|
27
|
-
createdAt: z.string() // ISO date string
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
export const ListArrayOutputSchema = z.array(ListOutputSchema)
|
|
31
|
-
|
|
32
|
-
// ============================================
|
|
33
|
-
// COMPANY SCHEMAS
|
|
34
|
-
// ============================================
|
|
35
|
-
|
|
36
|
-
export const CreateCompanyInputSchema = z.object({
|
|
37
|
-
name: z.string().min(1),
|
|
38
|
-
domain: z.string().optional(),
|
|
39
|
-
linkedinUrl: z.string().url().optional(),
|
|
40
|
-
website: z.string().url().optional(),
|
|
41
|
-
numEmployees: z.number().int().positive().optional(),
|
|
42
|
-
foundedYear: z.number().int().min(1800).max(2100).optional(),
|
|
43
|
-
locationCity: z.string().optional(),
|
|
44
|
-
locationState: z.string().optional(),
|
|
45
|
-
source: z.string().optional(),
|
|
46
|
-
batchId: z.string().optional()
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
export const UpdateCompanyInputSchema = z.object({
|
|
50
|
-
id: z.string().uuid(),
|
|
51
|
-
name: z.string().min(1).optional(),
|
|
52
|
-
domain: z.string().optional(),
|
|
53
|
-
linkedinUrl: z.string().url().optional(),
|
|
54
|
-
website: z.string().url().optional(),
|
|
55
|
-
numEmployees: z.number().int().positive().optional(),
|
|
56
|
-
foundedYear: z.number().int().min(1800).max(2100).optional(),
|
|
57
|
-
locationCity: z.string().optional(),
|
|
58
|
-
locationState: z.string().optional(),
|
|
59
|
-
category: z.string().optional(),
|
|
60
|
-
segment: z.string().optional(),
|
|
61
|
-
pipelineStatus: z.record(z.string(), z.unknown()).optional(),
|
|
62
|
-
enrichmentData: z.record(z.string(), z.unknown()).optional(),
|
|
63
|
-
source: z.string().optional(),
|
|
64
|
-
batchId: z.string().optional()
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
export const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
})
|
|
161
|
-
|
|
162
|
-
export const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
)
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
})
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
export type
|
|
242
|
-
export type
|
|
243
|
-
export type
|
|
244
|
-
export type
|
|
245
|
-
|
|
246
|
-
export type
|
|
247
|
-
|
|
248
|
-
export type
|
|
249
|
-
export type
|
|
250
|
-
export type
|
|
251
|
-
export type
|
|
252
|
-
export type
|
|
253
|
-
|
|
254
|
-
export type
|
|
255
|
-
export type
|
|
256
|
-
export type
|
|
257
|
-
export type
|
|
258
|
-
export type
|
|
259
|
-
export type
|
|
260
|
-
export type
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
// ============================================
|
|
4
|
+
// LIST SCHEMAS
|
|
5
|
+
// ============================================
|
|
6
|
+
|
|
7
|
+
export const CreateListInputSchema = z.object({
|
|
8
|
+
name: z.string().min(1),
|
|
9
|
+
description: z.string().optional()
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
export const UpdateListInputSchema = z.object({
|
|
13
|
+
id: z.string().uuid(),
|
|
14
|
+
name: z.string().min(1).optional(),
|
|
15
|
+
description: z.string().optional()
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
export const DeleteListInputSchema = z.object({
|
|
19
|
+
id: z.string().uuid()
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
export const ListOutputSchema = z.object({
|
|
23
|
+
id: z.string().uuid(),
|
|
24
|
+
organizationId: z.string().uuid(),
|
|
25
|
+
name: z.string(),
|
|
26
|
+
description: z.string().nullable(),
|
|
27
|
+
createdAt: z.string() // ISO date string
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
export const ListArrayOutputSchema = z.array(ListOutputSchema)
|
|
31
|
+
|
|
32
|
+
// ============================================
|
|
33
|
+
// COMPANY SCHEMAS
|
|
34
|
+
// ============================================
|
|
35
|
+
|
|
36
|
+
export const CreateCompanyInputSchema = z.object({
|
|
37
|
+
name: z.string().min(1),
|
|
38
|
+
domain: z.string().optional(),
|
|
39
|
+
linkedinUrl: z.string().url().optional(),
|
|
40
|
+
website: z.string().url().optional(),
|
|
41
|
+
numEmployees: z.number().int().positive().optional(),
|
|
42
|
+
foundedYear: z.number().int().min(1800).max(2100).optional(),
|
|
43
|
+
locationCity: z.string().optional(),
|
|
44
|
+
locationState: z.string().optional(),
|
|
45
|
+
source: z.string().optional(),
|
|
46
|
+
batchId: z.string().optional()
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
export const UpdateCompanyInputSchema = z.object({
|
|
50
|
+
id: z.string().uuid(),
|
|
51
|
+
name: z.string().min(1).optional(),
|
|
52
|
+
domain: z.string().optional(),
|
|
53
|
+
linkedinUrl: z.string().url().optional(),
|
|
54
|
+
website: z.string().url().optional(),
|
|
55
|
+
numEmployees: z.number().int().positive().optional(),
|
|
56
|
+
foundedYear: z.number().int().min(1800).max(2100).optional(),
|
|
57
|
+
locationCity: z.string().optional(),
|
|
58
|
+
locationState: z.string().optional(),
|
|
59
|
+
category: z.string().optional(),
|
|
60
|
+
segment: z.string().optional(),
|
|
61
|
+
pipelineStatus: z.record(z.string(), z.unknown()).optional(),
|
|
62
|
+
enrichmentData: z.record(z.string(), z.unknown()).optional(),
|
|
63
|
+
source: z.string().optional(),
|
|
64
|
+
batchId: z.string().optional(),
|
|
65
|
+
/** Track A: flat qualification score column (null until a scoring rubric is defined) */
|
|
66
|
+
qualificationScore: z.number().nullable().optional(),
|
|
67
|
+
/** Track A: flat qualification signals jsonb — mirrors the former pipeline_status.qualification shape */
|
|
68
|
+
qualificationSignals: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
69
|
+
/** Track A: key identifying the rubric used for qualification */
|
|
70
|
+
qualificationRubricKey: z.string().nullable().optional()
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
export const UpsertCompanyInputSchema = CreateCompanyInputSchema.extend({
|
|
74
|
+
domain: z.string().min(1) // Domain required for upsert (unique key)
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
export const GetCompanyInputSchema = z.object({
|
|
78
|
+
id: z.string().uuid()
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
export const ListCompaniesInputSchema = z.object({
|
|
82
|
+
segment: z.string().optional(),
|
|
83
|
+
category: z.string().optional(),
|
|
84
|
+
domain: z.string().optional().describe('Exact domain match filter'),
|
|
85
|
+
website: z.string().optional().describe('Exact website match filter'),
|
|
86
|
+
pipelineStatus: z.record(z.string(), z.unknown()).optional().describe('JSONB containment filter for pipeline_status'),
|
|
87
|
+
batchId: z.string().optional(),
|
|
88
|
+
status: z
|
|
89
|
+
.enum(['active', 'invalid'])
|
|
90
|
+
.optional()
|
|
91
|
+
.describe('Filter by company status. Defaults to active if not set and includeAll is false'),
|
|
92
|
+
includeAll: z
|
|
93
|
+
.boolean()
|
|
94
|
+
.optional()
|
|
95
|
+
.describe('Bypass default active-only filter to return all companies regardless of status'),
|
|
96
|
+
excludeColumns: z
|
|
97
|
+
.array(z.enum(['enrichmentData', 'pipelineStatus']))
|
|
98
|
+
.optional()
|
|
99
|
+
.describe('Exclude large JSONB columns from the response to reduce query size')
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
export const DeleteCompanyInputSchema = z.object({
|
|
103
|
+
id: z.string().uuid()
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
export const CompanyOutputSchema = z.object({
|
|
107
|
+
id: z.string().uuid(),
|
|
108
|
+
organizationId: z.string().uuid(),
|
|
109
|
+
name: z.string(),
|
|
110
|
+
domain: z.string().nullable(),
|
|
111
|
+
linkedinUrl: z.string().nullable(),
|
|
112
|
+
website: z.string().nullable(),
|
|
113
|
+
numEmployees: z.number().nullable(),
|
|
114
|
+
foundedYear: z.number().nullable(),
|
|
115
|
+
locationCity: z.string().nullable(),
|
|
116
|
+
locationState: z.string().nullable(),
|
|
117
|
+
category: z.string().nullable(),
|
|
118
|
+
segment: z.string().nullable(),
|
|
119
|
+
pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
|
|
120
|
+
enrichmentData: z.record(z.string(), z.unknown()).nullable(),
|
|
121
|
+
source: z.string().nullable(),
|
|
122
|
+
batchId: z.string().nullable().optional(),
|
|
123
|
+
status: z.enum(['active', 'invalid']),
|
|
124
|
+
createdAt: z.string(),
|
|
125
|
+
updatedAt: z.string()
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
export const CompanyArrayOutputSchema = z.array(CompanyOutputSchema)
|
|
129
|
+
|
|
130
|
+
// ============================================
|
|
131
|
+
// CONTACT SCHEMAS
|
|
132
|
+
// ============================================
|
|
133
|
+
|
|
134
|
+
export const CreateContactInputSchema = z.object({
|
|
135
|
+
email: z.string().email(),
|
|
136
|
+
companyId: z.string().uuid().optional(),
|
|
137
|
+
firstName: z.string().optional(),
|
|
138
|
+
lastName: z.string().optional(),
|
|
139
|
+
linkedinUrl: z.string().url().optional(),
|
|
140
|
+
title: z.string().optional(),
|
|
141
|
+
source: z.string().optional(),
|
|
142
|
+
sourceId: z.string().optional(),
|
|
143
|
+
batchId: z.string().optional()
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
export const UpdateContactInputSchema = z.object({
|
|
147
|
+
id: z.string().uuid(),
|
|
148
|
+
companyId: z.string().uuid().optional(),
|
|
149
|
+
emailValid: z.enum(['VALID', 'INVALID', 'RISKY', 'UNKNOWN']).optional(),
|
|
150
|
+
firstName: z.string().optional(),
|
|
151
|
+
lastName: z.string().optional(),
|
|
152
|
+
linkedinUrl: z.string().url().optional(),
|
|
153
|
+
title: z.string().optional(),
|
|
154
|
+
headline: z.string().optional(),
|
|
155
|
+
filterReason: z.string().optional(),
|
|
156
|
+
openingLine: z.string().optional(),
|
|
157
|
+
pipelineStatus: z.record(z.string(), z.unknown()).optional(),
|
|
158
|
+
enrichmentData: z.record(z.string(), z.unknown()).optional(),
|
|
159
|
+
status: z.enum(['active', 'invalid']).optional()
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
export const UpsertContactInputSchema = CreateContactInputSchema
|
|
163
|
+
|
|
164
|
+
export const GetContactInputSchema = z.object({
|
|
165
|
+
id: z.string().uuid()
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
export const ListContactsInputSchema = z.object({
|
|
169
|
+
openingLineIsNull: z.boolean().optional(), // Filter to contacts without personalization
|
|
170
|
+
batchId: z.string().optional(),
|
|
171
|
+
contactStatus: z.enum(['active', 'invalid']).optional().describe('Filter by contact status (soft-delete flag)'),
|
|
172
|
+
limit: z.number().int().min(1).max(1000).default(100),
|
|
173
|
+
offset: z.number().int().min(0).default(0)
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
export const DeleteContactInputSchema = z.object({
|
|
177
|
+
id: z.string().uuid()
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
export const DeactivateContactsByCompanyInputSchema = z.object({
|
|
181
|
+
companyId: z.string().uuid()
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
export const DeactivateContactsByCompanyResultSchema = z.object({
|
|
185
|
+
deactivated: z.number()
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
export const BulkImportInputSchema = z.object({
|
|
189
|
+
contacts: z.array(CreateContactInputSchema)
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
export const ContactOutputSchema = z.object({
|
|
193
|
+
id: z.string().uuid(),
|
|
194
|
+
organizationId: z.string().uuid(),
|
|
195
|
+
companyId: z.string().uuid().nullable(),
|
|
196
|
+
email: z.string(),
|
|
197
|
+
emailValid: z.enum(['VALID', 'INVALID', 'RISKY', 'UNKNOWN']).nullable(),
|
|
198
|
+
firstName: z.string().nullable(),
|
|
199
|
+
lastName: z.string().nullable(),
|
|
200
|
+
linkedinUrl: z.string().nullable(),
|
|
201
|
+
title: z.string().nullable(),
|
|
202
|
+
headline: z.string().nullable(),
|
|
203
|
+
filterReason: z.string().nullable(),
|
|
204
|
+
openingLine: z.string().nullable(),
|
|
205
|
+
source: z.string().nullable(),
|
|
206
|
+
sourceId: z.string().nullable(),
|
|
207
|
+
pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
|
|
208
|
+
enrichmentData: z.record(z.string(), z.unknown()).nullable(),
|
|
209
|
+
batchId: z.string().nullable().optional(),
|
|
210
|
+
status: z.enum(['active', 'invalid']),
|
|
211
|
+
createdAt: z.string(),
|
|
212
|
+
updatedAt: z.string()
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
export const PaginatedContactsOutputSchema = z.object({
|
|
216
|
+
data: z.array(ContactOutputSchema),
|
|
217
|
+
total: z.number(),
|
|
218
|
+
limit: z.number(),
|
|
219
|
+
offset: z.number()
|
|
220
|
+
})
|
|
221
|
+
|
|
222
|
+
export const BulkImportResultSchema = z.object({
|
|
223
|
+
created: z.number(),
|
|
224
|
+
updated: z.number(),
|
|
225
|
+
errors: z.array(
|
|
226
|
+
z.object({
|
|
227
|
+
email: z.string(),
|
|
228
|
+
error: z.string()
|
|
229
|
+
})
|
|
230
|
+
)
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
export const DeleteResultSchema = z.object({
|
|
234
|
+
success: z.boolean()
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
// ============================================
|
|
238
|
+
// INFERRED TYPES
|
|
239
|
+
// ============================================
|
|
240
|
+
|
|
241
|
+
export type CreateListInput = z.infer<typeof CreateListInputSchema>
|
|
242
|
+
export type UpdateListInput = z.infer<typeof UpdateListInputSchema>
|
|
243
|
+
export type DeleteListInput = z.infer<typeof DeleteListInputSchema>
|
|
244
|
+
export type ListOutput = z.infer<typeof ListOutputSchema>
|
|
245
|
+
|
|
246
|
+
export type CreateCompanyInput = z.infer<typeof CreateCompanyInputSchema>
|
|
247
|
+
export type UpdateCompanyInput = z.infer<typeof UpdateCompanyInputSchema>
|
|
248
|
+
export type UpsertCompanyInput = z.infer<typeof UpsertCompanyInputSchema>
|
|
249
|
+
export type GetCompanyInput = z.infer<typeof GetCompanyInputSchema>
|
|
250
|
+
export type ListCompaniesInput = z.infer<typeof ListCompaniesInputSchema>
|
|
251
|
+
export type DeleteCompanyInput = z.infer<typeof DeleteCompanyInputSchema>
|
|
252
|
+
export type CompanyOutput = z.infer<typeof CompanyOutputSchema>
|
|
253
|
+
|
|
254
|
+
export type CreateContactInput = z.infer<typeof CreateContactInputSchema>
|
|
255
|
+
export type UpdateContactInput = z.infer<typeof UpdateContactInputSchema>
|
|
256
|
+
export type UpsertContactInput = z.infer<typeof UpsertContactInputSchema>
|
|
257
|
+
export type GetContactInput = z.infer<typeof GetContactInputSchema>
|
|
258
|
+
export type ListContactsInput = z.infer<typeof ListContactsInputSchema>
|
|
259
|
+
export type DeleteContactInput = z.infer<typeof DeleteContactInputSchema>
|
|
260
|
+
export type BulkImportInput = z.infer<typeof BulkImportInputSchema>
|
|
261
|
+
export type ContactOutput = z.infer<typeof ContactOutputSchema>
|
|
262
|
+
export type PaginatedContactsOutput = z.infer<typeof PaginatedContactsOutputSchema>
|
|
263
|
+
export type BulkImportResult = z.infer<typeof BulkImportResultSchema>
|
|
264
|
+
export type DeleteResult = z.infer<typeof DeleteResultSchema>
|
|
265
|
+
export type DeactivateContactsByCompanyInput = z.infer<typeof DeactivateContactsByCompanyInputSchema>
|
|
266
|
+
export type DeactivateContactsByCompanyResult = z.infer<typeof DeactivateContactsByCompanyResultSchema>
|
|
@@ -22,7 +22,7 @@ import type {
|
|
|
22
22
|
TaskRow,
|
|
23
23
|
NoteRow
|
|
24
24
|
} from '../../../business/projects'
|
|
25
|
-
import type { DealListItem, DealDetail,
|
|
25
|
+
import type { DealListItem, DealDetail, ListDealsQuery } from '../../../business/acquisition'
|
|
26
26
|
import type { RecentActivityEntry } from '../../../business/sales/api-schemas'
|
|
27
27
|
import type { Database } from '../../../supabase/database.types'
|
|
28
28
|
|
|
@@ -142,7 +142,6 @@ export interface ICrmService {
|
|
|
142
142
|
listDeals(organizationId: string, filters?: Partial<ListDealsQuery>): Promise<DealListItem[]>
|
|
143
143
|
getDeal(dealId: string, organizationId: string): Promise<DealDetail | null>
|
|
144
144
|
getDealByEmail(email: string, organizationId: string): Promise<DealDetail | null>
|
|
145
|
-
updateDealStage(dealId: string, organizationId: string, stage: DealStage): Promise<void>
|
|
146
145
|
createDealNote(
|
|
147
146
|
params: import('./lead-service-types').CreateDealNoteParams
|
|
148
147
|
): Promise<import('./lead-service-types').AcqDealNote>
|
|
@@ -560,7 +559,7 @@ export {
|
|
|
560
559
|
type MarkProposalReviewedParams,
|
|
561
560
|
type UpdateCloseLostReasonParams,
|
|
562
561
|
type UpdateFeesParams,
|
|
563
|
-
type
|
|
562
|
+
type TransitionItemParams,
|
|
564
563
|
type SetContactNurtureParams,
|
|
565
564
|
type CancelSchedulesAndHitlByEmailParams,
|
|
566
565
|
type CancelHitlByDealIdParams,
|
|
@@ -595,7 +594,9 @@ export {
|
|
|
595
594
|
type RemoveCompaniesFromListParams,
|
|
596
595
|
type RemoveCompaniesFromListResult,
|
|
597
596
|
type RecordListExecutionParams,
|
|
598
|
-
type ListExecutionSummary
|
|
597
|
+
type ListExecutionSummary,
|
|
598
|
+
type TransitionDealParams,
|
|
599
|
+
type LoadDealParams
|
|
599
600
|
} from './lead-service-types'
|
|
600
601
|
|
|
601
602
|
/**
|