@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.
Files changed (50) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +9 -2
  3. package/dist/organization-model/index.d.ts +1 -1
  4. package/dist/organization-model/index.js +9 -2
  5. package/dist/test-utils/index.d.ts +480 -389
  6. package/dist/test-utils/index.js +28 -2
  7. package/package.json +1 -1
  8. package/src/_gen/__tests__/__snapshots__/contracts.md.snap +2324 -0
  9. package/src/auth/multi-tenancy/credentials/__tests__/encryption.test.ts +217 -216
  10. package/src/auth/multi-tenancy/credentials/server/encryption.ts +5 -19
  11. package/src/auth/multi-tenancy/credentials/server/kek-loader.ts +3 -13
  12. package/src/auth/multi-tenancy/permissions.ts +12 -5
  13. package/src/business/acquisition/activity-events.test.ts +250 -0
  14. package/src/business/acquisition/activity-events.ts +84 -0
  15. package/src/business/acquisition/api-schemas.test.ts +1180 -0
  16. package/src/business/acquisition/api-schemas.ts +456 -235
  17. package/src/business/acquisition/crm-state-actions.test.ts +160 -0
  18. package/src/business/acquisition/derive-actions.test.ts +518 -0
  19. package/src/business/acquisition/derive-actions.ts +103 -0
  20. package/src/business/acquisition/index.ts +51 -11
  21. package/src/business/acquisition/stateful.ts +30 -0
  22. package/src/business/acquisition/types.ts +44 -77
  23. package/src/execution/engine/index.ts +4 -1
  24. package/src/execution/engine/tools/integration/server/adapters/apify/__tests__/apify-run-actor.integration.test.ts +1 -2
  25. package/src/execution/engine/tools/integration/server/adapters/attio/__tests__/attio-crud.integration.test.ts +363 -361
  26. package/src/execution/engine/tools/integration/server/adapters/attio/fetch/get-record/index.test.ts +162 -186
  27. package/src/execution/engine/tools/integration/server/adapters/attio/fetch/list-records/index.test.ts +316 -338
  28. package/src/execution/engine/tools/integration/server/adapters/gmail/gmail-adapter.ts +204 -210
  29. package/src/execution/engine/tools/integration/server/adapters/resend/fetch/send-email/index.test.ts +88 -0
  30. package/src/execution/engine/tools/integration/server/adapters/resend/fetch/send-email/index.ts +141 -134
  31. package/src/execution/engine/tools/integration/server/adapters/resend/fetch/utils/types.ts +76 -75
  32. package/src/execution/engine/tools/integration/service.test.ts +34 -9
  33. package/src/execution/engine/tools/integration/service.ts +6 -3
  34. package/src/execution/engine/tools/lead-service-types.ts +90 -30
  35. package/src/execution/engine/tools/platform/acquisition/types.ts +266 -260
  36. package/src/execution/engine/tools/registry.ts +5 -4
  37. package/src/execution/engine/tools/tool-maps.ts +43 -21
  38. package/src/execution/engine/workflow/types.ts +11 -0
  39. package/src/organization-model/contracts.ts +4 -4
  40. package/src/organization-model/domains/navigation.ts +62 -62
  41. package/src/organization-model/domains/sales.ts +272 -0
  42. package/src/organization-model/organization-graph.mdx +2 -2
  43. package/src/organization-model/published.ts +21 -21
  44. package/src/organization-model/resolve.ts +21 -8
  45. package/src/platform/constants/versions.ts +1 -1
  46. package/src/reference/_generated/contracts.md +2324 -0
  47. package/src/scaffold-registry/index.ts +10 -9
  48. package/src/scaffold-registry/schema.ts +68 -62
  49. package/src/supabase/database.types.ts +2958 -2884
  50. 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
