@curviate/cli 0.18.1 → 0.20.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 +123 -0
- package/dist/{account-EGJJNBXW.js → account-2SOSCEB6.js} +26 -26
- package/dist/{chunk-TMU3CSPR.js → chunk-DW2HCRXJ.js} +1 -1
- package/dist/{chunk-M33MI53G.js → chunk-HDQUEFD2.js} +1 -1
- package/dist/chunk-HOQ7EUHJ.js +50 -0
- package/dist/{chunk-KVV6LZ7E.js → chunk-IGCQNDIG.js} +53 -17
- package/dist/cli.js +33 -33
- package/dist/{comment-VT6PO4MN.js → comment-AXDINBPS.js} +3 -3
- package/dist/{company-BVXX4FGX.js → company-BX4VDXZX.js} +398 -16
- package/dist/{config-P5CPF5WC.js → config-3O4N2XSH.js} +2 -2
- package/dist/{connect-6PU7QCOL.js → connect-KWOJKCIB.js} +36 -15
- package/dist/feed-4ROKUBG5.js +127 -0
- package/dist/group-L7TQEEFN.js +236 -0
- package/dist/{inbox-DRJ6ENXC.js → inbox-GMGZVDTQ.js} +69 -11
- package/dist/{inboxes-MTPWLP5F.js → inboxes-YVYLSM5W.js} +4 -4
- package/dist/{job-EIXBJXLW.js → job-TYBA2DUQ.js} +7 -7
- package/dist/{login-GDLWR542.js → login-W7NCDZOQ.js} +2 -2
- package/dist/{message-UWMRE2SJ.js → message-C6FV6JH6.js} +6 -3
- package/dist/notification-45XFT3S4.js +219 -0
- package/dist/{post-N3GQDIQJ.js → post-RETV3WUG.js} +102 -9
- package/dist/{profile-XWSRUYRW.js → profile-A2TWF4HB.js} +121 -15
- package/dist/{recruiter-MVPSTH2V.js → recruiter-FQAKY6Z2.js} +30 -30
- package/dist/{sales-nav-TMXWDKSE.js → sales-nav-SSJIZUNB.js} +16 -16
- package/dist/{search-ZQUKLQ6T.js → search-DH6BJFQC.js} +213 -12
- package/dist/{webhook-QFSZN3P2.js → webhook-LED6AKF3.js} +50 -19
- package/package.json +4 -4
package/dist/cli.js
CHANGED
|
@@ -11,40 +11,37 @@ import { createRequire } from "module";
|
|
|
11
11
|
import { runCommand } from "citty";
|
|
12
12
|
var REMOVED_COMMANDS = {
|
|
13
13
|
post: {
|
|
14
|
-
list: "`post list` was removed
|
|
15
|
-
comment: "post comments are their own group now
|
|
16
|
-
comments: "post comments are their own group now
|
|
14
|
+
list: "`post list` was removed. Use `post user-posts <user_id>` (accepts `me`).",
|
|
15
|
+
comment: "post comments are their own group now. Use `comment add <post_id> <text>`.",
|
|
16
|
+
comments: "post comments are their own group now. Use `comment list <post_id>`."
|
|
17
17
|
},
|
|
18
18
|
connect: {
|
|
19
|
-
respond: "`connect respond` was split
|
|
19
|
+
respond: "`connect respond` was split. Use `connect accept <id>` or `connect decline <id>`."
|
|
20
20
|
},
|
|
21
21
|
profile: {
|
|
22
|
-
connections: "`profile connections` was renamed
|
|
22
|
+
connections: "`profile connections` was renamed. Use `profile relations`."
|
|
23
23
|
},
|
|
24
24
|
account: {
|
|
25
|
-
"connect-link": "`account connect-link` was removed
|
|
26
|
-
"reconnect-link": "`account reconnect-link` was removed
|
|
27
|
-
reconnect: "`account reconnect` was removed
|
|
25
|
+
"connect-link": "`account connect-link` was removed. Use `account link [--account-id <id>]`.",
|
|
26
|
+
"reconnect-link": "`account reconnect-link` was removed. Use `account link [--account-id <id>]`.",
|
|
27
|
+
reconnect: "`account reconnect` was removed. Use `account link [--account-id <id>]`."
|
|
28
28
|
},
|
|
29
29
|
inbox: {
|
|
30
|
-
sync: "`inbox sync` was removed
|
|
31
|
-
"sync-chat": "`inbox sync-chat` was removed
|
|
30
|
+
sync: "`inbox sync` was removed. History syncs automatically; just read `inbox messages <chat_id>`.",
|
|
31
|
+
"sync-chat": "`inbox sync-chat` was removed. History syncs automatically; just read `inbox messages <chat_id>`."
|
|
32
32
|
},
|
|
33
33
|
recruiter: {
|
|
34
|
-
"add-candidate": "`recruiter add-candidate` was renamed
|
|
35
|
-
"project-jobs": "`recruiter project-jobs` was renamed
|
|
36
|
-
sync: "`recruiter sync` was removed
|
|
34
|
+
"add-candidate": "`recruiter add-candidate` was renamed. Use `recruiter save-candidate <project_id> --stage-id <id> --candidate-id <id>`.",
|
|
35
|
+
"project-jobs": "`recruiter project-jobs` was renamed. Use `recruiter project-job get <project_id>`.",
|
|
36
|
+
sync: "`recruiter sync` was removed. Recruiter data syncs automatically now.",
|
|
37
37
|
"add-applicant": "`recruiter add-applicant` was removed with no replacement.",
|
|
38
38
|
"reject-applicant": "`recruiter reject-applicant` was removed with no replacement."
|
|
39
39
|
},
|
|
40
40
|
"sales-nav": {
|
|
41
|
-
sync: "`sales-nav sync` was removed
|
|
41
|
+
sync: "`sales-nav sync` was removed. Sales Navigator data syncs automatically now."
|
|
42
42
|
},
|
|
43
43
|
webhook: {
|
|
44
44
|
"state-diff": "`webhook state-diff` was removed with no replacement."
|
|
45
|
-
},
|
|
46
|
-
company: {
|
|
47
|
-
followers: "`company followers` was removed with no replacement."
|
|
48
45
|
}
|
|
49
46
|
};
|
|
50
47
|
function successorHint(group, token) {
|
|
@@ -250,25 +247,28 @@ var main = defineCommand({
|
|
|
250
247
|
// Subcommand registry — names and descriptions are static for help rendering;
|
|
251
248
|
// the handler implementation is loaded lazily on first invocation.
|
|
252
249
|
subCommands: {
|
|
253
|
-
login: () => import("./login-
|
|
254
|
-
config: () => import("./config-
|
|
250
|
+
login: () => import("./login-W7NCDZOQ.js").then((m) => m.loginCommand),
|
|
251
|
+
config: () => import("./config-3O4N2XSH.js").then((m) => m.configCommand),
|
|
255
252
|
// ---------------------------------------------------------------------------
|
|
256
253
|
// Noun groups — lazy-loaded on first invocation.
|
|
257
254
|
// ---------------------------------------------------------------------------
|
|
258
|
-
profile: () => import("./profile-
|
|
259
|
-
company: () => import("./company-
|
|
260
|
-
job: () => import("./job-
|
|
261
|
-
connect: () => import("./connect-
|
|
262
|
-
search: () => import("./search-
|
|
263
|
-
inbox: () => import("./inbox-
|
|
264
|
-
inboxes: () => import("./inboxes-
|
|
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-
|
|
255
|
+
profile: () => import("./profile-A2TWF4HB.js").then((m) => m.profileCommand),
|
|
256
|
+
company: () => import("./company-BX4VDXZX.js").then((m) => m.companyCommand),
|
|
257
|
+
job: () => import("./job-TYBA2DUQ.js").then((m) => m.jobCommand),
|
|
258
|
+
connect: () => import("./connect-KWOJKCIB.js").then((m) => m.connectCommand),
|
|
259
|
+
search: () => import("./search-DH6BJFQC.js").then((m) => m.searchCommand),
|
|
260
|
+
inbox: () => import("./inbox-GMGZVDTQ.js").then((m) => m.inboxCommand),
|
|
261
|
+
inboxes: () => import("./inboxes-YVYLSM5W.js").then((m) => m.inboxesCommand),
|
|
262
|
+
message: () => import("./message-C6FV6JH6.js").then((m) => m.messageCommand),
|
|
263
|
+
post: () => import("./post-RETV3WUG.js").then((m) => m.postCommand),
|
|
264
|
+
comment: () => import("./comment-AXDINBPS.js").then((m) => m.commentCommand),
|
|
265
|
+
account: () => import("./account-2SOSCEB6.js").then((m) => m.accountCommand),
|
|
266
|
+
webhook: () => import("./webhook-LED6AKF3.js").then((m) => m.webhookCommand),
|
|
267
|
+
"sales-nav": () => import("./sales-nav-SSJIZUNB.js").then((m) => m.salesNavCommand),
|
|
268
|
+
recruiter: () => import("./recruiter-FQAKY6Z2.js").then((m) => m.recruiterCommand),
|
|
269
|
+
group: () => import("./group-L7TQEEFN.js").then((m) => m.groupCommand),
|
|
270
|
+
feed: () => import("./feed-4ROKUBG5.js").then((m) => m.feedCommand),
|
|
271
|
+
notification: () => import("./notification-45XFT3S4.js").then((m) => m.notificationCommand)
|
|
272
272
|
},
|
|
273
273
|
async run() {
|
|
274
274
|
const { runMain } = await import("citty");
|
|
@@ -25,11 +25,11 @@ import {
|
|
|
25
25
|
renderSuccess,
|
|
26
26
|
renderUnexpectedError,
|
|
27
27
|
resolveEffectiveConfig
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-HDQUEFD2.js";
|
|
29
29
|
import {
|
|
30
30
|
GLOBAL_FLAGS,
|
|
31
31
|
WRITE_SINGLE_FLAGS
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-DW2HCRXJ.js";
|
|
33
33
|
|
|
34
34
|
// src/commands/comment.ts
|
|
35
35
|
import { defineCommand } from "citty";
|
|
@@ -398,7 +398,7 @@ async function withClient(flags, fn) {
|
|
|
398
398
|
profile: flags.profile
|
|
399
399
|
});
|
|
400
400
|
if (!cfg.apiKey) {
|
|
401
|
-
process.stderr.write("error: no API key
|
|
401
|
+
process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
|
|
402
402
|
process.exit(3);
|
|
403
403
|
}
|
|
404
404
|
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
sentAsNotice
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IGCQNDIG.js";
|
|
5
|
+
import "./chunk-HOQ7EUHJ.js";
|
|
5
6
|
import {
|
|
6
7
|
resolveTextOrStdin
|
|
7
8
|
} from "./chunk-U7Y4EXHT.js";
|
|
@@ -36,11 +37,11 @@ import {
|
|
|
36
37
|
renderSuccess,
|
|
37
38
|
renderUnexpectedError,
|
|
38
39
|
resolveEffectiveConfig
|
|
39
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-HDQUEFD2.js";
|
|
40
41
|
import {
|
|
41
42
|
GLOBAL_FLAGS,
|
|
42
43
|
WRITE_FLAGS
|
|
43
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-DW2HCRXJ.js";
|
|
44
45
|
|
|
45
46
|
// src/commands/company.ts
|
|
46
47
|
import { defineCommand } from "citty";
|
|
@@ -261,6 +262,186 @@ async function runCompanyFollowInvite(client, flags, out) {
|
|
|
261
262
|
await handleSdkError(err, outOpts, out);
|
|
262
263
|
}
|
|
263
264
|
}
|
|
265
|
+
async function runCompanyManaged(client, flags, out) {
|
|
266
|
+
rejectPreviewOnRead(flags.preview, out);
|
|
267
|
+
const accountId = requireAccount(flags.account, out);
|
|
268
|
+
const ns = client.account(accountId);
|
|
269
|
+
const outOpts = resolveOutputOpts(flags);
|
|
270
|
+
const params = {};
|
|
271
|
+
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
272
|
+
if (flags.cursor) params["cursor"] = flags.cursor;
|
|
273
|
+
try {
|
|
274
|
+
if (flags.all) {
|
|
275
|
+
const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
|
|
276
|
+
const fn = (p) => ns.companies.managed(p);
|
|
277
|
+
for await (const item of streamAll(fn, params, {
|
|
278
|
+
maxPages,
|
|
279
|
+
out,
|
|
280
|
+
pageDelayMs: pageDelayFromFlags(flags)
|
|
281
|
+
})) {
|
|
282
|
+
out.stdout.write(JSON.stringify(item) + "\n");
|
|
283
|
+
}
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
const result = await ns.companies.managed(params);
|
|
287
|
+
renderSuccess(result, outOpts, out);
|
|
288
|
+
} catch (err) {
|
|
289
|
+
await handleSdkError(err, outOpts, out);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
async function runCompanyFollowers(client, flags, out) {
|
|
293
|
+
rejectPreviewOnRead(flags.preview, out);
|
|
294
|
+
const accountId = requireAccount(flags.account, out);
|
|
295
|
+
const ns = client.account(accountId);
|
|
296
|
+
const outOpts = resolveOutputOpts(flags);
|
|
297
|
+
const params = {};
|
|
298
|
+
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
299
|
+
if (flags.cursor) params["cursor"] = flags.cursor;
|
|
300
|
+
try {
|
|
301
|
+
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
302
|
+
if (flags.all) {
|
|
303
|
+
const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
|
|
304
|
+
const fn = (p) => ns.companies.followers(identifier, p);
|
|
305
|
+
for await (const item of streamAll(fn, params, {
|
|
306
|
+
maxPages,
|
|
307
|
+
out,
|
|
308
|
+
pageDelayMs: pageDelayFromFlags(flags)
|
|
309
|
+
})) {
|
|
310
|
+
out.stdout.write(JSON.stringify(item) + "\n");
|
|
311
|
+
}
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
const result = await ns.companies.followers(identifier, params);
|
|
315
|
+
renderSuccess(result, outOpts, out);
|
|
316
|
+
} catch (err) {
|
|
317
|
+
await handleSdkError(err, outOpts, out);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
async function runCompanyChats(client, flags, out) {
|
|
321
|
+
rejectPreviewOnRead(flags.preview, out);
|
|
322
|
+
const accountId = requireAccount(flags.account, out);
|
|
323
|
+
const ns = client.account(accountId);
|
|
324
|
+
const outOpts = resolveOutputOpts(flags);
|
|
325
|
+
const params = {};
|
|
326
|
+
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
327
|
+
if (flags.cursor) params["cursor"] = flags.cursor;
|
|
328
|
+
try {
|
|
329
|
+
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
330
|
+
if (flags.all) {
|
|
331
|
+
const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
|
|
332
|
+
const fn = (p) => ns.companies.chats(identifier, p);
|
|
333
|
+
for await (const item of streamAll(fn, params, {
|
|
334
|
+
maxPages,
|
|
335
|
+
out,
|
|
336
|
+
pageDelayMs: pageDelayFromFlags(flags)
|
|
337
|
+
})) {
|
|
338
|
+
out.stdout.write(JSON.stringify(item) + "\n");
|
|
339
|
+
}
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
const result = await ns.companies.chats(identifier, params);
|
|
343
|
+
renderSuccess(result, outOpts, out);
|
|
344
|
+
} catch (err) {
|
|
345
|
+
await handleSdkError(err, outOpts, out);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
async function runCompanyChat(client, flags, out) {
|
|
349
|
+
rejectPreviewOnRead(flags.preview, out);
|
|
350
|
+
if (flags.all) {
|
|
351
|
+
out.stderr.write("error: --all is not supported on non-paginated commands.\n");
|
|
352
|
+
process.exit(2);
|
|
353
|
+
}
|
|
354
|
+
const accountId = requireAccount(flags.account, out);
|
|
355
|
+
const ns = client.account(accountId);
|
|
356
|
+
const outOpts = resolveOutputOpts(flags);
|
|
357
|
+
const chatId = flags.chatId ?? "";
|
|
358
|
+
try {
|
|
359
|
+
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
360
|
+
const result = await ns.companies.chat(identifier, chatId);
|
|
361
|
+
renderSuccess(result, outOpts, out);
|
|
362
|
+
} catch (err) {
|
|
363
|
+
await handleSdkError(err, outOpts, out);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
async function runCompanyMessages(client, flags, out) {
|
|
367
|
+
rejectPreviewOnRead(flags.preview, out);
|
|
368
|
+
const accountId = requireAccount(flags.account, out);
|
|
369
|
+
const ns = client.account(accountId);
|
|
370
|
+
const outOpts = resolveOutputOpts(flags);
|
|
371
|
+
const chatId = flags.chatId ?? "";
|
|
372
|
+
const params = {};
|
|
373
|
+
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
374
|
+
if (flags.cursor) params["cursor"] = flags.cursor;
|
|
375
|
+
try {
|
|
376
|
+
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
377
|
+
if (flags.all) {
|
|
378
|
+
const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
|
|
379
|
+
const fn = (p) => ns.companies.messages(identifier, chatId, p);
|
|
380
|
+
for await (const item of streamAll(fn, params, {
|
|
381
|
+
maxPages,
|
|
382
|
+
out,
|
|
383
|
+
pageDelayMs: pageDelayFromFlags(flags)
|
|
384
|
+
})) {
|
|
385
|
+
out.stdout.write(JSON.stringify(item) + "\n");
|
|
386
|
+
}
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
const result = await ns.companies.messages(identifier, chatId, params);
|
|
390
|
+
renderSuccess(result, outOpts, out);
|
|
391
|
+
} catch (err) {
|
|
392
|
+
await handleSdkError(err, outOpts, out);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
async function runCompanyMessage(client, flags, out) {
|
|
396
|
+
rejectPreviewOnRead(flags.preview, out);
|
|
397
|
+
if (flags.all) {
|
|
398
|
+
out.stderr.write("error: --all is not supported on non-paginated commands.\n");
|
|
399
|
+
process.exit(2);
|
|
400
|
+
}
|
|
401
|
+
const accountId = requireAccount(flags.account, out);
|
|
402
|
+
const ns = client.account(accountId);
|
|
403
|
+
const outOpts = resolveOutputOpts(flags);
|
|
404
|
+
const chatId = flags.chatId ?? "";
|
|
405
|
+
const messageId = flags.messageId ?? "";
|
|
406
|
+
try {
|
|
407
|
+
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
408
|
+
const result = await ns.companies.message(identifier, chatId, messageId);
|
|
409
|
+
renderSuccess(result, outOpts, out);
|
|
410
|
+
} catch (err) {
|
|
411
|
+
await handleSdkError(err, outOpts, out);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
async function runCompanySearchChats(client, flags, out) {
|
|
415
|
+
rejectPreviewOnRead(flags.preview, out);
|
|
416
|
+
const accountId = requireAccount(flags.account, out);
|
|
417
|
+
const ns = client.account(accountId);
|
|
418
|
+
const outOpts = resolveOutputOpts(flags);
|
|
419
|
+
const params = {};
|
|
420
|
+
if (flags.query) params["query"] = flags.query;
|
|
421
|
+
if (flags.topic) params["topic"] = flags.topic;
|
|
422
|
+
if (flags.unread !== void 0) params["unread"] = flags.unread;
|
|
423
|
+
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
424
|
+
if (flags.cursor) params["cursor"] = flags.cursor;
|
|
425
|
+
try {
|
|
426
|
+
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
427
|
+
if (flags.all) {
|
|
428
|
+
const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
|
|
429
|
+
const fn = (p) => ns.companies.searchChats(identifier, p);
|
|
430
|
+
for await (const item of streamAll(fn, params, {
|
|
431
|
+
maxPages,
|
|
432
|
+
out,
|
|
433
|
+
pageDelayMs: pageDelayFromFlags(flags)
|
|
434
|
+
})) {
|
|
435
|
+
out.stdout.write(JSON.stringify(item) + "\n");
|
|
436
|
+
}
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
const result = await ns.companies.searchChats(identifier, params);
|
|
440
|
+
renderSuccess(result, outOpts, out);
|
|
441
|
+
} catch (err) {
|
|
442
|
+
await handleSdkError(err, outOpts, out);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
264
445
|
async function runCompanyReply(client, flags, out, _readStdin) {
|
|
265
446
|
const accountId = requireAccount(flags.account, out);
|
|
266
447
|
const ns = client.account(accountId);
|
|
@@ -315,7 +496,7 @@ var companyEmployeesCommand = defineCommand({
|
|
|
315
496
|
meta: { name: "employees", description: "List people who currently work at the company." },
|
|
316
497
|
args: {
|
|
317
498
|
...GLOBAL_FLAGS,
|
|
318
|
-
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id)
|
|
499
|
+
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), a slug/URL is resolved to the numeric id first." },
|
|
319
500
|
keywords: { type: "string", description: "Free-text keyword filter across employee profile fields." },
|
|
320
501
|
location: { type: "string", description: "Opaque location id from `search parameters --type LOCATION`." }
|
|
321
502
|
},
|
|
@@ -329,7 +510,7 @@ var companyEmployeesCommand = defineCommand({
|
|
|
329
510
|
profile: flags.profile
|
|
330
511
|
});
|
|
331
512
|
if (!cfg.apiKey) {
|
|
332
|
-
process.stderr.write("error: no API key
|
|
513
|
+
process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
|
|
333
514
|
process.exit(3);
|
|
334
515
|
}
|
|
335
516
|
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
@@ -341,7 +522,7 @@ var companyPostsCommand = defineCommand({
|
|
|
341
522
|
meta: { name: "posts", description: "List the company's posts." },
|
|
342
523
|
args: {
|
|
343
524
|
...GLOBAL_FLAGS,
|
|
344
|
-
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id)
|
|
525
|
+
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), a slug/URL is resolved to the numeric id first." }
|
|
345
526
|
},
|
|
346
527
|
async run({ args }) {
|
|
347
528
|
const flags = args;
|
|
@@ -353,7 +534,7 @@ var companyPostsCommand = defineCommand({
|
|
|
353
534
|
profile: flags.profile
|
|
354
535
|
});
|
|
355
536
|
if (!cfg.apiKey) {
|
|
356
|
-
process.stderr.write("error: no API key
|
|
537
|
+
process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
|
|
357
538
|
process.exit(3);
|
|
358
539
|
}
|
|
359
540
|
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
@@ -365,7 +546,7 @@ var companyJobsCommand = defineCommand({
|
|
|
365
546
|
meta: { name: "jobs", description: "List the company's open job postings." },
|
|
366
547
|
args: {
|
|
367
548
|
...GLOBAL_FLAGS,
|
|
368
|
-
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id)
|
|
549
|
+
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), a slug/URL is resolved to the numeric id first." },
|
|
369
550
|
keywords: { type: "string", description: "Free-text keyword filter across job postings." }
|
|
370
551
|
},
|
|
371
552
|
async run({ args }) {
|
|
@@ -378,7 +559,7 @@ var companyJobsCommand = defineCommand({
|
|
|
378
559
|
profile: flags.profile
|
|
379
560
|
});
|
|
380
561
|
if (!cfg.apiKey) {
|
|
381
|
-
process.stderr.write("error: no API key
|
|
562
|
+
process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
|
|
382
563
|
process.exit(3);
|
|
383
564
|
}
|
|
384
565
|
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
@@ -405,7 +586,7 @@ var companyInvitableFollowersCommand = defineCommand({
|
|
|
405
586
|
profile: flags.profile
|
|
406
587
|
});
|
|
407
588
|
if (!cfg.apiKey) {
|
|
408
|
-
process.stderr.write("error: no API key
|
|
589
|
+
process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
|
|
409
590
|
process.exit(3);
|
|
410
591
|
}
|
|
411
592
|
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
@@ -436,7 +617,7 @@ var companyFollowInviteCommand = defineCommand({
|
|
|
436
617
|
profile: flags.profile
|
|
437
618
|
});
|
|
438
619
|
if (!cfg.apiKey) {
|
|
439
|
-
process.stderr.write("error: no API key
|
|
620
|
+
process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
|
|
440
621
|
process.exit(3);
|
|
441
622
|
}
|
|
442
623
|
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
@@ -444,6 +625,193 @@ var companyFollowInviteCommand = defineCommand({
|
|
|
444
625
|
await runCompanyFollowInvite(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
445
626
|
}
|
|
446
627
|
});
|
|
628
|
+
var companyManagedCommand = defineCommand({
|
|
629
|
+
meta: { name: "managed", description: "List the company pages the connected account administers. An empty result is valid, the account administers no pages." },
|
|
630
|
+
args: { ...GLOBAL_FLAGS },
|
|
631
|
+
async run({ args }) {
|
|
632
|
+
const flags = args;
|
|
633
|
+
const cfg = await resolveEffectiveConfig({
|
|
634
|
+
apiKey: flags["api-key"],
|
|
635
|
+
baseUrl: flags["base-url"],
|
|
636
|
+
timeout: flags.timeout,
|
|
637
|
+
account: flags.account,
|
|
638
|
+
profile: flags.profile
|
|
639
|
+
});
|
|
640
|
+
if (!cfg.apiKey) {
|
|
641
|
+
process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
|
|
642
|
+
process.exit(3);
|
|
643
|
+
}
|
|
644
|
+
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
645
|
+
const out = buildOutputStreams();
|
|
646
|
+
await runCompanyManaged(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
647
|
+
}
|
|
648
|
+
});
|
|
649
|
+
var companyFollowersCommand = defineCommand({
|
|
650
|
+
meta: { name: "followers", description: "List a company page's followers, newest first. Admin-gated: the account must administer the page (see `company managed`)." },
|
|
651
|
+
args: {
|
|
652
|
+
...GLOBAL_FLAGS,
|
|
653
|
+
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), a slug/URL is resolved to the numeric id first." }
|
|
654
|
+
},
|
|
655
|
+
async run({ args }) {
|
|
656
|
+
const flags = args;
|
|
657
|
+
const cfg = await resolveEffectiveConfig({
|
|
658
|
+
apiKey: flags["api-key"],
|
|
659
|
+
baseUrl: flags["base-url"],
|
|
660
|
+
timeout: flags.timeout,
|
|
661
|
+
account: flags.account,
|
|
662
|
+
profile: flags.profile
|
|
663
|
+
});
|
|
664
|
+
if (!cfg.apiKey) {
|
|
665
|
+
process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
|
|
666
|
+
process.exit(3);
|
|
667
|
+
}
|
|
668
|
+
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
669
|
+
const out = buildOutputStreams();
|
|
670
|
+
await runCompanyFollowers(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
671
|
+
}
|
|
672
|
+
});
|
|
673
|
+
var companyChatsCommand = defineCommand({
|
|
674
|
+
meta: {
|
|
675
|
+
name: "chats",
|
|
676
|
+
description: "List the conversations in a company page's admin message inbox, newest-activity-first. Admin-gated. Beta."
|
|
677
|
+
},
|
|
678
|
+
args: {
|
|
679
|
+
...GLOBAL_FLAGS,
|
|
680
|
+
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), a slug/URL is resolved to the numeric id first." }
|
|
681
|
+
},
|
|
682
|
+
async run({ args }) {
|
|
683
|
+
const flags = args;
|
|
684
|
+
const cfg = await resolveEffectiveConfig({
|
|
685
|
+
apiKey: flags["api-key"],
|
|
686
|
+
baseUrl: flags["base-url"],
|
|
687
|
+
timeout: flags.timeout,
|
|
688
|
+
account: flags.account,
|
|
689
|
+
profile: flags.profile
|
|
690
|
+
});
|
|
691
|
+
if (!cfg.apiKey) {
|
|
692
|
+
process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
|
|
693
|
+
process.exit(3);
|
|
694
|
+
}
|
|
695
|
+
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
696
|
+
const out = buildOutputStreams();
|
|
697
|
+
await runCompanyChats(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
var companyChatCommand = defineCommand({
|
|
701
|
+
meta: {
|
|
702
|
+
name: "chat",
|
|
703
|
+
description: "Retrieve one conversation from a company page's admin inbox. Admin-gated. Beta."
|
|
704
|
+
},
|
|
705
|
+
args: {
|
|
706
|
+
...GLOBAL_FLAGS,
|
|
707
|
+
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), a slug/URL is resolved to the numeric id first." },
|
|
708
|
+
chatId: { type: "positional", description: "The 2-\u2026 chat id from `company chats`, passed through verbatim." }
|
|
709
|
+
},
|
|
710
|
+
async run({ args }) {
|
|
711
|
+
const flags = args;
|
|
712
|
+
const cfg = await resolveEffectiveConfig({
|
|
713
|
+
apiKey: flags["api-key"],
|
|
714
|
+
baseUrl: flags["base-url"],
|
|
715
|
+
timeout: flags.timeout,
|
|
716
|
+
account: flags.account,
|
|
717
|
+
profile: flags.profile
|
|
718
|
+
});
|
|
719
|
+
if (!cfg.apiKey) {
|
|
720
|
+
process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
|
|
721
|
+
process.exit(3);
|
|
722
|
+
}
|
|
723
|
+
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
724
|
+
const out = buildOutputStreams();
|
|
725
|
+
await runCompanyChat(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
var companyMessagesCommand = defineCommand({
|
|
729
|
+
meta: {
|
|
730
|
+
name: "messages",
|
|
731
|
+
description: "List a company-inbox conversation's messages, newest first. Admin-gated."
|
|
732
|
+
},
|
|
733
|
+
args: {
|
|
734
|
+
...GLOBAL_FLAGS,
|
|
735
|
+
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), a slug/URL is resolved to the numeric id first." },
|
|
736
|
+
chatId: { type: "positional", description: "The 2-\u2026 chat id from `company chats`, passed through verbatim." }
|
|
737
|
+
},
|
|
738
|
+
async run({ args }) {
|
|
739
|
+
const flags = args;
|
|
740
|
+
const cfg = await resolveEffectiveConfig({
|
|
741
|
+
apiKey: flags["api-key"],
|
|
742
|
+
baseUrl: flags["base-url"],
|
|
743
|
+
timeout: flags.timeout,
|
|
744
|
+
account: flags.account,
|
|
745
|
+
profile: flags.profile
|
|
746
|
+
});
|
|
747
|
+
if (!cfg.apiKey) {
|
|
748
|
+
process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
|
|
749
|
+
process.exit(3);
|
|
750
|
+
}
|
|
751
|
+
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
752
|
+
const out = buildOutputStreams();
|
|
753
|
+
await runCompanyMessages(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
754
|
+
}
|
|
755
|
+
});
|
|
756
|
+
var companyMessageCommand = defineCommand({
|
|
757
|
+
meta: {
|
|
758
|
+
name: "message",
|
|
759
|
+
description: "Retrieve one message from a company-inbox conversation. Admin-gated. See also: `company reply` (send)."
|
|
760
|
+
},
|
|
761
|
+
args: {
|
|
762
|
+
...GLOBAL_FLAGS,
|
|
763
|
+
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), a slug/URL is resolved to the numeric id first." },
|
|
764
|
+
chatId: { type: "positional", description: "The 2-\u2026 chat id from `company chats`, passed through verbatim." },
|
|
765
|
+
messageId: { type: "positional", description: "The message id from `company messages`, passed through verbatim." }
|
|
766
|
+
},
|
|
767
|
+
async run({ args }) {
|
|
768
|
+
const flags = args;
|
|
769
|
+
const cfg = await resolveEffectiveConfig({
|
|
770
|
+
apiKey: flags["api-key"],
|
|
771
|
+
baseUrl: flags["base-url"],
|
|
772
|
+
timeout: flags.timeout,
|
|
773
|
+
account: flags.account,
|
|
774
|
+
profile: flags.profile
|
|
775
|
+
});
|
|
776
|
+
if (!cfg.apiKey) {
|
|
777
|
+
process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
|
|
778
|
+
process.exit(3);
|
|
779
|
+
}
|
|
780
|
+
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
781
|
+
const out = buildOutputStreams();
|
|
782
|
+
await runCompanyMessage(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
783
|
+
}
|
|
784
|
+
});
|
|
785
|
+
var companySearchChatsCommand = defineCommand({
|
|
786
|
+
meta: {
|
|
787
|
+
name: "search-chats",
|
|
788
|
+
description: "Search or filter a company page's admin inbox. Exactly one mode per call: free-text <query>, --topic, or --unread; mutually exclusive, enforced server-side. Admin-gated."
|
|
789
|
+
},
|
|
790
|
+
args: {
|
|
791
|
+
...GLOBAL_FLAGS,
|
|
792
|
+
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), a slug/URL is resolved to the numeric id first." },
|
|
793
|
+
query: { type: "positional", required: false, description: "Free-text term, matches participant names and message content." },
|
|
794
|
+
topic: { type: "string", description: "Filter mode, one inbox topic card: 1-5 or its name (Service request, Request a demo, Support, Careers, Other)." },
|
|
795
|
+
unread: { type: "boolean", description: "Filter mode, unread conversations only." }
|
|
796
|
+
},
|
|
797
|
+
async run({ args }) {
|
|
798
|
+
const flags = args;
|
|
799
|
+
const cfg = await resolveEffectiveConfig({
|
|
800
|
+
apiKey: flags["api-key"],
|
|
801
|
+
baseUrl: flags["base-url"],
|
|
802
|
+
timeout: flags.timeout,
|
|
803
|
+
account: flags.account,
|
|
804
|
+
profile: flags.profile
|
|
805
|
+
});
|
|
806
|
+
if (!cfg.apiKey) {
|
|
807
|
+
process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
|
|
808
|
+
process.exit(3);
|
|
809
|
+
}
|
|
810
|
+
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
811
|
+
const out = buildOutputStreams();
|
|
812
|
+
await runCompanySearchChats(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
813
|
+
}
|
|
814
|
+
});
|
|
447
815
|
var companyReplyCommand = defineCommand({
|
|
448
816
|
meta: {
|
|
449
817
|
name: "reply",
|
|
@@ -469,7 +837,7 @@ var companyReplyCommand = defineCommand({
|
|
|
469
837
|
profile: flags.profile
|
|
470
838
|
});
|
|
471
839
|
if (!cfg.apiKey) {
|
|
472
|
-
process.stderr.write("error: no API key
|
|
840
|
+
process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
|
|
473
841
|
process.exit(3);
|
|
474
842
|
}
|
|
475
843
|
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
@@ -482,7 +850,7 @@ var companyCommand = defineCommand({
|
|
|
482
850
|
args: {
|
|
483
851
|
...GLOBAL_FLAGS,
|
|
484
852
|
id: { type: "positional", description: "Company identifier (URL, slug, or native id)." },
|
|
485
|
-
sections: { type: "string", description: "Not supported on company commands
|
|
853
|
+
sections: { type: "string", description: "Not supported on company commands; a usage error (exit 2) if supplied." }
|
|
486
854
|
},
|
|
487
855
|
subCommands: {
|
|
488
856
|
employees: companyEmployeesCommand,
|
|
@@ -490,7 +858,14 @@ var companyCommand = defineCommand({
|
|
|
490
858
|
jobs: companyJobsCommand,
|
|
491
859
|
"invitable-followers": companyInvitableFollowersCommand,
|
|
492
860
|
"follow-invite": companyFollowInviteCommand,
|
|
493
|
-
reply: companyReplyCommand
|
|
861
|
+
reply: companyReplyCommand,
|
|
862
|
+
managed: companyManagedCommand,
|
|
863
|
+
followers: companyFollowersCommand,
|
|
864
|
+
chats: companyChatsCommand,
|
|
865
|
+
chat: companyChatCommand,
|
|
866
|
+
messages: companyMessagesCommand,
|
|
867
|
+
message: companyMessageCommand,
|
|
868
|
+
"search-chats": companySearchChatsCommand
|
|
494
869
|
},
|
|
495
870
|
async run({ args }) {
|
|
496
871
|
const flags = args;
|
|
@@ -502,7 +877,7 @@ var companyCommand = defineCommand({
|
|
|
502
877
|
profile: flags.profile
|
|
503
878
|
});
|
|
504
879
|
if (!cfg.apiKey) {
|
|
505
|
-
process.stderr.write("error: no API key
|
|
880
|
+
process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
|
|
506
881
|
process.exit(3);
|
|
507
882
|
}
|
|
508
883
|
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
@@ -512,11 +887,18 @@ var companyCommand = defineCommand({
|
|
|
512
887
|
});
|
|
513
888
|
export {
|
|
514
889
|
companyCommand,
|
|
890
|
+
runCompanyChat,
|
|
891
|
+
runCompanyChats,
|
|
515
892
|
runCompanyEmployees,
|
|
516
893
|
runCompanyFollowInvite,
|
|
894
|
+
runCompanyFollowers,
|
|
517
895
|
runCompanyGet,
|
|
518
896
|
runCompanyInvitableFollowers,
|
|
519
897
|
runCompanyJobs,
|
|
898
|
+
runCompanyManaged,
|
|
899
|
+
runCompanyMessage,
|
|
900
|
+
runCompanyMessages,
|
|
520
901
|
runCompanyPosts,
|
|
521
|
-
runCompanyReply
|
|
902
|
+
runCompanyReply,
|
|
903
|
+
runCompanySearchChats
|
|
522
904
|
};
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
renameProfile,
|
|
8
8
|
setActiveProfile,
|
|
9
9
|
updateProfileField
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DW2HCRXJ.js";
|
|
11
11
|
|
|
12
12
|
// src/commands/config.ts
|
|
13
13
|
import { defineCommand } from "citty";
|
|
@@ -177,7 +177,7 @@ var configCommand = defineCommand({
|
|
|
177
177
|
);
|
|
178
178
|
if (url === void 0 || url === "") {
|
|
179
179
|
process.stderr.write(
|
|
180
|
-
`Cleared baseUrl on profile "${profileName}"
|
|
180
|
+
`Cleared baseUrl on profile "${profileName}", using the API default.
|
|
181
181
|
`
|
|
182
182
|
);
|
|
183
183
|
} else {
|