@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.
Files changed (26) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/dist/{account-EGJJNBXW.js → account-2SOSCEB6.js} +26 -26
  3. package/dist/{chunk-TMU3CSPR.js → chunk-DW2HCRXJ.js} +1 -1
  4. package/dist/{chunk-M33MI53G.js → chunk-HDQUEFD2.js} +1 -1
  5. package/dist/chunk-HOQ7EUHJ.js +50 -0
  6. package/dist/{chunk-KVV6LZ7E.js → chunk-IGCQNDIG.js} +53 -17
  7. package/dist/cli.js +33 -33
  8. package/dist/{comment-VT6PO4MN.js → comment-AXDINBPS.js} +3 -3
  9. package/dist/{company-BVXX4FGX.js → company-BX4VDXZX.js} +398 -16
  10. package/dist/{config-P5CPF5WC.js → config-3O4N2XSH.js} +2 -2
  11. package/dist/{connect-6PU7QCOL.js → connect-KWOJKCIB.js} +36 -15
  12. package/dist/feed-4ROKUBG5.js +127 -0
  13. package/dist/group-L7TQEEFN.js +236 -0
  14. package/dist/{inbox-DRJ6ENXC.js → inbox-GMGZVDTQ.js} +69 -11
  15. package/dist/{inboxes-MTPWLP5F.js → inboxes-YVYLSM5W.js} +4 -4
  16. package/dist/{job-EIXBJXLW.js → job-TYBA2DUQ.js} +7 -7
  17. package/dist/{login-GDLWR542.js → login-W7NCDZOQ.js} +2 -2
  18. package/dist/{message-UWMRE2SJ.js → message-C6FV6JH6.js} +6 -3
  19. package/dist/notification-45XFT3S4.js +219 -0
  20. package/dist/{post-N3GQDIQJ.js → post-RETV3WUG.js} +102 -9
  21. package/dist/{profile-XWSRUYRW.js → profile-A2TWF4HB.js} +121 -15
  22. package/dist/{recruiter-MVPSTH2V.js → recruiter-FQAKY6Z2.js} +30 -30
  23. package/dist/{sales-nav-TMXWDKSE.js → sales-nav-SSJIZUNB.js} +16 -16
  24. package/dist/{search-ZQUKLQ6T.js → search-DH6BJFQC.js} +213 -12
  25. package/dist/{webhook-QFSZN3P2.js → webhook-LED6AKF3.js} +50 -19
  26. package/package.json +4 -4
@@ -25,10 +25,10 @@ import {
25
25
  renderSuccess,
26
26
  renderUnexpectedError,
27
27
  resolveEffectiveConfig
28
- } from "./chunk-M33MI53G.js";
28
+ } from "./chunk-HDQUEFD2.js";
29
29
  import {
30
30
  GLOBAL_FLAGS
31
- } from "./chunk-TMU3CSPR.js";
31
+ } from "./chunk-DW2HCRXJ.js";
32
32
 
33
33
  // src/commands/search.ts
34
34
  import { defineCommand } from "citty";
@@ -384,6 +384,115 @@ async function runSearchParameters(client, flags, out) {
384
384
  process.exit(1);
385
385
  }
386
386
  }
