@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
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,121 @@ a new command or flag is a minor; a breaking command/flag/exit-code change is a
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [0.41.0] - 2026-09-23
|
|
12
|
+
|
|
13
|
+
Follows `@curviate/sdk` to `0.37.1` and re-vendors the OpenAPI fixture from the
|
|
14
|
+
deployed production document. A minor, not a patch: the fix below changes an
|
|
15
|
+
exit code (0 to 7) for inputs that previously succeeded silently.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **SDK pin moves `0.37.0` to exactly `0.37.1`**, as `check:sdk-pin` requires.
|
|
20
|
+
That SDK release honours `retry_hint.kind: "never"` in its GET retry decision
|
|
21
|
+
and treats an empty `Retry-After` as unparseable; its type changes are
|
|
22
|
+
description-only.
|
|
23
|
+
- **`test/fixtures/openapi.json` re-vendored** from `@curviate/sdk@0.37.1`'s
|
|
24
|
+
`fixtures/openapi.json`, generated against production at
|
|
25
|
+
`0b33680536a45681ed5ffe420006cb05c85fe683`. `test/fixtures/VENDORED_FROM.json`
|
|
26
|
+
records the new `sdkVersion`, its salted `sha256` and that `sourceServerGitSha`.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- **A single-object read's 2xx must be a readable object, or it's a platform
|
|
31
|
+
fault (exit 7), never a silent exit 0.** `null`, a scalar, a bare array, an
|
|
32
|
+
empty body, or a `{}` body previously rendered as if it were the resource.
|
|
33
|
+
`company <id>` against a `null`, empty or `{}` body fabricated an all-null
|
|
34
|
+
object (`{"id":null,"name":null,...}`) and exited 0. All of these now exit 7
|
|
35
|
+
(`PLATFORM_ERROR`) on every affected single-object read command, matching
|
|
36
|
+
the existing list-read and id-resolver contract. Writes are unaffected: a
|
|
37
|
+
genuine `204`/empty/`{}` body on a write still exits 0.
|
|
38
|
+
|
|
39
|
+
## [0.40.0] - 2026-09-22
|
|
40
|
+
|
|
41
|
+
Follows `@curviate/sdk` to `0.37.0` and re-vendors the OpenAPI fixture from the
|
|
42
|
+
deployed production document. No command, flag or exit-code changes of its own.
|
|
43
|
+
|
|
44
|
+
`0.39.0` was prepared in this repository but never published to npm, so `0.40.0`
|
|
45
|
+
is the first release to carry that version's pagination and
|
|
46
|
+
`message new --subject` work to the registry. The `0.39.0` section below still
|
|
47
|
+
describes those changes; nothing in it was reverted.
|
|
48
|
+
|
|
49
|
+
### Changed
|
|
50
|
+
|
|
51
|
+
- **SDK pin moves `0.36.0` to exactly `0.37.0`**, as `check:sdk-pin` requires.
|
|
52
|
+
That SDK release is breaking: `headers[].value_prefix` is removed from every
|
|
53
|
+
webhook read and a keyed `headers[].value_fingerprint` takes its place. The
|
|
54
|
+
CLI emits webhook reads as passthrough JSON and never rendered `value_prefix`
|
|
55
|
+
itself, so no command output wording changed here. The field a caller sees
|
|
56
|
+
from `webhook get` and `webhook list` is the server's, and only the compiled
|
|
57
|
+
type surface follows the pin.
|
|
58
|
+
- **`test/fixtures/openapi.json` re-vendored** from `@curviate/sdk@0.37.0`'s
|
|
59
|
+
`fixtures/openapi.json`, which was generated against production at
|
|
60
|
+
`9d5eb6583e24928eca0c3c8b162ad664e869af99`. `test/fixtures/VENDORED_FROM.json`
|
|
61
|
+
records the new `sdkVersion`, its salted `sha256` and that `sourceServerGitSha`.
|
|
62
|
+
|
|
63
|
+
## [0.39.0] - 2026-09-22
|
|
64
|
+
|
|
65
|
+
Pagination flags are honoured and validated on every command that offers
|
|
66
|
+
them, and `message new` can name the chat it starts. No SDK move: the pin
|
|
67
|
+
stays exactly `0.36.0`.
|
|
68
|
+
|
|
69
|
+
### Added
|
|
70
|
+
|
|
71
|
+
- **`message new --subject <s>`.** `POST /v1/{account_id}/chats` has always
|
|
72
|
+
accepted an optional conversation name (at most 200 characters) and
|
|
73
|
+
round-trips it onto the opening message, and MCP's `start_chat` exposed it,
|
|
74
|
+
but the CLI never followed, so the capability was unreachable from the
|
|
75
|
+
command line. The flag passes straight through to the request body. Omitted,
|
|
76
|
+
the key is left OUT of the body rather than sent as `subject: ""`: the
|
|
77
|
+
server's schema has no minimum length, so an empty string on the caller's
|
|
78
|
+
behalf would name the chat "" on the platform instead of leaving it unnamed.
|
|
79
|
+
- **`search service-parameters` and `sales-nav search parameters` paginate.**
|
|
80
|
+
Both endpoints take a cursor and return one, so both commands now offer the
|
|
81
|
+
full streaming set: `--cursor` to page manually, `--all` to stream every page
|
|
82
|
+
as NDJSON, `--max-pages` / `--page-delay` to bound and pace it. They behave
|
|
83
|
+
exactly like their `search parameters` sibling, down to the NDJSON notice and
|
|
84
|
+
the truncation sentinel, and `--max-pages` / `--page-delay` without `--all`
|
|
85
|
+
is the same exit 2 every other streaming command gives.
|
|
86
|
+
|
|
87
|
+
### Changed
|
|
88
|
+
|
|
89
|
+
- **`--cursor ""` is a usage error (exit 2), never a silent restart.** Every
|
|
90
|
+
paginated command guarded the flag with a truthiness check, so an empty or
|
|
91
|
+
whitespace-only value was dropped client-side and the walk began again at
|
|
92
|
+
page one: `--cursor "$NEXT"` with `NEXT` unset re-read the first page
|
|
93
|
+
forever and reported exit 0 every time. A lost cursor is now refused before
|
|
94
|
+
any request, naming the flag. An omitted `--cursor` still means "start at
|
|
95
|
+
the first page", unchanged. Same ruling as `account link --seat-id ""` in
|
|
96
|
+
0.37.0, and the API itself now answers 400 on an empty cursor. Decided once
|
|
97
|
+
in `lib/paginate.ts` and routed through by all 51 call sites, across 61
|
|
98
|
+
commands.
|
|
99
|
+
- **`--max-pages` must be a positive integer (exit 2 otherwise).**
|
|
100
|
+
`--max-pages abc` parsed to `NaN`, and a `>= NaN` comparison is false
|
|
101
|
+
forever, so a walk asked to stop after a few pages ran unbounded instead:
|
|
102
|
+
the opposite of what was typed, ending at exit 0. `0`, a negative, a
|
|
103
|
+
fractional value and an empty string are refused for the same reason: none
|
|
104
|
+
of them can be a page budget. One shared parse in `lib/paginate.ts`, used by
|
|
105
|
+
all 60 call sites, across 60 streaming commands.
|
|
106
|
+
|
|
107
|
+
### Fixed
|
|
108
|
+
|
|
109
|
+
- **`search parameters --help` named a `--type` value the API rejects.** The
|
|
110
|
+
enum was renamed `CONNECTIONS` to `RELATION` in v2; the help text and the
|
|
111
|
+
`search people --connections-of` resolve hint both still said
|
|
112
|
+
`CONNECTIONS`, so the one lookup those lines exist to make easy answered
|
|
113
|
+
400. Both now say `RELATION`, which is what the served document lists.
|
|
114
|
+
|
|
115
|
+
### Known, not changed here
|
|
116
|
+
|
|
117
|
+
- Eleven commands declare `--cursor` against an endpoint that has no cursor
|
|
118
|
+
input at all (`company`, `company chat`, `company message`, `post get`,
|
|
119
|
+
`profile endorse`, `recruiter search parameters`, and the five
|
|
120
|
+
non-list `webhook` subcommands). They spread the wrong flag set rather than
|
|
121
|
+
dropping a real cursor, so correcting them removes `--cursor` and `--limit`
|
|
122
|
+
from those commands' help, which is a separate decision. Pinned by name in
|
|
123
|
+
`test/cursor-empty-refused-bin.test.ts` so none can drift in or out
|
|
124
|
+
unnoticed.
|
|
125
|
+
|
|
11
126
|
## [0.38.0] - 2026-09-20
|
|
12
127
|
|
|
13
128
|
Re-vendored from `@curviate/sdk` 0.36.0.
|
package/README.md
CHANGED
|
@@ -99,9 +99,9 @@ Global flags available on every command:
|
|
|
99
99
|
--json Force JSON output even when stdout is a TTY
|
|
100
100
|
--fields Comma-separated list of fields to include in JSON output
|
|
101
101
|
--limit Maximum number of results to return per page
|
|
102
|
-
--cursor Pagination cursor from a previous response
|
|
102
|
+
--cursor Pagination cursor from a previous response (an empty value is a usage error, never a restart)
|
|
103
103
|
--all Stream all pages as NDJSON
|
|
104
|
-
--max-pages Cap on the number of pages fetched with --all
|
|
104
|
+
--max-pages Cap on the number of pages fetched with --all (a positive integer)
|
|
105
105
|
--page-delay Milliseconds to pause between pages when --all is used (default 400)
|
|
106
106
|
--preview Show what would happen without sending any write request
|
|
107
107
|
--verbose Output the full SDK response instead of the slim default
|
|
@@ -13,6 +13,9 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
isJsonMode,
|
|
15
15
|
pageDelayFromFlags,
|
|
16
|
+
readCursorFlag,
|
|
17
|
+
readMaxPagesFlag,
|
|
18
|
+
readableObject,
|
|
16
19
|
readablePage,
|
|
17
20
|
rejectPaginationModifiersWithoutAll,
|
|
18
21
|
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 {
|
|
27
30
|
AUTH_NEEDED
|
|
28
31
|
} from "./chunk-XZJQQJBE.js";
|
|
@@ -213,9 +216,9 @@ async function runAccountList(client, flags, out) {
|
|
|
213
216
|
rejectPaginationModifiersWithoutAll(flags, out);
|
|
214
217
|
const outOpts = resolveOutputOpts(flags);
|
|
215
218
|
const all = flags.all ?? false;
|
|
216
|
-
const maxPages =
|
|
219
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
217
220
|
const limit = flags.limit ? parseInt(flags.limit, 10) : void 0;
|
|
218
|
-
const cursor = flags
|
|
221
|
+
const cursor = readCursorFlag(flags, out);
|
|
219
222
|
const params = {};
|
|
220
223
|
if (limit !== void 0) params["limit"] = limit;
|
|
221
224
|
if (cursor) params["cursor"] = cursor;
|
|
@@ -246,6 +249,7 @@ async function runAccountGet(client, flags, out) {
|
|
|
246
249
|
const outOpts = resolveOutputOpts(flags);
|
|
247
250
|
try {
|
|
248
251
|
const result = await client.accounts.get(accountId);
|
|
252
|
+
readableObject(result);
|
|
249
253
|
renderSuccess(result, { ...outOpts, slim: slimAccountGet }, out);
|
|
250
254
|
} catch (err) {
|
|
251
255
|
await handleError(err, outOpts, out);
|
|
@@ -421,6 +425,7 @@ async function waitForMobileApproval(client, accountId, expiresAt, ctx) {
|
|
|
421
425
|
let result;
|
|
422
426
|
try {
|
|
423
427
|
result = await client.auth.pollCheckpoint(accountId);
|
|
428
|
+
readableObject(result);
|
|
424
429
|
} catch (err) {
|
|
425
430
|
return await handleError(err, ctx.outOpts, ctx.out);
|
|
426
431
|
}
|
|
@@ -634,6 +639,7 @@ async function runConnectSessionWaitLoop(client, sessionId, ctx) {
|
|
|
634
639
|
await ctx.sleep(CHECKPOINT_POLL_FIRST_DELAY_MS);
|
|
635
640
|
for (; ; ) {
|
|
636
641
|
const result = await client.auth.getSession(sessionId);
|
|
642
|
+
readableObject(result);
|
|
637
643
|
const r = result;
|
|
638
644
|
if (r.status === "resolved") return { kind: "resolved", result };
|
|
639
645
|
if (r.status === "expired" || r.status === "failed") {
|
|
@@ -681,6 +687,7 @@ async function runAccountConnectSessionPoll(client, flags, out, io = {}) {
|
|
|
681
687
|
if (!flags.wait) {
|
|
682
688
|
try {
|
|
683
689
|
const result = await client.auth.getSession(sessionId);
|
|
690
|
+
readableObject(result);
|
|
684
691
|
renderSuccess(result, outOpts, out);
|
|
685
692
|
} catch (err) {
|
|
686
693
|
await handleError(err, outOpts, out);
|
|
@@ -823,6 +830,7 @@ async function runAccountCheckpointSolve(client, flags, out) {
|
|
|
823
830
|
let chained = false;
|
|
824
831
|
try {
|
|
825
832
|
const result = await client.auth.solveCheckpoint(accountId, body);
|
|
833
|
+
readableObject(result);
|
|
826
834
|
const r = result;
|
|
827
835
|
renderSuccess(result, outOpts, out);
|
|
828
836
|
chained = r.status === "checkpoint_required";
|
|
@@ -869,6 +877,7 @@ async function runCheckpointPollWaitLoop(client, accountId, ctx) {
|
|
|
869
877
|
await ctx.sleep(CHECKPOINT_POLL_FIRST_DELAY_MS);
|
|
870
878
|
for (; ; ) {
|
|
871
879
|
const result = await client.auth.pollCheckpoint(accountId);
|
|
880
|
+
readableObject(result);
|
|
872
881
|
const r = result;
|
|
873
882
|
if (r.status === "active") return { kind: "active", result };
|
|
874
883
|
if (r.status === "expired" || r.status === "failed") {
|
|
@@ -905,6 +914,7 @@ async function runAccountCheckpointPoll(client, flags, out, io = {}) {
|
|
|
905
914
|
if (!flags.wait) {
|
|
906
915
|
try {
|
|
907
916
|
const result = await client.auth.pollCheckpoint(accountId);
|
|
917
|
+
readableObject(result);
|
|
908
918
|
renderSuccess(result, outOpts, out);
|
|
909
919
|
} catch (err) {
|
|
910
920
|
await handleError(err, outOpts, out);
|
|
@@ -18,17 +18,18 @@ import {
|
|
|
18
18
|
} from "./chunk-UEAX6KUB.js";
|
|
19
19
|
import {
|
|
20
20
|
requireAccount
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-BLFGJIJJ.js";
|
|
22
22
|
import {
|
|
23
23
|
buildPreviewOutput
|
|
24
24
|
} from "./chunk-TCUYH5GO.js";
|
|
25
25
|
import {
|
|
26
26
|
readableId,
|
|
27
|
+
readableObject,
|
|
27
28
|
renderError,
|
|
28
29
|
renderSuccess,
|
|
29
30
|
renderUnexpectedError,
|
|
30
31
|
resolveEffectiveConfig
|
|
31
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-CBHL3QQJ.js";
|
|
32
33
|
import {
|
|
33
34
|
createClient,
|
|
34
35
|
downloadBinary
|
|
@@ -59,6 +60,25 @@ function rejectAllOnNonPaginated(all, out) {
|
|
|
59
60
|
process.exit(2);
|
|
60
61
|
}
|
|
61
62
|
}
|
|
63
|
+
var CHAT_SUBJECT_MAX_CHARS = 200;
|
|
64
|
+
function readChatSubjectFlag(flags, out) {
|
|
65
|
+
const raw = flags.subject;
|
|
66
|
+
if (raw === void 0) return void 0;
|
|
67
|
+
if (raw.trim() === "") {
|
|
68
|
+
out.stderr.write(
|
|
69
|
+
"error: --subject was given an empty value. Pass the subject line, or omit the flag entirely to start an unnamed chat.\n"
|
|
70
|
+
);
|
|
71
|
+
process.exit(2);
|
|
72
|
+
}
|
|
73
|
+
if (raw.length > CHAT_SUBJECT_MAX_CHARS) {
|
|
74
|
+
out.stderr.write(
|
|
75
|
+
`error: --subject is ${raw.length} characters; the maximum is ${CHAT_SUBJECT_MAX_CHARS}.
|
|
76
|
+
`
|
|
77
|
+
);
|
|
78
|
+
process.exit(2);
|
|
79
|
+
}
|
|
80
|
+
return raw;
|
|
81
|
+
}
|
|
62
82
|
function resolveOutputOpts(flags) {
|
|
63
83
|
return {
|
|
64
84
|
json: (flags.json ?? false) || !process.stdout.isTTY,
|
|
@@ -93,6 +113,7 @@ function willSendAsNotice(chatId) {
|
|
|
93
113
|
return chatId.startsWith("COMPANY_") ? "Will send as a company page\n" : null;
|
|
94
114
|
}
|
|
95
115
|
async function runMessageNew(client, flags, out, _readStdin) {
|
|
116
|
+
const subject = readChatSubjectFlag(flags, out);
|
|
96
117
|
const accountId = await requireAccount(client, flags, out);
|
|
97
118
|
const rawTo = flags.to ?? "";
|
|
98
119
|
const rawText = flags.text ?? "";
|
|
@@ -128,7 +149,7 @@ async function runMessageNew(client, flags, out, _readStdin) {
|
|
|
128
149
|
const preview = buildPreviewOutput({
|
|
129
150
|
method: "messaging.startChat",
|
|
130
151
|
args: { attendees_ids: [providerId] },
|
|
131
|
-
body: { attendees_ids: [providerId], text },
|
|
152
|
+
body: { attendees_ids: [providerId], text, ...subject !== void 0 ? { subject } : {} },
|
|
132
153
|
account: accountId,
|
|
133
154
|
attachments: attachBuffers.map((buf, i) => ({
|
|
134
155
|
name: attachPaths[i] ? attachPaths[i].split("/").pop() ?? attachPaths[i] : `attachment_${i}`,
|
|
@@ -141,6 +162,9 @@ async function runMessageNew(client, flags, out, _readStdin) {
|
|
|
141
162
|
const body = {
|
|
142
163
|
attendees_ids: [providerId],
|
|
143
164
|
text,
|
|
165
|
+
// Present only when the flag was given: an absent subject must leave the
|
|
166
|
+
// key out, never send `subject: ""` (the server has no `.min(1)`).
|
|
167
|
+
...subject !== void 0 ? { subject } : {},
|
|
144
168
|
...attachmentPayloads.length > 0 ? { attachments: attachmentPayloads } : {}
|
|
145
169
|
};
|
|
146
170
|
try {
|
|
@@ -209,6 +233,7 @@ async function runMessageGet(client, flags, out) {
|
|
|
209
233
|
const outOpts = resolveOutputOpts(flags);
|
|
210
234
|
try {
|
|
211
235
|
const result = await ns.messaging.getMessage(chatId, messageId);
|
|
236
|
+
readableObject(result);
|
|
212
237
|
renderSuccess(result, outOpts, out);
|
|
213
238
|
} catch (err) {
|
|
214
239
|
await handleSdkError(err, outOpts, out);
|
|
@@ -374,6 +399,7 @@ async function runMessageInMailBalance(client, flags, out) {
|
|
|
374
399
|
const outOpts = resolveOutputOpts(flags);
|
|
375
400
|
try {
|
|
376
401
|
const result = await ns.users.getInMailCredits();
|
|
402
|
+
readableObject(result);
|
|
377
403
|
renderSuccess(result, outOpts, out);
|
|
378
404
|
} catch (err) {
|
|
379
405
|
await handleSdkError(err, outOpts, out);
|
|
@@ -390,6 +416,10 @@ var messageNewCommand = defineCommand({
|
|
|
390
416
|
required: true
|
|
391
417
|
},
|
|
392
418
|
text: { type: "positional", stdinArg: true, description: "Opening message text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
|
|
419
|
+
subject: {
|
|
420
|
+
type: "string",
|
|
421
|
+
description: "Optional conversation name / subject line (at most 200 characters). Omit it for an unnamed chat; an empty value is a usage error."
|
|
422
|
+
},
|
|
393
423
|
attach: { type: "string", description: "File to attach (repeatable)." }
|
|
394
424
|
},
|
|
395
425
|
async run({ args }) {
|
|
@@ -653,7 +683,7 @@ var MESSAGE_SUBCOMMANDS = [
|
|
|
653
683
|
"inmail",
|
|
654
684
|
"inmail-balance"
|
|
655
685
|
];
|
|
656
|
-
var MESSAGE_USAGE = 'Usage: curviate message new --to <attendee> "<text>" [--attach <file>...]\n curviate message send <chat_id> "<text>" [--attach <file>...]\n curviate message <chat_id> "<text>" [--attach <file>...]\n curviate message get <chat_id> <message_id>\n curviate message edit <chat_id> <message_id> "<text>"\n curviate message delete <chat_id> <message_id>\n curviate message react <chat_id> <message_id> <emoji>\n curviate message attachment <chat_id> <message_id> <attachment_id> [-o <file>]\n curviate message inmail --to <id> --subject <s> "<text>"\n curviate message inmail-balance\n';
|
|
686
|
+
var MESSAGE_USAGE = 'Usage: curviate message new --to <attendee> "<text>" [--subject <s>] [--attach <file>...]\n curviate message send <chat_id> "<text>" [--attach <file>...]\n curviate message <chat_id> "<text>" [--attach <file>...]\n curviate message get <chat_id> <message_id>\n curviate message edit <chat_id> <message_id> "<text>"\n curviate message delete <chat_id> <message_id>\n curviate message react <chat_id> <message_id> <emoji>\n curviate message attachment <chat_id> <message_id> <attachment_id> [-o <file>]\n curviate message inmail --to <id> --subject <s> "<text>"\n curviate message inmail-balance\n';
|
|
657
687
|
function guardBareMessageForm(chatId, out) {
|
|
658
688
|
if (!looksLikeCommandWord(chatId)) return;
|
|
659
689
|
const suggestion = nearestSubcommand(chatId, [...MESSAGE_SUBCOMMANDS]);
|
|
@@ -251,6 +251,10 @@ function readableId(entity) {
|
|
|
251
251
|
if ((typeof id !== "string" || id === "") && !(typeof id === "number" && Number.isFinite(id))) throw unreadable("id");
|
|
252
252
|
return String(id);
|
|
253
253
|
}
|
|
254
|
+
function readableObject(data) {
|
|
255
|
+
if (!isPlainObject(data) || Object.keys(data).length === 0) throw unreadable("object");
|
|
256
|
+
return data;
|
|
257
|
+
}
|
|
254
258
|
function rejectPaginationModifiersWithoutAll(flags, out) {
|
|
255
259
|
if (flags.all) return;
|
|
256
260
|
const offender = flags["max-pages"] !== void 0 ? "--max-pages" : flags["page-delay"] !== void 0 ? "--page-delay" : null;
|
|
@@ -259,6 +263,30 @@ function rejectPaginationModifiersWithoutAll(flags, out) {
|
|
|
259
263
|
`);
|
|
260
264
|
process.exit(2);
|
|
261
265
|
}
|
|
266
|
+
var DEFAULT_MAX_PAGES = 100;
|
|
267
|
+
function readCursorFlag(flags, out) {
|
|
268
|
+
const raw = flags.cursor;
|
|
269
|
+
if (raw === void 0) return void 0;
|
|
270
|
+
if (raw.trim() === "") {
|
|
271
|
+
out.stderr.write(
|
|
272
|
+
"error: --cursor was given an empty value. Pass the cursor from the previous response, or omit the flag entirely to start at the first page.\n"
|
|
273
|
+
);
|
|
274
|
+
process.exit(2);
|
|
275
|
+
}
|
|
276
|
+
return raw;
|
|
277
|
+
}
|
|
278
|
+
function readMaxPagesFlag(flags, out) {
|
|
279
|
+
const raw = flags["max-pages"];
|
|
280
|
+
if (raw === void 0) return DEFAULT_MAX_PAGES;
|
|
281
|
+
if (!/^\d+$/.test(raw) || Number(raw) < 1) {
|
|
282
|
+
out.stderr.write(
|
|
283
|
+
`error: --max-pages must be a positive integer (got ${JSON.stringify(raw)}); it is the number of pages --all may fetch.
|
|
284
|
+
`
|
|
285
|
+
);
|
|
286
|
+
process.exit(2);
|
|
287
|
+
}
|
|
288
|
+
return Number(raw);
|
|
289
|
+
}
|
|
262
290
|
function unreadable(what) {
|
|
263
291
|
return new CurviateError({
|
|
264
292
|
code: "PLATFORM_ERROR",
|
|
@@ -291,7 +319,7 @@ function truncationSentinelLine(pagesFetched, hasMore) {
|
|
|
291
319
|
return JSON.stringify({ object: "stream_truncated", pages_fetched: pagesFetched, has_more: hasMore }) + "\n";
|
|
292
320
|
}
|
|
293
321
|
async function* streamAll(fn, params, opts = {}) {
|
|
294
|
-
const maxPages = opts.maxPages ??
|
|
322
|
+
const maxPages = opts.maxPages ?? DEFAULT_MAX_PAGES;
|
|
295
323
|
const pageDelayMs = opts.pageDelayMs ?? DEFAULT_PAGE_DELAY_MS;
|
|
296
324
|
const sleep = opts.sleep ?? realSleep;
|
|
297
325
|
let cursor = void 0;
|
|
@@ -386,7 +414,10 @@ export {
|
|
|
386
414
|
renderUnexpectedError,
|
|
387
415
|
readablePage,
|
|
388
416
|
readableId,
|
|
417
|
+
readableObject,
|
|
389
418
|
rejectPaginationModifiersWithoutAll,
|
|
419
|
+
readCursorFlag,
|
|
420
|
+
readMaxPagesFlag,
|
|
390
421
|
ndjsonModeNotice,
|
|
391
422
|
DEFAULT_PAGE_DELAY_MS,
|
|
392
423
|
pageDelayFromFlags,
|
package/dist/cli.js
CHANGED
|
@@ -414,30 +414,30 @@ var main = defineCommand({
|
|
|
414
414
|
// Subcommand registry, names and descriptions are static for help rendering;
|
|
415
415
|
// the handler implementation is loaded lazily on first invocation.
|
|
416
416
|
subCommands: {
|
|
417
|
-
setup: () => import("./setup-
|
|
418
|
-
doctor: () => import("./doctor-
|
|
417
|
+
setup: () => import("./setup-NZQUWJYC.js").then((m) => m.setupCommand),
|
|
418
|
+
doctor: () => import("./doctor-ET7XQ22E.js").then((m) => m.doctorCommand),
|
|
419
419
|
login: () => import("./login-YTVPIN27.js").then((m) => m.loginCommand),
|
|
420
420
|
config: () => import("./config-RUBXWFQ3.js").then((m) => m.configCommand),
|
|
421
421
|
// ---------------------------------------------------------------------------
|
|
422
422
|
// Noun groups, lazy-loaded on first invocation.
|
|
423
423
|
// ---------------------------------------------------------------------------
|
|
424
|
-
profile: () => import("./profile-
|
|
425
|
-
company: () => import("./company-
|
|
426
|
-
job: () => import("./job-
|
|
427
|
-
connect: () => import("./connect-
|
|
428
|
-
search: () => import("./search-
|
|
429
|
-
inbox: () => import("./inbox-
|
|
430
|
-
inboxes: () => import("./inboxes-
|
|
431
|
-
message: () => import("./message-
|
|
432
|
-
post: () => import("./post-
|
|
433
|
-
comment: () => import("./comment-
|
|
434
|
-
account: () => import("./account-
|
|
435
|
-
webhook: () => import("./webhook-
|
|
436
|
-
"sales-nav": () => import("./sales-nav-
|
|
437
|
-
recruiter: () => import("./recruiter-
|
|
438
|
-
group: () => import("./group-
|
|
439
|
-
feed: () => import("./feed-
|
|
440
|
-
notification: () => import("./notification-
|
|
424
|
+
profile: () => import("./profile-K5BZNGX5.js").then((m) => m.profileCommand),
|
|
425
|
+
company: () => import("./company-IXQ4OFU3.js").then((m) => m.companyCommand),
|
|
426
|
+
job: () => import("./job-QNVGEM4J.js").then((m) => m.jobCommand),
|
|
427
|
+
connect: () => import("./connect-TTA2X3KO.js").then((m) => m.connectCommand),
|
|
428
|
+
search: () => import("./search-YAKZKK74.js").then((m) => m.searchCommand),
|
|
429
|
+
inbox: () => import("./inbox-SRVTUTE6.js").then((m) => m.inboxCommand),
|
|
430
|
+
inboxes: () => import("./inboxes-XHZTAUQ7.js").then((m) => m.inboxesCommand),
|
|
431
|
+
message: () => import("./message-2JEL6P7E.js").then((m) => m.messageCommand),
|
|
432
|
+
post: () => import("./post-PV4UQVPO.js").then((m) => m.postCommand),
|
|
433
|
+
comment: () => import("./comment-SYA6OKEY.js").then((m) => m.commentCommand),
|
|
434
|
+
account: () => import("./account-QZ5RYKIT.js").then((m) => m.accountCommand),
|
|
435
|
+
webhook: () => import("./webhook-PXSLDB2F.js").then((m) => m.webhookCommand),
|
|
436
|
+
"sales-nav": () => import("./sales-nav-WPTMS6QF.js").then((m) => m.salesNavCommand),
|
|
437
|
+
recruiter: () => import("./recruiter-OBKS4ZVL.js").then((m) => m.recruiterCommand),
|
|
438
|
+
group: () => import("./group-DIIG4XQT.js").then((m) => m.groupCommand),
|
|
439
|
+
feed: () => import("./feed-556LS3CN.js").then((m) => m.feedCommand),
|
|
440
|
+
notification: () => import("./notification-T4SRAIJ3.js").then((m) => m.notificationCommand)
|
|
441
441
|
},
|
|
442
442
|
async run() {
|
|
443
443
|
const { runMain } = await import("citty");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
resolveMemberOrMeProviderId
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WAE7YLO5.js";
|
|
5
5
|
import {
|
|
6
6
|
AttachError,
|
|
7
7
|
describeAttachment,
|
|
@@ -11,12 +11,14 @@ import {
|
|
|
11
11
|
import "./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";
|
|
18
18
|
import {
|
|
19
19
|
pageDelayFromFlags,
|
|
20
|
+
readCursorFlag,
|
|
21
|
+
readMaxPagesFlag,
|
|
20
22
|
readablePage,
|
|
21
23
|
rejectPaginationModifiersWithoutAll,
|
|
22
24
|
renderError,
|
|
@@ -25,7 +27,7 @@ import {
|
|
|
25
27
|
resolveEffectiveConfig,
|
|
26
28
|
streamAll,
|
|
27
29
|
writeNdjsonItem
|
|
28
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-CBHL3QQJ.js";
|
|
29
31
|
import "./chunk-XZJQQJBE.js";
|
|
30
32
|
import {
|
|
31
33
|
createClient
|
|
@@ -59,10 +61,11 @@ function resolveOutputOpts(flags) {
|
|
|
59
61
|
verbose: flags.verbose ?? false
|
|
60
62
|
};
|
|
61
63
|
}
|
|
62
|
-
function buildListQuery(flags) {
|
|
64
|
+
function buildListQuery(flags, out) {
|
|
63
65
|
const params = {};
|
|
64
66
|
if (flags.limit) params.limit = parseInt(flags.limit, 10);
|
|
65
|
-
|
|
67
|
+
const cursor = readCursorFlag(flags, out);
|
|
68
|
+
if (cursor) params.cursor = cursor;
|
|
66
69
|
return params;
|
|
67
70
|
}
|
|
68
71
|
async function handleSdkError(err, outOpts, out) {
|
|
@@ -95,8 +98,8 @@ async function runCommentList(client, flags, out) {
|
|
|
95
98
|
const ns = client.account(accountId);
|
|
96
99
|
const outOpts = resolveOutputOpts(flags);
|
|
97
100
|
const all = flags.all ?? false;
|
|
98
|
-
const maxPages =
|
|
99
|
-
const params = buildListQuery(flags);
|
|
101
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
102
|
+
const params = buildListQuery(flags, out);
|
|
100
103
|
try {
|
|
101
104
|
if (all) {
|
|
102
105
|
const fn = (p) => ns.posts.listComments(postId, p);
|
|
@@ -125,8 +128,8 @@ async function runCommentReplies(client, flags, out) {
|
|
|
125
128
|
const ns = client.account(accountId);
|
|
126
129
|
const outOpts = resolveOutputOpts(flags);
|
|
127
130
|
const all = flags.all ?? false;
|
|
128
|
-
const maxPages =
|
|
129
|
-
const params = buildListQuery(flags);
|
|
131
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
132
|
+
const params = buildListQuery(flags, out);
|
|
130
133
|
try {
|
|
131
134
|
if (all) {
|
|
132
135
|
const fn = (p) => ns.comments.listReplies(postId, commentId, p);
|
|
@@ -155,8 +158,8 @@ async function runCommentReactions(client, flags, out) {
|
|
|
155
158
|
const ns = client.account(accountId);
|
|
156
159
|
const outOpts = resolveOutputOpts(flags);
|
|
157
160
|
const all = flags.all ?? false;
|
|
158
|
-
const maxPages =
|
|
159
|
-
const params = buildListQuery(flags);
|
|
161
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
162
|
+
const params = buildListQuery(flags, out);
|
|
160
163
|
try {
|
|
161
164
|
if (all) {
|
|
162
165
|
const fn = (p) => ns.comments.listReactions(postId, commentId, p);
|
|
@@ -190,8 +193,8 @@ async function runCommentUser(client, flags, out) {
|
|
|
190
193
|
return;
|
|
191
194
|
}
|
|
192
195
|
const all = flags.all ?? false;
|
|
193
|
-
const maxPages =
|
|
194
|
-
const params = buildListQuery(flags);
|
|
196
|
+
const maxPages = readMaxPagesFlag(flags, out);
|
|
197
|
+
const params = buildListQuery(flags, out);
|
|
195
198
|
try {
|
|
196
199
|
if (all) {
|
|
197
200
|
const fn = (p) => ns.comments.listUserComments(userId, p);
|