@dench.com/cli 3.12.25-staging.1397 → 3.12.26-staging.1399
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/app-sdk.d.ts +31 -0
- package/campaign.ts +68 -3
- package/lib/api-schemas.ts +54 -0
- package/lib/app-sdk-catalog.generated.ts +2 -0
- package/lib/app-sdk-surface.ts +6 -0
- package/lib/command-registry.ts +12 -0
- package/lib/references.generated.json +6 -6
- package/package.json +1 -1
package/app-sdk.d.ts
CHANGED
|
@@ -2872,6 +2872,8 @@ export interface ApiRequests {
|
|
|
2872
2872
|
};
|
|
2873
2873
|
/** Discover the mailboxes the acting workspace member can send campaign email from: ids for emailMailboxAccountIds, status, warm-up state and when it is done, the daily cold-email cap and what is left today. Never returns provider credentials. — `dench campaign accounts` — GET /api/v1/campaigns/accounts/email */
|
|
2874
2874
|
"campaigns.accounts.email": Record<string, unknown>;
|
|
2875
|
+
/** Discover the connected X (Twitter) accounts the acting workspace member can send X campaigns from: ids for xAccountIds, handle, status, visibility, sync summary and daily safety limits. Never returns provider credentials. — `dench campaign accounts` — GET /api/v1/campaigns/accounts/x */
|
|
2876
|
+
"campaigns.accounts.x": Record<string, unknown>;
|
|
2875
2877
|
/** List outreach campaigns of every kind on the Campaigns page, each with its kind (archived ones on request). — `dench campaign list [--with-references]` — GET /api/v1/campaigns */
|
|
2876
2878
|
"campaigns.list": {
|
|
2877
2879
|
/** Include bounded navigation references. Array reads return {data, references, referenceCoverage}; existing result envelopes keep their fields. */
|
|
@@ -7082,6 +7084,31 @@ export interface ApiResponses {
|
|
|
7082
7084
|
visibility: "private" | "shared";
|
|
7083
7085
|
[key: string]: unknown;
|
|
7084
7086
|
}>;
|
|
7087
|
+
"campaigns.accounts.x": Array<{
|
|
7088
|
+
/** The xAccountId to put in xAccountIds. */
|
|
7089
|
+
_id: string;
|
|
7090
|
+
xUserId: string;
|
|
7091
|
+
/** X handle without leading @. */
|
|
7092
|
+
username: string;
|
|
7093
|
+
displayName: string;
|
|
7094
|
+
status: "running" | "disconnected" | "errored" | "removed";
|
|
7095
|
+
visibility: "private" | "shared";
|
|
7096
|
+
isOwner: boolean;
|
|
7097
|
+
ownerName?: string;
|
|
7098
|
+
followersCount?: number;
|
|
7099
|
+
followingCount?: number;
|
|
7100
|
+
usageToday?: {
|
|
7101
|
+
followsUsed: number;
|
|
7102
|
+
likesUsed: number;
|
|
7103
|
+
repliesUsed: number;
|
|
7104
|
+
dmsUsed: number;
|
|
7105
|
+
followsLimit: number;
|
|
7106
|
+
likesLimit: number;
|
|
7107
|
+
repliesLimit: number;
|
|
7108
|
+
dmsLimit: number;
|
|
7109
|
+
};
|
|
7110
|
+
[key: string]: unknown;
|
|
7111
|
+
}>;
|
|
7085
7112
|
"campaigns.list": Array<{
|
|
7086
7113
|
_id: string;
|
|
7087
7114
|
name: string;
|
|
@@ -9109,6 +9136,8 @@ export type DenchApiTree = {
|
|
|
9109
9136
|
email(args?: Req<"campaigns.accounts.email">): Promise<Res<"campaigns.accounts.email">>;
|
|
9110
9137
|
/** Discover LinkedIn sender ids, labels, availability and remaining capacity visible to the acting workspace member. Never returns provider credentials. (`dench campaign accounts`) */
|
|
9111
9138
|
linkedin(args?: Req<"campaigns.accounts.linkedin">): Promise<Res<"campaigns.accounts.linkedin">>;
|
|
9139
|
+
/** Discover the connected X (Twitter) accounts the acting workspace member can send X campaigns from: ids for xAccountIds, handle, status, visibility, sync summary and daily safety limits. Never returns provider credentials. (`dench campaign accounts`) */
|
|
9140
|
+
x(args?: Req<"campaigns.accounts.x">): Promise<Res<"campaigns.accounts.x">>;
|
|
9112
9141
|
};
|
|
9113
9142
|
/** Campaign funnel: enrolled, contacted, invited, accepted, messaged, replied, opens and clicks, and for a workflow how many people took each If / else and Wait for them to accept path (branchStats). (`dench campaign get`) */
|
|
9114
9143
|
analytics(args: Req<"campaigns.analytics">): Promise<Res<"campaigns.analytics">>;
|
|
@@ -10493,6 +10522,8 @@ export interface DenchCampaigns {
|
|
|
10493
10522
|
mailboxes(): Promise<Res<"campaigns.accounts.email">>;
|
|
10494
10523
|
/** LinkedIn accounts campaigns can send from, with capacity. Permission: `campaigns:read`. Wraps `campaigns.accounts.linkedin`. */
|
|
10495
10524
|
linkedinAccounts(): Promise<Res<"campaigns.accounts.linkedin">>;
|
|
10525
|
+
/** Connected X accounts campaigns can send from, with daily limits. Permission: `campaigns:read`. Wraps `campaigns.accounts.x`. */
|
|
10526
|
+
xAccounts(): Promise<Res<"campaigns.accounts.x">>;
|
|
10496
10527
|
/** LinkedIn / multi-channel outreach campaigns. Permission: `campaigns:read`. Wraps `campaigns.list`. */
|
|
10497
10528
|
list(): Promise<Res<"campaigns.list">>;
|
|
10498
10529
|
/** One campaign. Permission: `campaigns:read`. Wraps `campaigns.get`. */
|
package/campaign.ts
CHANGED
|
@@ -4358,16 +4358,38 @@ function remainingCapacity(value: unknown): number | null {
|
|
|
4358
4358
|
: null;
|
|
4359
4359
|
}
|
|
4360
4360
|
|
|
4361
|
+
type XSenderRow = {
|
|
4362
|
+
_id: string;
|
|
4363
|
+
xUserId?: string;
|
|
4364
|
+
username?: string;
|
|
4365
|
+
displayName?: string;
|
|
4366
|
+
status?: string;
|
|
4367
|
+
ownerName?: string;
|
|
4368
|
+
isOwner?: boolean;
|
|
4369
|
+
visibility?: string;
|
|
4370
|
+
usageToday?: {
|
|
4371
|
+
followsUsed?: number;
|
|
4372
|
+
likesUsed?: number;
|
|
4373
|
+
repliesUsed?: number;
|
|
4374
|
+
dmsUsed?: number;
|
|
4375
|
+
followsLimit?: number;
|
|
4376
|
+
likesLimit?: number;
|
|
4377
|
+
repliesLimit?: number;
|
|
4378
|
+
dmsLimit?: number;
|
|
4379
|
+
};
|
|
4380
|
+
};
|
|
4381
|
+
|
|
4361
4382
|
/**
|
|
4362
|
-
* The sending accounts a pool (or legacy step) can name.
|
|
4383
|
+
* The sending accounts a pool (or legacy step) can name. All queries accept
|
|
4363
4384
|
* the CLI token and scope to the acting member's usable connections. Never
|
|
4364
|
-
* fall back to
|
|
4385
|
+
* fall back to browser-only settings queries or provider credentials.
|
|
4365
4386
|
*/
|
|
4366
4387
|
async function runAccounts(ctx: CampaignCliContext): Promise<void> {
|
|
4367
4388
|
unknownFlags(ctx.args, "campaign accounts");
|
|
4368
|
-
const [rows, linkedinRows] = await Promise.all([
|
|
4389
|
+
const [rows, linkedinRows, xRows] = await Promise.all([
|
|
4369
4390
|
callQuery(ctx, "functions/emailMailboxAccounts:listAccounts", {}),
|
|
4370
4391
|
callQuery(ctx, "functions/linkedinAccounts:listSenderAccounts", {}),
|
|
4392
|
+
callQuery(ctx, "functions/xAccounts:listAccounts", {}).catch(() => []),
|
|
4371
4393
|
]);
|
|
4372
4394
|
const mailboxes = (Array.isArray(rows) ? (rows as MailboxRow[]) : []).map(
|
|
4373
4395
|
(row) => ({
|
|
@@ -4431,6 +4453,48 @@ async function runAccounts(ctx: CampaignCliContext): Promise<void> {
|
|
|
4431
4453
|
" none — connect LinkedIn under Outreach → Accounts in the Dench app",
|
|
4432
4454
|
);
|
|
4433
4455
|
}
|
|
4456
|
+
const xAccounts = (Array.isArray(xRows) ? (xRows as XSenderRow[]) : []).map(
|
|
4457
|
+
(row) => ({
|
|
4458
|
+
xAccountId: row._id,
|
|
4459
|
+
username: row.username ?? null,
|
|
4460
|
+
handle: row.username ? `@${row.username}` : null,
|
|
4461
|
+
displayName:
|
|
4462
|
+
row.displayName ?? (row.username ? `@${row.username}` : "X account"),
|
|
4463
|
+
status: row.status ?? null,
|
|
4464
|
+
ownerName: row.ownerName ?? null,
|
|
4465
|
+
isOwner: row.isOwner === true,
|
|
4466
|
+
visibility: row.visibility ?? null,
|
|
4467
|
+
remainingToday: {
|
|
4468
|
+
follows: remainingCapacity(
|
|
4469
|
+
(row.usageToday?.followsLimit ?? 25) -
|
|
4470
|
+
(row.usageToday?.followsUsed ?? 0),
|
|
4471
|
+
),
|
|
4472
|
+
likes: remainingCapacity(
|
|
4473
|
+
(row.usageToday?.likesLimit ?? 30) - (row.usageToday?.likesUsed ?? 0),
|
|
4474
|
+
),
|
|
4475
|
+
replies: remainingCapacity(
|
|
4476
|
+
(row.usageToday?.repliesLimit ?? 15) -
|
|
4477
|
+
(row.usageToday?.repliesUsed ?? 0),
|
|
4478
|
+
),
|
|
4479
|
+
dms: remainingCapacity(
|
|
4480
|
+
(row.usageToday?.dmsLimit ?? 25) - (row.usageToday?.dmsUsed ?? 0),
|
|
4481
|
+
),
|
|
4482
|
+
},
|
|
4483
|
+
}),
|
|
4484
|
+
);
|
|
4485
|
+
lines.push(
|
|
4486
|
+
"",
|
|
4487
|
+
`X accounts (${xAccounts.length}) — use these ids with --x-accounts:`,
|
|
4488
|
+
...xAccounts.map((account) => {
|
|
4489
|
+
const rem = account.remainingToday;
|
|
4490
|
+
return ` ${account.handle ?? account.displayName} — ${account.status ?? "unknown"} · ${rem.follows ?? "?"} follows, ${rem.likes ?? "?"} likes, ${rem.replies ?? "?"} replies, ${rem.dms ?? "?"} DMs remaining today${account.ownerName && !account.isOwner ? ` · ${account.ownerName}` : ""}${account.visibility === "private" ? " · private" : ""} [${account.xAccountId}]`;
|
|
4491
|
+
}),
|
|
4492
|
+
);
|
|
4493
|
+
if (xAccounts.length === 0) {
|
|
4494
|
+
lines.push(
|
|
4495
|
+
" none — connect X under Integrations → Your accounts in the Dench app",
|
|
4496
|
+
);
|
|
4497
|
+
}
|
|
4434
4498
|
const note =
|
|
4435
4499
|
"Capacity is a usage snapshot before queued work and campaign limits. A mailbox's daily cap and warm-up, and a LinkedIn account's limits and hours, are set by its owner in the Dench app. Pool changes require access for both you and the campaign owner; launch and dispatch revalidate availability.";
|
|
4436
4500
|
lines.push("", note);
|
|
@@ -4439,6 +4503,7 @@ async function runAccounts(ctx: CampaignCliContext): Promise<void> {
|
|
|
4439
4503
|
{
|
|
4440
4504
|
mailboxes,
|
|
4441
4505
|
linkedinAccounts,
|
|
4506
|
+
xAccounts,
|
|
4442
4507
|
note,
|
|
4443
4508
|
},
|
|
4444
4509
|
lines,
|
package/lib/api-schemas.ts
CHANGED
|
@@ -666,6 +666,34 @@ const campaignMailboxSummary = z
|
|
|
666
666
|
.passthrough()
|
|
667
667
|
.describe("One mailbox a campaign can send from.");
|
|
668
668
|
|
|
669
|
+
const campaignXAccountSummary = z
|
|
670
|
+
.object({
|
|
671
|
+
_id: z.string().describe("The xAccountId to put in xAccountIds."),
|
|
672
|
+
xUserId: z.string(),
|
|
673
|
+
username: z.string().describe("X handle without leading @."),
|
|
674
|
+
displayName: z.string(),
|
|
675
|
+
status: z.enum(["running", "disconnected", "errored", "removed"]),
|
|
676
|
+
visibility: z.enum(["private", "shared"]),
|
|
677
|
+
isOwner: z.boolean(),
|
|
678
|
+
ownerName: z.string().optional(),
|
|
679
|
+
followersCount: z.number().optional(),
|
|
680
|
+
followingCount: z.number().optional(),
|
|
681
|
+
usageToday: z
|
|
682
|
+
.object({
|
|
683
|
+
followsUsed: z.number(),
|
|
684
|
+
likesUsed: z.number(),
|
|
685
|
+
repliesUsed: z.number(),
|
|
686
|
+
dmsUsed: z.number(),
|
|
687
|
+
followsLimit: z.number(),
|
|
688
|
+
likesLimit: z.number(),
|
|
689
|
+
repliesLimit: z.number(),
|
|
690
|
+
dmsLimit: z.number(),
|
|
691
|
+
})
|
|
692
|
+
.optional(),
|
|
693
|
+
})
|
|
694
|
+
.passthrough()
|
|
695
|
+
.describe("One connected X account a campaign can send from.");
|
|
696
|
+
|
|
669
697
|
const campaignLinkedinSenderSummary = z
|
|
670
698
|
.object({
|
|
671
699
|
linkedinAccountId: z
|
|
@@ -3682,6 +3710,7 @@ export const requestSchemas: Record<string, ZodTypeAny> = {
|
|
|
3682
3710
|
})
|
|
3683
3711
|
.strict(),
|
|
3684
3712
|
"campaigns.accounts.email": noInput,
|
|
3713
|
+
"campaigns.accounts.x": noInput,
|
|
3685
3714
|
"campaigns.list": z.object({
|
|
3686
3715
|
...withReferencesRequest,
|
|
3687
3716
|
includeArchived: z
|
|
@@ -5962,6 +5991,7 @@ export const responseSchemas: Record<string, ZodTypeAny> = {
|
|
|
5962
5991
|
})
|
|
5963
5992
|
.passthrough(),
|
|
5964
5993
|
"campaigns.accounts.email": z.array(campaignMailboxSummary),
|
|
5994
|
+
"campaigns.accounts.x": z.array(campaignXAccountSummary),
|
|
5965
5995
|
"campaigns.list": referenceListResponse(campaignListRow),
|
|
5966
5996
|
"campaigns.create": z.object({
|
|
5967
5997
|
sequenceId: z.string(),
|
|
@@ -7991,6 +8021,30 @@ export const responseExamples: Record<string, unknown> = {
|
|
|
7991
8021
|
visibility: "shared",
|
|
7992
8022
|
},
|
|
7993
8023
|
],
|
|
8024
|
+
"campaigns.accounts.x": [
|
|
8025
|
+
{
|
|
8026
|
+
_id: "<xAccountId>",
|
|
8027
|
+
xUserId: "1234567890",
|
|
8028
|
+
username: "ada",
|
|
8029
|
+
displayName: "Ada Lovelace",
|
|
8030
|
+
status: "running",
|
|
8031
|
+
visibility: "private",
|
|
8032
|
+
isOwner: true,
|
|
8033
|
+
ownerName: "Ada",
|
|
8034
|
+
followersCount: 1200,
|
|
8035
|
+
followingCount: 340,
|
|
8036
|
+
usageToday: {
|
|
8037
|
+
followsUsed: 0,
|
|
8038
|
+
likesUsed: 0,
|
|
8039
|
+
repliesUsed: 0,
|
|
8040
|
+
dmsUsed: 0,
|
|
8041
|
+
followsLimit: 25,
|
|
8042
|
+
likesLimit: 30,
|
|
8043
|
+
repliesLimit: 15,
|
|
8044
|
+
dmsLimit: 25,
|
|
8045
|
+
},
|
|
8046
|
+
},
|
|
8047
|
+
],
|
|
7994
8048
|
"campaigns.accounts.linkedin": [
|
|
7995
8049
|
{
|
|
7996
8050
|
linkedinAccountId: "<linkedinAccountId>",
|
|
@@ -395,6 +395,7 @@ export const APP_SDK_OPERATIONS: readonly AppSdkOperationInfo[] = [
|
|
|
395
395
|
{"id":"campaigns.accounts.linkedin","group":"campaigns","summary":"Discover LinkedIn sender ids, labels, availability and remaining capacity visible to the acting workspace member. Never returns provider credentials.","cli":"dench campaign accounts","method":"GET","path":"/campaigns/accounts/linkedin","permission":"campaigns:read","pathParams":[]},
|
|
396
396
|
{"id":"campaigns.linkedin.send","group":"campaigns","summary":"Send one LinkedIn message now as the acting member, like the Inbox's Send button: not paced, 1st-degree connections only. Only use for an explicit send request.","cli":"dench campaign linkedin send","method":"POST","path":"/campaigns/linkedin/messages","permission":"campaigns:write","pathParams":[]},
|
|
397
397
|
{"id":"campaigns.accounts.email","group":"campaigns","summary":"Discover the mailboxes the acting workspace member can send campaign email from: ids for emailMailboxAccountIds, status, warm-up state and when it is done, the daily cold-email cap and what is left today. Never returns provider credentials.","cli":"dench campaign accounts","method":"GET","path":"/campaigns/accounts/email","permission":"campaigns:read","pathParams":[]},
|
|
398
|
+
{"id":"campaigns.accounts.x","group":"campaigns","summary":"Discover the connected X (Twitter) accounts the acting workspace member can send X campaigns from: ids for xAccountIds, handle, status, visibility, sync summary and daily safety limits. Never returns provider credentials.","cli":"dench campaign accounts","method":"GET","path":"/campaigns/accounts/x","permission":"campaigns:read","pathParams":[]},
|
|
398
399
|
{"id":"campaigns.list","group":"campaigns","summary":"List outreach campaigns of every kind on the Campaigns page, each with its kind (archived ones on request).","cli":"dench campaign list [--with-references]","method":"GET","path":"/campaigns","permission":"campaigns:read","pathParams":[]},
|
|
399
400
|
{"id":"campaigns.create","group":"campaigns","summary":"Create a draft outreach campaign with email and LinkedIn sender pools and a business-hours send window in the given timezone.","cli":"dench campaign create","method":"POST","path":"/campaigns","permission":"campaigns:write","pathParams":[]},
|
|
400
401
|
{"id":"campaigns.duplicate","group":"campaigns","summary":"Copy a campaign into a new draft named \"<name> copy\": the same steps, schedule, sender pools and personalized lines, its lead source paused, and no people. To reach more than 300 people, duplicate and add the next page of the search to the copy.","cli":"dench campaign duplicate","method":"POST","path":"/campaigns/{sequenceId}/duplicate","permission":"campaigns:write","pathParams":["sequenceId"]},
|
|
@@ -648,6 +649,7 @@ export const APP_SDK_METHODS: Readonly<Record<string, AppSdkMethodInfo>> = {
|
|
|
648
649
|
"campaigns.estimate": {"kind":"op","permission":"campaigns:write","op":"campaigns.builder.estimate","doc":"Estimate audience or signal volume."},
|
|
649
650
|
"campaigns.mailboxes": {"kind":"op","permission":"campaigns:read","op":"campaigns.accounts.email","doc":"Mailboxes campaigns can send from, with warm-up and daily cap."},
|
|
650
651
|
"campaigns.linkedinAccounts": {"kind":"op","permission":"campaigns:read","op":"campaigns.accounts.linkedin","doc":"LinkedIn accounts campaigns can send from, with capacity."},
|
|
652
|
+
"campaigns.xAccounts": {"kind":"op","permission":"campaigns:read","op":"campaigns.accounts.x","doc":"Connected X accounts campaigns can send from, with daily limits."},
|
|
651
653
|
"campaigns.list": {"kind":"op","permission":"campaigns:read","op":"campaigns.list","doc":"LinkedIn / multi-channel outreach campaigns."},
|
|
652
654
|
"campaigns.get": {"kind":"op","permission":"campaigns:read","op":"campaigns.get","doc":"One campaign."},
|
|
653
655
|
"campaigns.setSteps": {"kind":"op","permission":"campaigns:write","op":"campaigns.steps.replace","doc":"Replace every step of a draft campaign."},
|
package/lib/app-sdk-surface.ts
CHANGED
|
@@ -821,6 +821,12 @@ export const APP_SDK_SURFACE: AppSdkSurface = {
|
|
|
821
821
|
args: "",
|
|
822
822
|
returns: R("campaigns.accounts.linkedin"),
|
|
823
823
|
},
|
|
824
|
+
xAccounts: {
|
|
825
|
+
op: "campaigns.accounts.x",
|
|
826
|
+
doc: "Connected X accounts campaigns can send from, with daily limits.",
|
|
827
|
+
args: "",
|
|
828
|
+
returns: R("campaigns.accounts.x"),
|
|
829
|
+
},
|
|
824
830
|
list: {
|
|
825
831
|
op: "campaigns.list",
|
|
826
832
|
doc: "LinkedIn / multi-channel outreach campaigns.",
|
package/lib/command-registry.ts
CHANGED
|
@@ -4501,6 +4501,18 @@ const rawApiOperations = [
|
|
|
4501
4501
|
responseSchema: anyResponse,
|
|
4502
4502
|
backend: convex("query", "functions/emailMailboxAccounts:listAccounts"),
|
|
4503
4503
|
}),
|
|
4504
|
+
op({
|
|
4505
|
+
id: "campaigns.accounts.x",
|
|
4506
|
+
group: "campaigns",
|
|
4507
|
+
summary:
|
|
4508
|
+
"Discover the connected X (Twitter) accounts the acting workspace member can send X campaigns from: ids for xAccountIds, handle, status, visibility, sync summary and daily safety limits. Never returns provider credentials.",
|
|
4509
|
+
cli: "dench campaign accounts",
|
|
4510
|
+
method: "GET",
|
|
4511
|
+
path: "/campaigns/accounts/x",
|
|
4512
|
+
requestSchema: anyObject,
|
|
4513
|
+
responseSchema: anyResponse,
|
|
4514
|
+
backend: convex("query", "functions/xAccounts:listAccounts"),
|
|
4515
|
+
}),
|
|
4504
4516
|
op({
|
|
4505
4517
|
id: "campaigns.list",
|
|
4506
4518
|
group: "campaigns",
|