387
+ async function runSearchGroups(client, flags, out) {
388
+ rejectPreviewOnRead(flags.preview, out);
389
+ const keywords = flags.query ?? "";
390
+ if (!keywords) {
391
+ out.stderr.write("error: <query> is required.\n");
392
+ process.exit(2);
393
+ }
394
+ const accountId = requireAccount(flags.account, out);
395
+ const ns = client.account(accountId);
396
+ const outOpts = resolveOutputOpts(flags);
397
+ const all = flags.all ?? false;
398
+ const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
399
+ const query = { keywords };
400
+ if (flags.limit) query.limit = parseInt(flags.limit, 10);
401
+ if (flags.cursor) query.cursor = flags.cursor;
402
+ try {
403
+ if (all) {
404
+ const fn = (p) => ns.search.groups(p);
405
+ for await (const item of streamAll(fn, query, {
406
+ maxPages,
407
+ out,
408
+ pageDelayMs: pageDelayFromFlags(flags)
409
+ })) {
410
+ out.stdout.write(JSON.stringify(item) + "\n");
411
+ }
412
+ } else {
413
+ const result = await ns.search.groups(query);
414
+ renderSuccess(result, outOpts, out);
415
+ }
416
+ } catch (err) {
417
+ const { CurviateError } = await import("@curviate/sdk");
418
+ if (err instanceof CurviateError) {
419
+ const { getExitCode } = await import("./exit-codes-63JE5GM5.js");
420
+ renderError(err, outOpts, out);
421
+ process.exit(getExitCode(err.code));
422
+ }
423
+ renderUnexpectedError(err, out);
424
+ process.exit(1);
425
+ }
426
+ }
427
+ async function runSearchServices(client, flags, out) {
428
+ rejectPreviewOnRead(flags.preview, out);
429
+ const accountId = requireAccount(flags.account, out);
430
+ const ns = client.account(accountId);
431
+ const outOpts = resolveOutputOpts(flags);
432
+ const all = flags.all ?? false;
433
+ const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
434
+ const body = {};
435
+ if (flags.keywords) body["keywords"] = flags.keywords;
436
+ if (flags["service-category"]) body["service_category"] = splitCsv(flags["service-category"]);
437
+ if (flags.location) body["location"] = splitCsv(flags.location);
438
+ if (flags.connections) {
439
+ body["connections"] = splitCsvNumbers(flags.connections);
440
+ }
441
+ if (flags.language) body["language"] = splitCsv(flags.language);
442
+ if (flags.limit) body["limit"] = parseInt(flags.limit, 10);
443
+ if (flags.cursor) body["cursor"] = flags.cursor;
444
+ try {
445
+ if (all) {
446
+ const fn = (p) => ns.search.services(p);
447
+ for await (const item of streamAll(fn, body, {
448
+ maxPages,
449
+ out,
450
+ pageDelayMs: pageDelayFromFlags(flags)
451
+ })) {
452
+ out.stdout.write(JSON.stringify(item) + "\n");
453
+ }
454
+ } else {
455
+ const result = await ns.search.services(body);
456
+ renderSuccess(result, outOpts, out);
457
+ }
458
+ } catch (err) {
459
+ const { CurviateError } = await import("@curviate/sdk");
460
+ if (err instanceof CurviateError) {
461
+ const { getExitCode } = await import("./exit-codes-63JE5GM5.js");
462
+ renderError(err, outOpts, out);
463
+ process.exit(getExitCode(err.code));
464
+ }
465
+ renderUnexpectedError(err, out);
466
+ process.exit(1);
467
+ }
468
+ }
469
+ async function runSearchServiceParameters(client, flags, out) {
470
+ rejectPreviewOnRead(flags.preview, out);
471
+ rejectAllOnNonPaginated(flags.all, out);
472
+ if (!flags.keywords) {
473
+ out.stderr.write("error: --keywords is required.\n");
474
+ process.exit(2);
475
+ }
476
+ const accountId = requireAccount(flags.account, out);
477
+ const ns = client.account(accountId);
478
+ const outOpts = resolveOutputOpts(flags);
479
+ const query = { keywords: flags.keywords };
480
+ if (flags.type) query.type = flags.type;
481
+ if (flags.limit) query.limit = parseInt(flags.limit, 10);
482
+ try {
483
+ const result = await ns.search.getServiceParameters(query);
484
+ renderSuccess(result, outOpts, out);
485
+ } catch (err) {
486
+ const { CurviateError } = await import("@curviate/sdk");
487
+ if (err instanceof CurviateError) {
488
+ const { getExitCode } = await import("./exit-codes-63JE5GM5.js");
489
+ renderError(err, outOpts, out);
490
+ process.exit(getExitCode(err.code));
491
+ }
492
+ renderUnexpectedError(err, out);
493
+ process.exit(1);
494
+ }
495
+ }
387
496
  async function runSearchFromUrl(client, flags, out) {
388
497
  rejectPreviewOnRead(flags.preview, out);
389
498
  const accountId = requireAccount(flags.account, out);
@@ -449,7 +558,7 @@ var searchPeopleCommand = defineCommand({
449
558
  profile: flags.profile
450
559
  });
451
560
  if (!cfg.apiKey) {
452
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
561
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
453
562
  process.exit(3);
454
563
  }
455
564
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -482,7 +591,7 @@ var searchCompaniesCommand = defineCommand({
482
591
  profile: flags.profile
483
592
  });
484
593
  if (!cfg.apiKey) {
485
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
594
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
486
595
  process.exit(3);
487
596
  }
488
597
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -518,7 +627,7 @@ var searchPostsCommand = defineCommand({
518
627
  profile: flags.profile
519
628
  });
520
629
  if (!cfg.apiKey) {
521
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
630
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
522
631
  process.exit(3);
523
632
  }
524
633
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -540,11 +649,11 @@ var searchJobsCommand = defineCommand({
540
649
  "job-type": { type: "string", description: "job type, independent 7-value enum: full_time|part_time|contract|temporary|volunteer|internship|other (comma-separated)" },
541
650
  company: { type: "string", description: "Company ids (comma-separated)." },
542
651
  "sort-by": { type: "string", description: "Sort order (e.g. relevance, recent)." },
543
- "date-posted": { type: "string", description: "maximum job age in days (a number \u2014 e.g. 7, 14, 30; not an enum string)" },
652
+ "date-posted": { type: "string", description: "maximum job age in days (a number, e.g. 7, 14, 30; not an enum string)" },
544
653
  region: { type: "string", description: "alias for --location (same body field: region)" },
545
654
  title: {
546
655
  type: "string",
547
- description: "job title id(s), comma-separated (resolve: search parameters --type JOB_TITLE); ID-based targeting \u2014 unlike search people --title, which is free-text"
656
+ description: "job title id(s), comma-separated (resolve: search parameters --type JOB_TITLE); ID-based targeting, unlike search people --title, which is free-text"
548
657
  },
549
658
  presence: { type: "string", description: "work presence, comma-separated: on_site, hybrid, remote" },
550
659
  benefits: { type: "string", description: "benefit ids, comma-separated" },
@@ -568,7 +677,7 @@ var searchJobsCommand = defineCommand({
568
677
  profile: flags.profile
569
678
  });
570
679
  if (!cfg.apiKey) {
571
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
680
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
572
681
  process.exit(3);
573
682
  }
574
683
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -597,7 +706,7 @@ var searchParametersCommand = defineCommand({
597
706
  profile: flags.profile
598
707
  });
599
708
  if (!cfg.apiKey) {
600
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
709
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
601
710
  process.exit(3);
602
711
  }
603
712
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -605,6 +714,92 @@ var searchParametersCommand = defineCommand({
605
714
  await runSearchParameters(client, { ...flags, account: flags.account ?? cfg.account }, out);
606
715
  }
607
716
  });
717
+ var searchGroupsCommand = defineCommand({
718
+ meta: { name: "groups", description: "Keyword search for LinkedIn groups. A no-match search returns an empty list, not an error." },
719
+ args: {
720
+ ...GLOBAL_FLAGS,
721
+ query: { type: "positional", description: "Search terms (multi-word supported, e.g. 'gtm engineering')." }
722
+ },
723
+ async run({ args }) {
724
+ const flags = args;
725
+ const cfg = await resolveEffectiveConfig({
726
+ apiKey: flags["api-key"],
727
+ baseUrl: flags["base-url"],
728
+ timeout: flags.timeout,
729
+ account: flags.account,
730
+ profile: flags.profile
731
+ });
732
+ if (!cfg.apiKey) {
733
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
734
+ process.exit(3);
735
+ }
736
+ const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
737
+ const out = buildOutputStreams();
738
+ await runSearchGroups(client, { ...flags, account: flags.account ?? cfg.account }, out);
739
+ }
740
+ });
741
+ var searchServicesCommand = defineCommand({
742
+ meta: {
743
+ name: "services",
744
+ description: "Search Services Marketplace providers with structured filters. At least one of --keywords, --service-category, or --location is required. Resolve --service-category/--location values with 'search service-parameters' first, both take opaque ids, not free text."
745
+ },
746
+ args: {
747
+ ...GLOBAL_FLAGS,
748
+ keywords: { type: "string", description: "Free-text keyword match." },
749
+ "service-category": { type: "string", description: "Opaque service-category ids (comma-separated; resolve via search service-parameters --type service_category)." },
750
+ location: { type: "string", description: "Opaque location ids (comma-separated; resolve via search service-parameters --type location)." },
751
+ connections: { type: "string", description: "Connection degree filter, comma-separated: 1 (1st), 2 (2nd), 3 (3rd+)." },
752
+ language: { type: "string", description: "Profile-language ISO 639-1 codes, comma-separated (e.g. en,de,es,fr)." }
753
+ },
754
+ async run({ args }) {
755
+ const flags = args;
756
+ const cfg = await resolveEffectiveConfig({
757
+ apiKey: flags["api-key"],
758
+ baseUrl: flags["base-url"],
759
+ timeout: flags.timeout,
760
+ account: flags.account,
761
+ profile: flags.profile
762
+ });
763
+ if (!cfg.apiKey) {
764
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
765
+ process.exit(3);
766
+ }
767
+ const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
768
+ const out = buildOutputStreams();
769
+ await runSearchServices(client, { ...flags, account: flags.account ?? cfg.account }, out);
770
+ }
771
+ });
772
+ var searchServiceParametersCommand = defineCommand({
773
+ meta: {
774
+ name: "service-parameters",
775
+ description: "Resolve human-readable service-filter terms into the opaque ids 'search services' accepts."
776
+ },
777
+ args: {
778
+ ...GLOBAL_FLAGS,
779
+ type: {
780
+ type: "string",
781
+ description: "Filter type to resolve: service_category (default) or location."
782
+ },
783
+ keywords: { type: "string", description: "The typed text to resolve (e.g. 'marke').", required: true }
784
+ },
785
+ async run({ args }) {
786
+ const flags = args;
787
+ const cfg = await resolveEffectiveConfig({
788
+ apiKey: flags["api-key"],
789
+ baseUrl: flags["base-url"],
790
+ timeout: flags.timeout,
791
+ account: flags.account,
792
+ profile: flags.profile
793
+ });
794
+ if (!cfg.apiKey) {
795
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
796
+ process.exit(3);
797
+ }
798
+ const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
799
+ const out = buildOutputStreams();
800
+ await runSearchServiceParameters(client, { ...flags, account: flags.account ?? cfg.account }, out);
801
+ }
802
+ });
608
803
  var searchCommand = defineCommand({
609
804
  meta: { name: "search", description: "Search people, companies, posts, and jobs. Also runs a pasted search URL directly." },
610
805
  args: {
@@ -620,13 +815,16 @@ var searchCommand = defineCommand({
620
815
  companies: searchCompaniesCommand,
621
816
  posts: searchPostsCommand,
622
817
  jobs: searchJobsCommand,
623
- parameters: searchParametersCommand
818
+ parameters: searchParametersCommand,
819
+ groups: searchGroupsCommand,
820
+ services: searchServicesCommand,
821
+ "service-parameters": searchServiceParametersCommand
624
822
  },
625
823
  async run({ args }) {
626
824
  const flags = args;
627
825
  if (!flags.url) {
628
826
  process.stderr.write(
629
- "Usage: curviate search <url>\n curviate search people [--keywords <k>]\n curviate search companies [--keywords <k>]\n curviate search posts [--keywords <k>]\n curviate search jobs [--keywords <k>]\n curviate search parameters --type <t> --keywords <k>\n"
827
+ "Usage: curviate search <url>\n curviate search people [--keywords <k>]\n curviate search companies [--keywords <k>]\n curviate search posts [--keywords <k>]\n curviate search jobs [--keywords <k>]\n curviate search parameters --type <t> --keywords <k>\n curviate search groups <query>\n curviate search services [--keywords <k>]\n curviate search service-parameters --keywords <k> [--type <t>]\n"
630
828
  );
631
829
  process.exit(2);
632
830
  }
@@ -638,7 +836,7 @@ var searchCommand = defineCommand({
638
836
  profile: flags.profile
639
837
  });
640
838
  if (!cfg.apiKey) {
641
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
839
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
642
840
  process.exit(3);
643
841
  }
644
842
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -649,9 +847,12 @@ var searchCommand = defineCommand({
649
847
  export {
650
848
  runSearchCompanies,
651
849
  runSearchFromUrl,
850
+ runSearchGroups,
652
851
  runSearchJobs,
653
852
  runSearchParameters,
654
853
  runSearchPeople,
655
854
  runSearchPosts,
855
+ runSearchServiceParameters,
856
+ runSearchServices,
656
857
  searchCommand
657
858
  };
@@ -1,4 +1,8 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ STDIN_SENTINEL,
4
+ defaultReadStdin
5
+ } from "./chunk-U7Y4EXHT.js";
2
6
  import {
3
7
  pageDelayFromFlags,
4
8
  streamAll
@@ -12,10 +16,10 @@ import {
12
16
  renderSuccess,
13
17
  renderUnexpectedError,
14
18
  resolveEffectiveConfig
15
- } from "./chunk-M33MI53G.js";
19
+ } from "./chunk-HDQUEFD2.js";
16
20
  import {
17
21
  GLOBAL_FLAGS
18
- } from "./chunk-TMU3CSPR.js";
22
+ } from "./chunk-DW2HCRXJ.js";
19
23
 
20
24
  // src/commands/webhook.ts
21
25
  import { defineCommand } from "citty";
@@ -202,6 +206,37 @@ async function runWebhookDelete(client, flags, out) {
202
206
  await handleError(err, outOpts, out);
203
207
  }
204
208
  }
209
+ function stripTrailingNewlines(s) {
210
+ return s.replace(/(?:\r?\n)+$/, "");
211
+ }
212
+ async function resolveWebhookBody(raw, out, readStdin = defaultReadStdin) {
213
+ if (raw === void 0 || raw === "") {
214
+ out.stderr.write(
215
+ "error: --body is required: pass the raw webhook body as inline JSON, as a path to a file containing it, or as - to read it from stdin.\n"
216
+ );
217
+ process.exit(2);
218
+ }
219
+ if (raw === "-" || raw === STDIN_SENTINEL) {
220
+ const piped = stripTrailingNewlines(await readStdin());
221
+ if (!piped) {
222
+ out.stderr.write("error: --body -: stdin: empty input\n");
223
+ process.exit(2);
224
+ }
225
+ return piped;
226
+ }
227
+ if (raw.trimStart().startsWith("{")) return raw;
228
+ try {
229
+ return stripTrailingNewlines(readFileSync(raw, "utf8"));
230
+ } catch (err) {
231
+ const reason = err instanceof Error ? err.message : String(err);
232
+ out.stderr.write(
233
+ `error: --body: could not read ${raw}: ${reason}
234
+ --body accepts inline JSON, a path to a file containing the raw body, or - to read it from stdin.
235
+ `
236
+ );
237
+ process.exit(2);
238
+ }
239
+ }
205
240
  async function runWebhookVerify(input, out) {
206
241
  const { constructEvent, WebhookSignatureError } = await import("@curviate/sdk");
207
242
  try {
@@ -222,7 +257,7 @@ async function runWebhookVerify(input, out) {
222
257
  }
223
258
  };
224
259
  out.stdout.write(JSON.stringify(envelope) + "\n");
225
- out.stderr.write(`error: webhook verification failed \u2014 ${err.reason}: ${err.message}
260
+ out.stderr.write(`error: webhook verification failed, ${err.reason}: ${err.message}
226
261
  `);
227
262
  process.exit(2);
228
263
  }
@@ -253,7 +288,7 @@ var webhookCreateCommand = defineCommand({
253
288
  profile: flags.profile
254
289
  });
255
290
  if (!cfg.apiKey) {
256
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
291
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
257
292
  process.exit(3);
258
293
  }
259
294
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -273,7 +308,7 @@ var webhookListCommand = defineCommand({
273
308
  profile: flags.profile
274
309
  });
275
310
  if (!cfg.apiKey) {
276
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
311
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
277
312
  process.exit(3);
278
313
  }
279
314
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -293,7 +328,7 @@ var webhookEventsCommand = defineCommand({
293
328
  profile: flags.profile
294
329
  });
295
330
  if (!cfg.apiKey) {
296
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
331
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
297
332
  process.exit(3);
298
333
  }
299
334
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -316,7 +351,7 @@ var webhookGetCommand = defineCommand({
316
351
  profile: flags.profile
317
352
  });
318
353
  if (!cfg.apiKey) {
319
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
354
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
320
355
  process.exit(3);
321
356
  }
322
357
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -346,7 +381,7 @@ var webhookUpdateCommand = defineCommand({
346
381
  profile: flags.profile
347
382
  });
348
383
  if (!cfg.apiKey) {
349
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
384
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
350
385
  process.exit(3);
351
386
  }
352
387
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -369,7 +404,7 @@ var webhookDeleteCommand = defineCommand({
369
404
  profile: flags.profile
370
405
  });
371
406
  if (!cfg.apiKey) {
372
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
407
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
373
408
  process.exit(3);
374
409
  }
375
410
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -388,11 +423,13 @@ var webhookVerifyCommand = defineCommand({
388
423
  },
389
424
  header: {
390
425
  type: "string",
391
- description: "The full X-Curviate-Signature header value (t=\u2026,v1=\u2026). Reads from stdin if omitted."
426
+ description: "The full Curviate-Signature header value from the delivery (t=\u2026,v1=\u2026).",
427
+ required: true
392
428
  },
393
429
  body: {
394
430
  type: "string",
395
- description: "Path to a file containing the raw webhook body, or - for stdin."
431
+ description: "The raw webhook body: inline JSON, a path to a file containing it, or - to read it from stdin.",
432
+ required: true
396
433
  },
397
434
  "max-age-secs": {
398
435
  type: "string",
@@ -402,14 +439,7 @@ var webhookVerifyCommand = defineCommand({
402
439
  async run({ args }) {
403
440
  const flags = args;
404
441
  const out = buildOutputStreams();
405
- let rawBody = "";
406
- if (flags.body) {
407
- if (flags.body === "-") {
408
- rawBody = readFileSync("/dev/stdin", "utf8");
409
- } else {
410
- rawBody = readFileSync(flags.body, "utf8");
411
- }
412
- }
442
+ const rawBody = await resolveWebhookBody(flags.body, out);
413
443
  const signatureHeader = flags.header ?? "";
414
444
  const secret = flags.secret ?? "";
415
445
  const replayWindowSecs = flags["max-age-secs"] ? parseInt(flags["max-age-secs"], 10) : void 0;
@@ -434,6 +464,7 @@ var webhookCommand = defineCommand({
434
464
  }
435
465
  });
436
466
  export {
467
+ resolveWebhookBody,
437
468
  runWebhookCreate,
438
469
  runWebhookDelete,
439
470
  runWebhookEvents,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curviate/cli",
3
- "version": "0.18.1",
3
+ "version": "0.20.0",
4
4
  "private": false,
5
5
  "description": "Official command-line interface for the Curviate API.",
6
6
  "license": "MIT",
@@ -8,10 +8,10 @@
8
8
  "homepage": "https://docs.curviate.com",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "git+https://github.com/curviate/cli.git"
11
+ "url": "git+https://github.com/curviate/curviate-cli.git"
12
12
  },
13
13
  "bugs": {
14
- "url": "https://github.com/curviate/cli/issues"
14
+ "url": "https://github.com/curviate/curviate-cli/issues"
15
15
  },
16
16
  "publishConfig": {
17
17
  "access": "public"
@@ -41,7 +41,7 @@
41
41
  "clean": "rm -rf dist *.tsbuildinfo"
42
42
  },
43
43
  "dependencies": {
44
- "@curviate/sdk": "^0.18.1",
44
+ "@curviate/sdk": "^0.19.0",
45
45
  "citty": "^0.1.6",
46
46
  "open": "^10.1.0"
47
47
  },