@curviate/cli 0.16.0 → 0.18.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 +42 -0
- package/dist/{account-ZDIZAXVI.js → account-EGJJNBXW.js} +6 -6
- package/dist/{message-IKKOI6CZ.js → chunk-KVV6LZ7E.js} +13 -10
- package/dist/{chunk-45KHSWCV.js → chunk-ROULHEFW.js} +30 -1
- package/dist/cli.js +13 -13
- package/dist/{company-XU7TZ66L.js → company-BC72KZ5G.js} +239 -6
- package/dist/{connect-7OWBNGHU.js → connect-6PU7QCOL.js} +7 -7
- package/dist/{job-QLSGNDGW.js → job-EIXBJXLW.js} +11 -11
- package/dist/message-UWMRE2SJ.js +36 -0
- package/dist/{profile-JUTGTPES.js → profile-XWSRUYRW.js} +7 -7
- package/dist/{recruiter-WEZZVZN3.js → recruiter-MVPSTH2V.js} +9 -9
- package/dist/{search-5U5U5MTT.js → search-ZQUKLQ6T.js} +1 -1
- package/package.json +2 -2
- package/dist/{comment-COJY6HQP.js → comment-VT6PO4MN.js} +7 -7
- package/dist/{inbox-VVRQ7SOX.js → inbox-DRJ6ENXC.js} +5 -5
- package/dist/{post-DH4RDYKZ.js → post-N3GQDIQJ.js} +7 -7
- package/dist/{sales-nav-NUCYJ4S3.js → sales-nav-TMXWDKSE.js} +5 -5
- package/dist/{webhook-UWIOVWVV.js → webhook-QFSZN3P2.js} +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,48 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
6
6
|
Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html):
|
|
7
7
|
a new command or flag is a minor; a breaking command/flag/exit-code change is a major; a fix is a patch.
|
|
8
8
|
|
|
9
|
+
## [Unreleased]
|
|
10
|
+
|
|
11
|
+
## [0.18.0] - 2026-07-17
|
|
12
|
+
|
|
13
|
+
A minor release adding the `company reply` command. No breaking changes, built against `@curviate/sdk` 0.18.0.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **`company reply <id> <chat_id> "<text>" [--attach <file>…]`** (write, admin-gated,
|
|
18
|
+
`--preview` accepted). Replies to an existing company-inbox conversation as the page,
|
|
19
|
+
via the SDK's `companies.sendMessage`. `<chat_id>` must be a `COMPANY_` chat id from
|
|
20
|
+
`inboxes chats`, not the `2-…` id the `company` reads return; it passes through verbatim
|
|
21
|
+
(no client-side pre-check) and a non-`COMPANY_` id is rejected by the API with a guiding
|
|
22
|
+
400 naming the fix. Reply-only: it cannot start a new conversation on the page's behalf.
|
|
23
|
+
`<id>` accepts a URL, slug, or numeric id, resolved to the numeric id first (including
|
|
24
|
+
under `--preview`, so the preview renders the request that would be sent). Pass `-` as
|
|
25
|
+
the text to read the reply body from stdin. See also `inboxes chats` and `message send`
|
|
26
|
+
(the personal equivalent, which also accepts a `COMPANY_` chat id).
|
|
27
|
+
|
|
28
|
+
## [0.17.0] - 2026-07-17
|
|
29
|
+
|
|
30
|
+
A minor release adding the `company follow-invite` and `company invitable-followers`
|
|
31
|
+
commands. No breaking changes, built against `@curviate/sdk` 0.17.0.
|
|
32
|
+
|
|
33
|
+
### Added
|
|
34
|
+
|
|
35
|
+
- **`company follow-invite <id> --invitee <AC…> [--invitee <AC…> ...]`** (write, admin-gated,
|
|
36
|
+
`--preview` accepted). Invites the connected account's 1st-degree connections to follow an
|
|
37
|
+
administered company page. `--invitee` is repeatable, at least one required, max 50 per
|
|
38
|
+
request. All-or-nothing: for an all-valid request you get one outcome per requested invitee,
|
|
39
|
+
in request order (`status: "invited" | "already_invited" | "ineligible" | "not_found"`); if
|
|
40
|
+
any invitee id is invalid the whole request rejects with a 404, not a partial result.
|
|
41
|
+
Re-inviting an already-invited member is a safe no-op, the same `invitation_id`, never a
|
|
42
|
+
duplicate. `<id>`
|
|
43
|
+
accepts a URL, slug, or numeric id, resolved to the numeric provider_id first (including
|
|
44
|
+
under `--preview`, so the preview renders the actual request that would be sent).
|
|
45
|
+
- **`company invitable-followers <id> [--limit] [--cursor] [--all]`** (paginated read). Lists
|
|
46
|
+
the connections eligible to be invited to follow a company page you administer, the read
|
|
47
|
+
that seeds `company follow-invite`. Items carry no name or headline; hydrate a candidate via
|
|
48
|
+
`profile <id>` first. `invite_token` is always re-encoded as base64 in CLI output (the raw
|
|
49
|
+
value can carry bytes unsafe to print in a terminal), in every output mode.
|
|
50
|
+
|
|
9
51
|
## [0.16.0] - 2026-07-17
|
|
10
52
|
|
|
11
53
|
A minor release adding the `inboxes` command group. No breaking changes,
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
defaultReadStdin
|
|
4
|
-
} from "./chunk-U7Y4EXHT.js";
|
|
5
2
|
import {
|
|
6
3
|
readlineSync
|
|
7
4
|
} from "./chunk-H4KV7MIN.js";
|
|
@@ -9,17 +6,20 @@ import {
|
|
|
9
6
|
AUTH_NEEDED
|
|
10
7
|
} from "./chunk-M6UDWFHX.js";
|
|
11
8
|
import {
|
|
12
|
-
|
|
13
|
-
} from "./chunk-
|
|
9
|
+
defaultReadStdin
|
|
10
|
+
} from "./chunk-U7Y4EXHT.js";
|
|
14
11
|
import {
|
|
15
12
|
slimAccountGet,
|
|
16
13
|
slimAccountList,
|
|
17
14
|
slimAccountListItem
|
|
18
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ROULHEFW.js";
|
|
19
16
|
import {
|
|
20
17
|
pageDelayFromFlags,
|
|
21
18
|
streamAll
|
|
22
19
|
} from "./chunk-EEMJDJ4W.js";
|
|
20
|
+
import {
|
|
21
|
+
buildPreviewOutput
|
|
22
|
+
} from "./chunk-R3VLWLVV.js";
|
|
23
23
|
import {
|
|
24
24
|
createClient,
|
|
25
25
|
renderError,
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
BinaryOutputError,
|
|
12
12
|
writeBinaryOutput
|
|
13
13
|
} from "./chunk-UWO2D4HW.js";
|
|
14
|
-
import {
|
|
15
|
-
buildPreviewOutput
|
|
16
|
-
} from "./chunk-R3VLWLVV.js";
|
|
17
14
|
import {
|
|
18
15
|
normalizeChatId,
|
|
19
16
|
resolveIdentifier
|
|
20
17
|
} from "./chunk-DMQZEPQE.js";
|
|
18
|
+
import {
|
|
19
|
+
buildPreviewOutput
|
|
20
|
+
} from "./chunk-R3VLWLVV.js";
|
|
21
21
|
import {
|
|
22
22
|
createClient,
|
|
23
23
|
renderError,
|
|
@@ -693,15 +693,18 @@ var messageCommand = defineCommand({
|
|
|
693
693
|
await runMessageSend(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
694
694
|
}
|
|
695
695
|
});
|
|
696
|
+
|
|
696
697
|
export {
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
698
|
+
sentAsNotice,
|
|
699
|
+
willSendAsNotice,
|
|
700
|
+
runMessageNew,
|
|
701
|
+
runMessageSend,
|
|
701
702
|
runMessageGet,
|
|
703
|
+
runMessageEdit,
|
|
704
|
+
runMessageDelete,
|
|
705
|
+
runMessageReact,
|
|
706
|
+
runMessageAttachment,
|
|
702
707
|
runMessageInMail,
|
|
703
708
|
runMessageInMailBalance,
|
|
704
|
-
|
|
705
|
-
runMessageReact,
|
|
706
|
-
runMessageSend
|
|
709
|
+
messageCommand
|
|
707
710
|
};
|
|
@@ -255,6 +255,32 @@ function slimCompany(data) {
|
|
|
255
255
|
follower_count: d["follower_count"] ?? null
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
|
+
function encodeInviteToken(token) {
|
|
259
|
+
if (typeof token !== "string" || token.length === 0) return token;
|
|
260
|
+
return Buffer.from(token, "utf8").toString("base64");
|
|
261
|
+
}
|
|
262
|
+
function reencodeInviteTokenItem(item) {
|
|
263
|
+
if (!("invite_token" in item)) return item;
|
|
264
|
+
return { ...item, invite_token: encodeInviteToken(item["invite_token"]) };
|
|
265
|
+
}
|
|
266
|
+
function reencodeInvitableFollowers(data) {
|
|
267
|
+
const d = data !== null && data !== void 0 && typeof data === "object" ? data : {};
|
|
268
|
+
const items = Array.isArray(d["items"]) ? d["items"].map(reencodeInviteTokenItem) : [];
|
|
269
|
+
return { ...d, items };
|
|
270
|
+
}
|
|
271
|
+
function slimCompanyInvitableFollowerItem(item) {
|
|
272
|
+
return {
|
|
273
|
+
object: item["object"] ?? null,
|
|
274
|
+
id: item["id"] ?? null,
|
|
275
|
+
profile_urn: item["profile_urn"] ?? null,
|
|
276
|
+
invite_token: item["invite_token"] ?? null
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
function slimCompanyInvitableFollowers(data) {
|
|
280
|
+
const d = data !== null && data !== void 0 && typeof data === "object" ? data : {};
|
|
281
|
+
const items = Array.isArray(d["items"]) ? d["items"].map(slimCompanyInvitableFollowerItem) : [];
|
|
282
|
+
return { ...d, items };
|
|
283
|
+
}
|
|
258
284
|
|
|
259
285
|
export {
|
|
260
286
|
slimProfileMe,
|
|
@@ -275,5 +301,8 @@ export {
|
|
|
275
301
|
slimAccountList,
|
|
276
302
|
slimAccountGet,
|
|
277
303
|
slimJob,
|
|
278
|
-
slimCompany
|
|
304
|
+
slimCompany,
|
|
305
|
+
reencodeInviteTokenItem,
|
|
306
|
+
reencodeInvitableFollowers,
|
|
307
|
+
slimCompanyInvitableFollowers
|
|
279
308
|
};
|
package/dist/cli.js
CHANGED
|
@@ -255,20 +255,20 @@ var main = defineCommand({
|
|
|
255
255
|
// ---------------------------------------------------------------------------
|
|
256
256
|
// Noun groups — lazy-loaded on first invocation.
|
|
257
257
|
// ---------------------------------------------------------------------------
|
|
258
|
-
profile: () => import("./profile-
|
|
259
|
-
company: () => import("./company-
|
|
260
|
-
job: () => import("./job-
|
|
261
|
-
connect: () => import("./connect-
|
|
262
|
-
search: () => import("./search-
|
|
263
|
-
inbox: () => import("./inbox-
|
|
258
|
+
profile: () => import("./profile-XWSRUYRW.js").then((m) => m.profileCommand),
|
|
259
|
+
company: () => import("./company-BC72KZ5G.js").then((m) => m.companyCommand),
|
|
260
|
+
job: () => import("./job-EIXBJXLW.js").then((m) => m.jobCommand),
|
|
261
|
+
connect: () => import("./connect-6PU7QCOL.js").then((m) => m.connectCommand),
|
|
262
|
+
search: () => import("./search-ZQUKLQ6T.js").then((m) => m.searchCommand),
|
|
263
|
+
inbox: () => import("./inbox-DRJ6ENXC.js").then((m) => m.inboxCommand),
|
|
264
264
|
inboxes: () => import("./inboxes-MTPWLP5F.js").then((m) => m.inboxesCommand),
|
|
265
|
-
message: () => import("./message-
|
|
266
|
-
post: () => import("./post-
|
|
267
|
-
comment: () => import("./comment-
|
|
268
|
-
account: () => import("./account-
|
|
269
|
-
webhook: () => import("./webhook-
|
|
270
|
-
"sales-nav": () => import("./sales-nav-
|
|
271
|
-
recruiter: () => import("./recruiter-
|
|
265
|
+
message: () => import("./message-UWMRE2SJ.js").then((m) => m.messageCommand),
|
|
266
|
+
post: () => import("./post-N3GQDIQJ.js").then((m) => m.postCommand),
|
|
267
|
+
comment: () => import("./comment-VT6PO4MN.js").then((m) => m.commentCommand),
|
|
268
|
+
account: () => import("./account-EGJJNBXW.js").then((m) => m.accountCommand),
|
|
269
|
+
webhook: () => import("./webhook-QFSZN3P2.js").then((m) => m.webhookCommand),
|
|
270
|
+
"sales-nav": () => import("./sales-nav-TMXWDKSE.js").then((m) => m.salesNavCommand),
|
|
271
|
+
recruiter: () => import("./recruiter-MVPSTH2V.js").then((m) => m.recruiterCommand)
|
|
272
272
|
},
|
|
273
273
|
async run() {
|
|
274
274
|
const { runMain } = await import("citty");
|
|
@@ -1,17 +1,36 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
sentAsNotice,
|
|
4
|
+
willSendAsNotice
|
|
5
|
+
} from "./chunk-KVV6LZ7E.js";
|
|
6
|
+
import {
|
|
7
|
+
resolveTextOrStdin
|
|
8
|
+
} from "./chunk-U7Y4EXHT.js";
|
|
9
|
+
import {
|
|
10
|
+
AttachError,
|
|
11
|
+
readAttachment,
|
|
12
|
+
toAttachmentPayload
|
|
13
|
+
} from "./chunk-BGZW6B7G.js";
|
|
5
14
|
import {
|
|
15
|
+
reencodeInvitableFollowers,
|
|
16
|
+
reencodeInviteTokenItem,
|
|
6
17
|
slimCompany,
|
|
18
|
+
slimCompanyInvitableFollowers,
|
|
7
19
|
slimSearchJobs,
|
|
8
20
|
slimSearchPeople,
|
|
9
21
|
slimSearchPosts
|
|
10
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ROULHEFW.js";
|
|
11
23
|
import {
|
|
12
24
|
pageDelayFromFlags,
|
|
13
25
|
streamAll
|
|
14
26
|
} from "./chunk-EEMJDJ4W.js";
|
|
27
|
+
import "./chunk-UWO2D4HW.js";
|
|
28
|
+
import {
|
|
29
|
+
resolveIdentifier
|
|
30
|
+
} from "./chunk-DMQZEPQE.js";
|
|
31
|
+
import {
|
|
32
|
+
buildPreviewOutput
|
|
33
|
+
} from "./chunk-R3VLWLVV.js";
|
|
15
34
|
import {
|
|
16
35
|
createClient,
|
|
17
36
|
renderError,
|
|
@@ -20,7 +39,8 @@ import {
|
|
|
20
39
|
resolveEffectiveConfig
|
|
21
40
|
} from "./chunk-M33MI53G.js";
|
|
22
41
|
import {
|
|
23
|
-
GLOBAL_FLAGS
|
|
42
|
+
GLOBAL_FLAGS,
|
|
43
|
+
WRITE_FLAGS
|
|
24
44
|
} from "./chunk-TMU3CSPR.js";
|
|
25
45
|
|
|
26
46
|
// src/commands/company.ts
|
|
@@ -52,6 +72,14 @@ function resolveOutputOpts(flags) {
|
|
|
52
72
|
verbose: flags.verbose ?? false
|
|
53
73
|
};
|
|
54
74
|
}
|
|
75
|
+
function normalizeInviteeIds(invitee) {
|
|
76
|
+
if (!invitee) return [];
|
|
77
|
+
return Array.isArray(invitee) ? invitee : [invitee];
|
|
78
|
+
}
|
|
79
|
+
function normalizeAttachPaths(attach) {
|
|
80
|
+
if (!attach) return [];
|
|
81
|
+
return Array.isArray(attach) ? attach : [attach];
|
|
82
|
+
}
|
|
55
83
|
async function resolveCompanyId(ns, raw) {
|
|
56
84
|
const normalized = resolveIdentifier(raw);
|
|
57
85
|
if (/^\d+$/.test(normalized)) return normalized;
|
|
@@ -176,6 +204,114 @@ async function runCompanyJobs(client, flags, out) {
|
|
|
176
204
|
await handleSdkError(err, outOpts, out);
|
|
177
205
|
}
|
|
178
206
|
}
|
|
207
|
+
async function runCompanyInvitableFollowers(client, flags, out) {
|
|
208
|
+
rejectPreviewOnRead(flags.preview, out);
|
|
209
|
+
const accountId = requireAccount(flags.account, out);
|
|
210
|
+
const ns = client.account(accountId);
|
|
211
|
+
const outOpts = resolveOutputOpts(flags);
|
|
212
|
+
const params = {};
|
|
213
|
+
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
214
|
+
if (flags.cursor) params["cursor"] = flags.cursor;
|
|
215
|
+
try {
|
|
216
|
+
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
217
|
+
if (flags.all) {
|
|
218
|
+
const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
|
|
219
|
+
const fn = (p) => ns.companies.invitableFollowers(identifier, p);
|
|
220
|
+
for await (const item of streamAll(fn, params, {
|
|
221
|
+
maxPages,
|
|
222
|
+
out,
|
|
223
|
+
pageDelayMs: pageDelayFromFlags(flags)
|
|
224
|
+
})) {
|
|
225
|
+
out.stdout.write(JSON.stringify(reencodeInviteTokenItem(item)) + "\n");
|
|
226
|
+
}
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
const result = await ns.companies.invitableFollowers(identifier, params);
|
|
230
|
+
const safeResult = reencodeInvitableFollowers(result);
|
|
231
|
+
renderSuccess(safeResult, { ...outOpts, slim: slimCompanyInvitableFollowers }, out);
|
|
232
|
+
} catch (err) {
|
|
233
|
+
await handleSdkError(err, outOpts, out);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
async function runCompanyFollowInvite(client, flags, out) {
|
|
237
|
+
const accountId = requireAccount(flags.account, out);
|
|
238
|
+
const ns = client.account(accountId);
|
|
239
|
+
const outOpts = resolveOutputOpts(flags);
|
|
240
|
+
const inviteeIds = normalizeInviteeIds(flags.invitee);
|
|
241
|
+
if (inviteeIds.length === 0) {
|
|
242
|
+
out.stderr.write("error: at least one --invitee is required.\n");
|
|
243
|
+
process.exit(2);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
try {
|
|
247
|
+
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
248
|
+
const body = { invitee_ids: inviteeIds };
|
|
249
|
+
if (flags.preview) {
|
|
250
|
+
const preview = buildPreviewOutput({
|
|
251
|
+
method: "companies.followInvite",
|
|
252
|
+
args: { identifier },
|
|
253
|
+
body,
|
|
254
|
+
account: accountId
|
|
255
|
+
});
|
|
256
|
+
out.stdout.write(JSON.stringify(preview) + "\n");
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
const result = await ns.companies.followInvite(identifier, body);
|
|
260
|
+
renderSuccess(result, outOpts, out);
|
|
261
|
+
} catch (err) {
|
|
262
|
+
await handleSdkError(err, outOpts, out);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
async function runCompanyReply(client, flags, out, _readStdin) {
|
|
266
|
+
const accountId = requireAccount(flags.account, out);
|
|
267
|
+
const ns = client.account(accountId);
|
|
268
|
+
const outOpts = resolveOutputOpts(flags);
|
|
269
|
+
const chatId = flags.chatId ?? "";
|
|
270
|
+
const rawText = flags.text ?? "";
|
|
271
|
+
const attachPaths = normalizeAttachPaths(flags.attach);
|
|
272
|
+
const text = await resolveTextOrStdin(rawText, out, _readStdin);
|
|
273
|
+
let attachBuffers = [];
|
|
274
|
+
try {
|
|
275
|
+
attachBuffers = await Promise.all(attachPaths.map((p) => readAttachment(p)));
|
|
276
|
+
} catch (err) {
|
|
277
|
+
if (err instanceof AttachError) {
|
|
278
|
+
out.stderr.write(`error: ${err.message}
|
|
279
|
+
`);
|
|
280
|
+
process.exit(err.exitCode);
|
|
281
|
+
}
|
|
282
|
+
throw err;
|
|
283
|
+
}
|
|
284
|
+
try {
|
|
285
|
+
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
286
|
+
if (flags.preview) {
|
|
287
|
+
const preview = buildPreviewOutput({
|
|
288
|
+
method: "companies.sendMessage",
|
|
289
|
+
args: { identifier, chat_id: chatId },
|
|
290
|
+
body: { text },
|
|
291
|
+
account: accountId,
|
|
292
|
+
attachments: attachBuffers.map((buf, i) => ({
|
|
293
|
+
name: attachPaths[i] ? attachPaths[i].split("/").pop() ?? attachPaths[i] : `attachment_${i}`,
|
|
294
|
+
buffer: buf
|
|
295
|
+
}))
|
|
296
|
+
});
|
|
297
|
+
out.stdout.write(JSON.stringify(preview) + "\n");
|
|
298
|
+
const willSendAs = willSendAsNotice(chatId);
|
|
299
|
+
if (willSendAs) out.stderr.write(willSendAs);
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
const attachmentPayloads = attachBuffers.map((buf, i) => toAttachmentPayload(attachPaths[i], buf));
|
|
303
|
+
const body = {
|
|
304
|
+
text,
|
|
305
|
+
...attachmentPayloads.length > 0 ? { attachments: attachmentPayloads } : {}
|
|
306
|
+
};
|
|
307
|
+
const result = await ns.companies.sendMessage(identifier, chatId, body);
|
|
308
|
+
renderSuccess(result, outOpts, out);
|
|
309
|
+
const notice = sentAsNotice(result?.["sent_as"]);
|
|
310
|
+
if (notice) out.stderr.write(notice);
|
|
311
|
+
} catch (err) {
|
|
312
|
+
await handleSdkError(err, outOpts, out);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
179
315
|
var companyEmployeesCommand = defineCommand({
|
|
180
316
|
meta: { name: "employees", description: "List people who currently work at the company." },
|
|
181
317
|
args: {
|
|
@@ -251,6 +387,97 @@ var companyJobsCommand = defineCommand({
|
|
|
251
387
|
await runCompanyJobs(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
252
388
|
}
|
|
253
389
|
});
|
|
390
|
+
var companyInvitableFollowersCommand = defineCommand({
|
|
391
|
+
meta: {
|
|
392
|
+
name: "invitable-followers",
|
|
393
|
+
description: "List the account's 1st-degree connections who are eligible to be invited to follow the company page. This is the read that seeds `company follow-invite`. Items carry no name or headline (a wire limitation), so hydrate a candidate via `profile <id>` before deciding who to invite. `invite_token` is always returned as base64 (the raw value can carry binary bytes unsafe to print)."
|
|
394
|
+
},
|
|
395
|
+
args: {
|
|
396
|
+
...GLOBAL_FLAGS,
|
|
397
|
+
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), resolved to the numeric id first." }
|
|
398
|
+
},
|
|
399
|
+
async run({ args }) {
|
|
400
|
+
const flags = args;
|
|
401
|
+
const cfg = await resolveEffectiveConfig({
|
|
402
|
+
apiKey: flags["api-key"],
|
|
403
|
+
baseUrl: flags["base-url"],
|
|
404
|
+
timeout: flags.timeout,
|
|
405
|
+
account: flags.account,
|
|
406
|
+
profile: flags.profile
|
|
407
|
+
});
|
|
408
|
+
if (!cfg.apiKey) {
|
|
409
|
+
process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
|
|
410
|
+
process.exit(3);
|
|
411
|
+
}
|
|
412
|
+
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
413
|
+
const out = buildOutputStreams();
|
|
414
|
+
await runCompanyInvitableFollowers(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
var companyFollowInviteCommand = defineCommand({
|
|
418
|
+
meta: {
|
|
419
|
+
name: "follow-invite",
|
|
420
|
+
description: "Invite the account's 1st-degree connections to follow the administered company page. Write, admin-gated (the account must administer the page with invite rights). Pass the AC\u2026 member ids from `company invitable-followers`, one --invitee per invitee. All-or-nothing: for an all-valid request you get one outcome per invitee, in request order (invited/already_invited/ineligible/not_found); if any invitee id is invalid the whole request rejects with a 404, not a partial result. Re-inviting an already-invited member is a safe no-op (the same invitation id, never a duplicate)."
|
|
421
|
+
},
|
|
422
|
+
args: {
|
|
423
|
+
...WRITE_FLAGS,
|
|
424
|
+
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), resolved to the numeric id first, including under --preview." },
|
|
425
|
+
invitee: {
|
|
426
|
+
type: "string",
|
|
427
|
+
description: "AC\u2026 member id to invite (from `company invitable-followers`). Repeatable, at least one required, max 50 per request."
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
async run({ args }) {
|
|
431
|
+
const flags = args;
|
|
432
|
+
const cfg = await resolveEffectiveConfig({
|
|
433
|
+
apiKey: flags["api-key"],
|
|
434
|
+
baseUrl: flags["base-url"],
|
|
435
|
+
timeout: flags.timeout,
|
|
436
|
+
account: flags.account,
|
|
437
|
+
profile: flags.profile
|
|
438
|
+
});
|
|
439
|
+
if (!cfg.apiKey) {
|
|
440
|
+
process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
|
|
441
|
+
process.exit(3);
|
|
442
|
+
}
|
|
443
|
+
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
444
|
+
const out = buildOutputStreams();
|
|
445
|
+
await runCompanyFollowInvite(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
var companyReplyCommand = defineCommand({
|
|
449
|
+
meta: {
|
|
450
|
+
name: "reply",
|
|
451
|
+
description: "Reply to a company-inbox conversation, as the page (write, admin-gated: the account must administer the page). Requires a COMPANY_ chat id from `inboxes chats`, not the 2-\u2026 id `company` reads return (the API rejects a non-COMPANY_ id with a guiding 400 naming the fix). Reply-only, this cannot start a new conversation on the page's behalf. See also: `inboxes chats` and `message send` (the personal equivalent, which also accepts a COMPANY_ chat id)."
|
|
452
|
+
},
|
|
453
|
+
args: {
|
|
454
|
+
...WRITE_FLAGS,
|
|
455
|
+
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), resolved to the numeric id first, including under --preview." },
|
|
456
|
+
chatId: {
|
|
457
|
+
type: "positional",
|
|
458
|
+
description: "COMPANY_ chat id (from `inboxes chats`), passed through verbatim, no client-side check."
|
|
459
|
+
},
|
|
460
|
+
text: { type: "positional", description: "Reply text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
|
|
461
|
+
attach: { type: "string", description: "File to attach (repeatable)." }
|
|
462
|
+
},
|
|
463
|
+
async run({ args }) {
|
|
464
|
+
const flags = args;
|
|
465
|
+
const cfg = await resolveEffectiveConfig({
|
|
466
|
+
apiKey: flags["api-key"],
|
|
467
|
+
baseUrl: flags["base-url"],
|
|
468
|
+
timeout: flags.timeout,
|
|
469
|
+
account: flags.account,
|
|
470
|
+
profile: flags.profile
|
|
471
|
+
});
|
|
472
|
+
if (!cfg.apiKey) {
|
|
473
|
+
process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
|
|
474
|
+
process.exit(3);
|
|
475
|
+
}
|
|
476
|
+
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
477
|
+
const out = buildOutputStreams();
|
|
478
|
+
await runCompanyReply(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
479
|
+
}
|
|
480
|
+
});
|
|
254
481
|
var companyCommand = defineCommand({
|
|
255
482
|
meta: { name: "company", description: "Fetch a company profile by URL, slug, or numeric id, and its sub-resources." },
|
|
256
483
|
args: {
|
|
@@ -261,7 +488,10 @@ var companyCommand = defineCommand({
|
|
|
261
488
|
subCommands: {
|
|
262
489
|
employees: companyEmployeesCommand,
|
|
263
490
|
posts: companyPostsCommand,
|
|
264
|
-
jobs: companyJobsCommand
|
|
491
|
+
jobs: companyJobsCommand,
|
|
492
|
+
"invitable-followers": companyInvitableFollowersCommand,
|
|
493
|
+
"follow-invite": companyFollowInviteCommand,
|
|
494
|
+
reply: companyReplyCommand
|
|
265
495
|
},
|
|
266
496
|
async run({ args }) {
|
|
267
497
|
const flags = args;
|
|
@@ -284,7 +514,10 @@ var companyCommand = defineCommand({
|
|
|
284
514
|
export {
|
|
285
515
|
companyCommand,
|
|
286
516
|
runCompanyEmployees,
|
|
517
|
+
runCompanyFollowInvite,
|
|
287
518
|
runCompanyGet,
|
|
519
|
+
runCompanyInvitableFollowers,
|
|
288
520
|
runCompanyJobs,
|
|
289
|
-
runCompanyPosts
|
|
521
|
+
runCompanyPosts,
|
|
522
|
+
runCompanyReply
|
|
290
523
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
buildPreviewOutput
|
|
4
|
-
} from "./chunk-R3VLWLVV.js";
|
|
5
|
-
import {
|
|
6
|
-
resolveIdentifier
|
|
7
|
-
} from "./chunk-DMQZEPQE.js";
|
|
8
2
|
import {
|
|
9
3
|
slimInviteReceived,
|
|
10
4
|
slimInviteReceivedItem,
|
|
11
5
|
slimInviteSent,
|
|
12
6
|
slimInviteSentItem
|
|
13
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ROULHEFW.js";
|
|
14
8
|
import {
|
|
15
9
|
pageDelayFromFlags,
|
|
16
10
|
streamAll
|
|
17
11
|
} from "./chunk-EEMJDJ4W.js";
|
|
12
|
+
import {
|
|
13
|
+
resolveIdentifier
|
|
14
|
+
} from "./chunk-DMQZEPQE.js";
|
|
15
|
+
import {
|
|
16
|
+
buildPreviewOutput
|
|
17
|
+
} from "./chunk-R3VLWLVV.js";
|
|
18
18
|
import {
|
|
19
19
|
createClient,
|
|
20
20
|
renderError,
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
BinaryOutputError,
|
|
4
|
-
writeBinaryOutput
|
|
5
|
-
} from "./chunk-UWO2D4HW.js";
|
|
6
|
-
import {
|
|
7
|
-
buildPreviewOutput
|
|
8
|
-
} from "./chunk-R3VLWLVV.js";
|
|
9
|
-
import {
|
|
10
|
-
resolveJobIdentifier
|
|
11
|
-
} from "./chunk-DMQZEPQE.js";
|
|
12
2
|
import {
|
|
13
3
|
slimJob
|
|
14
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ROULHEFW.js";
|
|
15
5
|
import {
|
|
16
6
|
DEFAULT_PAGE_DELAY_MS,
|
|
17
7
|
ndjsonModeNotice,
|
|
18
8
|
pageDelayFromFlags,
|
|
19
9
|
streamAll
|
|
20
10
|
} from "./chunk-EEMJDJ4W.js";
|
|
11
|
+
import {
|
|
12
|
+
BinaryOutputError,
|
|
13
|
+
writeBinaryOutput
|
|
14
|
+
} from "./chunk-UWO2D4HW.js";
|
|
15
|
+
import {
|
|
16
|
+
resolveJobIdentifier
|
|
17
|
+
} from "./chunk-DMQZEPQE.js";
|
|
18
|
+
import {
|
|
19
|
+
buildPreviewOutput
|
|
20
|
+
} from "./chunk-R3VLWLVV.js";
|
|
21
21
|
import {
|
|
22
22
|
createClient,
|
|
23
23
|
renderError,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
messageCommand,
|
|
4
|
+
runMessageAttachment,
|
|
5
|
+
runMessageDelete,
|
|
6
|
+
runMessageEdit,
|
|
7
|
+
runMessageGet,
|
|
8
|
+
runMessageInMail,
|
|
9
|
+
runMessageInMailBalance,
|
|
10
|
+
runMessageNew,
|
|
11
|
+
runMessageReact,
|
|
12
|
+
runMessageSend,
|
|
13
|
+
sentAsNotice,
|
|
14
|
+
willSendAsNotice
|
|
15
|
+
} from "./chunk-KVV6LZ7E.js";
|
|
16
|
+
import "./chunk-U7Y4EXHT.js";
|
|
17
|
+
import "./chunk-BGZW6B7G.js";
|
|
18
|
+
import "./chunk-UWO2D4HW.js";
|
|
19
|
+
import "./chunk-DMQZEPQE.js";
|
|
20
|
+
import "./chunk-R3VLWLVV.js";
|
|
21
|
+
import "./chunk-M33MI53G.js";
|
|
22
|
+
import "./chunk-TMU3CSPR.js";
|
|
23
|
+
export {
|
|
24
|
+
messageCommand,
|
|
25
|
+
runMessageAttachment,
|
|
26
|
+
runMessageDelete,
|
|
27
|
+
runMessageEdit,
|
|
28
|
+
runMessageGet,
|
|
29
|
+
runMessageInMail,
|
|
30
|
+
runMessageInMailBalance,
|
|
31
|
+
runMessageNew,
|
|
32
|
+
runMessageReact,
|
|
33
|
+
runMessageSend,
|
|
34
|
+
sentAsNotice,
|
|
35
|
+
willSendAsNotice
|
|
36
|
+
};
|
|
@@ -8,20 +8,20 @@ import {
|
|
|
8
8
|
readAttachment,
|
|
9
9
|
toAttachmentPayload
|
|
10
10
|
} from "./chunk-BGZW6B7G.js";
|
|
11
|
-
import {
|
|
12
|
-
buildPreviewOutput
|
|
13
|
-
} from "./chunk-R3VLWLVV.js";
|
|
14
|
-
import {
|
|
15
|
-
resolveIdentifier
|
|
16
|
-
} from "./chunk-DMQZEPQE.js";
|
|
17
11
|
import {
|
|
18
12
|
slimProfile,
|
|
19
13
|
slimProfileMe
|
|
20
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ROULHEFW.js";
|
|
21
15
|
import {
|
|
22
16
|
pageDelayFromFlags,
|
|
23
17
|
streamAll
|
|
24
18
|
} from "./chunk-EEMJDJ4W.js";
|
|
19
|
+
import {
|
|
20
|
+
resolveIdentifier
|
|
21
|
+
} from "./chunk-DMQZEPQE.js";
|
|
22
|
+
import {
|
|
23
|
+
buildPreviewOutput
|
|
24
|
+
} from "./chunk-R3VLWLVV.js";
|
|
25
25
|
import {
|
|
26
26
|
createClient,
|
|
27
27
|
renderError,
|
|
@@ -9,24 +9,24 @@ import {
|
|
|
9
9
|
readAttachment,
|
|
10
10
|
toAttachmentPayload
|
|
11
11
|
} from "./chunk-BGZW6B7G.js";
|
|
12
|
+
import {
|
|
13
|
+
slimJob
|
|
14
|
+
} from "./chunk-ROULHEFW.js";
|
|
15
|
+
import {
|
|
16
|
+
pageDelayFromFlags,
|
|
17
|
+
streamAll
|
|
18
|
+
} from "./chunk-EEMJDJ4W.js";
|
|
12
19
|
import {
|
|
13
20
|
BinaryOutputError,
|
|
14
21
|
writeBinaryOutput
|
|
15
22
|
} from "./chunk-UWO2D4HW.js";
|
|
16
|
-
import {
|
|
17
|
-
buildPreviewOutput
|
|
18
|
-
} from "./chunk-R3VLWLVV.js";
|
|
19
23
|
import {
|
|
20
24
|
resolveIdentifier,
|
|
21
25
|
resolveJobIdentifier
|
|
22
26
|
} from "./chunk-DMQZEPQE.js";
|
|
23
27
|
import {
|
|
24
|
-
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import {
|
|
27
|
-
pageDelayFromFlags,
|
|
28
|
-
streamAll
|
|
29
|
-
} from "./chunk-EEMJDJ4W.js";
|
|
28
|
+
buildPreviewOutput
|
|
29
|
+
} from "./chunk-R3VLWLVV.js";
|
|
30
30
|
import {
|
|
31
31
|
createClient,
|
|
32
32
|
renderError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@curviate/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Official command-line interface for the Curviate API.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"clean": "rm -rf dist *.tsbuildinfo"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@curviate/sdk": "^0.
|
|
44
|
+
"@curviate/sdk": "^0.18.0",
|
|
45
45
|
"citty": "^0.1.6",
|
|
46
46
|
"open": "^10.1.0"
|
|
47
47
|
},
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
resolveTextOrStdin
|
|
4
|
-
} from "./chunk-U7Y4EXHT.js";
|
|
5
2
|
import {
|
|
6
3
|
resolveMemberOrMeProviderId
|
|
7
4
|
} from "./chunk-QJZ3LWOX.js";
|
|
5
|
+
import {
|
|
6
|
+
resolveTextOrStdin
|
|
7
|
+
} from "./chunk-U7Y4EXHT.js";
|
|
8
8
|
import {
|
|
9
9
|
AttachError,
|
|
10
10
|
describeAttachment,
|
|
11
11
|
readAttachment,
|
|
12
12
|
toAttachmentPayload
|
|
13
13
|
} from "./chunk-BGZW6B7G.js";
|
|
14
|
-
import {
|
|
15
|
-
buildPreviewOutput
|
|
16
|
-
} from "./chunk-R3VLWLVV.js";
|
|
17
|
-
import "./chunk-DMQZEPQE.js";
|
|
18
14
|
import {
|
|
19
15
|
pageDelayFromFlags,
|
|
20
16
|
streamAll
|
|
21
17
|
} from "./chunk-EEMJDJ4W.js";
|
|
18
|
+
import "./chunk-DMQZEPQE.js";
|
|
19
|
+
import {
|
|
20
|
+
buildPreviewOutput
|
|
21
|
+
} from "./chunk-R3VLWLVV.js";
|
|
22
22
|
import {
|
|
23
23
|
createClient,
|
|
24
24
|
renderError,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
pageDelayFromFlags,
|
|
4
|
+
streamAll
|
|
5
|
+
} from "./chunk-EEMJDJ4W.js";
|
|
5
6
|
import {
|
|
6
7
|
normalizeChatId
|
|
7
8
|
} from "./chunk-DMQZEPQE.js";
|
|
8
9
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} from "./chunk-EEMJDJ4W.js";
|
|
10
|
+
buildPreviewOutput
|
|
11
|
+
} from "./chunk-R3VLWLVV.js";
|
|
12
12
|
import {
|
|
13
13
|
createClient,
|
|
14
14
|
renderError,
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
resolveTextOrStdin
|
|
4
|
-
} from "./chunk-U7Y4EXHT.js";
|
|
5
2
|
import {
|
|
6
3
|
resolveMemberOrMeProviderId
|
|
7
4
|
} from "./chunk-QJZ3LWOX.js";
|
|
5
|
+
import {
|
|
6
|
+
resolveTextOrStdin
|
|
7
|
+
} from "./chunk-U7Y4EXHT.js";
|
|
8
8
|
import {
|
|
9
9
|
AttachError,
|
|
10
10
|
readAttachment,
|
|
11
11
|
toAttachmentPayload
|
|
12
12
|
} from "./chunk-BGZW6B7G.js";
|
|
13
|
-
import {
|
|
14
|
-
buildPreviewOutput
|
|
15
|
-
} from "./chunk-R3VLWLVV.js";
|
|
16
|
-
import "./chunk-DMQZEPQE.js";
|
|
17
13
|
import {
|
|
18
14
|
pageDelayFromFlags,
|
|
19
15
|
streamAll
|
|
20
16
|
} from "./chunk-EEMJDJ4W.js";
|
|
17
|
+
import "./chunk-DMQZEPQE.js";
|
|
18
|
+
import {
|
|
19
|
+
buildPreviewOutput
|
|
20
|
+
} from "./chunk-R3VLWLVV.js";
|
|
21
21
|
import {
|
|
22
22
|
createClient,
|
|
23
23
|
renderError,
|
|
@@ -11,15 +11,15 @@ import {
|
|
|
11
11
|
toAttachmentPayload
|
|
12
12
|
} from "./chunk-BGZW6B7G.js";
|
|
13
13
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
pageDelayFromFlags,
|
|
15
|
+
streamAll
|
|
16
|
+
} from "./chunk-EEMJDJ4W.js";
|
|
16
17
|
import {
|
|
17
18
|
resolveIdentifier
|
|
18
19
|
} from "./chunk-DMQZEPQE.js";
|
|
19
20
|
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} from "./chunk-EEMJDJ4W.js";
|
|
21
|
+
buildPreviewOutput
|
|
22
|
+
} from "./chunk-R3VLWLVV.js";
|
|
23
23
|
import {
|
|
24
24
|
createClient,
|
|
25
25
|
renderError,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
buildPreviewOutput
|
|
4
|
-
} from "./chunk-R3VLWLVV.js";
|
|
5
2
|
import {
|
|
6
3
|
pageDelayFromFlags,
|
|
7
4
|
streamAll
|
|
8
5
|
} from "./chunk-EEMJDJ4W.js";
|
|
6
|
+
import {
|
|
7
|
+
buildPreviewOutput
|
|
8
|
+
} from "./chunk-R3VLWLVV.js";
|
|
9
9
|
import {
|
|
10
10
|
createClient,
|
|
11
11
|
renderError,
|