@curviate/cli 0.37.0 → 0.40.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 (27) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/README.md +2 -2
  3. package/dist/{account-TYKHUB7X.js → account-LTXAUBBP.js} +5 -3
  4. package/dist/{chunk-ZJ7D3NFS.js → chunk-BGVK73VI.js} +1 -1
  5. package/dist/{chunk-MNDXMGPX.js → chunk-LD5KJSCT.js} +1 -1
  6. package/dist/{chunk-7JU4IXXG.js → chunk-OTBJATDE.js} +27 -1
  7. package/dist/{chunk-BN7L7WSY.js → chunk-T6G5AASF.js} +31 -4
  8. package/dist/cli.js +19 -19
  9. package/dist/{comment-G6RB2PBZ.js → comment-2CSBSBOH.js} +16 -13
  10. package/dist/{company-OWND3W3L.js → company-ZUIUR5UN.js} +32 -21
  11. package/dist/{connect-3E7EC5ZM.js → connect-LSXKNEL2.js} +8 -6
  12. package/dist/{doctor-Z6OSCGKT.js → doctor-FHOHIQPX.js} +1 -1
  13. package/dist/{feed-VDTFIMKN.js → feed-UUHB2FXI.js} +7 -4
  14. package/dist/{group-KDJHY2IM.js → group-NUCO3P2W.js} +10 -6
  15. package/dist/{inbox-DQLX2LR7.js → inbox-DEZTGTPO.js} +14 -11
  16. package/dist/{inboxes-WMNHOPY7.js → inboxes-F3NIQQRK.js} +7 -4
  17. package/dist/{job-ESKS2LDJ.js → job-YMGO3WJH.js} +10 -6
  18. package/dist/{message-5W2R3YHS.js → message-RSBUXI64.js} +3 -3
  19. package/dist/{notification-IGNUH2GR.js → notification-EJ35OD3Q.js} +7 -4
  20. package/dist/{post-NLI76K74.js → post-VHVQ56A7.js} +16 -13
  21. package/dist/{profile-TBKKIICM.js → profile-3CBNI42H.js} +20 -15
  22. package/dist/{recruiter-AEJRHIX5.js → recruiter-M7XUFYNR.js} +18 -15
  23. package/dist/{sales-nav-SW6WJVMD.js → sales-nav-S47OCEUC.js} +44 -19
  24. package/dist/{search-CS6VN5AG.js → search-UWI37MKG.js} +70 -36
  25. package/dist/{setup-YUSWG77F.js → setup-3EQRACT6.js} +1 -1
  26. package/dist/{webhook-NGMRJMQ5.js → webhook-I4U4C4XE.js} +5 -3
  27. package/package.json +2 -2
@@ -22,12 +22,14 @@ import {
22
22
  } from "./chunk-UEAX6KUB.js";
23
23
  import {
24
24
  requireAccount
25
- } from "./chunk-MNDXMGPX.js";
25
+ } from "./chunk-LD5KJSCT.js";
26
26
  import {
27
27
  buildPreviewOutput
28
28
  } from "./chunk-TCUYH5GO.js";
29
29
  import {
30
30
  pageDelayFromFlags,
31
+ readCursorFlag,
32
+ readMaxPagesFlag,
31
33
  readablePage,
32
34
  rejectPaginationModifiersWithoutAll,
33
35
  renderError,
@@ -36,7 +38,7 @@ import {
36
38
  resolveEffectiveConfig,
37
39
  streamAll,
38
40
  writeNdjsonItem
39
- } from "./chunk-7JU4IXXG.js";
41
+ } from "./chunk-OTBJATDE.js";
40
42
  import "./chunk-XZJQQJBE.js";
