@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,577 +1,574 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool Method Maps
|
|
3
|
-
*
|
|
4
|
-
* Single source of truth for tool -> method -> params -> result type mappings.
|
|
5
|
-
* Used by SDK adapters (compile-time typed wrappers) and optionally by the
|
|
6
|
-
* server-side dispatcher for type checking.
|
|
7
|
-
*
|
|
8
|
-
* Browser-safe: no Node.js imports, pure type definitions.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {
|
|
12
|
-
CreateRecordParams,
|
|
13
|
-
CreateRecordResult,
|
|
14
|
-
UpdateRecordParams,
|
|
15
|
-
UpdateRecordResult,
|
|
16
|
-
QueryRecordsParams,
|
|
17
|
-
QueryRecordsResult,
|
|
18
|
-
GetRecordParams,
|
|
19
|
-
GetRecordResult,
|
|
20
|
-
DeleteRecordParams,
|
|
21
|
-
DeleteRecordResult,
|
|
22
|
-
ListObjectsResult,
|
|
23
|
-
ListAttributesParams,
|
|
24
|
-
ListAttributesResult,
|
|
25
|
-
CreateAttributeParams,
|
|
26
|
-
CreateAttributeResult,
|
|
27
|
-
UpdateAttributeParams,
|
|
28
|
-
UpdateAttributeResult,
|
|
29
|
-
CreateNoteParams,
|
|
30
|
-
CreateNoteResult,
|
|
31
|
-
ListNotesParams,
|
|
32
|
-
ListNotesResult,
|
|
33
|
-
DeleteNoteParams,
|
|
34
|
-
DeleteNoteResult
|
|
35
|
-
} from './integration/types/attio'
|
|
36
|
-
|
|
37
|
-
import type {
|
|
38
|
-
RunActorParams,
|
|
39
|
-
RunActorResult,
|
|
40
|
-
GetDatasetItemsParams,
|
|
41
|
-
GetDatasetItemsResult,
|
|
42
|
-
StartActorParams,
|
|
43
|
-
StartActorResult
|
|
44
|
-
} from './integration/types/apify'
|
|
45
|
-
|
|
46
|
-
import type {
|
|
47
|
-
UploadFileParams,
|
|
48
|
-
UploadFileResult,
|
|
49
|
-
CreateFolderParams,
|
|
50
|
-
CreateFolderResult
|
|
51
|
-
} from './integration/types/dropbox'
|
|
52
|
-
|
|
53
|
-
import type { GmailSendEmailParams, GmailSendEmailResult } from './integration/types/gmail'
|
|
54
|
-
|
|
55
|
-
import type {
|
|
56
|
-
ReadSheetParams,
|
|
57
|
-
ReadSheetResult,
|
|
58
|
-
WriteSheetParams,
|
|
59
|
-
WriteSheetResult,
|
|
60
|
-
AppendRowsParams,
|
|
61
|
-
AppendRowsResult,
|
|
62
|
-
ClearRangeParams,
|
|
63
|
-
ClearRangeResult,
|
|
64
|
-
GetSpreadsheetMetadataParams,
|
|
65
|
-
GetSpreadsheetMetadataResult,
|
|
66
|
-
BatchUpdateParams,
|
|
67
|
-
BatchUpdateResult,
|
|
68
|
-
GetHeadersParams,
|
|
69
|
-
GetHeadersResult,
|
|
70
|
-
GetLastRowParams,
|
|
71
|
-
GetLastRowResult,
|
|
72
|
-
GetRowByValueParams,
|
|
73
|
-
GetRowByValueResult,
|
|
74
|
-
UpdateRowByValueParams,
|
|
75
|
-
UpdateRowByValueResult,
|
|
76
|
-
UpsertRowParams,
|
|
77
|
-
UpsertRowResult,
|
|
78
|
-
FilterRowsParams,
|
|
79
|
-
FilterRowsResult,
|
|
80
|
-
DeleteRowByValueParams,
|
|
81
|
-
DeleteRowByValueResult
|
|
82
|
-
} from './integration/types/google-sheets'
|
|
83
|
-
|
|
84
|
-
import type {
|
|
85
|
-
SendReplyParams,
|
|
86
|
-
SendReplyResult,
|
|
87
|
-
RemoveFromSubsequenceParams,
|
|
88
|
-
RemoveFromSubsequenceResult,
|
|
89
|
-
GetEmailsParams,
|
|
90
|
-
GetEmailsResult,
|
|
91
|
-
UpdateInterestStatusParams,
|
|
92
|
-
UpdateInterestStatusResult,
|
|
93
|
-
AddToCampaignParams,
|
|
94
|
-
AddToCampaignResult,
|
|
95
|
-
ListCampaignsParams,
|
|
96
|
-
ListCampaignsResult,
|
|
97
|
-
GetCampaignParams,
|
|
98
|
-
GetCampaignResult,
|
|
99
|
-
UpdateCampaignParams,
|
|
100
|
-
UpdateCampaignResult,
|
|
101
|
-
PauseCampaignParams,
|
|
102
|
-
PauseCampaignResult,
|
|
103
|
-
ActivateCampaignParams,
|
|
104
|
-
ActivateCampaignResult,
|
|
105
|
-
GetCampaignAnalyticsParams,
|
|
106
|
-
GetCampaignAnalyticsResult,
|
|
107
|
-
GetStepAnalyticsParams,
|
|
108
|
-
GetStepAnalyticsResult,
|
|
109
|
-
BulkAddLeadsParams,
|
|
110
|
-
BulkAddLeadsResult,
|
|
111
|
-
GetAccountHealthParams,
|
|
112
|
-
GetAccountHealthResult,
|
|
113
|
-
CreateInboxTestParams,
|
|
114
|
-
CreateInboxTestResult,
|
|
115
|
-
CreateCampaignParams,
|
|
116
|
-
CreateCampaignResult,
|
|
117
|
-
GetDailyCampaignAnalyticsParams,
|
|
118
|
-
GetDailyCampaignAnalyticsResult,
|
|
119
|
-
ListLeadsParams,
|
|
120
|
-
ListLeadsResult,
|
|
121
|
-
BulkDeleteLeadsParams,
|
|
122
|
-
BulkDeleteLeadsResult,
|
|
123
|
-
DeleteCampaignParams,
|
|
124
|
-
DeleteCampaignResult,
|
|
125
|
-
PatchLeadParams,
|
|
126
|
-
PatchLeadResult
|
|
127
|
-
} from './integration/types/instantly'
|
|
128
|
-
|
|
129
|
-
import type {
|
|
130
|
-
MillionVerifierVerifyEmailParams,
|
|
131
|
-
MillionVerifierVerifyEmailResult,
|
|
132
|
-
MillionVerifierCheckCreditsParams,
|
|
133
|
-
MillionVerifierCheckCreditsResult
|
|
134
|
-
} from './integration/types/millionverifier'
|
|
135
|
-
|
|
136
|
-
import type {
|
|
137
|
-
FindCompanyEmailParams,
|
|
138
|
-
FindCompanyEmailResult,
|
|
139
|
-
FindPersonEmailParams,
|
|
140
|
-
FindPersonEmailResult,
|
|
141
|
-
FindDecisionMakerEmailParams,
|
|
142
|
-
FindDecisionMakerEmailResult,
|
|
143
|
-
VerifyEmailParams,
|
|
144
|
-
VerifyEmailResult
|
|
145
|
-
} from './integration/types/anymailfinder'
|
|
146
|
-
|
|
147
|
-
import type {
|
|
148
|
-
EmailFinderParams,
|
|
149
|
-
EmailFinderResult,
|
|
150
|
-
DomainSearchParams,
|
|
151
|
-
DomainSearchResult,
|
|
152
|
-
EmailVerifierParams,
|
|
153
|
-
EmailVerifierResult
|
|
154
|
-
} from './integration/types/tomba'
|
|
155
|
-
|
|
156
|
-
import type {
|
|
157
|
-
ResendSendEmailParams,
|
|
158
|
-
ResendSendEmailResult,
|
|
159
|
-
ResendGetEmailParams,
|
|
160
|
-
ResendGetEmailResult
|
|
161
|
-
} from './integration/types/resend'
|
|
162
|
-
|
|
163
|
-
import type {
|
|
164
|
-
CreateEnvelopeParams,
|
|
165
|
-
CreateEnvelopeResult,
|
|
166
|
-
VoidEnvelopeParams,
|
|
167
|
-
VoidEnvelopeResult,
|
|
168
|
-
DownloadDocumentParams,
|
|
169
|
-
DownloadDocumentResult,
|
|
170
|
-
GetEnvelopeParams,
|
|
171
|
-
GetEnvelopeResult
|
|
172
|
-
} from './integration/types/signature-api'
|
|
173
|
-
|
|
174
|
-
import type {
|
|
175
|
-
CreatePaymentLinkParams,
|
|
176
|
-
CreatePaymentLinkResult,
|
|
177
|
-
GetPaymentLinkParams,
|
|
178
|
-
GetPaymentLinkResult,
|
|
179
|
-
UpdatePaymentLinkParams,
|
|
180
|
-
UpdatePaymentLinkResult,
|
|
181
|
-
ListPaymentLinksParams,
|
|
182
|
-
ListPaymentLinksResult,
|
|
183
|
-
CreateAutoPaymentLinkParams,
|
|
184
|
-
CreateAutoPaymentLinkResult,
|
|
185
|
-
CreateCheckoutSessionParams,
|
|
186
|
-
CreateCheckoutSessionResult
|
|
187
|
-
} from './integration/types/stripe'
|
|
188
|
-
|
|
189
|
-
import type {
|
|
190
|
-
StorageUploadInput,
|
|
191
|
-
StorageUploadOutput,
|
|
192
|
-
StorageDownloadInput,
|
|
193
|
-
StorageDownloadOutput,
|
|
194
|
-
StorageSignedUrlInput,
|
|
195
|
-
StorageSignedUrlOutput,
|
|
196
|
-
StorageDeleteInput,
|
|
197
|
-
StorageDeleteOutput,
|
|
198
|
-
StorageListInput,
|
|
199
|
-
StorageListOutput
|
|
200
|
-
} from './platform/storage/types'
|
|
201
|
-
|
|
202
|
-
import type { CreateScheduleInput, TaskSchedule } from '../../scheduler/types'
|
|
203
|
-
|
|
204
|
-
import type { CreateNotificationParams } from '../../../operations/notifications/types'
|
|
205
|
-
|
|
206
|
-
import type {
|
|
207
|
-
AcqList,
|
|
208
|
-
AcqCompany,
|
|
209
|
-
AcqContact,
|
|
210
|
-
PaginatedResult,
|
|
211
|
-
CreateListParams,
|
|
212
|
-
UpdateListParams,
|
|
213
|
-
CreateCompanyParams,
|
|
214
|
-
UpdateCompanyParams,
|
|
215
|
-
UpsertCompanyParams,
|
|
216
|
-
CompanyFilters,
|
|
217
|
-
CreateContactParams,
|
|
218
|
-
UpdateContactParams,
|
|
219
|
-
UpsertContactParams,
|
|
220
|
-
ContactFilters,
|
|
221
|
-
UpsertDealParams,
|
|
222
|
-
AcqDeal,
|
|
223
|
-
AcqDealNote,
|
|
224
|
-
AcqDealTask,
|
|
225
|
-
CreateDealNoteParams,
|
|
226
|
-
ListDealNotesParams,
|
|
227
|
-
CreateDealTaskParams,
|
|
228
|
-
ListDealTasksParams,
|
|
229
|
-
ListDealTasksDueParams,
|
|
230
|
-
CompleteDealTaskParams,
|
|
231
|
-
RecordDealActivityParams,
|
|
232
|
-
AddContactsToListParams,
|
|
233
|
-
AddContactsToListResult,
|
|
234
|
-
BulkImportParams,
|
|
235
|
-
BulkImportResult,
|
|
236
|
-
BulkImportCompaniesParams,
|
|
237
|
-
BulkImportCompaniesResult,
|
|
238
|
-
UpdateDiscoveryDataParams,
|
|
239
|
-
UpdateProposalDataParams,
|
|
240
|
-
MarkProposalSentParams,
|
|
241
|
-
MarkProposalReviewedParams,
|
|
242
|
-
UpdateCloseLostReasonParams,
|
|
243
|
-
UpdateFeesParams,
|
|
244
|
-
|
|
245
|
-
SetContactNurtureParams,
|
|
246
|
-
CancelSchedulesAndHitlByEmailParams,
|
|
247
|
-
CancelHitlByDealIdParams,
|
|
248
|
-
ClearDealFieldsParams,
|
|
249
|
-
DeleteDealParams,
|
|
250
|
-
DealFilters,
|
|
251
|
-
DealPipelineAnalytics,
|
|
252
|
-
ListConfig,
|
|
253
|
-
RecordListExecutionParams,
|
|
254
|
-
UpdateCompanyStageParams,
|
|
255
|
-
UpdateContactStageParams,
|
|
256
|
-
UpsertSocialPostParams,
|
|
257
|
-
UpsertSocialPostsResult,
|
|
258
|
-
GetDealByIdParams,
|
|
259
|
-
GetContactByIdParams,
|
|
260
|
-
GetCompanyByIdParams
|
|
261
|
-
} from './lead-service-types'
|
|
262
|
-
|
|
263
|
-
import type { DealListItem, DealDetail } from '../../../business/acquisition'
|
|
264
|
-
import { CrmSchemas } from '../../../business/sales/api-schemas'
|
|
265
|
-
import type { RecentActivityEntry } from '../../../business/sales/api-schemas'
|
|
266
|
-
import { DealSchemas } from '../../../business/acquisition'
|
|
267
|
-
import { ProjectSchemas } from '../../../projects/api-schemas'
|
|
268
|
-
import type {
|
|
269
|
-
ProjectRow,
|
|
270
|
-
MilestoneRow,
|
|
271
|
-
TaskRow,
|
|
272
|
-
NoteRow,
|
|
273
|
-
ProjectWithCounts,
|
|
274
|
-
ProjectDetail
|
|
275
|
-
} from '../../../business/projects'
|
|
276
|
-
import type { z } from 'zod'
|
|
277
|
-
|
|
278
|
-
// ---------------------------------------------------------------------------
|
|
279
|
-
// Generic constraint types
|
|
280
|
-
// ---------------------------------------------------------------------------
|
|
281
|
-
|
|
282
|
-
/** A single method entry: what params go in, what result comes out */
|
|
283
|
-
export interface MethodEntry {
|
|
284
|
-
params: unknown
|
|
285
|
-
result: unknown
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
/** A tool's complete method map: method name -> MethodEntry */
|
|
289
|
-
export type ToolMethodMap = Record<string, MethodEntry>
|
|
290
|
-
|
|
291
|
-
// ---------------------------------------------------------------------------
|
|
292
|
-
// Attio (integration adapter, 12 methods)
|
|
293
|
-
// ---------------------------------------------------------------------------
|
|
294
|
-
|
|
295
|
-
export type AttioToolMap = {
|
|
296
|
-
createRecord: { params: CreateRecordParams; result: CreateRecordResult }
|
|
297
|
-
updateRecord: { params: UpdateRecordParams; result: UpdateRecordResult }
|
|
298
|
-
listRecords: { params: QueryRecordsParams; result: QueryRecordsResult }
|
|
299
|
-
getRecord: { params: GetRecordParams; result: GetRecordResult }
|
|
300
|
-
deleteRecord: { params: DeleteRecordParams; result: DeleteRecordResult }
|
|
301
|
-
listObjects: { params: Record<string, never>; result: ListObjectsResult }
|
|
302
|
-
listAttributes: { params: ListAttributesParams; result: ListAttributesResult }
|
|
303
|
-
createAttribute: { params: CreateAttributeParams; result: CreateAttributeResult }
|
|
304
|
-
updateAttribute: { params: UpdateAttributeParams; result: UpdateAttributeResult }
|
|
305
|
-
createNote: { params: CreateNoteParams; result: CreateNoteResult }
|
|
306
|
-
listNotes: { params: ListNotesParams; result: ListNotesResult }
|
|
307
|
-
deleteNote: { params: DeleteNoteParams; result: DeleteNoteResult }
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
// ---------------------------------------------------------------------------
|
|
311
|
-
// Scheduler (platform tool, 9 methods)
|
|
312
|
-
// ---------------------------------------------------------------------------
|
|
313
|
-
|
|
314
|
-
export type SchedulerToolMap = {
|
|
315
|
-
createSchedule: { params: CreateScheduleInput; result: TaskSchedule }
|
|
316
|
-
updateAnchor: { params: { scheduleId: string; anchorAt: string }; result: TaskSchedule }
|
|
317
|
-
deleteSchedule: { params: { scheduleId: string }; result: void }
|
|
318
|
-
findByIdempotencyKey: { params: { idempotencyKey: string }; result: TaskSchedule | null }
|
|
319
|
-
deleteScheduleByIdempotencyKey: { params: { idempotencyKey: string }; result: void }
|
|
320
|
-
listSchedules: { params: { status?: string; limit?: number; offset?: number }; result: TaskSchedule[] }
|
|
321
|
-
getSchedule: { params: { scheduleId: string }; result: TaskSchedule }
|
|
322
|
-
cancelSchedule: { params: { scheduleId: string }; result: void }
|
|
323
|
-
cancelSchedulesByMetadata: { params: { metadata: Record<string, unknown> }; result: { cancelledCount: number } }
|
|
324
|
-
cancelScheduleByIdempotencyKey: { params: { idempotencyKey: string }; result: { cancelled: boolean } }
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
// ---------------------------------------------------------------------------
|
|
328
|
-
// Storage (platform tool, 5 methods)
|
|
329
|
-
// ---------------------------------------------------------------------------
|
|
330
|
-
|
|
331
|
-
export type StorageToolMap = {
|
|
332
|
-
upload: { params: StorageUploadInput; result: StorageUploadOutput }
|
|
333
|
-
download: { params: StorageDownloadInput; result: StorageDownloadOutput }
|
|
334
|
-
createSignedUrl: { params: StorageSignedUrlInput; result: StorageSignedUrlOutput }
|
|
335
|
-
delete: { params: StorageDeleteInput; result: StorageDeleteOutput }
|
|
336
|
-
list: { params: StorageListInput; result: StorageListOutput }
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// ---------------------------------------------------------------------------
|
|
340
|
-
// Notification (platform tool, 1 method)
|
|
341
|
-
// ---------------------------------------------------------------------------
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* SDK-side notification input.
|
|
345
|
-
* Omits userId and organizationId which are injected server-side from execution context.
|
|
346
|
-
*/
|
|
347
|
-
export type NotificationSDKInput = Omit<CreateNotificationParams, 'userId' | 'organizationId'>
|
|
348
|
-
|
|
349
|
-
export type NotificationToolMap = {
|
|
350
|
-
create: { params: NotificationSDKInput; result: void }
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
// ---------------------------------------------------------------------------
|
|
354
|
-
// Projects (platform tool, 18 methods)
|
|
355
|
-
// ---------------------------------------------------------------------------
|
|
356
|
-
|
|
357
|
-
type ProjectsListParams = z.infer<typeof ProjectSchemas.GetProjectsQuery>
|
|
358
|
-
type ProjectCreateParams = z.infer<typeof ProjectSchemas.CreateProjectRequest>
|
|
359
|
-
type ProjectUpdateParams = z.infer<typeof ProjectSchemas.UpdateProjectRequest>
|
|
360
|
-
type MilestoneCreateParams = z.infer<typeof ProjectSchemas.ProjectIdPathParams> &
|
|
361
|
-
z.infer<typeof ProjectSchemas.CreateMilestoneRequest>
|
|
362
|
-
type MilestoneUpdateParams = z.infer<typeof ProjectSchemas.UpdateMilestoneRequest>
|
|
363
|
-
type TaskListParams = z.infer<typeof ProjectSchemas.ProjectIdPathParams> & z.infer<typeof ProjectSchemas.GetTasksQuery>
|
|
364
|
-
type TaskCreateParams = z.infer<typeof ProjectSchemas.CreateTaskRequest>
|
|
365
|
-
type TaskUpdateParams = z.infer<typeof ProjectSchemas.UpdateTaskRequest>
|
|
366
|
-
type TaskResumeContextParams = z.infer<typeof ProjectSchemas.TaskIdParams> &
|
|
367
|
-
z.infer<typeof ProjectSchemas.MergeResumeContextRequest>
|
|
368
|
-
type NoteListParams = z.infer<typeof ProjectSchemas.ProjectIdPathParams>
|
|
369
|
-
type NoteCreateParams = z.infer<typeof ProjectSchemas.CreateNoteRequest>
|
|
370
|
-
type NoteUpdateParams = z.infer<typeof ProjectSchemas.UpdateNoteRequest>
|
|
371
|
-
type TaskResumeContextResult = Pick<TaskRow, 'id' | 'resume_context' | 'updated_at'>
|
|
372
|
-
|
|
373
|
-
export type ProjectsToolMap = {
|
|
374
|
-
listProjects: { params: ProjectsListParams; result: ProjectWithCounts[] }
|
|
375
|
-
getProject: { params: z.infer<typeof ProjectSchemas.ProjectIdParams>; result: ProjectDetail }
|
|
376
|
-
createProject: { params: ProjectCreateParams; result: ProjectRow }
|
|
377
|
-
updateProject: { params: z.infer<typeof ProjectSchemas.ProjectIdParams> & ProjectUpdateParams; result: ProjectRow }
|
|
378
|
-
deleteProject: { params: z.infer<typeof ProjectSchemas.ProjectIdParams>; result: void }
|
|
379
|
-
listMilestones: { params: z.infer<typeof ProjectSchemas.ProjectIdPathParams>; result: MilestoneRow[] }
|
|
380
|
-
createMilestone: { params: MilestoneCreateParams; result: MilestoneRow }
|
|
381
|
-
updateMilestone: {
|
|
382
|
-
params: z.infer<typeof ProjectSchemas.MilestoneIdParams> & MilestoneUpdateParams
|
|
383
|
-
result: MilestoneRow
|
|
384
|
-
}
|
|
385
|
-
deleteMilestone: { params: z.infer<typeof ProjectSchemas.MilestoneIdParams>; result: void }
|
|
386
|
-
listTasks: { params: TaskListParams; result: TaskRow[] }
|
|
387
|
-
getTask: { params: z.infer<typeof ProjectSchemas.TaskIdParams>; result: TaskRow }
|
|
388
|
-
createTask: { params: TaskCreateParams; result: TaskRow }
|
|
389
|
-
updateTask: { params: z.infer<typeof ProjectSchemas.TaskIdParams> & TaskUpdateParams; result: TaskRow }
|
|
390
|
-
deleteTask: { params: z.infer<typeof ProjectSchemas.TaskIdParams>; result: void }
|
|
391
|
-
mergeTaskResumeContext: { params: TaskResumeContextParams; result: TaskResumeContextResult }
|
|
392
|
-
listNotes: { params: NoteListParams; result: NoteRow[] }
|
|
393
|
-
createNote: { params: NoteCreateParams; result: NoteRow }
|
|
394
|
-
updateNote: { params: z.infer<typeof ProjectSchemas.NoteIdParams> & NoteUpdateParams; result: NoteRow }
|
|
395
|
-
deleteNote: { params: z.infer<typeof ProjectSchemas.NoteIdParams>; result: void }
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
// ---------------------------------------------------------------------------
|
|
399
|
-
// CRM (platform tool, 13 methods)
|
|
400
|
-
// ---------------------------------------------------------------------------
|
|
401
|
-
|
|
402
|
-
type CrmRecentActivityParams = Partial<z.infer<typeof CrmSchemas.GetRecentActivityQuery>>
|
|
403
|
-
type CrmListDealsParams = Partial<z.infer<typeof DealSchemas.ListDealsQuery>>
|
|
404
|
-
type CrmGetDealParams = z.infer<typeof DealSchemas.DealIdParams>
|
|
405
|
-
type
|
|
406
|
-
|
|
407
|
-
type
|
|
408
|
-
type
|
|
409
|
-
type
|
|
410
|
-
type
|
|
411
|
-
|
|
412
|
-
type
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
//
|
|
571
|
-
|
|
572
|
-
export type LeadToolMap = {
|
|
573
|
-
// List operations
|
|
574
|
-
listLists: { params: Record<string, never>; result: AcqList[] }
|
|
1
|
+
/**
|
|
2
|
+
* Tool Method Maps
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for tool -> method -> params -> result type mappings.
|
|
5
|
+
* Used by SDK adapters (compile-time typed wrappers) and optionally by the
|
|
6
|
+
* server-side dispatcher for type checking.
|
|
7
|
+
*
|
|
8
|
+
* Browser-safe: no Node.js imports, pure type definitions.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type {
|
|
12
|
+
CreateRecordParams,
|
|
13
|
+
CreateRecordResult,
|
|
14
|
+
UpdateRecordParams,
|
|
15
|
+
UpdateRecordResult,
|
|
16
|
+
QueryRecordsParams,
|
|
17
|
+
QueryRecordsResult,
|
|
18
|
+
GetRecordParams,
|
|
19
|
+
GetRecordResult,
|
|
20
|
+
DeleteRecordParams,
|
|
21
|
+
DeleteRecordResult,
|
|
22
|
+
ListObjectsResult,
|
|
23
|
+
ListAttributesParams,
|
|
24
|
+
ListAttributesResult,
|
|
25
|
+
CreateAttributeParams,
|
|
26
|
+
CreateAttributeResult,
|
|
27
|
+
UpdateAttributeParams,
|
|
28
|
+
UpdateAttributeResult,
|
|
29
|
+
CreateNoteParams,
|
|
30
|
+
CreateNoteResult,
|
|
31
|
+
ListNotesParams,
|
|
32
|
+
ListNotesResult,
|
|
33
|
+
DeleteNoteParams,
|
|
34
|
+
DeleteNoteResult
|
|
35
|
+
} from './integration/types/attio'
|
|
36
|
+
|
|
37
|
+
import type {
|
|
38
|
+
RunActorParams,
|
|
39
|
+
RunActorResult,
|
|
40
|
+
GetDatasetItemsParams,
|
|
41
|
+
GetDatasetItemsResult,
|
|
42
|
+
StartActorParams,
|
|
43
|
+
StartActorResult
|
|
44
|
+
} from './integration/types/apify'
|
|
45
|
+
|
|
46
|
+
import type {
|
|
47
|
+
UploadFileParams,
|
|
48
|
+
UploadFileResult,
|
|
49
|
+
CreateFolderParams,
|
|
50
|
+
CreateFolderResult
|
|
51
|
+
} from './integration/types/dropbox'
|
|
52
|
+
|
|
53
|
+
import type { GmailSendEmailParams, GmailSendEmailResult } from './integration/types/gmail'
|
|
54
|
+
|
|
55
|
+
import type {
|
|
56
|
+
ReadSheetParams,
|
|
57
|
+
ReadSheetResult,
|
|
58
|
+
WriteSheetParams,
|
|
59
|
+
WriteSheetResult,
|
|
60
|
+
AppendRowsParams,
|
|
61
|
+
AppendRowsResult,
|
|
62
|
+
ClearRangeParams,
|
|
63
|
+
ClearRangeResult,
|
|
64
|
+
GetSpreadsheetMetadataParams,
|
|
65
|
+
GetSpreadsheetMetadataResult,
|
|
66
|
+
BatchUpdateParams,
|
|
67
|
+
BatchUpdateResult,
|
|
68
|
+
GetHeadersParams,
|
|
69
|
+
GetHeadersResult,
|
|
70
|
+
GetLastRowParams,
|
|
71
|
+
GetLastRowResult,
|
|
72
|
+
GetRowByValueParams,
|
|
73
|
+
GetRowByValueResult,
|
|
74
|
+
UpdateRowByValueParams,
|
|
75
|
+
UpdateRowByValueResult,
|
|
76
|
+
UpsertRowParams,
|
|
77
|
+
UpsertRowResult,
|
|
78
|
+
FilterRowsParams,
|
|
79
|
+
FilterRowsResult,
|
|
80
|
+
DeleteRowByValueParams,
|
|
81
|
+
DeleteRowByValueResult
|
|
82
|
+
} from './integration/types/google-sheets'
|
|
83
|
+
|
|
84
|
+
import type {
|
|
85
|
+
SendReplyParams,
|
|
86
|
+
SendReplyResult,
|
|
87
|
+
RemoveFromSubsequenceParams,
|
|
88
|
+
RemoveFromSubsequenceResult,
|
|
89
|
+
GetEmailsParams,
|
|
90
|
+
GetEmailsResult,
|
|
91
|
+
UpdateInterestStatusParams,
|
|
92
|
+
UpdateInterestStatusResult,
|
|
93
|
+
AddToCampaignParams,
|
|
94
|
+
AddToCampaignResult,
|
|
95
|
+
ListCampaignsParams,
|
|
96
|
+
ListCampaignsResult,
|
|
97
|
+
GetCampaignParams,
|
|
98
|
+
GetCampaignResult,
|
|
99
|
+
UpdateCampaignParams,
|
|
100
|
+
UpdateCampaignResult,
|
|
101
|
+
PauseCampaignParams,
|
|
102
|
+
PauseCampaignResult,
|
|
103
|
+
ActivateCampaignParams,
|
|
104
|
+
ActivateCampaignResult,
|
|
105
|
+
GetCampaignAnalyticsParams,
|
|
106
|
+
GetCampaignAnalyticsResult,
|
|
107
|
+
GetStepAnalyticsParams,
|
|
108
|
+
GetStepAnalyticsResult,
|
|
109
|
+
BulkAddLeadsParams,
|
|
110
|
+
BulkAddLeadsResult,
|
|
111
|
+
GetAccountHealthParams,
|
|
112
|
+
GetAccountHealthResult,
|
|
113
|
+
CreateInboxTestParams,
|
|
114
|
+
CreateInboxTestResult,
|
|
115
|
+
CreateCampaignParams,
|
|
116
|
+
CreateCampaignResult,
|
|
117
|
+
GetDailyCampaignAnalyticsParams,
|
|
118
|
+
GetDailyCampaignAnalyticsResult,
|
|
119
|
+
ListLeadsParams,
|
|
120
|
+
ListLeadsResult,
|
|
121
|
+
BulkDeleteLeadsParams,
|
|
122
|
+
BulkDeleteLeadsResult,
|
|
123
|
+
DeleteCampaignParams,
|
|
124
|
+
DeleteCampaignResult,
|
|
125
|
+
PatchLeadParams,
|
|
126
|
+
PatchLeadResult
|
|
127
|
+
} from './integration/types/instantly'
|
|
128
|
+
|
|
129
|
+
import type {
|
|
130
|
+
MillionVerifierVerifyEmailParams,
|
|
131
|
+
MillionVerifierVerifyEmailResult,
|
|
132
|
+
MillionVerifierCheckCreditsParams,
|
|
133
|
+
MillionVerifierCheckCreditsResult
|
|
134
|
+
} from './integration/types/millionverifier'
|
|
135
|
+
|
|
136
|
+
import type {
|
|
137
|
+
FindCompanyEmailParams,
|
|
138
|
+
FindCompanyEmailResult,
|
|
139
|
+
FindPersonEmailParams,
|
|
140
|
+
FindPersonEmailResult,
|
|
141
|
+
FindDecisionMakerEmailParams,
|
|
142
|
+
FindDecisionMakerEmailResult,
|
|
143
|
+
VerifyEmailParams,
|
|
144
|
+
VerifyEmailResult
|
|
145
|
+
} from './integration/types/anymailfinder'
|
|
146
|
+
|
|
147
|
+
import type {
|
|
148
|
+
EmailFinderParams,
|
|
149
|
+
EmailFinderResult,
|
|
150
|
+
DomainSearchParams,
|
|
151
|
+
DomainSearchResult,
|
|
152
|
+
EmailVerifierParams,
|
|
153
|
+
EmailVerifierResult
|
|
154
|
+
} from './integration/types/tomba'
|
|
155
|
+
|
|
156
|
+
import type {
|
|
157
|
+
ResendSendEmailParams,
|
|
158
|
+
ResendSendEmailResult,
|
|
159
|
+
ResendGetEmailParams,
|
|
160
|
+
ResendGetEmailResult
|
|
161
|
+
} from './integration/types/resend'
|
|
162
|
+
|
|
163
|
+
import type {
|
|
164
|
+
CreateEnvelopeParams,
|
|
165
|
+
CreateEnvelopeResult,
|
|
166
|
+
VoidEnvelopeParams,
|
|
167
|
+
VoidEnvelopeResult,
|
|
168
|
+
DownloadDocumentParams,
|
|
169
|
+
DownloadDocumentResult,
|
|
170
|
+
GetEnvelopeParams,
|
|
171
|
+
GetEnvelopeResult
|
|
172
|
+
} from './integration/types/signature-api'
|
|
173
|
+
|
|
174
|
+
import type {
|
|
175
|
+
CreatePaymentLinkParams,
|
|
176
|
+
CreatePaymentLinkResult,
|
|
177
|
+
GetPaymentLinkParams,
|
|
178
|
+
GetPaymentLinkResult,
|
|
179
|
+
UpdatePaymentLinkParams,
|
|
180
|
+
UpdatePaymentLinkResult,
|
|
181
|
+
ListPaymentLinksParams,
|
|
182
|
+
ListPaymentLinksResult,
|
|
183
|
+
CreateAutoPaymentLinkParams,
|
|
184
|
+
CreateAutoPaymentLinkResult,
|
|
185
|
+
CreateCheckoutSessionParams,
|
|
186
|
+
CreateCheckoutSessionResult
|
|
187
|
+
} from './integration/types/stripe'
|
|
188
|
+
|
|
189
|
+
import type {
|
|
190
|
+
StorageUploadInput,
|
|
191
|
+
StorageUploadOutput,
|
|
192
|
+
StorageDownloadInput,
|
|
193
|
+
StorageDownloadOutput,
|
|
194
|
+
StorageSignedUrlInput,
|
|
195
|
+
StorageSignedUrlOutput,
|
|
196
|
+
StorageDeleteInput,
|
|
197
|
+
StorageDeleteOutput,
|
|
198
|
+
StorageListInput,
|
|
199
|
+
StorageListOutput
|
|
200
|
+
} from './platform/storage/types'
|
|
201
|
+
|
|
202
|
+
import type { CreateScheduleInput, TaskSchedule } from '../../scheduler/types'
|
|
203
|
+
|
|
204
|
+
import type { CreateNotificationParams } from '../../../operations/notifications/types'
|
|
205
|
+
|
|
206
|
+
import type {
|
|
207
|
+
AcqList,
|
|
208
|
+
AcqCompany,
|
|
209
|
+
AcqContact,
|
|
210
|
+
PaginatedResult,
|
|
211
|
+
CreateListParams,
|
|
212
|
+
UpdateListParams,
|
|
213
|
+
CreateCompanyParams,
|
|
214
|
+
UpdateCompanyParams,
|
|
215
|
+
UpsertCompanyParams,
|
|
216
|
+
CompanyFilters,
|
|
217
|
+
CreateContactParams,
|
|
218
|
+
UpdateContactParams,
|
|
219
|
+
UpsertContactParams,
|
|
220
|
+
ContactFilters,
|
|
221
|
+
UpsertDealParams,
|
|
222
|
+
AcqDeal,
|
|
223
|
+
AcqDealNote,
|
|
224
|
+
AcqDealTask,
|
|
225
|
+
CreateDealNoteParams,
|
|
226
|
+
ListDealNotesParams,
|
|
227
|
+
CreateDealTaskParams,
|
|
228
|
+
ListDealTasksParams,
|
|
229
|
+
ListDealTasksDueParams,
|
|
230
|
+
CompleteDealTaskParams,
|
|
231
|
+
RecordDealActivityParams,
|
|
232
|
+
AddContactsToListParams,
|
|
233
|
+
AddContactsToListResult,
|
|
234
|
+
BulkImportParams,
|
|
235
|
+
BulkImportResult,
|
|
236
|
+
BulkImportCompaniesParams,
|
|
237
|
+
BulkImportCompaniesResult,
|
|
238
|
+
UpdateDiscoveryDataParams,
|
|
239
|
+
UpdateProposalDataParams,
|
|
240
|
+
MarkProposalSentParams,
|
|
241
|
+
MarkProposalReviewedParams,
|
|
242
|
+
UpdateCloseLostReasonParams,
|
|
243
|
+
UpdateFeesParams,
|
|
244
|
+
TransitionItemParams,
|
|
245
|
+
SetContactNurtureParams,
|
|
246
|
+
CancelSchedulesAndHitlByEmailParams,
|
|
247
|
+
CancelHitlByDealIdParams,
|
|
248
|
+
ClearDealFieldsParams,
|
|
249
|
+
DeleteDealParams,
|
|
250
|
+
DealFilters,
|
|
251
|
+
DealPipelineAnalytics,
|
|
252
|
+
ListConfig,
|
|
253
|
+
RecordListExecutionParams,
|
|
254
|
+
UpdateCompanyStageParams,
|
|
255
|
+
UpdateContactStageParams,
|
|
256
|
+
UpsertSocialPostParams,
|
|
257
|
+
UpsertSocialPostsResult,
|
|
258
|
+
GetDealByIdParams,
|
|
259
|
+
GetContactByIdParams,
|
|
260
|
+
GetCompanyByIdParams
|
|
261
|
+
} from './lead-service-types'
|
|
262
|
+
|
|
263
|
+
import type { DealListItem, DealDetail } from '../../../business/acquisition'
|
|
264
|
+
import { CrmSchemas } from '../../../business/sales/api-schemas'
|
|
265
|
+
import type { RecentActivityEntry } from '../../../business/sales/api-schemas'
|
|
266
|
+
import { DealSchemas } from '../../../business/acquisition'
|
|
267
|
+
import { ProjectSchemas } from '../../../projects/api-schemas'
|
|
268
|
+
import type {
|
|
269
|
+
ProjectRow,
|
|
270
|
+
MilestoneRow,
|
|
271
|
+
TaskRow,
|
|
272
|
+
NoteRow,
|
|
273
|
+
ProjectWithCounts,
|
|
274
|
+
ProjectDetail
|
|
275
|
+
} from '../../../business/projects'
|
|
276
|
+
import type { z } from 'zod'
|
|
277
|
+
|
|
278
|
+
// ---------------------------------------------------------------------------
|
|
279
|
+
// Generic constraint types
|
|
280
|
+
// ---------------------------------------------------------------------------
|
|
281
|
+
|
|
282
|
+
/** A single method entry: what params go in, what result comes out */
|
|
283
|
+
export interface MethodEntry {
|
|
284
|
+
params: unknown
|
|
285
|
+
result: unknown
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/** A tool's complete method map: method name -> MethodEntry */
|
|
289
|
+
export type ToolMethodMap = Record<string, MethodEntry>
|
|
290
|
+
|
|
291
|
+
// ---------------------------------------------------------------------------
|
|
292
|
+
// Attio (integration adapter, 12 methods)
|
|
293
|
+
// ---------------------------------------------------------------------------
|
|
294
|
+
|
|
295
|
+
export type AttioToolMap = {
|
|
296
|
+
createRecord: { params: CreateRecordParams; result: CreateRecordResult }
|
|
297
|
+
updateRecord: { params: UpdateRecordParams; result: UpdateRecordResult }
|
|
298
|
+
listRecords: { params: QueryRecordsParams; result: QueryRecordsResult }
|
|
299
|
+
getRecord: { params: GetRecordParams; result: GetRecordResult }
|
|
300
|
+
deleteRecord: { params: DeleteRecordParams; result: DeleteRecordResult }
|
|
301
|
+
listObjects: { params: Record<string, never>; result: ListObjectsResult }
|
|
302
|
+
listAttributes: { params: ListAttributesParams; result: ListAttributesResult }
|
|
303
|
+
createAttribute: { params: CreateAttributeParams; result: CreateAttributeResult }
|
|
304
|
+
updateAttribute: { params: UpdateAttributeParams; result: UpdateAttributeResult }
|
|
305
|
+
createNote: { params: CreateNoteParams; result: CreateNoteResult }
|
|
306
|
+
listNotes: { params: ListNotesParams; result: ListNotesResult }
|
|
307
|
+
deleteNote: { params: DeleteNoteParams; result: DeleteNoteResult }
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// ---------------------------------------------------------------------------
|
|
311
|
+
// Scheduler (platform tool, 9 methods)
|
|
312
|
+
// ---------------------------------------------------------------------------
|
|
313
|
+
|
|
314
|
+
export type SchedulerToolMap = {
|
|
315
|
+
createSchedule: { params: CreateScheduleInput; result: TaskSchedule }
|
|
316
|
+
updateAnchor: { params: { scheduleId: string; anchorAt: string }; result: TaskSchedule }
|
|
317
|
+
deleteSchedule: { params: { scheduleId: string }; result: void }
|
|
318
|
+
findByIdempotencyKey: { params: { idempotencyKey: string }; result: TaskSchedule | null }
|
|
319
|
+
deleteScheduleByIdempotencyKey: { params: { idempotencyKey: string }; result: void }
|
|
320
|
+
listSchedules: { params: { status?: string; limit?: number; offset?: number }; result: TaskSchedule[] }
|
|
321
|
+
getSchedule: { params: { scheduleId: string }; result: TaskSchedule }
|
|
322
|
+
cancelSchedule: { params: { scheduleId: string }; result: void }
|
|
323
|
+
cancelSchedulesByMetadata: { params: { metadata: Record<string, unknown> }; result: { cancelledCount: number } }
|
|
324
|
+
cancelScheduleByIdempotencyKey: { params: { idempotencyKey: string }; result: { cancelled: boolean } }
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// ---------------------------------------------------------------------------
|
|
328
|
+
// Storage (platform tool, 5 methods)
|
|
329
|
+
// ---------------------------------------------------------------------------
|
|
330
|
+
|
|
331
|
+
export type StorageToolMap = {
|
|
332
|
+
upload: { params: StorageUploadInput; result: StorageUploadOutput }
|
|
333
|
+
download: { params: StorageDownloadInput; result: StorageDownloadOutput }
|
|
334
|
+
createSignedUrl: { params: StorageSignedUrlInput; result: StorageSignedUrlOutput }
|
|
335
|
+
delete: { params: StorageDeleteInput; result: StorageDeleteOutput }
|
|
336
|
+
list: { params: StorageListInput; result: StorageListOutput }
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// ---------------------------------------------------------------------------
|
|
340
|
+
// Notification (platform tool, 1 method)
|
|
341
|
+
// ---------------------------------------------------------------------------
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* SDK-side notification input.
|
|
345
|
+
* Omits userId and organizationId which are injected server-side from execution context.
|
|
346
|
+
*/
|
|
347
|
+
export type NotificationSDKInput = Omit<CreateNotificationParams, 'userId' | 'organizationId'>
|
|
348
|
+
|
|
349
|
+
export type NotificationToolMap = {
|
|
350
|
+
create: { params: NotificationSDKInput; result: void }
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// ---------------------------------------------------------------------------
|
|
354
|
+
// Projects (platform tool, 18 methods)
|
|
355
|
+
// ---------------------------------------------------------------------------
|
|
356
|
+
|
|
357
|
+
type ProjectsListParams = z.infer<typeof ProjectSchemas.GetProjectsQuery>
|
|
358
|
+
type ProjectCreateParams = z.infer<typeof ProjectSchemas.CreateProjectRequest>
|
|
359
|
+
type ProjectUpdateParams = z.infer<typeof ProjectSchemas.UpdateProjectRequest>
|
|
360
|
+
type MilestoneCreateParams = z.infer<typeof ProjectSchemas.ProjectIdPathParams> &
|
|
361
|
+
z.infer<typeof ProjectSchemas.CreateMilestoneRequest>
|
|
362
|
+
type MilestoneUpdateParams = z.infer<typeof ProjectSchemas.UpdateMilestoneRequest>
|
|
363
|
+
type TaskListParams = z.infer<typeof ProjectSchemas.ProjectIdPathParams> & z.infer<typeof ProjectSchemas.GetTasksQuery>
|
|
364
|
+
type TaskCreateParams = z.infer<typeof ProjectSchemas.CreateTaskRequest>
|
|
365
|
+
type TaskUpdateParams = z.infer<typeof ProjectSchemas.UpdateTaskRequest>
|
|
366
|
+
type TaskResumeContextParams = z.infer<typeof ProjectSchemas.TaskIdParams> &
|
|
367
|
+
z.infer<typeof ProjectSchemas.MergeResumeContextRequest>
|
|
368
|
+
type NoteListParams = z.infer<typeof ProjectSchemas.ProjectIdPathParams>
|
|
369
|
+
type NoteCreateParams = z.infer<typeof ProjectSchemas.CreateNoteRequest>
|
|
370
|
+
type NoteUpdateParams = z.infer<typeof ProjectSchemas.UpdateNoteRequest>
|
|
371
|
+
type TaskResumeContextResult = Pick<TaskRow, 'id' | 'resume_context' | 'updated_at'>
|
|
372
|
+
|
|
373
|
+
export type ProjectsToolMap = {
|
|
374
|
+
listProjects: { params: ProjectsListParams; result: ProjectWithCounts[] }
|
|
375
|
+
getProject: { params: z.infer<typeof ProjectSchemas.ProjectIdParams>; result: ProjectDetail }
|
|
376
|
+
createProject: { params: ProjectCreateParams; result: ProjectRow }
|
|
377
|
+
updateProject: { params: z.infer<typeof ProjectSchemas.ProjectIdParams> & ProjectUpdateParams; result: ProjectRow }
|
|
378
|
+
deleteProject: { params: z.infer<typeof ProjectSchemas.ProjectIdParams>; result: void }
|
|
379
|
+
listMilestones: { params: z.infer<typeof ProjectSchemas.ProjectIdPathParams>; result: MilestoneRow[] }
|
|
380
|
+
createMilestone: { params: MilestoneCreateParams; result: MilestoneRow }
|
|
381
|
+
updateMilestone: {
|
|
382
|
+
params: z.infer<typeof ProjectSchemas.MilestoneIdParams> & MilestoneUpdateParams
|
|
383
|
+
result: MilestoneRow
|
|
384
|
+
}
|
|
385
|
+
deleteMilestone: { params: z.infer<typeof ProjectSchemas.MilestoneIdParams>; result: void }
|
|
386
|
+
listTasks: { params: TaskListParams; result: TaskRow[] }
|
|
387
|
+
getTask: { params: z.infer<typeof ProjectSchemas.TaskIdParams>; result: TaskRow }
|
|
388
|
+
createTask: { params: TaskCreateParams; result: TaskRow }
|
|
389
|
+
updateTask: { params: z.infer<typeof ProjectSchemas.TaskIdParams> & TaskUpdateParams; result: TaskRow }
|
|
390
|
+
deleteTask: { params: z.infer<typeof ProjectSchemas.TaskIdParams>; result: void }
|
|
391
|
+
mergeTaskResumeContext: { params: TaskResumeContextParams; result: TaskResumeContextResult }
|
|
392
|
+
listNotes: { params: NoteListParams; result: NoteRow[] }
|
|
393
|
+
createNote: { params: NoteCreateParams; result: NoteRow }
|
|
394
|
+
updateNote: { params: z.infer<typeof ProjectSchemas.NoteIdParams> & NoteUpdateParams; result: NoteRow }
|
|
395
|
+
deleteNote: { params: z.infer<typeof ProjectSchemas.NoteIdParams>; result: void }
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// ---------------------------------------------------------------------------
|
|
399
|
+
// CRM (platform tool, 13 methods)
|
|
400
|
+
// ---------------------------------------------------------------------------
|
|
401
|
+
|
|
402
|
+
type CrmRecentActivityParams = Partial<z.infer<typeof CrmSchemas.GetRecentActivityQuery>>
|
|
403
|
+
type CrmListDealsParams = Partial<z.infer<typeof DealSchemas.ListDealsQuery>>
|
|
404
|
+
type CrmGetDealParams = z.infer<typeof DealSchemas.DealIdParams>
|
|
405
|
+
type CrmGetDealByEmailParams = { email: string }
|
|
406
|
+
type CrmTaskDueParams = Partial<z.infer<typeof DealSchemas.ListDealTasksDueQuery>>
|
|
407
|
+
type CrmDealTaskParams = Omit<CreateDealTaskParams, 'organizationId'>
|
|
408
|
+
type CrmDealNoteParams = Omit<CreateDealNoteParams, 'organizationId'>
|
|
409
|
+
type CrmRecordActivityParams = Omit<RecordDealActivityParams, 'organizationId'>
|
|
410
|
+
type CrmDeleteDealParams = Omit<DeleteDealParams, 'organizationId'>
|
|
411
|
+
|
|
412
|
+
export type CrmToolMap = {
|
|
413
|
+
getRecentActivity: { params: CrmRecentActivityParams; result: RecentActivityEntry[] }
|
|
414
|
+
listDeals: { params: CrmListDealsParams; result: DealListItem[] }
|
|
415
|
+
getDeal: { params: CrmGetDealParams; result: DealDetail | null }
|
|
416
|
+
getDealByEmail: { params: CrmGetDealByEmailParams; result: DealDetail | null }
|
|
417
|
+
createDealNote: { params: CrmDealNoteParams; result: AcqDealNote }
|
|
418
|
+
listDealNotes: { params: Omit<ListDealNotesParams, 'organizationId'>; result: AcqDealNote[] }
|
|
419
|
+
createDealTask: { params: CrmDealTaskParams; result: AcqDealTask }
|
|
420
|
+
listDealTasks: { params: Omit<ListDealTasksParams, 'organizationId'>; result: AcqDealTask[] }
|
|
421
|
+
listDealTasksDue: { params: CrmTaskDueParams; result: AcqDealTask[] }
|
|
422
|
+
completeDealTask: { params: Omit<CompleteDealTaskParams, 'organizationId'>; result: AcqDealTask }
|
|
423
|
+
recordActivity: { params: CrmRecordActivityParams; result: void }
|
|
424
|
+
deleteDeal: { params: CrmDeleteDealParams; result: void }
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// ---------------------------------------------------------------------------
|
|
428
|
+
// Stripe (integration adapter, 6 methods)
|
|
429
|
+
// ---------------------------------------------------------------------------
|
|
430
|
+
|
|
431
|
+
export type StripeToolMap = {
|
|
432
|
+
createPaymentLink: { params: CreatePaymentLinkParams; result: CreatePaymentLinkResult }
|
|
433
|
+
getPaymentLink: { params: GetPaymentLinkParams; result: GetPaymentLinkResult }
|
|
434
|
+
updatePaymentLink: { params: UpdatePaymentLinkParams; result: UpdatePaymentLinkResult }
|
|
435
|
+
listPaymentLinks: { params: ListPaymentLinksParams; result: ListPaymentLinksResult }
|
|
436
|
+
createAutoPaymentLink: { params: CreateAutoPaymentLinkParams; result: CreateAutoPaymentLinkResult }
|
|
437
|
+
createCheckoutSession: { params: CreateCheckoutSessionParams; result: CreateCheckoutSessionResult }
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// ---------------------------------------------------------------------------
|
|
441
|
+
// Google Sheets (integration adapter, 13 methods)
|
|
442
|
+
// ---------------------------------------------------------------------------
|
|
443
|
+
|
|
444
|
+
export type GoogleSheetsToolMap = {
|
|
445
|
+
readSheet: { params: ReadSheetParams; result: ReadSheetResult }
|
|
446
|
+
writeSheet: { params: WriteSheetParams; result: WriteSheetResult }
|
|
447
|
+
appendRows: { params: AppendRowsParams; result: AppendRowsResult }
|
|
448
|
+
clearRange: { params: ClearRangeParams; result: ClearRangeResult }
|
|
449
|
+
getSpreadsheetMetadata: { params: GetSpreadsheetMetadataParams; result: GetSpreadsheetMetadataResult }
|
|
450
|
+
batchUpdate: { params: BatchUpdateParams; result: BatchUpdateResult }
|
|
451
|
+
getHeaders: { params: GetHeadersParams; result: GetHeadersResult }
|
|
452
|
+
getLastRow: { params: GetLastRowParams; result: GetLastRowResult }
|
|
453
|
+
getRowByValue: { params: GetRowByValueParams; result: GetRowByValueResult }
|
|
454
|
+
updateRowByValue: { params: UpdateRowByValueParams; result: UpdateRowByValueResult }
|
|
455
|
+
upsertRow: { params: UpsertRowParams; result: UpsertRowResult }
|
|
456
|
+
filterRows: { params: FilterRowsParams; result: FilterRowsResult }
|
|
457
|
+
deleteRowByValue: { params: DeleteRowByValueParams; result: DeleteRowByValueResult }
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// ---------------------------------------------------------------------------
|
|
461
|
+
// Resend (integration adapter, 2 methods)
|
|
462
|
+
// ---------------------------------------------------------------------------
|
|
463
|
+
|
|
464
|
+
export type ResendToolMap = {
|
|
465
|
+
sendEmail: { params: ResendSendEmailParams; result: ResendSendEmailResult }
|
|
466
|
+
getEmail: { params: ResendGetEmailParams; result: ResendGetEmailResult }
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// ---------------------------------------------------------------------------
|
|
470
|
+
// Apify (integration adapter, 2 methods)
|
|
471
|
+
// ---------------------------------------------------------------------------
|
|
472
|
+
|
|
473
|
+
export type ApifyToolMap = {
|
|
474
|
+
runActor: { params: RunActorParams; result: RunActorResult }
|
|
475
|
+
getDatasetItems: { params: GetDatasetItemsParams; result: GetDatasetItemsResult }
|
|
476
|
+
startActor: { params: StartActorParams; result: StartActorResult }
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
// ---------------------------------------------------------------------------
|
|
480
|
+
// Gmail (integration adapter, 1 method)
|
|
481
|
+
// ---------------------------------------------------------------------------
|
|
482
|
+
|
|
483
|
+
export type GmailToolMap = {
|
|
484
|
+
sendEmail: { params: GmailSendEmailParams; result: GmailSendEmailResult }
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// ---------------------------------------------------------------------------
|
|
488
|
+
// Dropbox (integration adapter, 2 methods)
|
|
489
|
+
// ---------------------------------------------------------------------------
|
|
490
|
+
|
|
491
|
+
export type DropboxToolMap = {
|
|
492
|
+
uploadFile: { params: UploadFileParams; result: UploadFileResult }
|
|
493
|
+
createFolder: { params: CreateFolderParams; result: CreateFolderResult }
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
// ---------------------------------------------------------------------------
|
|
497
|
+
// SignatureAPI (integration adapter, 4 methods)
|
|
498
|
+
// ---------------------------------------------------------------------------
|
|
499
|
+
|
|
500
|
+
export type SignatureApiToolMap = {
|
|
501
|
+
createEnvelope: { params: CreateEnvelopeParams; result: CreateEnvelopeResult }
|
|
502
|
+
voidEnvelope: { params: VoidEnvelopeParams; result: VoidEnvelopeResult }
|
|
503
|
+
downloadDocument: { params: DownloadDocumentParams; result: DownloadDocumentResult }
|
|
504
|
+
getEnvelope: { params: GetEnvelopeParams; result: GetEnvelopeResult }
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
// ---------------------------------------------------------------------------
|
|
508
|
+
// Instantly (integration adapter, 21 methods)
|
|
509
|
+
// ---------------------------------------------------------------------------
|
|
510
|
+
|
|
511
|
+
export type InstantlyToolMap = {
|
|
512
|
+
sendReply: { params: SendReplyParams; result: SendReplyResult }
|
|
513
|
+
removeFromSubsequence: { params: RemoveFromSubsequenceParams; result: RemoveFromSubsequenceResult }
|
|
514
|
+
getEmails: { params: GetEmailsParams; result: GetEmailsResult }
|
|
515
|
+
updateInterestStatus: { params: UpdateInterestStatusParams; result: UpdateInterestStatusResult }
|
|
516
|
+
addToCampaign: { params: AddToCampaignParams; result: AddToCampaignResult }
|
|
517
|
+
listCampaigns: { params: ListCampaignsParams; result: ListCampaignsResult }
|
|
518
|
+
getCampaign: { params: GetCampaignParams; result: GetCampaignResult }
|
|
519
|
+
updateCampaign: { params: UpdateCampaignParams; result: UpdateCampaignResult }
|
|
520
|
+
pauseCampaign: { params: PauseCampaignParams; result: PauseCampaignResult }
|
|
521
|
+
activateCampaign: { params: ActivateCampaignParams; result: ActivateCampaignResult }
|
|
522
|
+
getCampaignAnalytics: { params: GetCampaignAnalyticsParams; result: GetCampaignAnalyticsResult }
|
|
523
|
+
getStepAnalytics: { params: GetStepAnalyticsParams; result: GetStepAnalyticsResult }
|
|
524
|
+
bulkAddLeads: { params: BulkAddLeadsParams; result: BulkAddLeadsResult }
|
|
525
|
+
getAccountHealth: { params: GetAccountHealthParams; result: GetAccountHealthResult }
|
|
526
|
+
createInboxTest: { params: CreateInboxTestParams; result: CreateInboxTestResult }
|
|
527
|
+
createCampaign: { params: CreateCampaignParams; result: CreateCampaignResult }
|
|
528
|
+
getDailyCampaignAnalytics: { params: GetDailyCampaignAnalyticsParams; result: GetDailyCampaignAnalyticsResult }
|
|
529
|
+
listLeads: { params: ListLeadsParams; result: ListLeadsResult }
|
|
530
|
+
bulkDeleteLeads: { params: BulkDeleteLeadsParams; result: BulkDeleteLeadsResult }
|
|
531
|
+
deleteCampaign: { params: DeleteCampaignParams; result: DeleteCampaignResult }
|
|
532
|
+
patchLead: { params: PatchLeadParams; result: PatchLeadResult }
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// ---------------------------------------------------------------------------
|
|
536
|
+
// Anymailfinder (integration adapter, 4 methods)
|
|
537
|
+
// ---------------------------------------------------------------------------
|
|
538
|
+
|
|
539
|
+
export type AnymailfinderToolMap = {
|
|
540
|
+
findCompanyEmail: { params: FindCompanyEmailParams; result: FindCompanyEmailResult }
|
|
541
|
+
findPersonEmail: { params: FindPersonEmailParams; result: FindPersonEmailResult }
|
|
542
|
+
findDecisionMakerEmail: { params: FindDecisionMakerEmailParams; result: FindDecisionMakerEmailResult }
|
|
543
|
+
verifyEmail: { params: VerifyEmailParams; result: VerifyEmailResult }
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// ---------------------------------------------------------------------------
|
|
547
|
+
// Tomba (integration adapter, 3 methods)
|
|
548
|
+
// ---------------------------------------------------------------------------
|
|
549
|
+
|
|
550
|
+
export type TombaToolMap = {
|
|
551
|
+
emailFinder: { params: EmailFinderParams; result: EmailFinderResult }
|
|
552
|
+
domainSearch: { params: DomainSearchParams; result: DomainSearchResult }
|
|
553
|
+
emailVerifier: { params: EmailVerifierParams; result: EmailVerifierResult }
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
// ---------------------------------------------------------------------------
|
|
557
|
+
// MillionVerifier (integration adapter, 2 methods)
|
|
558
|
+
// ---------------------------------------------------------------------------
|
|
559
|
+
|
|
560
|
+
export type MillionVerifierToolMap = {
|
|
561
|
+
verifyEmail: { params: MillionVerifierVerifyEmailParams; result: MillionVerifierVerifyEmailResult }
|
|
562
|
+
checkCredits: { params: MillionVerifierCheckCreditsParams; result: MillionVerifierCheckCreditsResult }
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
// ---------------------------------------------------------------------------
|
|
566
|
+
// Lead (platform tool, 46 methods)
|
|
567
|
+
// ---------------------------------------------------------------------------
|
|
568
|
+
|
|
569
|
+
export type LeadToolMap = {
|
|
570
|
+
// List operations
|
|
571
|
+
listLists: { params: Record<string, never>; result: AcqList[] }
|
|
575
572
|
createList: { params: Omit<CreateListParams, 'organizationId'>; result: AcqList }
|
|
576
573
|
updateList: { params: { id: string } & UpdateListParams; result: AcqList }
|
|
577
574
|
deleteList: { params: { id: string }; result: void }
|
|
@@ -586,209 +583,209 @@ export type LeadToolMap = {
|
|
|
586
583
|
}
|
|
587
584
|
// Company operations
|
|
588
585
|
createCompany: { params: Omit<CreateCompanyParams, 'organizationId'>; result: AcqCompany }
|
|
589
|
-
upsertCompany: { params: Omit<UpsertCompanyParams, 'organizationId'>; result: AcqCompany }
|
|
590
|
-
updateCompany: { params: { id: string } & UpdateCompanyParams; result: AcqCompany }
|
|
591
|
-
getCompany: { params: { id: string }; result: AcqCompany | null }
|
|
592
|
-
listCompanies: { params: CompanyFilters; result: AcqCompany[] }
|
|
593
|
-
deleteCompany: { params: { id: string }; result: void }
|
|
594
|
-
// Contact operations
|
|
595
|
-
createContact: { params: Omit<CreateContactParams, 'organizationId'>; result: AcqContact }
|
|
596
|
-
upsertContact: { params: Omit<UpsertContactParams, 'organizationId'>; result: AcqContact }
|
|
597
|
-
updateContact: { params: { id: string } & UpdateContactParams; result: AcqContact }
|
|
598
|
-
getContact: { params: { id: string }; result: AcqContact | null }
|
|
599
|
-
getContactByEmail: { params: { email: string }; result: AcqContact | null }
|
|
600
|
-
listContacts: {
|
|
601
|
-
params: ContactFilters & { limit?: number; offset?: number }
|
|
602
|
-
result: PaginatedResult<AcqContact>
|
|
603
|
-
}
|
|
604
|
-
deleteContact: { params: { id: string }; result: void }
|
|
605
|
-
bulkImportContacts: { params: Omit<BulkImportParams, 'organizationId'>; result: BulkImportResult }
|
|
606
|
-
bulkImportCompanies: {
|
|
607
|
-
params: Omit<BulkImportCompaniesParams, 'organizationId'>
|
|
608
|
-
result: BulkImportCompaniesResult
|
|
609
|
-
}
|
|
610
|
-
deactivateContactsByCompany: {
|
|
611
|
-
params: { companyId: string }
|
|
612
|
-
result: { deactivated: number }
|
|
613
|
-
}
|
|
614
|
-
// Deal operations
|
|
615
|
-
upsertDeal: { params: Omit<UpsertDealParams, 'organizationId'>; result: AcqDeal }
|
|
616
|
-
getDealByEmail: { params: { email: string }; result: AcqDeal | null }
|
|
617
|
-
getDealByEnvelopeId: { params: { envelopeId: string }; result: AcqDeal | null }
|
|
618
|
-
updateDealEnvelopeId: { params: { dealId: string; envelopeId: string }; result: AcqDeal | null }
|
|
619
|
-
getDealById: { params: Omit<GetDealByIdParams, 'organizationId'>; result: AcqDeal | null }
|
|
620
|
-
getContactById: { params: Omit<GetContactByIdParams, 'organizationId'>; result: AcqContact | null }
|
|
621
|
-
getCompanyById: { params: Omit<GetCompanyByIdParams, 'organizationId'>; result: AcqCompany | null }
|
|
622
|
-
// Deal-sync operations
|
|
623
|
-
updateDiscoveryData: { params: Omit<UpdateDiscoveryDataParams, 'organizationId'>; result: void }
|
|
624
|
-
updateProposalData: { params: Omit<UpdateProposalDataParams, 'organizationId'>; result: void }
|
|
625
|
-
markProposalSent: { params: Omit<MarkProposalSentParams, 'organizationId'>; result: void }
|
|
626
|
-
markProposalReviewed: { params: Omit<MarkProposalReviewedParams, 'organizationId'>; result: void }
|
|
627
|
-
updateCloseLostReason: { params: Omit<UpdateCloseLostReasonParams, 'organizationId'>; result: void }
|
|
628
|
-
updateFees: { params: Omit<UpdateFeesParams, 'organizationId'>; result: void }
|
|
629
|
-
|
|
630
|
-
setContactNurture: { params: Omit<SetContactNurtureParams, 'organizationId'>; result: void }
|
|
631
|
-
cancelSchedulesAndHitlByEmail: {
|
|
632
|
-
params: Omit<CancelSchedulesAndHitlByEmailParams, 'organizationId'>
|
|
633
|
-
result: { schedulesCancelled: number; hitlDeleted: number }
|
|
634
|
-
}
|
|
635
|
-
cancelHitlByDealId: { params: Omit<CancelHitlByDealIdParams, 'organizationId'>; result: { hitlDeleted: number } }
|
|
636
|
-
clearDealFields: { params: Omit<ClearDealFieldsParams, 'organizationId'>; result: void }
|
|
637
|
-
deleteDeal: { params: Omit<DeleteDealParams, 'organizationId'>; result: void }
|
|
638
|
-
recordDealActivity: {
|
|
639
|
-
params: Omit<RecordDealActivityParams, 'organizationId'>
|
|
640
|
-
result: void
|
|
641
|
-
}
|
|
642
|
-
// Deal note operations
|
|
643
|
-
createDealNote: {
|
|
644
|
-
params: Omit<CreateDealNoteParams, 'organizationId'>
|
|
645
|
-
result: AcqDealNote
|
|
646
|
-
}
|
|
647
|
-
listDealNotes: {
|
|
648
|
-
params: Omit<ListDealNotesParams, 'organizationId'>
|
|
649
|
-
result: AcqDealNote[]
|
|
650
|
-
}
|
|
651
|
-
// Deal task operations
|
|
652
|
-
createDealTask: {
|
|
653
|
-
params: Omit<CreateDealTaskParams, 'organizationId'>
|
|
654
|
-
result: AcqDealTask
|
|
655
|
-
}
|
|
656
|
-
listDealTasks: {
|
|
657
|
-
params: Omit<ListDealTasksParams, 'organizationId'>
|
|
658
|
-
result: AcqDealTask[]
|
|
659
|
-
}
|
|
660
|
-
listDealTasksDue: {
|
|
661
|
-
params: Omit<ListDealTasksDueParams, 'organizationId'>
|
|
662
|
-
result: AcqDealTask[]
|
|
663
|
-
}
|
|
664
|
-
completeDealTask: {
|
|
665
|
-
params: Omit<CompleteDealTaskParams, 'organizationId'>
|
|
666
|
-
result: AcqDealTask
|
|
667
|
-
}
|
|
668
|
-
// Deal query & analytics operations
|
|
669
|
-
listDeals: { params: DealFilters; result: AcqDeal[] }
|
|
670
|
-
getDealPipelineAnalytics: { params: { recentLimit?: number }; result: DealPipelineAnalytics }
|
|
671
|
-
// Enrichment data operations
|
|
672
|
-
mergeEnrichmentData: {
|
|
673
|
-
params: { id: string; table: 'acq_companies' | 'acq_contacts'; data: Record<string, unknown> }
|
|
674
|
-
result: void
|
|
675
|
-
}
|
|
676
|
-
// Social monitoring operations
|
|
677
|
-
upsertSocialPosts: {
|
|
678
|
-
params: { posts: Omit<UpsertSocialPostParams, 'organizationId'>[] }
|
|
679
|
-
result: UpsertSocialPostsResult
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
// ---------------------------------------------------------------------------
|
|
684
|
-
// List (platform tool, 4 methods)
|
|
685
|
-
// ---------------------------------------------------------------------------
|
|
686
|
-
|
|
687
|
-
export type ListToolMap = {
|
|
688
|
-
getConfig: { params: { listId: string }; result: ListConfig }
|
|
689
|
-
recordExecution: {
|
|
690
|
-
params: Omit<RecordListExecutionParams, 'organizationId'>
|
|
691
|
-
result: void
|
|
692
|
-
}
|
|
693
|
-
updateCompanyStage: {
|
|
694
|
-
params: Omit<UpdateCompanyStageParams, 'organizationId'>
|
|
695
|
-
result: void
|
|
696
|
-
}
|
|
697
|
-
updateContactStage: {
|
|
698
|
-
params: Omit<UpdateContactStageParams, 'organizationId'>
|
|
699
|
-
result: void
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
// ---------------------------------------------------------------------------
|
|
704
|
-
// PDF (platform tool, 2 methods)
|
|
705
|
-
// ---------------------------------------------------------------------------
|
|
706
|
-
|
|
707
|
-
export type PdfToolMap = {
|
|
708
|
-
render: {
|
|
709
|
-
params: {
|
|
710
|
-
document: Record<string, unknown>
|
|
711
|
-
theme?: Record<string, unknown>
|
|
712
|
-
storage: { bucket: string; path: string }
|
|
713
|
-
}
|
|
714
|
-
result: { success: boolean; pdfUrl: string; size: number }
|
|
715
|
-
}
|
|
716
|
-
renderToBuffer: {
|
|
717
|
-
params: {
|
|
718
|
-
document: Record<string, unknown>
|
|
719
|
-
theme?: Record<string, unknown>
|
|
720
|
-
}
|
|
721
|
-
result: { buffer: string }
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
// ---------------------------------------------------------------------------
|
|
726
|
-
// Approval (platform tool, 2 methods)
|
|
727
|
-
// ---------------------------------------------------------------------------
|
|
728
|
-
|
|
729
|
-
export type ApprovalToolMap = {
|
|
730
|
-
create: {
|
|
731
|
-
params: {
|
|
732
|
-
actions: Array<{
|
|
733
|
-
id: string
|
|
734
|
-
label: string
|
|
735
|
-
type: 'primary' | 'secondary' | 'danger' | 'outline'
|
|
736
|
-
icon?: string
|
|
737
|
-
color?: string
|
|
738
|
-
target?: { resourceType: 'agent' | 'workflow'; resourceId: string; sessionId?: string }
|
|
739
|
-
form?: Record<string, unknown>
|
|
740
|
-
requiresConfirmation?: boolean
|
|
741
|
-
confirmationMessage?: string
|
|
742
|
-
description?: string
|
|
743
|
-
}>
|
|
744
|
-
context: Record<string, unknown>
|
|
745
|
-
description?: string
|
|
746
|
-
priority?: number
|
|
747
|
-
humanCheckpoint?: string
|
|
748
|
-
metadata?: Record<string, unknown>
|
|
749
|
-
expiresAt?: string
|
|
750
|
-
idempotencyKey?: string
|
|
751
|
-
}
|
|
752
|
-
result: { id: string }
|
|
753
|
-
}
|
|
754
|
-
deleteByMetadata: {
|
|
755
|
-
params: { metadata: Record<string, unknown>; status?: string }
|
|
756
|
-
result: { deleted: number }
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
// ---------------------------------------------------------------------------
|
|
761
|
-
// Execution (platform tool, 1 method)
|
|
762
|
-
// ---------------------------------------------------------------------------
|
|
763
|
-
|
|
764
|
-
export type ExecutionToolMap = {
|
|
765
|
-
trigger: {
|
|
766
|
-
params: { resourceId: string; input?: unknown }
|
|
767
|
-
result: { success: boolean; executionId: string; output: unknown; error?: string }
|
|
768
|
-
}
|
|
769
|
-
triggerAsync: {
|
|
770
|
-
params: { resourceId: string; input?: unknown }
|
|
771
|
-
result: { executionId: string }
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
// ---------------------------------------------------------------------------
|
|
776
|
-
// Email (platform tool, 1 method)
|
|
777
|
-
// ---------------------------------------------------------------------------
|
|
778
|
-
|
|
779
|
-
export type EmailToolMap = {
|
|
780
|
-
send: {
|
|
781
|
-
params: {
|
|
782
|
-
subject: string
|
|
783
|
-
html?: string
|
|
784
|
-
text?: string
|
|
785
|
-
replyTo?: string
|
|
786
|
-
tags?: Array<{ name: string; value: string }>
|
|
787
|
-
} & (
|
|
788
|
-
| { userIds: string[]; targetRole?: never; targetAll?: never }
|
|
789
|
-
| { targetRole: string; userIds?: never; targetAll?: never }
|
|
790
|
-
| { targetAll: true; userIds?: never; targetRole?: never }
|
|
791
|
-
)
|
|
792
|
-
result: { sent: number; failed: number; errors?: Array<{ userId: string; email: string; error: string }> }
|
|
793
|
-
}
|
|
794
|
-
}
|
|
586
|
+
upsertCompany: { params: Omit<UpsertCompanyParams, 'organizationId'>; result: AcqCompany }
|
|
587
|
+
updateCompany: { params: { id: string } & UpdateCompanyParams; result: AcqCompany }
|
|
588
|
+
getCompany: { params: { id: string }; result: AcqCompany | null }
|
|
589
|
+
listCompanies: { params: CompanyFilters; result: AcqCompany[] }
|
|
590
|
+
deleteCompany: { params: { id: string }; result: void }
|
|
591
|
+
// Contact operations
|
|
592
|
+
createContact: { params: Omit<CreateContactParams, 'organizationId'>; result: AcqContact }
|
|
593
|
+
upsertContact: { params: Omit<UpsertContactParams, 'organizationId'>; result: AcqContact }
|
|
594
|
+
updateContact: { params: { id: string } & UpdateContactParams; result: AcqContact }
|
|
595
|
+
getContact: { params: { id: string }; result: AcqContact | null }
|
|
596
|
+
getContactByEmail: { params: { email: string }; result: AcqContact | null }
|
|
597
|
+
listContacts: {
|
|
598
|
+
params: ContactFilters & { limit?: number; offset?: number }
|
|
599
|
+
result: PaginatedResult<AcqContact>
|
|
600
|
+
}
|
|
601
|
+
deleteContact: { params: { id: string }; result: void }
|
|
602
|
+
bulkImportContacts: { params: Omit<BulkImportParams, 'organizationId'>; result: BulkImportResult }
|
|
603
|
+
bulkImportCompanies: {
|
|
604
|
+
params: Omit<BulkImportCompaniesParams, 'organizationId'>
|
|
605
|
+
result: BulkImportCompaniesResult
|
|
606
|
+
}
|
|
607
|
+
deactivateContactsByCompany: {
|
|
608
|
+
params: { companyId: string }
|
|
609
|
+
result: { deactivated: number }
|
|
610
|
+
}
|
|
611
|
+
// Deal operations
|
|
612
|
+
upsertDeal: { params: Omit<UpsertDealParams, 'organizationId'>; result: AcqDeal }
|
|
613
|
+
getDealByEmail: { params: { email: string }; result: AcqDeal | null }
|
|
614
|
+
getDealByEnvelopeId: { params: { envelopeId: string }; result: AcqDeal | null }
|
|
615
|
+
updateDealEnvelopeId: { params: { dealId: string; envelopeId: string }; result: AcqDeal | null }
|
|
616
|
+
getDealById: { params: Omit<GetDealByIdParams, 'organizationId'>; result: AcqDeal | null }
|
|
617
|
+
getContactById: { params: Omit<GetContactByIdParams, 'organizationId'>; result: AcqContact | null }
|
|
618
|
+
getCompanyById: { params: Omit<GetCompanyByIdParams, 'organizationId'>; result: AcqCompany | null }
|
|
619
|
+
// Deal-sync operations
|
|
620
|
+
updateDiscoveryData: { params: Omit<UpdateDiscoveryDataParams, 'organizationId'>; result: void }
|
|
621
|
+
updateProposalData: { params: Omit<UpdateProposalDataParams, 'organizationId'>; result: void }
|
|
622
|
+
markProposalSent: { params: Omit<MarkProposalSentParams, 'organizationId'>; result: void }
|
|
623
|
+
markProposalReviewed: { params: Omit<MarkProposalReviewedParams, 'organizationId'>; result: void }
|
|
624
|
+
updateCloseLostReason: { params: Omit<UpdateCloseLostReasonParams, 'organizationId'>; result: void }
|
|
625
|
+
updateFees: { params: Omit<UpdateFeesParams, 'organizationId'>; result: void }
|
|
626
|
+
transitionItem: { params: Omit<TransitionItemParams, 'organizationId'>; result: void }
|
|
627
|
+
setContactNurture: { params: Omit<SetContactNurtureParams, 'organizationId'>; result: void }
|
|
628
|
+
cancelSchedulesAndHitlByEmail: {
|
|
629
|
+
params: Omit<CancelSchedulesAndHitlByEmailParams, 'organizationId'>
|
|
630
|
+
result: { schedulesCancelled: number; hitlDeleted: number }
|
|
631
|
+
}
|
|
632
|
+
cancelHitlByDealId: { params: Omit<CancelHitlByDealIdParams, 'organizationId'>; result: { hitlDeleted: number } }
|
|
633
|
+
clearDealFields: { params: Omit<ClearDealFieldsParams, 'organizationId'>; result: void }
|
|
634
|
+
deleteDeal: { params: Omit<DeleteDealParams, 'organizationId'>; result: void }
|
|
635
|
+
recordDealActivity: {
|
|
636
|
+
params: Omit<RecordDealActivityParams, 'organizationId'>
|
|
637
|
+
result: void
|
|
638
|
+
}
|
|
639
|
+
// Deal note operations
|
|
640
|
+
createDealNote: {
|
|
641
|
+
params: Omit<CreateDealNoteParams, 'organizationId'>
|
|
642
|
+
result: AcqDealNote
|
|
643
|
+
}
|
|
644
|
+
listDealNotes: {
|
|
645
|
+
params: Omit<ListDealNotesParams, 'organizationId'>
|
|
646
|
+
result: AcqDealNote[]
|
|
647
|
+
}
|
|
648
|
+
// Deal task operations
|
|
649
|
+
createDealTask: {
|
|
650
|
+
params: Omit<CreateDealTaskParams, 'organizationId'>
|
|
651
|
+
result: AcqDealTask
|
|
652
|
+
}
|
|
653
|
+
listDealTasks: {
|
|
654
|
+
params: Omit<ListDealTasksParams, 'organizationId'>
|
|
655
|
+
result: AcqDealTask[]
|
|
656
|
+
}
|
|
657
|
+
listDealTasksDue: {
|
|
658
|
+
params: Omit<ListDealTasksDueParams, 'organizationId'>
|
|
659
|
+
result: AcqDealTask[]
|
|
660
|
+
}
|
|
661
|
+
completeDealTask: {
|
|
662
|
+
params: Omit<CompleteDealTaskParams, 'organizationId'>
|
|
663
|
+
result: AcqDealTask
|
|
664
|
+
}
|
|
665
|
+
// Deal query & analytics operations
|
|
666
|
+
listDeals: { params: DealFilters; result: AcqDeal[] }
|
|
667
|
+
getDealPipelineAnalytics: { params: { recentLimit?: number }; result: DealPipelineAnalytics }
|
|
668
|
+
// Enrichment data operations
|
|
669
|
+
mergeEnrichmentData: {
|
|
670
|
+
params: { id: string; table: 'acq_companies' | 'acq_contacts'; data: Record<string, unknown> }
|
|
671
|
+
result: void
|
|
672
|
+
}
|
|
673
|
+
// Social monitoring operations
|
|
674
|
+
upsertSocialPosts: {
|
|
675
|
+
params: { posts: Omit<UpsertSocialPostParams, 'organizationId'>[] }
|
|
676
|
+
result: UpsertSocialPostsResult
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
// ---------------------------------------------------------------------------
|
|
681
|
+
// List (platform tool, 4 methods)
|
|
682
|
+
// ---------------------------------------------------------------------------
|
|
683
|
+
|
|
684
|
+
export type ListToolMap = {
|
|
685
|
+
getConfig: { params: { listId: string }; result: ListConfig }
|
|
686
|
+
recordExecution: {
|
|
687
|
+
params: Omit<RecordListExecutionParams, 'organizationId'>
|
|
688
|
+
result: void
|
|
689
|
+
}
|
|
690
|
+
updateCompanyStage: {
|
|
691
|
+
params: Omit<UpdateCompanyStageParams, 'organizationId'>
|
|
692
|
+
result: void
|
|
693
|
+
}
|
|
694
|
+
updateContactStage: {
|
|
695
|
+
params: Omit<UpdateContactStageParams, 'organizationId'>
|
|
696
|
+
result: void
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
// ---------------------------------------------------------------------------
|
|
701
|
+
// PDF (platform tool, 2 methods)
|
|
702
|
+
// ---------------------------------------------------------------------------
|
|
703
|
+
|
|
704
|
+
export type PdfToolMap = {
|
|
705
|
+
render: {
|
|
706
|
+
params: {
|
|
707
|
+
document: Record<string, unknown>
|
|
708
|
+
theme?: Record<string, unknown>
|
|
709
|
+
storage: { bucket: string; path: string }
|
|
710
|
+
}
|
|
711
|
+
result: { success: boolean; pdfUrl: string; size: number }
|
|
712
|
+
}
|
|
713
|
+
renderToBuffer: {
|
|
714
|
+
params: {
|
|
715
|
+
document: Record<string, unknown>
|
|
716
|
+
theme?: Record<string, unknown>
|
|
717
|
+
}
|
|
718
|
+
result: { buffer: string }
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
// ---------------------------------------------------------------------------
|
|
723
|
+
// Approval (platform tool, 2 methods)
|
|
724
|
+
// ---------------------------------------------------------------------------
|
|
725
|
+
|
|
726
|
+
export type ApprovalToolMap = {
|
|
727
|
+
create: {
|
|
728
|
+
params: {
|
|
729
|
+
actions: Array<{
|
|
730
|
+
id: string
|
|
731
|
+
label: string
|
|
732
|
+
type: 'primary' | 'secondary' | 'danger' | 'outline'
|
|
733
|
+
icon?: string
|
|
734
|
+
color?: string
|
|
735
|
+
target?: { resourceType: 'agent' | 'workflow'; resourceId: string; sessionId?: string }
|
|
736
|
+
form?: Record<string, unknown>
|
|
737
|
+
requiresConfirmation?: boolean
|
|
738
|
+
confirmationMessage?: string
|
|
739
|
+
description?: string
|
|
740
|
+
}>
|
|
741
|
+
context: Record<string, unknown>
|
|
742
|
+
description?: string
|
|
743
|
+
priority?: number
|
|
744
|
+
humanCheckpoint?: string
|
|
745
|
+
metadata?: Record<string, unknown>
|
|
746
|
+
expiresAt?: string
|
|
747
|
+
idempotencyKey?: string
|
|
748
|
+
}
|
|
749
|
+
result: { id: string }
|
|
750
|
+
}
|
|
751
|
+
deleteByMetadata: {
|
|
752
|
+
params: { metadata: Record<string, unknown>; status?: string }
|
|
753
|
+
result: { deleted: number }
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
// ---------------------------------------------------------------------------
|
|
758
|
+
// Execution (platform tool, 1 method)
|
|
759
|
+
// ---------------------------------------------------------------------------
|
|
760
|
+
|
|
761
|
+
export type ExecutionToolMap = {
|
|
762
|
+
trigger: {
|
|
763
|
+
params: { resourceId: string; input?: unknown }
|
|
764
|
+
result: { success: boolean; executionId: string; output: unknown; error?: string }
|
|
765
|
+
}
|
|
766
|
+
triggerAsync: {
|
|
767
|
+
params: { resourceId: string; input?: unknown }
|
|
768
|
+
result: { executionId: string }
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
// ---------------------------------------------------------------------------
|
|
773
|
+
// Email (platform tool, 1 method)
|
|
774
|
+
// ---------------------------------------------------------------------------
|
|
775
|
+
|
|
776
|
+
export type EmailToolMap = {
|
|
777
|
+
send: {
|
|
778
|
+
params: {
|
|
779
|
+
subject: string
|
|
780
|
+
html?: string
|
|
781
|
+
text?: string
|
|
782
|
+
replyTo?: string
|
|
783
|
+
tags?: Array<{ name: string; value: string }>
|
|
784
|
+
} & (
|
|
785
|
+
| { userIds: string[]; targetRole?: never; targetAll?: never }
|
|
786
|
+
| { targetRole: string; userIds?: never; targetAll?: never }
|
|
787
|
+
| { targetAll: true; userIds?: never; targetRole?: never }
|
|
788
|
+
)
|
|
789
|
+
result: { sent: number; failed: number; errors?: Array<{ userId: string; email: string; error: string }> }
|
|
790
|
+
}
|
|
791
|
+
}
|