@curviate/cli 0.19.0 → 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 +95 -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-XEEBBCRZ.js → company-BX4VDXZX.js} +19 -18
  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-KAUDRE5K.js → feed-4ROKUBG5.js} +3 -3
  13. package/dist/{group-LPVVJ2JX.js → group-L7TQEEFN.js} +7 -7
  14. package/dist/{inbox-BXCWHGWP.js → inbox-GMGZVDTQ.js} +9 -9
  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-RYFDHM3G.js → notification-45XFT3S4.js} +5 -5
  20. package/dist/{post-HK6HHIKV.js → post-RETV3WUG.js} +8 -8
  21. package/dist/{profile-PES67647.js → profile-A2TWF4HB.js} +13 -13
  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-O2LACGHE.js → search-DH6BJFQC.js} +13 -13
  25. package/dist/{webhook-QFSZN3P2.js → webhook-LED6AKF3.js} +50 -19
  26. package/package.json +2 -2
@@ -26,12 +26,12 @@ import {
26
26
  renderSuccess,
27
27
  renderUnexpectedError,
28
28
  resolveEffectiveConfig
29
- } from "./chunk-M33MI53G.js";
29
+ } from "./chunk-HDQUEFD2.js";
30
30
  import {
31
31
  GLOBAL_FLAGS,
32
32
  READ_SINGLE_FLAGS,
33
33
  WRITE_FLAGS
34
- } from "./chunk-TMU3CSPR.js";
34
+ } from "./chunk-DW2HCRXJ.js";
35
35
 
36
36
  // src/commands/sales-nav.ts
37
37
  import { defineCommand } from "citty";
