@curviate/cli 0.49.0 → 0.50.0-next.1
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 +26 -0
- package/README.md +12 -5
- package/dist/{account-2BH2Q6VG.js → account-U7UJIE3H.js} +784 -116
- package/dist/analytics-MZU2WKON.js +27 -0
- package/dist/beta-consent-67IDUV3K.js +81 -0
- package/dist/billing-QAW75YE7.js +124 -0
- package/dist/{chunk-RXWODUWA.js → chunk-2W4RN5ON.js} +18 -2
- package/dist/{chunk-MGB6FE4A.js → chunk-3Z6PXS6N.js} +6 -6
- package/dist/chunk-5S3MJVI5.js +22 -0
- package/dist/{chunk-V7FJWTZW.js → chunk-6LBOGIVE.js} +4 -4
- package/dist/{chunk-Z7OQSWBD.js → chunk-6PLDAEMO.js} +85 -10
- package/dist/chunk-73DJ3KNE.js +54 -0
- package/dist/{chunk-3RCW7URJ.js → chunk-A57ZILRU.js} +1 -1
- package/dist/chunk-AVI7J47S.js +52 -0
- package/dist/{chunk-JYKYD57J.js → chunk-CKVCBGQX.js} +1 -1
- package/dist/chunk-EIA66ESN.js +339 -0
- package/dist/{chunk-YLSJ4HKU.js → chunk-ENBIMEKS.js} +26 -1
- package/dist/{chunk-LCGXJGPB.js → chunk-GHMRPX5H.js} +7 -1
- package/dist/chunk-GOICALYQ.js +28 -0
- package/dist/{chunk-PQWDDSV7.js → chunk-L7JH3W56.js} +1 -1
- package/dist/chunk-LCPPXOPN.js +528 -0
- package/dist/chunk-LRMPS4UQ.js +144 -0
- package/dist/{chunk-5ZGTU4VD.js → chunk-LULN3II2.js} +78 -5
- package/dist/chunk-PPGKQJKU.js +38 -0
- package/dist/chunk-Q3ZPRFUX.js +20 -0
- package/dist/{chunk-SA2QHAXG.js → chunk-QM57YDJE.js} +13 -201
- package/dist/{chunk-Y7MZZRYR.js → chunk-RYWWSZUH.js} +14 -2
- package/dist/{chunk-TEAWYLPO.js → chunk-TYNVJDYK.js} +49 -18
- package/dist/cli.js +34 -18
- package/dist/{comment-MRDPDA33.js → comment-6NRZILAS.js} +90 -11
- package/dist/{company-2AEHSGHA.js → company-VXE7IEPT.js} +65 -15
- package/dist/{config-NRBKHXES.js → config-3WP7OD35.js} +53 -4
- package/dist/{connect-4XEBV5V3.js → connect-FBK6UWZP.js} +63 -18
- package/dist/contact-HFPZ3KGL.js +32 -0
- package/dist/contact-groups-AI4MLGQS.js +399 -0
- package/dist/contact-import-54Y7EMU2.js +336 -0
- package/dist/core-RLMWMQEI.js +46 -0
- package/dist/do-not-contact-LQ5V6SPE.js +200 -0
- package/dist/{doctor-BZ4DA7DV.js → doctor-KKRL7TEF.js} +65 -11
- package/dist/{document-RKHRWXNT.js → document-GFRWPQFV.js} +1 -1
- package/dist/{draft-C5N6EOO5.js → draft-VSWZOCDR.js} +60 -14
- package/dist/{enrollment-BNQOUKI7.js → enrollment-OACCSBM5.js} +31 -19
- package/dist/{examples-NIMSIXMV.js → examples-JJB4DZKK.js} +2 -2
- package/dist/{exit-codes-TLMKTLRI.js → exit-codes-7DBETBDT.js} +1 -1
- package/dist/export-AQHAFVAB.js +96 -0
- package/dist/{feed-DFUU7SUJ.js → feed-HY4HT75U.js} +13 -10
- package/dist/{group-CSD2OWOZ.js → group-A3SMBFU5.js} +18 -10
- package/dist/{inbox-SNSPWI7J.js → inbox-YHUO2RPI.js} +31 -12
- package/dist/{inboxes-RIRHPS4H.js → inboxes-GKLMHPDR.js} +14 -10
- package/dist/incoming-NHROOOIZ.js +218 -0
- package/dist/{job-6PNXXZNF.js → job-QBW3PGWL.js} +65 -13
- package/dist/{login-Y7JBAHCW.js → login-GWIYHKYO.js} +13 -4
- package/dist/{message-2IK4MBBG.js → message-BFLN2VHS.js} +9 -7
- package/dist/{motion-7ATUXO6R.js → motion-LTWU2GPC.js} +39 -117
- package/dist/network-CNSBX2SR.js +235 -0
- package/dist/{notification-VYK5NDEB.js → notification-DCCFJPXU.js} +38 -11
- package/dist/notifications-AQBXBK4K.js +231 -0
- package/dist/{post-AN6T2OJF.js → post-PINZHSPS.js} +92 -12
- package/dist/{profile-UQY64642.js → profile-MJQJSNYR.js} +76 -20
- package/dist/{recruiter-OY4RN5HH.js → recruiter-X6GX4A2G.js} +133 -22
- package/dist/{sales-nav-KLODLYMW.js → sales-nav-44GYWDYE.js} +74 -19
- package/dist/{search-NWP5S6CF.js → search-SULIN6TB.js} +55 -23
- package/dist/{setup-YPPFLH2N.js → setup-ZQRHMRMB.js} +69 -17
- package/dist/team-TM6LRUY5.js +450 -0
- package/dist/tier-Z3U6AT7H.js +61 -0
- package/dist/unibox-BIMI2KY5.js +402 -0
- package/dist/{webhook-OHKBL3YS.js → webhook-EHXRTHBG.js} +257 -27
- package/package.json +2 -2
- package/dist/chunk-D2S5OCYU.js +0 -38
- package/dist/core-RGU2SCBN.js +0 -46
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
GRAMMAR_ARGS,
|
|
4
|
+
WINDOW_ARGS,
|
|
5
|
+
analyticsCommand,
|
|
6
|
+
grammarParams,
|
|
7
|
+
renderOverview,
|
|
8
|
+
windowParams
|
|
9
|
+
} from "./chunk-EIA66ESN.js";
|
|
10
|
+
import "./chunk-5S3MJVI5.js";
|
|
11
|
+
import "./chunk-PPGKQJKU.js";
|
|
12
|
+
import "./chunk-3Z6PXS6N.js";
|
|
13
|
+
import "./chunk-NNV2OYEF.js";
|
|
14
|
+
import "./chunk-LRMPS4UQ.js";
|
|
15
|
+
import "./chunk-QM57YDJE.js";
|
|
16
|
+
import "./chunk-LULN3II2.js";
|
|
17
|
+
import "./chunk-RYWWSZUH.js";
|
|
18
|
+
import "./chunk-73DJ3KNE.js";
|
|
19
|
+
import "./chunk-ZYURL5VK.js";
|
|
20
|
+
export {
|
|
21
|
+
GRAMMAR_ARGS,
|
|
22
|
+
WINDOW_ARGS,
|
|
23
|
+
analyticsCommand,
|
|
24
|
+
grammarParams,
|
|
25
|
+
renderOverview,
|
|
26
|
+
windowParams
|
|
27
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
fail,
|
|
4
|
+
outputOpts,
|
|
5
|
+
rootClient,
|
|
6
|
+
usage
|
|
7
|
+
} from "./chunk-3Z6PXS6N.js";
|
|
8
|
+
import {
|
|
9
|
+
buildPreviewOutput
|
|
10
|
+
} from "./chunk-TCUYH5GO.js";
|
|
11
|
+
import {
|
|
12
|
+
renderSuccess
|
|
13
|
+
} from "./chunk-QM57YDJE.js";
|
|
14
|
+
import "./chunk-LULN3II2.js";
|
|
15
|
+
import {
|
|
16
|
+
READ_SINGLE_FLAGS,
|
|
17
|
+
WRITE_SINGLE_FLAGS,
|
|
18
|
+
readOnly
|
|
19
|
+
} from "./chunk-RYWWSZUH.js";
|
|
20
|
+
import {
|
|
21
|
+
DESCRIPTIONS
|
|
22
|
+
} from "./chunk-73DJ3KNE.js";
|
|
23
|
+
import "./chunk-ZYURL5VK.js";
|
|
24
|
+
|
|
25
|
+
// src/commands/beta-consent.ts
|
|
26
|
+
import { defineCommand } from "citty";
|
|
27
|
+
async function runStatus(c, f) {
|
|
28
|
+
try {
|
|
29
|
+
renderSuccess(await c.tenant.beta.get(), outputOpts(f), process);
|
|
30
|
+
} catch (err) {
|
|
31
|
+
await fail(err, f);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async function runUpdate(c, f) {
|
|
35
|
+
if (f.enabled !== "true" && f.enabled !== "false") usage("--enabled takes true or false.");
|
|
36
|
+
const body = { beta_enabled: f.enabled === "true" };
|
|
37
|
+
if (f.preview) return void process.stdout.write(JSON.stringify(buildPreviewOutput({ method: "tenant.beta.set", args: {}, body })) + "\n");
|
|
38
|
+
try {
|
|
39
|
+
renderSuccess(await c.tenant.beta.set(body), outputOpts(f), process);
|
|
40
|
+
} catch (err) {
|
|
41
|
+
await fail(err, f);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
var online = (fn) => async ({ args }) => {
|
|
45
|
+
const f = args;
|
|
46
|
+
await fn(await rootClient(f), f);
|
|
47
|
+
};
|
|
48
|
+
var statusCmd = defineCommand({
|
|
49
|
+
meta: { name: "status", description: "Whether beta operations run for your Team without --beta.", risk: "read", examples: ["curviate beta status"] },
|
|
50
|
+
args: readOnly(READ_SINGLE_FLAGS),
|
|
51
|
+
run: online(runStatus)
|
|
52
|
+
});
|
|
53
|
+
var updateCmd = defineCommand({
|
|
54
|
+
meta: {
|
|
55
|
+
name: "update",
|
|
56
|
+
description: "Turn the Team's beta consent on or off. Owners only. On: beta operations run without --beta for every key of the Team.",
|
|
57
|
+
risk: "write",
|
|
58
|
+
rules: {
|
|
59
|
+
changes: "Sets the Team's beta consent.",
|
|
60
|
+
visible_to: "Your Team.",
|
|
61
|
+
budget_rows: [],
|
|
62
|
+
retry: "Safe to repeat: the same setting again.",
|
|
63
|
+
undo: "Run it with the other value."
|
|
64
|
+
},
|
|
65
|
+
errors: { INSUFFICIENT_ROLE: "only an Owner can change it." },
|
|
66
|
+
examples: ["curviate beta update --enabled true"]
|
|
67
|
+
},
|
|
68
|
+
args: { ...WRITE_SINGLE_FLAGS, enabled: { type: "string", required: true, description: "true or false." } },
|
|
69
|
+
run: online(runUpdate)
|
|
70
|
+
});
|
|
71
|
+
var betaCommand = defineCommand({
|
|
72
|
+
meta: { name: "beta", description: DESCRIPTIONS.beta },
|
|
73
|
+
subCommands: { status: statusCmd, update: updateCmd },
|
|
74
|
+
async run() {
|
|
75
|
+
const { showHelp } = await import("./examples-JJB4DZKK.js");
|
|
76
|
+
await showHelp(betaCommand, ["curviate", "beta"]);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
export {
|
|
80
|
+
betaCommand
|
|
81
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
writeAtomic
|
|
4
|
+
} from "./chunk-GOICALYQ.js";
|
|
5
|
+
import {
|
|
6
|
+
fail,
|
|
7
|
+
outputOpts,
|
|
8
|
+
rootClient,
|
|
9
|
+
usage
|
|
10
|
+
} from "./chunk-3Z6PXS6N.js";
|
|
11
|
+
import {
|
|
12
|
+
intFlag
|
|
13
|
+
} from "./chunk-NNV2OYEF.js";
|
|
14
|
+
import {
|
|
15
|
+
pageDelayFromFlags,
|
|
16
|
+
readCursorFlag,
|
|
17
|
+
readMaxPagesFlag,
|
|
18
|
+
readablePage,
|
|
19
|
+
rejectPaginationModifiersWithoutAll,
|
|
20
|
+
streamAll
|
|
21
|
+
} from "./chunk-LRMPS4UQ.js";
|
|
22
|
+
import {
|
|
23
|
+
renderSuccess,
|
|
24
|
+
writeNdjsonItem
|
|
25
|
+
} from "./chunk-QM57YDJE.js";
|
|
26
|
+
import {
|
|
27
|
+
downloadBinary
|
|
28
|
+
} from "./chunk-LULN3II2.js";
|
|
29
|
+
import {
|
|
30
|
+
GLOBAL_FLAGS,
|
|
31
|
+
readOnly
|
|
32
|
+
} from "./chunk-RYWWSZUH.js";
|
|
33
|
+
import {
|
|
34
|
+
DESCRIPTIONS
|
|
35
|
+
} from "./chunk-73DJ3KNE.js";
|
|
36
|
+
import "./chunk-ZYURL5VK.js";
|
|
37
|
+
|
|
38
|
+
// src/commands/billing.ts
|
|
39
|
+
import { defineCommand } from "citty";
|
|
40
|
+
var online = (fn) => async ({ args }) => {
|
|
41
|
+
const f = args;
|
|
42
|
+
await fn(await rootClient(f), f);
|
|
43
|
+
};
|
|
44
|
+
async function runList(c, f) {
|
|
45
|
+
rejectPaginationModifiersWithoutAll(f, process);
|
|
46
|
+
const params = {};
|
|
47
|
+
if (f.limit !== void 0) params["limit"] = intFlag("limit", f.limit, 1, 100);
|
|
48
|
+
const cursor = readCursorFlag(f, process);
|
|
49
|
+
if (cursor) params["cursor"] = cursor;
|
|
50
|
+
try {
|
|
51
|
+
if (f.all) {
|
|
52
|
+
const page = (p) => c.billing.invoices.list(p);
|
|
53
|
+
for await (const item of streamAll(page, params, { maxPages: readMaxPagesFlag(f, process), out: process, pageDelayMs: pageDelayFromFlags(f) })) writeNdjsonItem(process, item, f.fields);
|
|
54
|
+
} else {
|
|
55
|
+
renderSuccess(readablePage(await c.billing.invoices.list(params)), outputOpts(f), process);
|
|
56
|
+
}
|
|
57
|
+
} catch (err) {
|
|
58
|
+
await fail(err, f);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
async function runPdf(c, f) {
|
|
62
|
+
const number = String(f.number ?? "");
|
|
63
|
+
if (number.trim() === "") usage("the invoice number is empty. Take it from `curviate billing invoices`.");
|
|
64
|
+
if (f.output === void 0 || f.output.trim() === "") usage("-o <file> is required: the PDF is written there, or to stdout with -o - when stdout is not a terminal.");
|
|
65
|
+
if (f.output === "-" && process.stdout.isTTY) usage("-o - would write a PDF to the terminal. Pass a file name.");
|
|
66
|
+
let bytes;
|
|
67
|
+
try {
|
|
68
|
+
bytes = Buffer.from(await downloadBinary(() => c.billing.invoices.pdf(number)));
|
|
69
|
+
} catch (err) {
|
|
70
|
+
return fail(err, f);
|
|
71
|
+
}
|
|
72
|
+
if (f.output === "-") process.stdout.write(bytes);
|
|
73
|
+
else {
|
|
74
|
+
try {
|
|
75
|
+
writeAtomic(f.output, bytes);
|
|
76
|
+
} catch (err) {
|
|
77
|
+
usage(`-o: cannot write ${f.output}: ${err.code ?? "write error"}.`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
process.stderr.write(`Invoice ${number}: ${bytes.length} bytes${f.output === "-" ? "" : ` written to ${f.output}`}.
|
|
81
|
+
`);
|
|
82
|
+
}
|
|
83
|
+
var pdfCmd = defineCommand({
|
|
84
|
+
meta: {
|
|
85
|
+
name: "pdf",
|
|
86
|
+
description: "Download one invoice as a PDF, by its number from `curviate billing invoices`. Owners only. The file is written whole or not at all.",
|
|
87
|
+
risk: "read",
|
|
88
|
+
output: ["The PDF bytes, to -o <file> (replaced whole on success) or, with -o -, to stdout; a byte count on stderr."],
|
|
89
|
+
examples: ["curviate billing invoices pdf INV-0001 -o invoice.pdf"]
|
|
90
|
+
},
|
|
91
|
+
args: {
|
|
92
|
+
"api-key": GLOBAL_FLAGS["api-key"],
|
|
93
|
+
profile: GLOBAL_FLAGS.profile,
|
|
94
|
+
team: GLOBAL_FLAGS.team,
|
|
95
|
+
"base-url": GLOBAL_FLAGS["base-url"],
|
|
96
|
+
timeout: GLOBAL_FLAGS.timeout,
|
|
97
|
+
number: { type: "positional", description: "The invoice number, from the invoice list." },
|
|
98
|
+
output: { type: "string", alias: "o", required: true, description: "Write the PDF to this path, or - for stdout." }
|
|
99
|
+
},
|
|
100
|
+
run: online(runPdf)
|
|
101
|
+
});
|
|
102
|
+
var invoicesCmd = defineCommand({
|
|
103
|
+
meta: {
|
|
104
|
+
name: "invoices",
|
|
105
|
+
description: "List your Team's issued invoices, newest first: number, amount (in the currency's smallest unit), status and service period. No links: download a PDF by its number. Owners only.",
|
|
106
|
+
risk: "read",
|
|
107
|
+
output: ["`items` (number, created_at, period_start, period_end, total, currency, status) and a `cursor`; with --all, one invoice per line."],
|
|
108
|
+
examples: ["curviate billing invoices", "curviate billing invoices --json --limit 12"]
|
|
109
|
+
},
|
|
110
|
+
args: { ...readOnly(GLOBAL_FLAGS) },
|
|
111
|
+
subCommands: { pdf: pdfCmd },
|
|
112
|
+
run: online(runList)
|
|
113
|
+
});
|
|
114
|
+
var billingCommand = defineCommand({
|
|
115
|
+
meta: { name: "billing", description: DESCRIPTIONS.billing },
|
|
116
|
+
subCommands: { invoices: invoicesCmd },
|
|
117
|
+
async run() {
|
|
118
|
+
const { showHelp } = await import("./examples-JJB4DZKK.js");
|
|
119
|
+
await showHelp(billingCommand, ["curviate", "billing"]);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
export {
|
|
123
|
+
billingCommand
|
|
124
|
+
};
|
|
@@ -30,11 +30,19 @@ var EXIT_CODE_MAP = {
|
|
|
30
30
|
ACCOUNT_REQUIRED: 2,
|
|
31
31
|
DRAFT_NOT_PUBLISHABLE: 2,
|
|
32
32
|
SCHEDULE_CONFLICT: 2,
|
|
33
|
+
TEAM_REQUIRED: 2,
|
|
34
|
+
NOTHING_TO_REDELIVER: 2,
|
|
35
|
+
WEBHOOK_DISABLED: 2,
|
|
36
|
+
WEBHOOK_TEMPLATE_INVALID: 2,
|
|
33
37
|
// Not found (4)
|
|
34
38
|
RESOURCE_NOT_FOUND: 4,
|
|
35
39
|
ACCOUNT_NOT_FOUND: 4,
|
|
36
40
|
SUBSCRIPTION_NOT_FOUND: 4,
|
|
37
41
|
SEAT_NOT_FOUND: 4,
|
|
42
|
+
EXPORT_EXPIRED: 4,
|
|
43
|
+
EXPORT_REMOVED: 4,
|
|
44
|
+
REDELIVERY_EXPIRED: 4,
|
|
45
|
+
INCOMING_URL_RETIRED: 4,
|
|
38
46
|
// Entitlement (5), three independent refusals, see the note above
|
|
39
47
|
NO_ACTIVE_SEAT: 5,
|
|
40
48
|
LINKEDIN_FEATURE_NOT_SUBSCRIBED: 5,
|
|
@@ -50,6 +58,9 @@ var EXIT_CODE_MAP = {
|
|
|
50
58
|
// 7: a publish of this Draft is in flight (or being settled); read it again
|
|
51
59
|
// in a few seconds. A busy state, not a malformed request.
|
|
52
60
|
DRAFT_PUBLISHING: 7,
|
|
61
|
+
EXPORT_IN_PROGRESS: 7,
|
|
62
|
+
EXPORT_NOT_READY: 7,
|
|
63
|
+
DELIVERY_IN_FLIGHT: 7,
|
|
53
64
|
// Account / connection state (8)
|
|
54
65
|
ACCOUNT_RESTRICTED: 8,
|
|
55
66
|
RESOURCE_ACCESS_RESTRICTED: 8,
|
|
@@ -68,6 +79,7 @@ var EXIT_CODE_MAP = {
|
|
|
68
79
|
// cannot land there, which is account/connection state. user_fixable, not
|
|
69
80
|
// retryable as sent: pick a nearby country or allow fallback.
|
|
70
81
|
CONNECTION_LOCATION_UNAVAILABLE: 8,
|
|
82
|
+
LINKEDIN_SIGN_IN_REQUIRED: 8,
|
|
71
83
|
// Checkpoint flow (9)
|
|
72
84
|
CHECKPOINT_NOT_FOUND: 9,
|
|
73
85
|
CHECKPOINT_EXPIRED: 9,
|
|
@@ -78,11 +90,14 @@ var EXIT_CODE_MAP = {
|
|
|
78
90
|
// Messaging window / recipient (10)
|
|
79
91
|
MESSAGE_WINDOW_EXPIRED: 10,
|
|
80
92
|
RECIPIENT_UNREACHABLE: 10,
|
|
93
|
+
CHAT_NOT_VISIBLE: 10,
|
|
94
|
+
DO_NOT_CONTACT: 10,
|
|
81
95
|
// Billing (11)
|
|
82
96
|
PAYMENT_REQUIRED: 11,
|
|
83
97
|
PAYMENT_FAILED: 11,
|
|
84
98
|
SUBSCRIPTION_BUSY: 11,
|
|
85
99
|
SEAT_CANCELLED: 11,
|
|
100
|
+
SEAT_LENT: 11,
|
|
86
101
|
// Account-safety budget (13), see the note above for why this is not 6
|
|
87
102
|
BUDGET_EXHAUSTED: 13,
|
|
88
103
|
// Nothing stored (14), A NEW BUCKET, and deliberately not 4.
|
|
@@ -173,8 +188,9 @@ var EXIT_CODE_MAP = {
|
|
|
173
188
|
INVITE_ALREADY_PENDING: 2,
|
|
174
189
|
INVITE_NOT_PENDING: 2,
|
|
175
190
|
INVITE_LIMIT_REACHED: 2,
|
|
176
|
-
|
|
177
|
-
|
|
191
|
+
// 8: the request's state forbids it (connection state), not a usage error: the same input works on a pending one.
|
|
192
|
+
CONNECT_REQUEST_NOT_PENDING: 8,
|
|
193
|
+
CONNECT_REQUEST_IN_USE: 8,
|
|
178
194
|
LINKEDIN_ACCOUNT_MISMATCH: 8,
|
|
179
195
|
// Contacts: a cap or a name clash never succeeds as sent; a full import queue drains (6).
|
|
180
196
|
NAME_TAKEN: 2,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
renderError,
|
|
4
|
-
renderUnexpectedError
|
|
5
|
-
|
|
6
|
-
} from "./chunk-SA2QHAXG.js";
|
|
4
|
+
renderUnexpectedError
|
|
5
|
+
} from "./chunk-QM57YDJE.js";
|
|
7
6
|
import {
|
|
8
|
-
createClient
|
|
9
|
-
|
|
7
|
+
createClient,
|
|
8
|
+
resolveEffectiveConfig
|
|
9
|
+
} from "./chunk-LULN3II2.js";
|
|
10
10
|
|
|
11
11
|
// src/lib/root-command.ts
|
|
12
12
|
var outputOpts = (f) => ({
|
|
@@ -35,7 +35,7 @@ async function rootClient(f) {
|
|
|
35
35
|
async function fail(err, f) {
|
|
36
36
|
const { CurviateError } = await import("@curviate/sdk");
|
|
37
37
|
if (err instanceof CurviateError) {
|
|
38
|
-
const { getExitCode } = await import("./exit-codes-
|
|
38
|
+
const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
|
|
39
39
|
renderError(err, outputOpts(f), process);
|
|
40
40
|
process.exit(getExitCode(err));
|
|
41
41
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/lib/table.ts
|
|
4
|
+
var cell = (v) => v === null || v === void 0 || v === "" ? "-" : typeof v === "object" ? JSON.stringify(v) : String(v);
|
|
5
|
+
function table(head, rows) {
|
|
6
|
+
const cells = rows.map((r) => head.map((_, i) => cell(r[i])));
|
|
7
|
+
const w = head.map((h, i) => Math.max(h.length, ...cells.map((r) => r[i].length)));
|
|
8
|
+
return [head, ...cells].map((r) => r.map((c, i) => c.padEnd(w[i])).join(" ").trimEnd()).join("\n");
|
|
9
|
+
}
|
|
10
|
+
function rate(o, num, den) {
|
|
11
|
+
const r = o;
|
|
12
|
+
if (!r || typeof r !== "object") return "-";
|
|
13
|
+
const pct = typeof r["rate"] === "number" ? ` ${Math.round(r["rate"] * 100)}%` : "";
|
|
14
|
+
return `${cell(r[num])}/${cell(r[den])}${pct}`;
|
|
15
|
+
}
|
|
16
|
+
var print = (text) => void process.stdout.write(text + "\n");
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
table,
|
|
20
|
+
rate,
|
|
21
|
+
print
|
|
22
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readablePage
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
getExitCode
|
|
7
|
-
} from "./chunk-RXWODUWA.js";
|
|
4
|
+
} from "./chunk-LRMPS4UQ.js";
|
|
8
5
|
import {
|
|
9
6
|
assertNoStdinPlaceholder
|
|
10
7
|
} from "./chunk-ZYURL5VK.js";
|
|
8
|
+
import {
|
|
9
|
+
getExitCode
|
|
10
|
+
} from "./chunk-2W4RN5ON.js";
|
|
11
11
|
|
|
12
12
|
// src/lib/path-safety.ts
|
|
13
13
|
var UNSAFE_CHARS = /[\u0000-\u0020\u007F/\\?#%]/;
|
|
@@ -8,36 +8,43 @@ import {
|
|
|
8
8
|
BinaryOutputError,
|
|
9
9
|
writeBinaryOutput
|
|
10
10
|
} from "./chunk-UWO2D4HW.js";
|
|
11
|
+
import {
|
|
12
|
+
AS_ACCOUNT,
|
|
13
|
+
BUDGET,
|
|
14
|
+
TARGET
|
|
15
|
+
} from "./chunk-Q3ZPRFUX.js";
|
|
11
16
|
import {
|
|
12
17
|
normalizeChatId,
|
|
13
18
|
resolveIdentifier
|
|
14
19
|
} from "./chunk-UEAX6KUB.js";
|
|
15
20
|
import {
|
|
16
21
|
requireAccount
|
|
17
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-6LBOGIVE.js";
|
|
18
23
|
import {
|
|
19
24
|
buildPreviewOutput
|
|
20
25
|
} from "./chunk-TCUYH5GO.js";
|
|
21
26
|
import {
|
|
22
27
|
readableId,
|
|
23
|
-
readableObject
|
|
28
|
+
readableObject
|
|
29
|
+
} from "./chunk-LRMPS4UQ.js";
|
|
30
|
+
import {
|
|
24
31
|
renderError,
|
|
25
32
|
renderSuccess,
|
|
26
|
-
renderUnexpectedError
|
|
27
|
-
|
|
28
|
-
} from "./chunk-SA2QHAXG.js";
|
|
33
|
+
renderUnexpectedError
|
|
34
|
+
} from "./chunk-QM57YDJE.js";
|
|
29
35
|
import {
|
|
30
36
|
createClient,
|
|
31
|
-
downloadBinary
|
|
32
|
-
|
|
37
|
+
downloadBinary,
|
|
38
|
+
resolveEffectiveConfig
|
|
39
|
+
} from "./chunk-LULN3II2.js";
|
|
33
40
|
import {
|
|
34
41
|
READ_SINGLE_FLAGS,
|
|
35
42
|
WRITE_FLAGS,
|
|
36
43
|
readOnly
|
|
37
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-RYWWSZUH.js";
|
|
38
45
|
import {
|
|
39
46
|
DESCRIPTIONS
|
|
40
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-73DJ3KNE.js";
|
|
41
48
|
import {
|
|
42
49
|
looksLikeCommandWord,
|
|
43
50
|
nearestSubcommand
|
|
@@ -110,7 +117,7 @@ var MEMBER_PROVIDER_ID_RE = /^A[CDE][A-Za-z0-9_-]{4,}$/;
|
|
|
110
117
|
async function handleSdkError(err, outOpts, out) {
|
|
111
118
|
const { CurviateError } = await import("@curviate/sdk");
|
|
112
119
|
if (err instanceof CurviateError) {
|
|
113
|
-
const { getExitCode } = await import("./exit-codes-
|
|
120
|
+
const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
|
|
114
121
|
renderError(err, outOpts, out);
|
|
115
122
|
process.exit(getExitCode(err));
|
|
116
123
|
}
|
|
@@ -421,6 +428,15 @@ var messageNewCommand = defineCommand({
|
|
|
421
428
|
meta: {
|
|
422
429
|
name: "new",
|
|
423
430
|
description: "Start a new chat with one or more members.",
|
|
431
|
+
risk: "write",
|
|
432
|
+
rules: {
|
|
433
|
+
changes: "Starts a chat with the recipient and sends the opening message from your Account.",
|
|
434
|
+
visible_to: "The recipient, in their LinkedIn inbox.",
|
|
435
|
+
budget_rows: ["messages_first_degree"],
|
|
436
|
+
retry: "Not safe: requests carry no idempotency key, so a retry after a timeout can repeat it. Read `curviate core inbox list` first.",
|
|
437
|
+
undo: "`curviate core message delete <chat_id> <message_id>` removes the message; the chat stays and the recipient may have read it."
|
|
438
|
+
},
|
|
439
|
+
errors: { ...AS_ACCOUNT, ...BUDGET, ...TARGET, RECIPIENT_UNREACHABLE: "LinkedIn will not let the Account message this person." },
|
|
424
440
|
examples: [
|
|
425
441
|
'curviate core message new --to janesmith "Hi Jane, enjoyed your post on agent evals."'
|
|
426
442
|
]
|
|
@@ -462,6 +478,7 @@ var messageGetCommand = defineCommand({
|
|
|
462
478
|
meta: {
|
|
463
479
|
name: "get",
|
|
464
480
|
description: "Get a message by ID.",
|
|
481
|
+
risk: "read",
|
|
465
482
|
examples: [
|
|
466
483
|
"curviate core message get 2-YTQ3ODU3Njgt MSG_ID"
|
|
467
484
|
]
|
|
@@ -494,6 +511,15 @@ var messageEditCommand = defineCommand({
|
|
|
494
511
|
meta: {
|
|
495
512
|
name: "edit",
|
|
496
513
|
description: "Edit a message (within the allowed window).",
|
|
514
|
+
risk: "write",
|
|
515
|
+
rules: {
|
|
516
|
+
changes: "Replaces the text of one of your messages.",
|
|
517
|
+
visible_to: "The other participants of the chat.",
|
|
518
|
+
budget_rows: [],
|
|
519
|
+
retry: "Safe: the same text written again leaves the message the same.",
|
|
520
|
+
undo: "Edit it again with the previous text, while LinkedIn still allows edits."
|
|
521
|
+
},
|
|
522
|
+
errors: { ...AS_ACCOUNT, ...TARGET },
|
|
497
523
|
examples: [
|
|
498
524
|
'curviate core message edit 2-YTQ3ODU3Njgt MSG_ID "Thanks, that makes sense to me."'
|
|
499
525
|
]
|
|
@@ -527,6 +553,17 @@ var messageDeleteCommand = defineCommand({
|
|
|
527
553
|
meta: {
|
|
528
554
|
name: "delete",
|
|
529
555
|
description: "Delete a message.",
|
|
556
|
+
risk: "high",
|
|
557
|
+
rules: {
|
|
558
|
+
changes: "Deletes one message from the chat.",
|
|
559
|
+
visible_to: "The other participants no longer see it.",
|
|
560
|
+
budget_rows: [],
|
|
561
|
+
retry: "Safe: a deleted message is gone, so a repeat has nothing to delete.",
|
|
562
|
+
undo: "Cannot be undone.",
|
|
563
|
+
blast_radius: "One message."
|
|
564
|
+
},
|
|
565
|
+
errors: { ...AS_ACCOUNT, ...TARGET },
|
|
566
|
+
seeAlso: ["curviate core inbox messages"],
|
|
530
567
|
examples: [
|
|
531
568
|
"curviate core message delete 2-YTQ3ODU3Njgt MSG_ID"
|
|
532
569
|
]
|
|
@@ -559,6 +596,15 @@ var messageReactCommand = defineCommand({
|
|
|
559
596
|
meta: {
|
|
560
597
|
name: "react",
|
|
561
598
|
description: "Add an emoji reaction to a message.",
|
|
599
|
+
risk: "write",
|
|
600
|
+
rules: {
|
|
601
|
+
changes: "Adds your emoji reaction to the message.",
|
|
602
|
+
visible_to: "The other participants of the chat.",
|
|
603
|
+
budget_rows: ["post_likes"],
|
|
604
|
+
retry: "Read the message first: a repeat with the same emoji may count against the budget again.",
|
|
605
|
+
undo: "React again to change it; the CLI has no command to remove a reaction."
|
|
606
|
+
},
|
|
607
|
+
errors: { ...AS_ACCOUNT, ...BUDGET, ...TARGET },
|
|
562
608
|
examples: [
|
|
563
609
|
"curviate core message react 2-YTQ3ODU3Njgt MSG_ID \u{1F44D}"
|
|
564
610
|
],
|
|
@@ -600,6 +646,7 @@ var messageAttachmentCommand = defineCommand({
|
|
|
600
646
|
meta: {
|
|
601
647
|
name: "attachment",
|
|
602
648
|
description: "Download a message attachment.",
|
|
649
|
+
risk: "read",
|
|
603
650
|
examples: [
|
|
604
651
|
"curviate core message attachment 2-YTQ3ODU3Njgt MSG_ID ATTACHMENT_ID -o attachment.pdf"
|
|
605
652
|
]
|
|
@@ -639,6 +686,15 @@ var messageInMailCommand = defineCommand({
|
|
|
639
686
|
meta: {
|
|
640
687
|
name: "inmail",
|
|
641
688
|
description: "Send an InMail to a member.",
|
|
689
|
+
risk: "write",
|
|
690
|
+
rules: {
|
|
691
|
+
changes: "Sends an InMail to the member.",
|
|
692
|
+
visible_to: "The recipient.",
|
|
693
|
+
budget_rows: ["inmail"],
|
|
694
|
+
retry: "Not safe: requests carry no idempotency key, so a retry after a timeout can repeat it. Read `curviate core inbox list` first.",
|
|
695
|
+
undo: "Cannot be undone."
|
|
696
|
+
},
|
|
697
|
+
errors: { ...AS_ACCOUNT, ...BUDGET, ...TARGET, RECIPIENT_UNREACHABLE: "LinkedIn will not let the Account message this person." },
|
|
642
698
|
examples: [
|
|
643
699
|
'curviate core message inmail --to janesmith --subject "Agent tooling" "Hi Jane, a quick question about your eval setup."'
|
|
644
700
|
]
|
|
@@ -676,6 +732,15 @@ var messageSendCommand = defineCommand({
|
|
|
676
732
|
meta: {
|
|
677
733
|
name: "send",
|
|
678
734
|
description: 'Send a message to an existing chat. Pass a COMPANY_ chat id (from `curviate core inboxes chats`) to send as that company page instead of yourself, no separate flag needed. The output shows the acting identity: a company-page send prints "Sent as <name> (company page)", a personal send prints nothing new. See also: `curviate core inboxes chats` (discover a COMPANY_ chat id) and the Reply as a company page guide.',
|
|
735
|
+
risk: "write",
|
|
736
|
+
rules: {
|
|
737
|
+
changes: "Sends the text into the chat, as you, or as the page for a COMPANY_ chat id.",
|
|
738
|
+
visible_to: "The other participants of the chat.",
|
|
739
|
+
budget_rows: ["messages_first_degree"],
|
|
740
|
+
retry: "Not safe: requests carry no idempotency key, so a retry after a timeout can repeat it. Read `curviate core inbox messages <chat_id>` first.",
|
|
741
|
+
undo: "`curviate core message delete <chat_id> <message_id>`; it may already have been read."
|
|
742
|
+
},
|
|
743
|
+
errors: { ...AS_ACCOUNT, ...BUDGET, ...TARGET, RECIPIENT_UNREACHABLE: "LinkedIn will not let the Account message this person.", CHAT_NOT_VISIBLE: "the chat is not visible to the Account." },
|
|
679
744
|
examples: [
|
|
680
745
|
'curviate core message send 2-YTQ3ODU3Njgt "Thanks, that makes sense."'
|
|
681
746
|
]
|
|
@@ -712,6 +777,7 @@ var messageInMailBalanceCommand = defineCommand({
|
|
|
712
777
|
meta: {
|
|
713
778
|
name: "inmail-balance",
|
|
714
779
|
description: "Get InMail credit balance.",
|
|
780
|
+
risk: "read",
|
|
715
781
|
examples: [
|
|
716
782
|
"curviate core message inmail-balance"
|
|
717
783
|
]
|
|
@@ -774,6 +840,15 @@ var messageCommand = defineCommand({
|
|
|
774
840
|
meta: {
|
|
775
841
|
name: "message",
|
|
776
842
|
description: DESCRIPTIONS.message,
|
|
843
|
+
risk: "write",
|
|
844
|
+
rules: {
|
|
845
|
+
changes: "Sends the text into the chat, as you, or as the page for a COMPANY_ chat id.",
|
|
846
|
+
visible_to: "The other participants of the chat.",
|
|
847
|
+
budget_rows: ["messages_first_degree"],
|
|
848
|
+
retry: "Not safe: requests carry no idempotency key, so a retry after a timeout can repeat it. Read `curviate core inbox messages <chat_id>` first.",
|
|
849
|
+
undo: "`curviate core message delete <chat_id> <message_id>`; it may already have been read."
|
|
850
|
+
},
|
|
851
|
+
errors: { ...AS_ACCOUNT, ...BUDGET, ...TARGET, RECIPIENT_UNREACHABLE: "LinkedIn will not let the Account message this person.", CHAT_NOT_VISIBLE: "the chat is not visible to the Account." },
|
|
777
852
|
examples: [
|
|
778
853
|
'curviate core message 2-YTQ3ODU3Njgt "Thanks, that makes sense."',
|
|
779
854
|
'curviate core message 2-YTQ3ODU3Njgt "See the attached brief." --attach brief.pdf'
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/commands/descriptions.ts
|
|
4
|
+
var DESCRIPTIONS = {
|
|
5
|
+
setup: "Connect this machine to your workspace: opens the dashboard, takes the code it shows you, and saves an API key.",
|
|
6
|
+
doctor: "Check that this machine can call the API: config, credential source, workspace, reachability and connected accounts.",
|
|
7
|
+
login: "Save an API key to a local profile. Run `curviate core profile me` to verify.",
|
|
8
|
+
config: "Manage CLI profiles and settings.",
|
|
9
|
+
account: "LinkedIn account connection management.",
|
|
10
|
+
motion: "Motions: one Sequence run for the Contacts of your Team's Contact lists, from its sending Accounts, paced on a schedule. Create and edit drafts, preview, start, pause, resume, archive, add or remove Contacts; lint a Sequence and write a template offline. Your Team's data: every role reads; writes need motion-send on each sending Account, and Motions need the Automate plan.",
|
|
11
|
+
enrollment: "Enrollments: one Contact in one Motion on one Account. List and read them; pause, resume, retry a failed Step, stop, send a custom event, reassign, or act on many at once. Your Team's data: every role reads; writes need operate on the Enrollment's Account.",
|
|
12
|
+
contact: "Contacts: the people in your Team's lists, not LinkedIn actions. List, read, add, change and delete them; import and export; enrich from LinkedIn profiles. Subgroups: `curviate contact lists` (Contact lists, including combining lists), `curviate contact tags`, `curviate contact imports`. Your Team's data: every role reads and writes; deleting is for Owners and Managers.",
|
|
13
|
+
"do-not-contact": "Do-not-contact: your Team's one list of people no Motion contacts and no write reaches (a write toward them exits 10). List, read, add, change the reason, remove. Any member adds; removing is for Owners and Managers.",
|
|
14
|
+
billing: "Billing: your Team's invoices, listed and downloaded as PDFs. Owners only. Seats and the Tier are under `curviate team` and `curviate tier`.",
|
|
15
|
+
contactImport: "Import Contacts from a CSV, JSON or NDJSON file into a Contact list, splitting a large file into several imports.",
|
|
16
|
+
contactImports: "Read your Team's import records: the counts, the failure, and the rows an import skipped and why.",
|
|
17
|
+
contactLists: "Contact lists: named sets of Contacts a Motion enrolls from. List, read, create, combine lists into a new one, rename, delete, add and remove Contacts.",
|
|
18
|
+
contactTags: "Tags: labels on Contacts. List, rename, delete, and add or remove one on Contacts named by id or by filter.",
|
|
19
|
+
unibox: "Unibox: one inbox over the chats of every Account you may operate, served from Curviate's store. List, read and count chats; reply, mark, tag the person, enroll them in a Motion; refresh. An Account shows its whole inbox only with Sync full inbox, which its own person turns on (`curviate unibox consent`); otherwise only its Motion chats.",
|
|
20
|
+
network: "Network: each Account's LinkedIn Connections, synced and stored by Curviate. List, export, read the sync status, ask for a resync. Your Team's data, for the Accounts you may operate.",
|
|
21
|
+
analytics: "Motion outcomes and the budget your Accounts used. Read-only; Motion numbers cover your Accounts and your team's shared Accounts, core activity the Accounts you may operate.",
|
|
22
|
+
export: "Background export jobs started by `curviate analytics export --job`: read the status, download the file. Only the person who started one can.",
|
|
23
|
+
tier: "Your Team's Tier now, what it bought, any trial, override or pending change, the features it includes, and early access. Every role may read it.",
|
|
24
|
+
team: "Teams: list yours and switch the one calls act in, read or rename it, manage members and invites, set its logo, create a Team, lend seats between your Teams. Owners and Managers manage (a Manager invites Members only); every role reads.",
|
|
25
|
+
incoming: "Incoming events: a private URL any tool posts to. Curviate finds the Contact in the post and moves the Enrollments waiting for that event (`until event.<name>`). Your Team's data.",
|
|
26
|
+
beta: "Beta consent for your Team: whether beta operations run without --beta on each call. Owners change it.",
|
|
27
|
+
webhook: "Webhook management and signature verification.",
|
|
28
|
+
core: "Curviate core: LinkedIn building blocks. Each command runs one action now, from one Account, and counts against that Account's budgets. Nothing is queued, paced or retried for you, except a Draft scheduled with `--schedule-at`, which Curviate publishes at that time (`curviate core draft create`).",
|
|
29
|
+
profile: "LinkedIn profile operations.",
|
|
30
|
+
company: "Fetch a company profile by URL, slug, or numeric id, and its sub-resources.",
|
|
31
|
+
job: "Classic LinkedIn job-posting operations.",
|
|
32
|
+
connect: "Send or manage connection invitations. Connection requests may take 10-30 seconds to appear in the recipient's received list (LinkedIn propagation delay).",
|
|
33
|
+
search: "Search people, companies, posts, and jobs. Also runs a pasted search URL directly.",
|
|
34
|
+
inbox: "Read one Account's LinkedIn message inbox, live. Every Account's chats in one inbox: `curviate unibox`.",
|
|
35
|
+
inboxes: "Discover LinkedIn inboxes (personal + company pages) and list their conversations. Beta. See also: `curviate core inbox` (the account's own message-thread inbox), `curviate core message send` (reply to a chat).",
|
|
36
|
+
message: "Send and manage LinkedIn messages. A COMPANY_ chat id (from `curviate core inboxes chats`) sends as that company page instead of yourself; see `curviate core message send --help`.",
|
|
37
|
+
post: "Create and manage LinkedIn posts.",
|
|
38
|
+
comment: "Comment-thread operations (list, add, reply, edit, delete, react).",
|
|
39
|
+
"sales-nav": "Beta. Sales Navigator operations. Needs the LinkedIn account's own Sales Navigator subscription; no Curviate add-on. Beta operations can require consent: an Owner enables beta with `curviate beta update --enabled true`, or pass --beta for this call.",
|
|
40
|
+
recruiter: "Beta. LinkedIn Recruiter operations. Needs the LinkedIn account's own Recruiter subscription; no Curviate add-on. Beta operations can require consent: an Owner enables beta with `curviate beta update --enabled true`, or pass --beta for this call.",
|
|
41
|
+
group: "Read LinkedIn groups: your own membership list, one group's detail, and its member roster.",
|
|
42
|
+
feed: "Read the connected account's LinkedIn home feed as agent-actionable posts.",
|
|
43
|
+
notification: "Curviate Notifications: an account that needs reconnecting, a paused Motion, a finished import, a member who left. Yours alone, per Team; list, count, mark read, archive. LinkedIn's own notification cards are under `curviate core notification`.",
|
|
44
|
+
coreNotification: "Read and act on LinkedIn notification cards. Curviate's own Notifications are `curviate notification`.",
|
|
45
|
+
draft: "Drafts and scheduled posts."
|
|
46
|
+
};
|
|
47
|
+
function lazy(name, load) {
|
|
48
|
+
return Object.assign(load, { description: DESCRIPTIONS[name] });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
DESCRIPTIONS,
|
|
53
|
+
lazy
|
|
54
|
+
};
|