@curviate/cli 0.49.0 → 0.50.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +12 -5
- package/dist/{account-2BH2Q6VG.js → account-U7UJIE3H.js} +784 -116
- package/dist/analytics-MZU2WKON.js +27 -0
- package/dist/beta-consent-67IDUV3K.js +81 -0
- package/dist/billing-QAW75YE7.js +124 -0
- package/dist/{chunk-RXWODUWA.js → chunk-2W4RN5ON.js} +18 -2
- package/dist/{chunk-MGB6FE4A.js → chunk-3Z6PXS6N.js} +6 -6
- package/dist/chunk-5S3MJVI5.js +22 -0
- package/dist/{chunk-V7FJWTZW.js → chunk-6LBOGIVE.js} +4 -4
- package/dist/{chunk-Z7OQSWBD.js → chunk-6PLDAEMO.js} +85 -10
- package/dist/chunk-73DJ3KNE.js +54 -0
- package/dist/{chunk-3RCW7URJ.js → chunk-A57ZILRU.js} +1 -1
- package/dist/chunk-AVI7J47S.js +52 -0
- package/dist/{chunk-JYKYD57J.js → chunk-CKVCBGQX.js} +1 -1
- package/dist/chunk-EIA66ESN.js +339 -0
- package/dist/{chunk-YLSJ4HKU.js → chunk-ENBIMEKS.js} +26 -1
- package/dist/{chunk-LCGXJGPB.js → chunk-GHMRPX5H.js} +7 -1
- package/dist/chunk-GOICALYQ.js +28 -0
- package/dist/{chunk-PQWDDSV7.js → chunk-L7JH3W56.js} +1 -1
- package/dist/chunk-LCPPXOPN.js +528 -0
- package/dist/chunk-LRMPS4UQ.js +144 -0
- package/dist/{chunk-5ZGTU4VD.js → chunk-LULN3II2.js} +78 -5
- package/dist/chunk-PPGKQJKU.js +38 -0
- package/dist/chunk-Q3ZPRFUX.js +20 -0
- package/dist/{chunk-SA2QHAXG.js → chunk-QM57YDJE.js} +13 -201
- package/dist/{chunk-Y7MZZRYR.js → chunk-RYWWSZUH.js} +14 -2
- package/dist/{chunk-TEAWYLPO.js → chunk-TYNVJDYK.js} +49 -18
- package/dist/cli.js +34 -18
- package/dist/{comment-MRDPDA33.js → comment-6NRZILAS.js} +90 -11
- package/dist/{company-2AEHSGHA.js → company-VXE7IEPT.js} +65 -15
- package/dist/{config-NRBKHXES.js → config-3WP7OD35.js} +53 -4
- package/dist/{connect-4XEBV5V3.js → connect-FBK6UWZP.js} +63 -18
- package/dist/contact-HFPZ3KGL.js +32 -0
- package/dist/contact-groups-AI4MLGQS.js +399 -0
- package/dist/contact-import-54Y7EMU2.js +336 -0
- package/dist/core-RLMWMQEI.js +46 -0
- package/dist/do-not-contact-LQ5V6SPE.js +200 -0
- package/dist/{doctor-BZ4DA7DV.js → doctor-KKRL7TEF.js} +65 -11
- package/dist/{document-RKHRWXNT.js → document-GFRWPQFV.js} +1 -1
- package/dist/{draft-C5N6EOO5.js → draft-VSWZOCDR.js} +60 -14
- package/dist/{enrollment-BNQOUKI7.js → enrollment-OACCSBM5.js} +31 -19
- package/dist/{examples-NIMSIXMV.js → examples-JJB4DZKK.js} +2 -2
- package/dist/{exit-codes-TLMKTLRI.js → exit-codes-7DBETBDT.js} +1 -1
- package/dist/export-AQHAFVAB.js +96 -0
- package/dist/{feed-DFUU7SUJ.js → feed-HY4HT75U.js} +13 -10
- package/dist/{group-CSD2OWOZ.js → group-A3SMBFU5.js} +18 -10
- package/dist/{inbox-SNSPWI7J.js → inbox-YHUO2RPI.js} +31 -12
- package/dist/{inboxes-RIRHPS4H.js → inboxes-GKLMHPDR.js} +14 -10
- package/dist/incoming-NHROOOIZ.js +218 -0
- package/dist/{job-6PNXXZNF.js → job-QBW3PGWL.js} +65 -13
- package/dist/{login-Y7JBAHCW.js → login-GWIYHKYO.js} +13 -4
- package/dist/{message-2IK4MBBG.js → message-BFLN2VHS.js} +9 -7
- package/dist/{motion-7ATUXO6R.js → motion-LTWU2GPC.js} +39 -117
- package/dist/network-CNSBX2SR.js +235 -0
- package/dist/{notification-VYK5NDEB.js → notification-DCCFJPXU.js} +38 -11
- package/dist/notifications-AQBXBK4K.js +231 -0
- package/dist/{post-AN6T2OJF.js → post-PINZHSPS.js} +92 -12
- package/dist/{profile-UQY64642.js → profile-MJQJSNYR.js} +76 -20
- package/dist/{recruiter-OY4RN5HH.js → recruiter-X6GX4A2G.js} +133 -22
- package/dist/{sales-nav-KLODLYMW.js → sales-nav-44GYWDYE.js} +74 -19
- package/dist/{search-NWP5S6CF.js → search-SULIN6TB.js} +55 -23
- package/dist/{setup-YPPFLH2N.js → setup-ZQRHMRMB.js} +69 -17
- package/dist/team-TM6LRUY5.js +450 -0
- package/dist/tier-Z3U6AT7H.js +61 -0
- package/dist/unibox-BIMI2KY5.js +402 -0
- package/dist/{webhook-OHKBL3YS.js → webhook-EHXRTHBG.js} +257 -27
- package/package.json +2 -2
- package/dist/chunk-D2S5OCYU.js +0 -38
- package/dist/core-RGU2SCBN.js +0 -46
|
@@ -0,0 +1,402 @@
|
|
|
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-3Z6PXS6N.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
|
+
readablePage,
|
|
24
|
+
rejectPaginationModifiersWithoutAll,
|
|
25
|
+
streamAll
|
|
26
|
+
} from "./chunk-LRMPS4UQ.js";
|
|
27
|
+
import {
|
|
28
|
+
renderSuccess,
|
|
29
|
+
writeNdjsonItem
|
|
30
|
+
} from "./chunk-QM57YDJE.js";
|
|
31
|
+
import "./chunk-LULN3II2.js";
|
|
32
|
+
import {
|
|
33
|
+
GLOBAL_FLAGS,
|
|
34
|
+
WRITE_SINGLE_FLAGS,
|
|
35
|
+
readOnly
|
|
36
|
+
} from "./chunk-RYWWSZUH.js";
|
|
37
|
+
import {
|
|
38
|
+
DESCRIPTIONS
|
|
39
|
+
} from "./chunk-73DJ3KNE.js";
|
|
40
|
+
import "./chunk-ZYURL5VK.js";
|
|
41
|
+
|
|
42
|
+
// src/commands/unibox.ts
|
|
43
|
+
import { defineCommand } from "citty";
|
|
44
|
+
var ids = (f) => ({ accountId: String(f.accountId ?? ""), chatId: String(f.chatId ?? "") });
|
|
45
|
+
var preview = (method, args, body = {}) => print(JSON.stringify(buildPreviewOutput({ method, args, body })));
|
|
46
|
+
async function paged(f, params, fetch, human) {
|
|
47
|
+
rejectPaginationModifiersWithoutAll(f, process);
|
|
48
|
+
const cursor = readCursorFlag(f, process);
|
|
49
|
+
if (cursor) params["cursor"] = cursor;
|
|
50
|
+
if (f.all) {
|
|
51
|
+
for await (const item of streamAll((p) => fetch(p), params, { maxPages: readMaxPagesFlag(f, process), out: process, pageDelayMs: pageDelayFromFlags(f) })) writeNdjsonItem(process, item, f.fields);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const page = readablePage(await fetch(params));
|
|
55
|
+
if (outputOpts(f).json) return renderSuccess(page, outputOpts(f), process);
|
|
56
|
+
human(page);
|
|
57
|
+
if (page["cursor"]) print(`next page: --cursor ${String(page["cursor"])}`);
|
|
58
|
+
}
|
|
59
|
+
async function runList(c, f) {
|
|
60
|
+
const q = {};
|
|
61
|
+
if (f.accounts !== void 0) q["account_ids"] = listFlag("accounts", f.accounts);
|
|
62
|
+
if (f.motion !== void 0) q["motion_ids"] = listFlag("motion", f.motion);
|
|
63
|
+
if (f.tag !== void 0) q["tags"] = listFlag("tag", f.tag);
|
|
64
|
+
if (f.person !== void 0) q["person"] = f.person;
|
|
65
|
+
if (f.unread !== void 0) q["unread"] = f.unread;
|
|
66
|
+
if (f["last-from"] !== void 0) q["last_message_from"] = f["last-from"];
|
|
67
|
+
if (f.type !== void 0) q["type"] = f.type;
|
|
68
|
+
if (f.query !== void 0) q["q"] = f.query;
|
|
69
|
+
if (f.total) q["include_total"] = true;
|
|
70
|
+
if (f.limit !== void 0) q["limit"] = intFlag("limit", f.limit, 1, 100);
|
|
71
|
+
try {
|
|
72
|
+
await paged(f, q, (p) => c.unibox.list(p), (page) => {
|
|
73
|
+
const unread = (i) => i["unread"] ? i["marked_unread"] ? "marked" : "yes" : "";
|
|
74
|
+
const motion = (i) => i["motion_context"]?.["motion_name"];
|
|
75
|
+
print(table(
|
|
76
|
+
["ACCOUNT", "CHAT", "WITH", "UNREAD", "LAST", "FROM", "MOTION", "TAGS"],
|
|
77
|
+
page.items.map((i) => [i["account_id"], i["chat_id"], i["counterpart"]?.["name"], unread(i), i["last_activity_at"], i["last_message_from"], motion(i), i["tags"]?.join(", ")])
|
|
78
|
+
));
|
|
79
|
+
if (typeof page["total"] === "number") print(`total: ${page["total"]} chats match`);
|
|
80
|
+
});
|
|
81
|
+
} catch (err) {
|
|
82
|
+
await fail(err, f);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async function runGet(c, f) {
|
|
86
|
+
const { accountId, chatId } = ids(f);
|
|
87
|
+
try {
|
|
88
|
+
renderSuccess(await c.unibox.get(accountId, chatId), outputOpts(f), process);
|
|
89
|
+
} catch (err) {
|
|
90
|
+
await fail(err, f);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async function runUnread(c, f) {
|
|
94
|
+
try {
|
|
95
|
+
renderSuccess(await c.unibox.unreadCount(f.accounts === void 0 ? {} : { account_ids: listFlag("accounts", f.accounts) }), outputOpts(f), process);
|
|
96
|
+
} catch (err) {
|
|
97
|
+
await fail(err, f);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
async function runMessages(c, f) {
|
|
101
|
+
const { accountId, chatId } = ids(f);
|
|
102
|
+
const q = {};
|
|
103
|
+
if (f.limit !== void 0) q["limit"] = intFlag("limit", f.limit, 1, 25);
|
|
104
|
+
try {
|
|
105
|
+
await paged(f, q, (p) => c.account(accountId).messaging.listMessages(chatId, p), (page) => print(table(["AT", "FROM", "ORIGIN", "TEXT"], page.items.map((m) => [m["timestamp"], m["is_sender"] ? "me" : m["sender"]?.["display_name"] ?? m["sender_id"], m["origin"], m["text"]]))));
|
|
106
|
+
} catch (err) {
|
|
107
|
+
await fail(err, f);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async function runReply(c, f) {
|
|
111
|
+
const { accountId, chatId } = ids(f);
|
|
112
|
+
if (!f.text) usage('the message text is required: `curviate unibox reply <account_id> <chat_id> "<text>"`.');
|
|
113
|
+
const body = { text: f.text };
|
|
114
|
+
if (f.preview) return preview("messaging.sendMessage", { account_id: accountId, chat_id: chatId }, body);
|
|
115
|
+
try {
|
|
116
|
+
renderSuccess(await c.account(accountId).messaging.sendMessage(chatId, body), outputOpts(f), process);
|
|
117
|
+
} catch (err) {
|
|
118
|
+
await fail(err, f);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
async function runMark(c, f) {
|
|
122
|
+
const { accountId, chatId } = ids(f);
|
|
123
|
+
if (f.read === void 0 === (f.unread === void 0)) usage("pass exactly one of --read or --unread.");
|
|
124
|
+
const body = { read: f.read ?? !f.unread };
|
|
125
|
+
if (f.preview) return preview("messaging.markChatRead", { account_id: accountId, chat_id: chatId }, body);
|
|
126
|
+
try {
|
|
127
|
+
renderSuccess(await c.account(accountId).messaging.markChatRead(chatId, body), outputOpts(f), process);
|
|
128
|
+
} catch (err) {
|
|
129
|
+
await fail(err, f);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async function runTag(c, f) {
|
|
133
|
+
const { accountId, chatId } = ids(f);
|
|
134
|
+
const body = f.tag === void 0 ? {} : { tags: listFlag("tag", f.tag) };
|
|
135
|
+
if (f.preview) return preview("unibox.tagContact", { account_id: accountId, chat_id: chatId }, body);
|
|
136
|
+
try {
|
|
137
|
+
renderSuccess(await c.unibox.tagContact(accountId, chatId, body), outputOpts(f), process);
|
|
138
|
+
} catch (err) {
|
|
139
|
+
await fail(err, f);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
async function runEnroll(c, f) {
|
|
143
|
+
const { accountId, chatId } = ids(f);
|
|
144
|
+
const motion = typeof f.motion === "string" && f.motion.trim() !== "" ? f.motion : usage("--motion is required: the Motion to enroll the person in (mot_...).");
|
|
145
|
+
const body = { motion_id: motion };
|
|
146
|
+
if (f.preview) return preview("unibox.enroll", { account_id: accountId, chat_id: chatId }, body);
|
|
147
|
+
try {
|
|
148
|
+
renderSuccess(await c.unibox.enroll(accountId, chatId, body), outputOpts(f), process);
|
|
149
|
+
} catch (err) {
|
|
150
|
+
await fail(err, f);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
async function runRefresh(c, f) {
|
|
154
|
+
const body = f.accounts === void 0 ? {} : { account_ids: listFlag("accounts", f.accounts) };
|
|
155
|
+
if (f.preview) return preview("unibox.refresh", {}, body);
|
|
156
|
+
try {
|
|
157
|
+
renderSuccess(await c.unibox.refresh(body), outputOpts(f), process);
|
|
158
|
+
} catch (err) {
|
|
159
|
+
await fail(err, f);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
async function runAccounts(c, f) {
|
|
163
|
+
try {
|
|
164
|
+
const res = await c.unibox.accounts.list();
|
|
165
|
+
if (outputOpts(f).json) return renderSuccess(res, outputOpts(f), process);
|
|
166
|
+
print(table(
|
|
167
|
+
["ACCOUNT", "STATUS", "FULL INBOX", "SYNC", "NEXT READ"],
|
|
168
|
+
(res.items ?? []).map((i) => [i["account_id"], i["account_status"], i["sync_full_inbox"] ? "on" : "off", i["sync"]?.["state"], i["sync"]?.["next_run_at"]])
|
|
169
|
+
));
|
|
170
|
+
} catch (err) {
|
|
171
|
+
await fail(err, f);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
async function runConsent(c, f) {
|
|
175
|
+
if (Boolean(f.on) === Boolean(f.off)) usage("pass exactly one of --on or --off.");
|
|
176
|
+
const accountId = String(f.accountId ?? "");
|
|
177
|
+
const body = { sync_full_inbox: Boolean(f.on) };
|
|
178
|
+
if (f.preview) return preview("unibox.accounts.update", { account_id: accountId }, body);
|
|
179
|
+
try {
|
|
180
|
+
renderSuccess(await c.unibox.accounts.update(accountId, body), outputOpts(f), process);
|
|
181
|
+
} catch (err) {
|
|
182
|
+
await fail(err, f);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
var online = (fn) => async ({ args }) => {
|
|
186
|
+
const f = args;
|
|
187
|
+
await fn(await rootClient(f), f);
|
|
188
|
+
};
|
|
189
|
+
var ACCOUNT = { type: "positional", description: "The chat's Account (acc_...), as `curviate unibox list` prints it." };
|
|
190
|
+
var CHAT = { type: "positional", description: "The chat id, as `curviate unibox list` prints it." };
|
|
191
|
+
var ACCOUNTS = { type: "string", description: "Only these Accounts: a comma list of ids (acc_...). Never filled from your profile's default Account." };
|
|
192
|
+
var AUTOMATE = { TIER_REQUIRED: "your plan does not include the Unibox actions (Automate)." };
|
|
193
|
+
var ONE_TO_ONE = { CHAT_NOT_ONE_TO_ONE: "the chat is a group chat: there is no one person to save." };
|
|
194
|
+
var listCmd = defineCommand({
|
|
195
|
+
meta: {
|
|
196
|
+
name: "list",
|
|
197
|
+
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 Motion chats; a disconnected Account's chats are listed read-only.",
|
|
198
|
+
risk: "read",
|
|
199
|
+
output: ["A table of Account, chat, person, unread (`marked` when made unread without a newer message), last activity, Motion and tags; with --total the count of matching chats. --json (or piped) prints the API page."],
|
|
200
|
+
examples: ["curviate unibox list --unread", "curviate unibox list --person con_YOUR_CONTACT_ID --motion none --total"]
|
|
201
|
+
},
|
|
202
|
+
args: {
|
|
203
|
+
...readOnly(GLOBAL_FLAGS),
|
|
204
|
+
accounts: ACCOUNTS,
|
|
205
|
+
motion: { type: "string", description: "Only chats linked to these Motions (mot_...), repeatable or a comma list; `none` for chats no Motion links." },
|
|
206
|
+
person: { type: "string", description: "Only chats with this person: a Contact id (con_...) or a LinkedIn id (ACo...)." },
|
|
207
|
+
tag: { type: "string", description: "Only chats whose Contact has this tag; repeatable or a comma list." },
|
|
208
|
+
unread: { type: "boolean", description: "--unread for unread chats only, --no-unread for read ones; omit for both." },
|
|
209
|
+
"last-from": { type: "string", description: "Who wrote the last message: me or them." },
|
|
210
|
+
type: { type: "string", description: "classic, inmail, sales_navigator or recruiter." },
|
|
211
|
+
query: { type: "string", description: "Person name or message text contains this (3 characters or more)." },
|
|
212
|
+
total: { type: "boolean", description: "Also count every chat that matches the filters (`total`)." }
|
|
213
|
+
},
|
|
214
|
+
run: online(runList)
|
|
215
|
+
});
|
|
216
|
+
var getCmd = defineCommand({
|
|
217
|
+
meta: {
|
|
218
|
+
name: "get",
|
|
219
|
+
description: "One chat as the Unibox lists it, with `marked_unread` ({origin, at}, or null) and its Motion context.",
|
|
220
|
+
risk: "read",
|
|
221
|
+
examples: ["curviate unibox get acc_YOUR_ACCOUNT_ID YOUR_CHAT_ID"]
|
|
222
|
+
},
|
|
223
|
+
args: { ...readOnly(WRITE_SINGLE_FLAGS), accountId: ACCOUNT, chatId: CHAT },
|
|
224
|
+
run: online(runGet)
|
|
225
|
+
});
|
|
226
|
+
var unreadCmd = defineCommand({
|
|
227
|
+
meta: {
|
|
228
|
+
name: "unread",
|
|
229
|
+
description: "Count unread chats (chats, not messages) across your Accounts; cheap to poll.",
|
|
230
|
+
risk: "read",
|
|
231
|
+
examples: ["curviate unibox unread", "curviate unibox unread --accounts acc_YOUR_ACCOUNT_ID"]
|
|
232
|
+
},
|
|
233
|
+
args: { ...readOnly(WRITE_SINGLE_FLAGS), accounts: ACCOUNTS },
|
|
234
|
+
run: online(runUnread)
|
|
235
|
+
});
|
|
236
|
+
var messagesCmd = defineCommand({
|
|
237
|
+
meta: {
|
|
238
|
+
name: "messages",
|
|
239
|
+
description: "Read one chat's messages, newest first. Each message carries `origin` when known: motion, unibox, api or linkedin.",
|
|
240
|
+
risk: "read",
|
|
241
|
+
seeAlso: ["curviate core inbox messages"],
|
|
242
|
+
examples: ["curviate unibox messages acc_YOUR_ACCOUNT_ID YOUR_CHAT_ID", "curviate unibox messages acc_YOUR_ACCOUNT_ID YOUR_CHAT_ID --all"]
|
|
243
|
+
},
|
|
244
|
+
args: { ...readOnly(GLOBAL_FLAGS), accountId: ACCOUNT, chatId: CHAT },
|
|
245
|
+
run: online(runMessages)
|
|
246
|
+
});
|
|
247
|
+
var replyCmd = defineCommand({
|
|
248
|
+
meta: {
|
|
249
|
+
name: "reply",
|
|
250
|
+
description: "Send a message into the chat from its Account. The send marks the chat read.",
|
|
251
|
+
risk: "write",
|
|
252
|
+
rules: {
|
|
253
|
+
changes: "Sends one LinkedIn message and marks the chat read.",
|
|
254
|
+
visible_to: "The other people in the chat, at once.",
|
|
255
|
+
budget_rows: [],
|
|
256
|
+
retry: "A retry after a timeout can send the message twice: read `curviate unibox messages` first.",
|
|
257
|
+
undo: "`curviate core message delete` removes it on LinkedIn; it may have been read already."
|
|
258
|
+
},
|
|
259
|
+
errors: { REAUTH_REQUIRED: "the Account is disconnected: reconnect it to write.", CHAT_NOT_VISIBLE: "the chat is not visible to you." },
|
|
260
|
+
examples: ['curviate unibox reply acc_YOUR_ACCOUNT_ID YOUR_CHAT_ID "Thanks, Tuesday works."']
|
|
261
|
+
},
|
|
262
|
+
args: { ...WRITE_SINGLE_FLAGS, accountId: ACCOUNT, chatId: CHAT, text: { type: "positional", description: "The message text (1 to 8000 characters)." } },
|
|
263
|
+
run: online(runReply)
|
|
264
|
+
});
|
|
265
|
+
var markCmd = defineCommand({
|
|
266
|
+
meta: {
|
|
267
|
+
name: "mark",
|
|
268
|
+
description: "Mark the chat read or unread on LinkedIn, for everyone who sees this Account's inbox.",
|
|
269
|
+
risk: "write",
|
|
270
|
+
rules: {
|
|
271
|
+
changes: "Sets the chat's read state on LinkedIn.",
|
|
272
|
+
visible_to: "Your Team and the Account's own LinkedIn inbox; not the other person.",
|
|
273
|
+
budget_rows: [],
|
|
274
|
+
retry: "Safe to repeat: the same state again.",
|
|
275
|
+
undo: "Mark it the other way."
|
|
276
|
+
},
|
|
277
|
+
errors: { REAUTH_REQUIRED: "the Account is disconnected: reconnect it to write." },
|
|
278
|
+
examples: ["curviate unibox mark acc_YOUR_ACCOUNT_ID YOUR_CHAT_ID --read"]
|
|
279
|
+
},
|
|
280
|
+
args: {
|
|
281
|
+
...WRITE_SINGLE_FLAGS,
|
|
282
|
+
accountId: ACCOUNT,
|
|
283
|
+
chatId: CHAT,
|
|
284
|
+
read: { type: "boolean", description: "Mark it read." },
|
|
285
|
+
unread: { type: "boolean", description: "Mark it unread." }
|
|
286
|
+
},
|
|
287
|
+
run: online(runMark)
|
|
288
|
+
});
|
|
289
|
+
var tagCmd = defineCommand({
|
|
290
|
+
meta: {
|
|
291
|
+
name: "tag",
|
|
292
|
+
description: "Save the other person of a one-to-one chat as a Contact (or find the one you hold) and add tags, never removing any. Needs Automate.",
|
|
293
|
+
risk: "write",
|
|
294
|
+
rules: {
|
|
295
|
+
changes: "Creates or finds the Contact and adds the tags.",
|
|
296
|
+
visible_to: "Your Team.",
|
|
297
|
+
budget_rows: [],
|
|
298
|
+
retry: "Safe to repeat: the same Contact, tags already there stay.",
|
|
299
|
+
undo: "Remove the tags or the Contact with `curviate contact`."
|
|
300
|
+
},
|
|
301
|
+
errors: { ...AUTOMATE, ...ONE_TO_ONE },
|
|
302
|
+
examples: ["curviate unibox tag acc_YOUR_ACCOUNT_ID YOUR_CHAT_ID --tag warm"]
|
|
303
|
+
},
|
|
304
|
+
args: { ...WRITE_SINGLE_FLAGS, accountId: ACCOUNT, chatId: CHAT, tag: { type: "string", description: "A tag to add; repeatable or a comma list. Omit to only save the Contact." } },
|
|
305
|
+
run: online(runTag)
|
|
306
|
+
});
|
|
307
|
+
var enrollCmd = defineCommand({
|
|
308
|
+
meta: {
|
|
309
|
+
name: "enroll",
|
|
310
|
+
description: "Save the other person of a one-to-one chat as a Contact and enroll them in a Motion through this chat's Account (one of its sending Accounts). A direct add: the rule that skips people you already chat with does not apply; every other rule does. Needs Automate.",
|
|
311
|
+
risk: "high",
|
|
312
|
+
rules: {
|
|
313
|
+
changes: "Creates the Enrollment; the Motion's Steps run for this person from this Account.",
|
|
314
|
+
visible_to: "The person, once a Step reaches LinkedIn.",
|
|
315
|
+
budget_rows: [],
|
|
316
|
+
retry: "A second call answers that the person is already enrolled.",
|
|
317
|
+
undo: "`curviate enrollment stop <enrollment_id>`; what was sent stays sent.",
|
|
318
|
+
blast_radius: "One person, from one Account."
|
|
319
|
+
},
|
|
320
|
+
errors: { ...AUTOMATE, ...ONE_TO_ONE, ALREADY_ENROLLED_ON_ACCOUNT: "the person is already in this Motion on this Account." },
|
|
321
|
+
seeAlso: ["curviate enrollment get"],
|
|
322
|
+
examples: ["curviate unibox enroll acc_YOUR_ACCOUNT_ID YOUR_CHAT_ID --motion mot_YOUR_MOTION_ID"]
|
|
323
|
+
},
|
|
324
|
+
args: { ...WRITE_SINGLE_FLAGS, accountId: ACCOUNT, chatId: CHAT, motion: { type: "string", required: true, description: "The Motion (mot_...)." } },
|
|
325
|
+
run: online(runEnroll)
|
|
326
|
+
});
|
|
327
|
+
var refreshCmd = defineCommand({
|
|
328
|
+
meta: {
|
|
329
|
+
name: "refresh",
|
|
330
|
+
description: "Queue a re-read of the newest chats of each Account the inbox poll covers, or of --accounts; it runs within minutes. Once per Account in a short cooldown: a repeat answers cooldown with next_allowed_at. An Account without Sync full inbox is re-read for its Motion conversations only; one with neither answers not_synced. The poll keeps the Account's active hours: on a Team whose active days are Monday to Friday nothing is polled at the weekend, and a refresh then answers paused until the next active day. Needs Automate.",
|
|
331
|
+
risk: "write",
|
|
332
|
+
rules: {
|
|
333
|
+
changes: "Queues one read of each Account's newest chats.",
|
|
334
|
+
visible_to: "Nobody: reads only.",
|
|
335
|
+
budget_rows: ["inbox_sync"],
|
|
336
|
+
retry: "A repeat inside the cooldown answers cooldown; nothing new is queued.",
|
|
337
|
+
undo: "Nothing to undo: a refresh only reads."
|
|
338
|
+
},
|
|
339
|
+
errors: AUTOMATE,
|
|
340
|
+
examples: ["curviate unibox refresh", "curviate unibox refresh --accounts acc_YOUR_ACCOUNT_ID"]
|
|
341
|
+
},
|
|
342
|
+
args: { ...WRITE_SINGLE_FLAGS, accounts: ACCOUNTS },
|
|
343
|
+
run: online(runRefresh)
|
|
344
|
+
});
|
|
345
|
+
var accountsCmd = defineCommand({
|
|
346
|
+
meta: {
|
|
347
|
+
name: "accounts",
|
|
348
|
+
description: "For every Account you may operate: whether Sync full inbox is on, and how far the chat-list sync is. Read `sync` before trusting an empty Unibox.",
|
|
349
|
+
risk: "read",
|
|
350
|
+
examples: ["curviate unibox accounts"]
|
|
351
|
+
},
|
|
352
|
+
args: readOnly(WRITE_SINGLE_FLAGS),
|
|
353
|
+
run: online(runAccounts)
|
|
354
|
+
});
|
|
355
|
+
var consentCmd = defineCommand({
|
|
356
|
+
meta: {
|
|
357
|
+
name: "consent",
|
|
358
|
+
description: "Turn Sync full inbox on or off for one Account. Only the person who connected the Account can. On starts a paced listing that takes hours (needs Automate); off hides the Account's non-Motion chats at once and deletes them shortly after.",
|
|
359
|
+
risk: "high",
|
|
360
|
+
rules: {
|
|
361
|
+
changes: "Copies the Account's whole inbox into the Unibox (on), or removes the non-Motion chats from it (off).",
|
|
362
|
+
visible_to: "Your Team: every teammate who may operate the Account reads its whole inbox while on.",
|
|
363
|
+
budget_rows: ["inbox_sync"],
|
|
364
|
+
retry: "Safe to repeat: the same setting again.",
|
|
365
|
+
undo: "Run it with the other flag; chats removed by off are listed again by a new sync.",
|
|
366
|
+
blast_radius: "One Account's whole inbox."
|
|
367
|
+
},
|
|
368
|
+
errors: { ...AUTOMATE, ACCOUNT_OWNER_ONLY: "only the person who connected the Account can change this." },
|
|
369
|
+
seeAlso: ["curviate unibox refresh", "curviate unibox list"],
|
|
370
|
+
examples: ["curviate unibox consent acc_YOUR_ACCOUNT_ID --on"]
|
|
371
|
+
},
|
|
372
|
+
args: {
|
|
373
|
+
...WRITE_SINGLE_FLAGS,
|
|
374
|
+
accountId: { type: "positional", description: "Your Account (acc_...)." },
|
|
375
|
+
on: { type: "boolean", description: "Turn Sync full inbox on." },
|
|
376
|
+
off: { type: "boolean", description: "Turn Sync full inbox off." }
|
|
377
|
+
},
|
|
378
|
+
run: online(runConsent)
|
|
379
|
+
});
|
|
380
|
+
var uniboxCommand = defineCommand({
|
|
381
|
+
meta: { name: "unibox", description: DESCRIPTIONS.unibox },
|
|
382
|
+
subCommands: {
|
|
383
|
+
list: listCmd,
|
|
384
|
+
get: getCmd,
|
|
385
|
+
unread: unreadCmd,
|
|
386
|
+
messages: messagesCmd,
|
|
387
|
+
reply: replyCmd,
|
|
388
|
+
mark: markCmd,
|
|
389
|
+
tag: tagCmd,
|
|
390
|
+
enroll: enrollCmd,
|
|
391
|
+
refresh: refreshCmd,
|
|
392
|
+
accounts: accountsCmd,
|
|
393
|
+
consent: consentCmd
|
|
394
|
+
},
|
|
395
|
+
async run() {
|
|
396
|
+
const { showHelp } = await import("./examples-JJB4DZKK.js");
|
|
397
|
+
await showHelp(uniboxCommand, ["curviate", "unibox"]);
|
|
398
|
+
}
|
|
399
|
+
});
|
|
400
|
+
export {
|
|
401
|
+
uniboxCommand
|
|
402
|
+
};
|