@curviate/cli 0.55.0 → 0.57.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 +69 -0
- package/README.md +5 -4
- package/dist/{account-6L33JFZS.js → account-IRIYB2SG.js} +47 -22
- package/dist/{analytics-HGJGXRAM.js → analytics-IRSCLVOL.js} +5 -5
- package/dist/{beta-consent-LIND4PPN.js → beta-consent-NQVGFZL3.js} +4 -4
- package/dist/billing-TCTP44ZB.js +248 -0
- package/dist/{chunk-KLXDFFHT.js → chunk-3B5M2RUN.js} +1 -1
- package/dist/{chunk-LGUZ52BU.js → chunk-3ZQNOKEK.js} +2 -2
- package/dist/{chunk-QBY6L77D.js → chunk-5LGKZBAY.js} +5 -3
- package/dist/{chunk-Q5Z7FMXI.js → chunk-6OT6TS7N.js} +2 -2
- package/dist/{chunk-OYZ27Q3B.js → chunk-A6JGJGDF.js} +19 -17
- package/dist/{chunk-AMMAA62Z.js → chunk-AG6G3PRQ.js} +111 -14
- package/dist/{chunk-EA5LJ4CS.js → chunk-AMTKGO37.js} +1 -1
- package/dist/{chunk-J34JU27C.js → chunk-DENWYJK2.js} +2 -2
- package/dist/{chunk-Z3RPQ5K4.js → chunk-F7CLAS5Y.js} +2 -2
- package/dist/{chunk-ENBIMEKS.js → chunk-IB6ARI3R.js} +1 -1
- package/dist/{chunk-R7USRN52.js → chunk-OE4CY3ZL.js} +1 -1
- package/dist/{chunk-JKXGL7PT.js → chunk-RKNW4UX4.js} +42 -0
- package/dist/{chunk-BC4N5X3N.js → chunk-RTT75CXE.js} +44 -6
- package/dist/{chunk-S234PC5E.js → chunk-RXDG57B2.js} +1 -1
- package/dist/{chunk-RDKTHFQ6.js → chunk-SCUTAREU.js} +4 -0
- package/dist/{chunk-FHSGANM6.js → chunk-VPFV7YV3.js} +5 -5
- package/dist/cli.js +38 -30
- package/dist/{comment-IIKLEAEK.js → comment-PNHEKGZX.js} +7 -7
- package/dist/{company-CX5TZNB5.js → company-OUFF23SU.js} +20 -9
- package/dist/company-record-ULPDDB6L.js +128 -0
- package/dist/{config-Y4FC7QKM.js → config-U6VDNL2P.js} +2 -2
- package/dist/{connect-GUUBX23F.js → connect-ICNXC37R.js} +11 -11
- package/dist/{contact-OCYSFRTS.js → contact-K6RIVQWU.js} +9 -9
- package/dist/{contact-groups-HWJSYRFJ.js → contact-groups-CNH2VB6A.js} +11 -11
- package/dist/{contact-import-CTWSFT64.js → contact-import-FK22UTN2.js} +11 -11
- package/dist/core-MPEBYNSL.js +46 -0
- package/dist/{do-not-contact-6UVY3UKT.js → do-not-contact-BQHXNHTV.js} +46 -20
- package/dist/{doctor-6CB6DCY3.js → doctor-ZYPZF5BE.js} +21 -4
- package/dist/{document-ADK4GZA7.js → document-H65EXU4L.js} +1 -1
- package/dist/{domain-BUJMHYIV.js → domain-HLOT6Y4A.js} +8 -8
- package/dist/{draft-SII6E6Z6.js → draft-JGQ36JSH.js} +4 -4
- package/dist/{enrollment-OXGR5WVI.js → enrollment-CF634DB4.js} +11 -9
- package/dist/{examples-77WVMKZQ.js → examples-J4X5NEIE.js} +2 -2
- package/dist/{exit-codes-ZSOLAXQO.js → exit-codes-P2FLCKM7.js} +1 -1
- package/dist/{export-D32J5GRN.js → export-ZQLDQYUZ.js} +4 -4
- package/dist/{feed-HOFHCP6W.js → feed-RQHEDZVL.js} +6 -6
- package/dist/{group-AMYOAGNS.js → group-LRMG76FN.js} +6 -6
- package/dist/{inbox-NS2LB2WQ.js → inbox-5RGG5RQG.js} +6 -6
- package/dist/{inboxes-XWUZJ5PN.js → inboxes-ZFY6ZP33.js} +6 -6
- package/dist/{incoming-UIWRL6QS.js → incoming-3MJ4CP6H.js} +8 -8
- package/dist/{job-TKGPXU26.js → job-QFIUTHHT.js} +6 -6
- package/dist/{login-B2YWX2JP.js → login-THXWX5HZ.js} +4 -4
- package/dist/{mailbox-LLSGX2FF.js → mailbox-54DPLNXA.js} +27 -21
- package/dist/{message-M4THMNRZ.js → message-DM5OUKQS.js} +6 -6
- package/dist/{motion-2OUGYR3O.js → motion-NKOAK7NU.js} +101 -26
- package/dist/{network-MFWKXTEV.js → network-VKJUMZ2L.js} +8 -8
- package/dist/{notification-5K4TCYQA.js → notification-XW5J6KFA.js} +6 -6
- package/dist/{notifications-2GKUJB7C.js → notifications-USYOV54R.js} +17 -12
- package/dist/{post-BHH7YKGM.js → post-M2G3BK4A.js} +7 -7
- package/dist/{profile-GKMRRKZF.js → profile-3SG64IEG.js} +11 -11
- package/dist/{recruiter-J53ZSD4P.js → recruiter-7OUGZ776.js} +8 -8
- package/dist/{sales-nav-6I5SYTRX.js → sales-nav-HHQLLM5C.js} +8 -8
- package/dist/{search-HS2YAA33.js → search-5LMSLUH4.js} +16 -16
- package/dist/{setup-IYVOGVC6.js → setup-6F4HYUSZ.js} +5 -5
- package/dist/signal-LVODDBOY.js +331 -0
- package/dist/{team-N6ILUHAD.js → team-MSOPELF6.js} +62 -8
- package/dist/{tier-QWXKFESB.js → tier-RXHOAQ6L.js} +6 -5
- package/dist/{unibox-D4WIHIZX.js → unibox-UAA6WIGZ.js} +65 -12
- package/dist/{webhook-PKWGZZO2.js → webhook-J2H7X766.js} +9 -9
- package/package.json +2 -2
- package/dist/billing-QKPP5NPR.js +0 -124
- package/dist/core-37XZS2RG.js +0 -46
|
@@ -7,23 +7,23 @@ import {
|
|
|
7
7
|
contactImportCommand,
|
|
8
8
|
contactImportsCommand,
|
|
9
9
|
csvRecords
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-Z3RPQ5K4.js";
|
|
10
|
+
} from "./chunk-AG6G3PRQ.js";
|
|
11
|
+
import "./chunk-A6JGJGDF.js";
|
|
13
12
|
import "./chunk-GOICALYQ.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-F7CLAS5Y.js";
|
|
14
|
+
import "./chunk-6OT6TS7N.js";
|
|
15
|
+
import "./chunk-3ZQNOKEK.js";
|
|
17
16
|
import "./chunk-NNV2OYEF.js";
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-TCUYH5GO.js";
|
|
18
|
+
import "./chunk-OE4CY3ZL.js";
|
|
19
19
|
import "./chunk-QM57YDJE.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-RXDG57B2.js";
|
|
21
21
|
import "./chunk-QLKGOIWS.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-5LGKZBAY.js";
|
|
23
|
+
import "./chunk-RKNW4UX4.js";
|
|
24
24
|
import "./chunk-FDJMAF7D.js";
|
|
25
25
|
import "./chunk-ZYURL5VK.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-SCUTAREU.js";
|
|
27
27
|
export {
|
|
28
28
|
IMPORT_MAX_BODY_BYTES,
|
|
29
29
|
IMPORT_MAX_ROWS,
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
DESCRIPTIONS,
|
|
4
|
+
lazy
|
|
5
|
+
} from "./chunk-5LGKZBAY.js";
|
|
6
|
+
|
|
7
|
+
// src/commands/core.ts
|
|
8
|
+
import { defineCommand } from "citty";
|
|
9
|
+
var coreCommand = defineCommand({
|
|
10
|
+
meta: {
|
|
11
|
+
name: "core",
|
|
12
|
+
description: DESCRIPTIONS.core,
|
|
13
|
+
rules: {
|
|
14
|
+
notes: [
|
|
15
|
+
"Writes reach LinkedIn immediately and are seen by the people they touch.",
|
|
16
|
+
"A retry after a timeout can repeat a write: requests carry no idempotency key. Read the current state before retrying.",
|
|
17
|
+
"Budget rows, ceilings and what is left: `curviate account get <account_id>`."
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
subCommands: {
|
|
22
|
+
profile: lazy("profile", () => import("./profile-3SG64IEG.js").then((m) => m.profileCommand)),
|
|
23
|
+
company: lazy("company", () => import("./company-OUFF23SU.js").then((m) => m.companyCommand)),
|
|
24
|
+
job: lazy("job", () => import("./job-QFIUTHHT.js").then((m) => m.jobCommand)),
|
|
25
|
+
connect: lazy("connect", () => import("./connect-ICNXC37R.js").then((m) => m.connectCommand)),
|
|
26
|
+
search: lazy("search", () => import("./search-5LMSLUH4.js").then((m) => m.searchCommand)),
|
|
27
|
+
inbox: lazy("inbox", () => import("./inbox-5RGG5RQG.js").then((m) => m.inboxCommand)),
|
|
28
|
+
inboxes: lazy("inboxes", () => import("./inboxes-ZFY6ZP33.js").then((m) => m.inboxesCommand)),
|
|
29
|
+
message: lazy("message", () => import("./message-DM5OUKQS.js").then((m) => m.messageCommand)),
|
|
30
|
+
post: lazy("post", () => import("./post-M2G3BK4A.js").then((m) => m.postCommand)),
|
|
31
|
+
comment: lazy("comment", () => import("./comment-PNHEKGZX.js").then((m) => m.commentCommand)),
|
|
32
|
+
"sales-nav": lazy("sales-nav", () => import("./sales-nav-HHQLLM5C.js").then((m) => m.salesNavCommand)),
|
|
33
|
+
recruiter: lazy("recruiter", () => import("./recruiter-7OUGZ776.js").then((m) => m.recruiterCommand)),
|
|
34
|
+
group: lazy("group", () => import("./group-LRMG76FN.js").then((m) => m.groupCommand)),
|
|
35
|
+
feed: lazy("feed", () => import("./feed-RQHEDZVL.js").then((m) => m.feedCommand)),
|
|
36
|
+
notification: lazy("coreNotification", () => import("./notification-XW5J6KFA.js").then((m) => m.notificationCommand)),
|
|
37
|
+
draft: lazy("draft", () => import("./draft-JGQ36JSH.js").then((m) => m.draftCommand))
|
|
38
|
+
},
|
|
39
|
+
async run() {
|
|
40
|
+
const { showHelp } = await import("./examples-J4X5NEIE.js");
|
|
41
|
+
await showHelp(coreCommand, ["curviate", "core"]);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
coreCommand
|
|
46
|
+
};
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
import {
|
|
3
3
|
chunkRows,
|
|
4
4
|
csvRecords
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-Z3RPQ5K4.js";
|
|
5
|
+
} from "./chunk-AG6G3PRQ.js";
|
|
6
|
+
import "./chunk-A6JGJGDF.js";
|
|
8
7
|
import {
|
|
9
8
|
writeAtomic
|
|
10
9
|
} from "./chunk-GOICALYQ.js";
|
|
10
|
+
import "./chunk-F7CLAS5Y.js";
|
|
11
11
|
import {
|
|
12
12
|
sendChunked
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-6OT6TS7N.js";
|
|
14
14
|
import {
|
|
15
15
|
fail,
|
|
16
16
|
outputOpts,
|
|
17
17
|
rootClient,
|
|
18
18
|
usage
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import {
|
|
21
|
-
buildPreviewOutput
|
|
22
|
-
} from "./chunk-TCUYH5GO.js";
|
|
19
|
+
} from "./chunk-3ZQNOKEK.js";
|
|
23
20
|
import {
|
|
24
21
|
intFlag
|
|
25
22
|
} from "./chunk-NNV2OYEF.js";
|
|
23
|
+
import {
|
|
24
|
+
buildPreviewOutput
|
|
25
|
+
} from "./chunk-TCUYH5GO.js";
|
|
26
26
|
import {
|
|
27
27
|
pageDelayFromFlags,
|
|
28
28
|
readCursorFlag,
|
|
@@ -31,14 +31,14 @@ import {
|
|
|
31
31
|
readablePage,
|
|
32
32
|
rejectPaginationModifiersWithoutAll,
|
|
33
33
|
streamAll
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-OE4CY3ZL.js";
|
|
35
35
|
import {
|
|
36
36
|
renderSuccess,
|
|
37
37
|
writeNdjsonItem
|
|
38
38
|
} from "./chunk-QM57YDJE.js";
|
|
39
39
|
import {
|
|
40
40
|
downloadBinary
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-RXDG57B2.js";
|
|
42
42
|
import {
|
|
43
43
|
GLOBAL_FLAGS,
|
|
44
44
|
READ_SINGLE_FLAGS,
|
|
@@ -47,24 +47,30 @@ import {
|
|
|
47
47
|
} from "./chunk-QLKGOIWS.js";
|
|
48
48
|
import {
|
|
49
49
|
DESCRIPTIONS
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-5LGKZBAY.js";
|
|
51
51
|
import {
|
|
52
52
|
readFileFlag
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-RKNW4UX4.js";
|
|
54
54
|
import "./chunk-FDJMAF7D.js";
|
|
55
55
|
import {
|
|
56
56
|
isStdinToken
|
|
57
57
|
} from "./chunk-ZYURL5VK.js";
|
|
58
|
-
import "./chunk-
|
|
58
|
+
import "./chunk-SCUTAREU.js";
|
|
59
59
|
|
|
60
60
|
// src/commands/do-not-contact.ts
|
|
61
61
|
import { defineCommand } from "citty";
|
|
62
|
-
var REASONS = ["asked_to_stop", "existing_customer", "competitor", "partner", "employee", "other"];
|
|
62
|
+
var REASONS = ["asked_to_stop", "existing_customer", "competitor", "partner", "employee", "unsubscribed", "other"];
|
|
63
|
+
var SCOPES = ["everything", "email_only"];
|
|
63
64
|
var online = (fn) => async ({ args }) => {
|
|
64
65
|
const f = args;
|
|
65
66
|
await fn(await rootClient(f), f);
|
|
66
67
|
};
|
|
67
68
|
var preview = (method, args, body = {}) => void process.stdout.write(JSON.stringify(buildPreviewOutput({ method, args, body })) + "\n");
|
|
69
|
+
var scope = (f) => {
|
|
70
|
+
if (f.scope === void 0) return void 0;
|
|
71
|
+
if (!SCOPES.includes(f.scope)) usage(`--scope takes everything or email_only (got ${JSON.stringify(f.scope)}).`);
|
|
72
|
+
return f.scope;
|
|
73
|
+
};
|
|
68
74
|
var reason = (f, requiredFlag) => {
|
|
69
75
|
if (f.reason === void 0) return requiredFlag ? usage(`--reason is required: one of ${REASONS.join(", ")}.`) : void 0;
|
|
70
76
|
if (!REASONS.includes(f.reason)) usage(`--reason takes one of ${REASONS.join(", ")}.`);
|
|
@@ -104,6 +110,8 @@ async function runAdd(c, f) {
|
|
|
104
110
|
const body = f.lead !== void 0 ? { lead_id: f.lead } : { linkedin_url: f["linkedin-url"] };
|
|
105
111
|
const why = reason(f, false);
|
|
106
112
|
if (why) body["reason"] = why;
|
|
113
|
+
const what = scope(f);
|
|
114
|
+
if (what) body["scope"] = what;
|
|
107
115
|
if (f.preview) return preview("doNotContact.add", {}, body);
|
|
108
116
|
try {
|
|
109
117
|
renderSuccess(readableObject(await c.doNotContact.add(body)), outputOpts(f), process);
|
|
@@ -168,6 +176,7 @@ async function runImport(c, f) {
|
|
|
168
176
|
if (format === void 0) usage(dash ? "--format is required with --file -: csv, json or ndjson." : "--format could not be told from the file name: pass csv, json or ndjson.");
|
|
169
177
|
}
|
|
170
178
|
if (!FORMATS.includes(format)) usage(`--format takes one of ${FORMATS.join(", ")}.`);
|
|
179
|
+
const what = scope(f);
|
|
171
180
|
const text = await readFileFlag("file", file, { allowBom: true, maxBytes: 64 * 1024 * 1024, others: f });
|
|
172
181
|
let header;
|
|
173
182
|
let rows;
|
|
@@ -198,6 +207,13 @@ async function runImport(c, f) {
|
|
|
198
207
|
if (rows.length === 0) usage("--file: no rows to import.");
|
|
199
208
|
const bad = header === void 0 ? rows.findIndex((o) => o === null || typeof o !== "object" || Array.isArray(o)) : -1;
|
|
200
209
|
if (bad >= 0) usage(`--file: row ${bad + 1} is not an object.`);
|
|
210
|
+
if (what !== void 0 && header !== void 0) {
|
|
211
|
+
if (header.split(",").some((h) => h.trim().replace(/^"|"$/g, "").toLowerCase() === "scope")) usage("--scope: the file has a scope column; set it there, or drop the column.");
|
|
212
|
+
header = `${header},scope`;
|
|
213
|
+
rows = rows.map((r) => `${r},${what}`);
|
|
214
|
+
} else if (what !== void 0) {
|
|
215
|
+
rows = rows.map((r) => "scope" in r ? r : { ...r, scope: what });
|
|
216
|
+
}
|
|
201
217
|
const chunks = chunkRows(rows, (r) => Buffer.byteLength(typeof r === "string" ? r : JSON.stringify(r)) + 1, IMPORT_MAX_ROWS);
|
|
202
218
|
const bodyOf = (part) => header !== void 0 ? { csv: [header, ...part].join("\n") } : { rows: part };
|
|
203
219
|
if (f.preview) return preview("doNotContact.import", chunks.length > 1 ? { requests: chunks.length, rows: rows.length } : {}, bodyOf(chunks[0]));
|
|
@@ -224,6 +240,10 @@ async function runImport(c, f) {
|
|
|
224
240
|
}
|
|
225
241
|
var ID = { type: "positional", description: "Entry id (dnc_...), from `curviate do-not-contact list`." };
|
|
226
242
|
var REASON_ARG = { type: "string", description: `Why: ${REASONS.join(" | ")}.` };
|
|
243
|
+
var SCOPE_ARG = {
|
|
244
|
+
type: "string",
|
|
245
|
+
description: "What the entry stops: everything (default) or email_only (No email: email steps skip the person; LinkedIn Campaigns and writes still reach them)."
|
|
246
|
+
};
|
|
227
247
|
var listCmd = defineCommand({
|
|
228
248
|
meta: {
|
|
229
249
|
name: "list",
|
|
@@ -235,14 +255,14 @@ var listCmd = defineCommand({
|
|
|
235
255
|
run: online(runList)
|
|
236
256
|
});
|
|
237
257
|
var getCmd = defineCommand({
|
|
238
|
-
meta: { name: "get", description: "One do-not-contact entry: the person, the reason,
|
|
258
|
+
meta: { name: "get", description: "One do-not-contact entry: the person, the reason, the scope (everything or email_only), how it was added and by whom.", risk: "read", examples: ["curviate do-not-contact get dnc_YOUR_ENTRY_ID"] },
|
|
239
259
|
args: { ...readOnly(READ_SINGLE_FLAGS), id: ID },
|
|
240
260
|
run: online(runGet)
|
|
241
261
|
});
|
|
242
262
|
var addCmd = defineCommand({
|
|
243
263
|
meta: {
|
|
244
264
|
name: "add",
|
|
245
|
-
description: "Put one person on the list, by Lead id or LinkedIn URL (a URL of someone who is not a Lead yet creates the Lead from stored data). No Campaign contacts them afterwards and writes toward them are refused. One person per call; for many, `do-not-contact import`. Any member may add. Needs Automate.",
|
|
265
|
+
description: "Put one person on the list, by Lead id or LinkedIn URL (a URL of someone who is not a Lead yet creates the Lead from stored data). No Campaign contacts them afterwards and writes toward them are refused; with --scope email_only only email stops (No email). One person per call; for many, `do-not-contact import`. Any member may add. Needs Automate.",
|
|
246
266
|
risk: "write",
|
|
247
267
|
rules: {
|
|
248
268
|
changes: "The person joins the list; Campaigns skip them and writes toward them are refused.",
|
|
@@ -253,13 +273,18 @@ var addCmd = defineCommand({
|
|
|
253
273
|
},
|
|
254
274
|
errors: { TIER_REQUIRED: "your plan does not include Do-not-contact writes (Automate).", RESOURCE_NOT_FOUND: "no Lead has this id." },
|
|
255
275
|
seeAlso: ["curviate do-not-contact list", "curviate do-not-contact import"],
|
|
256
|
-
examples: [
|
|
276
|
+
examples: [
|
|
277
|
+
"curviate do-not-contact add --lead con_YOUR_LEAD_ID --reason asked_to_stop",
|
|
278
|
+
"curviate do-not-contact add --linkedin-url https://www.linkedin.com/in/jane-doe",
|
|
279
|
+
"curviate do-not-contact add --lead con_YOUR_LEAD_ID --scope email_only"
|
|
280
|
+
]
|
|
257
281
|
},
|
|
258
282
|
args: {
|
|
259
283
|
...WRITE_SINGLE_FLAGS,
|
|
260
284
|
lead: { type: "string", description: "The Lead (con_...). Not with --linkedin-url." },
|
|
261
285
|
"linkedin-url": { type: "string", description: "The person's LinkedIn profile URL, in any spelling. Not with --lead." },
|
|
262
|
-
reason: REASON_ARG
|
|
286
|
+
reason: REASON_ARG,
|
|
287
|
+
scope: SCOPE_ARG
|
|
263
288
|
},
|
|
264
289
|
run: online(runAdd)
|
|
265
290
|
});
|
|
@@ -343,7 +368,8 @@ var importCmd = defineCommand({
|
|
|
343
368
|
args: {
|
|
344
369
|
...WRITE_SINGLE_FLAGS,
|
|
345
370
|
file: { type: "string", stdinArg: true, required: true, description: "The file: a path, or - to read it from stdin (then --format is required)." },
|
|
346
|
-
format: { type: "string", description: "csv | json | ndjson. Default: from the file extension (.csv, .json, .ndjson)." }
|
|
371
|
+
format: { type: "string", description: "csv | json | ndjson. Default: from the file extension (.csv, .json, .ndjson)." },
|
|
372
|
+
scope: { ...SCOPE_ARG, description: "The scope of every row that names none: everything (default) or email_only." }
|
|
347
373
|
},
|
|
348
374
|
run: online(runImport)
|
|
349
375
|
});
|
|
@@ -351,7 +377,7 @@ var doNotContactCommand = defineCommand({
|
|
|
351
377
|
meta: { name: "do-not-contact", description: DESCRIPTIONS["do-not-contact"] },
|
|
352
378
|
subCommands: { list: listCmd, get: getCmd, add: addCmd, update: updateCmd, remove: removeCmd, export: exportCmd, import: importCmd },
|
|
353
379
|
async run() {
|
|
354
|
-
const { showHelp } = await import("./examples-
|
|
380
|
+
const { showHelp } = await import("./examples-J4X5NEIE.js");
|
|
355
381
|
await showHelp(doNotContactCommand, ["curviate", "do-not-contact"]);
|
|
356
382
|
}
|
|
357
383
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readablePage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OE4CY3ZL.js";
|
|
5
5
|
import "./chunk-QM57YDJE.js";
|
|
6
6
|
import {
|
|
7
7
|
createClient,
|
|
@@ -10,17 +10,17 @@ import {
|
|
|
10
10
|
readConfigFile,
|
|
11
11
|
resolveEffectiveConfig,
|
|
12
12
|
withoutUserinfo
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-RXDG57B2.js";
|
|
14
14
|
import {
|
|
15
15
|
GLOBAL_FLAGS
|
|
16
16
|
} from "./chunk-QLKGOIWS.js";
|
|
17
17
|
import {
|
|
18
18
|
DESCRIPTIONS
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-5LGKZBAY.js";
|
|
20
20
|
import "./chunk-ZYURL5VK.js";
|
|
21
21
|
import {
|
|
22
22
|
getExitCode
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-SCUTAREU.js";
|
|
24
24
|
|
|
25
25
|
// src/commands/doctor.ts
|
|
26
26
|
import { defineCommand } from "citty";
|
|
@@ -42,6 +42,9 @@ function defaultVersion() {
|
|
|
42
42
|
async function defaultListAccounts(apiKey, baseUrl, timeout) {
|
|
43
43
|
return createClient({ apiKey, baseUrl, timeout }).accounts.list();
|
|
44
44
|
}
|
|
45
|
+
async function defaultListMailboxes(apiKey, baseUrl, timeout, team) {
|
|
46
|
+
return createClient({ apiKey, baseUrl, timeout, ...team ? { team } : {} }).mailboxes.list({ limit: 100 });
|
|
47
|
+
}
|
|
45
48
|
async function defaultListTeams(apiKey, baseUrl, timeout) {
|
|
46
49
|
return createClient({ apiKey, baseUrl, timeout, team: null }).teams.list({ limit: 100 });
|
|
47
50
|
}
|
|
@@ -57,6 +60,7 @@ function resolveDoctorIO(io = {}) {
|
|
|
57
60
|
isOutputTTY: io.isOutputTTY ?? (process.stdout.isTTY ?? false),
|
|
58
61
|
listAccounts: io.listAccounts ?? defaultListAccounts,
|
|
59
62
|
listTeams: io.listTeams ?? defaultListTeams,
|
|
63
|
+
listMailboxes: io.listMailboxes ?? defaultListMailboxes,
|
|
60
64
|
version: io.version ?? defaultVersion
|
|
61
65
|
};
|
|
62
66
|
}
|
|
@@ -132,6 +136,7 @@ async function runDoctor(args, io) {
|
|
|
132
136
|
exit: 8
|
|
133
137
|
});
|
|
134
138
|
team = await checkTeam(io, effective.apiKey, effective.baseUrl, effective.timeout, keyScope, team, checks);
|
|
139
|
+
checks.push(await checkMailboxes(io, effective.apiKey, effective.baseUrl, effective.timeout, team?.team_id));
|
|
135
140
|
} catch (err) {
|
|
136
141
|
const error = err;
|
|
137
142
|
const code = typeof error.code === "string" ? error.code : void 0;
|
|
@@ -180,6 +185,18 @@ async function runDoctor(args, io) {
|
|
|
180
185
|
};
|
|
181
186
|
return report;
|
|
182
187
|
}
|
|
188
|
+
async function checkMailboxes(io, apiKey, baseUrl, timeout, team) {
|
|
189
|
+
try {
|
|
190
|
+
const payload = await io.listMailboxes(apiKey, baseUrl, timeout, team);
|
|
191
|
+
const items = isPlainObject(payload) && Array.isArray(payload["items"]) ? payload["items"] : [];
|
|
192
|
+
const sending = items.filter((m) => isPlainObject(m) && (m["state"] === "connected" || m["state"] === "ramping")).length;
|
|
193
|
+
const detail = items.length === 0 ? "none: email steps cannot send (`curviate mailbox connect`)" : `${items.length} (${sending} can send)`;
|
|
194
|
+
return { name: "mailboxes", ok: true, detail, exit: 0 };
|
|
195
|
+
} catch (err) {
|
|
196
|
+
const code = err.code;
|
|
197
|
+
return { name: "mailboxes", ok: true, detail: `not read (${typeof code === "string" ? code : "error"})`, exit: 0 };
|
|
198
|
+
}
|
|
199
|
+
}
|
|
183
200
|
async function checkTeam(io, apiKey, baseUrl, timeout, scope, team, checks) {
|
|
184
201
|
let rows;
|
|
185
202
|
try {
|
|
@@ -4,24 +4,24 @@ import {
|
|
|
4
4
|
outputOpts,
|
|
5
5
|
rootClient,
|
|
6
6
|
usage
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3ZQNOKEK.js";
|
|
8
8
|
import {
|
|
9
9
|
buildPreviewOutput
|
|
10
10
|
} from "./chunk-TCUYH5GO.js";
|
|
11
11
|
import {
|
|
12
12
|
readableObject
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-OE4CY3ZL.js";
|
|
14
14
|
import {
|
|
15
15
|
renderSuccess
|
|
16
16
|
} from "./chunk-QM57YDJE.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-RXDG57B2.js";
|
|
18
18
|
import {
|
|
19
19
|
READ_SINGLE_FLAGS,
|
|
20
20
|
readOnly
|
|
21
21
|
} from "./chunk-QLKGOIWS.js";
|
|
22
22
|
import {
|
|
23
23
|
DESCRIPTIONS
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-5LGKZBAY.js";
|
|
25
25
|
import "./chunk-ZYURL5VK.js";
|
|
26
26
|
|
|
27
27
|
// src/commands/domain.ts
|
|
@@ -29,12 +29,12 @@ import { defineCommand } from "citty";
|
|
|
29
29
|
var checkCmd = defineCommand({
|
|
30
30
|
meta: {
|
|
31
31
|
name: "check",
|
|
32
|
-
description: "A sending domain's checks as last run (daily): mx, spf, dkim, dmarc and tracking, each pass, fail or unknown (a failed lookup, or a DKIM selector not known yet, is never a fail), with the tracking record to add and
|
|
32
|
+
description: "A sending domain's checks as last run (daily): mx, spf, dkim, dmarc and tracking, each pass, fail or unknown (a failed lookup, or a DKIM selector not known yet, is never a fail), with the tracking record to add, any blocklists and the DKIM selector found. --now runs them now: DNS lookups only, nothing is sent and no Mailbox is contacted. It takes any domain your Team names, before its first Mailbox there too, so the records can be set up first. A check warns and never stops sending.",
|
|
33
33
|
risk: "read",
|
|
34
34
|
output: ["The domain with its checks. Without --now the answer is the last daily run; with --now, the run just made."],
|
|
35
|
-
errors: { DOMAIN_NOT_FOUND: "
|
|
35
|
+
errors: { DOMAIN_NOT_FOUND: "without --now: your Team has no Mailbox on this domain and never checked it (another Team's domain answers the same); a public email provider's domain always." },
|
|
36
36
|
seeAlso: ["curviate mailbox list"],
|
|
37
|
-
examples: ["curviate domain check acme.example", "curviate domain check acme.example
|
|
37
|
+
examples: ["curviate domain check acme.example --now", "curviate domain check acme.example"]
|
|
38
38
|
},
|
|
39
39
|
args: {
|
|
40
40
|
...readOnly(READ_SINGLE_FLAGS),
|
|
@@ -61,7 +61,7 @@ var domainCommand = defineCommand({
|
|
|
61
61
|
meta: { name: "domain", description: DESCRIPTIONS["domain"] },
|
|
62
62
|
subCommands: { check: checkCmd },
|
|
63
63
|
async run() {
|
|
64
|
-
const { showHelp } = await import("./examples-
|
|
64
|
+
const { showHelp } = await import("./examples-J4X5NEIE.js");
|
|
65
65
|
await showHelp(domainCommand, ["curviate", "domain"]);
|
|
66
66
|
}
|
|
67
67
|
});
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
readablePage,
|
|
21
21
|
rejectPaginationModifiersWithoutAll,
|
|
22
22
|
streamAll
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-OE4CY3ZL.js";
|
|
24
24
|
import {
|
|
25
25
|
renderError,
|
|
26
26
|
renderSuccess,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
import {
|
|
31
31
|
createClient,
|
|
32
32
|
resolveEffectiveConfig
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-RXDG57B2.js";
|
|
34
34
|
import {
|
|
35
35
|
GLOBAL_FLAGS,
|
|
36
36
|
READ_SINGLE_FLAGS,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
} from "./chunk-QLKGOIWS.js";
|
|
40
40
|
import {
|
|
41
41
|
DESCRIPTIONS
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-5LGKZBAY.js";
|
|
43
43
|
import {
|
|
44
44
|
resolveTextOrStdin
|
|
45
45
|
} from "./chunk-ZYURL5VK.js";
|
|
@@ -73,7 +73,7 @@ function rejectAllOnNonPaginated(all, out) {
|
|
|
73
73
|
async function handleError(err, outOpts, out) {
|
|
74
74
|
const { CurviateError } = await import("@curviate/sdk");
|
|
75
75
|
if (err instanceof CurviateError) {
|
|
76
|
-
const { getExitCode } = await import("./exit-codes-
|
|
76
|
+
const { getExitCode } = await import("./exit-codes-P2FLCKM7.js");
|
|
77
77
|
renderError(err, outOpts, out);
|
|
78
78
|
process.exit(getExitCode(err));
|
|
79
79
|
}
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
outputOpts,
|
|
6
6
|
rootClient,
|
|
7
7
|
usage
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
buildPreviewOutput
|
|
11
|
-
} from "./chunk-TCUYH5GO.js";
|
|
8
|
+
} from "./chunk-3ZQNOKEK.js";
|
|
12
9
|
import {
|
|
13
10
|
intFlag
|
|
14
11
|
} from "./chunk-NNV2OYEF.js";
|
|
12
|
+
import {
|
|
13
|
+
buildPreviewOutput
|
|
14
|
+
} from "./chunk-TCUYH5GO.js";
|
|
15
15
|
import {
|
|
16
16
|
pageDelayFromFlags,
|
|
17
17
|
readCursorFlag,
|
|
@@ -20,12 +20,12 @@ import {
|
|
|
20
20
|
readablePage,
|
|
21
21
|
rejectPaginationModifiersWithoutAll,
|
|
22
22
|
streamAll
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-OE4CY3ZL.js";
|
|
24
24
|
import {
|
|
25
25
|
renderSuccess,
|
|
26
26
|
writeNdjsonItem
|
|
27
27
|
} from "./chunk-QM57YDJE.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-RXDG57B2.js";
|
|
29
29
|
import {
|
|
30
30
|
GLOBAL_FLAGS,
|
|
31
31
|
READ_SINGLE_FLAGS,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
} from "./chunk-QLKGOIWS.js";
|
|
35
35
|
import {
|
|
36
36
|
DESCRIPTIONS
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-5LGKZBAY.js";
|
|
38
38
|
import "./chunk-ZYURL5VK.js";
|
|
39
39
|
|
|
40
40
|
// src/commands/enrollment.ts
|
|
@@ -80,6 +80,8 @@ function humanReasons(data) {
|
|
|
80
80
|
o["reason"] = paired(o["reason"], o["reason_message"]);
|
|
81
81
|
delete o["reason_message"];
|
|
82
82
|
}
|
|
83
|
+
const next = o["next_action"];
|
|
84
|
+
if (next && typeof next === "object" && typeof next["text"] === "string") o["next_action"] = next["text"];
|
|
83
85
|
for (const k of ["items", "history"]) if (Array.isArray(o[k])) o[k] = o[k].map(humanReasons);
|
|
84
86
|
return o;
|
|
85
87
|
}
|
|
@@ -206,7 +208,7 @@ async function runBulk(c, f) {
|
|
|
206
208
|
}
|
|
207
209
|
const firstError = results.find((r) => r.outcome !== "ok");
|
|
208
210
|
if (firstError) {
|
|
209
|
-
const { getExitCode } = await import("./exit-codes-
|
|
211
|
+
const { getExitCode } = await import("./exit-codes-P2FLCKM7.js");
|
|
210
212
|
process.stderr.write(`error: ${results.filter((r) => r.outcome !== "ok").length} of ${results.length} Enrollments were refused; each refusal is listed.
|
|
211
213
|
`);
|
|
212
214
|
process.exit(getExitCode(firstError.error?.code ?? "INTERNAL"));
|
|
@@ -473,7 +475,7 @@ var enrollmentCommand = defineCommand({
|
|
|
473
475
|
bulk: bulkCmd
|
|
474
476
|
},
|
|
475
477
|
async run() {
|
|
476
|
-
const { showHelp } = await import("./examples-
|
|
478
|
+
const { showHelp } = await import("./examples-J4X5NEIE.js");
|
|
477
479
|
await showHelp(enrollmentCommand, ["curviate", "enrollment"]);
|
|
478
480
|
}
|
|
479
481
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
EXIT_CODE_MAP
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SCUTAREU.js";
|
|
5
5
|
|
|
6
6
|
// src/lib/examples.ts
|
|
7
7
|
import { renderUsage } from "citty";
|
|
@@ -22,7 +22,7 @@ function renderRules(rules) {
|
|
|
22
22
|
}
|
|
23
23
|
async function renderSections(cmd) {
|
|
24
24
|
const meta = typeof cmd.meta === "function" ? await cmd.meta() : await cmd.meta;
|
|
25
|
-
const { renderDocument } = meta?.document ? await import("./document-
|
|
25
|
+
const { renderDocument } = meta?.document ? await import("./document-H65EXU4L.js") : { renderDocument: () => [] };
|
|
26
26
|
const body = {
|
|
27
27
|
DOCUMENT: meta?.document ? renderDocument(meta.document) : void 0,
|
|
28
28
|
RULES: renderRules(meta?.rules),
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
outputOpts,
|
|
8
8
|
rootClient,
|
|
9
9
|
usage
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3ZQNOKEK.js";
|
|
11
11
|
import {
|
|
12
12
|
renderSuccess
|
|
13
13
|
} from "./chunk-QM57YDJE.js";
|
|
14
14
|
import {
|
|
15
15
|
downloadBinary
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-RXDG57B2.js";
|
|
17
17
|
import {
|
|
18
18
|
GLOBAL_FLAGS,
|
|
19
19
|
READ_SINGLE_FLAGS,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./chunk-QLKGOIWS.js";
|
|
22
22
|
import {
|
|
23
23
|
DESCRIPTIONS
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-5LGKZBAY.js";
|
|
25
25
|
import "./chunk-ZYURL5VK.js";
|
|
26
26
|
|
|
27
27
|
// src/commands/export.ts
|
|
@@ -87,7 +87,7 @@ var exportCommand = defineCommand({
|
|
|
87
87
|
meta: { name: "export", description: DESCRIPTIONS.export },
|
|
88
88
|
subCommands: { get: getCmd, download: downloadCmd },
|
|
89
89
|
async run() {
|
|
90
|
-
const { showHelp } = await import("./examples-
|
|
90
|
+
const { showHelp } = await import("./examples-J4X5NEIE.js");
|
|
91
91
|
await showHelp(exportCommand, ["curviate", "export"]);
|
|
92
92
|
}
|
|
93
93
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
requireAccount
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-F7CLAS5Y.js";
|
|
5
5
|
import {
|
|
6
6
|
pageDelayFromFlags,
|
|
7
7
|
readCursorFlag,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
readablePage,
|
|
10
10
|
rejectPaginationModifiersWithoutAll,
|
|
11
11
|
streamAll
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OE4CY3ZL.js";
|
|
13
13
|
import {
|
|
14
14
|
renderError,
|
|
15
15
|
renderSuccess,
|
|
@@ -19,16 +19,16 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
createClient,
|
|
21
21
|
resolveEffectiveConfig
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-RXDG57B2.js";
|
|
23
23
|
import {
|
|
24
24
|
GLOBAL_FLAGS,
|
|
25
25
|
readOnly
|
|
26
26
|
} from "./chunk-QLKGOIWS.js";
|
|
27
27
|
import {
|
|
28
28
|
DESCRIPTIONS
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-5LGKZBAY.js";
|
|
30
30
|
import "./chunk-ZYURL5VK.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-SCUTAREU.js";
|
|
32
32
|
|
|
33
33
|
// src/commands/feed.ts
|
|
34
34
|
import { defineCommand } from "citty";
|
|
@@ -49,7 +49,7 @@ function resolveOutputOpts(flags) {
|
|
|
49
49
|
async function handleSdkError(err, outOpts, out) {
|
|
50
50
|
const { CurviateError } = await import("@curviate/sdk");
|
|
51
51
|
if (err instanceof CurviateError) {
|
|
52
|
-
const { getExitCode } = await import("./exit-codes-
|
|
52
|
+
const { getExitCode } = await import("./exit-codes-P2FLCKM7.js");
|
|
53
53
|
renderError(err, outOpts, out);
|
|
54
54
|
process.exit(getExitCode(err));
|
|
55
55
|
}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-UEAX6KUB.js";
|
|
5
5
|
import {
|
|
6
6
|
requireAccount
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-F7CLAS5Y.js";
|
|
8
8
|
import {
|
|
9
9
|
pageDelayFromFlags,
|
|
10
10
|
readCursorFlag,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
readablePage,
|
|
14
14
|
rejectPaginationModifiersWithoutAll,
|
|
15
15
|
streamAll
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OE4CY3ZL.js";
|
|
17
17
|
import {
|
|
18
18
|
renderError,
|
|
19
19
|
renderSuccess,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
createClient,
|
|
25
25
|
resolveEffectiveConfig
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-RXDG57B2.js";
|
|
27
27
|
import {
|
|
28
28
|
GLOBAL_FLAGS,
|
|
29
29
|
READ_SINGLE_FLAGS,
|
|
@@ -31,9 +31,9 @@ import {
|
|
|
31
31
|
} from "./chunk-QLKGOIWS.js";
|
|
32
32
|
import {
|
|
33
33
|
DESCRIPTIONS
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-5LGKZBAY.js";
|
|
35
35
|
import "./chunk-ZYURL5VK.js";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-SCUTAREU.js";
|
|
37
37
|
|
|
38
38
|
// src/commands/group.ts
|
|
39
39
|
import { defineCommand } from "citty";
|
|
@@ -60,7 +60,7 @@ function resolveOutputOpts(flags) {
|
|
|
60
60
|
async function handleSdkError(err, outOpts, out) {
|
|
61
61
|
const { CurviateError } = await import("@curviate/sdk");
|
|
62
62
|
if (err instanceof CurviateError) {
|
|
63
|
-
const { getExitCode } = await import("./exit-codes-
|
|
63
|
+
const { getExitCode } = await import("./exit-codes-P2FLCKM7.js");
|
|
64
64
|
renderError(err, outOpts, out);
|
|
65
65
|
process.exit(getExitCode(err));
|
|
66
66
|
}
|