- export const UpsertCompanyInputSchema = CreateCompanyInputSchema.extend({
68
- domain: z.string().min(1) // Domain required for upsert (unique key)
69
- })
70
-
71
- export const GetCompanyInputSchema = z.object({
72
- id: z.string().uuid()
73
- })
74
-
75
- export const ListCompaniesInputSchema = z.object({
76
- segment: z.string().optional(),
77
- category: z.string().optional(),
78
- domain: z.string().optional().describe('Exact domain match filter'),
79
- website: z.string().optional().describe('Exact website match filter'),
80
- pipelineStatus: z.record(z.string(), z.unknown()).optional().describe('JSONB containment filter for pipeline_status'),
81
- batchId: z.string().optional(),
82
- status: z
83
- .enum(['active', 'invalid'])
84
- .optional()
85
- .describe('Filter by company status. Defaults to active if not set and includeAll is false'),
86
- includeAll: z
87
- .boolean()
88
- .optional()
89
- .describe('Bypass default active-only filter to return all companies regardless of status'),
90
- excludeColumns: z
91
- .array(z.enum(['enrichmentData', 'pipelineStatus']))
92
- .optional()
93
- .describe('Exclude large JSONB columns from the response to reduce query size')
94
- })
95
-
96
- export const DeleteCompanyInputSchema = z.object({
97
- id: z.string().uuid()
98
- })
99
-
100
- export const CompanyOutputSchema = z.object({
101
- id: z.string().uuid(),
102
- organizationId: z.string().uuid(),
103
- name: z.string(),
104
- domain: z.string().nullable(),
105
- linkedinUrl: z.string().nullable(),
106
- website: z.string().nullable(),
107
- numEmployees: z.number().nullable(),
108
- foundedYear: z.number().nullable(),
109
- locationCity: z.string().nullable(),
110
- locationState: z.string().nullable(),
111
- category: z.string().nullable(),
112
- segment: z.string().nullable(),
113
- pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
114
- enrichmentData: z.record(z.string(), z.unknown()).nullable(),
115
- source: z.string().nullable(),
116
- batchId: z.string().nullable().optional(),
117
- status: z.enum(['active', 'invalid']),
118
- createdAt: z.string(),
119
- updatedAt: z.string()
120
- })
121
-
122
- export const CompanyArrayOutputSchema = z.array(CompanyOutputSchema)
123
-
124
- // ============================================
125
- // CONTACT SCHEMAS
126
- // ============================================
127
-
128
- export const CreateContactInputSchema = z.object({
129
- email: z.string().email(),
130
- companyId: z.string().uuid().optional(),
131
- firstName: z.string().optional(),
132
- lastName: z.string().optional(),
133
- linkedinUrl: z.string().url().optional(),
134
- title: z.string().optional(),
135
- source: z.string().optional(),
136
- sourceId: z.string().optional(),
137
- batchId: z.string().optional()
138
- })
139
-
140
- export const UpdateContactInputSchema = z.object({
141
- id: z.string().uuid(),
142
- companyId: z.string().uuid().optional(),
143
- emailValid: z.enum(['VALID', 'INVALID', 'RISKY', 'UNKNOWN']).optional(),
144
- firstName: z.string().optional(),
145
- lastName: z.string().optional(),
146
- linkedinUrl: z.string().url().optional(),
147
- title: z.string().optional(),
148
- headline: z.string().optional(),
149
- filterReason: z.string().optional(),
150
- openingLine: z.string().optional(),
151
- pipelineStatus: z.record(z.string(), z.unknown()).optional(),
152
- enrichmentData: z.record(z.string(), z.unknown()).optional(),
153
- status: z.enum(['active', 'invalid']).optional()
154
- })
155
-
156
- export const UpsertContactInputSchema = CreateContactInputSchema
157
-
158
- export const GetContactInputSchema = z.object({
159
- id: z.string().uuid()
160
- })
161
-
162
- export const ListContactsInputSchema = z.object({
163
- openingLineIsNull: z.boolean().optional(), // Filter to contacts without personalization
164
- batchId: z.string().optional(),
165
- contactStatus: z.enum(['active', 'invalid']).optional().describe('Filter by contact status (soft-delete flag)'),
166
- limit: z.number().int().min(1).max(1000).default(100),
167
- offset: z.number().int().min(0).default(0)
168
- })
169
-
170
- export const DeleteContactInputSchema = z.object({
171
- id: z.string().uuid()
172
- })
173
-
174
- export const DeactivateContactsByCompanyInputSchema = z.object({
175
- companyId: z.string().uuid()
176
- })
177
-
178
- export const DeactivateContactsByCompanyResultSchema = z.object({
179
- deactivated: z.number()
180
- })
181
-
182
- export const BulkImportInputSchema = z.object({
183
- contacts: z.array(CreateContactInputSchema)
184
- })
185
-
186
- export const ContactOutputSchema = z.object({
187
- id: z.string().uuid(),
188
- organizationId: z.string().uuid(),
189
- companyId: z.string().uuid().nullable(),
190
- email: z.string(),
191
- emailValid: z.enum(['VALID', 'INVALID', 'RISKY', 'UNKNOWN']).nullable(),
192
- firstName: z.string().nullable(),
193
- lastName: z.string().nullable(),
194
- linkedinUrl: z.string().nullable(),
195
- title: z.string().nullable(),
196
- headline: z.string().nullable(),
197
- filterReason: z.string().nullable(),
198
- openingLine: z.string().nullable(),
199
- source: z.string().nullable(),
200
- sourceId: z.string().nullable(),
201
- pipelineStatus: z.record(z.string(), z.unknown()).nullable(),
202
- enrichmentData: z.record(z.string(), z.unknown()).nullable(),
203
- batchId: z.string().nullable().optional(),
204
- status: z.enum(['active', 'invalid']),
205
- createdAt: z.string(),
206
- updatedAt: z.string()
207
- })
208
-
209
- export const PaginatedContactsOutputSchema = z.object({
210
- data: z.array(ContactOutputSchema),
211
- total: z.number(),
212
- limit: z.number(),
213
- offset: z.number()
214
- })
215
-
216
- export const BulkImportResultSchema = z.object({
217
- created: z.number(),
218
- updated: z.number(),
219
- errors: z.array(
220
- z.object({
221
- email: z.string(),
222
- error: z.string()
223
- })
224
- )
225
- })
226
-
227
- export const DeleteResultSchema = z.object({
228
- success: z.boolean()
229
- })
230
-
231
- // ============================================
232
- // INFERRED TYPES
233
- // ============================================
234
-
235
- export type CreateListInput = z.infer<typeof CreateListInputSchema>
236
- export type UpdateListInput = z.infer<typeof UpdateListInputSchema>
237
- export type DeleteListInput = z.infer<typeof DeleteListInputSchema>
238
- export type ListOutput = z.infer<typeof ListOutputSchema>
239
-
240
- export type CreateCompanyInput = z.infer<typeof CreateCompanyInputSchema>
241
- export type UpdateCompanyInput = z.infer<typeof UpdateCompanyInputSchema>
242
- export type UpsertCompanyInput = z.infer<typeof UpsertCompanyInputSchema>
243
- export type GetCompanyInput = z.infer<typeof GetCompanyInputSchema>
244
- export type ListCompaniesInput = z.infer<typeof ListCompaniesInputSchema>
245
- export type DeleteCompanyInput = z.infer<typeof DeleteCompanyInputSchema>
246
- export type CompanyOutput = z.infer<typeof CompanyOutputSchema>
247
-
248
- export type CreateContactInput = z.infer<typeof CreateContactInputSchema>
249
- export type UpdateContactInput = z.infer<typeof UpdateContactInputSchema>
250
- export type UpsertContactInput = z.infer<typeof UpsertContactInputSchema>
251
- export type GetContactInput = z.infer<typeof GetContactInputSchema>
252
- export type ListContactsInput = z.infer<typeof ListContactsInputSchema>
253
- export type DeleteContactInput = z.infer<typeof DeleteContactInputSchema>
254
- export type BulkImportInput = z.infer<typeof BulkImportInputSchema>
255
- export type ContactOutput = z.infer<typeof ContactOutputSchema>
256
- export type PaginatedContactsOutput = z.infer<typeof PaginatedContactsOutputSchema>
257
- export type BulkImportResult = z.infer<typeof BulkImportResultSchema>
258
- export type DeleteResult = z.infer<typeof DeleteResultSchema>
259
- export type DeactivateContactsByCompanyInput = z.infer<typeof DeactivateContactsByCompanyInputSchema>
260
- export type DeactivateContactsByCompanyResult = z.infer<typeof DeactivateContactsByCompanyResultSchema>
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, DealStage, ListDealsQuery } from '../../../business/acquisition'
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 SyncDealStageParams,
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
  /**