@curviate/cli 0.54.0 → 0.55.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/CHANGELOG.md +24 -0
- package/README.md +34 -17
- package/dist/{account-DW5N5MJ6.js → account-6L33JFZS.js} +98 -116
- package/dist/{analytics-T2K3OWVQ.js → analytics-HGJGXRAM.js} +5 -5
- package/dist/{beta-consent-O736ONE7.js → beta-consent-LIND4PPN.js} +4 -4
- package/dist/{billing-NTBL32EX.js → billing-QKPP5NPR.js} +5 -5
- package/dist/{chunk-5B4T6BMN.js → chunk-AMMAA62Z.js} +44 -44
- package/dist/{chunk-FBLCSVIU.js → chunk-BC4N5X3N.js} +47 -47
- package/dist/{chunk-N4IYTFIY.js → chunk-EA5LJ4CS.js} +1 -1
- package/dist/{chunk-A3UNS44U.js → chunk-FHSGANM6.js} +10 -10
- package/dist/chunk-J34JU27C.js +94 -0
- package/dist/{chunk-62YAYAUI.js → chunk-JKXGL7PT.js} +9 -9
- package/dist/{chunk-FUX3BRYP.js → chunk-JXDEV33Z.js} +1 -1
- package/dist/{chunk-V3HHYTBY.js → chunk-KLXDFFHT.js} +1 -1
- package/dist/{chunk-HOMRAZ6S.js → chunk-LGUZ52BU.js} +2 -2
- package/dist/{chunk-Q57PZJLX.js → chunk-OYZ27Q3B.js} +88 -88
- package/dist/{chunk-UFHT2KZG.js → chunk-Q5Z7FMXI.js} +2 -2
- package/dist/{chunk-R4HS2MWM.js → chunk-QBY6L77D.js} +14 -12
- package/dist/{chunk-KXJJFHSD.js → chunk-R7USRN52.js} +1 -1
- package/dist/{chunk-QW5K5DTC.js → chunk-RDKTHFQ6.js} +25 -6
- package/dist/{chunk-N76WNJ5T.js → chunk-S234PC5E.js} +1 -1
- package/dist/{chunk-ACKKHLUH.js → chunk-Z3RPQ5K4.js} +2 -2
- package/dist/cli.js +27 -25
- package/dist/{comment-ATVJOTWV.js → comment-IIKLEAEK.js} +8 -8
- package/dist/{company-BRKFROPE.js → company-CX5TZNB5.js} +11 -11
- package/dist/{config-E223SS5K.js → config-Y4FC7QKM.js} +2 -2
- package/dist/{connect-XVDQ5FTT.js → connect-GUUBX23F.js} +15 -15
- package/dist/{contact-4HOUOVD7.js → contact-OCYSFRTS.js} +8 -8
- package/dist/{contact-groups-ENA3VGGL.js → contact-groups-HWJSYRFJ.js} +85 -85
- package/dist/{contact-import-4EKVDFPV.js → contact-import-CTWSFT64.js} +10 -10
- package/dist/core-37XZS2RG.js +46 -0
- package/dist/{do-not-contact-S2WGHSQL.js → do-not-contact-6UVY3UKT.js} +29 -29
- package/dist/{doctor-OFIUGRUG.js → doctor-6CB6DCY3.js} +4 -4
- package/dist/{document-MDE2WJYX.js → document-ADK4GZA7.js} +1 -1
- package/dist/domain-BUJMHYIV.js +70 -0
- package/dist/{draft-DD3DTXBM.js → draft-SII6E6Z6.js} +4 -4
- package/dist/{enrollment-ESCHKQ5X.js → enrollment-OXGR5WVI.js} +38 -38
- package/dist/{examples-KAMXHRLE.js → examples-77WVMKZQ.js} +2 -2
- package/dist/{exit-codes-CYQHN4NE.js → exit-codes-ZSOLAXQO.js} +1 -1
- package/dist/{export-GUAGB7TF.js → export-D32J5GRN.js} +5 -5
- package/dist/{feed-ZC4FY4BA.js → feed-HOFHCP6W.js} +6 -6
- package/dist/{group-42ZE7K3K.js → group-AMYOAGNS.js} +6 -6
- package/dist/{inbox-2YS7CTXH.js → inbox-NS2LB2WQ.js} +9 -9
- package/dist/{inboxes-5RB3BGCQ.js → inboxes-XWUZJ5PN.js} +6 -6
- package/dist/{incoming-ATZN6JJA.js → incoming-UIWRL6QS.js} +13 -13
- package/dist/{job-WD3Z3P3Q.js → job-TKGPXU26.js} +10 -10
- package/dist/{login-JQ57YHEJ.js → login-B2YWX2JP.js} +2 -2
- package/dist/mailbox-LLSGX2FF.js +406 -0
- package/dist/{message-WGS2IIDC.js → message-M4THMNRZ.js} +7 -7
- package/dist/{motion-BRVBJJJP.js → motion-2OUGYR3O.js} +147 -147
- package/dist/{network-CODIWCJQ.js → network-MFWKXTEV.js} +5 -5
- package/dist/{notification-RLVF4NLJ.js → notification-5K4TCYQA.js} +6 -6
- package/dist/{notifications-HGEHM5KW.js → notifications-2GKUJB7C.js} +6 -6
- package/dist/{post-3GH2IPO6.js → post-BHH7YKGM.js} +8 -8
- package/dist/{profile-6RFJQMIB.js → profile-GKMRRKZF.js} +15 -15
- package/dist/{recruiter-GK3UNS62.js → recruiter-J53ZSD4P.js} +17 -17
- package/dist/{sales-nav-SLS3ABF4.js → sales-nav-6I5SYTRX.js} +15 -15
- package/dist/{search-45WRT5T3.js → search-HS2YAA33.js} +17 -17
- package/dist/{setup-5QZOM2Q2.js → setup-IYVOGVC6.js} +4 -4
- package/dist/{team-WM3RKOQ2.js → team-N6ILUHAD.js} +6 -6
- package/dist/{tier-5AMLO5KE.js → tier-QWXKFESB.js} +4 -4
- package/dist/{unibox-TTCF7YVO.js → unibox-D4WIHIZX.js} +34 -34
- package/dist/{webhook-UCCCSKDO.js → webhook-PKWGZZO2.js} +18 -18
- package/package.json +2 -2
- package/dist/core-6VDDV2NM.js +0 -46
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
} from "./chunk-VHNF6OZD.js";
|
|
6
6
|
import {
|
|
7
7
|
sendInChunks
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-Q5Z7FMXI.js";
|
|
9
9
|
import {
|
|
10
10
|
fail,
|
|
11
11
|
listFlag,
|
|
12
12
|
outputOpts,
|
|
13
13
|
rootClient,
|
|
14
14
|
usage
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LGUZ52BU.js";
|
|
16
16
|
import {
|
|
17
17
|
buildPreviewOutput
|
|
18
18
|
} from "./chunk-TCUYH5GO.js";
|
|
@@ -27,12 +27,12 @@ import {
|
|
|
27
27
|
readablePage,
|
|
28
28
|
rejectPaginationModifiersWithoutAll,
|
|
29
29
|
streamAll
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-R7USRN52.js";
|
|
31
31
|
import {
|
|
32
32
|
renderSuccess,
|
|
33
33
|
writeNdjsonItem
|
|
34
34
|
} from "./chunk-QM57YDJE.js";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-S234PC5E.js";
|
|
36
36
|
import {
|
|
37
37
|
GLOBAL_FLAGS,
|
|
38
38
|
READ_SINGLE_FLAGS,
|
|
@@ -41,14 +41,14 @@ import {
|
|
|
41
41
|
} from "./chunk-QLKGOIWS.js";
|
|
42
42
|
import {
|
|
43
43
|
DESCRIPTIONS
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-QBY6L77D.js";
|
|
45
45
|
import {
|
|
46
46
|
documentSchema,
|
|
47
47
|
parseDocument,
|
|
48
48
|
readFileFlag,
|
|
49
49
|
reportIssues,
|
|
50
50
|
validate
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-JKXGL7PT.js";
|
|
52
52
|
import "./chunk-FDJMAF7D.js";
|
|
53
53
|
import {
|
|
54
54
|
isStdinToken
|
|
@@ -134,7 +134,7 @@ var connect_and_converse_default = {
|
|
|
134
134
|
{
|
|
135
135
|
id: "has_post",
|
|
136
136
|
if: {
|
|
137
|
-
"
|
|
137
|
+
"lead.posted_within": "14d"
|
|
138
138
|
},
|
|
139
139
|
then: "w_like",
|
|
140
140
|
else: "w_invite"
|
|
@@ -254,7 +254,7 @@ var engage_then_connect_default = {
|
|
|
254
254
|
text: "{{comment}}",
|
|
255
255
|
fallback: "skip"
|
|
256
256
|
},
|
|
257
|
-
note: "Your AI writes one comment per
|
|
257
|
+
note: "Your AI writes one comment per Lead; no product mention."
|
|
258
258
|
},
|
|
259
259
|
{
|
|
260
260
|
id: "w_invite",
|
|
@@ -330,7 +330,7 @@ var nurture_connections_default = {
|
|
|
330
330
|
{
|
|
331
331
|
id: "is_connected",
|
|
332
332
|
if: {
|
|
333
|
-
"
|
|
333
|
+
"lead.connected": true
|
|
334
334
|
},
|
|
335
335
|
then: "dm",
|
|
336
336
|
else: "not_connected"
|
|
@@ -406,7 +406,7 @@ function assignWarning(sequence, assign) {
|
|
|
406
406
|
const at = steps.findIndex((s) => s?.["do"] === "invite.send" && typeof s["id"] === "string");
|
|
407
407
|
if (at < 0) return [];
|
|
408
408
|
const rule = "settings.assign is already_connected, so anyone not already connected to a sending Account is skipped and this invitation never runs for them; use assign: auto";
|
|
409
|
-
const hint = "Set settings.assign to auto, the default: it prefers an Account already connected and invites everyone else. Keep already_connected only for a
|
|
409
|
+
const hint = "Set settings.assign to auto, the default: it prefers an Account already connected and invites everyone else. Keep already_connected only for a Campaign that writes to existing Connections.";
|
|
410
410
|
return [{ code: "W17", path: `${steps[at]["id"]}.do`, rule, message: rule, pointer: `/steps/${at}/do`, hint, docs_url: "https://docs.curviate.com/reference/sequence-rules#w17", severity: "warning" }];
|
|
411
411
|
}
|
|
412
412
|
async function checkSequence(f, text, sequence, prefix, settings) {
|
|
@@ -426,14 +426,14 @@ async function checkSequence(f, text, sequence, prefix, settings) {
|
|
|
426
426
|
`).join(""));
|
|
427
427
|
return verdict;
|
|
428
428
|
}
|
|
429
|
-
function
|
|
429
|
+
function checkCampaignFields(f, command, doc) {
|
|
430
430
|
const schema = documentSchema(command);
|
|
431
431
|
let body = doc;
|
|
432
432
|
if (doc && typeof doc === "object" && !Array.isArray(doc)) {
|
|
433
433
|
const readOnlyKeys = schema["x-curviate-response-only"];
|
|
434
434
|
const dropped = Object.keys(doc).filter((k) => readOnlyKeys.includes(k));
|
|
435
435
|
if (dropped.length) {
|
|
436
|
-
process.stderr.write(`warning: dropped ${dropped.join(", ")}: set by Curviate, not part of a
|
|
436
|
+
process.stderr.write(`warning: dropped ${dropped.join(", ")}: set by Curviate, not part of a Campaign file (\`curviate campaign get\` output carries them).
|
|
437
437
|
`);
|
|
438
438
|
body = Object.fromEntries(Object.entries(doc).filter(([k]) => !dropped.includes(k)));
|
|
439
439
|
}
|
|
@@ -442,9 +442,9 @@ function checkMotionFields(f, command, doc) {
|
|
|
442
442
|
if (issues.length) reportIssues(issues, outputOpts(f).json);
|
|
443
443
|
return body;
|
|
444
444
|
}
|
|
445
|
-
async function
|
|
445
|
+
async function readCampaignFile(f, command) {
|
|
446
446
|
const text = await readFileFlag("file", f.file ?? "", { others: f });
|
|
447
|
-
const body =
|
|
447
|
+
const body = checkCampaignFields(f, command, parseDocument("file", text));
|
|
448
448
|
if (body["sequence"] != null) await checkSequence(f, text, body["sequence"], "/sequence", body["settings"]);
|
|
449
449
|
return { body, text };
|
|
450
450
|
}
|
|
@@ -457,7 +457,7 @@ function explain(err, f, text) {
|
|
|
457
457
|
if (e.code === "SEQUENCE_CONFLICT" && e.current) {
|
|
458
458
|
const c = e.current;
|
|
459
459
|
process.stderr.write(
|
|
460
|
-
`The Sequence was saved since revision ${f["if-revision"]}: revision ${c.sequence_revision} by ${c.sequence_updated_by_user_id ?? "an unknown user"} at ${c.updated_at ?? "an unknown time"}. Read it with \`curviate
|
|
460
|
+
`The Sequence was saved since revision ${f["if-revision"]}: revision ${c.sequence_revision} by ${c.sequence_updated_by_user_id ?? "an unknown user"} at ${c.updated_at ?? "an unknown time"}. Read it with \`curviate campaign get ${f.id}\` and merge, or send yours again with --if-revision ${c.sequence_revision} to replace it.
|
|
461
461
|
`
|
|
462
462
|
);
|
|
463
463
|
}
|
|
@@ -482,10 +482,10 @@ async function runList(c, f) {
|
|
|
482
482
|
if (cursor) params["cursor"] = cursor;
|
|
483
483
|
try {
|
|
484
484
|
if (f.all) {
|
|
485
|
-
const page = (p) => c.
|
|
485
|
+
const page = (p) => c.campaigns.list(p);
|
|
486
486
|
for await (const item of streamAll(page, params, { maxPages: readMaxPagesFlag(f, process), out: process, pageDelayMs: pageDelayFromFlags(f) })) writeNdjsonItem(process, item, f.fields);
|
|
487
487
|
} else {
|
|
488
|
-
renderSuccess(readablePage(await c.
|
|
488
|
+
renderSuccess(readablePage(await c.campaigns.list(params)), outputOpts(f), process);
|
|
489
489
|
}
|
|
490
490
|
} catch (err) {
|
|
491
491
|
await fail(err, f);
|
|
@@ -493,41 +493,41 @@ async function runList(c, f) {
|
|
|
493
493
|
}
|
|
494
494
|
async function runGet(c, f) {
|
|
495
495
|
try {
|
|
496
|
-
const result = f.version === void 0 ? await c.
|
|
496
|
+
const result = f.version === void 0 ? await c.campaigns.get(f.id ?? "") : await c.campaigns.getSequenceVersion(f.id ?? "", { version: intFlag("version", f.version) });
|
|
497
497
|
renderSuccess(readableObject(result), outputOpts(f), process);
|
|
498
498
|
} catch (err) {
|
|
499
499
|
await fail(err, f);
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
async function runCreate(c, f) {
|
|
503
|
-
const { body, text } = await
|
|
504
|
-
if (f.preview) return preview("
|
|
503
|
+
const { body, text } = await readCampaignFile(f, "campaign create");
|
|
504
|
+
if (f.preview) return preview("campaigns.create", {}, body);
|
|
505
505
|
try {
|
|
506
|
-
renderSuccess(await c.
|
|
506
|
+
renderSuccess(await c.campaigns.create(body), outputOpts(f), process);
|
|
507
507
|
} catch (err) {
|
|
508
508
|
explain(err, f, text);
|
|
509
509
|
await fail(err, f);
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
512
|
async function runUpdate(c, f) {
|
|
513
|
-
const { body, text } = await
|
|
513
|
+
const { body, text } = await readCampaignFile(f, "campaign update");
|
|
514
514
|
if ("if_sequence_revision" in body) {
|
|
515
515
|
process.stderr.write("warning: dropped if_sequence_revision from the file: pass --if-revision <n> to send it.\n");
|
|
516
516
|
delete body["if_sequence_revision"];
|
|
517
517
|
}
|
|
518
518
|
if (f["if-revision"] !== void 0) body["if_sequence_revision"] = intFlag("if-revision", f["if-revision"], 0);
|
|
519
|
-
if (f.preview) return preview("
|
|
519
|
+
if (f.preview) return preview("campaigns.update", { id: f.id }, body);
|
|
520
520
|
try {
|
|
521
|
-
renderSuccess(await c.
|
|
521
|
+
renderSuccess(await c.campaigns.update(f.id ?? "", body), outputOpts(f), process);
|
|
522
522
|
} catch (err) {
|
|
523
523
|
explain(err, f, text);
|
|
524
524
|
await fail(err, f);
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
527
|
var lifecycle = (method) => async (c, f) => {
|
|
528
|
-
if (f.preview) return preview(`
|
|
528
|
+
if (f.preview) return preview(`campaigns.${method}`, { id: f.id });
|
|
529
529
|
try {
|
|
530
|
-
renderSuccess(await c.
|
|
530
|
+
renderSuccess(await c.campaigns[method](f.id ?? ""), outputOpts(f), process);
|
|
531
531
|
} catch (err) {
|
|
532
532
|
await fail(err, f);
|
|
533
533
|
}
|
|
@@ -535,22 +535,22 @@ var lifecycle = (method) => async (c, f) => {
|
|
|
535
535
|
async function runPreview(c, f) {
|
|
536
536
|
const params = {};
|
|
537
537
|
if (f.sample !== void 0) params["sample"] = intFlag("sample", f.sample, 1, 20);
|
|
538
|
-
if (f.
|
|
539
|
-
if (params["sample"] !== void 0 && params["
|
|
538
|
+
if (f.lead !== void 0) params["lead_ids"] = listFlag("lead", f.lead);
|
|
539
|
+
if (params["sample"] !== void 0 && params["lead_ids"] !== void 0) usage("--sample and --lead cannot be combined: name the Leads, or let Curviate sample.");
|
|
540
540
|
try {
|
|
541
|
-
renderSuccess(readableObject(await c.
|
|
541
|
+
renderSuccess(readableObject(await c.campaigns.preview(f.id ?? "", params)), outputOpts(f), process);
|
|
542
542
|
} catch (err) {
|
|
543
543
|
await fail(err, f);
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
546
|
var membership = (kind) => async (c, f) => {
|
|
547
|
-
const ids = listFlag("
|
|
548
|
-
if (!ids.length) usage("--
|
|
549
|
-
if (f.account !== void 0 && f.account.trim() === "") usage("--account was given an empty value. Pass an acc_... id of the
|
|
550
|
-
const body = (chunk) => ({
|
|
551
|
-
const method = kind === "add" ? "
|
|
552
|
-
if (f.preview) return preview(`
|
|
553
|
-
const results = await sendInChunks(ids, BULK_MAX_IDS, (chunk) => c.
|
|
547
|
+
const ids = listFlag("lead", f.lead);
|
|
548
|
+
if (!ids.length) usage("--lead is required: one or more Lead ids (con_...).");
|
|
549
|
+
if (f.account !== void 0 && f.account.trim() === "") usage("--account was given an empty value. Pass an acc_... id of the Campaign, or omit it to let Curviate assign one.");
|
|
550
|
+
const body = (chunk) => ({ lead_ids: chunk, ...f.account !== void 0 ? { account_id: f.account } : {} });
|
|
551
|
+
const method = kind === "add" ? "addLeads" : "removeLeads";
|
|
552
|
+
if (f.preview) return preview(`campaigns.${method}`, { id: f.id }, body(ids.slice(0, BULK_MAX_IDS)));
|
|
553
|
+
const results = await sendInChunks(ids, BULK_MAX_IDS, (chunk) => c.campaigns[method](f.id ?? "", body(chunk)), f);
|
|
554
554
|
if (results.length === 1) return renderSuccess(results[0], outputOpts(f), process);
|
|
555
555
|
const last = results[results.length - 1] ?? {};
|
|
556
556
|
const merged = kind === "add" ? { ...last, results: results.flatMap((r) => r?.results ?? []) } : {
|
|
@@ -562,7 +562,7 @@ var membership = (kind) => async (c, f) => {
|
|
|
562
562
|
};
|
|
563
563
|
async function runVoiceClipUpload(c, f) {
|
|
564
564
|
const path = f.file ?? "";
|
|
565
|
-
if (path.trim() === "") usage("the audio file is missing. Pass its path: `curviate
|
|
565
|
+
if (path.trim() === "") usage("the audio file is missing. Pass its path: `curviate campaign voice-clip upload intro.mp3`.");
|
|
566
566
|
const filename = basename(path);
|
|
567
567
|
let bytes;
|
|
568
568
|
try {
|
|
@@ -572,17 +572,17 @@ async function runVoiceClipUpload(c, f) {
|
|
|
572
572
|
throw err;
|
|
573
573
|
}
|
|
574
574
|
if (f.preview) {
|
|
575
|
-
return void process.stdout.write(JSON.stringify(buildPreviewOutput({ method: "
|
|
575
|
+
return void process.stdout.write(JSON.stringify(buildPreviewOutput({ method: "campaigns.voiceClips.upload", args: { filename }, body: {}, attachments: [{ name: filename, buffer: bytes }] })) + "\n");
|
|
576
576
|
}
|
|
577
577
|
try {
|
|
578
|
-
renderSuccess(await c.
|
|
578
|
+
renderSuccess(await c.campaigns.voiceClips.upload(bytes, { filename }), outputOpts(f), process);
|
|
579
579
|
} catch (err) {
|
|
580
580
|
await fail(err, f);
|
|
581
581
|
}
|
|
582
582
|
}
|
|
583
583
|
async function runVoiceClipGet(c, f) {
|
|
584
584
|
try {
|
|
585
|
-
renderSuccess(await c.
|
|
585
|
+
renderSuccess(await c.campaigns.voiceClips.get(f.id ?? ""), outputOpts(f), process);
|
|
586
586
|
} catch (err) {
|
|
587
587
|
await fail(err, f);
|
|
588
588
|
}
|
|
@@ -590,10 +590,10 @@ async function runVoiceClipGet(c, f) {
|
|
|
590
590
|
async function runLint(f) {
|
|
591
591
|
const text = await readFileFlag("file", f.file ?? "", { others: f });
|
|
592
592
|
const doc = parseDocument("file", text);
|
|
593
|
-
const
|
|
594
|
-
if (
|
|
595
|
-
if (
|
|
596
|
-
const verdict = await checkSequence(f, text,
|
|
593
|
+
const campaignFile = !!doc && typeof doc === "object" && !Array.isArray(doc) && !("steps" in doc) && ("sequence" in doc || "name" in doc);
|
|
594
|
+
if (campaignFile) checkCampaignFields(f, "campaign create", doc);
|
|
595
|
+
if (campaignFile && doc["sequence"] == null) usage("--file: the Campaign file has no sequence; there is nothing to lint.");
|
|
596
|
+
const verdict = await checkSequence(f, text, campaignFile ? doc["sequence"] : doc, campaignFile ? "/sequence" : "", campaignFile ? doc["settings"] : void 0);
|
|
597
597
|
if (outputOpts(f).json) process.stdout.write(JSON.stringify({ errors: [], warnings: verdict.warnings }) + "\n");
|
|
598
598
|
}
|
|
599
599
|
async function runInit(f) {
|
|
@@ -608,31 +608,31 @@ async function runInit(f) {
|
|
|
608
608
|
} catch (err) {
|
|
609
609
|
usage(`--output: cannot write ${f.output}: ${err.code ?? "write error"}.`);
|
|
610
610
|
}
|
|
611
|
-
process.stderr.write(`Wrote ${f.output}. Next: fill
|
|
611
|
+
process.stderr.write(`Wrote ${f.output}. Next: fill lead_list_ids and account_ids, then \`curviate campaign create --file ${f.output}\`.
|
|
612
612
|
`);
|
|
613
613
|
}
|
|
614
614
|
var online = (fn) => async ({ args }) => {
|
|
615
615
|
const f = args;
|
|
616
616
|
await fn(await rootClient(f), f);
|
|
617
617
|
};
|
|
618
|
-
var ID = { type: "positional", description: "
|
|
619
|
-
var FILE_DESC = "The
|
|
620
|
-
var SEQUENCE_ERRORS = { SEQUENCE_INVALID: "the Sequence breaks a rule; every error is listed, one line each, as `curviate
|
|
618
|
+
var ID = { type: "positional", description: "Campaign id (mot_...)." };
|
|
619
|
+
var FILE_DESC = "The Campaign file: a path, or - to read it from stdin. `curviate campaign get` output is accepted as is.";
|
|
620
|
+
var SEQUENCE_ERRORS = { SEQUENCE_INVALID: "the Sequence breaks a rule; every error is listed, one line each, as `curviate campaign lint` prints them." };
|
|
621
621
|
var ROLE_ERRORS = {
|
|
622
|
-
INSUFFICIENT_ROLE: "your role cannot send from a sending Account of this
|
|
622
|
+
INSUFFICIENT_ROLE: "your role cannot send from a sending Account of this Campaign.",
|
|
623
623
|
ACCOUNT_NOT_SHARED: "a sending Account is not shared with you."
|
|
624
624
|
};
|
|
625
|
-
var SEE_LIFECYCLE = ["curviate
|
|
625
|
+
var SEE_LIFECYCLE = ["curviate campaign get", "curviate enrollment list"];
|
|
626
626
|
var listCmd = defineCommand({
|
|
627
627
|
meta: {
|
|
628
628
|
name: "list",
|
|
629
|
-
description: "List your Team's
|
|
629
|
+
description: "List your Team's Campaigns, most recently updated first (--sort activity: latest activity first, `last_activity_at`). Items carry no Sequence: read one with `curviate campaign get <campaign_id>`. A cursor belongs to its sort.",
|
|
630
630
|
risk: "read",
|
|
631
|
-
examples: ["curviate
|
|
631
|
+
examples: ["curviate campaign list", "curviate campaign list --status active,paused", "curviate campaign list --accounts acc_A,acc_B --sort activity"]
|
|
632
632
|
},
|
|
633
633
|
args: {
|
|
634
634
|
...readOnly(GLOBAL_FLAGS),
|
|
635
|
-
accounts: { type: "string", description: "Only
|
|
635
|
+
accounts: { type: "string", description: "Only Campaigns sending from one of these Accounts: a comma list of ids (acc_...). --account a,b is accepted as the same filter." },
|
|
636
636
|
sort: { type: "string", description: "updated (default) or activity." },
|
|
637
637
|
status: { type: "string", description: `Comma list of ${STATUSES.join(", ")}. Default: all but archived.` }
|
|
638
638
|
},
|
|
@@ -641,10 +641,10 @@ var listCmd = defineCommand({
|
|
|
641
641
|
var getCmd = defineCommand({
|
|
642
642
|
meta: {
|
|
643
643
|
name: "get",
|
|
644
|
-
description: "One
|
|
644
|
+
description: "One Campaign with its current Sequence and lint warnings. With --version, that Sequence version instead, and how many Enrollments still run on it.",
|
|
645
645
|
risk: "read",
|
|
646
|
-
output: ["The full
|
|
647
|
-
examples: ["curviate
|
|
646
|
+
output: ["The full Campaign, pasteable: `curviate campaign create --file -` and `curviate campaign update <campaign_id> --file -` accept it as is, dropping the keys Curviate sets."],
|
|
647
|
+
examples: ["curviate campaign get mot_YOUR_CAMPAIGN_ID", "curviate campaign get mot_YOUR_CAMPAIGN_ID --version 1"]
|
|
648
648
|
},
|
|
649
649
|
args: {
|
|
650
650
|
...readOnly(READ_SINGLE_FLAGS),
|
|
@@ -653,9 +653,9 @@ var getCmd = defineCommand({
|
|
|
653
653
|
},
|
|
654
654
|
run: online(runGet)
|
|
655
655
|
});
|
|
656
|
-
var
|
|
656
|
+
var CAMPAIGN_DOC = `{
|
|
657
657
|
"name": "Q4 webinar follow-up",
|
|
658
|
-
"
|
|
658
|
+
"lead_list_ids": ["cl_YOUR_LIST_ID"],
|
|
659
659
|
"account_ids": ["acc_YOUR_ACCOUNT_ID"],
|
|
660
660
|
"sequence": {
|
|
661
661
|
"on_reply": "end",
|
|
@@ -667,22 +667,22 @@ var MOTION_DOC = `{
|
|
|
667
667
|
var createCmd = defineCommand({
|
|
668
668
|
meta: {
|
|
669
669
|
name: "create",
|
|
670
|
-
description: "Create a
|
|
670
|
+
description: "Create a Campaign from a Campaign file, always as a draft: nothing runs until `curviate campaign start`. The file is checked before anything is sent, its Sequence as `curviate campaign lint` checks it. settings.priority (normal or prioritized) sets the Campaign's weight in each Account's budgets: 1 or 1.5, on every budget; every Campaign with work due still progresses and no limit is passed. Needs Automate.",
|
|
671
671
|
risk: "write",
|
|
672
672
|
rules: {
|
|
673
|
-
changes: "Creates a draft
|
|
673
|
+
changes: "Creates a draft Campaign. No Lead is enrolled and nothing reaches LinkedIn until it is started.",
|
|
674
674
|
visible_to: "Your Team.",
|
|
675
675
|
budget_rows: [],
|
|
676
|
-
retry: "A retry creates a second draft: list with `curviate
|
|
677
|
-
undo: "`curviate
|
|
676
|
+
retry: "A retry creates a second draft: list with `curviate campaign list --status draft` first.",
|
|
677
|
+
undo: "`curviate campaign delete <campaign_id>` deletes a draft."
|
|
678
678
|
},
|
|
679
|
-
errors: { ...SEQUENCE_ERRORS, ...ROLE_ERRORS, TIER_REQUIRED: "
|
|
680
|
-
seeAlso: ["curviate
|
|
681
|
-
document: "
|
|
679
|
+
errors: { ...SEQUENCE_ERRORS, ...ROLE_ERRORS, TIER_REQUIRED: "Campaigns need the Automate plan." },
|
|
680
|
+
seeAlso: ["curviate campaign lint", "curviate campaign init", "curviate campaign preview"],
|
|
681
|
+
document: "campaign create",
|
|
682
682
|
examples: [
|
|
683
|
-
"curviate
|
|
684
|
-
`curviate
|
|
685
|
-
${
|
|
683
|
+
"curviate campaign create --file campaign.json",
|
|
684
|
+
`curviate campaign create --file - <<'EOF'
|
|
685
|
+
${CAMPAIGN_DOC}
|
|
686
686
|
EOF`
|
|
687
687
|
]
|
|
688
688
|
},
|
|
@@ -695,27 +695,27 @@ EOF`
|
|
|
695
695
|
var updateCmd = defineCommand({
|
|
696
696
|
meta: {
|
|
697
697
|
name: "update",
|
|
698
|
-
description: "Change a
|
|
698
|
+
description: "Change a Campaign from a Campaign file: objects (schedule, settings) merge by key, arrays and the Sequence replace whole, null clears. settings.priority (normal or prioritized) weighs the Campaign 1 or 1.5 in each Account's budgets, on every budget (every Campaign with work due still progresses, and no limit is passed); settings.new_enrollments_per_account_per_day and settings.assign even are retired (accepted and ignored until 2027-01-28, with a notice). After start, a structural Sequence change makes a new version; running Enrollments keep theirs. With --if-revision the save is refused when someone saved the Sequence since. Needs Automate.",
|
|
699
699
|
risk: "write",
|
|
700
700
|
rules: {
|
|
701
|
-
changes: "Changes the
|
|
702
|
-
visible_to: "Your Team, and the
|
|
701
|
+
changes: "Changes the Campaign. A running Campaign picks the change up at each Enrollment's next Step.",
|
|
702
|
+
visible_to: "Your Team, and the Leads its next Steps reach.",
|
|
703
703
|
budget_rows: [],
|
|
704
704
|
retry: "Safe: the same file sends the same change. Without --if-revision the last save wins.",
|
|
705
|
-
undo: "Send the previous file again (`curviate
|
|
705
|
+
undo: "Send the previous file again (`curviate campaign get <campaign_id> --version <n>` reads an earlier Sequence)."
|
|
706
706
|
},
|
|
707
707
|
errors: {
|
|
708
708
|
...SEQUENCE_ERRORS,
|
|
709
709
|
SEQUENCE_CONFLICT: "with --if-revision: someone saved the Sequence since that revision; the message names the newer revision and who saved it.",
|
|
710
|
-
|
|
710
|
+
CAMPAIGN_STATUS_CONFLICT: "an archived Campaign, or one past its end, cannot change.",
|
|
711
711
|
...ROLE_ERRORS
|
|
712
712
|
},
|
|
713
|
-
seeAlso: ["curviate
|
|
714
|
-
document: "
|
|
713
|
+
seeAlso: ["curviate campaign get", "curviate campaign lint"],
|
|
714
|
+
document: "campaign update",
|
|
715
715
|
examples: [
|
|
716
|
-
"curviate
|
|
717
|
-
`curviate
|
|
718
|
-
${
|
|
716
|
+
"curviate campaign update mot_YOUR_CAMPAIGN_ID --file campaign.json --if-revision 3",
|
|
717
|
+
`curviate campaign update mot_YOUR_CAMPAIGN_ID --file - <<'EOF'
|
|
718
|
+
${CAMPAIGN_DOC}
|
|
719
719
|
EOF`
|
|
720
720
|
]
|
|
721
721
|
},
|
|
@@ -723,128 +723,128 @@ EOF`
|
|
|
723
723
|
...WRITE_SINGLE_FLAGS,
|
|
724
724
|
id: ID,
|
|
725
725
|
file: { type: "string", stdinArg: true, required: true, description: FILE_DESC },
|
|
726
|
-
"if-revision": { type: "string", description: "The sequence_revision you read (`curviate
|
|
726
|
+
"if-revision": { type: "string", description: "The sequence_revision you read (`curviate campaign get`). The save is refused with SEQUENCE_CONFLICT when the stored Sequence moved past it. Omitted: the last save wins." }
|
|
727
727
|
},
|
|
728
728
|
run: online(runUpdate)
|
|
729
729
|
});
|
|
730
730
|
var lifecycleCmd = (name, meta) => defineCommand({
|
|
731
|
-
meta: { name, ...meta, examples: [`curviate
|
|
731
|
+
meta: { name, ...meta, examples: [`curviate campaign ${name} mot_YOUR_CAMPAIGN_ID`] },
|
|
732
732
|
args: { ...WRITE_SINGLE_FLAGS, id: ID },
|
|
733
733
|
run: online(lifecycle(name))
|
|
734
734
|
});
|
|
735
735
|
var startCmd = lifecycleCmd("start", {
|
|
736
|
-
description: "Start a draft: scheduled when its start time is ahead, else active. Freezes Sequence version 1. A
|
|
736
|
+
description: "Start a draft: scheduled when its start time is ahead, else active. Freezes Sequence version 1. A Campaign missing what it needs is refused with every gap listed. Needs Automate.",
|
|
737
737
|
risk: "high",
|
|
738
738
|
rules: {
|
|
739
|
-
changes: "The
|
|
740
|
-
visible_to: "The
|
|
739
|
+
changes: "The Campaign starts enrolling its Leads and running its Steps from its sending Accounts, paced on its schedule.",
|
|
740
|
+
visible_to: "The Leads each Step reaches on LinkedIn.",
|
|
741
741
|
budget_rows: [],
|
|
742
|
-
retry: "A retry on a started
|
|
743
|
-
undo: "`curviate
|
|
744
|
-
blast_radius: "Every
|
|
742
|
+
retry: "A retry on a started Campaign answers CAMPAIGN_STATUS_CONFLICT; nothing runs twice.",
|
|
743
|
+
undo: "`curviate campaign pause <campaign_id>` stops new Steps; what was sent stays sent.",
|
|
744
|
+
blast_radius: "Every Lead of its Lead lists, from every sending Account, each Step spending that Account's budgets (`curviate account get <account_id>`)."
|
|
745
745
|
},
|
|
746
|
-
errors: {
|
|
747
|
-
seeAlso: ["curviate
|
|
746
|
+
errors: { CAMPAIGN_NOT_STARTABLE: "a gap stops it (Lead list, sending Account, Sequence); each is listed.", CAMPAIGN_STATUS_CONFLICT: "only a draft starts.", ...ROLE_ERRORS, TIER_REQUIRED: "Campaigns need the Automate plan." },
|
|
747
|
+
seeAlso: ["curviate campaign preview", "curviate campaign pause"]
|
|
748
748
|
});
|
|
749
749
|
var pauseCmd = lifecycleCmd("pause", {
|
|
750
|
-
description: "Pause an active or scheduled
|
|
750
|
+
description: "Pause an active or scheduled Campaign: no Step runs until it is resumed. Waits keep their time.",
|
|
751
751
|
risk: "write",
|
|
752
752
|
rules: {
|
|
753
|
-
changes: "No Step of the
|
|
753
|
+
changes: "No Step of the Campaign runs while it is paused.",
|
|
754
754
|
visible_to: "Your Team.",
|
|
755
755
|
budget_rows: [],
|
|
756
|
-
retry: "Safe: a paused
|
|
757
|
-
undo: "`curviate
|
|
756
|
+
retry: "Safe: a paused Campaign answers CAMPAIGN_STATUS_CONFLICT.",
|
|
757
|
+
undo: "`curviate campaign resume <campaign_id>`."
|
|
758
758
|
},
|
|
759
|
-
errors: {
|
|
759
|
+
errors: { CAMPAIGN_STATUS_CONFLICT: "only an active or scheduled Campaign pauses.", ...ROLE_ERRORS },
|
|
760
760
|
seeAlso: SEE_LIFECYCLE
|
|
761
761
|
});
|
|
762
762
|
var resumeCmd = lifecycleCmd("resume", {
|
|
763
|
-
description: "Resume a paused
|
|
763
|
+
description: "Resume a paused Campaign. Runs the start checks again. Needs Automate.",
|
|
764
764
|
risk: "high",
|
|
765
765
|
rules: {
|
|
766
|
-
changes: "The
|
|
767
|
-
visible_to: "The
|
|
766
|
+
changes: "The Campaign's Steps run again from its sending Accounts.",
|
|
767
|
+
visible_to: "The Leads each Step reaches on LinkedIn.",
|
|
768
768
|
budget_rows: [],
|
|
769
|
-
retry: "A retry on a running
|
|
770
|
-
undo: "`curviate
|
|
771
|
-
blast_radius: "Every open Enrollment of the
|
|
769
|
+
retry: "A retry on a running Campaign answers CAMPAIGN_STATUS_CONFLICT.",
|
|
770
|
+
undo: "`curviate campaign pause <campaign_id>`; what was sent stays sent.",
|
|
771
|
+
blast_radius: "Every open Enrollment of the Campaign."
|
|
772
772
|
},
|
|
773
|
-
errors: {
|
|
773
|
+
errors: { CAMPAIGN_NOT_STARTABLE: "a gap stops it; each is listed.", CAMPAIGN_STATUS_CONFLICT: "only a paused Campaign resumes.", ...ROLE_ERRORS, TIER_REQUIRED: "Campaigns need the Automate plan." },
|
|
774
774
|
seeAlso: SEE_LIFECYCLE
|
|
775
775
|
});
|
|
776
776
|
var archiveCmd = lifecycleCmd("archive", {
|
|
777
|
-
description: "Archive a
|
|
777
|
+
description: "Archive a Campaign: its open Enrollments end (campaign_archived) and it never runs again.",
|
|
778
778
|
risk: "high",
|
|
779
779
|
rules: {
|
|
780
|
-
changes: "Ends every open Enrollment and freezes the
|
|
780
|
+
changes: "Ends every open Enrollment and freezes the Campaign.",
|
|
781
781
|
visible_to: "Your Team.",
|
|
782
782
|
budget_rows: [],
|
|
783
|
-
retry: "A retry answers
|
|
784
|
-
undo: "Cannot be undone. Create a new
|
|
785
|
-
blast_radius: "Every open Enrollment of the
|
|
783
|
+
retry: "A retry answers CAMPAIGN_STATUS_CONFLICT.",
|
|
784
|
+
undo: "Cannot be undone. Create a new Campaign from `curviate campaign get <campaign_id>` output.",
|
|
785
|
+
blast_radius: "Every open Enrollment of the Campaign."
|
|
786
786
|
},
|
|
787
|
-
errors: {
|
|
787
|
+
errors: { CAMPAIGN_STATUS_CONFLICT: "already archived.", ...ROLE_ERRORS },
|
|
788
788
|
seeAlso: SEE_LIFECYCLE
|
|
789
789
|
});
|
|
790
790
|
var deleteCmd = lifecycleCmd("delete", {
|
|
791
|
-
description: "Delete a draft
|
|
791
|
+
description: "Delete a draft Campaign with its Sequence versions. Any other status: archive it instead.",
|
|
792
792
|
risk: "high",
|
|
793
793
|
rules: {
|
|
794
794
|
changes: "Deletes the draft and its Sequence versions.",
|
|
795
795
|
visible_to: "Your Team.",
|
|
796
796
|
budget_rows: [],
|
|
797
797
|
retry: "A retry answers RESOURCE_NOT_FOUND.",
|
|
798
|
-
undo: "Cannot be undone. Keep `curviate
|
|
799
|
-
blast_radius: "One draft
|
|
798
|
+
undo: "Cannot be undone. Keep `curviate campaign get <campaign_id>` output to create it again.",
|
|
799
|
+
blast_radius: "One draft Campaign; it has no Enrollments."
|
|
800
800
|
},
|
|
801
|
-
errors: { RESOURCE_NOT_FOUND: "no
|
|
802
|
-
seeAlso: ["curviate
|
|
801
|
+
errors: { RESOURCE_NOT_FOUND: "no Campaign with this id.", CAMPAIGN_STATUS_CONFLICT: "only a draft is deleted; archive the others.", ...ROLE_ERRORS },
|
|
802
|
+
seeAlso: ["curviate campaign archive", "curviate campaign list"]
|
|
803
803
|
});
|
|
804
804
|
var previewCmd = defineCommand({
|
|
805
805
|
meta: {
|
|
806
806
|
name: "preview",
|
|
807
|
-
description: "What the
|
|
807
|
+
description: "What the Campaign would do, in any status: every path through its Sequence, rendered messages for sampled or named Leads, and the budget projection: per Account the pool that binds its pace, the expected actions a day (a draft: the mean daily invitations, messages and InMails of the first 7 days of its forecast, as if turned on now), and warnings (hours_below_share, no_sending_account). A read: never reaches LinkedIn, spends nothing.",
|
|
808
808
|
risk: "read",
|
|
809
|
-
examples: ["curviate
|
|
809
|
+
examples: ["curviate campaign preview mot_YOUR_CAMPAIGN_ID", "curviate campaign preview mot_YOUR_CAMPAIGN_ID --sample 3"]
|
|
810
810
|
},
|
|
811
811
|
args: {
|
|
812
812
|
...readOnly(READ_SINGLE_FLAGS),
|
|
813
813
|
id: ID,
|
|
814
|
-
sample: { type: "string", description: "How many
|
|
815
|
-
|
|
814
|
+
sample: { type: "string", description: "How many Leads to render (default 5)." },
|
|
815
|
+
lead: { type: "string", description: "A Lead id (con_...) to render; repeatable, or a comma list. Not with --sample." }
|
|
816
816
|
},
|
|
817
817
|
run: online(runPreview)
|
|
818
818
|
});
|
|
819
819
|
var membershipCmd = (kind) => defineCommand({
|
|
820
820
|
meta: {
|
|
821
821
|
name: kind,
|
|
822
|
-
description: kind === "add" ? "Enroll
|
|
822
|
+
description: kind === "add" ? "Enroll Leads directly, on an Account of the Campaign (--account) or one Curviate assigns. Every exclusion and filter applies; each Lead's outcome says what happened. Sent in requests of up to 1000 ids, in order. Needs Automate." : "Take Leads out of the Campaign: their open Enrollments end (removed). Sent in requests of up to 1000 ids, in order.",
|
|
823
823
|
risk: "high",
|
|
824
824
|
rules: kind === "add" ? {
|
|
825
|
-
changes: "Each queued
|
|
826
|
-
visible_to: "Your Team now; the
|
|
825
|
+
changes: "Each queued Lead becomes a pending Enrollment; a running Campaign reaches it on its schedule.",
|
|
826
|
+
visible_to: "Your Team now; the Leads once their Steps run.",
|
|
827
827
|
budget_rows: [],
|
|
828
|
-
retry: "Safe: a
|
|
829
|
-
undo: "`curviate
|
|
830
|
-
blast_radius: "Every
|
|
828
|
+
retry: "Safe: a Lead already in the Campaign answers already_enrolled. After a failed request, send the ids from the failed one on.",
|
|
829
|
+
undo: "`curviate campaign remove <campaign_id> --lead <lead_id>`; what was sent stays sent.",
|
|
830
|
+
blast_radius: "Every Lead given."
|
|
831
831
|
} : {
|
|
832
|
-
changes: "Ends each named
|
|
832
|
+
changes: "Ends each named Lead's open Enrollments in the Campaign (removed).",
|
|
833
833
|
visible_to: "Your Team.",
|
|
834
834
|
budget_rows: [],
|
|
835
|
-
retry: "Safe: a
|
|
836
|
-
undo: "`curviate
|
|
837
|
-
blast_radius: "Every
|
|
835
|
+
retry: "Safe: a Lead no longer in the Campaign is listed in not_found.",
|
|
836
|
+
undo: "`curviate campaign add <campaign_id> --lead <lead_id>` enrolls it again.",
|
|
837
|
+
blast_radius: "Every Lead given."
|
|
838
838
|
},
|
|
839
|
-
errors: {
|
|
839
|
+
errors: { CAMPAIGN_STATUS_CONFLICT: "an archived Campaign, or one past its end, takes no Leads.", ...ROLE_ERRORS },
|
|
840
840
|
seeAlso: ["curviate enrollment list"],
|
|
841
|
-
examples: kind === "add" ? ["curviate
|
|
841
|
+
examples: kind === "add" ? ["curviate campaign add mot_YOUR_CAMPAIGN_ID --lead con_YOUR_LEAD_ID", "curviate campaign add mot_YOUR_CAMPAIGN_ID --lead con_A,con_B --account acc_YOUR_ACCOUNT_ID"] : ["curviate campaign remove mot_YOUR_CAMPAIGN_ID --lead con_YOUR_LEAD_ID"]
|
|
842
842
|
},
|
|
843
843
|
args: {
|
|
844
844
|
...WRITE_SINGLE_FLAGS,
|
|
845
845
|
id: ID,
|
|
846
|
-
|
|
847
|
-
...kind === "add" ? { account: { type: "string", description: "Enroll them on this sending Account of the
|
|
846
|
+
lead: { type: "string", required: true, description: "A Lead id (con_...); repeatable, or a comma list." },
|
|
847
|
+
...kind === "add" ? { account: { type: "string", description: "Enroll them on this sending Account of the Campaign (acc_...). Never defaulted: omit it and Curviate assigns one." } } : {}
|
|
848
848
|
},
|
|
849
849
|
run: online(membership(kind))
|
|
850
850
|
});
|
|
@@ -852,15 +852,15 @@ var OFFLINE = { notes: ["Offline: no API call."] };
|
|
|
852
852
|
var lintCmd = defineCommand({
|
|
853
853
|
meta: {
|
|
854
854
|
name: "lint",
|
|
855
|
-
description: "Check a Sequence offline with the rules the API applies: a
|
|
855
|
+
description: "Check a Sequence offline with the rules the API applies: a Campaign file (its sequence) or a bare Sequence document. One line per finding, `<file>:<line>:<col> error|warning <code> <path>: <message>. <hint> -> <docs_url>`; exit 2 on any error, 0 otherwise.",
|
|
856
856
|
risk: "read",
|
|
857
857
|
rules: OFFLINE,
|
|
858
858
|
output: ["Findings on stderr. With --json (or piped), stdout carries `{errors, warnings}`, or on errors the SEQUENCE_INVALID refusal the API would send."],
|
|
859
|
-
examples: ["curviate
|
|
859
|
+
examples: ["curviate campaign lint --file campaign.json"]
|
|
860
860
|
},
|
|
861
861
|
args: {
|
|
862
862
|
json: GLOBAL_FLAGS.json,
|
|
863
|
-
file: { type: "string", stdinArg: true, required: true, description: "A
|
|
863
|
+
file: { type: "string", stdinArg: true, required: true, description: "A Campaign file or a Sequence document: a path, or - to read it from stdin." }
|
|
864
864
|
},
|
|
865
865
|
async run({ args }) {
|
|
866
866
|
await runLint(args);
|
|
@@ -869,11 +869,11 @@ var lintCmd = defineCommand({
|
|
|
869
869
|
var initCmd = defineCommand({
|
|
870
870
|
meta: {
|
|
871
871
|
name: "init",
|
|
872
|
-
description: `Write a
|
|
872
|
+
description: `Write a Campaign file from a template (${Object.keys(TEMPLATES).join(", ")}). Fill lead_list_ids and account_ids, then create it.`,
|
|
873
873
|
risk: "read",
|
|
874
874
|
rules: OFFLINE,
|
|
875
|
-
output: ["The
|
|
876
|
-
examples: ["curviate
|
|
875
|
+
output: ["The Campaign file on stdout, or in the --output file."],
|
|
876
|
+
examples: ["curviate campaign init --template connect-and-converse --output campaign.json"]
|
|
877
877
|
},
|
|
878
878
|
args: {
|
|
879
879
|
template: { type: "string", required: true, description: `One of ${Object.keys(TEMPLATES).join(", ")}.` },
|
|
@@ -889,7 +889,7 @@ var voiceClipUploadCmd = defineCommand({
|
|
|
889
889
|
description: "Upload one audio file (MP3, WAV, M4A, WebM or Ogg) and print the clip: its `id` (vc_...) is the `clip_id` of a `voice.send` step. 1 to 120 seconds, up to 20 MiB, 100 uploads per Team per 24 hours. The file is converted once and the original is discarded. Nothing reaches LinkedIn. Needs Automate.",
|
|
890
890
|
risk: "write",
|
|
891
891
|
rules: {
|
|
892
|
-
changes: "Stores one converted clip for your Team. No
|
|
892
|
+
changes: "Stores one converted clip for your Team. No Campaign changes and nothing is sent to anyone.",
|
|
893
893
|
visible_to: "Your Team.",
|
|
894
894
|
budget_rows: [],
|
|
895
895
|
retry: "A retry stores a second clip (it counts toward the 24-hour cap); an unused clip is deleted 30 days after its upload.",
|
|
@@ -903,8 +903,8 @@ var voiceClipUploadCmd = defineCommand({
|
|
|
903
903
|
TIER_REQUIRED: "Voice clips need the Automate plan.",
|
|
904
904
|
...ROLE_ERRORS
|
|
905
905
|
},
|
|
906
|
-
seeAlso: ["curviate
|
|
907
|
-
examples: ["curviate
|
|
906
|
+
seeAlso: ["curviate campaign voice-clip get", "curviate campaign lint", "curviate campaign create"],
|
|
907
|
+
examples: ["curviate campaign voice-clip upload intro.mp3", "curviate campaign voice-clip upload intro.m4a --preview"]
|
|
908
908
|
},
|
|
909
909
|
args: {
|
|
910
910
|
...WRITE_SINGLE_FLAGS,
|
|
@@ -917,7 +917,7 @@ var voiceClipGetCmd = defineCommand({
|
|
|
917
917
|
name: "get",
|
|
918
918
|
description: "One Voice clip: duration, size, file name and upload time. No download link. Another Team's clip is RESOURCE_NOT_FOUND, like an unknown id.",
|
|
919
919
|
risk: "read",
|
|
920
|
-
examples: ["curviate
|
|
920
|
+
examples: ["curviate campaign voice-clip get vc_YOUR_CLIP_ID"]
|
|
921
921
|
},
|
|
922
922
|
args: {
|
|
923
923
|
...readOnly(READ_SINGLE_FLAGS),
|
|
@@ -926,15 +926,15 @@ var voiceClipGetCmd = defineCommand({
|
|
|
926
926
|
run: online(runVoiceClipGet)
|
|
927
927
|
});
|
|
928
928
|
var voiceClipCommand = defineCommand({
|
|
929
|
-
meta: { name: "voice-clip", description: DESCRIPTIONS.
|
|
929
|
+
meta: { name: "voice-clip", description: DESCRIPTIONS.campaignVoiceClip },
|
|
930
930
|
subCommands: { upload: voiceClipUploadCmd, get: voiceClipGetCmd },
|
|
931
931
|
async run() {
|
|
932
|
-
const { showHelp } = await import("./examples-
|
|
933
|
-
await showHelp(voiceClipCommand, ["curviate", "
|
|
932
|
+
const { showHelp } = await import("./examples-77WVMKZQ.js");
|
|
933
|
+
await showHelp(voiceClipCommand, ["curviate", "campaign", "voice-clip"]);
|
|
934
934
|
}
|
|
935
935
|
});
|
|
936
|
-
var
|
|
937
|
-
meta: { name: "
|
|
936
|
+
var campaignCommand = defineCommand({
|
|
937
|
+
meta: { name: "campaign", description: DESCRIPTIONS.campaign },
|
|
938
938
|
subCommands: {
|
|
939
939
|
list: listCmd,
|
|
940
940
|
get: getCmd,
|
|
@@ -953,14 +953,14 @@ var motionCommand = defineCommand({
|
|
|
953
953
|
"voice-clip": voiceClipCommand
|
|
954
954
|
},
|
|
955
955
|
async run() {
|
|
956
|
-
const { showHelp } = await import("./examples-
|
|
957
|
-
await showHelp(
|
|
956
|
+
const { showHelp } = await import("./examples-77WVMKZQ.js");
|
|
957
|
+
await showHelp(campaignCommand, ["curviate", "campaign"]);
|
|
958
958
|
}
|
|
959
959
|
});
|
|
960
960
|
export {
|
|
961
961
|
BULK_MAX_IDS,
|
|
962
962
|
TEMPLATES,
|
|
963
|
-
|
|
963
|
+
campaignCommand,
|
|
964
964
|
runInit,
|
|
965
965
|
runLint
|
|
966
966
|
};
|