@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
|
@@ -0,0 +1,331 @@
|
|
|
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-3ZQNOKEK.js";
|
|
13
|
+
import {
|
|
14
|
+
intFlag
|
|
15
|
+
} from "./chunk-NNV2OYEF.js";
|
|
16
|
+
import {
|
|
17
|
+
buildPreviewOutput
|
|
18
|
+
} from "./chunk-TCUYH5GO.js";
|
|
19
|
+
import {
|
|
20
|
+
pageDelayFromFlags,
|
|
21
|
+
readCursorFlag,
|
|
22
|
+
readMaxPagesFlag,
|
|
23
|
+
readableObject,
|
|
24
|
+
readablePage,
|
|
25
|
+
rejectPaginationModifiersWithoutAll,
|
|
26
|
+
streamAll
|
|
27
|
+
} from "./chunk-OE4CY3ZL.js";
|
|
28
|
+
import {
|
|
29
|
+
renderSuccess,
|
|
30
|
+
writeNdjsonItem
|
|
31
|
+
} from "./chunk-QM57YDJE.js";
|
|
32
|
+
import "./chunk-RXDG57B2.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-5LGKZBAY.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 online = (fn) => async ({ args }) => {
|
|
49
|
+
const f = args;
|
|
50
|
+
await fn(await rootClient(f), f);
|
|
51
|
+
};
|
|
52
|
+
var preview = (method, args, body) => process.stdout.write(JSON.stringify(buildPreviewOutput({ method, args, body })) + "\n");
|
|
53
|
+
var nonEmpty = (what, v) => v !== void 0 && v.trim() !== "" ? v : usage(`${what} is required.`);
|
|
54
|
+
async function paged(f, params, fetch, human) {
|
|
55
|
+
rejectPaginationModifiersWithoutAll(f, process);
|
|
56
|
+
if (f.limit !== void 0) params["limit"] = intFlag("limit", f.limit, 1, 100);
|
|
57
|
+
const cursor = readCursorFlag(f, process);
|
|
58
|
+
if (cursor) params["cursor"] = cursor;
|
|
59
|
+
if (f.all) {
|
|
60
|
+
for await (const item of streamAll((p) => fetch(p), params, { maxPages: readMaxPagesFlag(f, process), out: process, pageDelayMs: pageDelayFromFlags(f) })) writeNdjsonItem(process, item, f.fields);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const page = readablePage(await fetch(params));
|
|
64
|
+
if (outputOpts(f).json) return renderSuccess(page, outputOpts(f), process);
|
|
65
|
+
human(page.items);
|
|
66
|
+
if (page["cursor"]) print(`next page: --cursor ${String(page["cursor"])}`);
|
|
67
|
+
}
|
|
68
|
+
async function runList(c, f) {
|
|
69
|
+
const q = {};
|
|
70
|
+
if (f.kind !== void 0) {
|
|
71
|
+
const kind = String(f.kind);
|
|
72
|
+
if (!KINDS.includes(kind)) usage(`--kind takes one of ${KINDS.join(", ")}.`);
|
|
73
|
+
q["kind"] = kind;
|
|
74
|
+
}
|
|
75
|
+
if (f["account-id"] !== void 0) q["account_id"] = f["account-id"];
|
|
76
|
+
if (f.match !== void 0) {
|
|
77
|
+
if (!MATCHES.includes(f.match)) usage(`--match takes one of ${MATCHES.join(", ")}.`);
|
|
78
|
+
q["match"] = f.match;
|
|
79
|
+
}
|
|
80
|
+
if (f.listed !== void 0) q["listed"] = f.listed;
|
|
81
|
+
if (f.since !== void 0) q["since"] = f.since;
|
|
82
|
+
try {
|
|
83
|
+
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"]]))));
|
|
84
|
+
} catch (err) {
|
|
85
|
+
await fail(err, f);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async function one(f, run) {
|
|
89
|
+
try {
|
|
90
|
+
renderSuccess(readableObject(await run()), outputOpts(f), process);
|
|
91
|
+
} catch (err) {
|
|
92
|
+
await fail(err, f);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async function runWatch(c, f) {
|
|
96
|
+
try {
|
|
97
|
+
const res = await c.signals.watch();
|
|
98
|
+
if (outputOpts(f).json) return renderSuccess(res, outputOpts(f), process);
|
|
99
|
+
print(table(
|
|
100
|
+
["ACCOUNT", "WATCH", "STATE", "PAUSED UNTIL", "LAST VISIT", "VISITS TODAY", "READS TODAY"],
|
|
101
|
+
(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"]])
|
|
102
|
+
));
|
|
103
|
+
} catch (err) {
|
|
104
|
+
await fail(err, f);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
var onOff = (flag, v) => v === void 0 ? void 0 : v === "on" ? true : v === "off" ? false : usage(`--${flag} takes on or off.`);
|
|
108
|
+
function settingsBody(f) {
|
|
109
|
+
const follow_up = {};
|
|
110
|
+
const pe = onOff("post-engaged", f["post-engaged"]);
|
|
111
|
+
const pv = onOff("profile-viewed", f["profile-viewed"]);
|
|
112
|
+
if (pe !== void 0) follow_up["post_engaged"] = pe;
|
|
113
|
+
if (pv !== void 0) follow_up["profile_viewed"] = pv;
|
|
114
|
+
if (!Object.keys(follow_up).length) usage("pass --post-engaged on|off, --profile-viewed on|off, or both.");
|
|
115
|
+
return { follow_up };
|
|
116
|
+
}
|
|
117
|
+
function ruleBody(f, create) {
|
|
118
|
+
const body = {};
|
|
119
|
+
if (f.name !== void 0) body["name"] = f.name;
|
|
120
|
+
if (f.on && f.off) usage("pass --on or --off, not both.");
|
|
121
|
+
if (f.on || f.off) body["enabled"] = Boolean(f.on);
|
|
122
|
+
if (f.kind !== void 0) {
|
|
123
|
+
const kinds = listFlag("kind", f.kind);
|
|
124
|
+
const bad = kinds.find((k) => !KINDS.includes(k));
|
|
125
|
+
if (bad !== void 0) usage(`--kind ${bad} is not a Signal kind: one of ${KINDS.join(", ")}.`);
|
|
126
|
+
body["kinds"] = kinds;
|
|
127
|
+
}
|
|
128
|
+
if (f.accounts !== void 0 && f["all-accounts"]) usage("--accounts and --all-accounts cannot be combined.");
|
|
129
|
+
if (f.accounts !== void 0) body["account_ids"] = listFlag("accounts", f.accounts);
|
|
130
|
+
if (f["all-accounts"]) body["account_ids"] = null;
|
|
131
|
+
if (f["unknown-people"] !== void 0) {
|
|
132
|
+
if (!["skip", "visit_profile"].includes(f["unknown-people"])) usage("--unknown-people takes skip or visit_profile.");
|
|
133
|
+
body["unknown_people"] = f["unknown-people"];
|
|
134
|
+
}
|
|
135
|
+
const outcomes = [];
|
|
136
|
+
if (f["add-to-list"] !== void 0) outcomes.push({ type: "add_to_list", list_id: nonEmpty("--add-to-list", f["add-to-list"]) });
|
|
137
|
+
if (f["send-event"]) outcomes.push({ type: "send_event" });
|
|
138
|
+
if (outcomes.length) body["outcomes"] = outcomes;
|
|
139
|
+
if (create) {
|
|
140
|
+
if (body["name"] === void 0) usage("--name is required: the rule's name, 1 to 100 characters.");
|
|
141
|
+
if (body["kinds"] === void 0) usage("--kind is required: the Signal kinds the rule acts on, repeatable or a comma list.");
|
|
142
|
+
if (!outcomes.length) usage("pass --add-to-list <cl_...>, --send-event, or both: what the rule does.");
|
|
143
|
+
} else if (!Object.keys(body).length) usage("pass what changes: --name, --kind, --accounts, --all-accounts, --add-to-list, --send-event, --unknown-people, --on or --off.");
|
|
144
|
+
return body;
|
|
145
|
+
}
|
|
146
|
+
var ID = { type: "positional", description: "Signal id (sig_...)." };
|
|
147
|
+
var RULE_ID = { type: "positional", description: "Rule id (sgr_...)." };
|
|
148
|
+
var listCmd = defineCommand({
|
|
149
|
+
meta: {
|
|
150
|
+
name: "list",
|
|
151
|
+
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.",
|
|
152
|
+
risk: "read",
|
|
153
|
+
output: ["A table of Signal, kind, Account, person and when it happened; --json (or piped) prints the API page."],
|
|
154
|
+
seeAlso: ["curviate signal watch", "curviate signal rules list"],
|
|
155
|
+
examples: ["curviate signal list", "curviate signal list --kind profile_viewed --match lead", "curviate signal list --since 2026-11-17T00:00:00Z --all"]
|
|
156
|
+
},
|
|
157
|
+
args: {
|
|
158
|
+
...readOnly(GLOBAL_FLAGS),
|
|
159
|
+
limit: { ...GLOBAL_FLAGS.limit, description: "Signals per page (1 to 100)." },
|
|
160
|
+
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." },
|
|
161
|
+
"account-id": { type: "string", description: "Only the Signals this Account caught (acc_...)." },
|
|
162
|
+
match: { type: "string", description: "Only Signals whose person is a lead, connection, followed, unknown or anonymous." },
|
|
163
|
+
listed: { type: "boolean", description: "--listed: only people on your Do-not-contact list; --no-listed: only people who are not." },
|
|
164
|
+
since: { type: "string", description: "Only Signals Curviate wrote after this time (ISO 8601)." }
|
|
165
|
+
},
|
|
166
|
+
run: online(runList)
|
|
167
|
+
});
|
|
168
|
+
var getCmd = defineCommand({
|
|
169
|
+
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"] },
|
|
170
|
+
args: { ...readOnly(READ_SINGLE_FLAGS), id: ID },
|
|
171
|
+
run: online((c, f) => one(f, () => c.signals.get(nonEmpty("the Signal id", f.id))))
|
|
172
|
+
});
|
|
173
|
+
var kindsCmd = defineCommand({
|
|
174
|
+
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"] },
|
|
175
|
+
args: readOnly(READ_SINGLE_FLAGS),
|
|
176
|
+
run: online((c, f) => one(f, () => c.signals.kinds()))
|
|
177
|
+
});
|
|
178
|
+
var watchCmd = defineCommand({
|
|
179
|
+
meta: {
|
|
180
|
+
name: "watch",
|
|
181
|
+
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.",
|
|
182
|
+
risk: "read",
|
|
183
|
+
examples: ["curviate signal watch"]
|
|
184
|
+
},
|
|
185
|
+
args: readOnly(READ_SINGLE_FLAGS),
|
|
186
|
+
run: online(runWatch)
|
|
187
|
+
});
|
|
188
|
+
var settingsCmd = defineCommand({
|
|
189
|
+
meta: {
|
|
190
|
+
name: "settings",
|
|
191
|
+
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.",
|
|
192
|
+
risk: "write",
|
|
193
|
+
rules: {
|
|
194
|
+
changes: "The Team's follow-up reads, for every Account's next visits.",
|
|
195
|
+
visible_to: "Your Team.",
|
|
196
|
+
budget_rows: [],
|
|
197
|
+
retry: "Safe to repeat: the same settings again.",
|
|
198
|
+
undo: "Run it again with the other value."
|
|
199
|
+
},
|
|
200
|
+
errors: { INSUFFICIENT_ROLE: "only an Owner or a Manager changes the Signal settings." },
|
|
201
|
+
examples: ["curviate signal settings --profile-viewed off"]
|
|
202
|
+
},
|
|
203
|
+
args: {
|
|
204
|
+
...WRITE_SINGLE_FLAGS,
|
|
205
|
+
"post-engaged": { type: "string", description: "on or off." },
|
|
206
|
+
"profile-viewed": { type: "string", description: "on or off." }
|
|
207
|
+
},
|
|
208
|
+
run: async ({ args }) => {
|
|
209
|
+
const f = args;
|
|
210
|
+
const body = settingsBody(f);
|
|
211
|
+
if (f.preview) return void preview("signals.updateSettings", {}, body);
|
|
212
|
+
await one(f, async () => (await rootClient(f)).signals.updateSettings(body));
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
var RULE_FLAGS = {
|
|
216
|
+
name: { type: "string", description: "The rule's name, 1 to 100 characters." },
|
|
217
|
+
kind: { type: "string", description: "The Signal kinds it acts on, repeatable or a comma list (see `curviate signal kinds`)." },
|
|
218
|
+
accounts: { type: "string", description: "Only these Accounts (acc_...), a comma list. Default on create: every Account of the Team, now and later." },
|
|
219
|
+
"all-accounts": { type: "boolean", description: "Every Account of the Team, now and later." },
|
|
220
|
+
"add-to-list": { type: "string", description: "Outcome: add the person to this Lead list (cl_...)." },
|
|
221
|
+
"send-event": { type: "boolean", description: "Outcome: send signal.matched to your webhooks." },
|
|
222
|
+
"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." },
|
|
223
|
+
on: { type: "boolean", description: "Turn the rule on." },
|
|
224
|
+
off: { type: "boolean", description: "Turn the rule off: it acts on no Signal." }
|
|
225
|
+
};
|
|
226
|
+
var RULE_ERRORS = {
|
|
227
|
+
INSUFFICIENT_ROLE: "your role does not allow adding Leads to a Lead list, which the rule does.",
|
|
228
|
+
ACCOUNT_NOT_SHARED: "--accounts names an Account you may not operate."
|
|
229
|
+
};
|
|
230
|
+
var rulesCmd = defineCommand({
|
|
231
|
+
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, send signal.matched to your webhooks)." },
|
|
232
|
+
subCommands: {
|
|
233
|
+
list: defineCommand({
|
|
234
|
+
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"] },
|
|
235
|
+
args: { ...readOnly(GLOBAL_FLAGS), enabled: { type: "boolean", description: "--enabled: only rules that are on; --no-enabled: only rules that are off." } },
|
|
236
|
+
run: online(async (c, f) => {
|
|
237
|
+
const q = {};
|
|
238
|
+
if (f.enabled !== void 0) q["enabled"] = f.enabled;
|
|
239
|
+
try {
|
|
240
|
+
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"]]))));
|
|
241
|
+
} catch (err) {
|
|
242
|
+
await fail(err, f);
|
|
243
|
+
}
|
|
244
|
+
})
|
|
245
|
+
}),
|
|
246
|
+
get: defineCommand({
|
|
247
|
+
meta: { name: "get", description: "One rule of this Team.", risk: "read", examples: ["curviate signal rules get sgr_YOUR_RULE_ID"] },
|
|
248
|
+
args: { ...readOnly(READ_SINGLE_FLAGS), id: RULE_ID },
|
|
249
|
+
run: online((c, f) => one(f, () => c.signals.rules.get(nonEmpty("the rule id", f.id))))
|
|
250
|
+
}),
|
|
251
|
+
create: defineCommand({
|
|
252
|
+
meta: {
|
|
253
|
+
name: "create",
|
|
254
|
+
description: "Create a rule: for --kind on --accounts (default every Account), add the person to a Lead list (--add-to-list) 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. The answer's summary is the rule as one sentence.",
|
|
255
|
+
risk: "write",
|
|
256
|
+
rules: {
|
|
257
|
+
changes: "A rule that acts on every matching Signal from now on: Leads join the list, events are sent.",
|
|
258
|
+
visible_to: "Your Team; with --unknown-people visit_profile, the people whose profiles are read.",
|
|
259
|
+
budget_rows: [],
|
|
260
|
+
retry: "A second call creates a second rule: list them first.",
|
|
261
|
+
undo: "`curviate signal rules delete <rule_id>`; Leads it added stay."
|
|
262
|
+
},
|
|
263
|
+
errors: RULE_ERRORS,
|
|
264
|
+
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']
|
|
265
|
+
},
|
|
266
|
+
args: { ...WRITE_SINGLE_FLAGS, ...RULE_FLAGS },
|
|
267
|
+
run: async ({ args }) => {
|
|
268
|
+
const f = args;
|
|
269
|
+
const body = ruleBody(f, true);
|
|
270
|
+
if (f.preview) return void preview("signals.rules.create", {}, body);
|
|
271
|
+
await one(f, async () => (await rootClient(f)).signals.rules.create(body));
|
|
272
|
+
}
|
|
273
|
+
}),
|
|
274
|
+
update: defineCommand({
|
|
275
|
+
meta: {
|
|
276
|
+
name: "update",
|
|
277
|
+
description: "Change a rule; only what you pass changes (an outcome flag replaces the outcomes). --off switches it off, --on on again.",
|
|
278
|
+
risk: "write",
|
|
279
|
+
rules: {
|
|
280
|
+
changes: "The rule, for every Signal from now on.",
|
|
281
|
+
visible_to: "Your Team.",
|
|
282
|
+
budget_rows: [],
|
|
283
|
+
retry: "Safe to repeat: the same values again.",
|
|
284
|
+
undo: "Run it again with the previous values (`curviate signal rules get` prints them)."
|
|
285
|
+
},
|
|
286
|
+
errors: RULE_ERRORS,
|
|
287
|
+
examples: ["curviate signal rules update sgr_YOUR_RULE_ID --off", "curviate signal rules update sgr_YOUR_RULE_ID --kind profile_viewed,followed_you"]
|
|
288
|
+
},
|
|
289
|
+
args: { ...WRITE_SINGLE_FLAGS, id: RULE_ID, ...RULE_FLAGS },
|
|
290
|
+
run: async ({ args }) => {
|
|
291
|
+
const f = args;
|
|
292
|
+
const id = nonEmpty("the rule id", f.id);
|
|
293
|
+
const body = ruleBody(f, false);
|
|
294
|
+
if (f.preview) return void preview("signals.rules.update", { id }, body);
|
|
295
|
+
await one(f, async () => (await rootClient(f)).signals.rules.update(id, body));
|
|
296
|
+
}
|
|
297
|
+
}),
|
|
298
|
+
delete: defineCommand({
|
|
299
|
+
meta: {
|
|
300
|
+
name: "delete",
|
|
301
|
+
description: "Delete a rule. What it did stays: the Leads, their list memberships and the records of its actions.",
|
|
302
|
+
risk: "write",
|
|
303
|
+
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`." },
|
|
304
|
+
examples: ["curviate signal rules delete sgr_YOUR_RULE_ID"]
|
|
305
|
+
},
|
|
306
|
+
args: { ...WRITE_SINGLE_FLAGS, id: RULE_ID },
|
|
307
|
+
run: async ({ args }) => {
|
|
308
|
+
const f = args;
|
|
309
|
+
const id = nonEmpty("the rule id", f.id);
|
|
310
|
+
if (f.preview) return void preview("signals.rules.delete", { id }, {});
|
|
311
|
+
try {
|
|
312
|
+
await (await rootClient(f)).signals.rules.delete(id);
|
|
313
|
+
renderSuccess({ deleted: true, id }, outputOpts(f), process);
|
|
314
|
+
} catch (err) {
|
|
315
|
+
await fail(err, f);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
})
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
var signalCommand = defineCommand({
|
|
322
|
+
meta: { name: "signal", description: DESCRIPTIONS.signal },
|
|
323
|
+
subCommands: { list: listCmd, get: getCmd, kinds: kindsCmd, watch: watchCmd, settings: settingsCmd, rules: rulesCmd },
|
|
324
|
+
async run() {
|
|
325
|
+
const { showHelp } = await import("./examples-J4X5NEIE.js");
|
|
326
|
+
await showHelp(signalCommand, ["curviate", "signal"]);
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
export {
|
|
330
|
+
signalCommand
|
|
331
|
+
};
|
|
@@ -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,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
|
renderSuccess,
|
|
26
26
|
writeNdjsonItem
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
readConfig,
|
|
31
31
|
resolveEffectiveConfig,
|
|
32
32
|
writeProfile
|
|
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 "./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-J4X5NEIE.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-3ZQNOKEK.js";
|
|
7
7
|
import {
|
|
8
8
|
readableObject
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OE4CY3ZL.js";
|
|
10
10
|
import {
|
|
11
11
|
renderSuccess
|
|
12
12
|
} from "./chunk-QM57YDJE.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-RXDG57B2.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-5LGKZBAY.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({
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
outputOpts,
|
|
10
10
|
rootClient,
|
|
11
11
|
usage
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import {
|
|
14
|
-
buildPreviewOutput
|
|
15
|
-
} from "./chunk-TCUYH5GO.js";
|
|
12
|
+
} from "./chunk-3ZQNOKEK.js";
|
|
16
13
|
import {
|
|
17
14
|
intFlag
|
|
18
15
|
} from "./chunk-NNV2OYEF.js";
|
|
16
|
+
import {
|
|
17
|
+
buildPreviewOutput
|
|
18
|
+
} from "./chunk-TCUYH5GO.js";
|
|
19
19
|
import {
|
|
20
20
|
pageDelayFromFlags,
|
|
21
21
|
readCursorFlag,
|
|
@@ -23,12 +23,12 @@ import {
|
|
|
23
23
|
readablePage,
|
|
24
24
|
rejectPaginationModifiersWithoutAll,
|
|
25
25
|
streamAll
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-OE4CY3ZL.js";
|
|
27
27
|
import {
|
|
28
28
|
renderSuccess,
|
|
29
29
|
writeNdjsonItem
|
|
30
30
|
} from "./chunk-QM57YDJE.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-RXDG57B2.js";
|
|
32
32
|
import {
|
|
33
33
|
GLOBAL_FLAGS,
|
|
34
34
|
WRITE_SINGLE_FLAGS,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
} from "./chunk-QLKGOIWS.js";
|
|
37
37
|
import {
|
|
38
38
|
DESCRIPTIONS
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-5LGKZBAY.js";
|
|
40
40
|
import "./chunk-ZYURL5VK.js";
|
|
41
41
|
|
|
42
42
|
// src/commands/unibox.ts
|
|
@@ -73,15 +73,17 @@ async function runList(c, f) {
|
|
|
73
73
|
if (f["last-from"] !== void 0) q["last_message_from"] = f["last-from"];
|
|
74
74
|
if (f.type !== void 0) q["type"] = f.type;
|
|
75
75
|
if (f.query !== void 0) q["q"] = f.query;
|
|
76
|
+
if (f["reply-label"] !== void 0) q["reply_label"] = listFlag("reply-label", f["reply-label"]);
|
|
76
77
|
if (f.total) q["include_total"] = true;
|
|
77
78
|
if (f.limit !== void 0) q["limit"] = intFlag("limit", f.limit, 1, 100);
|
|
78
79
|
try {
|
|
79
80
|
await paged(f, q, (p) => c.unibox.list(p), (page) => {
|
|
80
81
|
const unread = (i) => i["unread"] ? i["marked_unread"] ? "marked" : "yes" : "";
|
|
81
82
|
const campaign = (i) => i["campaign_context"]?.["campaign_name"];
|
|
83
|
+
const label = (i) => i["reply_label"]?.["label"];
|
|
82
84
|
print(table(
|
|
83
|
-
["ACCOUNT", "CHAT", "WITH", "UNREAD", "LAST", "FROM", "CAMPAIGN", "TAGS"],
|
|
84
|
-
page.items.map((i) => [i["account_id"], i["chat_id"], chatWith(i), unread(i), i["last_activity_at"], i["last_message_from"], campaign(i), i["tags"]?.join(", ")])
|
|
85
|
+
["ACCOUNT", "CHAT", "WITH", "UNREAD", "LAST", "FROM", "LABEL", "CAMPAIGN", "TAGS"],
|
|
86
|
+
page.items.map((i) => [i["account_id"], i["chat_id"], chatWith(i), unread(i), i["last_activity_at"], i["last_message_from"], label(i), campaign(i), i["tags"]?.join(", ")])
|
|
85
87
|
));
|
|
86
88
|
if (typeof page["total"] === "number") print(`total: ${page["total"]} chats match`);
|
|
87
89
|
});
|
|
@@ -166,6 +168,32 @@ async function runRefresh(c, f) {
|
|
|
166
168
|
await fail(err, f);
|
|
167
169
|
}
|
|
168
170
|
}
|
|
171
|
+
var REPLY_LABELS = ["interested", "not_now", "not_interested", "opt_out", "out_of_office", "referral", "other"];
|
|
172
|
+
async function runLabel(c, f) {
|
|
173
|
+
const messageId = String(f.messageId ?? "");
|
|
174
|
+
if (messageId.trim() === "") usage("the message id is required: `curviate unibox label <message_id>`, as `curviate unibox messages` prints it.");
|
|
175
|
+
if (f.set !== void 0) {
|
|
176
|
+
if (!REPLY_LABELS.includes(f.set)) usage(`--set takes one of ${REPLY_LABELS.join(", ")}.`);
|
|
177
|
+
const body = { reply_label: f.set };
|
|
178
|
+
if (f.preview) return preview("unibox.updateMessage", { message_id: messageId }, body);
|
|
179
|
+
try {
|
|
180
|
+
renderSuccess(await c.unibox.updateMessage(messageId, body), outputOpts(f), process);
|
|
181
|
+
} catch (err) {
|
|
182
|
+
await fail(err, f);
|
|
183
|
+
}
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
try {
|
|
187
|
+
const res = await c.unibox.getReplyLabel(messageId);
|
|
188
|
+
if (outputOpts(f).json) return renderSuccess(res, outputOpts(f), process);
|
|
189
|
+
const cur = res.current;
|
|
190
|
+
print(cur ? `${String(cur["label"])} (${String(cur["source"])}${cur["confidence"] == null ? "" : `, confidence ${String(cur["confidence"])}`})` : "no label");
|
|
191
|
+
const history = res.history ?? [];
|
|
192
|
+
if (history.length > 1) print(table(["AT", "LABEL", "SOURCE", "CONFIDENCE", "SET BY"], history.map((h) => [h["set_at"], h["label"], h["source"], h["confidence"], h["set_by"]?.["name"]])));
|
|
193
|
+
} catch (err) {
|
|
194
|
+
await fail(err, f);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
169
197
|
async function runAccounts(c, f) {
|
|
170
198
|
try {
|
|
171
199
|
const res = await c.unibox.accounts.list();
|
|
@@ -203,8 +231,8 @@ var listCmd = defineCommand({
|
|
|
203
231
|
name: "list",
|
|
204
232
|
description: "List the chats of every Account you may operate, newest activity first. Served from Curviate's store: no LinkedIn call, no budget. An Account without full-inbox sync shows only its Campaign chats; a disconnected Account's chats are listed read-only.",
|
|
205
233
|
risk: "read",
|
|
206
|
-
output: ["A table of Account, chat, person, unread (`marked` when made unread without a newer message), last activity, Campaign and tags; with --total the count of matching chats. --json (or piped) prints the API page."],
|
|
207
|
-
examples: ["curviate unibox list --unread", "curviate unibox list --person con_YOUR_LEAD_ID --campaign none --total"]
|
|
234
|
+
output: ["A table of Account, chat, person, unread (`marked` when made unread without a newer message), last activity, Reply label, Campaign and tags; with --total the count of matching chats. --json (or piped) prints the API page."],
|
|
235
|
+
examples: ["curviate unibox list --unread", "curviate unibox list --reply-label interested,unsure", "curviate unibox list --person con_YOUR_LEAD_ID --campaign none --total"]
|
|
208
236
|
},
|
|
209
237
|
args: {
|
|
210
238
|
...readOnly(GLOBAL_FLAGS),
|
|
@@ -215,6 +243,7 @@ var listCmd = defineCommand({
|
|
|
215
243
|
tag: { type: "string", description: "Only chats whose Lead has this tag; repeatable or a comma list." },
|
|
216
244
|
unread: { type: "boolean", description: "--unread for unread chats only, --no-unread for read ones; omit for both." },
|
|
217
245
|
"last-from": { type: "string", description: "Who wrote the last message: me or them." },
|
|
246
|
+
"reply-label": { type: "string", description: "Only chats whose latest Reply label is one of these, repeatable or a comma list: interested, not_now, not_interested, opt_out, out_of_office, referral, other, unsure; `none` adds chats with no label." },
|
|
218
247
|
type: { type: "string", description: "classic, inmail, sales_navigator or recruiter." },
|
|
219
248
|
query: { type: "string", description: "Person name or message text contains this (3 characters or more)." },
|
|
220
249
|
total: { type: "boolean", description: "Also count every chat that matches the filters (`total`)." }
|
|
@@ -350,6 +379,29 @@ var refreshCmd = defineCommand({
|
|
|
350
379
|
args: { ...WRITE_SINGLE_FLAGS, accounts: ACCOUNTS },
|
|
351
380
|
run: online(runRefresh)
|
|
352
381
|
});
|
|
382
|
+
var labelCmd = defineCommand({
|
|
383
|
+
meta: {
|
|
384
|
+
name: "label",
|
|
385
|
+
description: "Read a reply's Reply label and its history (who set it, Curviate's confidence as a whole percent, or a rule), or with --set correct it. A correction acts as when Curviate sets the label: opt_out puts the person on your Do-not-contact list (not_interested too when your Team turned that on), out_of_office makes the Lead wait 7 days, and your Team's Tag for the label is added. No LinkedIn call. --set needs Automate.",
|
|
386
|
+
risk: "write",
|
|
387
|
+
rules: {
|
|
388
|
+
changes: "With --set: the message's Reply label, stored as a correction; the earlier label stays in the history.",
|
|
389
|
+
visible_to: "Your Team.",
|
|
390
|
+
budget_rows: [],
|
|
391
|
+
retry: "Safe to repeat: the same label again.",
|
|
392
|
+
undo: "Set the label back with --set; a Do-not-contact entry it added stays: `curviate do-not-contact remove`."
|
|
393
|
+
},
|
|
394
|
+
errors: { ...AUTOMATE, REPLY_NOT_LABELLABLE: "this message takes no Reply label: a direct conversation (no Campaign), your own message, or a warm-up message." },
|
|
395
|
+
seeAlso: ["curviate unibox messages", "curviate team reply-labels"],
|
|
396
|
+
examples: ["curviate unibox label YOUR_MESSAGE_ID", "curviate unibox label YOUR_MESSAGE_ID --set not_now"]
|
|
397
|
+
},
|
|
398
|
+
args: {
|
|
399
|
+
...WRITE_SINGLE_FLAGS,
|
|
400
|
+
messageId: { type: "positional", description: "The message id, as `curviate unibox messages` prints it." },
|
|
401
|
+
set: { type: "string", description: "Set or correct the label: interested, not_now, not_interested, opt_out, out_of_office, referral or other." }
|
|
402
|
+
},
|
|
403
|
+
run: online(runLabel)
|
|
404
|
+
});
|
|
353
405
|
var accountsCmd = defineCommand({
|
|
354
406
|
meta: {
|
|
355
407
|
name: "accounts",
|
|
@@ -396,12 +448,13 @@ var uniboxCommand = defineCommand({
|
|
|
396
448
|
mark: markCmd,
|
|
397
449
|
tag: tagCmd,
|
|
398
450
|
enroll: enrollCmd,
|
|
451
|
+
label: labelCmd,
|
|
399
452
|
refresh: refreshCmd,
|
|
400
453
|
accounts: accountsCmd,
|
|
401
454
|
consent: consentCmd
|
|
402
455
|
},
|
|
403
456
|
async run() {
|
|
404
|
-
const { showHelp } = await import("./examples-
|
|
457
|
+
const { showHelp } = await import("./examples-J4X5NEIE.js");
|
|
405
458
|
await showHelp(uniboxCommand, ["curviate", "unibox"]);
|
|
406
459
|
}
|
|
407
460
|
});
|