@curviate/cli 0.38.0 → 0.41.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 +115 -0
- package/README.md +2 -2
- package/dist/{account-TYKHUB7X.js → account-QZ5RYKIT.js} +13 -3
- package/dist/{chunk-BN7L7WSY.js → chunk-4AAKZPOM.js} +34 -4
- package/dist/{chunk-MNDXMGPX.js → chunk-BLFGJIJJ.js} +1 -1
- package/dist/{chunk-7JU4IXXG.js → chunk-CBHL3QQJ.js} +32 -1
- package/dist/{chunk-ZJ7D3NFS.js → chunk-WAE7YLO5.js} +1 -1
- package/dist/cli.js +19 -19
- package/dist/{comment-G6RB2PBZ.js → comment-SYA6OKEY.js} +16 -13
- package/dist/{company-OWND3W3L.js → company-IXQ4OFU3.js} +36 -21
- package/dist/{connect-3E7EC5ZM.js → connect-TTA2X3KO.js} +8 -6
- package/dist/{doctor-Z6OSCGKT.js → doctor-ET7XQ22E.js} +1 -1
- package/dist/{feed-VDTFIMKN.js → feed-556LS3CN.js} +7 -4
- package/dist/{group-KDJHY2IM.js → group-DIIG4XQT.js} +12 -6
- package/dist/{inbox-DQLX2LR7.js → inbox-SRVTUTE6.js} +16 -11
- package/dist/{inboxes-WMNHOPY7.js → inboxes-XHZTAUQ7.js} +9 -4
- package/dist/{job-ESKS2LDJ.js → job-QNVGEM4J.js} +14 -6
- package/dist/{message-5W2R3YHS.js → message-2JEL6P7E.js} +3 -3
- package/dist/{notification-IGNUH2GR.js → notification-T4SRAIJ3.js} +7 -4
- package/dist/{post-NLI76K74.js → post-PV4UQVPO.js} +18 -13
- package/dist/{profile-TBKKIICM.js → profile-K5BZNGX5.js} +26 -15
- package/dist/{recruiter-AEJRHIX5.js → recruiter-OBKS4ZVL.js} +27 -15
- package/dist/{sales-nav-SW6WJVMD.js → sales-nav-WPTMS6QF.js} +46 -19
- package/dist/{search-WRMVQU6C.js → search-YAKZKK74.js} +51 -35
- package/dist/{setup-YUSWG77F.js → setup-NZQUWJYC.js} +1 -1
- package/dist/{webhook-NGMRJMQ5.js → webhook-PXSLDB2F.js} +8 -3
- package/package.json +2 -2
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-XP2LN6F6.js";
|
|
11
11
|
import {
|
|
12
12
|
sentAsNotice
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-4AAKZPOM.js";
|
|
14
14
|
import "./chunk-UWO2D4HW.js";
|
|
15
15
|
import "./chunk-HOQ7EUHJ.js";
|
|
16
16
|
import {
|
|
@@ -23,13 +23,16 @@ import {
|
|
|
23
23
|
} from "./chunk-UEAX6KUB.js";
|
|
24
24
|
import {
|
|
25
25
|
requireAccount
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-BLFGJIJJ.js";
|
|
27
27
|
import {
|
|
28
28
|
buildPreviewOutput
|
|
29
29
|
} from "./chunk-TCUYH5GO.js";
|
|
30
30
|
import {
|
|
31
31
|
pageDelayFromFlags,
|
|
32
|
+
readCursorFlag,
|
|
33
|
+
readMaxPagesFlag,
|
|
32
34
|
readableId,
|
|
35
|
+
readableObject,
|
|
33
36
|
readablePage,
|
|
34
37
|
rejectPaginationModifiersWithoutAll,
|
|
35
38
|
renderError,
|
|
@@ -38,7 +41,7 @@ import {
|
|
|
38
41
|
resolveEffectiveConfig,
|
|
39
42
|
streamAll,
|
|
40
43
|
writeNdjsonItem
|
|
41
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-CBHL3QQJ.js";
|
|
42
45
|
import "./chunk-XZJQQJBE.js";
|
|
43
46
|
import {
|
|
44
47
|
createClient
|
|
@@ -111,6 +114,7 @@ async function runCompanyGet(client, flags, out) {
|
|
|
111
114
|
const outOpts = { ...resolveOutputOpts(flags), slim: slimCompany };
|
|
112
115
|
try {
|
|
113
116
|
const result = await client.account(accountId).companies.get(resolvedId);
|
|
117
|
+
readableObject(result);
|
|
114
118
|
renderSuccess(result, outOpts, out);
|
|
115
119
|
} catch (err) {
|
|
116
120
|
await handleSdkError(err, outOpts, out);
|
|
@@ -124,13 +128,14 @@ async function runCompanyEmployees(client, flags, out) {
|
|
|
124
128
|
const outOpts = resolveOutputOpts(flags);
|
|
125
129
|
const params = {};
|
|
126
130
|
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
127
|
-
|
|
131
|
+
const cursor = readCursorFlag(flags, out);
|
|
132
|
+
if (cursor) params["cursor"] = cursor;
|
|
128
133
|
if (flags.keywords) params["keywords"] = flags.keywords;
|
|
129
134
|
if (flags.location) params["location"] = flags.location;
|
|
130
135
|
try {
|
|
131
136
|
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
132
137
|
if (flags.all) {
|
|
133
|
-
const maxPages =
|
|
138
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
134
139
|
const fn = (p) => ns.companies.employees(identifier, p);
|
|
135
140
|
for await (const item of streamAll(fn, params, {
|
|
136
141
|
maxPages,
|
|
@@ -156,11 +161,12 @@ async function runCompanyPosts(client, flags, out) {
|
|
|
156
161
|
const outOpts = resolveOutputOpts(flags);
|
|
157
162
|
const params = {};
|
|
158
163
|
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
159
|
-
|
|
164
|
+
const cursor = readCursorFlag(flags, out);
|
|
165
|
+
if (cursor) params["cursor"] = cursor;
|
|
160
166
|
try {
|
|
161
167
|
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
162
168
|
if (flags.all) {
|
|
163
|
-
const maxPages =
|
|
169
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
164
170
|
const fn = (p) => ns.companies.posts(identifier, p);
|
|
165
171
|
for await (const item of streamAll(fn, params, {
|
|
166
172
|
maxPages,
|
|
@@ -186,12 +192,13 @@ async function runCompanyJobs(client, flags, out) {
|
|
|
186
192
|
const outOpts = resolveOutputOpts(flags);
|
|
187
193
|
const params = {};
|
|
188
194
|
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
189
|
-
|
|
195
|
+
const cursor = readCursorFlag(flags, out);
|
|
196
|
+
if (cursor) params["cursor"] = cursor;
|
|
190
197
|
if (flags.keywords) params["keywords"] = flags.keywords;
|
|
191
198
|
try {
|
|
192
199
|
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
193
200
|
if (flags.all) {
|
|
194
|
-
const maxPages =
|
|
201
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
195
202
|
const fn = (p) => ns.companies.jobs(identifier, p);
|
|
196
203
|
for await (const item of streamAll(fn, params, {
|
|
197
204
|
maxPages,
|
|
@@ -217,11 +224,12 @@ async function runCompanyInvitableFollowers(client, flags, out) {
|
|
|
217
224
|
const outOpts = resolveOutputOpts(flags);
|
|
218
225
|
const params = {};
|
|
219
226
|
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
220
|
-
|
|
227
|
+
const cursor = readCursorFlag(flags, out);
|
|
228
|
+
if (cursor) params["cursor"] = cursor;
|
|
221
229
|
try {
|
|
222
230
|
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
223
231
|
if (flags.all) {
|
|
224
|
-
const maxPages =
|
|
232
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
225
233
|
const fn = (p) => ns.companies.invitableFollowers(identifier, p);
|
|
226
234
|
for await (const item of streamAll(fn, params, {
|
|
227
235
|
maxPages,
|
|
@@ -277,10 +285,11 @@ async function runCompanyManaged(client, flags, out) {
|
|
|
277
285
|
const outOpts = resolveOutputOpts(flags);
|
|
278
286
|
const params = {};
|
|
279
287
|
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
280
|
-
|
|
288
|
+
const cursor = readCursorFlag(flags, out);
|
|
289
|
+
if (cursor) params["cursor"] = cursor;
|
|
281
290
|
try {
|
|
282
291
|
if (flags.all) {
|
|
283
|
-
const maxPages =
|
|
292
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
284
293
|
const fn = (p) => ns.companies.managed(p);
|
|
285
294
|
for await (const item of streamAll(fn, params, {
|
|
286
295
|
maxPages,
|
|
@@ -306,11 +315,12 @@ async function runCompanyFollowers(client, flags, out) {
|
|
|
306
315
|
const outOpts = resolveOutputOpts(flags);
|
|
307
316
|
const params = {};
|
|
308
317
|
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
309
|
-
|
|
318
|
+
const cursor = readCursorFlag(flags, out);
|
|
319
|
+
if (cursor) params["cursor"] = cursor;
|
|
310
320
|
try {
|
|
311
321
|
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
312
322
|
if (flags.all) {
|
|
313
|
-
const maxPages =
|
|
323
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
314
324
|
const fn = (p) => ns.companies.followers(identifier, p);
|
|
315
325
|
for await (const item of streamAll(fn, params, {
|
|
316
326
|
maxPages,
|
|
@@ -336,11 +346,12 @@ async function runCompanyChats(client, flags, out) {
|
|
|
336
346
|
const outOpts = resolveOutputOpts(flags);
|
|
337
347
|
const params = {};
|
|
338
348
|
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
339
|
-
|
|
349
|
+
const cursor = readCursorFlag(flags, out);
|
|
350
|
+
if (cursor) params["cursor"] = cursor;
|
|
340
351
|
try {
|
|
341
352
|
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
342
353
|
if (flags.all) {
|
|
343
|
-
const maxPages =
|
|
354
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
344
355
|
const fn = (p) => ns.companies.chats(identifier, p);
|
|
345
356
|
for await (const item of streamAll(fn, params, {
|
|
346
357
|
maxPages,
|
|
@@ -371,6 +382,7 @@ async function runCompanyChat(client, flags, out) {
|
|
|
371
382
|
try {
|
|
372
383
|
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
373
384
|
const result = await ns.companies.chat(identifier, chatId);
|
|
385
|
+
readableObject(result);
|
|
374
386
|
renderSuccess(result, outOpts, out);
|
|
375
387
|
} catch (err) {
|
|
376
388
|
await handleSdkError(err, outOpts, out);
|
|
@@ -385,11 +397,12 @@ async function runCompanyMessages(client, flags, out) {
|
|
|
385
397
|
const chatId = flags.chatId ?? "";
|
|
386
398
|
const params = {};
|
|
387
399
|
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
388
|
-
|
|
400
|
+
const cursor = readCursorFlag(flags, out);
|
|
401
|
+
if (cursor) params["cursor"] = cursor;
|
|
389
402
|
try {
|
|
390
403
|
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
391
404
|
if (flags.all) {
|
|
392
|
-
const maxPages =
|
|
405
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
393
406
|
const fn = (p) => ns.companies.messages(identifier, chatId, p);
|
|
394
407
|
for await (const item of streamAll(fn, params, {
|
|
395
408
|
maxPages,
|
|
@@ -421,6 +434,7 @@ async function runCompanyMessage(client, flags, out) {
|
|
|
421
434
|
try {
|
|
422
435
|
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
423
436
|
const result = await ns.companies.message(identifier, chatId, messageId);
|
|
437
|
+
readableObject(result);
|
|
424
438
|
renderSuccess(result, outOpts, out);
|
|
425
439
|
} catch (err) {
|
|
426
440
|
await handleSdkError(err, outOpts, out);
|
|
@@ -437,11 +451,12 @@ async function runCompanySearchChats(client, flags, out) {
|
|
|
437
451
|
if (flags.topic) params["topic"] = flags.topic;
|
|
438
452
|
if (flags.unread !== void 0) params["unread"] = flags.unread;
|
|
439
453
|
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
440
|
-
|
|
454
|
+
const cursor = readCursorFlag(flags, out);
|
|
455
|
+
if (cursor) params["cursor"] = cursor;
|
|
441
456
|
try {
|
|
442
457
|
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
443
458
|
if (flags.all) {
|
|
444
|
-
const maxPages =
|
|
459
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
445
460
|
const fn = (p) => ns.companies.searchChats(identifier, p);
|
|
446
461
|
for await (const item of streamAll(fn, params, {
|
|
447
462
|
maxPages,
|
|
@@ -13,12 +13,14 @@ import {
|
|
|
13
13
|
} from "./chunk-UEAX6KUB.js";
|
|
14
14
|
import {
|
|
15
15
|
requireAccount
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-BLFGJIJJ.js";
|
|
17
17
|
import {
|
|
18
18
|
buildPreviewOutput
|
|
19
19
|
} from "./chunk-TCUYH5GO.js";
|
|
20
20
|
import {
|
|
21
21
|
pageDelayFromFlags,
|
|
22
|
+
readCursorFlag,
|
|
23
|
+
readMaxPagesFlag,
|
|
22
24
|
readablePage,
|
|
23
25
|
rejectPaginationModifiersWithoutAll,
|
|
24
26
|
renderError,
|
|
@@ -27,7 +29,7 @@ import {
|
|
|
27
29
|
resolveEffectiveConfig,
|
|
28
30
|
streamAll,
|
|
29
31
|
writeNdjsonItem
|
|
30
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-CBHL3QQJ.js";
|
|
31
33
|
import "./chunk-XZJQQJBE.js";
|
|
32
34
|
import {
|
|
33
35
|
createClient
|
|
@@ -100,9 +102,9 @@ async function runConnectSent(client, flags, out) {
|
|
|
100
102
|
const ns = client.account(accountId);
|
|
101
103
|
const outOpts = resolveOutputOpts(flags);
|
|
102
104
|
const all = flags.all ?? false;
|
|
103
|
-
const maxPages =
|
|
105
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
104
106
|
const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
|
|
105
|
-
const cursor = flags
|
|
107
|
+
const cursor = readCursorFlag(flags, out);
|
|
106
108
|
const params = {};
|
|
107
109
|
if (limit !== void 0) params["limit"] = limit;
|
|
108
110
|
if (cursor) params["cursor"] = cursor;
|
|
@@ -140,9 +142,9 @@ async function runConnectReceived(client, flags, out) {
|
|
|
140
142
|
const ns = client.account(accountId);
|
|
141
143
|
const outOpts = resolveOutputOpts(flags);
|
|
142
144
|
const all = flags.all ?? false;
|
|
143
|
-
const maxPages =
|
|
145
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
144
146
|
const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
|
|
145
|
-
const cursor = flags
|
|
147
|
+
const cursor = readCursorFlag(flags, out);
|
|
146
148
|
const params = {};
|
|
147
149
|
if (limit !== void 0) params["limit"] = limit;
|
|
148
150
|
if (cursor) params["cursor"] = cursor;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
requireAccount
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BLFGJIJJ.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-CBHL3QQJ.js";
|
|
16
18
|
import "./chunk-XZJQQJBE.js";
|
|
17
19
|
import {
|
|
18
20
|
createClient
|
|
@@ -60,11 +62,12 @@ async function runFeedHome(client, flags, out) {
|
|
|
60
62
|
const ns = client.account(accountId);
|
|
61
63
|
const outOpts = resolveOutputOpts(flags);
|
|
62
64
|
const all = flags.all ?? false;
|
|
63
|
-
const maxPages =
|
|
65
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
64
66
|
const params = {};
|
|
65
67
|
if (flags.sort) params["sort"] = flags.sort;
|
|
66
68
|
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
67
|
-
|
|
69
|
+
const cursor = readCursorFlag(flags, out);
|
|
70
|
+
if (cursor) params["cursor"] = cursor;
|
|
68
71
|
try {
|
|
69
72
|
if (all) {
|
|
70
73
|
const fn = (p) => ns.feed.home(p);
|
|
@@ -4,9 +4,12 @@ import {
|
|
|
4
4
|
} from "./chunk-UEAX6KUB.js";
|
|
5
5
|
import {
|
|
6
6
|
requireAccount
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BLFGJIJJ.js";
|
|
8
8
|
import {
|
|
9
9
|
pageDelayFromFlags,
|
|
10
|
+
readCursorFlag,
|
|
11
|
+
readMaxPagesFlag,
|
|
12
|
+
readableObject,
|
|
10
13
|
readablePage,
|
|
11
14
|
rejectPaginationModifiersWithoutAll,
|
|
12
15
|
renderError,
|
|
@@ -15,7 +18,7 @@ import {
|
|
|
15
18
|
resolveEffectiveConfig,
|
|
16
19
|
streamAll,
|
|
17
20
|
writeNdjsonItem
|
|
18
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-CBHL3QQJ.js";
|
|
19
22
|
import "./chunk-XZJQQJBE.js";
|
|
20
23
|
import {
|
|
21
24
|
createClient
|
|
@@ -70,11 +73,12 @@ async function runGroupList(client, flags, out) {
|
|
|
70
73
|
const ns = client.account(accountId);
|
|
71
74
|
const outOpts = resolveOutputOpts(flags);
|
|
72
75
|
const all = flags.all ?? false;
|
|
73
|
-
const maxPages =
|
|
76
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
74
77
|
const params = {};
|
|
75
78
|
if (flags.target) params["profile"] = flags.target;
|
|
76
79
|
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
77
|
-
|
|
80
|
+
const cursor = readCursorFlag(flags, out);
|
|
81
|
+
if (cursor) params["cursor"] = cursor;
|
|
78
82
|
try {
|
|
79
83
|
if (all) {
|
|
80
84
|
const fn = (p) => ns.groups.list(p);
|
|
@@ -103,6 +107,7 @@ async function runGroupGet(client, flags, out) {
|
|
|
103
107
|
const outOpts = resolveOutputOpts(flags);
|
|
104
108
|
try {
|
|
105
109
|
const result = await ns.groups.get(groupId);
|
|
110
|
+
readableObject(result);
|
|
106
111
|
renderSuccess(result, outOpts, out);
|
|
107
112
|
} catch (err) {
|
|
108
113
|
await handleSdkError(err, outOpts, out);
|
|
@@ -116,11 +121,12 @@ async function runGroupMembers(client, flags, out) {
|
|
|
116
121
|
const ns = client.account(accountId);
|
|
117
122
|
const outOpts = resolveOutputOpts(flags);
|
|
118
123
|
const all = flags.all ?? false;
|
|
119
|
-
const maxPages =
|
|
124
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
120
125
|
const params = {};
|
|
121
126
|
if (flags.name) params["name"] = flags.name;
|
|
122
127
|
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
123
|
-
|
|
128
|
+
const cursor = readCursorFlag(flags, out);
|
|
129
|
+
if (cursor) params["cursor"] = cursor;
|
|
124
130
|
try {
|
|
125
131
|
if (all) {
|
|
126
132
|
const fn = (p) => ns.groups.members(groupId, p);
|
|
@@ -8,12 +8,15 @@ import {
|
|
|
8
8
|
} from "./chunk-UEAX6KUB.js";
|
|
9
9
|
import {
|
|
10
10
|
requireAccount
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BLFGJIJJ.js";
|
|
12
12
|
import {
|
|
13
13
|
buildPreviewOutput
|
|
14
14
|
} from "./chunk-TCUYH5GO.js";
|
|
15
15
|
import {
|
|
16
16
|
pageDelayFromFlags,
|
|
17
|
+
readCursorFlag,
|
|
18
|
+
readMaxPagesFlag,
|
|
19
|
+
readableObject,
|
|
17
20
|
readablePage,
|
|
18
21
|
rejectPaginationModifiersWithoutAll,
|
|
19
22
|
renderError,
|
|
@@ -22,7 +25,7 @@ import {
|
|
|
22
25
|
resolveEffectiveConfig,
|
|
23
26
|
streamAll,
|
|
24
27
|
writeNdjsonItem
|
|
25
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-CBHL3QQJ.js";
|
|
26
29
|
import "./chunk-XZJQQJBE.js";
|
|
27
30
|
import {
|
|
28
31
|
createClient
|
|
@@ -60,10 +63,11 @@ function resolveOutputOpts(flags) {
|
|
|
60
63
|
fields: flags.fields
|
|
61
64
|
};
|
|
62
65
|
}
|
|
63
|
-
function buildPaginationParams(flags) {
|
|
66
|
+
function buildPaginationParams(flags, out) {
|
|
64
67
|
const params = {};
|
|
65
68
|
if (flags.limit !== void 0) params["limit"] = parseInt(flags.limit, 10);
|
|
66
|
-
|
|
69
|
+
const cursor = readCursorFlag(flags, out);
|
|
70
|
+
if (cursor) params["cursor"] = cursor;
|
|
67
71
|
return params;
|
|
68
72
|
}
|
|
69
73
|
function validateIsoZTimestamp(value, flagName, out) {
|
|
@@ -112,8 +116,8 @@ async function runInboxList(client, flags, out) {
|
|
|
112
116
|
const ns = client.account(accountId);
|
|
113
117
|
const outOpts = resolveOutputOpts(flags);
|
|
114
118
|
const all = flags.all ?? false;
|
|
115
|
-
const maxPages =
|
|
116
|
-
const params = buildPaginationParams(flags);
|
|
119
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
120
|
+
const params = buildPaginationParams(flags, out);
|
|
117
121
|
validateLimitRange(flags.limit, out);
|
|
118
122
|
validateInboxFolder(flags.inbox, out);
|
|
119
123
|
if (flags.unread !== void 0) {
|
|
@@ -156,6 +160,7 @@ async function runInboxGet(client, flags, out) {
|
|
|
156
160
|
const outOpts = resolveOutputOpts(flags);
|
|
157
161
|
try {
|
|
158
162
|
const result = await ns.messaging.getChat(chatId, retrieval.query);
|
|
163
|
+
readableObject(result);
|
|
159
164
|
renderSuccess(result, outOpts, out);
|
|
160
165
|
} catch (err) {
|
|
161
166
|
await handleSdkError(err, outOpts, out);
|
|
@@ -193,8 +198,8 @@ async function runInboxMessages(client, flags, out) {
|
|
|
193
198
|
const ns = client.account(accountId);
|
|
194
199
|
const outOpts = resolveOutputOpts(flags);
|
|
195
200
|
const all = flags.all ?? false;
|
|
196
|
-
const maxPages =
|
|
197
|
-
const params = { ...buildPaginationParams(flags), ...retrieval.query };
|
|
201
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
202
|
+
const params = { ...buildPaginationParams(flags, out), ...retrieval.query };
|
|
198
203
|
validateLimitRange(flags.limit, out);
|
|
199
204
|
if (flags.before !== void 0) {
|
|
200
205
|
validateIsoZTimestamp(flags.before, "before", out);
|
|
@@ -223,7 +228,7 @@ async function runInboxMessages(client, flags, out) {
|
|
|
223
228
|
const { CurviateError } = await import("@curviate/sdk");
|
|
224
229
|
if (err instanceof CurviateError && err.code === "NOT_STORED") {
|
|
225
230
|
renderError(err, outOpts, out);
|
|
226
|
-
const servable = flags.before === void 0 && flags.after === void 0 && flags
|
|
231
|
+
const servable = flags.before === void 0 && flags.after === void 0 && readCursorFlag(flags, out) === void 0;
|
|
227
232
|
if (servable) {
|
|
228
233
|
out.stderr.write(
|
|
229
234
|
"hint: a stored listing is served only after a walk of the whole chat, which any unfiltered page fetch restarts. Run `curviate inbox messages <chat_id> --all` without `--mode cache_only` to walk it to the end. A chat whose messages do not fit one page (`--limit`, at most 25) is not served from the store at all.\n"
|
|
@@ -253,8 +258,8 @@ async function runInboxSearch(client, flags, out) {
|
|
|
253
258
|
const ns = client.account(accountId);
|
|
254
259
|
const outOpts = resolveOutputOpts(flags);
|
|
255
260
|
const all = flags.all ?? false;
|
|
256
|
-
const maxPages =
|
|
257
|
-
const params = { query, ...buildPaginationParams(flags) };
|
|
261
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
262
|
+
const params = { query, ...buildPaginationParams(flags, out) };
|
|
258
263
|
try {
|
|
259
264
|
if (all) {
|
|
260
265
|
const fn = (p) => ns.messaging.searchChats(p);
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
requireAccount
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BLFGJIJJ.js";
|
|
5
5
|
import {
|
|
6
6
|
pageDelayFromFlags,
|
|
7
|
+
readCursorFlag,
|
|
8
|
+
readMaxPagesFlag,
|
|
9
|
+
readableObject,
|
|
7
10
|
readablePage,
|
|
8
11
|
rejectPaginationModifiersWithoutAll,
|
|
9
12
|
renderError,
|
|
@@ -12,7 +15,7 @@ import {
|
|
|
12
15
|
resolveEffectiveConfig,
|
|
13
16
|
streamAll,
|
|
14
17
|
writeNdjsonItem
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-CBHL3QQJ.js";
|
|
16
19
|
import "./chunk-XZJQQJBE.js";
|
|
17
20
|
import {
|
|
18
21
|
createClient
|
|
@@ -81,6 +84,7 @@ async function runInboxesList(client, flags, out) {
|
|
|
81
84
|
if (flags["company-id"]) params["company_id"] = flags["company-id"];
|
|
82
85
|
try {
|
|
83
86
|
const result = await ns.inboxes.list(params);
|
|
87
|
+
readableObject(result);
|
|
84
88
|
renderSuccess(result, outOpts, out);
|
|
85
89
|
} catch (err) {
|
|
86
90
|
await handleSdkError(err, outOpts, out);
|
|
@@ -94,11 +98,12 @@ async function runInboxesChats(client, flags, out) {
|
|
|
94
98
|
const ns = client.account(accountId);
|
|
95
99
|
const outOpts = resolveOutputOpts(flags);
|
|
96
100
|
const all = flags.all ?? false;
|
|
97
|
-
const maxPages =
|
|
101
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
98
102
|
validateLimitRange(flags.limit, out);
|
|
99
103
|
const params = {};
|
|
100
104
|
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
101
|
-
|
|
105
|
+
const cursor = readCursorFlag(flags, out);
|
|
106
|
+
if (cursor) params["cursor"] = cursor;
|
|
102
107
|
try {
|
|
103
108
|
if (all) {
|
|
104
109
|
const fn = (p) => ns.inboxes.listChats(inboxId, p);
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-UEAX6KUB.js";
|
|
12
12
|
import {
|
|
13
13
|
requireAccount
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-BLFGJIJJ.js";
|
|
15
15
|
import {
|
|
16
16
|
buildPreviewOutput
|
|
17
17
|
} from "./chunk-TCUYH5GO.js";
|
|
@@ -19,6 +19,9 @@ import {
|
|
|
19
19
|
DEFAULT_PAGE_DELAY_MS,
|
|
20
20
|
ndjsonModeNotice,
|
|
21
21
|
pageDelayFromFlags,
|
|
22
|
+
readCursorFlag,
|
|
23
|
+
readMaxPagesFlag,
|
|
24
|
+
readableObject,
|
|
22
25
|
readablePage,
|
|
23
26
|
rejectPaginationModifiersWithoutAll,
|
|
24
27
|
renderError,
|
|
@@ -27,7 +30,7 @@ import {
|
|
|
27
30
|
resolveEffectiveConfig,
|
|
28
31
|
streamAll,
|
|
29
32
|
writeNdjsonItem
|
|
30
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-CBHL3QQJ.js";
|
|
31
34
|
import "./chunk-XZJQQJBE.js";
|
|
32
35
|
import {
|
|
33
36
|
createClient,
|
|
@@ -129,6 +132,7 @@ async function runJobGet(client, flags, out) {
|
|
|
129
132
|
const outOpts = resolveOutputOpts(flags);
|
|
130
133
|
try {
|
|
131
134
|
const result = await ns.jobs.get(resolvedId);
|
|
135
|
+
readableObject(result);
|
|
132
136
|
renderSuccess(result, { ...outOpts, slim: slimJob }, out);
|
|
133
137
|
} catch (err) {
|
|
134
138
|
await handleSdkError(err, outOpts, out);
|
|
@@ -149,7 +153,7 @@ async function runJobList(client, flags, out) {
|
|
|
149
153
|
const ns = client.account(accountId);
|
|
150
154
|
const outOpts = resolveOutputOpts(flags);
|
|
151
155
|
const all = flags.all ?? false;
|
|
152
|
-
const maxPages =
|
|
156
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
153
157
|
const pageDelayMs = pageDelayFromFlags(flags);
|
|
154
158
|
if (state === "ALL") {
|
|
155
159
|
await runJobListAllStates(ns, flags, out, outOpts, { all, maxPages, pageDelayMs });
|
|
@@ -158,7 +162,8 @@ async function runJobList(client, flags, out) {
|
|
|
158
162
|
requireEnum(state, JOB_STATES, "--state", out);
|
|
159
163
|
const base = { state };
|
|
160
164
|
if (flags.limit) base.limit = parseInt(flags.limit, 10);
|
|
161
|
-
|
|
165
|
+
const cursor = readCursorFlag(flags, out);
|
|
166
|
+
if (cursor) base.cursor = cursor;
|
|
162
167
|
try {
|
|
163
168
|
if (all) {
|
|
164
169
|
const fn = (p) => listJobs(ns, p).then((page) => {
|
|
@@ -259,6 +264,7 @@ async function runJobBudget(client, flags, out) {
|
|
|
259
264
|
const outOpts = resolveOutputOpts(flags);
|
|
260
265
|
try {
|
|
261
266
|
const result = await ns.jobs.getBudget(jobId);
|
|
267
|
+
readableObject(result);
|
|
262
268
|
renderSuccess(result, outOpts, out);
|
|
263
269
|
} catch (err) {
|
|
264
270
|
await handleSdkError(err, outOpts, out);
|
|
@@ -272,7 +278,7 @@ async function runJobApplicants(client, flags, out) {
|
|
|
272
278
|
const ns = client.account(accountId);
|
|
273
279
|
const outOpts = resolveOutputOpts(flags);
|
|
274
280
|
const all = flags.all ?? false;
|
|
275
|
-
const maxPages =
|
|
281
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
276
282
|
const base = {};
|
|
277
283
|
if (flags.ratings) {
|
|
278
284
|
const ratings = flags.ratings.split(",").map((r) => r.trim()).filter(Boolean);
|
|
@@ -280,7 +286,8 @@ async function runJobApplicants(client, flags, out) {
|
|
|
280
286
|
base.ratings = ratings;
|
|
281
287
|
}
|
|
282
288
|
if (flags.limit) base.limit = parseInt(flags.limit, 10);
|
|
283
|
-
|
|
289
|
+
const cursor = readCursorFlag(flags, out);
|
|
290
|
+
if (cursor) base.cursor = cursor;
|
|
284
291
|
try {
|
|
285
292
|
if (all) {
|
|
286
293
|
const fn = (p) => ns.jobs.listApplicants(jobId, p);
|
|
@@ -309,6 +316,7 @@ async function runJobApplicantGet(client, flags, out) {
|
|
|
309
316
|
const outOpts = resolveOutputOpts(flags);
|
|
310
317
|
try {
|
|
311
318
|
const result = await ns.jobs.getApplicant(jobId, applicantId);
|
|
319
|
+
readableObject(result);
|
|
312
320
|
renderSuccess(result, outOpts, out);
|
|
313
321
|
} catch (err) {
|
|
314
322
|
await handleSdkError(err, outOpts, out);
|
|
@@ -13,14 +13,14 @@ import {
|
|
|
13
13
|
runMessageSend,
|
|
14
14
|
sentAsNotice,
|
|
15
15
|
willSendAsNotice
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-4AAKZPOM.js";
|
|
17
17
|
import "./chunk-UWO2D4HW.js";
|
|
18
18
|
import "./chunk-HOQ7EUHJ.js";
|
|
19
19
|
import "./chunk-BGZW6B7G.js";
|
|
20
20
|
import "./chunk-UEAX6KUB.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-BLFGJIJJ.js";
|
|
22
22
|
import "./chunk-TCUYH5GO.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-CBHL3QQJ.js";
|
|
24
24
|
import "./chunk-XZJQQJBE.js";
|
|
25
25
|
import "./chunk-DCZR4M7G.js";
|
|
26
26
|
import "./chunk-XDQHNUEU.js";
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
requireAccount
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BLFGJIJJ.js";
|
|
5
5
|
import {
|
|
6
6
|
buildPreviewOutput
|
|
7
7
|
} from "./chunk-TCUYH5GO.js";
|
|
8
8
|
import {
|
|
9
9
|
pageDelayFromFlags,
|
|
10
|
+
readCursorFlag,
|
|
11
|
+
readMaxPagesFlag,
|
|
10
12
|
readablePage,
|
|
11
13
|
rejectPaginationModifiersWithoutAll,
|
|
12
14
|
renderError,
|
|
@@ -15,7 +17,7 @@ import {
|
|
|
15
17
|
resolveEffectiveConfig,
|
|
16
18
|
streamAll,
|
|
17
19
|
writeNdjsonItem
|
|
18
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-CBHL3QQJ.js";
|
|
19
21
|
import "./chunk-XZJQQJBE.js";
|
|
20
22
|
import {
|
|
21
23
|
createClient
|
|
@@ -64,11 +66,12 @@ async function runNotificationList(client, flags, out) {
|
|
|
64
66
|
const ns = client.account(accountId);
|
|
65
67
|
const outOpts = resolveOutputOpts(flags);
|
|
66
68
|
const all = flags.all ?? false;
|
|
67
|
-
const maxPages =
|
|
69
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
68
70
|
const params = {};
|
|
69
71
|
if (flags.filter) params["filter"] = flags.filter;
|
|
70
72
|
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
71
|
-
|
|
73
|
+
const cursor = readCursorFlag(flags, out);
|
|
74
|
+
if (cursor) params["cursor"] = cursor;
|
|
72
75
|
try {
|
|
73
76
|
if (all) {
|
|
74
77
|
const fn = (p) => ns.notifications.list(p);
|