@@ -488,7 +488,7 @@ var salesNavMessageNewCommand = defineCommand({
488
488
  ...WRITE_FLAGS,
489
489
  to: {
490
490
  type: "string",
491
- description: "Recipient's LinkedIn provider ID (ACw\u2026 format, e.g. from a Sales Navigator search result or profile). Not resolved from a URL/slug \u2014 pass the provider ID directly.",
491
+ description: "Recipient's LinkedIn provider ID (ACw\u2026 format, e.g. from a Sales Navigator search result or profile). Not resolved from a URL/slug. Pass the provider ID directly.",
492
492
  required: true
493
493
  },
494
494
  subject: { type: "string", description: "Message subject line (required for Sales Navigator messaging).", required: true },
@@ -507,7 +507,7 @@ var salesNavMessageNewCommand = defineCommand({
507
507
  profile: flags.profile
508
508
  });
509
509
  if (!cfg.apiKey) {
510
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
510
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
511
511
  process.exit(3);
512
512
  }
513
513
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -547,7 +547,7 @@ var salesNavSearchPeopleCommand = defineCommand({
547
547
  profile: flags.profile
548
548
  });
549
549
  if (!cfg.apiKey) {
550
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
550
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
551
551
  process.exit(3);
552
552
  }
553
553
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -576,7 +576,7 @@ var salesNavSearchCompaniesCommand = defineCommand({
576
576
  profile: flags.profile
577
577
  });
578
578
  if (!cfg.apiKey) {
579
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
579
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
580
580
  process.exit(3);
581
581
  }
582
582
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -605,7 +605,7 @@ var salesNavSearchParametersCommand = defineCommand({
605
605
  profile: flags.profile
606
606
  });
607
607
  if (!cfg.apiKey) {
608
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
608
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
609
609
  process.exit(3);
610
610
  }
611
611
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -644,7 +644,7 @@ var salesNavSearchCommand = defineCommand({
644
644
  profile: flags.profile
645
645
  });
646
646
  if (!cfg.apiKey) {
647
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
647
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
648
648
  process.exit(3);
649
649
  }
650
650
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -669,7 +669,7 @@ var salesNavProfileCommand = defineCommand({
669
669
  profile: flags.profile
670
670
  });
671
671
  if (!cfg.apiKey) {
672
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
672
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
673
673
  process.exit(3);
674
674
  }
675
675
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -683,7 +683,7 @@ var salesNavSaveLeadCommand = defineCommand({
683
683
  // Write command: WRITE_FLAGS omits pagination/projection flags
684
684
  ...WRITE_FLAGS,
685
685
  userId: { type: "positional", description: "Sales Navigator member ID (ACw\u2026 format)." },
686
- list: { type: "string", description: "Lead list ID to save the member into (required \u2014 the v2 save always targets a specific list).", required: true }
686
+ list: { type: "string", description: "Lead list ID to save the member into (required; the v2 save always targets a specific list).", required: true }
687
687
  },
688
688
  async run({ args }) {
689
689
  const flags = args;
@@ -695,7 +695,7 @@ var salesNavSaveLeadCommand = defineCommand({
695
695
  profile: flags.profile
696
696
  });
697
697
  if (!cfg.apiKey) {
698
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
698
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
699
699
  process.exit(3);
700
700
  }
701
701
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -716,7 +716,7 @@ var salesNavAccountListsCommand = defineCommand({
716
716
  profile: flags.profile
717
717
  });
718
718
  if (!cfg.apiKey) {
719
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
719
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
720
720
  process.exit(3);
721
721
  }
722
722
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -737,7 +737,7 @@ var salesNavLeadListsCommand = defineCommand({
737
737
  profile: flags.profile
738
738
  });
739
739
  if (!cfg.apiKey) {
740
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
740
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
741
741
  process.exit(3);
742
742
  }
743
743
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -764,7 +764,7 @@ var salesNavBrowseAccountListCommand = defineCommand({
764
764
  profile: flags.profile
765
765
  });
766
766
  if (!cfg.apiKey) {
767
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
767
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
768
768
  process.exit(3);
769
769
  }
770
770
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -791,7 +791,7 @@ var salesNavBrowseLeadListCommand = defineCommand({
791
791
  profile: flags.profile
792
792
  });
793
793
  if (!cfg.apiKey) {
794
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
794
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
795
795
  process.exit(3);
796
796
  }
797
797
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -817,7 +817,7 @@ var salesNavSaveAccountCommand = defineCommand({
817
817
  profile: flags.profile
818
818
  });
819
819
  if (!cfg.apiKey) {
820
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
820
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
821
821
  process.exit(3);
822
822
  }
823
823
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -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";
@@ -558,7 +558,7 @@ var searchPeopleCommand = defineCommand({
558
558
  profile: flags.profile
559
559
  });
560
560
  if (!cfg.apiKey) {
561
- 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");
562
562
  process.exit(3);
563
563
  }
564
564
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -591,7 +591,7 @@ var searchCompaniesCommand = defineCommand({
591
591
  profile: flags.profile
592
592
  });
593
593
  if (!cfg.apiKey) {
594
- 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");
595
595
  process.exit(3);
596
596
  }
597
597
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -627,7 +627,7 @@ var searchPostsCommand = defineCommand({
627
627
  profile: flags.profile
628
628
  });
629
629
  if (!cfg.apiKey) {
630
- 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");
631
631
  process.exit(3);
632
632
  }
633
633
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -649,11 +649,11 @@ var searchJobsCommand = defineCommand({
649
649
  "job-type": { type: "string", description: "job type, independent 7-value enum: full_time|part_time|contract|temporary|volunteer|internship|other (comma-separated)" },
650
650
  company: { type: "string", description: "Company ids (comma-separated)." },
651
651
  "sort-by": { type: "string", description: "Sort order (e.g. relevance, recent)." },
652
- "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)" },
653
653
  region: { type: "string", description: "alias for --location (same body field: region)" },
654
654
  title: {
655
655
  type: "string",
656
- 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"
657
657
  },
658
658
  presence: { type: "string", description: "work presence, comma-separated: on_site, hybrid, remote" },
659
659
  benefits: { type: "string", description: "benefit ids, comma-separated" },
@@ -677,7 +677,7 @@ var searchJobsCommand = defineCommand({
677
677
  profile: flags.profile
678
678
  });
679
679
  if (!cfg.apiKey) {
680
- 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");
681
681
  process.exit(3);
682
682
  }
683
683
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -706,7 +706,7 @@ var searchParametersCommand = defineCommand({
706
706
  profile: flags.profile
707
707
  });
708
708
  if (!cfg.apiKey) {
709
- 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");
710
710
  process.exit(3);
711
711
  }
712
712
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -730,7 +730,7 @@ var searchGroupsCommand = defineCommand({
730
730
  profile: flags.profile
731
731
  });
732
732
  if (!cfg.apiKey) {
733
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
733
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
734
734
  process.exit(3);
735
735
  }
736
736
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -761,7 +761,7 @@ var searchServicesCommand = defineCommand({
761
761
  profile: flags.profile
762
762
  });
763
763
  if (!cfg.apiKey) {
764
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
764
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
765
765
  process.exit(3);
766
766
  }
767
767
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -792,7 +792,7 @@ var searchServiceParametersCommand = defineCommand({
792
792
  profile: flags.profile
793
793
  });
794
794
  if (!cfg.apiKey) {
795
- process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
795
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
796
796
  process.exit(3);
797
797
  }
798
798
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -836,7 +836,7 @@ var searchCommand = defineCommand({
836
836
  profile: flags.profile
837
837
  });
838
838
  if (!cfg.apiKey) {
839
- 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");
840
840
  process.exit(3);
841
841
  }
842
842
  const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
@@ -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.19.0",
3
+ "version": "0.20.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.18.1",
44
+ "@curviate/sdk": "^0.19.0",
45
45
  "citty": "^0.1.6",
46
46
  "open": "^10.1.0"
47
47
  },