41
43
  import {
42
44
  createClient,
@@ -274,9 +276,9 @@ async function runRecruiterSearchPeople(client, flags, out, readers = DEFAULT_FI
274
276
  const ns = client.account(accountId);
275
277
  const outOpts = resolveOutputOpts(flags);
276
278
  const all = flags.all ?? false;
277
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
279
+ const maxPages = readMaxPagesFlag(flags, out);
278
280
  const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
279
- const cursor = flags.cursor;
281
+ const cursor = readCursorFlag(flags, out);
280
282
  const assembled = await assembleFilters(flags, readers);
281
283
  if ("error" in assembled) {
282
284
  out.stderr.write(`error: ${assembled.error}
@@ -355,9 +357,9 @@ async function runRecruiterSearchFromUrl(client, flags, out) {
355
357
  const ns = client.account(accountId);
356
358
  const outOpts = resolveOutputOpts(flags);
357
359
  const all = flags.all ?? false;
358
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
360
+ const maxPages = readMaxPagesFlag(flags, out);
359
361
  const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
360
- const cursor = flags.cursor;
362
+ const cursor = readCursorFlag(flags, out);
361
363
  const body = { url };
362
364
  const params = {};
363
365
  if (limit !== void 0) params["limit"] = limit;
@@ -395,9 +397,9 @@ async function runRecruiterListProjects(client, flags, out) {
395
397
  const ns = client.account(accountId);
396
398
  const outOpts = resolveOutputOpts(flags);
397
399
  const all = flags.all ?? false;
398
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
400
+ const maxPages = readMaxPagesFlag(flags, out);
399
401
  const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
400
- const cursor = flags.cursor;
402
+ const cursor = readCursorFlag(flags, out);
401
403
  const params = {};
402
404
  if (limit !== void 0) params["limit"] = limit;
403
405
  if (cursor) params["cursor"] = cursor;
@@ -477,9 +479,9 @@ async function runRecruiterListPipeline(client, flags, out) {
477
479
  const ns = client.account(accountId);
478
480
  const outOpts = resolveOutputOpts(flags);
479
481
  const all = flags.all ?? false;
480
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
482
+ const maxPages = readMaxPagesFlag(flags, out);
481
483
  const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
482
- const cursor = flags.cursor;
484
+ const cursor = readCursorFlag(flags, out);
483
485
  const body = {};
484
486
  if (flags.keywords) body["keywords"] = flags.keywords;
485
487
  if (flags["stage-id"]) body["stage_id"] = flags["stage-id"];
@@ -578,9 +580,9 @@ async function runRecruiterListJobs(client, flags, out) {
578
580
  const ns = client.account(accountId);
579
581
  const outOpts = resolveOutputOpts(flags);
580
582
  const all = flags.all ?? false;
581
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
583
+ const maxPages = readMaxPagesFlag(flags, out);
582
584
  const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
583
- const cursor = flags.cursor;
585
+ const cursor = readCursorFlag(flags, out);
584
586
  const params = {};
585
587
  if (limit !== void 0) params["limit"] = limit;
586
588
  if (cursor) params["cursor"] = cursor;
@@ -788,9 +790,9 @@ async function runRecruiterSearchTalentPool(client, flags, out, readers = DEFAUL
788
790
  const ns = client.account(accountId);
789
791
  const outOpts = resolveOutputOpts(flags);
790
792
  const all = flags.all ?? false;
791
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
793
+ const maxPages = readMaxPagesFlag(flags, out);
792
794
  const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
793
- const cursor = flags.cursor;
795
+ const cursor = readCursorFlag(flags, out);
794
796
  const assembled = await assembleFilters(flags, readers);
795
797
  if ("error" in assembled) {
796
798
  out.stderr.write(`error: ${assembled.error}
@@ -842,7 +844,8 @@ async function runRecruiterListApplicants(client, flags, out) {
842
844
  const body = { channel_id: flags["channel-id"] };
843
845
  const params = {};
844
846
  if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
845
- if (flags.cursor) params["cursor"] = flags.cursor;
847
+ const cursor = readCursorFlag(flags, out);
848
+ if (cursor) params["cursor"] = cursor;
846
849
  try {
847
850
  const result = await ns.recruiter.listApplicants(projectId, body, Object.keys(params).length > 0 ? params : void 0);
848
851
  renderSuccess(result, outOpts, out);
@@ -14,12 +14,14 @@ import {
14
14
  } from "./chunk-UEAX6KUB.js";
15
15
  import {
16
16
  requireAccount
17
- } from "./chunk-MNDXMGPX.js";
17
+ } from "./chunk-LD5KJSCT.js";
18
18
  import {
19
19
  buildPreviewOutput
20
20
  } from "./chunk-TCUYH5GO.js";
21
21
  import {
22
22
  pageDelayFromFlags,
23
+ readCursorFlag,
24
+ readMaxPagesFlag,
23
25
  readablePage,
24
26
  rejectPaginationModifiersWithoutAll,
25
27
  renderError,
@@ -28,14 +30,13 @@ import {
28
30
  resolveEffectiveConfig,
29
31
  streamAll,
30
32
  writeNdjsonItem
31
- } from "./chunk-7JU4IXXG.js";
33
+ } from "./chunk-OTBJATDE.js";
32
34
  import "./chunk-XZJQQJBE.js";
33
35
  import {
34
36
  createClient
35
37
  } from "./chunk-DCZR4M7G.js";
36
38
  import {
37
39
  GLOBAL_FLAGS,
38
- NON_STREAM_FLAGS,
39
40
  READ_SINGLE_FLAGS,
40
41
  WRITE_FLAGS
41
42
  } from "./chunk-XDQHNUEU.js";
@@ -82,9 +83,9 @@ async function runSalesNavSearchPeople(client, flags, out, readers = DEFAULT_FIL
82
83
  const ns = client.account(accountId);
83
84
  const outOpts = resolveOutputOpts(flags);
84
85
  const all = flags.all ?? false;
85
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
86
+ const maxPages = readMaxPagesFlag(flags, out);
86
87
  const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
87
- const cursor = flags.cursor;
88
+ const cursor = readCursorFlag(flags, out);
88
89
  const assembled = await assembleFilters(flags, readers);
89
90
  if ("error" in assembled) {
90
91
  out.stderr.write(`error: ${assembled.error}
@@ -134,9 +135,9 @@ async function runSalesNavSearchCompanies(client, flags, out, readers = DEFAULT_
134
135
  const ns = client.account(accountId);
135
136
  const outOpts = resolveOutputOpts(flags);
136
137
  const all = flags.all ?? false;
137
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
138
+ const maxPages = readMaxPagesFlag(flags, out);
138
139
  const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
139
- const cursor = flags.cursor;
140
+ const cursor = readCursorFlag(flags, out);
140
141
  const assembled = await assembleFilters(flags, readers);
141
142
  if ("error" in assembled) {
142
143
  out.stderr.write(`error: ${assembled.error}
@@ -177,6 +178,7 @@ async function runSalesNavSearchCompanies(client, flags, out, readers = DEFAULT_
177
178
  }
178
179
  async function runSalesNavGetParameters(client, flags, out) {
179
180
  rejectPreviewOnRead(flags.preview, out);
181
+ rejectPaginationModifiersWithoutAll(flags, out);
180
182
  if (!flags.type) {
181
183
  out.stderr.write("error: --type is required.\n");
182
184
  process.exit(2);
@@ -184,11 +186,27 @@ async function runSalesNavGetParameters(client, flags, out) {
184
186
  const accountId = await requireAccount(client, flags, out);
185
187
  const ns = client.account(accountId);
186
188
  const outOpts = resolveOutputOpts(flags);
189
+ const all = flags.all ?? false;
190
+ const maxPages = readMaxPagesFlag(flags, out);
187
191
  const params = { type: flags.type };
188
192
  if (flags.keywords) params.keywords = flags.keywords;
189
193
  if (flags.limit) params.limit = parseInt(flags.limit, 10);
194
+ const cursor = readCursorFlag(flags, out);
195
+ if (cursor) params.cursor = cursor;
190
196
  try {
197
+ if (all) {
198
+ const fn = (p) => ns.salesNavigator.getParameters(p);
199
+ for await (const item of streamAll(fn, params, {
200
+ maxPages,
201
+ out,
202
+ pageDelayMs: pageDelayFromFlags(flags)
203
+ })) {
204
+ writeNdjsonItem(out, item, outOpts.fields);
205
+ }
206
+ return;
207
+ }
191
208
  const result = await ns.salesNavigator.getParameters(params);
209
+ readablePage(result);
192
210
  renderSuccess(result, outOpts, out);
193
211
  } catch (err) {
194
212
  await handleSdkError(err, outOpts, out);
@@ -202,9 +220,9 @@ async function runSalesNavSearchFromUrl(client, flags, out) {
202
220
  const ns = client.account(accountId);
203
221
  const outOpts = resolveOutputOpts(flags);
204
222
  const all = flags.all ?? false;
205
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
223
+ const maxPages = readMaxPagesFlag(flags, out);
206
224
  const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
207
- const cursor = flags.cursor;
225
+ const cursor = readCursorFlag(flags, out);
208
226
  const body = { url };
209
227
  const params = {};
210
228
  if (limit !== void 0) params["limit"] = limit;
@@ -345,10 +363,11 @@ async function runSalesNavAccountLists(client, flags, out) {
345
363
  const ns = client.account(accountId);
346
364
  const outOpts = resolveOutputOpts(flags);
347
365
  const all = flags.all ?? false;
348
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
366
+ const maxPages = readMaxPagesFlag(flags, out);
349
367
  const params = {};
350
368
  if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
351
- if (flags.cursor) params["cursor"] = flags.cursor;
369
+ const cursor = readCursorFlag(flags, out);
370
+ if (cursor) params["cursor"] = cursor;
352
371
  try {
353
372
  if (all) {
354
373
  const fn = (p) => ns.salesNavigator.accountLists(p);
@@ -375,10 +394,11 @@ async function runSalesNavLeadLists(client, flags, out) {
375
394
  const ns = client.account(accountId);
376
395
  const outOpts = resolveOutputOpts(flags);
377
396
  const all = flags.all ?? false;
378
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
397
+ const maxPages = readMaxPagesFlag(flags, out);
379
398
  const params = {};
380
399
  if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
381
- if (flags.cursor) params["cursor"] = flags.cursor;
400
+ const cursor = readCursorFlag(flags, out);
401
+ if (cursor) params["cursor"] = cursor;
382
402
  try {
383
403
  if (all) {
384
404
  const fn = (p) => ns.salesNavigator.leadLists(p);
@@ -406,14 +426,15 @@ async function runSalesNavBrowseAccountList(client, flags, out) {
406
426
  const ns = client.account(accountId);
407
427
  const outOpts = resolveOutputOpts(flags);
408
428
  const all = flags.all ?? false;
409
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
429
+ const maxPages = readMaxPagesFlag(flags, out);
410
430
  const body = {};
411
431
  if (flags.filter) body["filter"] = flags.filter;
412
432
  if (flags["sort-by"]) body["sort_by"] = flags["sort-by"];
413
433
  if (flags["sort-order"]) body["sort_order"] = flags["sort-order"];
414
434
  const params = {};
415
435
  if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
416
- if (flags.cursor) params["cursor"] = flags.cursor;
436
+ const cursor = readCursorFlag(flags, out);
437
+ if (cursor) params["cursor"] = cursor;
417
438
  try {
418
439
  if (all) {
419
440
  const fn = (p) => ns.salesNavigator.browseAccountList(listId, body, p);
@@ -441,14 +462,15 @@ async function runSalesNavBrowseLeadList(client, flags, out) {
441
462
  const ns = client.account(accountId);
442
463
  const outOpts = resolveOutputOpts(flags);
443
464
  const all = flags.all ?? false;
444
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
465
+ const maxPages = readMaxPagesFlag(flags, out);
445
466
  const body = {};
446
467
  if (flags.spotlight) body["spotlight"] = flags.spotlight;
447
468
  if (flags["sort-by"]) body["sort_by"] = flags["sort-by"];
448
469
  if (flags["sort-order"]) body["sort_order"] = flags["sort-order"];
449
470
  const params = {};
450
471
  if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
451
- if (flags.cursor) params["cursor"] = flags.cursor;
472
+ const cursor = readCursorFlag(flags, out);
473
+ if (cursor) params["cursor"] = cursor;
452
474
  try {
453
475
  if (all) {
454
476
  const fn = (p) => ns.salesNavigator.browseLeadList(listId, body, p);
@@ -593,9 +615,12 @@ var salesNavSearchCompaniesCommand = defineCommand({
593
615
  }
594
616
  });
595
617
  var salesNavSearchParametersCommand = defineCommand({
596
- meta: { name: "parameters", description: "Resolve Sales Navigator filter parameter IDs." },
618
+ meta: {
619
+ name: "parameters",
620
+ description: "Resolve Sales Navigator filter parameter IDs. Paginated: --cursor pages manually, --all streams every page as NDJSON."
621
+ },
597
622
  args: {
598
- ...NON_STREAM_FLAGS,
623
+ ...GLOBAL_FLAGS,
599
624
  type: {
600
625
  type: "string",
601
626
  description: "Parameter type to resolve. One of: GROUPS, SALES_INDUSTRY, DEPARTMENT, PERSONA, ACCOUNT_LISTS, LEAD_LISTS, TECHNOLOGIES, SAVED_ACCOUNTS, SAVED_SEARCHES, RECENT_SEARCHES, REGION, POSTAL_CODE.",
@@ -17,9 +17,11 @@ import {
17
17
  } from "./chunk-XP2LN6F6.js";
18
18
  import {
19
19
  requireAccount
20
- } from "./chunk-MNDXMGPX.js";
20
+ } from "./chunk-LD5KJSCT.js";
21
21
  import {
22
22
  pageDelayFromFlags,
23
+ readCursorFlag,
24
+ readMaxPagesFlag,
23
25
  readablePage,
24
26
  rejectPaginationModifiersWithoutAll,
25
27
  renderError,
@@ -28,14 +30,13 @@ import {
28
30
  resolveEffectiveConfig,
29
31
  streamAll,
30
32
  writeNdjsonItem
31
- } from "./chunk-7JU4IXXG.js";
33
+ } from "./chunk-OTBJATDE.js";
32
34
  import "./chunk-XZJQQJBE.js";
33
35
  import {
34
36
  createClient
35
37
  } from "./chunk-DCZR4M7G.js";
36
38
  import {
37
- GLOBAL_FLAGS,
38
- NON_STREAM_FLAGS
39
+ GLOBAL_FLAGS
39
40
  } from "./chunk-XDQHNUEU.js";
40
41
 
41
42
  // src/commands/search.ts
@@ -73,12 +74,6 @@ function rejectPreviewOnRead(preview, out) {
73
74
  process.exit(2);
74
75
  }
75
76
  }
76
- function rejectAllOnNonPaginated(all, out) {
77
- if (all) {
78
- out.stderr.write("error: --all is not supported on non-paginated commands.\n");
79
- process.exit(2);
80
- }
81
- }
82
77
  function resolveOutputOpts(flags) {
83
78
  return {
84
79
  json: (flags.json ?? false) || !process.stdout.isTTY,
@@ -87,9 +82,10 @@ function resolveOutputOpts(flags) {
87
82
  verbose: flags.verbose ?? false
88
83
  };
89
84
  }
90
- function applyCommonSearchFlags(body, flags) {
85
+ function applyCommonSearchFlags(body, flags, out) {
91
86
  if (flags.keywords) body["keywords"] = flags.keywords;
92
- if (flags.cursor) body["cursor"] = flags.cursor;
87
+ const cursor = readCursorFlag(flags, out);
88
+ if (cursor) body["cursor"] = cursor;
93
89
  if (flags.limit) body["limit"] = parseInt(flags.limit, 10);
94
90
  }
95
91
  function mergeNested(body, key, patch) {
@@ -171,11 +167,11 @@ var NAMED_FLAG_MAPPERS = {
171
167
  }
172
168
  }
173
169
  };
174
- async function buildSearchBody(kind, flags, readers) {
170
+ async function buildSearchBody(kind, flags, readers, out) {
175
171
  const assembled = await assembleFilters(flags, readers);
176
172
  if ("error" in assembled) return assembled;
177
173
  const body = assembled.body;
178
- applyCommonSearchFlags(body, flags);
174
+ applyCommonSearchFlags(body, flags, out);
179
175
  const mapperError = NAMED_FLAG_MAPPERS[kind](body, flags);
180
176
  if (mapperError) return { error: mapperError };
181
177
  return { body };
@@ -197,8 +193,8 @@ async function runSearchPeople(client, flags, out, readers = DEFAULT_FILTER_READ
197
193
  const outOpts = resolveOutputOpts(flags);
198
194
  const verbose = flags.verbose ?? false;
199
195
  const all = flags.all ?? false;
200
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
201
- const assembled = await buildSearchBody("people", flags, readers);
196
+ const maxPages = readMaxPagesFlag(flags, out);
197
+ const assembled = await buildSearchBody("people", flags, readers, out);
202
198
  if ("error" in assembled) {
203
199
  out.stderr.write(`error: ${assembled.error}
204
200
  `);
@@ -240,8 +236,8 @@ async function runSearchCompanies(client, flags, out, readers = DEFAULT_FILTER_R
240
236
  const outOpts = resolveOutputOpts(flags);
241
237
  const verbose = flags.verbose ?? false;
242
238
  const all = flags.all ?? false;
243
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
244
- const assembled = await buildSearchBody("companies", flags, readers);
239
+ const maxPages = readMaxPagesFlag(flags, out);
240
+ const assembled = await buildSearchBody("companies", flags, readers, out);
245
241
  if ("error" in assembled) {
246
242
  out.stderr.write(`error: ${assembled.error}
247
243
  `);
@@ -283,8 +279,8 @@ async function runSearchPosts(client, flags, out, readers = DEFAULT_FILTER_READE
283
279
  const outOpts = resolveOutputOpts(flags);
284
280
  const verbose = flags.verbose ?? false;
285
281
  const all = flags.all ?? false;
286
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
287
- const assembled = await buildSearchBody("posts", flags, readers);
282
+ const maxPages = readMaxPagesFlag(flags, out);
283
+ const assembled = await buildSearchBody("posts", flags, readers, out);
288
284
  if ("error" in assembled) {
289
285
  out.stderr.write(`error: ${assembled.error}
290
286
  `);
@@ -326,8 +322,8 @@ async function runSearchJobs(client, flags, out, readers = DEFAULT_FILTER_READER
326
322
  const outOpts = resolveOutputOpts(flags);
327
323
  const verbose = flags.verbose ?? false;
328
324
  const all = flags.all ?? false;
329
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
330
- const assembled = await buildSearchBody("jobs", flags, readers);
325
+ const maxPages = readMaxPagesFlag(flags, out);
326
+ const assembled = await buildSearchBody("jobs", flags, readers, out);
331
327
  if ("error" in assembled) {
332
328
  out.stderr.write(`error: ${assembled.error}
333
329
  `);
@@ -363,7 +359,7 @@ async function runSearchJobs(client, flags, out, readers = DEFAULT_FILTER_READER
363
359
  }
364
360
  async function runSearchParameters(client, flags, out) {
365
361
  rejectPreviewOnRead(flags.preview, out);
366
- rejectAllOnNonPaginated(flags.all, out);
362
+ rejectPaginationModifiersWithoutAll(flags, out);
367
363
  if (!flags.type) {
368
364
  out.stderr.write("error: --type is required.\n");
369
365
  process.exit(2);
@@ -375,13 +371,29 @@ async function runSearchParameters(client, flags, out) {
375
371
  const accountId = await requireAccount(client, flags, out);
376
372
  const ns = client.account(accountId);
377
373
  const outOpts = resolveOutputOpts(flags);
374
+ const all = flags.all ?? false;
375
+ const maxPages = readMaxPagesFlag(flags, out);
378
376
  const query = {
379
377
  type: flags.type,
380
378
  keywords: flags.keywords
381
379
  };
382
380
  if (flags.limit) query.limit = parseInt(flags.limit, 10);
381
+ const cursor = readCursorFlag(flags, out);
382
+ if (cursor) query.cursor = cursor;
383
383
  try {
384
+ if (all) {
385
+ const fn = (p) => ns.search.getParameters(p);
386
+ for await (const item of streamAll(fn, query, {
387
+ maxPages,
388
+ out,
389
+ pageDelayMs: pageDelayFromFlags(flags)
390
+ })) {
391
+ writeNdjsonItem(out, item, outOpts.fields);
392
+ }
393
+ return;
394
+ }
384
395
  const result = await ns.search.getParameters(query);
396
+ readablePage(result);
385
397
  renderSuccess(result, outOpts, out);
386
398
  } catch (err) {
387
399
  const { CurviateError } = await import("@curviate/sdk");
@@ -406,10 +418,11 @@ async function runSearchGroups(client, flags, out) {
406
418
  const ns = client.account(accountId);
407
419
  const outOpts = resolveOutputOpts(flags);
408
420
  const all = flags.all ?? false;
409
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
421
+ const maxPages = readMaxPagesFlag(flags, out);
410
422
  const query = { keywords };
411
423
  if (flags.limit) query.limit = parseInt(flags.limit, 10);
412
- if (flags.cursor) query.cursor = flags.cursor;
424
+ const cursor = readCursorFlag(flags, out);
425
+ if (cursor) query.cursor = cursor;
413
426
  try {
414
427
  if (all) {
415
428
  const fn = (p) => ns.search.groups(p);
@@ -443,7 +456,7 @@ async function runSearchServices(client, flags, out) {
443
456
  const ns = client.account(accountId);
444
457
  const outOpts = resolveOutputOpts(flags);
445
458
  const all = flags.all ?? false;
446
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
459
+ const maxPages = readMaxPagesFlag(flags, out);
447
460
  const body = {};
448
461
  if (flags.keywords) body["keywords"] = flags.keywords;
449
462
  if (flags["service-category"]) body["service_category"] = splitCsv(flags["service-category"]);
@@ -453,7 +466,8 @@ async function runSearchServices(client, flags, out) {
453
466
  }
454
467
  if (flags.language) body["language"] = splitCsv(flags.language);
455
468
  if (flags.limit) body["limit"] = parseInt(flags.limit, 10);
456
- if (flags.cursor) body["cursor"] = flags.cursor;
469
+ const cursor = readCursorFlag(flags, out);
470
+ if (cursor) body["cursor"] = cursor;
457
471
  try {
458
472
  if (all) {
459
473
  const fn = (p) => ns.search.services(p);
@@ -482,7 +496,7 @@ async function runSearchServices(client, flags, out) {
482
496
  }
483
497
  async function runSearchServiceParameters(client, flags, out) {
484
498
  rejectPreviewOnRead(flags.preview, out);
485
- rejectAllOnNonPaginated(flags.all, out);
499
+ rejectPaginationModifiersWithoutAll(flags, out);
486
500
  if (!flags.keywords) {
487
501
  out.stderr.write("error: --keywords is required.\n");
488
502
  process.exit(2);
@@ -490,11 +504,27 @@ async function runSearchServiceParameters(client, flags, out) {
490
504
  const accountId = await requireAccount(client, flags, out);
491
505
  const ns = client.account(accountId);
492
506
  const outOpts = resolveOutputOpts(flags);
507
+ const all = flags.all ?? false;
508
+ const maxPages = readMaxPagesFlag(flags, out);
493
509
  const query = { keywords: flags.keywords };
494
510
  if (flags.type) query.type = flags.type;
495
511
  if (flags.limit) query.limit = parseInt(flags.limit, 10);
512
+ const cursor = readCursorFlag(flags, out);
513
+ if (cursor) query.cursor = cursor;
496
514
  try {
515
+ if (all) {
516
+ const fn = (p) => ns.search.getServiceParameters(p);
517
+ for await (const item of streamAll(fn, query, {
518
+ maxPages,
519
+ out,
520
+ pageDelayMs: pageDelayFromFlags(flags)
521
+ })) {
522
+ writeNdjsonItem(out, item, outOpts.fields);
523
+ }
524
+ return;
525
+ }
497
526
  const result = await ns.search.getServiceParameters(query);
527
+ readablePage(result);
498
528
  renderSuccess(result, outOpts, out);
499
529
  } catch (err) {
500
530
  const { CurviateError } = await import("@curviate/sdk");
@@ -516,10 +546,11 @@ async function runSearchFromUrl(client, flags, out) {
516
546
  const outOpts = resolveOutputOpts(flags);
517
547
  const verbose = flags.verbose ?? false;
518
548
  const all = flags.all ?? false;
519
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
549
+ const maxPages = readMaxPagesFlag(flags, out);
520
550
  const body = { url };
521
551
  if (flags.limit) body.limit = parseInt(flags.limit, 10);
522
- if (flags.cursor) body.cursor = flags.cursor;
552
+ const cursor = readCursorFlag(flags, out);
553
+ if (cursor) body.cursor = cursor;
523
554
  try {
524
555
  if (all) {
525
556
  const fn = (p) => ns.search.fromUrl(p);
@@ -558,7 +589,7 @@ var searchPeopleCommand = defineCommand({
558
589
  "past-company": { type: "string", description: "Past company ids (comma-separated)." },
559
590
  school: { type: "string", description: "School ids (comma-separated)." },
560
591
  "network-distance": { type: "string", description: "Network distance, 1-3 (comma-separated)." },
561
- "connections-of": { type: "string", description: 'member id(s), comma-separated (resolve: `curviate search parameters --type CONNECTIONS --keywords "<name>"`)' },
592
+ "connections-of": { type: "string", description: 'member id(s), comma-separated (resolve: `curviate search parameters --type RELATION --keywords "<name>"`)' },
562
593
  "followers-of": { type: "string", description: 'member id(s), comma-separated (resolve: `curviate search parameters --type PEOPLE --keywords "<name>"`)' },
563
594
  // People-specific filter flags
564
595
  title: { type: "string", description: "Job title keyword filter (maps to advanced_keywords.title)." },
@@ -701,12 +732,15 @@ var searchJobsCommand = defineCommand({
701
732
  }
702
733
  });
703
734
  var searchParametersCommand = defineCommand({
704
- meta: { name: "parameters", description: "Resolve human-readable terms to opaque filter IDs." },
735
+ meta: {
736
+ name: "parameters",
737
+ description: "Resolve human-readable terms to opaque filter IDs. Paginated: --cursor pages manually, --all streams every page as NDJSON."
738
+ },
705
739
  args: {
706
- ...NON_STREAM_FLAGS,
740
+ ...GLOBAL_FLAGS,
707
741
  type: {
708
742
  type: "string",
709
- description: "Parameter type: LOCATION, PEOPLE, CONNECTIONS, COMPANY, SCHOOL, INDUSTRY, SERVICE, JOB_FUNCTION, JOB_TITLE, EMPLOYMENT_TYPE, SKILL.",
743
+ description: "Parameter type: LOCATION, PEOPLE, RELATION, COMPANY, SCHOOL, INDUSTRY, SERVICE, JOB_FUNCTION, JOB_TITLE, EMPLOYMENT_TYPE, SKILL.",
710
744
  required: true
711
745
  },
712
746
  keywords: { type: "string", description: "Human term to resolve (required for every --type, incl. EMPLOYMENT_TYPE).", required: true }
@@ -787,10 +821,10 @@ var searchServicesCommand = defineCommand({
787
821
  var searchServiceParametersCommand = defineCommand({
788
822
  meta: {
789
823
  name: "service-parameters",
790
- description: "Resolve human-readable service-filter terms into the opaque ids 'search services' accepts."
824
+ description: "Resolve human-readable service-filter terms into the opaque ids 'search services' accepts. Paginated: --cursor pages manually, --all streams every page as NDJSON."
791
825
  },
792
826
  args: {
793
- ...NON_STREAM_FLAGS,
827
+ ...GLOBAL_FLAGS,
794
828
  type: {
795
829
  type: "string",
796
830
  description: "Filter type to resolve: service_category (default) or location."
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  readablePage,
7
7
  resolveEffectiveConfig
8
- } from "./chunk-7JU4IXXG.js";
8
+ } from "./chunk-OTBJATDE.js";
9
9
  import {
10
10
  getExitCode
11
11
  } from "./chunk-XZJQQJBE.js";
@@ -4,6 +4,8 @@ import {
4
4
  } from "./chunk-TCUYH5GO.js";
5
5
  import {
6
6
  pageDelayFromFlags,
7
+ readCursorFlag,
8
+ readMaxPagesFlag,
7
9
  readablePage,
8
10
  rejectPaginationModifiersWithoutAll,
9
11
  renderError,
@@ -12,7 +14,7 @@ import {
12
14
  resolveEffectiveConfig,
13
15
  streamAll,
14
16
  writeNdjsonItem
15
- } from "./chunk-7JU4IXXG.js";
17
+ } from "./chunk-OTBJATDE.js";
16
18
  import {
17
19
  createClient
18
20
  } from "./chunk-DCZR4M7G.js";
@@ -106,9 +108,9 @@ async function runWebhookList(client, flags, out) {
106
108
  rejectPaginationModifiersWithoutAll(flags, out);
107
109
  const outOpts = resolveOutputOpts(flags);
108
110
  const all = flags.all ?? false;
109
- const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
111
+ const maxPages = readMaxPagesFlag(flags, out);
110
112
  const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
111
- const cursor = flags.cursor;
113
+ const cursor = readCursorFlag(flags, out);
112
114
  const params = {};
113
115
  if (limit !== void 0) params["limit"] = limit;
114
116
  if (cursor) params["cursor"] = cursor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curviate/cli",
3
- "version": "0.37.0",
3
+ "version": "0.40.0",
4
4
  "private": false,
5
5
  "description": "Official command-line interface for the Curviate API.",
6
6
  "license": "MIT",
@@ -46,7 +46,7 @@
46
46
  "clean": "rm -rf dist *.tsbuildinfo"
47
47
  },
48
48
  "dependencies": {
49
- "@curviate/sdk": "0.35.0",
49
+ "@curviate/sdk": "0.37.0",
50
50
  "citty": "^0.1.6",
51
51
  "open": "^10.1.0"
52
52
  },