@dench.com/cli 2.8.7-staging.189 → 2.9.0-staging.193
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/README.md +31 -0
- package/campaign.ts +2316 -0
- package/crm-comments.ts +303 -0
- package/crm.ts +100 -19
- package/dench.ts +101 -0
- package/email.ts +6 -2
- package/lib/api-schemas.ts +793 -1
- package/lib/command-registry.ts +506 -0
- package/lib/enrichment-gateway.ts +21 -1
- package/notifications.ts +262 -0
- package/package.json +4 -1
package/lib/command-registry.ts
CHANGED
|
@@ -79,6 +79,24 @@ function op(operation: ApiOperation): ApiOperation {
|
|
|
79
79
|
return operation;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
/** `?limit=&cursor=` → Convex `paginationOpts`. */
|
|
83
|
+
function paginationOptsFrom(
|
|
84
|
+
input: Record<string, unknown>,
|
|
85
|
+
defaultLimit: number,
|
|
86
|
+
): { numItems: number; cursor: string | null } {
|
|
87
|
+
const limit =
|
|
88
|
+
typeof input.limit === "number"
|
|
89
|
+
? Math.min(Math.max(Math.floor(input.limit), 1), 100)
|
|
90
|
+
: defaultLimit;
|
|
91
|
+
return {
|
|
92
|
+
numItems: limit,
|
|
93
|
+
cursor:
|
|
94
|
+
typeof input.cursor === "string" && input.cursor.length > 0
|
|
95
|
+
? input.cursor
|
|
96
|
+
: null,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
82
100
|
function convex(
|
|
83
101
|
functionType: ConvexOperation["functionType"],
|
|
84
102
|
functionName: string,
|
|
@@ -1042,6 +1060,198 @@ const rawApiOperations = [
|
|
|
1042
1060
|
},
|
|
1043
1061
|
},
|
|
1044
1062
|
}),
|
|
1063
|
+
|
|
1064
|
+
// CRM comments — threaded conversation on a record, merged with history
|
|
1065
|
+
// into the record's Activity feed. `@Dench` in a body summons the agent.
|
|
1066
|
+
op({
|
|
1067
|
+
id: "crm.comments.list",
|
|
1068
|
+
group: "crm",
|
|
1069
|
+
summary:
|
|
1070
|
+
"List comments on a CRM entry (roots newest first, with preview replies).",
|
|
1071
|
+
cli: "dench crm comments list",
|
|
1072
|
+
method: "GET",
|
|
1073
|
+
path: "/crm/objects/{objectName}/entries/{entryId}/comments",
|
|
1074
|
+
requestSchema: noBody,
|
|
1075
|
+
responseSchema: anyResponse,
|
|
1076
|
+
backend: {
|
|
1077
|
+
...convex("query", "functions/crm/comments:listForEntry"),
|
|
1078
|
+
transformArgs: (input) => ({
|
|
1079
|
+
objectName: input.objectName,
|
|
1080
|
+
entryId: input.entryId,
|
|
1081
|
+
previewReplies:
|
|
1082
|
+
typeof input.replies === "number"
|
|
1083
|
+
? Math.min(Math.max(Math.floor(input.replies), 0), 50)
|
|
1084
|
+
: undefined,
|
|
1085
|
+
paginationOpts: paginationOptsFrom(input, 20),
|
|
1086
|
+
}),
|
|
1087
|
+
},
|
|
1088
|
+
}),
|
|
1089
|
+
op({
|
|
1090
|
+
id: "crm.comments.replies",
|
|
1091
|
+
group: "crm",
|
|
1092
|
+
summary: "List every reply under a root comment, oldest first.",
|
|
1093
|
+
cli: "dench crm comments replies",
|
|
1094
|
+
method: "GET",
|
|
1095
|
+
path: "/crm/comments/{commentId}/replies",
|
|
1096
|
+
requestSchema: noBody,
|
|
1097
|
+
responseSchema: anyResponse,
|
|
1098
|
+
backend: {
|
|
1099
|
+
...convex("query", "functions/crm/comments:listReplies"),
|
|
1100
|
+
transformArgs: (input) => ({
|
|
1101
|
+
rootCommentId: input.commentId,
|
|
1102
|
+
paginationOpts: paginationOptsFrom(input, 50),
|
|
1103
|
+
}),
|
|
1104
|
+
},
|
|
1105
|
+
}),
|
|
1106
|
+
op({
|
|
1107
|
+
id: "crm.comments.get",
|
|
1108
|
+
group: "crm",
|
|
1109
|
+
summary: "Get one comment with its entry label.",
|
|
1110
|
+
cli: "dench crm comments get",
|
|
1111
|
+
method: "GET",
|
|
1112
|
+
path: "/crm/comments/{commentId}",
|
|
1113
|
+
requestSchema: noBody,
|
|
1114
|
+
responseSchema: anyResponse,
|
|
1115
|
+
backend: convex("query", "functions/crm/comments:get"),
|
|
1116
|
+
}),
|
|
1117
|
+
op({
|
|
1118
|
+
id: "crm.comments.create",
|
|
1119
|
+
group: "crm",
|
|
1120
|
+
summary:
|
|
1121
|
+
"Comment on a CRM entry (markdown). Mention members with [@Name](/?member=<userId>); mention Dench with [@Dench](/?member=dench) or mentionDench.",
|
|
1122
|
+
cli: "dench crm comments create",
|
|
1123
|
+
method: "POST",
|
|
1124
|
+
path: "/crm/objects/{objectName}/entries/{entryId}/comments",
|
|
1125
|
+
requestSchema: anyObject,
|
|
1126
|
+
responseSchema: anyResponse,
|
|
1127
|
+
backend: convex("mutation", "functions/crm/comments:create", "bearer", {
|
|
1128
|
+
includeRunId: true,
|
|
1129
|
+
}),
|
|
1130
|
+
}),
|
|
1131
|
+
op({
|
|
1132
|
+
id: "crm.comments.update",
|
|
1133
|
+
group: "crm",
|
|
1134
|
+
summary: "Edit a comment you wrote.",
|
|
1135
|
+
cli: "dench crm comments update",
|
|
1136
|
+
method: "PATCH",
|
|
1137
|
+
path: "/crm/comments/{commentId}",
|
|
1138
|
+
requestSchema: anyObject,
|
|
1139
|
+
responseSchema: anyResponse,
|
|
1140
|
+
backend: convex("mutation", "functions/crm/comments:edit"),
|
|
1141
|
+
}),
|
|
1142
|
+
op({
|
|
1143
|
+
id: "crm.comments.delete",
|
|
1144
|
+
group: "crm",
|
|
1145
|
+
summary: "Delete a comment (kept as a tombstone when it has replies).",
|
|
1146
|
+
cli: "dench crm comments delete",
|
|
1147
|
+
method: "DELETE",
|
|
1148
|
+
path: "/crm/comments/{commentId}",
|
|
1149
|
+
requestSchema: noBody,
|
|
1150
|
+
responseSchema: anyResponse,
|
|
1151
|
+
backend: convex("mutation", "functions/crm/comments:remove"),
|
|
1152
|
+
}),
|
|
1153
|
+
op({
|
|
1154
|
+
id: "crm.comments.react",
|
|
1155
|
+
group: "crm",
|
|
1156
|
+
summary: "Toggle an emoji reaction on a comment.",
|
|
1157
|
+
cli: "dench crm comments react",
|
|
1158
|
+
method: "PUT",
|
|
1159
|
+
path: "/crm/comments/{commentId}/reactions/{emoji}",
|
|
1160
|
+
requestSchema: noBody,
|
|
1161
|
+
responseSchema: anyResponse,
|
|
1162
|
+
backend: convex("mutation", "functions/crm/comments:toggleReaction"),
|
|
1163
|
+
}),
|
|
1164
|
+
op({
|
|
1165
|
+
id: "crm.watch.get",
|
|
1166
|
+
group: "crm",
|
|
1167
|
+
summary: "Whether you follow a CRM entry's activity.",
|
|
1168
|
+
cli: "dench crm watch status",
|
|
1169
|
+
method: "GET",
|
|
1170
|
+
path: "/crm/objects/{objectName}/entries/{entryId}/watch",
|
|
1171
|
+
requestSchema: noBody,
|
|
1172
|
+
responseSchema: anyResponse,
|
|
1173
|
+
backend: {
|
|
1174
|
+
...convex("query", "functions/crm/comments:getWatchState"),
|
|
1175
|
+
transformArgs: (input) => ({ entryId: input.entryId }),
|
|
1176
|
+
},
|
|
1177
|
+
}),
|
|
1178
|
+
op({
|
|
1179
|
+
id: "crm.watch.set",
|
|
1180
|
+
group: "crm",
|
|
1181
|
+
summary: "Follow or unfollow a CRM entry's activity.",
|
|
1182
|
+
cli: "dench crm watch",
|
|
1183
|
+
method: "PUT",
|
|
1184
|
+
path: "/crm/objects/{objectName}/entries/{entryId}/watch",
|
|
1185
|
+
requestSchema: anyObject,
|
|
1186
|
+
responseSchema: anyResponse,
|
|
1187
|
+
backend: {
|
|
1188
|
+
...convex("mutation", "functions/crm/comments:setWatching"),
|
|
1189
|
+
transformArgs: (input) => ({
|
|
1190
|
+
entryId: input.entryId,
|
|
1191
|
+
watching: input.watching !== false,
|
|
1192
|
+
}),
|
|
1193
|
+
},
|
|
1194
|
+
}),
|
|
1195
|
+
|
|
1196
|
+
// CRM tasks — conveniences over the protected `task` object. Tasks are
|
|
1197
|
+
// still ordinary entries (`crm.entries.*` works on them); these add the
|
|
1198
|
+
// "mine", "for this record", complete/reopen shortcuts the app uses.
|
|
1199
|
+
op({
|
|
1200
|
+
id: "crm.tasks.mine",
|
|
1201
|
+
group: "crm",
|
|
1202
|
+
summary: "Your open tasks (plus ones completed today).",
|
|
1203
|
+
cli: "dench crm tasks mine",
|
|
1204
|
+
method: "GET",
|
|
1205
|
+
path: "/crm/tasks/mine",
|
|
1206
|
+
requestSchema: noBody,
|
|
1207
|
+
responseSchema: anyResponse,
|
|
1208
|
+
backend: convex("query", "functions/crm/tasks:listMyOpenTasks"),
|
|
1209
|
+
}),
|
|
1210
|
+
op({
|
|
1211
|
+
id: "crm.tasks.forEntry",
|
|
1212
|
+
group: "crm",
|
|
1213
|
+
summary: "Tasks linked to a CRM entry.",
|
|
1214
|
+
cli: "dench crm tasks list",
|
|
1215
|
+
method: "GET",
|
|
1216
|
+
path: "/crm/objects/{objectName}/entries/{entryId}/tasks",
|
|
1217
|
+
requestSchema: noBody,
|
|
1218
|
+
responseSchema: anyResponse,
|
|
1219
|
+
backend: convex("query", "functions/crm/tasks:listEntryTasks"),
|
|
1220
|
+
}),
|
|
1221
|
+
op({
|
|
1222
|
+
id: "crm.tasks.createForEntry",
|
|
1223
|
+
group: "crm",
|
|
1224
|
+
summary: "Create a task linked to a CRM entry.",
|
|
1225
|
+
cli: "dench crm tasks create",
|
|
1226
|
+
method: "POST",
|
|
1227
|
+
path: "/crm/objects/{objectName}/entries/{entryId}/tasks",
|
|
1228
|
+
requestSchema: anyObject,
|
|
1229
|
+
responseSchema: anyResponse,
|
|
1230
|
+
backend: convex("mutation", "functions/crm/tasks:createEntryTask"),
|
|
1231
|
+
}),
|
|
1232
|
+
op({
|
|
1233
|
+
id: "crm.tasks.complete",
|
|
1234
|
+
group: "crm",
|
|
1235
|
+
summary: "Mark a task done.",
|
|
1236
|
+
cli: "dench crm tasks complete",
|
|
1237
|
+
method: "POST",
|
|
1238
|
+
path: "/crm/tasks/{entryId}/complete",
|
|
1239
|
+
requestSchema: noBody,
|
|
1240
|
+
responseSchema: anyResponse,
|
|
1241
|
+
backend: convex("mutation", "functions/crm/tasks:completeTask"),
|
|
1242
|
+
}),
|
|
1243
|
+
op({
|
|
1244
|
+
id: "crm.tasks.reopen",
|
|
1245
|
+
group: "crm",
|
|
1246
|
+
summary: "Reopen a completed task.",
|
|
1247
|
+
cli: "dench crm tasks reopen",
|
|
1248
|
+
method: "POST",
|
|
1249
|
+
path: "/crm/tasks/{entryId}/reopen",
|
|
1250
|
+
requestSchema: noBody,
|
|
1251
|
+
responseSchema: anyResponse,
|
|
1252
|
+
backend: convex("mutation", "functions/crm/tasks:reopenTask"),
|
|
1253
|
+
}),
|
|
1254
|
+
|
|
1045
1255
|
op({
|
|
1046
1256
|
id: "crm.entries.create",
|
|
1047
1257
|
group: "crm",
|
|
@@ -2138,6 +2348,209 @@ const rawApiOperations = [
|
|
|
2138
2348
|
backend: convex("mutation", "functions/emailSequences:stopEnrollment"),
|
|
2139
2349
|
}),
|
|
2140
2350
|
|
|
2351
|
+
// Outreach campaigns (email + LinkedIn steps on one schedule): `dench campaign`.
|
|
2352
|
+
op({
|
|
2353
|
+
id: "campaigns.list",
|
|
2354
|
+
group: "campaigns",
|
|
2355
|
+
summary: "List outreach campaigns (archived ones on request).",
|
|
2356
|
+
cli: "dench campaign list",
|
|
2357
|
+
method: "GET",
|
|
2358
|
+
path: "/campaigns",
|
|
2359
|
+
requestSchema: anyObject,
|
|
2360
|
+
responseSchema: anyResponse,
|
|
2361
|
+
backend: convex("query", "functions/outreachSequences:listSequences"),
|
|
2362
|
+
}),
|
|
2363
|
+
op({
|
|
2364
|
+
id: "campaigns.create",
|
|
2365
|
+
group: "campaigns",
|
|
2366
|
+
summary:
|
|
2367
|
+
"Create a draft outreach campaign with a business-hours send window in the given timezone.",
|
|
2368
|
+
cli: "dench campaign create",
|
|
2369
|
+
method: "POST",
|
|
2370
|
+
path: "/campaigns",
|
|
2371
|
+
requestSchema: anyObject,
|
|
2372
|
+
responseSchema: anyResponse,
|
|
2373
|
+
backend: convex("mutation", "functions/outreachSequences:createSequence"),
|
|
2374
|
+
}),
|
|
2375
|
+
op({
|
|
2376
|
+
id: "campaigns.get",
|
|
2377
|
+
group: "campaigns",
|
|
2378
|
+
summary:
|
|
2379
|
+
"Read a campaign: settings, steps, people, their current step and hold, last touches, linked leads.",
|
|
2380
|
+
cli: "dench campaign get",
|
|
2381
|
+
method: "GET",
|
|
2382
|
+
path: "/campaigns/{sequenceId}",
|
|
2383
|
+
requestSchema: anyObject,
|
|
2384
|
+
responseSchema: anyResponse,
|
|
2385
|
+
backend: convex("query", "functions/outreachSequences:getSequence"),
|
|
2386
|
+
}),
|
|
2387
|
+
op({
|
|
2388
|
+
id: "campaigns.analytics",
|
|
2389
|
+
group: "campaigns",
|
|
2390
|
+
summary:
|
|
2391
|
+
"Campaign funnel: enrolled, contacted, invited, accepted, messaged, replied, opens and clicks.",
|
|
2392
|
+
cli: "dench campaign get",
|
|
2393
|
+
method: "GET",
|
|
2394
|
+
path: "/campaigns/{sequenceId}/analytics",
|
|
2395
|
+
requestSchema: anyObject,
|
|
2396
|
+
responseSchema: anyResponse,
|
|
2397
|
+
backend: convex(
|
|
2398
|
+
"query",
|
|
2399
|
+
"functions/outreachSequences:getSequenceAnalytics",
|
|
2400
|
+
),
|
|
2401
|
+
}),
|
|
2402
|
+
op({
|
|
2403
|
+
id: "campaigns.live",
|
|
2404
|
+
group: "campaigns",
|
|
2405
|
+
summary:
|
|
2406
|
+
"What the campaign is doing now, what comes next and when, and why it is holding.",
|
|
2407
|
+
cli: "dench campaign get",
|
|
2408
|
+
method: "GET",
|
|
2409
|
+
path: "/campaigns/{sequenceId}/live",
|
|
2410
|
+
requestSchema: anyObject,
|
|
2411
|
+
responseSchema: anyResponse,
|
|
2412
|
+
backend: convex("query", "functions/outreachSequences:getSequenceLive"),
|
|
2413
|
+
}),
|
|
2414
|
+
op({
|
|
2415
|
+
id: "campaigns.update",
|
|
2416
|
+
group: "campaigns",
|
|
2417
|
+
summary:
|
|
2418
|
+
"Change a campaign's name, send windows, daily email cap, stop-on-reply, start or end. Works until archived.",
|
|
2419
|
+
cli: "dench campaign set",
|
|
2420
|
+
method: "PATCH",
|
|
2421
|
+
path: "/campaigns/{sequenceId}",
|
|
2422
|
+
requestSchema: anyObject,
|
|
2423
|
+
responseSchema: anyResponse,
|
|
2424
|
+
backend: convex("mutation", "functions/outreachSequences:updateDraft"),
|
|
2425
|
+
}),
|
|
2426
|
+
op({
|
|
2427
|
+
id: "campaigns.steps.replace",
|
|
2428
|
+
group: "campaigns",
|
|
2429
|
+
summary:
|
|
2430
|
+
"Replace every step of a draft campaign (email, wait, LinkedIn visit, connection request, message).",
|
|
2431
|
+
cli: "dench campaign steps set",
|
|
2432
|
+
method: "PUT",
|
|
2433
|
+
path: "/campaigns/{sequenceId}/steps",
|
|
2434
|
+
requestSchema: anyObject,
|
|
2435
|
+
responseSchema: anyResponse,
|
|
2436
|
+
backend: convex("mutation", "functions/outreachSequences:replaceSteps"),
|
|
2437
|
+
}),
|
|
2438
|
+
op({
|
|
2439
|
+
id: "campaigns.people.addFromCrm",
|
|
2440
|
+
group: "campaigns",
|
|
2441
|
+
summary:
|
|
2442
|
+
"Add CRM records (up to 100 ids per call) to a campaign; returns how many were added and why others were skipped.",
|
|
2443
|
+
cli: "dench campaign add",
|
|
2444
|
+
method: "POST",
|
|
2445
|
+
path: "/campaigns/{sequenceId}/people",
|
|
2446
|
+
requestSchema: anyObject,
|
|
2447
|
+
responseSchema: anyResponse,
|
|
2448
|
+
backend: convex("mutation", "functions/outreachSequences:enrollFromCrm"),
|
|
2449
|
+
}),
|
|
2450
|
+
op({
|
|
2451
|
+
id: "campaigns.people.add",
|
|
2452
|
+
group: "campaigns",
|
|
2453
|
+
summary: "Add one person by email and/or LinkedIn profile URL.",
|
|
2454
|
+
cli: "dench campaign add --name",
|
|
2455
|
+
method: "POST",
|
|
2456
|
+
path: "/campaigns/{sequenceId}/person",
|
|
2457
|
+
requestSchema: anyObject,
|
|
2458
|
+
responseSchema: anyResponse,
|
|
2459
|
+
backend: convex("mutation", "functions/outreachSequences:addEnrollment"),
|
|
2460
|
+
}),
|
|
2461
|
+
op({
|
|
2462
|
+
id: "campaigns.launch.preview",
|
|
2463
|
+
group: "campaigns",
|
|
2464
|
+
summary:
|
|
2465
|
+
"Launch readiness: blockers grouped by problem, warnings, and the fingerprint `launch` requires.",
|
|
2466
|
+
cli: "dench campaign launch",
|
|
2467
|
+
method: "GET",
|
|
2468
|
+
path: "/campaigns/{sequenceId}/launch",
|
|
2469
|
+
requestSchema: anyObject,
|
|
2470
|
+
responseSchema: anyResponse,
|
|
2471
|
+
backend: convex("query", "functions/outreachSequences:previewLaunch"),
|
|
2472
|
+
}),
|
|
2473
|
+
op({
|
|
2474
|
+
id: "campaigns.launch",
|
|
2475
|
+
group: "campaigns",
|
|
2476
|
+
summary:
|
|
2477
|
+
"Launch a ready draft. Pass the fingerprint from the preview and acknowledge the LinkedIn notice when LinkedIn steps exist.",
|
|
2478
|
+
cli: "dench campaign launch",
|
|
2479
|
+
method: "POST",
|
|
2480
|
+
path: "/campaigns/{sequenceId}/launch",
|
|
2481
|
+
requestSchema: anyObject,
|
|
2482
|
+
responseSchema: anyResponse,
|
|
2483
|
+
backend: convex("mutation", "functions/outreachSequences:launch"),
|
|
2484
|
+
}),
|
|
2485
|
+
op({
|
|
2486
|
+
id: "campaigns.pause",
|
|
2487
|
+
group: "campaigns",
|
|
2488
|
+
summary: "Pause an active campaign.",
|
|
2489
|
+
cli: "dench campaign pause",
|
|
2490
|
+
method: "POST",
|
|
2491
|
+
path: "/campaigns/{sequenceId}/pause",
|
|
2492
|
+
requestSchema: anyObject,
|
|
2493
|
+
responseSchema: anyResponse,
|
|
2494
|
+
backend: convex("mutation", "functions/outreachSequences:pauseSequence"),
|
|
2495
|
+
}),
|
|
2496
|
+
op({
|
|
2497
|
+
id: "campaigns.resume",
|
|
2498
|
+
group: "campaigns",
|
|
2499
|
+
summary: "Resume a paused campaign.",
|
|
2500
|
+
cli: "dench campaign resume",
|
|
2501
|
+
method: "POST",
|
|
2502
|
+
path: "/campaigns/{sequenceId}/resume",
|
|
2503
|
+
requestSchema: anyObject,
|
|
2504
|
+
responseSchema: anyResponse,
|
|
2505
|
+
backend: convex("mutation", "functions/outreachSequences:resumeSequence"),
|
|
2506
|
+
}),
|
|
2507
|
+
op({
|
|
2508
|
+
id: "campaigns.archive",
|
|
2509
|
+
group: "campaigns",
|
|
2510
|
+
summary: "Archive a campaign and stop everyone still in flight.",
|
|
2511
|
+
cli: "dench campaign archive",
|
|
2512
|
+
method: "POST",
|
|
2513
|
+
path: "/campaigns/{sequenceId}/archive",
|
|
2514
|
+
requestSchema: anyObject,
|
|
2515
|
+
responseSchema: anyResponse,
|
|
2516
|
+
backend: convex("mutation", "functions/outreachSequences:archiveSequence"),
|
|
2517
|
+
}),
|
|
2518
|
+
op({
|
|
2519
|
+
id: "campaigns.events",
|
|
2520
|
+
group: "campaigns",
|
|
2521
|
+
summary:
|
|
2522
|
+
"The campaign's activity log, newest first (sent, accepted, replied, skipped, failed, paused, stopped).",
|
|
2523
|
+
cli: "dench campaign events",
|
|
2524
|
+
method: "GET",
|
|
2525
|
+
path: "/campaigns/{sequenceId}/events",
|
|
2526
|
+
requestSchema: anyObject,
|
|
2527
|
+
responseSchema: anyResponse,
|
|
2528
|
+
backend: convex("query", "functions/outreachSequences:listSequenceEvents"),
|
|
2529
|
+
}),
|
|
2530
|
+
op({
|
|
2531
|
+
id: "campaigns.people.stop",
|
|
2532
|
+
group: "campaigns",
|
|
2533
|
+
summary:
|
|
2534
|
+
"Stop one person: nothing more is sent to them from this campaign.",
|
|
2535
|
+
cli: "dench campaign stop",
|
|
2536
|
+
method: "POST",
|
|
2537
|
+
path: "/campaigns/people/{enrollmentId}/stop",
|
|
2538
|
+
requestSchema: anyObject,
|
|
2539
|
+
responseSchema: anyResponse,
|
|
2540
|
+
backend: convex("mutation", "functions/outreachSequences:stopEnrollment"),
|
|
2541
|
+
}),
|
|
2542
|
+
op({
|
|
2543
|
+
id: "campaigns.people.resume",
|
|
2544
|
+
group: "campaigns",
|
|
2545
|
+
summary: "Resume one paused person in an active campaign.",
|
|
2546
|
+
cli: "dench campaign resume-person",
|
|
2547
|
+
method: "POST",
|
|
2548
|
+
path: "/campaigns/people/{enrollmentId}/resume",
|
|
2549
|
+
requestSchema: anyObject,
|
|
2550
|
+
responseSchema: anyResponse,
|
|
2551
|
+
backend: convex("mutation", "functions/outreachSequences:resumeEnrollment"),
|
|
2552
|
+
}),
|
|
2553
|
+
|
|
2141
2554
|
// Routines.
|
|
2142
2555
|
op({
|
|
2143
2556
|
id: "cron.list",
|
|
@@ -2981,6 +3394,99 @@ const rawApiOperations = [
|
|
|
2981
3394
|
responseSchema: anyResponse,
|
|
2982
3395
|
backend: convex("query", "functions/agentConfig:getAgentConfig"),
|
|
2983
3396
|
}),
|
|
3397
|
+
|
|
3398
|
+
// Notifications — the signed-in member's inbox (the bell). Agent sessions
|
|
3399
|
+
// read their owner's inbox; an org API key with no person behind it is
|
|
3400
|
+
// refused by the backend.
|
|
3401
|
+
op({
|
|
3402
|
+
id: "notifications.list",
|
|
3403
|
+
group: "notifications",
|
|
3404
|
+
summary: "List your notifications (inbox, unread, archived, or all).",
|
|
3405
|
+
cli: "dench notifications list",
|
|
3406
|
+
method: "GET",
|
|
3407
|
+
path: "/notifications",
|
|
3408
|
+
requestSchema: noBody,
|
|
3409
|
+
responseSchema: anyResponse,
|
|
3410
|
+
backend: convex("query", "functions/notifications:listMyNotifications"),
|
|
3411
|
+
}),
|
|
3412
|
+
op({
|
|
3413
|
+
id: "notifications.unreadCount",
|
|
3414
|
+
group: "notifications",
|
|
3415
|
+
summary: "How many unread notifications you have.",
|
|
3416
|
+
cli: "dench notifications count",
|
|
3417
|
+
method: "GET",
|
|
3418
|
+
path: "/notifications/unread-count",
|
|
3419
|
+
requestSchema: noBody,
|
|
3420
|
+
responseSchema: anyResponse,
|
|
3421
|
+
backend: convex("query", "functions/notifications:unreadCount"),
|
|
3422
|
+
}),
|
|
3423
|
+
op({
|
|
3424
|
+
id: "notifications.read",
|
|
3425
|
+
group: "notifications",
|
|
3426
|
+
summary: "Mark a notification read (or unread).",
|
|
3427
|
+
cli: "dench notifications read",
|
|
3428
|
+
method: "PATCH",
|
|
3429
|
+
path: "/notifications/{notificationId}",
|
|
3430
|
+
requestSchema: anyObject,
|
|
3431
|
+
responseSchema: anyResponse,
|
|
3432
|
+
backend: {
|
|
3433
|
+
...convex("mutation", "functions/notifications:setNotificationRead"),
|
|
3434
|
+
transformArgs: (input) => ({
|
|
3435
|
+
notificationId: input.notificationId,
|
|
3436
|
+
read: input.read !== false,
|
|
3437
|
+
}),
|
|
3438
|
+
},
|
|
3439
|
+
}),
|
|
3440
|
+
op({
|
|
3441
|
+
id: "notifications.readAll",
|
|
3442
|
+
group: "notifications",
|
|
3443
|
+
summary: "Mark every inbox notification read.",
|
|
3444
|
+
cli: "dench notifications read-all",
|
|
3445
|
+
method: "POST",
|
|
3446
|
+
path: "/notifications/read-all",
|
|
3447
|
+
requestSchema: noBody,
|
|
3448
|
+
responseSchema: anyResponse,
|
|
3449
|
+
backend: convex("mutation", "functions/notifications:markAllRead"),
|
|
3450
|
+
}),
|
|
3451
|
+
op({
|
|
3452
|
+
id: "notifications.archive",
|
|
3453
|
+
group: "notifications",
|
|
3454
|
+
summary: "Archive a notification.",
|
|
3455
|
+
cli: "dench notifications archive",
|
|
3456
|
+
method: "POST",
|
|
3457
|
+
path: "/notifications/{notificationId}/archive",
|
|
3458
|
+
requestSchema: noBody,
|
|
3459
|
+
responseSchema: anyResponse,
|
|
3460
|
+
backend: convex("mutation", "functions/notifications:archiveNotification"),
|
|
3461
|
+
}),
|
|
3462
|
+
op({
|
|
3463
|
+
id: "notifications.preferences.get",
|
|
3464
|
+
group: "notifications",
|
|
3465
|
+
summary: "Read your notification preferences.",
|
|
3466
|
+
cli: "dench notifications prefs",
|
|
3467
|
+
method: "GET",
|
|
3468
|
+
path: "/notifications/preferences",
|
|
3469
|
+
requestSchema: noBody,
|
|
3470
|
+
responseSchema: anyResponse,
|
|
3471
|
+
backend: convex(
|
|
3472
|
+
"query",
|
|
3473
|
+
"functions/notifications:getMyNotificationPreferences",
|
|
3474
|
+
),
|
|
3475
|
+
}),
|
|
3476
|
+
op({
|
|
3477
|
+
id: "notifications.preferences.update",
|
|
3478
|
+
group: "notifications",
|
|
3479
|
+
summary: "Update your notification preferences.",
|
|
3480
|
+
cli: "dench notifications prefs --set",
|
|
3481
|
+
method: "PATCH",
|
|
3482
|
+
path: "/notifications/preferences",
|
|
3483
|
+
requestSchema: anyObject,
|
|
3484
|
+
responseSchema: anyResponse,
|
|
3485
|
+
backend: convex(
|
|
3486
|
+
"mutation",
|
|
3487
|
+
"functions/notifications:updateMyNotificationPreferences",
|
|
3488
|
+
),
|
|
3489
|
+
}),
|
|
2984
3490
|
] as const satisfies readonly ApiOperation[];
|
|
2985
3491
|
|
|
2986
3492
|
/**
|
|
@@ -240,6 +240,12 @@ export type ApolloPersonEnvelope = {
|
|
|
240
240
|
title?: string;
|
|
241
241
|
headline?: string;
|
|
242
242
|
location?: string;
|
|
243
|
+
organization?: {
|
|
244
|
+
name?: string;
|
|
245
|
+
domain?: string;
|
|
246
|
+
website_url?: string;
|
|
247
|
+
};
|
|
248
|
+
organization_name?: string;
|
|
243
249
|
contact: {
|
|
244
250
|
phone_numbers: Array<{
|
|
245
251
|
sanitized_number: string;
|
|
@@ -258,6 +264,9 @@ type EnrichedPersonUpsertLike = {
|
|
|
258
264
|
currentTitle?: string;
|
|
259
265
|
linkedinID?: string;
|
|
260
266
|
location?: string;
|
|
267
|
+
locationName?: string;
|
|
268
|
+
currentCompanyName?: string;
|
|
269
|
+
currentCompanyWebsite?: string;
|
|
261
270
|
emails?: Array<{
|
|
262
271
|
address?: string;
|
|
263
272
|
normalizedAddress?: string;
|
|
@@ -272,6 +281,8 @@ function shapePersonToApolloEnvelope(
|
|
|
272
281
|
const workEmail = u.emails?.find((e) => e.type === "work")?.address;
|
|
273
282
|
const personalEmail = u.emails?.find((e) => e.type === "personal")?.address;
|
|
274
283
|
const anyEmail = u.emails?.[0]?.address;
|
|
284
|
+
const companyName = u.currentCompanyName;
|
|
285
|
+
const companyWebsite = u.currentCompanyWebsite;
|
|
275
286
|
return {
|
|
276
287
|
person: {
|
|
277
288
|
name: u.fullName,
|
|
@@ -285,7 +296,16 @@ function shapePersonToApolloEnvelope(
|
|
|
285
296
|
: undefined,
|
|
286
297
|
title: u.currentTitle,
|
|
287
298
|
headline: u.headline,
|
|
288
|
-
location: u.location,
|
|
299
|
+
location: u.location ?? u.locationName,
|
|
300
|
+
organization:
|
|
301
|
+
companyName || companyWebsite
|
|
302
|
+
? {
|
|
303
|
+
name: companyName,
|
|
304
|
+
domain: companyWebsite,
|
|
305
|
+
website_url: companyWebsite,
|
|
306
|
+
}
|
|
307
|
+
: undefined,
|
|
308
|
+
organization_name: companyName,
|
|
289
309
|
contact: {
|
|
290
310
|
phone_numbers: (u.phones ?? []).map((p) => ({
|
|
291
311
|
sanitized_number: p.normalizedNumber ?? p.number ?? "",
|