@curviate/cli 0.38.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.
- package/CHANGELOG.md +87 -0
- package/README.md +2 -2
- package/dist/{account-TYKHUB7X.js → account-LTXAUBBP.js} +5 -3
- package/dist/{chunk-ZJ7D3NFS.js → chunk-BGVK73VI.js} +1 -1
- package/dist/{chunk-MNDXMGPX.js → chunk-LD5KJSCT.js} +1 -1
- package/dist/{chunk-7JU4IXXG.js → chunk-OTBJATDE.js} +27 -1
- package/dist/{chunk-BN7L7WSY.js → chunk-T6G5AASF.js} +31 -4
- package/dist/cli.js +19 -19
- package/dist/{comment-G6RB2PBZ.js → comment-2CSBSBOH.js} +16 -13
- package/dist/{company-OWND3W3L.js → company-ZUIUR5UN.js} +32 -21
- package/dist/{connect-3E7EC5ZM.js → connect-LSXKNEL2.js} +8 -6
- package/dist/{doctor-Z6OSCGKT.js → doctor-FHOHIQPX.js} +1 -1
- package/dist/{feed-VDTFIMKN.js → feed-UUHB2FXI.js} +7 -4
- package/dist/{group-KDJHY2IM.js → group-NUCO3P2W.js} +10 -6
- package/dist/{inbox-DQLX2LR7.js → inbox-DEZTGTPO.js} +14 -11
- package/dist/{inboxes-WMNHOPY7.js → inboxes-F3NIQQRK.js} +7 -4
- package/dist/{job-ESKS2LDJ.js → job-YMGO3WJH.js} +10 -6
- package/dist/{message-5W2R3YHS.js → message-RSBUXI64.js} +3 -3
- package/dist/{notification-IGNUH2GR.js → notification-EJ35OD3Q.js} +7 -4
- package/dist/{post-NLI76K74.js → post-VHVQ56A7.js} +16 -13
- package/dist/{profile-TBKKIICM.js → profile-3CBNI42H.js} +20 -15
- package/dist/{recruiter-AEJRHIX5.js → recruiter-M7XUFYNR.js} +18 -15
- package/dist/{sales-nav-SW6WJVMD.js → sales-nav-S47OCEUC.js} +44 -19
- package/dist/{search-WRMVQU6C.js → search-UWI37MKG.js} +51 -35
- package/dist/{setup-YUSWG77F.js → setup-3EQRACT6.js} +1 -1
- package/dist/{webhook-NGMRJMQ5.js → webhook-I4U4C4XE.js} +5 -3
- package/package.json +2 -2
|
@@ -14,12 +14,14 @@ import {
|
|
|
14
14
|
} from "./chunk-UEAX6KUB.js";
|
|
15
15
|
import {
|
|
16
16
|
requireAccount
|
|
17
|
-
} from "./chunk-
|
|
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-
|
|
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 =
|
|
86
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
86
87
|
const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
|
|
87
|
-
const cursor = flags
|
|
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 =
|
|
138
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
138
139
|
const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
|
|
139
|
-
const cursor = flags
|
|
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 =
|
|
223
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
206
224
|
const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
|
|
207
|
-
const cursor = flags
|
|
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 =
|
|
366
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
349
367
|
const params = {};
|
|
350
368
|
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
351
|
-
|
|
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 =
|
|
397
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
379
398
|
const params = {};
|
|
380
399
|
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
381
|
-
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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: {
|
|
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
|
-
...
|
|
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-
|
|
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-
|
|
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
|
-
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
`);
|
|
@@ -376,13 +372,14 @@ async function runSearchParameters(client, flags, out) {
|
|
|
376
372
|
const ns = client.account(accountId);
|
|
377
373
|
const outOpts = resolveOutputOpts(flags);
|
|
378
374
|
const all = flags.all ?? false;
|
|
379
|
-
const maxPages =
|
|
375
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
380
376
|
const query = {
|
|
381
377
|
type: flags.type,
|
|
382
378
|
keywords: flags.keywords
|
|
383
379
|
};
|
|
384
380
|
if (flags.limit) query.limit = parseInt(flags.limit, 10);
|
|
385
|
-
|
|
381
|
+
const cursor = readCursorFlag(flags, out);
|
|
382
|
+
if (cursor) query.cursor = cursor;
|
|
386
383
|
try {
|
|
387
384
|
if (all) {
|
|
388
385
|
const fn = (p) => ns.search.getParameters(p);
|
|
@@ -421,10 +418,11 @@ async function runSearchGroups(client, flags, out) {
|
|
|
421
418
|
const ns = client.account(accountId);
|
|
422
419
|
const outOpts = resolveOutputOpts(flags);
|
|
423
420
|
const all = flags.all ?? false;
|
|
424
|
-
const maxPages =
|
|
421
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
425
422
|
const query = { keywords };
|
|
426
423
|
if (flags.limit) query.limit = parseInt(flags.limit, 10);
|
|
427
|
-
|
|
424
|
+
const cursor = readCursorFlag(flags, out);
|
|
425
|
+
if (cursor) query.cursor = cursor;
|
|
428
426
|
try {
|
|
429
427
|
if (all) {
|
|
430
428
|
const fn = (p) => ns.search.groups(p);
|
|
@@ -458,7 +456,7 @@ async function runSearchServices(client, flags, out) {
|
|
|
458
456
|
const ns = client.account(accountId);
|
|
459
457
|
const outOpts = resolveOutputOpts(flags);
|
|
460
458
|
const all = flags.all ?? false;
|
|
461
|
-
const maxPages =
|
|
459
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
462
460
|
const body = {};
|
|
463
461
|
if (flags.keywords) body["keywords"] = flags.keywords;
|
|
464
462
|
if (flags["service-category"]) body["service_category"] = splitCsv(flags["service-category"]);
|
|
@@ -468,7 +466,8 @@ async function runSearchServices(client, flags, out) {
|
|
|
468
466
|
}
|
|
469
467
|
if (flags.language) body["language"] = splitCsv(flags.language);
|
|
470
468
|
if (flags.limit) body["limit"] = parseInt(flags.limit, 10);
|
|
471
|
-
|
|
469
|
+
const cursor = readCursorFlag(flags, out);
|
|
470
|
+
if (cursor) body["cursor"] = cursor;
|
|
472
471
|
try {
|
|
473
472
|
if (all) {
|
|
474
473
|
const fn = (p) => ns.search.services(p);
|
|
@@ -497,7 +496,7 @@ async function runSearchServices(client, flags, out) {
|
|
|
497
496
|
}
|
|
498
497
|
async function runSearchServiceParameters(client, flags, out) {
|
|
499
498
|
rejectPreviewOnRead(flags.preview, out);
|
|
500
|
-
|
|
499
|
+
rejectPaginationModifiersWithoutAll(flags, out);
|
|
501
500
|
if (!flags.keywords) {
|
|
502
501
|
out.stderr.write("error: --keywords is required.\n");
|
|
503
502
|
process.exit(2);
|
|
@@ -505,11 +504,27 @@ async function runSearchServiceParameters(client, flags, out) {
|
|
|
505
504
|
const accountId = await requireAccount(client, flags, out);
|
|
506
505
|
const ns = client.account(accountId);
|
|
507
506
|
const outOpts = resolveOutputOpts(flags);
|
|
507
|
+
const all = flags.all ?? false;
|
|
508
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
508
509
|
const query = { keywords: flags.keywords };
|
|
509
510
|
if (flags.type) query.type = flags.type;
|
|
510
511
|
if (flags.limit) query.limit = parseInt(flags.limit, 10);
|
|
512
|
+
const cursor = readCursorFlag(flags, out);
|
|
513
|
+
if (cursor) query.cursor = cursor;
|
|
511
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
|
+
}
|
|
512
526
|
const result = await ns.search.getServiceParameters(query);
|
|
527
|
+
readablePage(result);
|
|
513
528
|
renderSuccess(result, outOpts, out);
|
|
514
529
|
} catch (err) {
|
|
515
530
|
const { CurviateError } = await import("@curviate/sdk");
|
|
@@ -531,10 +546,11 @@ async function runSearchFromUrl(client, flags, out) {
|
|
|
531
546
|
const outOpts = resolveOutputOpts(flags);
|
|
532
547
|
const verbose = flags.verbose ?? false;
|
|
533
548
|
const all = flags.all ?? false;
|
|
534
|
-
const maxPages =
|
|
549
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
535
550
|
const body = { url };
|
|
536
551
|
if (flags.limit) body.limit = parseInt(flags.limit, 10);
|
|
537
|
-
|
|
552
|
+
const cursor = readCursorFlag(flags, out);
|
|
553
|
+
if (cursor) body.cursor = cursor;
|
|
538
554
|
try {
|
|
539
555
|
if (all) {
|
|
540
556
|
const fn = (p) => ns.search.fromUrl(p);
|
|
@@ -573,7 +589,7 @@ var searchPeopleCommand = defineCommand({
|
|
|
573
589
|
"past-company": { type: "string", description: "Past company ids (comma-separated)." },
|
|
574
590
|
school: { type: "string", description: "School ids (comma-separated)." },
|
|
575
591
|
"network-distance": { type: "string", description: "Network distance, 1-3 (comma-separated)." },
|
|
576
|
-
"connections-of": { type: "string", description: 'member id(s), comma-separated (resolve: `curviate search parameters --type
|
|
592
|
+
"connections-of": { type: "string", description: 'member id(s), comma-separated (resolve: `curviate search parameters --type RELATION --keywords "<name>"`)' },
|
|
577
593
|
"followers-of": { type: "string", description: 'member id(s), comma-separated (resolve: `curviate search parameters --type PEOPLE --keywords "<name>"`)' },
|
|
578
594
|
// People-specific filter flags
|
|
579
595
|
title: { type: "string", description: "Job title keyword filter (maps to advanced_keywords.title)." },
|
|
@@ -724,7 +740,7 @@ var searchParametersCommand = defineCommand({
|
|
|
724
740
|
...GLOBAL_FLAGS,
|
|
725
741
|
type: {
|
|
726
742
|
type: "string",
|
|
727
|
-
description: "Parameter type: LOCATION, PEOPLE,
|
|
743
|
+
description: "Parameter type: LOCATION, PEOPLE, RELATION, COMPANY, SCHOOL, INDUSTRY, SERVICE, JOB_FUNCTION, JOB_TITLE, EMPLOYMENT_TYPE, SKILL.",
|
|
728
744
|
required: true
|
|
729
745
|
},
|
|
730
746
|
keywords: { type: "string", description: "Human term to resolve (required for every --type, incl. EMPLOYMENT_TYPE).", required: true }
|
|
@@ -805,10 +821,10 @@ var searchServicesCommand = defineCommand({
|
|
|
805
821
|
var searchServiceParametersCommand = defineCommand({
|
|
806
822
|
meta: {
|
|
807
823
|
name: "service-parameters",
|
|
808
|
-
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."
|
|
809
825
|
},
|
|
810
826
|
args: {
|
|
811
|
-
...
|
|
827
|
+
...GLOBAL_FLAGS,
|
|
812
828
|
type: {
|
|
813
829
|
type: "string",
|
|
814
830
|
description: "Filter type to resolve: service_category (default) or location."
|
|
@@ -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-
|
|
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 =
|
|
111
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
110
112
|
const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
|
|
111
|
-
const cursor = flags
|
|
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.
|
|
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.
|
|
49
|
+
"@curviate/sdk": "0.37.0",
|
|
50
50
|
"citty": "^0.1.6",
|
|
51
51
|
"open": "^10.1.0"
|
|
52
52
|
},
|