@curviate/cli 0.56.0 → 0.58.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 +129 -0
- package/README.md +9 -2
- package/dist/{account-ZF5NEMID.js → account-GSL6BCNX.js} +49 -13
- package/dist/{analytics-M7JWS67A.js → analytics-4FUMJSMC.js} +6 -6
- package/dist/{beta-consent-4Q2LZZQC.js → beta-consent-EC2QF6CM.js} +4 -4
- package/dist/billing-STRNXA4H.js +19 -0
- package/dist/{chunk-XP6S6E55.js → chunk-3IL3D5IZ.js} +2 -2
- package/dist/{chunk-UWRWZG4N.js → chunk-5OAJ4D65.js} +2 -2
- package/dist/{chunk-AMTKGO37.js → chunk-5Z3CCE5N.js} +1 -1
- package/dist/chunk-7F6B7P32.js +359 -0
- package/dist/{chunk-UOWOKEB2.js → chunk-CQHCPZ5I.js} +1 -1
- package/dist/{chunk-RDKTHFQ6.js → chunk-EWSOIFG2.js} +21 -0
- package/dist/{chunk-RKNW4UX4.js → chunk-JKOQX46J.js} +6 -0
- package/dist/{chunk-VHNF6OZD.js → chunk-JY26SUNH.js} +18 -2
- package/dist/{chunk-VEMK4MJM.js → chunk-KS4I4B3Z.js} +6 -6
- package/dist/{chunk-MIOEYSBQ.js → chunk-KUVJM5CP.js} +1 -1
- package/dist/{chunk-CRO7PJ4I.js → chunk-MLZSXQZC.js} +2 -2
- package/dist/{chunk-7PLTQHNO.js → chunk-PBJZQZPO.js} +1 -1
- package/dist/{chunk-J4SFOFMT.js → chunk-WGGZWJPO.js} +11 -11
- package/dist/{chunk-L3RJU7C3.js → chunk-WITIJCUU.js} +115 -14
- package/dist/{chunk-MWVTFTWV.js → chunk-XDPU2YAF.js} +8 -5
- package/dist/{chunk-EI64VFBE.js → chunk-XXB4MAX3.js} +121 -11
- package/dist/cli.js +30 -28
- package/dist/{comment-D6RSZTVK.js → comment-MUELYZYN.js} +8 -8
- package/dist/{company-3Z6PXGTW.js → company-5N7CXORR.js} +21 -10
- package/dist/company-record-HWLTP4TV.js +213 -0
- package/dist/{config-VY5MCJMN.js → config-PI7JMQ2L.js} +2 -2
- package/dist/{connect-G2RTLV7G.js → connect-NNZOOPWV.js} +11 -11
- package/dist/{contact-QSLJCBDE.js → contact-VNG7HRCN.js} +8 -8
- package/dist/{contact-groups-OITAD73K.js → contact-groups-6JF7VX6Q.js} +10 -10
- package/dist/{contact-import-LT7BKESC.js → contact-import-TMJWY2VD.js} +10 -10
- package/dist/core-ZRJY3HTF.js +46 -0
- package/dist/{do-not-contact-ZA7KS5WD.js → do-not-contact-GDVIUNMT.js} +19 -17
- package/dist/{doctor-JQT3DO6G.js → doctor-ZNAR5AZ2.js} +21 -4
- package/dist/{document-H65EXU4L.js → document-G6UND26L.js} +1 -1
- package/dist/{domain-7EX4E34B.js → domain-62YUYVDW.js} +8 -8
- package/dist/{draft-7U6H4BPF.js → draft-ED6RL67K.js} +5 -5
- package/dist/{enrollment-AZ6XGVVL.js → enrollment-LN3Z3RC5.js} +11 -7
- package/dist/{examples-IGQJCSNL.js → examples-5FJS47QF.js} +2 -2
- package/dist/{exit-codes-ZSOLAXQO.js → exit-codes-LQDMGDII.js} +1 -1
- package/dist/{export-OYMQXL62.js → export-S6D4FEAG.js} +4 -4
- package/dist/{feed-M5D4SJW7.js → feed-AC7HWUCD.js} +6 -6
- package/dist/{group-UTC3YBKE.js → group-6N37Q5ZS.js} +6 -6
- package/dist/{inbox-VSGNHSLG.js → inbox-JFRBROQ2.js} +6 -6
- package/dist/{inboxes-23C2MJK4.js → inboxes-IBZHZKSD.js} +6 -6
- package/dist/{incoming-QVPP32K7.js → incoming-YDRPPO24.js} +5 -5
- package/dist/{job-ZHVFFRWE.js → job-CSRHIFZM.js} +6 -6
- package/dist/{login-6OTNXEJZ.js → login-M7ZLOR2U.js} +2 -2
- package/dist/mailbox-E2K3I2VH.js +712 -0
- package/dist/{message-PIV77W47.js → message-SX6RDGWP.js} +7 -7
- package/dist/{motion-AHYF34DP.js → motion-4HH3OFI6.js} +118 -13
- package/dist/{network-RJHJFZEY.js → network-JQYLSQDH.js} +9 -9
- package/dist/{notification-XGR4NT3S.js → notification-ZAQM463D.js} +6 -6
- package/dist/{notifications-BHRWSHPR.js → notifications-N55F3DP3.js} +14 -9
- package/dist/{post-Z7AVDDKA.js → post-SIHHJX3P.js} +8 -8
- package/dist/{profile-YZNBX2RP.js → profile-VBHX3QGP.js} +12 -12
- package/dist/{recruiter-EXM4P7X7.js → recruiter-7AGFKQPI.js} +9 -9
- package/dist/{sales-nav-CKDSEXV2.js → sales-nav-ADVFBKWB.js} +9 -9
- package/dist/{search-B7FB6674.js → search-THJFPGOH.js} +16 -16
- package/dist/{setup-VZVPLJ4V.js → setup-D6D7SNND.js} +4 -4
- package/dist/signal-TGSF7WEP.js +438 -0
- package/dist/{team-PYABBUHO.js → team-MVNHCWJP.js} +59 -5
- package/dist/{tier-PRK4WQKR.js → tier-DAF7Y2HN.js} +6 -5
- package/dist/unibox-7B6B4SXB.js +741 -0
- package/dist/{webhook-V74EV4E2.js → webhook-NUVSTDXF.js} +9 -9
- package/package.json +3 -3
- package/dist/billing-LYPSX5SR.js +0 -196
- package/dist/core-RFTNNB6P.js +0 -46
- package/dist/mailbox-HD2UXZCA.js +0 -405
- package/dist/unibox-ZNKX2EKL.js +0 -410
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
print,
|
|
4
|
+
table
|
|
5
|
+
} from "./chunk-5S3MJVI5.js";
|
|
6
|
+
import {
|
|
7
|
+
fail,
|
|
8
|
+
listFlag,
|
|
9
|
+
outputOpts,
|
|
10
|
+
rootClient,
|
|
11
|
+
usage
|
|
12
|
+
} from "./chunk-5OAJ4D65.js";
|
|
13
|
+
import {
|
|
14
|
+
buildPreviewOutput
|
|
15
|
+
} from "./chunk-TCUYH5GO.js";
|
|
16
|
+
import {
|
|
17
|
+
intFlag
|
|
18
|
+
} from "./chunk-NNV2OYEF.js";
|
|
19
|
+
import {
|
|
20
|
+
pageDelayFromFlags,
|
|
21
|
+
readCursorFlag,
|
|
22
|
+
readMaxPagesFlag,
|
|
23
|
+
readableObject,
|
|
24
|
+
readablePage,
|
|
25
|
+
rejectPaginationModifiersWithoutAll,
|
|
26
|
+
streamAll
|
|
27
|
+
} from "./chunk-KUVJM5CP.js";
|
|
28
|
+
import {
|
|
29
|
+
renderSuccess,
|
|
30
|
+
writeNdjsonItem
|
|
31
|
+
} from "./chunk-QM57YDJE.js";
|
|
32
|
+
import "./chunk-PBJZQZPO.js";
|
|
33
|
+
import {
|
|
34
|
+
GLOBAL_FLAGS,
|
|
35
|
+
READ_SINGLE_FLAGS,
|
|
36
|
+
WRITE_SINGLE_FLAGS,
|
|
37
|
+
readOnly
|
|
38
|
+
} from "./chunk-QLKGOIWS.js";
|
|
39
|
+
import {
|
|
40
|
+
DESCRIPTIONS
|
|
41
|
+
} from "./chunk-XDPU2YAF.js";
|
|
42
|
+
import "./chunk-ZYURL5VK.js";
|
|
43
|
+
|
|
44
|
+
// src/commands/signal.ts
|
|
45
|
+
import { defineCommand } from "citty";
|
|
46
|
+
var KINDS = ["post_engaged", "post_reposted", "network_posted", "profile_viewed", "followed_you", "mentioned_you", "connection_added", "post_engaged.reaction", "post_engaged.comment"];
|
|
47
|
+
var MATCHES = ["lead", "connection", "followed", "unknown", "anonymous"];
|
|
48
|
+
var OUTCOMES = ["added_to_list", "already_in_list", "event_sent", "skipped"];
|
|
49
|
+
var online = (fn) => async ({ args }) => {
|
|
50
|
+
const f = args;
|
|
51
|
+
await fn(await rootClient(f), f);
|
|
52
|
+
};
|
|
53
|
+
var preview = (method, args, body) => process.stdout.write(JSON.stringify(buildPreviewOutput({ method, args, body })) + "\n");
|
|
54
|
+
var nonEmpty = (what, v) => v !== void 0 && v.trim() !== "" ? v : usage(`${what} is required.`);
|
|
55
|
+
async function paged(f, params, fetch, human) {
|
|
56
|
+
rejectPaginationModifiersWithoutAll(f, process);
|
|
57
|
+
if (f.limit !== void 0) params["limit"] = intFlag("limit", f.limit, 1, 100);
|
|
58
|
+
const cursor = readCursorFlag(f, process);
|
|
59
|
+
if (cursor) params["cursor"] = cursor;
|
|
60
|
+
if (f.all) {
|
|
61
|
+
for await (const item of streamAll((p) => fetch(p), params, { maxPages: readMaxPagesFlag(f, process), out: process, pageDelayMs: pageDelayFromFlags(f) })) writeNdjsonItem(process, item, f.fields);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const page = readablePage(await fetch(params));
|
|
65
|
+
if (outputOpts(f).json) return renderSuccess(page, outputOpts(f), process);
|
|
66
|
+
human(page.items);
|
|
67
|
+
if (page["cursor"]) print(`next page: --cursor ${String(page["cursor"])}`);
|
|
68
|
+
}
|
|
69
|
+
async function runList(c, f) {
|
|
70
|
+
const q = {};
|
|
71
|
+
if (f.kind !== void 0) {
|
|
72
|
+
const kind = String(f.kind);
|
|
73
|
+
if (!KINDS.includes(kind)) usage(`--kind takes one of ${KINDS.join(", ")}.`);
|
|
74
|
+
q["kind"] = kind;
|
|
75
|
+
}
|
|
76
|
+
if (f["account-id"] !== void 0) q["account_id"] = f["account-id"];
|
|
77
|
+
if (f.match !== void 0) {
|
|
78
|
+
if (!MATCHES.includes(f.match)) usage(`--match takes one of ${MATCHES.join(", ")}.`);
|
|
79
|
+
q["match"] = f.match;
|
|
80
|
+
}
|
|
81
|
+
if (f.listed !== void 0) q["listed"] = f.listed;
|
|
82
|
+
if (f.since !== void 0) q["since"] = f.since;
|
|
83
|
+
try {
|
|
84
|
+
await paged(f, q, (p) => c.signals.list(p), (items) => print(table(["SIGNAL", "KIND", "ACCOUNT", "PERSON", "AT"], items.map((i) => [i["id"], i["sub_kind"] ? `${String(i["kind"])}.${String(i["sub_kind"])}` : i["kind"], i["account_id"], i["person"]?.["name"] ?? (i["anonymous"] ? "anonymous" : ""), i["occurred_at"]]))));
|
|
85
|
+
} catch (err) {
|
|
86
|
+
await fail(err, f);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async function one(f, run) {
|
|
90
|
+
try {
|
|
91
|
+
renderSuccess(readableObject(await run()), outputOpts(f), process);
|
|
92
|
+
} catch (err) {
|
|
93
|
+
await fail(err, f);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async function runWatch(c, f) {
|
|
97
|
+
try {
|
|
98
|
+
const res = await c.signals.watch();
|
|
99
|
+
if (outputOpts(f).json) return renderSuccess(res, outputOpts(f), process);
|
|
100
|
+
print(table(
|
|
101
|
+
["ACCOUNT", "WATCH", "STATE", "PAUSED UNTIL", "LAST VISIT", "VISITS TODAY", "READS TODAY"],
|
|
102
|
+
(res.items ?? []).map((i) => [i["account_id"], i["signal_watch"] ? "on" : "off", i["pause_reason"] ? `${String(i["state"])} (${String(i["pause_reason"])})` : i["state"], i["paused_until"], i["last_visit_at"], i["visits_today"], i["reads_today"]])
|
|
103
|
+
));
|
|
104
|
+
} catch (err) {
|
|
105
|
+
await fail(err, f);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
var onOff = (flag, v) => v === void 0 ? void 0 : v === "on" ? true : v === "off" ? false : usage(`--${flag} takes on or off.`);
|
|
109
|
+
function settingsBody(f) {
|
|
110
|
+
const follow_up = {};
|
|
111
|
+
const pe = onOff("post-engaged", f["post-engaged"]);
|
|
112
|
+
const pv = onOff("profile-viewed", f["profile-viewed"]);
|
|
113
|
+
if (pe !== void 0) follow_up["post_engaged"] = pe;
|
|
114
|
+
if (pv !== void 0) follow_up["profile_viewed"] = pv;
|
|
115
|
+
if (!Object.keys(follow_up).length) usage("pass --post-engaged on|off, --profile-viewed on|off, or both.");
|
|
116
|
+
return { follow_up };
|
|
117
|
+
}
|
|
118
|
+
function ruleBody(f, create) {
|
|
119
|
+
const body = {};
|
|
120
|
+
if (f.name !== void 0) body["name"] = f.name;
|
|
121
|
+
if (f.on && f.off) usage("pass --on or --off, not both.");
|
|
122
|
+
if (f.on || f.off) body["enabled"] = Boolean(f.on);
|
|
123
|
+
if (f.kind !== void 0) {
|
|
124
|
+
const kinds = listFlag("kind", f.kind);
|
|
125
|
+
const bad = kinds.find((k) => !KINDS.includes(k));
|
|
126
|
+
if (bad !== void 0) usage(`--kind ${bad} is not a Signal kind: one of ${KINDS.join(", ")}.`);
|
|
127
|
+
body["kinds"] = kinds;
|
|
128
|
+
}
|
|
129
|
+
if (f.accounts !== void 0 && f["all-accounts"]) usage("--accounts and --all-accounts cannot be combined.");
|
|
130
|
+
if (f.accounts !== void 0) body["account_ids"] = listFlag("accounts", f.accounts);
|
|
131
|
+
if (f["all-accounts"]) body["account_ids"] = null;
|
|
132
|
+
if (f["unknown-people"] !== void 0) {
|
|
133
|
+
if (!["skip", "visit_profile"].includes(f["unknown-people"])) usage("--unknown-people takes skip or visit_profile.");
|
|
134
|
+
body["unknown_people"] = f["unknown-people"];
|
|
135
|
+
}
|
|
136
|
+
const outcomes = [];
|
|
137
|
+
if (f["add-to-list"] !== void 0) outcomes.push({ type: "add_to_list", list_id: nonEmpty("--add-to-list", f["add-to-list"]) });
|
|
138
|
+
if (f.enroll !== void 0) outcomes.push({ type: "enroll", campaign_id: nonEmpty("--enroll", f.enroll) });
|
|
139
|
+
if (f["send-event"]) outcomes.push({ type: "send_event" });
|
|
140
|
+
if (outcomes.length) body["outcomes"] = outcomes;
|
|
141
|
+
if (f["act-on-last-7-days"]) {
|
|
142
|
+
if (!create) usage("--act-on-last-7-days goes with `signal rules create` only.");
|
|
143
|
+
body["act_on_last_7_days"] = true;
|
|
144
|
+
}
|
|
145
|
+
if (create) {
|
|
146
|
+
if (body["name"] === void 0) usage("--name is required: the rule's name, 1 to 100 characters.");
|
|
147
|
+
if (body["kinds"] === void 0) usage("--kind is required: the Signal kinds the rule acts on, repeatable or a comma list.");
|
|
148
|
+
if (!outcomes.length) usage("pass --add-to-list <cl_...>, --enroll <mot_...>, --send-event, or several: what the rule does.");
|
|
149
|
+
} else if (!Object.keys(body).length) usage("pass what changes: --name, --kind, --accounts, --all-accounts, --add-to-list, --enroll, --send-event, --unknown-people, --on or --off.");
|
|
150
|
+
return body;
|
|
151
|
+
}
|
|
152
|
+
async function runActions(c, f) {
|
|
153
|
+
const q = {};
|
|
154
|
+
if (f["lead-id"] !== void 0) q["lead_id"] = f["lead-id"];
|
|
155
|
+
if (f["rule-id"] !== void 0) q["rule_id"] = f["rule-id"];
|
|
156
|
+
if (f.outcome !== void 0) {
|
|
157
|
+
if (!OUTCOMES.includes(f.outcome)) usage(`--outcome takes one of ${OUTCOMES.join(", ")}.`);
|
|
158
|
+
q["outcome"] = f.outcome;
|
|
159
|
+
}
|
|
160
|
+
try {
|
|
161
|
+
await paged(f, q, (p) => c.signals.actions(p), (items) => print(table(["SIGNAL", "RULE", "LEAD", "OUTCOME", "AT"], items.map((i) => [i["signal_id"], i["rule_id"], i["lead_id"], i["reason"] ? `${String(i["outcome"])} (${String(i["reason"])})` : i["outcome"], i["created_at"]]))));
|
|
162
|
+
} catch (err) {
|
|
163
|
+
await fail(err, f);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
var ID = { type: "positional", description: "Signal id (sig_...)." };
|
|
167
|
+
var RULE_ID = { type: "positional", description: "Rule id (sgr_...)." };
|
|
168
|
+
var listCmd = defineCommand({
|
|
169
|
+
meta: {
|
|
170
|
+
name: "list",
|
|
171
|
+
description: "The Signals of the Accounts you may operate, newest first, at most 7 days old and only for Accounts whose Signal watch is on. Filter by --kind, --account-id, --match (lead, connection, followed, unknown, anonymous), --listed and --since. No LinkedIn call.",
|
|
172
|
+
risk: "read",
|
|
173
|
+
output: ["A table of Signal, kind, Account, person and when it happened; --json (or piped) prints the API page."],
|
|
174
|
+
seeAlso: ["curviate signal watch list", "curviate signal rules list"],
|
|
175
|
+
examples: ["curviate signal list", "curviate signal list --kind profile_viewed --match lead", "curviate signal list --since 2026-11-17T00:00:00Z --all"]
|
|
176
|
+
},
|
|
177
|
+
args: {
|
|
178
|
+
...readOnly(GLOBAL_FLAGS),
|
|
179
|
+
limit: { ...GLOBAL_FLAGS.limit, description: "Signals per page (1 to 100)." },
|
|
180
|
+
kind: { type: "string", description: "Only this kind: post_engaged, post_reposted, network_posted, profile_viewed, followed_you, mentioned_you, connection_added, post_engaged.reaction or post_engaged.comment." },
|
|
181
|
+
"account-id": { type: "string", description: "Only the Signals this Account caught (acc_...)." },
|
|
182
|
+
match: { type: "string", description: "Only Signals whose person is a lead, connection, followed, unknown or anonymous." },
|
|
183
|
+
listed: { type: "boolean", description: "--listed: only people on your Do-not-contact list; --no-listed: only people who are not." },
|
|
184
|
+
since: { type: "string", description: "Only Signals Curviate wrote after this time (ISO 8601)." }
|
|
185
|
+
},
|
|
186
|
+
run: online(runList)
|
|
187
|
+
});
|
|
188
|
+
var getCmd = defineCommand({
|
|
189
|
+
meta: { name: "get", description: "One Signal, while it is at most 7 days old; an older or unknown one is RESOURCE_NOT_FOUND.", risk: "read", examples: ["curviate signal get sig_YOUR_SIGNAL_ID"] },
|
|
190
|
+
args: { ...readOnly(READ_SINGLE_FLAGS), id: ID },
|
|
191
|
+
run: online((c, f) => one(f, () => c.signals.get(nonEmpty("the Signal id", f.id))))
|
|
192
|
+
});
|
|
193
|
+
var actionsCmd = defineCommand({
|
|
194
|
+
meta: {
|
|
195
|
+
name: "actions",
|
|
196
|
+
description: "What Signal rules did, newest first: added_to_list, already_in_list, event_sent, or skipped with its reason. Records stay while the Lead exists, after the Signal is gone. Filter by --lead-id, --rule-id and --outcome. Every role; only the Accounts you may operate. No LinkedIn call.",
|
|
197
|
+
risk: "read",
|
|
198
|
+
output: ["A table of Signal, rule, Lead, outcome and when; --json (or piped) prints the API page."],
|
|
199
|
+
seeAlso: ["curviate signal rules list", "curviate signal list"],
|
|
200
|
+
examples: ["curviate signal actions", "curviate signal actions --outcome skipped", "curviate signal actions --rule-id sgr_YOUR_RULE_ID --all"]
|
|
201
|
+
},
|
|
202
|
+
args: {
|
|
203
|
+
...readOnly(GLOBAL_FLAGS),
|
|
204
|
+
limit: { ...GLOBAL_FLAGS.limit, description: "Records per page (1 to 100)." },
|
|
205
|
+
"lead-id": { type: "string", description: "Only what rules did for this Lead (con_...)." },
|
|
206
|
+
"rule-id": { type: "string", description: "Only what this rule did (sgr_...)." },
|
|
207
|
+
outcome: { type: "string", description: "Only this outcome: added_to_list, already_in_list, event_sent or skipped." }
|
|
208
|
+
},
|
|
209
|
+
run: online(runActions)
|
|
210
|
+
});
|
|
211
|
+
var kindsCmd = defineCommand({
|
|
212
|
+
meta: { name: "kinds", description: "Every Signal kind with its sub-kinds, the follow-up read a card of that kind can trigger (engagers, viewers or none), whether it is on for your Team, and the limit rows it uses.", risk: "read", examples: ["curviate signal kinds"] },
|
|
213
|
+
args: readOnly(READ_SINGLE_FLAGS),
|
|
214
|
+
run: online((c, f) => one(f, () => c.signals.kinds()))
|
|
215
|
+
});
|
|
216
|
+
var watchSetCmd = defineCommand({
|
|
217
|
+
meta: {
|
|
218
|
+
name: "set",
|
|
219
|
+
description: "Switch one Account's Signal watch on or off. Off is the default, and this is the only way an Account becomes watched: once a day, inside its Active hours, Curviate reads its notifications and turns them into Signals. Off stops it from the next plan on; the Signals already stored stay until they are 7 days old. An Account that needs reconnecting can be switched on and reads paused until it is reconnected. Owners and Managers. The switch itself makes no LinkedIn call.",
|
|
220
|
+
risk: "write",
|
|
221
|
+
rules: {
|
|
222
|
+
changes: "Whether this Account's daily visit reads its notifications into Signals, from its next plan on.",
|
|
223
|
+
visible_to: "Your Team. On LinkedIn, the watch reads what the Account's own notifications show, like a person opening them.",
|
|
224
|
+
budget_rows: [],
|
|
225
|
+
retry: "Safe to repeat: the same state again.",
|
|
226
|
+
undo: "Run it again with the other value."
|
|
227
|
+
},
|
|
228
|
+
errors: { INSUFFICIENT_ROLE: "only an Owner or a Manager switches the Signal watch.", ACCOUNT_NOT_FOUND: "the Account is not one you may operate, or not this Team's." },
|
|
229
|
+
seeAlso: ["curviate signal watch list", "curviate signal list"],
|
|
230
|
+
examples: ["curviate signal watch set acc_YOUR_ACCOUNT_ID on", "curviate signal watch set acc_YOUR_ACCOUNT_ID off"]
|
|
231
|
+
},
|
|
232
|
+
args: {
|
|
233
|
+
...WRITE_SINGLE_FLAGS,
|
|
234
|
+
account: { type: "positional", description: "The Account (acc_...)." },
|
|
235
|
+
state: { type: "positional", description: "on or off." }
|
|
236
|
+
},
|
|
237
|
+
run: async ({ args }) => {
|
|
238
|
+
const f = args;
|
|
239
|
+
const account = nonEmpty("the Account id", f.account);
|
|
240
|
+
const on = onOff("state", f.state);
|
|
241
|
+
if (on === void 0) usage("say on or off: `curviate signal watch set <account_id> on`.");
|
|
242
|
+
const body = { signal_watch: on };
|
|
243
|
+
if (f.preview) return void preview("signals.setWatch", { account_id: account }, body);
|
|
244
|
+
await one(f, async () => (await rootClient(f)).signals.setWatch(account, body));
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
var watchListCmd = defineCommand({
|
|
248
|
+
meta: {
|
|
249
|
+
name: "list",
|
|
250
|
+
description: "For each Account you may operate: whether its Signal watch is on, its state (watching, paused with a reason, or off, the default), its last visit and today's visits and reads. No LinkedIn call.",
|
|
251
|
+
risk: "read",
|
|
252
|
+
seeAlso: ["curviate signal watch set"],
|
|
253
|
+
examples: ["curviate signal watch list"]
|
|
254
|
+
},
|
|
255
|
+
args: readOnly(READ_SINGLE_FLAGS),
|
|
256
|
+
run: online(runWatch)
|
|
257
|
+
});
|
|
258
|
+
var watchCmd = defineCommand({
|
|
259
|
+
meta: {
|
|
260
|
+
name: "watch",
|
|
261
|
+
description: "Each Account's Signal watch: `list` reads every Account's state (bare `signal watch` does too), `set <account_id> on|off` switches one."
|
|
262
|
+
},
|
|
263
|
+
args: readOnly(READ_SINGLE_FLAGS),
|
|
264
|
+
subCommands: { list: watchListCmd, set: watchSetCmd },
|
|
265
|
+
run: online(runWatch)
|
|
266
|
+
// bare `signal watch` keeps listing, as before the switch existed
|
|
267
|
+
});
|
|
268
|
+
var settingsCmd = defineCommand({
|
|
269
|
+
meta: {
|
|
270
|
+
name: "settings",
|
|
271
|
+
description: "Turn the Team's follow-up reads on or off: --post-engaged (read a post's reactions or comments when a card shows someone engaged; off: the Signal names the card's first person only) and --profile-viewed (read the viewer list when a card shows views; off: no Signal for a viewer the card does not name). Both on by default. Owners and Managers.",
|
|
272
|
+
risk: "write",
|
|
273
|
+
rules: {
|
|
274
|
+
changes: "The Team's follow-up reads, for every Account's next visits.",
|
|
275
|
+
visible_to: "Your Team.",
|
|
276
|
+
budget_rows: [],
|
|
277
|
+
retry: "Safe to repeat: the same settings again.",
|
|
278
|
+
undo: "Run it again with the other value."
|
|
279
|
+
},
|
|
280
|
+
errors: { INSUFFICIENT_ROLE: "only an Owner or a Manager changes the Signal settings." },
|
|
281
|
+
examples: ["curviate signal settings --profile-viewed off"]
|
|
282
|
+
},
|
|
283
|
+
args: {
|
|
284
|
+
...WRITE_SINGLE_FLAGS,
|
|
285
|
+
"post-engaged": { type: "string", description: "on or off." },
|
|
286
|
+
"profile-viewed": { type: "string", description: "on or off." }
|
|
287
|
+
},
|
|
288
|
+
run: async ({ args }) => {
|
|
289
|
+
const f = args;
|
|
290
|
+
const body = settingsBody(f);
|
|
291
|
+
if (f.preview) return void preview("signals.updateSettings", {}, body);
|
|
292
|
+
await one(f, async () => (await rootClient(f)).signals.updateSettings(body));
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
var RULE_FLAGS = {
|
|
296
|
+
name: { type: "string", description: "The rule's name, 1 to 100 characters." },
|
|
297
|
+
kind: { type: "string", description: "The Signal kinds it acts on, repeatable or a comma list (see `curviate signal kinds`)." },
|
|
298
|
+
accounts: { type: "string", description: "Only these Accounts (acc_...), a comma list. Default on create: every Account of the Team, now and later." },
|
|
299
|
+
"all-accounts": { type: "boolean", description: "Every Account of the Team, now and later." },
|
|
300
|
+
"add-to-list": { type: "string", description: "Outcome: add the person to this Lead list (cl_...)." },
|
|
301
|
+
enroll: { type: "string", description: "Outcome: enroll the person in this Campaign (mot_...) through the Account that caught the Signal." },
|
|
302
|
+
"send-event": { type: "boolean", description: "Outcome: send signal.matched to your webhooks." },
|
|
303
|
+
"unknown-people": { type: "string", description: "skip (default): a person Curviate knows nothing about is skipped. visit_profile: read their profile once; the person may see the visit." },
|
|
304
|
+
on: { type: "boolean", description: "Turn the rule on." },
|
|
305
|
+
off: { type: "boolean", description: "Turn the rule off: it acts on no Signal." }
|
|
306
|
+
};
|
|
307
|
+
var RULE_ERRORS = {
|
|
308
|
+
INSUFFICIENT_ROLE: "your role does not allow adding Leads to a Lead list, which the rule does.",
|
|
309
|
+
ACCOUNT_NOT_SHARED: "--accounts names an Account you may not operate."
|
|
310
|
+
};
|
|
311
|
+
var switchCmd = (name) => defineCommand({
|
|
312
|
+
meta: {
|
|
313
|
+
name,
|
|
314
|
+
description: name === "enable" ? "Turn a rule on: it acts on every matching Signal from now on." : "Turn a rule off: it acts on no Signal until it is enabled again. What it did stays.",
|
|
315
|
+
risk: "write",
|
|
316
|
+
rules: {
|
|
317
|
+
changes: name === "enable" ? "The rule acts again, from the next Signal on." : "The rule stops acting, from the next Signal on.",
|
|
318
|
+
visible_to: "Your Team.",
|
|
319
|
+
budget_rows: [],
|
|
320
|
+
retry: "Safe to repeat: the same state again.",
|
|
321
|
+
undo: `\`curviate signal rules ${name === "enable" ? "disable" : "enable"} <rule_id>\`.`
|
|
322
|
+
},
|
|
323
|
+
errors: RULE_ERRORS,
|
|
324
|
+
examples: [`curviate signal rules ${name} sgr_YOUR_RULE_ID`]
|
|
325
|
+
},
|
|
326
|
+
args: { ...WRITE_SINGLE_FLAGS, id: RULE_ID },
|
|
327
|
+
run: async ({ args }) => {
|
|
328
|
+
const f = args;
|
|
329
|
+
const id = nonEmpty("the rule id", f.id);
|
|
330
|
+
const body = { enabled: name === "enable" };
|
|
331
|
+
if (f.preview) return void preview("signals.rules.update", { id }, body);
|
|
332
|
+
await one(f, async () => (await rootClient(f)).signals.rules.update(id, body));
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
var rulesCmd = defineCommand({
|
|
336
|
+
meta: { name: "rules", description: "Signal rules: what happens to a person when a Signal of a kind arrives on an Account (add them to a Lead list, enroll them in a Campaign, send signal.matched to your webhooks)." },
|
|
337
|
+
subCommands: {
|
|
338
|
+
list: defineCommand({
|
|
339
|
+
meta: { name: "list", description: "This Team's rules, newest first, each with its one-sentence summary. Every role may read them.", risk: "read", examples: ["curviate signal rules list", "curviate signal rules list --no-enabled"] },
|
|
340
|
+
args: { ...readOnly(GLOBAL_FLAGS), enabled: { type: "boolean", description: "--enabled: only rules that are on; --no-enabled: only rules that are off." } },
|
|
341
|
+
run: online(async (c, f) => {
|
|
342
|
+
const q = {};
|
|
343
|
+
if (f.enabled !== void 0) q["enabled"] = f.enabled;
|
|
344
|
+
try {
|
|
345
|
+
await paged(f, q, (p) => c.signals.rules.list(p), (items) => print(table(["RULE", "ON", "NAME", "SUMMARY"], items.map((r) => [r["id"], r["enabled"] ? "on" : "off", r["name"], r["summary"]]))));
|
|
346
|
+
} catch (err) {
|
|
347
|
+
await fail(err, f);
|
|
348
|
+
}
|
|
349
|
+
})
|
|
350
|
+
}),
|
|
351
|
+
get: defineCommand({
|
|
352
|
+
meta: { name: "get", description: "One rule of this Team.", risk: "read", examples: ["curviate signal rules get sgr_YOUR_RULE_ID"] },
|
|
353
|
+
args: { ...readOnly(READ_SINGLE_FLAGS), id: RULE_ID },
|
|
354
|
+
run: online((c, f) => one(f, () => c.signals.rules.get(nonEmpty("the rule id", f.id))))
|
|
355
|
+
}),
|
|
356
|
+
create: defineCommand({
|
|
357
|
+
meta: {
|
|
358
|
+
name: "create",
|
|
359
|
+
description: "Create a rule: for --kind on --accounts (default every Account), add the person to a Lead list (--add-to-list), enroll them in a Campaign through the Account that caught the Signal (--enroll) and/or send signal.matched to your webhooks (--send-event). --unknown-people visit_profile reads the profile of a person Curviate does not know, once; the person may see the visit. --act-on-last-7-days also acts, once, on the Team's Signals of the last 7 days. The answer's summary is the rule as one sentence.",
|
|
360
|
+
risk: "write",
|
|
361
|
+
rules: {
|
|
362
|
+
changes: "A rule that acts on every matching Signal from now on: Leads join the list or the Campaign, events are sent.",
|
|
363
|
+
visible_to: "Your Team; with --unknown-people visit_profile, the people whose profiles are read.",
|
|
364
|
+
budget_rows: [],
|
|
365
|
+
retry: "A second call creates a second rule: list them first.",
|
|
366
|
+
undo: "`curviate signal rules delete <rule_id>`; Leads it added stay."
|
|
367
|
+
},
|
|
368
|
+
errors: RULE_ERRORS,
|
|
369
|
+
examples: ['curviate signal rules create --name "Viewers to list" --kind profile_viewed --add-to-list cl_YOUR_LIST_ID', 'curviate signal rules create --name "Engagers" --kind post_engaged --send-event --accounts acc_YOUR_ACCOUNT_ID']
|
|
370
|
+
},
|
|
371
|
+
args: { ...WRITE_SINGLE_FLAGS, ...RULE_FLAGS, "act-on-last-7-days": { type: "boolean", description: "Also act, once, on the Team's Signals of the last 7 days." } },
|
|
372
|
+
run: async ({ args }) => {
|
|
373
|
+
const f = args;
|
|
374
|
+
const body = ruleBody(f, true);
|
|
375
|
+
if (f.preview) return void preview("signals.rules.create", {}, body);
|
|
376
|
+
await one(f, async () => (await rootClient(f)).signals.rules.create(body));
|
|
377
|
+
}
|
|
378
|
+
}),
|
|
379
|
+
update: defineCommand({
|
|
380
|
+
meta: {
|
|
381
|
+
name: "update",
|
|
382
|
+
description: "Change a rule; only what you pass changes (an outcome flag replaces the outcomes). --off switches it off, --on on again.",
|
|
383
|
+
risk: "write",
|
|
384
|
+
rules: {
|
|
385
|
+
changes: "The rule, for every Signal from now on.",
|
|
386
|
+
visible_to: "Your Team.",
|
|
387
|
+
budget_rows: [],
|
|
388
|
+
retry: "Safe to repeat: the same values again.",
|
|
389
|
+
undo: "Run it again with the previous values (`curviate signal rules get` prints them)."
|
|
390
|
+
},
|
|
391
|
+
errors: RULE_ERRORS,
|
|
392
|
+
examples: ["curviate signal rules update sgr_YOUR_RULE_ID --off", "curviate signal rules update sgr_YOUR_RULE_ID --kind profile_viewed,followed_you"]
|
|
393
|
+
},
|
|
394
|
+
args: { ...WRITE_SINGLE_FLAGS, id: RULE_ID, ...RULE_FLAGS },
|
|
395
|
+
run: async ({ args }) => {
|
|
396
|
+
const f = args;
|
|
397
|
+
const id = nonEmpty("the rule id", f.id);
|
|
398
|
+
const body = ruleBody(f, false);
|
|
399
|
+
if (f.preview) return void preview("signals.rules.update", { id }, body);
|
|
400
|
+
await one(f, async () => (await rootClient(f)).signals.rules.update(id, body));
|
|
401
|
+
}
|
|
402
|
+
}),
|
|
403
|
+
enable: switchCmd("enable"),
|
|
404
|
+
disable: switchCmd("disable"),
|
|
405
|
+
delete: defineCommand({
|
|
406
|
+
meta: {
|
|
407
|
+
name: "delete",
|
|
408
|
+
description: "Delete a rule. What it did stays: the Leads, their list memberships and the records of its actions.",
|
|
409
|
+
risk: "write",
|
|
410
|
+
rules: { changes: "The rule is gone; it acts on no further Signal.", visible_to: "Your Team.", budget_rows: [], retry: "A second call answers RESOURCE_NOT_FOUND.", undo: "Create it again with `curviate signal rules create`." },
|
|
411
|
+
examples: ["curviate signal rules delete sgr_YOUR_RULE_ID"]
|
|
412
|
+
},
|
|
413
|
+
args: { ...WRITE_SINGLE_FLAGS, id: RULE_ID },
|
|
414
|
+
run: async ({ args }) => {
|
|
415
|
+
const f = args;
|
|
416
|
+
const id = nonEmpty("the rule id", f.id);
|
|
417
|
+
if (f.preview) return void preview("signals.rules.delete", { id }, {});
|
|
418
|
+
try {
|
|
419
|
+
await (await rootClient(f)).signals.rules.delete(id);
|
|
420
|
+
renderSuccess({ deleted: true, id }, outputOpts(f), process);
|
|
421
|
+
} catch (err) {
|
|
422
|
+
await fail(err, f);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
})
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
var signalCommand = defineCommand({
|
|
429
|
+
meta: { name: "signal", description: DESCRIPTIONS.signal },
|
|
430
|
+
subCommands: { list: listCmd, get: getCmd, actions: actionsCmd, kinds: kindsCmd, watch: watchCmd, settings: settingsCmd, rules: rulesCmd },
|
|
431
|
+
async run() {
|
|
432
|
+
const { showHelp } = await import("./examples-5FJS47QF.js");
|
|
433
|
+
await showHelp(signalCommand, ["curviate", "signal"]);
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
export {
|
|
437
|
+
signalCommand
|
|
438
|
+
};
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
outputOpts,
|
|
6
6
|
rootClient,
|
|
7
7
|
usage
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5OAJ4D65.js";
|
|
9
9
|
import {
|
|
10
10
|
buildPreviewOutput
|
|
11
11
|
} from "./chunk-TCUYH5GO.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
readablePage,
|
|
21
21
|
rejectPaginationModifiersWithoutAll,
|
|
22
22
|
streamAll
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-KUVJM5CP.js";
|
|
24
24
|
import {
|
|
25
25
|
renderSuccess,
|
|
26
26
|
writeNdjsonItem
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
readConfig,
|
|
31
31
|
resolveEffectiveConfig,
|
|
32
32
|
writeProfile
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-PBJZQZPO.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-XDPU2YAF.js";
|
|
43
43
|
import "./chunk-ZYURL5VK.js";
|
|
44
44
|
|
|
45
45
|
// src/commands/team.ts
|
|
@@ -421,6 +421,59 @@ var seatsCmd = defineCommand({
|
|
|
421
421
|
})
|
|
422
422
|
}
|
|
423
423
|
});
|
|
424
|
+
var LABELS = ["interested", "not_now", "not_interested", "opt_out", "out_of_office", "referral", "other"];
|
|
425
|
+
function replyLabelsBody(f) {
|
|
426
|
+
if (f.on && f.off) usage("pass --on or --off, not both.");
|
|
427
|
+
const body = {};
|
|
428
|
+
if (f.on || f.off) body["enabled"] = Boolean(f.on);
|
|
429
|
+
if (f["not-interested-dnc"] !== void 0) body["not_interested_adds_to_do_not_contact"] = f["not-interested-dnc"];
|
|
430
|
+
if (f.tag !== void 0) {
|
|
431
|
+
const tags = {};
|
|
432
|
+
for (const pair of listFlag("tag", f.tag)) {
|
|
433
|
+
const eq = pair.indexOf("=");
|
|
434
|
+
const label = eq < 0 ? pair : pair.slice(0, eq);
|
|
435
|
+
if (eq < 0 || !LABELS.includes(label)) usage(`--tag takes <label>=<tag_id> (an empty tag id removes it); label is one of ${LABELS.join(", ")}.`);
|
|
436
|
+
const tagId = pair.slice(eq + 1).trim();
|
|
437
|
+
tags[label] = tagId === "" ? null : tagId;
|
|
438
|
+
}
|
|
439
|
+
body["tags"] = tags;
|
|
440
|
+
}
|
|
441
|
+
return Object.keys(body).length ? body : null;
|
|
442
|
+
}
|
|
443
|
+
var replyLabelsCmd = defineCommand({
|
|
444
|
+
meta: {
|
|
445
|
+
name: "reply-labels",
|
|
446
|
+
description: "The Team's Reply label settings: whether Curviate labels each reply to your Campaigns, whether not_interested puts the person on the Do-not-contact list, and the Tag added per label. Without a flag it reads them (every role); with one it changes only what you pass (Owners and Managers). Turning labels on changes only what the next Campaign reply gets.",
|
|
447
|
+
risk: "write",
|
|
448
|
+
rules: {
|
|
449
|
+
changes: "With a flag: the Team's Reply label settings.",
|
|
450
|
+
visible_to: "Your Team.",
|
|
451
|
+
budget_rows: [],
|
|
452
|
+
retry: "Safe to repeat: the same settings again.",
|
|
453
|
+
undo: "Run it again with the previous values (`curviate team reply-labels` prints them)."
|
|
454
|
+
},
|
|
455
|
+
errors: { INSUFFICIENT_ROLE: "only an Owner or a Manager changes the Reply label settings.", RESOURCE_NOT_FOUND: "a --tag names no Tag of this Team." },
|
|
456
|
+
seeAlso: ["curviate unibox label", "curviate unibox list"],
|
|
457
|
+
examples: ["curviate team reply-labels", "curviate team reply-labels --on --not-interested-dnc", "curviate team reply-labels --tag interested=tag_YOUR_TAG_ID --tag other="]
|
|
458
|
+
},
|
|
459
|
+
args: {
|
|
460
|
+
...WRITE_SINGLE_FLAGS,
|
|
461
|
+
on: { type: "boolean", description: "Turn Reply labels on." },
|
|
462
|
+
off: { type: "boolean", description: "Turn Reply labels off." },
|
|
463
|
+
"not-interested-dnc": { type: "boolean", description: "--not-interested-dnc: a reply labelled not_interested puts the person on the Do-not-contact list; --no-not-interested-dnc turns that off." },
|
|
464
|
+
tag: { type: "string", description: "<label>=<tag_id>: the Tag added when a reply gets that label; repeatable or a comma list. <label>= with no id removes it." }
|
|
465
|
+
},
|
|
466
|
+
run: async ({ args: raw }) => {
|
|
467
|
+
const f = raw;
|
|
468
|
+
const body = replyLabelsBody(f);
|
|
469
|
+
return call(
|
|
470
|
+
"teams.updateReplyLabels",
|
|
471
|
+
() => ({}),
|
|
472
|
+
() => body ?? {},
|
|
473
|
+
(c) => body === null ? c.teams.getReplyLabels() : c.teams.updateReplyLabels(body)
|
|
474
|
+
)({ args: { ...f, preview: body === null ? false : f.preview } });
|
|
475
|
+
}
|
|
476
|
+
});
|
|
424
477
|
function lendBody(f) {
|
|
425
478
|
return { team_id: nonEmpty("--to", f.to), ...f.seat !== void 0 ? { seat_id: nonEmpty("--seat", f.seat) } : {} };
|
|
426
479
|
}
|
|
@@ -432,6 +485,7 @@ var teamCommand = defineCommand({
|
|
|
432
485
|
switch: switchCmd,
|
|
433
486
|
create: createCmd,
|
|
434
487
|
update: updateCmd,
|
|
488
|
+
"reply-labels": replyLabelsCmd,
|
|
435
489
|
members: membersCmd,
|
|
436
490
|
role: roleCmd,
|
|
437
491
|
remove: removeCmd,
|
|
@@ -441,7 +495,7 @@ var teamCommand = defineCommand({
|
|
|
441
495
|
seats: seatsCmd
|
|
442
496
|
},
|
|
443
497
|
async run() {
|
|
444
|
-
const { showHelp } = await import("./examples-
|
|
498
|
+
const { showHelp } = await import("./examples-5FJS47QF.js");
|
|
445
499
|
await showHelp(teamCommand, ["curviate", "team"]);
|
|
446
500
|
}
|
|
447
501
|
});
|
|
@@ -3,21 +3,21 @@ import {
|
|
|
3
3
|
fail,
|
|
4
4
|
outputOpts,
|
|
5
5
|
rootClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5OAJ4D65.js";
|
|
7
7
|
import {
|
|
8
8
|
readableObject
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KUVJM5CP.js";
|
|
10
10
|
import {
|
|
11
11
|
renderSuccess
|
|
12
12
|
} from "./chunk-QM57YDJE.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-PBJZQZPO.js";
|
|
14
14
|
import {
|
|
15
15
|
READ_SINGLE_FLAGS,
|
|
16
16
|
readOnly
|
|
17
17
|
} from "./chunk-QLKGOIWS.js";
|
|
18
18
|
import {
|
|
19
19
|
DESCRIPTIONS
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-XDPU2YAF.js";
|
|
21
21
|
import "./chunk-ZYURL5VK.js";
|
|
22
22
|
|
|
23
23
|
// src/commands/tier.ts
|
|
@@ -29,7 +29,8 @@ function humanTier(t) {
|
|
|
29
29
|
`bought ${t.bought_tier ?? "none"}${t.period ? ` (${t.period})` : ""}`,
|
|
30
30
|
`trial ${at(t.trial)}`,
|
|
31
31
|
`override ${at(t.override)}`,
|
|
32
|
-
`features ${t.features.length ? t.features.join(", ") : "none"}
|
|
32
|
+
`features ${t.features.length ? t.features.join(", ") : "none"}`,
|
|
33
|
+
`email ${t.tier ? "included; it sends once a Mailbox is connected (`curviate mailbox list`, `curviate doctor`)" : "needs the plan"}`
|
|
33
34
|
].join("\n") + "\n";
|
|
34
35
|
}
|
|
35
36
|
var tierCommand = defineCommand({
|