@curviate/cli 0.49.0 → 0.50.0-next.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 +15 -0
- package/README.md +12 -5
- package/dist/{account-2BH2Q6VG.js → account-KGCGUYKF.js} +668 -116
- package/dist/analytics-HRAD4ABO.js +27 -0
- package/dist/beta-consent-364JI6IL.js +81 -0
- package/dist/billing-3SSVRS2Y.js +124 -0
- package/dist/{chunk-V7FJWTZW.js → chunk-25MO7BYN.js} +4 -4
- package/dist/{chunk-RXWODUWA.js → chunk-2W4RN5ON.js} +18 -2
- package/dist/chunk-5S3MJVI5.js +22 -0
- package/dist/chunk-67S4JHZZ.js +339 -0
- package/dist/chunk-73DJ3KNE.js +54 -0
- package/dist/chunk-CQGDMARG.js +525 -0
- package/dist/{chunk-JYKYD57J.js → chunk-DOHBOYXN.js} +1 -1
- package/dist/{chunk-3RCW7URJ.js → chunk-DSGKYZDK.js} +1 -1
- 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-L4CIJT6F.js +144 -0
- package/dist/{chunk-PQWDDSV7.js → chunk-L7JH3W56.js} +1 -1
- package/dist/{chunk-Z7OQSWBD.js → chunk-OE6YFYUM.js} +85 -10
- package/dist/chunk-PPGKQJKU.js +38 -0
- package/dist/{chunk-SA2QHAXG.js → chunk-QM57YDJE.js} +13 -201
- package/dist/{chunk-Y7MZZRYR.js → chunk-RYWWSZUH.js} +14 -2
- package/dist/{chunk-MGB6FE4A.js → chunk-T6GBS5SS.js} +6 -6
- package/dist/{chunk-TEAWYLPO.js → chunk-TE3WBPW6.js} +43 -17
- package/dist/chunk-UL53T4O6.js +52 -0
- package/dist/chunk-UWQPX4AE.js +20 -0
- package/dist/{chunk-5ZGTU4VD.js → chunk-YXVF5UST.js} +77 -4
- package/dist/cli.js +34 -18
- package/dist/{comment-MRDPDA33.js → comment-5JKGNYOY.js} +90 -11
- package/dist/{company-2AEHSGHA.js → company-TXST2VXW.js} +65 -15
- package/dist/{config-NRBKHXES.js → config-TVIQUVNK.js} +53 -4
- package/dist/{connect-4XEBV5V3.js → connect-RBL6U4KV.js} +63 -18
- package/dist/contact-YAHC5QFX.js +32 -0
- package/dist/contact-groups-DKOIBC57.js +399 -0
- package/dist/contact-import-ITSJQV7K.js +336 -0
- package/dist/core-PWMJPPRG.js +46 -0
- package/dist/do-not-contact-WDYIBWYA.js +200 -0
- package/dist/{doctor-BZ4DA7DV.js → doctor-F7JLPTED.js} +65 -11
- package/dist/{document-RKHRWXNT.js → document-BHYAUJ6F.js} +1 -1
- package/dist/{draft-C5N6EOO5.js → draft-TDJJUXLH.js} +60 -14
- package/dist/{enrollment-BNQOUKI7.js → enrollment-Q6UOKHPY.js} +31 -19
- package/dist/{examples-NIMSIXMV.js → examples-DQSVIIXZ.js} +2 -2
- package/dist/{exit-codes-TLMKTLRI.js → exit-codes-7DBETBDT.js} +1 -1
- package/dist/export-HIJSCJS6.js +96 -0
- package/dist/{feed-DFUU7SUJ.js → feed-W56ZTA4Z.js} +13 -10
- package/dist/{group-CSD2OWOZ.js → group-AUALYK5H.js} +18 -10
- package/dist/{inbox-SNSPWI7J.js → inbox-HLZR2ZPV.js} +31 -12
- package/dist/{inboxes-RIRHPS4H.js → inboxes-IZTRD6FE.js} +14 -10
- package/dist/incoming-ULB2RNV4.js +218 -0
- package/dist/{job-6PNXXZNF.js → job-55IKS6LP.js} +65 -13
- package/dist/{login-Y7JBAHCW.js → login-DPZ6CXNO.js} +13 -4
- package/dist/{message-2IK4MBBG.js → message-J44YKRDS.js} +9 -7
- package/dist/{motion-7ATUXO6R.js → motion-SQI5F2EK.js} +39 -117
- package/dist/network-K4QD7APQ.js +235 -0
- package/dist/{notification-VYK5NDEB.js → notification-SEDXZHXO.js} +38 -11
- package/dist/notifications-HGIBRUNQ.js +231 -0
- package/dist/{post-AN6T2OJF.js → post-L467SKIG.js} +92 -12
- package/dist/{profile-UQY64642.js → profile-A2N6RMR2.js} +76 -20
- package/dist/{recruiter-OY4RN5HH.js → recruiter-AR75RHBO.js} +133 -22
- package/dist/{sales-nav-KLODLYMW.js → sales-nav-C2AYFXPV.js} +74 -19
- package/dist/{search-NWP5S6CF.js → search-Z4DZIG4X.js} +55 -23
- package/dist/{setup-YPPFLH2N.js → setup-45BEVX6B.js} +69 -17
- package/dist/team-6QWY4IFP.js +450 -0
- package/dist/tier-2HS3BXDF.js +61 -0
- package/dist/unibox-DHUKG65Z.js +402 -0
- package/dist/{webhook-OHKBL3YS.js → webhook-Q53WUAI2.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-67S4JHZZ.js";
|
|
10
|
+
import "./chunk-5S3MJVI5.js";
|
|
11
|
+
import "./chunk-PPGKQJKU.js";
|
|
12
|
+
import "./chunk-T6GBS5SS.js";
|
|
13
|
+
import "./chunk-NNV2OYEF.js";
|
|
14
|
+
import "./chunk-L4CIJT6F.js";
|
|
15
|
+
import "./chunk-QM57YDJE.js";
|
|
16
|
+
import "./chunk-YXVF5UST.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-T6GBS5SS.js";
|
|
8
|
+
import {
|
|
9
|
+
buildPreviewOutput
|
|
10
|
+
} from "./chunk-TCUYH5GO.js";
|
|
11
|
+
import {
|
|
12
|
+
renderSuccess
|
|
13
|
+
} from "./chunk-QM57YDJE.js";
|
|
14
|
+
import "./chunk-YXVF5UST.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-DQSVIIXZ.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-T6GBS5SS.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-L4CIJT6F.js";
|
|
22
|
+
import {
|
|
23
|
+
renderSuccess,
|
|
24
|
+
writeNdjsonItem
|
|
25
|
+
} from "./chunk-QM57YDJE.js";
|
|
26
|
+
import {
|
|
27
|
+
downloadBinary
|
|
28
|
+
} from "./chunk-YXVF5UST.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-DQSVIIXZ.js");
|
|
119
|
+
await showHelp(billingCommand, ["curviate", "billing"]);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
export {
|
|
123
|
+
billingCommand
|
|
124
|
+
};
|
|
@@ -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-L4CIJT6F.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/\\?#%]/;
|
|
@@ -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,
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
print,
|
|
4
|
+
rate,
|
|
5
|
+
table
|
|
6
|
+
} from "./chunk-5S3MJVI5.js";
|
|
7
|
+
import {
|
|
8
|
+
writeExport
|
|
9
|
+
} from "./chunk-PPGKQJKU.js";
|
|
10
|
+
import {
|
|
11
|
+
fail,
|
|
12
|
+
listFlag,
|
|
13
|
+
outputOpts,
|
|
14
|
+
rootClient,
|
|
15
|
+
usage
|
|
16
|
+
} from "./chunk-T6GBS5SS.js";
|
|
17
|
+
import {
|
|
18
|
+
intFlag
|
|
19
|
+
} from "./chunk-NNV2OYEF.js";
|
|
20
|
+
import {
|
|
21
|
+
pageDelayFromFlags,
|
|
22
|
+
readCursorFlag,
|
|
23
|
+
readMaxPagesFlag,
|
|
24
|
+
readablePage,
|
|
25
|
+
rejectPaginationModifiersWithoutAll,
|
|
26
|
+
streamAll
|
|
27
|
+
} from "./chunk-L4CIJT6F.js";
|
|
28
|
+
import {
|
|
29
|
+
renderSuccess,
|
|
30
|
+
writeNdjsonItem
|
|
31
|
+
} from "./chunk-QM57YDJE.js";
|
|
32
|
+
import {
|
|
33
|
+
downloadBinary
|
|
34
|
+
} from "./chunk-YXVF5UST.js";
|
|
35
|
+
import {
|
|
36
|
+
GLOBAL_FLAGS,
|
|
37
|
+
READ_SINGLE_FLAGS,
|
|
38
|
+
readOnly
|
|
39
|
+
} from "./chunk-RYWWSZUH.js";
|
|
40
|
+
import {
|
|
41
|
+
DESCRIPTIONS
|
|
42
|
+
} from "./chunk-73DJ3KNE.js";
|
|
43
|
+
|
|
44
|
+
// src/commands/analytics.ts
|
|
45
|
+
import { defineCommand } from "citty";
|
|
46
|
+
var DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
47
|
+
function windowParams(f) {
|
|
48
|
+
const q = {};
|
|
49
|
+
for (const k of ["from", "to"]) {
|
|
50
|
+
const v = f[k];
|
|
51
|
+
if (v === void 0) continue;
|
|
52
|
+
if (!DATE.test(v)) usage(`--${k} takes a date, YYYY-MM-DD.`);
|
|
53
|
+
q[k] = v;
|
|
54
|
+
}
|
|
55
|
+
if (f.range !== void 0) q["range"] = f.range;
|
|
56
|
+
if (f.timezone !== void 0) q["timezone"] = f.timezone;
|
|
57
|
+
if (f.bucket !== void 0) q["bucket"] = f.bucket;
|
|
58
|
+
return q;
|
|
59
|
+
}
|
|
60
|
+
function grammarParams(f) {
|
|
61
|
+
const q = {};
|
|
62
|
+
if (f.include !== void 0) q["include"] = listFlag("include", f.include);
|
|
63
|
+
if (f.sort !== void 0) q["sort"] = listFlag("sort", f.sort);
|
|
64
|
+
if (f.limit !== void 0) q["limit"] = intFlag("limit", f.limit);
|
|
65
|
+
if (f.compare !== void 0) q["compare"] = f.compare;
|
|
66
|
+
return q;
|
|
67
|
+
}
|
|
68
|
+
function filterParams(f, keys) {
|
|
69
|
+
const q = {};
|
|
70
|
+
if (keys.includes("motions") && f.motions !== void 0) q["motion_id"] = listFlag("motions", f.motions);
|
|
71
|
+
if (keys.includes("accounts") && f.accounts !== void 0) q["account_id"] = listFlag("accounts", f.accounts);
|
|
72
|
+
if (keys.includes("origin") && f.origin !== void 0) q["origin"] = listFlag("origin", f.origin);
|
|
73
|
+
return q;
|
|
74
|
+
}
|
|
75
|
+
var outcomes = (s) => `acceptance ${rate(s?.["acceptance"], "accepted", "sent")} \xB7 reply ${rate(s?.["reply"], "replied", "messaged")} \xB7 InMail reply ${rate(s?.["inmail_reply"], "replied", "inmailed")} \xB7 replies ${s?.["replies"] ?? "-"}`;
|
|
76
|
+
var rowsTable = (label, id, name, items) => Array.isArray(items) && items.length ? table(
|
|
77
|
+
[label, "NAME", "ACCEPTANCE", "REPLY", "INMAIL REPLY", "REPLIES"],
|
|
78
|
+
items.map((r) => [r[id], r[name], rate(r["acceptance"], "accepted", "sent"), rate(r["reply"], "replied", "messaged"), rate(r["inmail_reply"], "replied", "inmailed"), r["replies"]])
|
|
79
|
+
) : null;
|
|
80
|
+
var reasons = (r) => Object.entries(r ?? {}).flatMap(([k, m]) => Object.entries(m ?? {}).map(([code, n]) => `${k} ${code} ${n}`)).join(", ");
|
|
81
|
+
function windowLines(body) {
|
|
82
|
+
const w = body["window"] ?? {};
|
|
83
|
+
const lines = [`${w["from"]} to ${w["to"]} (${w["timezone"]})`];
|
|
84
|
+
if (w["counts_only_through"]) lines.push(`daily counts only through ${w["counts_only_through"]}: step, variant and seen detail covers the days after it`);
|
|
85
|
+
return lines;
|
|
86
|
+
}
|
|
87
|
+
function renderOverview(body) {
|
|
88
|
+
const out = [...windowLines(body)];
|
|
89
|
+
const profile = body["profile"];
|
|
90
|
+
if (profile) out.push(`${profile["name"]} \xB7 ${profile["status"]}${profile["status_reason"] ? ` (${profile["status_reason"]})` : ""}`);
|
|
91
|
+
const metrics = body["metrics"];
|
|
92
|
+
if (metrics) out.push(`connections ${metrics["connections"]} \xB7 followers ${metrics["followers"]} \xB7 profile viewers 90d ${metrics["profile_viewers_90d"]} \xB7 search appearances ${metrics["search_appearances_week"]} (as of ${metrics["as_of"]})`);
|
|
93
|
+
const s = body["totals"] ?? body["performance"];
|
|
94
|
+
if (s) out.push(outcomes(s));
|
|
95
|
+
const steps = body["steps"];
|
|
96
|
+
if (Array.isArray(steps) && steps.length) {
|
|
97
|
+
out.push(table(
|
|
98
|
+
["STEP", "ACTION", "EXECUTED", "SKIPPED", "FAILED", "ACCEPTANCE", "REPLY", "SEEN"],
|
|
99
|
+
steps.map((t) => [t["step_id"], t["action"] ?? t["kind"], t["executed"], t["skipped"], t["failed"], rate(t["acceptance"], "accepted", "sent"), rate(t["reply"], "replied", "messaged"), rate(t["seen"], "seen", "sent")])
|
|
100
|
+
));
|
|
101
|
+
for (const t of steps) if (reasons(t["reasons"])) out.push(` ${t["step_id"]}: ${reasons(t["reasons"])}`);
|
|
102
|
+
}
|
|
103
|
+
const paths = body["paths"];
|
|
104
|
+
if (Array.isArray(paths) && paths.length) {
|
|
105
|
+
out.push(table(
|
|
106
|
+
["PATH", "ACCEPTANCE", "REPLY", "INMAIL REPLY", "REPLIES"],
|
|
107
|
+
paths.map((p) => {
|
|
108
|
+
const t = p["totals"] ?? {};
|
|
109
|
+
return [p["path"], rate(t["acceptance"], "accepted", "sent"), rate(t["reply"], "replied", "messaged"), rate(t["inmail_reply"], "replied", "inmailed"), t["replies"]];
|
|
110
|
+
})
|
|
111
|
+
));
|
|
112
|
+
const through = body["window"]?.["paths_through"];
|
|
113
|
+
if (through) out.push(`paths cover days after ${through}`);
|
|
114
|
+
}
|
|
115
|
+
const limits = body["limits"]?.["rows"];
|
|
116
|
+
if (Array.isArray(limits) && limits.length) out.push(table(["BUDGET ROW", "USED", "CEILING", "LEFT"], limits.map((r) => [r["budget_row"], r["used"], r["effective_ceiling"], r["remaining"]])));
|
|
117
|
+
out.push(rowsTable("MOTION", "motion_id", "name", body["motions"]));
|
|
118
|
+
out.push(rowsTable("ACCOUNT", "account_id", "account_name", body["accounts"]));
|
|
119
|
+
for (const fl of body["flags"] ?? []) out.push(`${fl["code"]}: ${fl["message"]}${fl["next"] ? ` (${fl["next"]})` : ""}`);
|
|
120
|
+
print(out.filter((x) => !!x).join("\n"));
|
|
121
|
+
}
|
|
122
|
+
function renderActivity(body) {
|
|
123
|
+
const out = [...windowLines(body), table(["BUDGET ROW", "USED", "FAILED", "REFUSED"], (body["types"] ?? []).map((t) => [t["budget_row"], t["used"], t["failed"], t["refused"]]))];
|
|
124
|
+
for (const a of body["accounts"] ?? []) out.push(`${a["account_name"] ?? a["account_id"]}: ${(a["types"] ?? []).map((t) => `${t["budget_row"]} ${t["used"]}`).join(", ")}`);
|
|
125
|
+
print(out.join("\n"));
|
|
126
|
+
}
|
|
127
|
+
async function runGet(c, f) {
|
|
128
|
+
const view = f.view ?? "motions";
|
|
129
|
+
if (view !== "motions" && view !== "activity") usage("--view takes motions or activity.");
|
|
130
|
+
if (view === "activity") {
|
|
131
|
+
const motionOnly = ["motion", "motions", "origin", "include", "sort", "limit", "compare", "version"].find((k) => f[k] !== void 0);
|
|
132
|
+
if (motionOnly) usage(`--${motionOnly} reads Motions: --view activity takes the window and --accounts only.`);
|
|
133
|
+
}
|
|
134
|
+
if (f.version !== void 0 && f.motion === void 0) usage("--version needs --motion.");
|
|
135
|
+
const q = { ...windowParams(f), ...filterParams(f, view === "activity" ? ["accounts"] : ["accounts", "origin"]) };
|
|
136
|
+
try {
|
|
137
|
+
if (view === "activity") {
|
|
138
|
+
const body2 = await c.analytics.activity(q);
|
|
139
|
+
return outputOpts(f).json ? renderSuccess(body2, outputOpts(f), process) : renderActivity(body2);
|
|
140
|
+
}
|
|
141
|
+
Object.assign(q, grammarParams(f));
|
|
142
|
+
if (f.version !== void 0) q["version"] = intFlag("version", f.version);
|
|
143
|
+
let body;
|
|
144
|
+
if (f.motion !== void 0) body = await c.analytics.motions.get(f.motion, q);
|
|
145
|
+
else body = await c.analytics.motions.list({ ...q, ...filterParams(f, ["motions"]) });
|
|
146
|
+
return outputOpts(f).json ? renderSuccess(body, outputOpts(f), process) : renderOverview(body);
|
|
147
|
+
} catch (err) {
|
|
148
|
+
await fail(err, f);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
async function runEvents(c, f) {
|
|
152
|
+
rejectPaginationModifiersWithoutAll(f, process);
|
|
153
|
+
if (f.step !== void 0 && f.motion === void 0) usage("--step needs --motion: a step id names a step of one Motion.");
|
|
154
|
+
const q = { ...filterParams(f, ["origin"]) };
|
|
155
|
+
if (f.motion !== void 0) q["motion_id"] = f.motion;
|
|
156
|
+
if (f.step !== void 0) q["step_id"] = f.step;
|
|
157
|
+
if (f.contact !== void 0) q["contact_id"] = f.contact;
|
|
158
|
+
if (f.accounts !== void 0) q["account_id"] = listFlag("accounts", f.accounts).join(",");
|
|
159
|
+
if (f.kind !== void 0) q["kind"] = listFlag("kind", f.kind);
|
|
160
|
+
if (f.limit !== void 0) q["limit"] = intFlag("limit", f.limit, 1, 100);
|
|
161
|
+
const cursor = readCursorFlag(f, process);
|
|
162
|
+
if (cursor) q["cursor"] = cursor;
|
|
163
|
+
try {
|
|
164
|
+
if (f.all) {
|
|
165
|
+
const page2 = (p) => c.analytics.events.list(p);
|
|
166
|
+
for await (const item of streamAll(page2, q, { maxPages: readMaxPagesFlag(f, process), out: process, pageDelayMs: pageDelayFromFlags(f) })) writeNdjsonItem(process, item, f.fields);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const page = readablePage(await c.analytics.events.list(q));
|
|
170
|
+
if (outputOpts(f).json) return renderSuccess(page, outputOpts(f), process);
|
|
171
|
+
print(table(
|
|
172
|
+
["AT", "KIND", "ORIGIN", "MOTION", "STEP", "OUTCOME", "REASON", "CONTACT"],
|
|
173
|
+
page.items.map((e) => [e["occurred_at"], e["kind"], e["origin"], e["motion_name"], e["step_id"], e["outcome"], e["reason"] ? `${e["reason"]}: ${e["reason_message"] ?? ""}` : null, e["contact"]?.["full_name"]])
|
|
174
|
+
));
|
|
175
|
+
if (page["cursor"]) print(`next page: --cursor ${String(page["cursor"])}`);
|
|
176
|
+
} catch (err) {
|
|
177
|
+
await fail(err, f);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
var ANALYTICS_TABLES = ["daily", "accounts", "motions", "enrollments"];
|
|
181
|
+
var JOB_ENTITIES = ["motion_activity", "account_activity", "account_metrics"];
|
|
182
|
+
async function runExport(c, f) {
|
|
183
|
+
if (f.json) usage("export commands take no --json: pass --format json.");
|
|
184
|
+
const tables = f.table === void 0 ? [] : listFlag("table", f.table);
|
|
185
|
+
const entity = tables.length === 1 && JOB_ENTITIES.includes(tables[0]) ? tables[0] : "analytics";
|
|
186
|
+
if (entity !== "analytics" && !f.job) usage(`--table ${entity} is built by a background job: add --job.`);
|
|
187
|
+
const unknown = tables.find((t) => !ANALYTICS_TABLES.includes(t) && t !== entity);
|
|
188
|
+
if (unknown !== void 0) usage(`--table takes ${ANALYTICS_TABLES.join(", ")}, or one of ${JOB_ENTITIES.join(", ")} with --job.`);
|
|
189
|
+
const format = f.format ?? "csv";
|
|
190
|
+
const filters = { ...windowParams(f), ...filterParams(f, ["motions", "accounts", "origin"]) };
|
|
191
|
+
try {
|
|
192
|
+
if (f.job) {
|
|
193
|
+
const exp = await c.exports.create({ entity, tables: tables.length ? tables : ANALYTICS_TABLES, format, filters });
|
|
194
|
+
renderSuccess(exp, outputOpts(f), process);
|
|
195
|
+
process.stderr.write(`Export ${exp["id"]} is ${exp["status"]}. Read it with \`curviate export get ${exp["id"]}\`, then \`curviate export download ${exp["id"]} -o <file>\` once ready.
|
|
196
|
+
`);
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (f.output === void 0 && process.stdout.isTTY && tables.length !== 1) usage("several tables come as one ZIP file: pass -o <file>, or one --table.");
|
|
200
|
+
const bytes = await downloadBinary(() => c.analytics.export({ ...filters, format, ...tables.length ? { table: tables } : {} }));
|
|
201
|
+
await writeExport(f.output, new Uint8Array(bytes));
|
|
202
|
+
} catch (err) {
|
|
203
|
+
await fail(err, f);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
var online = (fn) => async ({ args }) => {
|
|
207
|
+
const f = args;
|
|
208
|
+
await fn(await rootClient(f), f);
|
|
209
|
+
};
|
|
210
|
+
var WINDOW_ARGS = {
|
|
211
|
+
from: {
|
|
212
|
+
type: "string",
|
|
213
|
+
description: "First day, YYYY-MM-DD, inclusive, in --timezone. A Motion read (with or without --motion) or an Account overview may start more than a year back: up to `window.counts_only_through` the figures come from daily counts (UTC days, no step, variant or seen detail), and `paths` cover only the days after `window.paths_through`. --view activity and the activity exports keep their own cap, named in the refusal."
|
|
214
|
+
},
|
|
215
|
+
to: { type: "string", description: "Last day, YYYY-MM-DD, inclusive, in --timezone (default today). Same rules as --from." },
|
|
216
|
+
range: { type: "string", description: "Instead of --from/--to: 7d, 30d, 90d, 12m or all." },
|
|
217
|
+
timezone: { type: "string", description: "IANA zone the days are read in (default UTC)." },
|
|
218
|
+
bucket: { type: "string", description: "Daily series grouping: auto, day, week or month." }
|
|
219
|
+
};
|
|
220
|
+
var FILTER_ARGS = {
|
|
221
|
+
accounts: { type: "string", description: "Only these Accounts: a comma list of ids (acc_...). Never filled from your profile's default Account." },
|
|
222
|
+
origin: { type: "string", description: "Who sent the actions: a comma list of motion, unibox, api; direct is an alias for unibox and api." }
|
|
223
|
+
};
|
|
224
|
+
var GRAMMAR_ARGS = {
|
|
225
|
+
include: { type: "string", description: "Sections to return, comma list (for example performance,motions,accounts,steps,variants,paths,flags)." },
|
|
226
|
+
sort: { type: "string", description: "Order of the Motion and Account lists, comma list of sent, acceptance.rate, reply.rate, inmail_reply.rate, last_activity_at, name; a leading - sorts descending." },
|
|
227
|
+
limit: { type: "string", description: "How many Motions and Accounts to return." },
|
|
228
|
+
compare: { type: "string", description: "previous_period: add the same number of days before --from to every rate (`previous`, `delta`)." }
|
|
229
|
+
};
|
|
230
|
+
var getCmd = defineCommand({
|
|
231
|
+
meta: {
|
|
232
|
+
name: "get",
|
|
233
|
+
description: "Motion outcomes over a window: invitations, acceptance, messages, reply and InMail reply as outcomes so far, with each Motion and Account. With --motion: one Motion's steps, paths and Accounts. With --view activity: the budget rows your Accounts used. Each Contact counts once per Account.",
|
|
234
|
+
risk: "read",
|
|
235
|
+
output: [
|
|
236
|
+
"acceptance: invitations accepted over invitations sent in the window, so far.",
|
|
237
|
+
"reply: people who replied over people messaged; InMail reply the same for InMails. Rates move as replies and acceptances arrive; `maturing` counts what was sent under 7 days ago and `low_sample` marks fewer than 30.",
|
|
238
|
+
"seen (--motion): messages read or replied over messages sent, per message step.",
|
|
239
|
+
"A compact table by default; --json (or piped) prints the API body."
|
|
240
|
+
],
|
|
241
|
+
seeAlso: ["curviate analytics events list", "curviate account overview", "Judgement on reading the numbers: https://github.com/curviate/curviate-plugin"],
|
|
242
|
+
examples: [
|
|
243
|
+
"curviate analytics get --range 30d",
|
|
244
|
+
"curviate analytics get --motion mot_YOUR_MOTION_ID --include steps,paths --range 90d",
|
|
245
|
+
"curviate analytics get --view activity --from 2026-10-01 --to 2026-10-28"
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
args: {
|
|
249
|
+
...readOnly(READ_SINGLE_FLAGS),
|
|
250
|
+
view: { type: "string", description: "motions (default): Motion outcomes; activity: budget rows used, not with --motion." },
|
|
251
|
+
motion: { type: "string", description: "One Motion (mot_...): its steps, paths and Accounts." },
|
|
252
|
+
motions: { type: "string", description: "Without --motion: only these Motions, comma list (mot_...)." },
|
|
253
|
+
version: { type: "string", description: "With --motion: only this Sequence version." },
|
|
254
|
+
...WINDOW_ARGS,
|
|
255
|
+
...FILTER_ARGS,
|
|
256
|
+
...GRAMMAR_ARGS
|
|
257
|
+
},
|
|
258
|
+
run: online(runGet)
|
|
259
|
+
});
|
|
260
|
+
var eventsListCmd = defineCommand({
|
|
261
|
+
meta: {
|
|
262
|
+
name: "list",
|
|
263
|
+
description: "The records behind the numbers, newest first: steps executed or failed, invitations accepted, replies; each reason with its sentence. Metadata only, never message text.",
|
|
264
|
+
risk: "read",
|
|
265
|
+
examples: [
|
|
266
|
+
"curviate analytics events list --motion mot_YOUR_MOTION_ID --step opener",
|
|
267
|
+
"curviate analytics events list --contact con_YOUR_CONTACT_ID --origin unibox,api --all"
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
args: {
|
|
271
|
+
...readOnly(GLOBAL_FLAGS),
|
|
272
|
+
motion: { type: "string", description: "Only this Motion's records (mot_...)." },
|
|
273
|
+
step: { type: "string", description: "With --motion: only this step's records." },
|
|
274
|
+
contact: { type: "string", description: "Only this Contact's records (con_...): its Motion records and its direct ones." },
|
|
275
|
+
kind: { type: "string", description: "Comma list of step.executed, step.failed, invite.accepted, message.replied." },
|
|
276
|
+
accounts: FILTER_ARGS.accounts,
|
|
277
|
+
origin: FILTER_ARGS.origin
|
|
278
|
+
},
|
|
279
|
+
run: online(runEvents)
|
|
280
|
+
});
|
|
281
|
+
var exportCmd = defineCommand({
|
|
282
|
+
meta: {
|
|
283
|
+
name: "export",
|
|
284
|
+
description: "Export the Analytics tables (daily, accounts, motions, enrollments) under the same window and filters: streamed now, or with --job built in the background (then `curviate export get` and `curviate export download`). One table is one file; several are one ZIP. Never message text. Owners and Managers only.",
|
|
285
|
+
risk: "read",
|
|
286
|
+
output: ["Data only on stdout or the --output file (mode 0600); with --job the export record."],
|
|
287
|
+
errors: { INSUFFICIENT_ROLE: "Members cannot export: ask an Owner or Manager.", EXPORT_IN_PROGRESS: "your Team already has an export running; read it with `curviate export get <export_id>`." },
|
|
288
|
+
seeAlso: ["curviate export get", "curviate export download"],
|
|
289
|
+
examples: [
|
|
290
|
+
"curviate analytics export --table enrollments --format csv --range 30d -o enrollments.csv",
|
|
291
|
+
"curviate analytics export --table daily,accounts,motions,enrollments --format csv --range 90d --job"
|
|
292
|
+
]
|
|
293
|
+
},
|
|
294
|
+
args: {
|
|
295
|
+
"api-key": GLOBAL_FLAGS["api-key"],
|
|
296
|
+
profile: GLOBAL_FLAGS.profile,
|
|
297
|
+
team: GLOBAL_FLAGS.team,
|
|
298
|
+
"base-url": GLOBAL_FLAGS["base-url"],
|
|
299
|
+
timeout: GLOBAL_FLAGS.timeout,
|
|
300
|
+
table: { type: "string", description: "Comma list of daily, accounts, motions, enrollments (default all four); or, with --job, one of motion_activity, account_activity, account_metrics." },
|
|
301
|
+
format: { type: "string", description: "csv (default), json or ndjson (ndjson takes one table)." },
|
|
302
|
+
output: { type: "string", alias: "o", description: "File to write (mode 0600), or - for stdout (default)." },
|
|
303
|
+
job: { type: "boolean", description: "Build it in the background and print the export record instead of streaming it." },
|
|
304
|
+
motions: { type: "string", description: "Only these Motions, comma list (mot_...)." },
|
|
305
|
+
...WINDOW_ARGS,
|
|
306
|
+
...FILTER_ARGS,
|
|
307
|
+
json: { type: "boolean", description: "Not taken by exports: pass --format json." }
|
|
308
|
+
},
|
|
309
|
+
run: online(runExport)
|
|
310
|
+
});
|
|
311
|
+
var eventsCommand = defineCommand({
|
|
312
|
+
meta: { name: "events", description: "The records behind the analytics numbers." },
|
|
313
|
+
subCommands: { list: eventsListCmd },
|
|
314
|
+
async run() {
|
|
315
|
+
const { showHelp } = await import("./examples-DQSVIIXZ.js");
|
|
316
|
+
await showHelp(eventsCommand, ["curviate", "analytics", "events"]);
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
var analyticsCommand = defineCommand({
|
|
320
|
+
meta: { name: "analytics", description: DESCRIPTIONS.analytics },
|
|
321
|
+
subCommands: {
|
|
322
|
+
get: getCmd,
|
|
323
|
+
events: eventsCommand,
|
|
324
|
+
export: exportCmd
|
|
325
|
+
},
|
|
326
|
+
async run() {
|
|
327
|
+
const { showHelp } = await import("./examples-DQSVIIXZ.js");
|
|
328
|
+
await showHelp(analyticsCommand, ["curviate", "analytics"]);
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
export {
|
|
333
|
+
windowParams,
|
|
334
|
+
grammarParams,
|
|
335
|
+
renderOverview,
|
|
336
|
+
WINDOW_ARGS,
|
|
337
|
+
GRAMMAR_ARGS,
|
|
338
|
+
analyticsCommand
|
|
339
|
+
};
|